Lines Matching refs:card
21 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_state_show() local
22 if (!card) in qeth_dev_state_show()
25 switch (card->state) { in qeth_dev_state_show()
33 if (card->lan_online) in qeth_dev_state_show()
49 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_chpid_show() local
50 if (!card) in qeth_dev_chpid_show()
53 return sprintf(buf, "%02X\n", card->info.chpid); in qeth_dev_chpid_show()
61 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_if_name_show() local
62 if (!card) in qeth_dev_if_name_show()
64 return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card)); in qeth_dev_if_name_show()
72 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_card_type_show() local
73 if (!card) in qeth_dev_card_type_show()
76 return sprintf(buf, "%s\n", qeth_get_cardname_short(card)); in qeth_dev_card_type_show()
81 static inline const char *qeth_get_bufsize_str(struct qeth_card *card) in qeth_get_bufsize_str() argument
83 if (card->qdio.in_buf_size == 16384) in qeth_get_bufsize_str()
85 else if (card->qdio.in_buf_size == 24576) in qeth_get_bufsize_str()
87 else if (card->qdio.in_buf_size == 32768) in qeth_get_bufsize_str()
89 else if (card->qdio.in_buf_size == 40960) in qeth_get_bufsize_str()
98 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_inbuf_size_show() local
99 if (!card) in qeth_dev_inbuf_size_show()
102 return sprintf(buf, "%s\n", qeth_get_bufsize_str(card)); in qeth_dev_inbuf_size_show()
110 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portno_show() local
111 if (!card) in qeth_dev_portno_show()
114 return sprintf(buf, "%i\n", card->info.portno); in qeth_dev_portno_show()
120 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portno_store() local
125 if (!card) in qeth_dev_portno_store()
128 mutex_lock(&card->conf_mutex); in qeth_dev_portno_store()
129 if ((card->state != CARD_STATE_DOWN) && in qeth_dev_portno_store()
130 (card->state != CARD_STATE_RECOVER)) { in qeth_dev_portno_store()
140 limit = (card->ssqd.pcnt ? card->ssqd.pcnt - 1 : card->ssqd.pcnt); in qeth_dev_portno_store()
145 card->info.portno = portno; in qeth_dev_portno_store()
147 mutex_unlock(&card->conf_mutex); in qeth_dev_portno_store()
156 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portname_show() local
159 if (!card) in qeth_dev_portname_show()
162 if (card->info.portname_required) { in qeth_dev_portname_show()
163 memcpy(portname, card->info.portname + 1, 8); in qeth_dev_portname_show()
173 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_portname_store() local
177 if (!card) in qeth_dev_portname_store()
180 mutex_lock(&card->conf_mutex); in qeth_dev_portname_store()
181 if ((card->state != CARD_STATE_DOWN) && in qeth_dev_portname_store()
182 (card->state != CARD_STATE_RECOVER)) { in qeth_dev_portname_store()
193 card->info.portname[0] = strlen(tmp); in qeth_dev_portname_store()
196 card->info.portname[i] = ' '; in qeth_dev_portname_store()
197 strcpy(card->info.portname + 1, tmp); in qeth_dev_portname_store()
198 ASCEBC(card->info.portname + 1, 8); in qeth_dev_portname_store()
200 mutex_unlock(&card->conf_mutex); in qeth_dev_portname_store()
210 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_prioqing_show() local
212 if (!card) in qeth_dev_prioqing_show()
215 switch (card->qdio.do_prio_queueing) { in qeth_dev_prioqing_show()
222 card->qdio.default_out_queue); in qeth_dev_prioqing_show()
229 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_prioqing_store() local
233 if (!card) in qeth_dev_prioqing_store()
236 mutex_lock(&card->conf_mutex); in qeth_dev_prioqing_store()
237 if ((card->state != CARD_STATE_DOWN) && in qeth_dev_prioqing_store()
238 (card->state != CARD_STATE_RECOVER)) { in qeth_dev_prioqing_store()
246 if (card->qdio.no_out_queues == 1) { in qeth_dev_prioqing_store()
247 card->qdio.do_prio_queueing = QETH_PRIOQ_DEFAULT; in qeth_dev_prioqing_store()
254 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_PREC; in qeth_dev_prioqing_store()
256 card->qdio.do_prio_queueing = QETH_PRIO_Q_ING_TOS; in qeth_dev_prioqing_store()
258 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; in qeth_dev_prioqing_store()
259 card->qdio.default_out_queue = 0; in qeth_dev_prioqing_store()
261 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; in qeth_dev_prioqing_store()
262 card->qdio.default_out_queue = 1; in qeth_dev_prioqing_store()
264 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; in qeth_dev_prioqing_store()
265 card->qdio.default_out_queue = 2; in qeth_dev_prioqing_store()
267 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; in qeth_dev_prioqing_store()
268 card->qdio.default_out_queue = 3; in qeth_dev_prioqing_store()
270 card->qdio.do_prio_queueing = QETH_NO_PRIO_QUEUEING; in qeth_dev_prioqing_store()
271 card->qdio.default_out_queue = QETH_DEFAULT_QUEUE; in qeth_dev_prioqing_store()
275 mutex_unlock(&card->conf_mutex); in qeth_dev_prioqing_store()
285 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_bufcnt_show() local
287 if (!card) in qeth_dev_bufcnt_show()
290 return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count); in qeth_dev_bufcnt_show()
296 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_bufcnt_store() local
301 if (!card) in qeth_dev_bufcnt_store()
304 mutex_lock(&card->conf_mutex); in qeth_dev_bufcnt_store()
305 if ((card->state != CARD_STATE_DOWN) && in qeth_dev_bufcnt_store()
306 (card->state != CARD_STATE_RECOVER)) { in qeth_dev_bufcnt_store()
311 old_cnt = card->qdio.in_buf_pool.buf_count; in qeth_dev_bufcnt_store()
316 rc = qeth_realloc_buffer_pool(card, cnt); in qeth_dev_bufcnt_store()
319 mutex_unlock(&card->conf_mutex); in qeth_dev_bufcnt_store()
329 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_recover_store() local
333 if (!card) in qeth_dev_recover_store()
336 if (card->state != CARD_STATE_UP) in qeth_dev_recover_store()
341 qeth_schedule_recovery(card); in qeth_dev_recover_store()
351 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_performance_stats_show() local
353 if (!card) in qeth_dev_performance_stats_show()
356 return sprintf(buf, "%i\n", card->options.performance_stats ? 1:0); in qeth_dev_performance_stats_show()
362 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_performance_stats_store() local
366 if (!card) in qeth_dev_performance_stats_store()
369 mutex_lock(&card->conf_mutex); in qeth_dev_performance_stats_store()
372 if (i == card->options.performance_stats) in qeth_dev_performance_stats_store()
374 card->options.performance_stats = i; in qeth_dev_performance_stats_store()
376 memset(&card->perf_stats, 0, in qeth_dev_performance_stats_store()
378 card->perf_stats.initial_rx_packets = card->stats.rx_packets; in qeth_dev_performance_stats_store()
379 card->perf_stats.initial_tx_packets = card->stats.tx_packets; in qeth_dev_performance_stats_store()
383 mutex_unlock(&card->conf_mutex); in qeth_dev_performance_stats_store()
393 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_layer2_show() local
395 if (!card) in qeth_dev_layer2_show()
398 return sprintf(buf, "%i\n", card->options.layer2); in qeth_dev_layer2_show()
404 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_layer2_store() local
409 if (!card) in qeth_dev_layer2_store()
412 mutex_lock(&card->discipline_mutex); in qeth_dev_layer2_store()
413 if (card->state != CARD_STATE_DOWN) { in qeth_dev_layer2_store()
431 if (card->options.layer2 == newdis) in qeth_dev_layer2_store()
434 card->info.mac_bits = 0; in qeth_dev_layer2_store()
435 if (card->discipline) { in qeth_dev_layer2_store()
436 card->discipline->remove(card->gdev); in qeth_dev_layer2_store()
437 qeth_core_free_discipline(card); in qeth_dev_layer2_store()
441 rc = qeth_core_load_discipline(card, newdis); in qeth_dev_layer2_store()
445 rc = card->discipline->setup(card->gdev); in qeth_dev_layer2_store()
447 mutex_unlock(&card->discipline_mutex); in qeth_dev_layer2_store()
461 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_isolation_show() local
463 if (!card) in qeth_dev_isolation_show()
466 switch (card->options.isolation) { in qeth_dev_isolation_show()
481 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_isolation_store() local
487 if (!card) in qeth_dev_isolation_store()
490 mutex_lock(&card->conf_mutex); in qeth_dev_isolation_store()
492 if (card->info.type != QETH_CARD_TYPE_OSD && in qeth_dev_isolation_store()
493 card->info.type != QETH_CARD_TYPE_OSX && in qeth_dev_isolation_store()
494 card->info.type != QETH_CARD_TYPE_UNKNOWN) { in qeth_dev_isolation_store()
496 dev_err(&card->gdev->dev, "Adapter does not " in qeth_dev_isolation_store()
516 card->options.prev_isolation = card->options.isolation; in qeth_dev_isolation_store()
517 card->options.isolation = isolation; in qeth_dev_isolation_store()
518 if (card->state == CARD_STATE_SOFTSETUP || in qeth_dev_isolation_store()
519 card->state == CARD_STATE_UP) { in qeth_dev_isolation_store()
520 int ipa_rc = qeth_set_access_ctrl_online(card, 1); in qeth_dev_isolation_store()
525 mutex_unlock(&card->conf_mutex); in qeth_dev_isolation_store()
535 struct qeth_card *card = dev_get_drvdata(dev); in qeth_hw_trap_show() local
537 if (!card) in qeth_hw_trap_show()
539 if (card->info.hwtrap) in qeth_hw_trap_show()
548 struct qeth_card *card = dev_get_drvdata(dev); in qeth_hw_trap_store() local
554 if (!card) in qeth_hw_trap_store()
557 mutex_lock(&card->conf_mutex); in qeth_hw_trap_store()
558 if (card->state == CARD_STATE_SOFTSETUP || card->state == CARD_STATE_UP) in qeth_hw_trap_store()
562 if (!strcmp(tmp, "arm") && !card->info.hwtrap) { in qeth_hw_trap_store()
564 if (qeth_is_diagass_supported(card, in qeth_hw_trap_store()
566 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM); in qeth_hw_trap_store()
568 card->info.hwtrap = 1; in qeth_hw_trap_store()
572 card->info.hwtrap = 1; in qeth_hw_trap_store()
573 } else if (!strcmp(tmp, "disarm") && card->info.hwtrap) { in qeth_hw_trap_store()
575 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_hw_trap_store()
577 card->info.hwtrap = 0; in qeth_hw_trap_store()
579 card->info.hwtrap = 0; in qeth_hw_trap_store()
580 } else if (!strcmp(tmp, "trap") && state && card->info.hwtrap) in qeth_hw_trap_store()
581 rc = qeth_hw_trap(card, QETH_DIAGS_TRAP_CAPTURE); in qeth_hw_trap_store()
585 mutex_unlock(&card->conf_mutex); in qeth_hw_trap_store()
592 static ssize_t qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value) in qeth_dev_blkt_show() argument
595 if (!card) in qeth_dev_blkt_show()
601 static ssize_t qeth_dev_blkt_store(struct qeth_card *card, in qeth_dev_blkt_store() argument
607 if (!card) in qeth_dev_blkt_store()
610 mutex_lock(&card->conf_mutex); in qeth_dev_blkt_store()
611 if ((card->state != CARD_STATE_DOWN) && in qeth_dev_blkt_store()
612 (card->state != CARD_STATE_RECOVER)) { in qeth_dev_blkt_store()
622 mutex_unlock(&card->conf_mutex); in qeth_dev_blkt_store()
629 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_total_show() local
631 return qeth_dev_blkt_show(buf, card, card->info.blkt.time_total); in qeth_dev_blkt_total_show()
637 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_total_store() local
639 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_total_store()
640 &card->info.blkt.time_total, 5000); in qeth_dev_blkt_total_store()
651 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_show() local
653 return qeth_dev_blkt_show(buf, card, card->info.blkt.inter_packet); in qeth_dev_blkt_inter_show()
659 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_store() local
661 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_inter_store()
662 &card->info.blkt.inter_packet, 1000); in qeth_dev_blkt_inter_store()
671 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_jumbo_show() local
673 return qeth_dev_blkt_show(buf, card, in qeth_dev_blkt_inter_jumbo_show()
674 card->info.blkt.inter_packet_jumbo); in qeth_dev_blkt_inter_jumbo_show()
680 struct qeth_card *card = dev_get_drvdata(dev); in qeth_dev_blkt_inter_jumbo_store() local
682 return qeth_dev_blkt_store(card, buf, count, in qeth_dev_blkt_inter_jumbo_store()
683 &card->info.blkt.inter_packet_jumbo, 1000); in qeth_dev_blkt_inter_jumbo_store()