Lines Matching full:card
22 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_state_show() local
24 switch (card->state) { in qeth_dev_state_show()
28 if (card->dev->flags & IFF_UP) in qeth_dev_state_show()
30 netif_carrier_ok(card->dev) ? "ONLINE" : in qeth_dev_state_show()
43 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_chpid_show() local
45 return sprintf(buf, "%02X\n", card->info.chpid); in qeth_dev_chpid_show()
53 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_if_name_show() local
55 return sprintf(buf, "%s\n", netdev_name(card->dev)); in qeth_dev_if_name_show()
63 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_card_type_show() local
65 return sprintf(buf, "%s\n", qeth_get_cardname_short(card)); in qeth_dev_card_type_show()
70 static const char *qeth_get_bufsize_str(struct qeth_card *card) in qeth_get_bufsize_str() argument
72 if (card->qdio.in_buf_size == 16384) in qeth_get_bufsize_str()
74 else if (card->qdio.in_buf_size == 24576) in qeth_get_bufsize_str()
76 else if (card->qdio.in_buf_size == 32768) in qeth_get_bufsize_str()
78 else if (card->qdio.in_buf_size == 40960) in qeth_get_bufsize_str()
87 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_inbuf_size_show() local
89 return sprintf(buf, "%s\n", qeth_get_bufsize_str(card)); in qeth_dev_inbuf_size_show()
97 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portno_show() local
99 return sprintf(buf, "%i\n", card->dev->dev_port); in qeth_dev_portno_show()
105 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portno_store() local
115 mutex_lock(&card->conf_mutex); in qeth_dev_portno_store()
116 if (card->state != CARD_STATE_DOWN) { in qeth_dev_portno_store()
121 limit = (card->ssqd.pcnt ? card->ssqd.pcnt - 1 : card->ssqd.pcnt); in qeth_dev_portno_store()
126 card->dev->dev_port = portno; in qeth_dev_portno_store()
128 mutex_unlock(&card->conf_mutex); in qeth_dev_portno_store()
143 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portname_store() local
145 dev_warn_once(&card->gdev->dev, in qeth_dev_portname_store()
156 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_prioqing_show() local
158 switch (card->qdio.do_prio_queueing) { in qeth_dev_prioqing_show()
169 card->qdio.default_out_queue); in qeth_dev_prioqing_show()
178 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_prioqing_store() local
181 if (IS_IQD(card) || IS_VM_NIC(card)) in qeth_dev_prioqing_store()
184 mutex_lock(&card->conf_mutex); in qeth_dev_prioqing_store()
185 if (card->state != CARD_STATE_DOWN) { in qeth_dev_prioqing_store()
193 if (card->qdio.no_out_queues == 1) { in qeth_dev_prioqing_store()
194 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; in qeth_dev_prioqing_store()
200 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC; in qeth_dev_prioqing_store()
201 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; in qeth_dev_prioqing_store()
203 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_SKB; in qeth_dev_prioqing_store()
204 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; in qeth_dev_prioqing_store()
206 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS; in qeth_dev_prioqing_store()
207 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; in qeth_dev_prioqing_store()
209 if (IS_LAYER3(card)) { in qeth_dev_prioqing_store()
213 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_VLAN; in qeth_dev_prioqing_store()
214 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; in qeth_dev_prioqing_store()
216 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED; in qeth_dev_prioqing_store()
217 card->qdio.default_out_queue = 0; in qeth_dev_prioqing_store()
219 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED; in qeth_dev_prioqing_store()
220 card->qdio.default_out_queue = 1; in qeth_dev_prioqing_store()
222 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED; in qeth_dev_prioqing_store()
223 card->qdio.default_out_queue = 2; in qeth_dev_prioqing_store()
225 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_FIXED; in qeth_dev_prioqing_store()
226 card->qdio.default_out_queue = 3; in qeth_dev_prioqing_store()
228 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; in qeth_dev_prioqing_store()
229 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; in qeth_dev_prioqing_store()
233 mutex_unlock(&card->conf_mutex); in qeth_dev_prioqing_store()
243 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_bufcnt_show() local
245 return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count); in qeth_dev_bufcnt_show()
251 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_bufcnt_store() local
259 mutex_lock(&card->conf_mutex); in qeth_dev_bufcnt_store()
260 if (card->state != CARD_STATE_DOWN) { in qeth_dev_bufcnt_store()
266 rc = qeth_resize_buffer_pool(card, cnt); in qeth_dev_bufcnt_store()
269 mutex_unlock(&card->conf_mutex); in qeth_dev_bufcnt_store()
279 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_recover_store() local
287 if (!qeth_card_hw_is_reachable(card)) in qeth_dev_recover_store()
291 rc = qeth_schedule_recovery(card); in qeth_dev_recover_store()
307 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_performance_stats_store() local
318 memset(&card->stats, 0, sizeof(card->stats)); in qeth_dev_performance_stats_store()
319 for (i = 0; i < card->qdio.no_out_queues; i++) { in qeth_dev_performance_stats_store()
320 queue = card->qdio.out_qs[i]; in qeth_dev_performance_stats_store()
336 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_layer2_show() local
338 return sprintf(buf, "%i\n", card->options.layer); in qeth_dev_layer2_show()
344 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_layer2_store() local
365 mutex_lock(&card->discipline_mutex); in qeth_dev_layer2_store()
366 if (card->state != CARD_STATE_DOWN) { in qeth_dev_layer2_store()
371 if (card->options.layer == newdis) in qeth_dev_layer2_store()
373 if (card->info.layer_enforced) { in qeth_dev_layer2_store()
379 if (card->discipline) { in qeth_dev_layer2_store()
381 ndev = qeth_clone_netdev(card->dev); in qeth_dev_layer2_store()
387 card->discipline->remove(card->gdev); in qeth_dev_layer2_store()
388 qeth_core_free_discipline(card); in qeth_dev_layer2_store()
389 free_netdev(card->dev); in qeth_dev_layer2_store()
390 card->dev = ndev; in qeth_dev_layer2_store()
393 rc = qeth_core_load_discipline(card, newdis); in qeth_dev_layer2_store()
397 rc = card->discipline->setup(card->gdev); in qeth_dev_layer2_store()
399 qeth_core_free_discipline(card); in qeth_dev_layer2_store()
401 mutex_unlock(&card->discipline_mutex); in qeth_dev_layer2_store()
415 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_isolation_show() local
417 switch (card->options.isolation) { in qeth_dev_isolation_show()
432 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_isolation_store() local
436 mutex_lock(&card->conf_mutex); in qeth_dev_isolation_store()
437 if (!IS_OSD(card) && !IS_OSX(card)) { in qeth_dev_isolation_store()
439 dev_err(&card->gdev->dev, "Adapter does not " in qeth_dev_isolation_store()
456 if (qeth_card_hw_is_reachable(card)) in qeth_dev_isolation_store()
457 rc = qeth_setadpparms_set_access_ctrl(card, isolation); in qeth_dev_isolation_store()
460 WRITE_ONCE(card->options.isolation, isolation); in qeth_dev_isolation_store()
463 mutex_unlock(&card->conf_mutex); in qeth_dev_isolation_store()
474 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_switch_attrs_show() local
478 if (!qeth_card_hw_is_reachable(card)) in qeth_dev_switch_attrs_show()
481 rc = qeth_query_switch_attributes(card, &sw_info); in qeth_dev_switch_attrs_show()
506 struct qeth_card *card = dev_get_drvdata(dev); in qeth_hw_trap_show() local
508 if (card->info.hwtrap) in qeth_hw_trap_show()
517 struct qeth_card *card = dev_get_drvdata(dev); in qeth_hw_trap_store() local
521 mutex_lock(&card->conf_mutex); in qeth_hw_trap_store()
522 if (qeth_card_hw_is_reachable(card)) in qeth_hw_trap_store()
525 if (sysfs_streq(buf, "arm") && !card->info.hwtrap) { in qeth_hw_trap_store()
527 if (qeth_is_diagass_supported(card, in qeth_hw_trap_store()
529 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM); in qeth_hw_trap_store()
531 card->info.hwtrap = 1; in qeth_hw_trap_store()
535 card->info.hwtrap = 1; in qeth_hw_trap_store()
536 } else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) { in qeth_hw_trap_store()
538 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_hw_trap_store()
540 card->info.hwtrap = 0; in qeth_hw_trap_store()
542 card->info.hwtrap = 0; in qeth_hw_trap_store()
543 } else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap) in qeth_hw_trap_store()
544 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE); in qeth_hw_trap_store()
548 mutex_unlock(&card->conf_mutex); in qeth_hw_trap_store()
555 static ssize_t qeth_dev_blkt_store(struct qeth_card *card, in qeth_dev_blkt_store() argument
568 mutex_lock(&card->conf_mutex); in qeth_dev_blkt_store()
569 if (card->state != CARD_STATE_DOWN) in qeth_dev_blkt_store()
573 mutex_unlock(&card->conf_mutex); in qeth_dev_blkt_store()
580 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_total_show() local
582 return sprintf(buf, "%i\n", card->info.blkt.time_total); in qeth_dev_blkt_total_show()
588 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_total_store() local
590 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_total_store()
591 &card->info.blkt.time_total, 5000); in qeth_dev_blkt_total_store()
600 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_show() local
602 return sprintf(buf, "%i\n", card->info.blkt.inter_packet); in qeth_dev_blkt_inter_show()
608 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_store() local
610 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_inter_store()
611 &card->info.blkt.inter_packet, 1000); in qeth_dev_blkt_inter_store()
620 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_jumbo_show() local
622 return sprintf(buf, "%i\n", card->info.blkt.inter_packet_jumbo); in qeth_dev_blkt_inter_jumbo_show()
628 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_jumbo_store() local
630 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_inter_jumbo_store()
631 &card->info.blkt.inter_packet_jumbo, 1000); in qeth_dev_blkt_inter_jumbo_store()