Lines Matching refs:card

16 static ssize_t qeth_l3_dev_route_show(struct qeth_card *card,  in qeth_l3_dev_route_show()  argument
25 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) in qeth_l3_dev_route_show()
30 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) in qeth_l3_dev_route_show()
35 if (card->info.broadcast_capable == QETH_BROADCAST_WITHOUT_ECHO) in qeth_l3_dev_route_show()
47 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_route4_show() local
49 if (!card) in qeth_l3_dev_route4_show()
52 return qeth_l3_dev_route_show(card, &card->options.route4, buf); in qeth_l3_dev_route4_show()
55 static ssize_t qeth_l3_dev_route_store(struct qeth_card *card, in qeth_l3_dev_route_store() argument
62 mutex_lock(&card->conf_mutex); in qeth_l3_dev_route_store()
79 if (qeth_card_hw_is_reachable(card) && in qeth_l3_dev_route_store()
82 rc = qeth_l3_setrouting_v4(card); in qeth_l3_dev_route_store()
84 rc = qeth_l3_setrouting_v6(card); in qeth_l3_dev_route_store()
89 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_route_store()
96 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_route4_store() local
98 if (!card) in qeth_l3_dev_route4_store()
101 return qeth_l3_dev_route_store(card, &card->options.route4, in qeth_l3_dev_route4_store()
111 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_route6_show() local
113 if (!card) in qeth_l3_dev_route6_show()
116 return qeth_l3_dev_route_show(card, &card->options.route6, buf); in qeth_l3_dev_route6_show()
122 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_route6_store() local
124 if (!card) in qeth_l3_dev_route6_store()
127 return qeth_l3_dev_route_store(card, &card->options.route6, in qeth_l3_dev_route6_store()
137 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_fake_broadcast_show() local
139 if (!card) in qeth_l3_dev_fake_broadcast_show()
142 return sprintf(buf, "%i\n", card->options.fake_broadcast? 1:0); in qeth_l3_dev_fake_broadcast_show()
148 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_fake_broadcast_store() local
152 if (!card) in qeth_l3_dev_fake_broadcast_store()
155 mutex_lock(&card->conf_mutex); in qeth_l3_dev_fake_broadcast_store()
156 if ((card->state != CARD_STATE_DOWN) && in qeth_l3_dev_fake_broadcast_store()
157 (card->state != CARD_STATE_RECOVER)) { in qeth_l3_dev_fake_broadcast_store()
164 card->options.fake_broadcast = i; in qeth_l3_dev_fake_broadcast_store()
168 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_fake_broadcast_store()
178 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_sniffer_show() local
180 if (!card) in qeth_l3_dev_sniffer_show()
183 return sprintf(buf, "%i\n", card->options.sniffer ? 1 : 0); in qeth_l3_dev_sniffer_show()
189 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_sniffer_store() local
193 if (!card) in qeth_l3_dev_sniffer_store()
196 if (card->info.type != QETH_CARD_TYPE_IQD) in qeth_l3_dev_sniffer_store()
198 if (card->options.cq == QETH_CQ_ENABLED) in qeth_l3_dev_sniffer_store()
201 mutex_lock(&card->conf_mutex); in qeth_l3_dev_sniffer_store()
202 if ((card->state != CARD_STATE_DOWN) && in qeth_l3_dev_sniffer_store()
203 (card->state != CARD_STATE_RECOVER)) { in qeth_l3_dev_sniffer_store()
215 card->options.sniffer = i; in qeth_l3_dev_sniffer_store()
218 qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd); in qeth_l3_dev_sniffer_store()
219 if (card->ssqd.qdioac2 & QETH_SNIFF_AVAIL) { in qeth_l3_dev_sniffer_store()
220 card->options.sniffer = i; in qeth_l3_dev_sniffer_store()
221 if (card->qdio.init_pool.buf_count != in qeth_l3_dev_sniffer_store()
223 qeth_realloc_buffer_pool(card, in qeth_l3_dev_sniffer_store()
232 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_sniffer_store()
243 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_hsuid_show() local
246 if (!card) in qeth_l3_dev_hsuid_show()
249 if (card->info.type != QETH_CARD_TYPE_IQD) in qeth_l3_dev_hsuid_show()
252 if (card->state == CARD_STATE_DOWN) in qeth_l3_dev_hsuid_show()
255 memcpy(tmp_hsuid, card->options.hsuid, sizeof(tmp_hsuid)); in qeth_l3_dev_hsuid_show()
263 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_hsuid_store() local
268 if (!card) in qeth_l3_dev_hsuid_store()
271 if (card->info.type != QETH_CARD_TYPE_IQD) in qeth_l3_dev_hsuid_store()
273 if (card->state != CARD_STATE_DOWN && in qeth_l3_dev_hsuid_store()
274 card->state != CARD_STATE_RECOVER) in qeth_l3_dev_hsuid_store()
276 if (card->options.sniffer) in qeth_l3_dev_hsuid_store()
278 if (card->options.cq == QETH_CQ_NOTAVAILABLE) in qeth_l3_dev_hsuid_store()
285 if (card->options.hsuid[0]) { in qeth_l3_dev_hsuid_store()
293 card->options.hsuid[i - 8]; in qeth_l3_dev_hsuid_store()
298 if (!qeth_l3_delete_ip(card, addr)) in qeth_l3_dev_hsuid_store()
300 qeth_l3_set_ip_addr_list(card); in qeth_l3_dev_hsuid_store()
305 card->options.hsuid[0] = '\0'; in qeth_l3_dev_hsuid_store()
306 if (card->dev) in qeth_l3_dev_hsuid_store()
307 memcpy(card->dev->perm_addr, card->options.hsuid, 9); in qeth_l3_dev_hsuid_store()
308 qeth_configure_cq(card, QETH_CQ_DISABLED); in qeth_l3_dev_hsuid_store()
312 if (qeth_configure_cq(card, QETH_CQ_ENABLED)) in qeth_l3_dev_hsuid_store()
315 snprintf(card->options.hsuid, sizeof(card->options.hsuid), in qeth_l3_dev_hsuid_store()
317 ASCEBC(card->options.hsuid, 8); in qeth_l3_dev_hsuid_store()
318 if (card->dev) in qeth_l3_dev_hsuid_store()
319 memcpy(card->dev->perm_addr, card->options.hsuid, 9); in qeth_l3_dev_hsuid_store()
326 addr->u.a6.addr.s6_addr[i] = card->options.hsuid[i - 8]; in qeth_l3_dev_hsuid_store()
331 if (!qeth_l3_add_ip(card, addr)) in qeth_l3_dev_hsuid_store()
333 qeth_l3_set_ip_addr_list(card); in qeth_l3_dev_hsuid_store()
358 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_enable_show() local
360 if (!card) in qeth_l3_dev_ipato_enable_show()
363 return sprintf(buf, "%i\n", card->ipato.enabled? 1:0); in qeth_l3_dev_ipato_enable_show()
369 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_enable_store() local
373 if (!card) in qeth_l3_dev_ipato_enable_store()
376 mutex_lock(&card->conf_mutex); in qeth_l3_dev_ipato_enable_store()
377 if ((card->state != CARD_STATE_DOWN) && in qeth_l3_dev_ipato_enable_store()
378 (card->state != CARD_STATE_RECOVER)) { in qeth_l3_dev_ipato_enable_store()
384 card->ipato.enabled = (card->ipato.enabled)? 0 : 1; in qeth_l3_dev_ipato_enable_store()
386 card->ipato.enabled = 1; in qeth_l3_dev_ipato_enable_store()
387 list_for_each_entry_safe(tmpipa, t, card->ip_tbd_list, entry) { in qeth_l3_dev_ipato_enable_store()
389 qeth_l3_is_addr_covered_by_ipato(card, tmpipa)) in qeth_l3_dev_ipato_enable_store()
395 card->ipato.enabled = 0; in qeth_l3_dev_ipato_enable_store()
396 list_for_each_entry_safe(tmpipa, t, card->ip_tbd_list, entry) { in qeth_l3_dev_ipato_enable_store()
405 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_ipato_enable_store()
416 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_invert4_show() local
418 if (!card) in qeth_l3_dev_ipato_invert4_show()
421 return sprintf(buf, "%i\n", card->ipato.invert4? 1:0); in qeth_l3_dev_ipato_invert4_show()
428 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_invert4_store() local
431 if (!card) in qeth_l3_dev_ipato_invert4_store()
434 mutex_lock(&card->conf_mutex); in qeth_l3_dev_ipato_invert4_store()
436 card->ipato.invert4 = (card->ipato.invert4)? 0 : 1; in qeth_l3_dev_ipato_invert4_store()
438 card->ipato.invert4 = 1; in qeth_l3_dev_ipato_invert4_store()
440 card->ipato.invert4 = 0; in qeth_l3_dev_ipato_invert4_store()
443 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_ipato_invert4_store()
451 static ssize_t qeth_l3_dev_ipato_add_show(char *buf, struct qeth_card *card, in qeth_l3_dev_ipato_add_show() argument
463 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_dev_ipato_add_show()
464 list_for_each_entry(ipatoe, &card->ipato.entries, entry) { in qeth_l3_dev_ipato_add_show()
476 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_dev_ipato_add_show()
485 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_add4_show() local
487 if (!card) in qeth_l3_dev_ipato_add4_show()
490 return qeth_l3_dev_ipato_add_show(buf, card, QETH_PROT_IPV4); in qeth_l3_dev_ipato_add4_show()
521 struct qeth_card *card, enum qeth_prot_versions proto) in qeth_l3_dev_ipato_add_store() argument
528 mutex_lock(&card->conf_mutex); in qeth_l3_dev_ipato_add_store()
542 rc = qeth_l3_add_ipato_entry(card, ipatoe); in qeth_l3_dev_ipato_add_store()
546 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_ipato_add_store()
553 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_add4_store() local
555 if (!card) in qeth_l3_dev_ipato_add4_store()
558 return qeth_l3_dev_ipato_add_store(buf, count, card, QETH_PROT_IPV4); in qeth_l3_dev_ipato_add4_store()
566 struct qeth_card *card, enum qeth_prot_versions proto) in qeth_l3_dev_ipato_del_store() argument
572 mutex_lock(&card->conf_mutex); in qeth_l3_dev_ipato_del_store()
575 qeth_l3_del_ipato_entry(card, proto, addr, mask_bits); in qeth_l3_dev_ipato_del_store()
576 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_ipato_del_store()
583 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_del4_store() local
585 if (!card) in qeth_l3_dev_ipato_del4_store()
588 return qeth_l3_dev_ipato_del_store(buf, count, card, QETH_PROT_IPV4); in qeth_l3_dev_ipato_del4_store()
597 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_invert6_show() local
599 if (!card) in qeth_l3_dev_ipato_invert6_show()
602 return sprintf(buf, "%i\n", card->ipato.invert6? 1:0); in qeth_l3_dev_ipato_invert6_show()
608 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_invert6_store() local
611 if (!card) in qeth_l3_dev_ipato_invert6_store()
614 mutex_lock(&card->conf_mutex); in qeth_l3_dev_ipato_invert6_store()
616 card->ipato.invert6 = (card->ipato.invert6)? 0 : 1; in qeth_l3_dev_ipato_invert6_store()
618 card->ipato.invert6 = 1; in qeth_l3_dev_ipato_invert6_store()
620 card->ipato.invert6 = 0; in qeth_l3_dev_ipato_invert6_store()
623 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_ipato_invert6_store()
635 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_add6_show() local
637 if (!card) in qeth_l3_dev_ipato_add6_show()
640 return qeth_l3_dev_ipato_add_show(buf, card, QETH_PROT_IPV6); in qeth_l3_dev_ipato_add6_show()
646 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_add6_store() local
648 if (!card) in qeth_l3_dev_ipato_add6_store()
651 return qeth_l3_dev_ipato_add_store(buf, count, card, QETH_PROT_IPV6); in qeth_l3_dev_ipato_add6_store()
661 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_ipato_del6_store() local
663 if (!card) in qeth_l3_dev_ipato_del6_store()
666 return qeth_l3_dev_ipato_del_store(buf, count, card, QETH_PROT_IPV6); in qeth_l3_dev_ipato_del6_store()
688 static ssize_t qeth_l3_dev_vipa_add_show(char *buf, struct qeth_card *card, in qeth_l3_dev_vipa_add_show() argument
699 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_dev_vipa_add_show()
700 list_for_each_entry(ipaddr, &card->ip_list, entry) { in qeth_l3_dev_vipa_add_show()
714 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_dev_vipa_add_show()
723 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_vipa_add4_show() local
725 if (!card) in qeth_l3_dev_vipa_add4_show()
728 return qeth_l3_dev_vipa_add_show(buf, card, QETH_PROT_IPV4); in qeth_l3_dev_vipa_add4_show()
741 struct qeth_card *card, enum qeth_prot_versions proto) in qeth_l3_dev_vipa_add_store() argument
746 mutex_lock(&card->conf_mutex); in qeth_l3_dev_vipa_add_store()
749 rc = qeth_l3_add_vipa(card, proto, addr); in qeth_l3_dev_vipa_add_store()
750 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_vipa_add_store()
757 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_vipa_add4_store() local
759 if (!card) in qeth_l3_dev_vipa_add4_store()
762 return qeth_l3_dev_vipa_add_store(buf, count, card, QETH_PROT_IPV4); in qeth_l3_dev_vipa_add4_store()
770 struct qeth_card *card, enum qeth_prot_versions proto) in qeth_l3_dev_vipa_del_store() argument
775 mutex_lock(&card->conf_mutex); in qeth_l3_dev_vipa_del_store()
778 qeth_l3_del_vipa(card, proto, addr); in qeth_l3_dev_vipa_del_store()
779 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_vipa_del_store()
786 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_vipa_del4_store() local
788 if (!card) in qeth_l3_dev_vipa_del4_store()
791 return qeth_l3_dev_vipa_del_store(buf, count, card, QETH_PROT_IPV4); in qeth_l3_dev_vipa_del4_store()
800 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_vipa_add6_show() local
802 if (!card) in qeth_l3_dev_vipa_add6_show()
805 return qeth_l3_dev_vipa_add_show(buf, card, QETH_PROT_IPV6); in qeth_l3_dev_vipa_add6_show()
811 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_vipa_add6_store() local
813 if (!card) in qeth_l3_dev_vipa_add6_store()
816 return qeth_l3_dev_vipa_add_store(buf, count, card, QETH_PROT_IPV6); in qeth_l3_dev_vipa_add6_store()
826 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_vipa_del6_store() local
828 if (!card) in qeth_l3_dev_vipa_del6_store()
831 return qeth_l3_dev_vipa_del_store(buf, count, card, QETH_PROT_IPV6); in qeth_l3_dev_vipa_del6_store()
850 static ssize_t qeth_l3_dev_rxip_add_show(char *buf, struct qeth_card *card, in qeth_l3_dev_rxip_add_show() argument
861 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_dev_rxip_add_show()
862 list_for_each_entry(ipaddr, &card->ip_list, entry) { in qeth_l3_dev_rxip_add_show()
876 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_dev_rxip_add_show()
885 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_rxip_add4_show() local
887 if (!card) in qeth_l3_dev_rxip_add4_show()
890 return qeth_l3_dev_rxip_add_show(buf, card, QETH_PROT_IPV4); in qeth_l3_dev_rxip_add4_show()
903 struct qeth_card *card, enum qeth_prot_versions proto) in qeth_l3_dev_rxip_add_store() argument
908 mutex_lock(&card->conf_mutex); in qeth_l3_dev_rxip_add_store()
911 rc = qeth_l3_add_rxip(card, proto, addr); in qeth_l3_dev_rxip_add_store()
912 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_rxip_add_store()
919 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_rxip_add4_store() local
921 if (!card) in qeth_l3_dev_rxip_add4_store()
924 return qeth_l3_dev_rxip_add_store(buf, count, card, QETH_PROT_IPV4); in qeth_l3_dev_rxip_add4_store()
932 struct qeth_card *card, enum qeth_prot_versions proto) in qeth_l3_dev_rxip_del_store() argument
937 mutex_lock(&card->conf_mutex); in qeth_l3_dev_rxip_del_store()
940 qeth_l3_del_rxip(card, proto, addr); in qeth_l3_dev_rxip_del_store()
941 mutex_unlock(&card->conf_mutex); in qeth_l3_dev_rxip_del_store()
948 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_rxip_del4_store() local
950 if (!card) in qeth_l3_dev_rxip_del4_store()
953 return qeth_l3_dev_rxip_del_store(buf, count, card, QETH_PROT_IPV4); in qeth_l3_dev_rxip_del4_store()
962 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_rxip_add6_show() local
964 if (!card) in qeth_l3_dev_rxip_add6_show()
967 return qeth_l3_dev_rxip_add_show(buf, card, QETH_PROT_IPV6); in qeth_l3_dev_rxip_add6_show()
973 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_rxip_add6_store() local
975 if (!card) in qeth_l3_dev_rxip_add6_store()
978 return qeth_l3_dev_rxip_add_store(buf, count, card, QETH_PROT_IPV6); in qeth_l3_dev_rxip_add6_store()
988 struct qeth_card *card = dev_get_drvdata(dev); in qeth_l3_dev_rxip_del6_store() local
990 if (!card) in qeth_l3_dev_rxip_del6_store()
993 return qeth_l3_dev_rxip_del_store(buf, count, card, QETH_PROT_IPV6); in qeth_l3_dev_rxip_del6_store()