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) ? in qeth_dev_state_show()
43 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_chpid_show() local
45 return sysfs_emit(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 sysfs_emit(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 sysfs_emit(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 sysfs_emit(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 sysfs_emit(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 sysfs_emit(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 sysfs_emit(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 qeth_remove_discipline(card); in qeth_dev_layer2_store()
388 free_netdev(card->dev); in qeth_dev_layer2_store()
389 card->dev = ndev; in qeth_dev_layer2_store()
392 rc = qeth_setup_discipline(card, newdis); in qeth_dev_layer2_store()
395 mutex_unlock(&card->discipline_mutex); in qeth_dev_layer2_store()
409 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_isolation_show() local
411 switch (card->options.isolation) { in qeth_dev_isolation_show()
426 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_isolation_store() local
430 mutex_lock(&card->conf_mutex); in qeth_dev_isolation_store()
431 if (!IS_OSD(card) && !IS_OSX(card)) { in qeth_dev_isolation_store()
433 dev_err(&card->gdev->dev, "Adapter does not " in qeth_dev_isolation_store()
450 if (qeth_card_hw_is_reachable(card)) in qeth_dev_isolation_store()
451 rc = qeth_setadpparms_set_access_ctrl(card, isolation); in qeth_dev_isolation_store()
454 WRITE_ONCE(card->options.isolation, isolation); in qeth_dev_isolation_store()
457 mutex_unlock(&card->conf_mutex); in qeth_dev_isolation_store()
468 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_switch_attrs_show() local
472 if (!qeth_card_hw_is_reachable(card)) in qeth_dev_switch_attrs_show()
475 rc = qeth_query_switch_attributes(card, &sw_info); in qeth_dev_switch_attrs_show()
502 struct qeth_card *card = dev_get_drvdata(dev); in qeth_hw_trap_show() local
504 if (card->info.hwtrap) in qeth_hw_trap_show()
513 struct qeth_card *card = dev_get_drvdata(dev); in qeth_hw_trap_store() local
517 mutex_lock(&card->conf_mutex); in qeth_hw_trap_store()
518 if (qeth_card_hw_is_reachable(card)) in qeth_hw_trap_store()
521 if (sysfs_streq(buf, "arm") && !card->info.hwtrap) { in qeth_hw_trap_store()
523 if (qeth_is_diagass_supported(card, in qeth_hw_trap_store()
525 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM); in qeth_hw_trap_store()
527 card->info.hwtrap = 1; in qeth_hw_trap_store()
531 card->info.hwtrap = 1; in qeth_hw_trap_store()
532 } else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) { in qeth_hw_trap_store()
534 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_hw_trap_store()
536 card->info.hwtrap = 0; in qeth_hw_trap_store()
538 card->info.hwtrap = 0; in qeth_hw_trap_store()
539 } else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap) in qeth_hw_trap_store()
540 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE); in qeth_hw_trap_store()
544 mutex_unlock(&card->conf_mutex); in qeth_hw_trap_store()
551 static ssize_t qeth_dev_blkt_store(struct qeth_card *card, in qeth_dev_blkt_store() argument
564 mutex_lock(&card->conf_mutex); in qeth_dev_blkt_store()
565 if (card->state != CARD_STATE_DOWN) in qeth_dev_blkt_store()
569 mutex_unlock(&card->conf_mutex); in qeth_dev_blkt_store()
576 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_total_show() local
578 return sysfs_emit(buf, "%i\n", card->info.blkt.time_total); in qeth_dev_blkt_total_show()
584 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_total_store() local
586 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_total_store()
587 &card->info.blkt.time_total, 5000); in qeth_dev_blkt_total_store()
596 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_show() local
598 return sysfs_emit(buf, "%i\n", card->info.blkt.inter_packet); in qeth_dev_blkt_inter_show()
604 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_store() local
606 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_inter_store()
607 &card->info.blkt.inter_packet, 1000); in qeth_dev_blkt_inter_store()
616 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_jumbo_show() local
618 return sysfs_emit(buf, "%i\n", card->info.blkt.inter_packet_jumbo); in qeth_dev_blkt_inter_jumbo_show()
624 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_jumbo_store() local
626 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_inter_jumbo_store()
627 &card->info.blkt.inter_packet_jumbo, 1000); in qeth_dev_blkt_inter_jumbo_store()