Lines Matching refs:card
170 int qeth_l3_is_addr_covered_by_ipato(struct qeth_card *card, in qeth_l3_is_addr_covered_by_ipato() argument
178 if (!card->ipato.enabled) in qeth_l3_is_addr_covered_by_ipato()
183 list_for_each_entry(ipatoe, &card->ipato.entries, entry) { in qeth_l3_is_addr_covered_by_ipato()
199 if ((addr->proto == QETH_PROT_IPV4) && card->ipato.invert4) in qeth_l3_is_addr_covered_by_ipato()
201 else if ((addr->proto == QETH_PROT_IPV6) && card->ipato.invert6) in qeth_l3_is_addr_covered_by_ipato()
212 static int __qeth_l3_insert_ip_todo(struct qeth_card *card, in __qeth_l3_insert_ip_todo() argument
218 if (card->options.sniffer) in __qeth_l3_insert_ip_todo()
220 list_for_each_entry_safe(tmp, t, card->ip_tbd_list, entry) { in __qeth_l3_insert_ip_todo()
256 list_add(&addr->entry, card->ip_tbd_list); in __qeth_l3_insert_ip_todo()
261 qeth_l3_is_addr_covered_by_ipato(card, addr)) { in __qeth_l3_insert_ip_todo()
262 QETH_CARD_TEXT(card, 2, "tkovaddr"); in __qeth_l3_insert_ip_todo()
265 list_add_tail(&addr->entry, card->ip_tbd_list); in __qeth_l3_insert_ip_todo()
271 int qeth_l3_delete_ip(struct qeth_card *card, struct qeth_ipaddr *addr) in qeth_l3_delete_ip() argument
276 QETH_CARD_TEXT(card, 4, "delip"); in qeth_l3_delete_ip()
279 QETH_CARD_HEX(card, 4, &addr->u.a4.addr, 4); in qeth_l3_delete_ip()
281 QETH_CARD_HEX(card, 4, &addr->u.a6.addr, 8); in qeth_l3_delete_ip()
282 QETH_CARD_HEX(card, 4, ((char *)&addr->u.a6.addr) + 8, 8); in qeth_l3_delete_ip()
284 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_delete_ip()
285 rc = __qeth_l3_insert_ip_todo(card, addr, 0); in qeth_l3_delete_ip()
286 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_delete_ip()
290 int qeth_l3_add_ip(struct qeth_card *card, struct qeth_ipaddr *addr) in qeth_l3_add_ip() argument
295 QETH_CARD_TEXT(card, 4, "addip"); in qeth_l3_add_ip()
297 QETH_CARD_HEX(card, 4, &addr->u.a4.addr, 4); in qeth_l3_add_ip()
299 QETH_CARD_HEX(card, 4, &addr->u.a6.addr, 8); in qeth_l3_add_ip()
300 QETH_CARD_HEX(card, 4, ((char *)&addr->u.a6.addr) + 8, 8); in qeth_l3_add_ip()
302 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_add_ip()
303 rc = __qeth_l3_insert_ip_todo(card, addr, 1); in qeth_l3_add_ip()
304 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_add_ip()
323 static void qeth_l3_delete_mc_addresses(struct qeth_card *card) in qeth_l3_delete_mc_addresses() argument
328 QETH_CARD_TEXT(card, 4, "delmc"); in qeth_l3_delete_mc_addresses()
331 QETH_CARD_TEXT(card, 2, "dmcnomem"); in qeth_l3_delete_mc_addresses()
335 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_delete_mc_addresses()
336 if (!__qeth_l3_insert_ip_todo(card, iptodo, 0)) in qeth_l3_delete_mc_addresses()
338 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_delete_mc_addresses()
354 static int __qeth_l3_ref_ip_on_card(struct qeth_card *card, in __qeth_l3_ref_ip_on_card() argument
360 list_for_each_entry(addr, &card->ip_list, entry) { in __qeth_l3_ref_ip_on_card()
400 static void __qeth_l3_delete_all_mc(struct qeth_card *card, in __qeth_l3_delete_all_mc() argument
409 list_for_each_entry_safe(addr, tmp, &card->ip_list, entry) { in __qeth_l3_delete_all_mc()
412 spin_unlock_irqrestore(&card->ip_lock, *flags); in __qeth_l3_delete_all_mc()
413 rc = qeth_l3_deregister_addr_entry(card, addr); in __qeth_l3_delete_all_mc()
414 spin_lock_irqsave(&card->ip_lock, *flags); in __qeth_l3_delete_all_mc()
422 list_splice(&fail_list, &card->ip_list); in __qeth_l3_delete_all_mc()
425 void qeth_l3_set_ip_addr_list(struct qeth_card *card) in qeth_l3_set_ip_addr_list() argument
432 QETH_CARD_TEXT(card, 2, "sdiplist"); in qeth_l3_set_ip_addr_list()
433 QETH_CARD_HEX(card, 2, &card, sizeof(void *)); in qeth_l3_set_ip_addr_list()
435 if ((card->state != CARD_STATE_UP && in qeth_l3_set_ip_addr_list()
436 card->state != CARD_STATE_SOFTSETUP) || card->options.sniffer) { in qeth_l3_set_ip_addr_list()
440 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
441 tbd_list = card->ip_tbd_list; in qeth_l3_set_ip_addr_list()
442 card->ip_tbd_list = kzalloc(sizeof(struct list_head), GFP_ATOMIC); in qeth_l3_set_ip_addr_list()
443 if (!card->ip_tbd_list) { in qeth_l3_set_ip_addr_list()
444 QETH_CARD_TEXT(card, 0, "silnomem"); in qeth_l3_set_ip_addr_list()
445 card->ip_tbd_list = tbd_list; in qeth_l3_set_ip_addr_list()
446 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
449 INIT_LIST_HEAD(card->ip_tbd_list); in qeth_l3_set_ip_addr_list()
455 __qeth_l3_delete_all_mc(card, &flags); in qeth_l3_set_ip_addr_list()
459 rc = __qeth_l3_ref_ip_on_card(card, todo, &addr); in qeth_l3_set_ip_addr_list()
465 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
466 rc = qeth_l3_register_addr_entry(card, todo); in qeth_l3_set_ip_addr_list()
467 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
469 list_add_tail(&todo->entry, &card->ip_list); in qeth_l3_set_ip_addr_list()
475 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
476 rc = qeth_l3_deregister_addr_entry(card, addr); in qeth_l3_set_ip_addr_list()
477 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
481 list_add_tail(&addr->entry, &card->ip_list); in qeth_l3_set_ip_addr_list()
485 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_set_ip_addr_list()
489 static void qeth_l3_clear_ip_list(struct qeth_card *card, int recover) in qeth_l3_clear_ip_list() argument
494 QETH_CARD_TEXT(card, 4, "clearip"); in qeth_l3_clear_ip_list()
495 if (recover && card->options.sniffer) in qeth_l3_clear_ip_list()
497 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_clear_ip_list()
499 list_for_each_entry_safe(addr, tmp, card->ip_tbd_list, entry) { in qeth_l3_clear_ip_list()
504 while (!list_empty(&card->ip_list)) { in qeth_l3_clear_ip_list()
505 addr = list_entry(card->ip_list.next, in qeth_l3_clear_ip_list()
512 list_add_tail(&addr->entry, card->ip_tbd_list); in qeth_l3_clear_ip_list()
514 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_clear_ip_list()
542 static int qeth_l3_send_setdelmc(struct qeth_card *card, in qeth_l3_send_setdelmc() argument
549 QETH_CARD_TEXT(card, 4, "setdelmc"); in qeth_l3_send_setdelmc()
551 iob = qeth_get_ipacmd_buffer(card, ipacmd, addr->proto); in qeth_l3_send_setdelmc()
560 rc = qeth_send_ipa_cmd(card, iob, NULL, NULL); in qeth_l3_send_setdelmc()
579 static int qeth_l3_send_setdelip(struct qeth_card *card, in qeth_l3_send_setdelip() argument
587 QETH_CARD_TEXT(card, 4, "setdelip"); in qeth_l3_send_setdelip()
588 QETH_CARD_TEXT_(card, 4, "flags%02X", flags); in qeth_l3_send_setdelip()
590 iob = qeth_get_ipacmd_buffer(card, ipacmd, addr->proto); in qeth_l3_send_setdelip()
605 rc = qeth_send_ipa_cmd(card, iob, NULL, NULL); in qeth_l3_send_setdelip()
610 static int qeth_l3_send_setrouting(struct qeth_card *card, in qeth_l3_send_setrouting() argument
617 QETH_CARD_TEXT(card, 4, "setroutg"); in qeth_l3_send_setrouting()
618 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETRTG, prot); in qeth_l3_send_setrouting()
621 rc = qeth_send_ipa_cmd(card, iob, NULL, NULL); in qeth_l3_send_setrouting()
626 static int qeth_l3_correct_routing_type(struct qeth_card *card, in qeth_l3_correct_routing_type() argument
629 if (card->info.type == QETH_CARD_TYPE_IQD) { in qeth_l3_correct_routing_type()
646 if (qeth_is_ipafunc_supported(card, prot, in qeth_l3_correct_routing_type()
658 int qeth_l3_setrouting_v4(struct qeth_card *card) in qeth_l3_setrouting_v4() argument
662 QETH_CARD_TEXT(card, 3, "setrtg4"); in qeth_l3_setrouting_v4()
664 rc = qeth_l3_correct_routing_type(card, &card->options.route4.type, in qeth_l3_setrouting_v4()
669 rc = qeth_l3_send_setrouting(card, card->options.route4.type, in qeth_l3_setrouting_v4()
672 card->options.route4.type = NO_ROUTER; in qeth_l3_setrouting_v4()
675 QETH_CARD_IFNAME(card)); in qeth_l3_setrouting_v4()
680 int qeth_l3_setrouting_v6(struct qeth_card *card) in qeth_l3_setrouting_v6() argument
684 QETH_CARD_TEXT(card, 3, "setrtg6"); in qeth_l3_setrouting_v6()
687 if (!qeth_is_supported(card, IPA_IPV6)) in qeth_l3_setrouting_v6()
689 rc = qeth_l3_correct_routing_type(card, &card->options.route6.type, in qeth_l3_setrouting_v6()
694 rc = qeth_l3_send_setrouting(card, card->options.route6.type, in qeth_l3_setrouting_v6()
697 card->options.route6.type = NO_ROUTER; in qeth_l3_setrouting_v6()
700 QETH_CARD_IFNAME(card)); in qeth_l3_setrouting_v6()
709 static void qeth_l3_clear_ipato_list(struct qeth_card *card) in qeth_l3_clear_ipato_list() argument
715 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_clear_ipato_list()
716 list_for_each_entry_safe(ipatoe, tmp, &card->ipato.entries, entry) { in qeth_l3_clear_ipato_list()
720 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_clear_ipato_list()
723 int qeth_l3_add_ipato_entry(struct qeth_card *card, in qeth_l3_add_ipato_entry() argument
730 QETH_CARD_TEXT(card, 2, "addipato"); in qeth_l3_add_ipato_entry()
731 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_add_ipato_entry()
732 list_for_each_entry(ipatoe, &card->ipato.entries, entry) { in qeth_l3_add_ipato_entry()
743 list_add_tail(&new->entry, &card->ipato.entries); in qeth_l3_add_ipato_entry()
745 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_add_ipato_entry()
749 void qeth_l3_del_ipato_entry(struct qeth_card *card, in qeth_l3_del_ipato_entry() argument
755 QETH_CARD_TEXT(card, 2, "delipato"); in qeth_l3_del_ipato_entry()
756 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_del_ipato_entry()
757 list_for_each_entry_safe(ipatoe, tmp, &card->ipato.entries, entry) { in qeth_l3_del_ipato_entry()
767 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_del_ipato_entry()
773 int qeth_l3_add_vipa(struct qeth_card *card, enum qeth_prot_versions proto, in qeth_l3_add_vipa() argument
783 QETH_CARD_TEXT(card, 2, "addvipa4"); in qeth_l3_add_vipa()
787 QETH_CARD_TEXT(card, 2, "addvipa6"); in qeth_l3_add_vipa()
796 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_add_vipa()
797 if (qeth_l3_address_exists_in_list(&card->ip_list, ipaddr, 0) || in qeth_l3_add_vipa()
798 qeth_l3_address_exists_in_list(card->ip_tbd_list, ipaddr, 0)) in qeth_l3_add_vipa()
800 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_add_vipa()
805 if (!qeth_l3_add_ip(card, ipaddr)) in qeth_l3_add_vipa()
807 qeth_l3_set_ip_addr_list(card); in qeth_l3_add_vipa()
811 void qeth_l3_del_vipa(struct qeth_card *card, enum qeth_prot_versions proto, in qeth_l3_del_vipa() argument
819 QETH_CARD_TEXT(card, 2, "delvipa4"); in qeth_l3_del_vipa()
823 QETH_CARD_TEXT(card, 2, "delvipa6"); in qeth_l3_del_vipa()
830 if (!qeth_l3_delete_ip(card, ipaddr)) in qeth_l3_del_vipa()
832 qeth_l3_set_ip_addr_list(card); in qeth_l3_del_vipa()
838 int qeth_l3_add_rxip(struct qeth_card *card, enum qeth_prot_versions proto, in qeth_l3_add_rxip() argument
848 QETH_CARD_TEXT(card, 2, "addrxip4"); in qeth_l3_add_rxip()
852 QETH_CARD_TEXT(card, 2, "addrxip6"); in qeth_l3_add_rxip()
861 spin_lock_irqsave(&card->ip_lock, flags); in qeth_l3_add_rxip()
862 if (qeth_l3_address_exists_in_list(&card->ip_list, ipaddr, 0) || in qeth_l3_add_rxip()
863 qeth_l3_address_exists_in_list(card->ip_tbd_list, ipaddr, 0)) in qeth_l3_add_rxip()
865 spin_unlock_irqrestore(&card->ip_lock, flags); in qeth_l3_add_rxip()
870 if (!qeth_l3_add_ip(card, ipaddr)) in qeth_l3_add_rxip()
872 qeth_l3_set_ip_addr_list(card); in qeth_l3_add_rxip()
876 void qeth_l3_del_rxip(struct qeth_card *card, enum qeth_prot_versions proto, in qeth_l3_del_rxip() argument
884 QETH_CARD_TEXT(card, 2, "addrxip4"); in qeth_l3_del_rxip()
888 QETH_CARD_TEXT(card, 2, "addrxip6"); in qeth_l3_del_rxip()
895 if (!qeth_l3_delete_ip(card, ipaddr)) in qeth_l3_del_rxip()
897 qeth_l3_set_ip_addr_list(card); in qeth_l3_del_rxip()
900 static int qeth_l3_register_addr_entry(struct qeth_card *card, in qeth_l3_register_addr_entry() argument
908 QETH_CARD_TEXT(card, 2, "setaddr4"); in qeth_l3_register_addr_entry()
909 QETH_CARD_HEX(card, 3, &addr->u.a4.addr, sizeof(int)); in qeth_l3_register_addr_entry()
911 QETH_CARD_TEXT(card, 2, "setaddr6"); in qeth_l3_register_addr_entry()
912 QETH_CARD_HEX(card, 3, &addr->u.a6.addr, 8); in qeth_l3_register_addr_entry()
913 QETH_CARD_HEX(card, 3, ((char *)&addr->u.a6.addr) + 8, 8); in qeth_l3_register_addr_entry()
915 QETH_CARD_TEXT(card, 2, "setaddr?"); in qeth_l3_register_addr_entry()
916 QETH_CARD_HEX(card, 3, addr, sizeof(struct qeth_ipaddr)); in qeth_l3_register_addr_entry()
920 rc = qeth_l3_send_setdelmc(card, addr, IPA_CMD_SETIPM); in qeth_l3_register_addr_entry()
922 rc = qeth_l3_send_setdelip(card, addr, IPA_CMD_SETIP, in qeth_l3_register_addr_entry()
925 QETH_CARD_TEXT(card, 2, "failed"); in qeth_l3_register_addr_entry()
928 QETH_CARD_TEXT(card, 2, "FAILED"); in qeth_l3_register_addr_entry()
930 dev_warn(&card->gdev->dev, in qeth_l3_register_addr_entry()
936 static int qeth_l3_deregister_addr_entry(struct qeth_card *card, in qeth_l3_deregister_addr_entry() argument
942 QETH_CARD_TEXT(card, 2, "deladdr4"); in qeth_l3_deregister_addr_entry()
943 QETH_CARD_HEX(card, 3, &addr->u.a4.addr, sizeof(int)); in qeth_l3_deregister_addr_entry()
945 QETH_CARD_TEXT(card, 2, "deladdr6"); in qeth_l3_deregister_addr_entry()
946 QETH_CARD_HEX(card, 3, &addr->u.a6.addr, 8); in qeth_l3_deregister_addr_entry()
947 QETH_CARD_HEX(card, 3, ((char *)&addr->u.a6.addr) + 8, 8); in qeth_l3_deregister_addr_entry()
949 QETH_CARD_TEXT(card, 2, "deladdr?"); in qeth_l3_deregister_addr_entry()
950 QETH_CARD_HEX(card, 3, addr, sizeof(struct qeth_ipaddr)); in qeth_l3_deregister_addr_entry()
953 rc = qeth_l3_send_setdelmc(card, addr, IPA_CMD_DELIPM); in qeth_l3_deregister_addr_entry()
955 rc = qeth_l3_send_setdelip(card, addr, IPA_CMD_DELIP, in qeth_l3_deregister_addr_entry()
958 QETH_CARD_TEXT(card, 2, "failed"); in qeth_l3_deregister_addr_entry()
984 static int qeth_l3_setadapter_parms(struct qeth_card *card) in qeth_l3_setadapter_parms() argument
990 if (!qeth_is_supported(card, IPA_SETADAPTERPARMS)) { in qeth_l3_setadapter_parms()
991 dev_info(&card->gdev->dev, in qeth_l3_setadapter_parms()
996 rc = qeth_query_setadapterparms(card); in qeth_l3_setadapter_parms()
999 "0x%x\n", dev_name(&card->gdev->dev), rc); in qeth_l3_setadapter_parms()
1002 if (qeth_adp_supported(card, IPA_SETADP_ALTER_MAC_ADDRESS)) { in qeth_l3_setadapter_parms()
1003 rc = qeth_setadpparms_change_macaddr(card); in qeth_l3_setadapter_parms()
1005 dev_warn(&card->gdev->dev, "Reading the adapter MAC" in qeth_l3_setadapter_parms()
1012 static int qeth_l3_default_setassparms_cb(struct qeth_card *card, in qeth_l3_default_setassparms_cb() argument
1017 QETH_CARD_TEXT(card, 4, "defadpcb"); in qeth_l3_default_setassparms_cb()
1023 card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled; in qeth_l3_default_setassparms_cb()
1025 card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled; in qeth_l3_default_setassparms_cb()
1029 card->info.csum_mask = cmd->data.setassparms.data.flags_32bit; in qeth_l3_default_setassparms_cb()
1030 QETH_CARD_TEXT_(card, 3, "csum:%d", card->info.csum_mask); in qeth_l3_default_setassparms_cb()
1034 card->info.tx_csum_mask = in qeth_l3_default_setassparms_cb()
1036 QETH_CARD_TEXT_(card, 3, "tcsu:%d", card->info.tx_csum_mask); in qeth_l3_default_setassparms_cb()
1043 struct qeth_card *card, enum qeth_ipa_funcs ipa_func, __u16 cmd_code, in qeth_l3_get_setassparms_cmd() argument
1049 QETH_CARD_TEXT(card, 4, "getasscm"); in qeth_l3_get_setassparms_cmd()
1050 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SETASSPARMS, prot); in qeth_l3_get_setassparms_cmd()
1062 static int qeth_l3_send_setassparms(struct qeth_card *card, in qeth_l3_send_setassparms() argument
1071 QETH_CARD_TEXT(card, 4, "sendassp"); in qeth_l3_send_setassparms()
1079 rc = qeth_send_ipa_cmd(card, iob, reply_cb, reply_param); in qeth_l3_send_setassparms()
1084 static int qeth_l3_send_simple_setassparms_ipv6(struct qeth_card *card, in qeth_l3_send_simple_setassparms_ipv6() argument
1090 QETH_CARD_TEXT(card, 4, "simassp6"); in qeth_l3_send_simple_setassparms_ipv6()
1091 iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code, in qeth_l3_send_simple_setassparms_ipv6()
1093 rc = qeth_l3_send_setassparms(card, iob, 0, 0, in qeth_l3_send_simple_setassparms_ipv6()
1099 static int qeth_l3_send_simple_setassparms(struct qeth_card *card, in qeth_l3_send_simple_setassparms() argument
1106 QETH_CARD_TEXT(card, 4, "simassp4"); in qeth_l3_send_simple_setassparms()
1109 iob = qeth_l3_get_setassparms_cmd(card, ipa_func, cmd_code, in qeth_l3_send_simple_setassparms()
1111 rc = qeth_l3_send_setassparms(card, iob, length, data, in qeth_l3_send_simple_setassparms()
1116 static int qeth_l3_start_ipa_arp_processing(struct qeth_card *card) in qeth_l3_start_ipa_arp_processing() argument
1120 QETH_CARD_TEXT(card, 3, "ipaarp"); in qeth_l3_start_ipa_arp_processing()
1122 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { in qeth_l3_start_ipa_arp_processing()
1123 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_arp_processing()
1125 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_arp_processing()
1128 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, in qeth_l3_start_ipa_arp_processing()
1131 dev_warn(&card->gdev->dev, in qeth_l3_start_ipa_arp_processing()
1133 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_arp_processing()
1138 static int qeth_l3_start_ipa_ip_fragmentation(struct qeth_card *card) in qeth_l3_start_ipa_ip_fragmentation() argument
1142 QETH_CARD_TEXT(card, 3, "ipaipfrg"); in qeth_l3_start_ipa_ip_fragmentation()
1144 if (!qeth_is_supported(card, IPA_IP_FRAGMENTATION)) { in qeth_l3_start_ipa_ip_fragmentation()
1145 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_ip_fragmentation()
1147 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_ip_fragmentation()
1151 rc = qeth_l3_send_simple_setassparms(card, IPA_IP_FRAGMENTATION, in qeth_l3_start_ipa_ip_fragmentation()
1154 dev_warn(&card->gdev->dev, in qeth_l3_start_ipa_ip_fragmentation()
1156 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_ip_fragmentation()
1158 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_ip_fragmentation()
1163 static int qeth_l3_start_ipa_source_mac(struct qeth_card *card) in qeth_l3_start_ipa_source_mac() argument
1167 QETH_CARD_TEXT(card, 3, "stsrcmac"); in qeth_l3_start_ipa_source_mac()
1169 if (!qeth_is_supported(card, IPA_SOURCE_MAC)) { in qeth_l3_start_ipa_source_mac()
1170 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_source_mac()
1172 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_source_mac()
1176 rc = qeth_l3_send_simple_setassparms(card, IPA_SOURCE_MAC, in qeth_l3_start_ipa_source_mac()
1179 dev_warn(&card->gdev->dev, in qeth_l3_start_ipa_source_mac()
1181 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_source_mac()
1185 static int qeth_l3_start_ipa_vlan(struct qeth_card *card) in qeth_l3_start_ipa_vlan() argument
1189 QETH_CARD_TEXT(card, 3, "strtvlan"); in qeth_l3_start_ipa_vlan()
1191 if (!qeth_is_supported(card, IPA_FULL_VLAN)) { in qeth_l3_start_ipa_vlan()
1192 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_vlan()
1193 "VLAN not supported on %s\n", QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_vlan()
1197 rc = qeth_l3_send_simple_setassparms(card, IPA_VLAN_PRIO, in qeth_l3_start_ipa_vlan()
1200 dev_warn(&card->gdev->dev, in qeth_l3_start_ipa_vlan()
1202 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_vlan()
1204 dev_info(&card->gdev->dev, "VLAN enabled\n"); in qeth_l3_start_ipa_vlan()
1209 static int qeth_l3_start_ipa_multicast(struct qeth_card *card) in qeth_l3_start_ipa_multicast() argument
1213 QETH_CARD_TEXT(card, 3, "stmcast"); in qeth_l3_start_ipa_multicast()
1215 if (!qeth_is_supported(card, IPA_MULTICASTING)) { in qeth_l3_start_ipa_multicast()
1216 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_multicast()
1218 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_multicast()
1222 rc = qeth_l3_send_simple_setassparms(card, IPA_MULTICASTING, in qeth_l3_start_ipa_multicast()
1225 dev_warn(&card->gdev->dev, in qeth_l3_start_ipa_multicast()
1227 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_multicast()
1229 dev_info(&card->gdev->dev, "Multicast enabled\n"); in qeth_l3_start_ipa_multicast()
1230 card->dev->flags |= IFF_MULTICAST; in qeth_l3_start_ipa_multicast()
1236 static int qeth_l3_softsetup_ipv6(struct qeth_card *card) in qeth_l3_softsetup_ipv6() argument
1240 QETH_CARD_TEXT(card, 3, "softipv6"); in qeth_l3_softsetup_ipv6()
1242 if (card->info.type == QETH_CARD_TYPE_IQD) in qeth_l3_softsetup_ipv6()
1245 rc = qeth_query_ipassists(card, QETH_PROT_IPV6); in qeth_l3_softsetup_ipv6()
1247 dev_err(&card->gdev->dev, in qeth_l3_softsetup_ipv6()
1249 QETH_CARD_IFNAME(card)); in qeth_l3_softsetup_ipv6()
1252 rc = qeth_l3_send_simple_setassparms(card, IPA_IPV6, in qeth_l3_softsetup_ipv6()
1255 dev_err(&card->gdev->dev, in qeth_l3_softsetup_ipv6()
1257 QETH_CARD_IFNAME(card)); in qeth_l3_softsetup_ipv6()
1260 rc = qeth_l3_send_simple_setassparms_ipv6(card, IPA_IPV6, in qeth_l3_softsetup_ipv6()
1263 dev_err(&card->gdev->dev, in qeth_l3_softsetup_ipv6()
1265 QETH_CARD_IFNAME(card)); in qeth_l3_softsetup_ipv6()
1268 rc = qeth_l3_send_simple_setassparms_ipv6(card, IPA_PASSTHRU, in qeth_l3_softsetup_ipv6()
1271 dev_warn(&card->gdev->dev, in qeth_l3_softsetup_ipv6()
1273 QETH_CARD_IFNAME(card)); in qeth_l3_softsetup_ipv6()
1277 dev_info(&card->gdev->dev, "IPV6 enabled\n"); in qeth_l3_softsetup_ipv6()
1282 static int qeth_l3_start_ipa_ipv6(struct qeth_card *card) in qeth_l3_start_ipa_ipv6() argument
1286 QETH_CARD_TEXT(card, 3, "strtipv6"); in qeth_l3_start_ipa_ipv6()
1288 if (!qeth_is_supported(card, IPA_IPV6)) { in qeth_l3_start_ipa_ipv6()
1289 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_ipv6()
1290 "IPv6 not supported on %s\n", QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_ipv6()
1294 rc = qeth_l3_softsetup_ipv6(card); in qeth_l3_start_ipa_ipv6()
1299 static int qeth_l3_start_ipa_broadcast(struct qeth_card *card) in qeth_l3_start_ipa_broadcast() argument
1303 QETH_CARD_TEXT(card, 3, "stbrdcst"); in qeth_l3_start_ipa_broadcast()
1304 card->info.broadcast_capable = 0; in qeth_l3_start_ipa_broadcast()
1305 if (!qeth_is_supported(card, IPA_FILTERING)) { in qeth_l3_start_ipa_broadcast()
1306 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_broadcast()
1308 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_broadcast()
1312 rc = qeth_l3_send_simple_setassparms(card, IPA_FILTERING, in qeth_l3_start_ipa_broadcast()
1315 dev_warn(&card->gdev->dev, "Enabling broadcast filtering for " in qeth_l3_start_ipa_broadcast()
1316 "%s failed\n", QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_broadcast()
1320 rc = qeth_l3_send_simple_setassparms(card, IPA_FILTERING, in qeth_l3_start_ipa_broadcast()
1323 dev_warn(&card->gdev->dev, in qeth_l3_start_ipa_broadcast()
1325 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_broadcast()
1328 card->info.broadcast_capable = QETH_BROADCAST_WITH_ECHO; in qeth_l3_start_ipa_broadcast()
1329 dev_info(&card->gdev->dev, "Broadcast enabled\n"); in qeth_l3_start_ipa_broadcast()
1330 rc = qeth_l3_send_simple_setassparms(card, IPA_FILTERING, in qeth_l3_start_ipa_broadcast()
1333 dev_warn(&card->gdev->dev, "Setting up broadcast echo " in qeth_l3_start_ipa_broadcast()
1334 "filtering for %s failed\n", QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_broadcast()
1337 card->info.broadcast_capable = QETH_BROADCAST_WITHOUT_ECHO; in qeth_l3_start_ipa_broadcast()
1339 if (card->info.broadcast_capable) in qeth_l3_start_ipa_broadcast()
1340 card->dev->flags |= IFF_BROADCAST; in qeth_l3_start_ipa_broadcast()
1342 card->dev->flags &= ~IFF_BROADCAST; in qeth_l3_start_ipa_broadcast()
1346 static int qeth_l3_send_checksum_command(struct qeth_card *card) in qeth_l3_send_checksum_command() argument
1350 rc = qeth_l3_send_simple_setassparms(card, IPA_INBOUND_CHECKSUM, in qeth_l3_send_checksum_command()
1353 dev_warn(&card->gdev->dev, "Starting HW checksumming for %s " in qeth_l3_send_checksum_command()
1355 QETH_CARD_IFNAME(card)); in qeth_l3_send_checksum_command()
1358 rc = qeth_l3_send_simple_setassparms(card, IPA_INBOUND_CHECKSUM, in qeth_l3_send_checksum_command()
1360 card->info.csum_mask); in qeth_l3_send_checksum_command()
1362 dev_warn(&card->gdev->dev, "Enabling HW checksumming for %s " in qeth_l3_send_checksum_command()
1364 QETH_CARD_IFNAME(card)); in qeth_l3_send_checksum_command()
1370 static int qeth_l3_set_rx_csum(struct qeth_card *card, int on) in qeth_l3_set_rx_csum() argument
1375 rc = qeth_l3_send_checksum_command(card); in qeth_l3_set_rx_csum()
1378 dev_info(&card->gdev->dev, in qeth_l3_set_rx_csum()
1381 rc = qeth_l3_send_simple_setassparms(card, in qeth_l3_set_rx_csum()
1390 static int qeth_l3_start_ipa_checksum(struct qeth_card *card) in qeth_l3_start_ipa_checksum() argument
1392 QETH_CARD_TEXT(card, 3, "strtcsum"); in qeth_l3_start_ipa_checksum()
1394 if (card->dev->features & NETIF_F_RXCSUM) { in qeth_l3_start_ipa_checksum()
1397 card->dev->features &= ~NETIF_F_RXCSUM; in qeth_l3_start_ipa_checksum()
1398 netdev_update_features(card->dev); in qeth_l3_start_ipa_checksum()
1404 static int qeth_l3_start_ipa_tx_checksum(struct qeth_card *card) in qeth_l3_start_ipa_tx_checksum() argument
1408 if (!qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) in qeth_l3_start_ipa_tx_checksum()
1410 rc = qeth_l3_send_simple_setassparms(card, IPA_OUTBOUND_CHECKSUM, in qeth_l3_start_ipa_tx_checksum()
1414 rc = qeth_l3_send_simple_setassparms(card, IPA_OUTBOUND_CHECKSUM, in qeth_l3_start_ipa_tx_checksum()
1415 IPA_CMD_ASS_ENABLE, card->info.tx_csum_mask); in qeth_l3_start_ipa_tx_checksum()
1418 dev_info(&card->gdev->dev, "HW TX Checksumming enabled\n"); in qeth_l3_start_ipa_tx_checksum()
1421 dev_warn(&card->gdev->dev, "Enabling HW TX checksumming for %s " in qeth_l3_start_ipa_tx_checksum()
1422 "failed, using SW TX checksumming\n", QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_tx_checksum()
1426 static int qeth_l3_start_ipa_tso(struct qeth_card *card) in qeth_l3_start_ipa_tso() argument
1430 QETH_CARD_TEXT(card, 3, "sttso"); in qeth_l3_start_ipa_tso()
1432 if (!qeth_is_supported(card, IPA_OUTBOUND_TSO)) { in qeth_l3_start_ipa_tso()
1433 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_tso()
1435 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_tso()
1438 rc = qeth_l3_send_simple_setassparms(card, IPA_OUTBOUND_TSO, in qeth_l3_start_ipa_tso()
1441 dev_warn(&card->gdev->dev, "Starting outbound TCP " in qeth_l3_start_ipa_tso()
1443 QETH_CARD_IFNAME(card)); in qeth_l3_start_ipa_tso()
1445 dev_info(&card->gdev->dev, in qeth_l3_start_ipa_tso()
1449 card->dev->features &= ~NETIF_F_TSO; in qeth_l3_start_ipa_tso()
1453 static int qeth_l3_start_ipassists(struct qeth_card *card) in qeth_l3_start_ipassists() argument
1455 QETH_CARD_TEXT(card, 3, "strtipas"); in qeth_l3_start_ipassists()
1457 if (qeth_set_access_ctrl_online(card, 0)) in qeth_l3_start_ipassists()
1459 qeth_l3_start_ipa_arp_processing(card); /* go on*/ in qeth_l3_start_ipassists()
1460 qeth_l3_start_ipa_ip_fragmentation(card); /* go on*/ in qeth_l3_start_ipassists()
1461 qeth_l3_start_ipa_source_mac(card); /* go on*/ in qeth_l3_start_ipassists()
1462 qeth_l3_start_ipa_vlan(card); /* go on*/ in qeth_l3_start_ipassists()
1463 qeth_l3_start_ipa_multicast(card); /* go on*/ in qeth_l3_start_ipassists()
1464 qeth_l3_start_ipa_ipv6(card); /* go on*/ in qeth_l3_start_ipassists()
1465 qeth_l3_start_ipa_broadcast(card); /* go on*/ in qeth_l3_start_ipassists()
1466 qeth_l3_start_ipa_checksum(card); /* go on*/ in qeth_l3_start_ipassists()
1467 qeth_l3_start_ipa_tx_checksum(card); in qeth_l3_start_ipassists()
1468 qeth_l3_start_ipa_tso(card); /* go on*/ in qeth_l3_start_ipassists()
1472 static int qeth_l3_iqd_read_initial_mac_cb(struct qeth_card *card, in qeth_l3_iqd_read_initial_mac_cb() argument
1479 memcpy(card->dev->dev_addr, in qeth_l3_iqd_read_initial_mac_cb()
1482 eth_random_addr(card->dev->dev_addr); in qeth_l3_iqd_read_initial_mac_cb()
1487 static int qeth_l3_iqd_read_initial_mac(struct qeth_card *card) in qeth_l3_iqd_read_initial_mac() argument
1495 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR, in qeth_l3_iqd_read_initial_mac()
1499 card->info.unique_id; in qeth_l3_iqd_read_initial_mac()
1501 rc = qeth_send_ipa_cmd(card, iob, qeth_l3_iqd_read_initial_mac_cb, in qeth_l3_iqd_read_initial_mac()
1506 static int qeth_l3_get_unique_id_cb(struct qeth_card *card, in qeth_l3_get_unique_id_cb() argument
1513 card->info.unique_id = *((__u16 *) in qeth_l3_get_unique_id_cb()
1516 card->info.unique_id = UNIQUE_ID_IF_CREATE_ADDR_FAILED | in qeth_l3_get_unique_id_cb()
1518 dev_warn(&card->gdev->dev, "The network adapter failed to " in qeth_l3_get_unique_id_cb()
1524 static int qeth_l3_get_unique_id(struct qeth_card *card) in qeth_l3_get_unique_id() argument
1532 if (!qeth_is_supported(card, IPA_IPV6)) { in qeth_l3_get_unique_id()
1533 card->info.unique_id = UNIQUE_ID_IF_CREATE_ADDR_FAILED | in qeth_l3_get_unique_id()
1538 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_CREATE_ADDR, in qeth_l3_get_unique_id()
1542 card->info.unique_id; in qeth_l3_get_unique_id()
1544 rc = qeth_send_ipa_cmd(card, iob, qeth_l3_get_unique_id_cb, NULL); in qeth_l3_get_unique_id()
1549 qeth_diags_trace_cb(struct qeth_card *card, struct qeth_reply *reply, in qeth_diags_trace_cb() argument
1560 QETH_CARD_TEXT_(card, 2, "dxter%x", rc); in qeth_diags_trace_cb()
1568 card->info.promisc_mode = SET_PROMISC_MODE_OFF; in qeth_diags_trace_cb()
1569 dev_info(&card->gdev->dev, "The HiperSockets network " in qeth_diags_trace_cb()
1579 card->info.promisc_mode = SET_PROMISC_MODE_ON; in qeth_diags_trace_cb()
1580 dev_info(&card->gdev->dev, "The HiperSockets network " in qeth_diags_trace_cb()
1584 dev_warn(&card->gdev->dev, "The device is not " in qeth_diags_trace_cb()
1589 dev_warn(&card->gdev->dev, "A HiperSockets " in qeth_diags_trace_cb()
1599 cmd->data.diagass.action, QETH_CARD_IFNAME(card)); in qeth_diags_trace_cb()
1606 qeth_diags_trace(struct qeth_card *card, enum qeth_diags_trace_cmds diags_cmd) in qeth_diags_trace() argument
1613 iob = qeth_get_ipacmd_buffer(card, IPA_CMD_SET_DIAG_ASS, 0); in qeth_diags_trace()
1619 return qeth_send_ipa_cmd(card, iob, qeth_diags_trace_cb, NULL); in qeth_diags_trace()
1628 static void qeth_l3_add_mc(struct qeth_card *card, struct in_device *in4_dev) in qeth_l3_add_mc() argument
1634 QETH_CARD_TEXT(card, 4, "addmc"); in qeth_l3_add_mc()
1644 if (!qeth_l3_add_ip(card, ipm)) in qeth_l3_add_mc()
1650 static void qeth_l3_add_vlan_mc(struct qeth_card *card) in qeth_l3_add_vlan_mc() argument
1655 QETH_CARD_TEXT(card, 4, "addmcvl"); in qeth_l3_add_vlan_mc()
1656 if (!qeth_is_supported(card, IPA_FULL_VLAN)) in qeth_l3_add_vlan_mc()
1659 for_each_set_bit(vid, card->active_vlans, VLAN_N_VID) { in qeth_l3_add_vlan_mc()
1662 netdev = __vlan_find_dev_deep(card->dev, htons(ETH_P_8021Q), in qeth_l3_add_vlan_mc()
1670 qeth_l3_add_mc(card, in_dev); in qeth_l3_add_vlan_mc()
1674 static void qeth_l3_add_multicast_ipv4(struct qeth_card *card) in qeth_l3_add_multicast_ipv4() argument
1678 QETH_CARD_TEXT(card, 4, "chkmcv4"); in qeth_l3_add_multicast_ipv4()
1680 in4_dev = __in_dev_get_rcu(card->dev); in qeth_l3_add_multicast_ipv4()
1683 qeth_l3_add_mc(card, in4_dev); in qeth_l3_add_multicast_ipv4()
1684 qeth_l3_add_vlan_mc(card); in qeth_l3_add_multicast_ipv4()
1690 static void qeth_l3_add_mc6(struct qeth_card *card, struct inet6_dev *in6_dev) in qeth_l3_add_mc6() argument
1696 QETH_CARD_TEXT(card, 4, "addmc6"); in qeth_l3_add_mc6()
1706 if (!qeth_l3_add_ip(card, ipm)) in qeth_l3_add_mc6()
1712 static void qeth_l3_add_vlan_mc6(struct qeth_card *card) in qeth_l3_add_vlan_mc6() argument
1717 QETH_CARD_TEXT(card, 4, "admc6vl"); in qeth_l3_add_vlan_mc6()
1718 if (!qeth_is_supported(card, IPA_FULL_VLAN)) in qeth_l3_add_vlan_mc6()
1721 for_each_set_bit(vid, card->active_vlans, VLAN_N_VID) { in qeth_l3_add_vlan_mc6()
1724 netdev = __vlan_find_dev_deep(card->dev, htons(ETH_P_8021Q), in qeth_l3_add_vlan_mc6()
1733 qeth_l3_add_mc6(card, in_dev); in qeth_l3_add_vlan_mc6()
1739 static void qeth_l3_add_multicast_ipv6(struct qeth_card *card) in qeth_l3_add_multicast_ipv6() argument
1743 QETH_CARD_TEXT(card, 4, "chkmcv6"); in qeth_l3_add_multicast_ipv6()
1744 if (!qeth_is_supported(card, IPA_IPV6)) in qeth_l3_add_multicast_ipv6()
1746 in6_dev = in6_dev_get(card->dev); in qeth_l3_add_multicast_ipv6()
1751 qeth_l3_add_mc6(card, in6_dev); in qeth_l3_add_multicast_ipv6()
1752 qeth_l3_add_vlan_mc6(card); in qeth_l3_add_multicast_ipv6()
1759 static void qeth_l3_free_vlan_addresses4(struct qeth_card *card, in qeth_l3_free_vlan_addresses4() argument
1767 QETH_CARD_TEXT(card, 4, "frvaddr4"); in qeth_l3_free_vlan_addresses4()
1769 netdev = __vlan_find_dev_deep(card->dev, htons(ETH_P_8021Q), vid); in qeth_l3_free_vlan_addresses4()
1781 if (!qeth_l3_delete_ip(card, addr)) in qeth_l3_free_vlan_addresses4()
1788 static void qeth_l3_free_vlan_addresses6(struct qeth_card *card, in qeth_l3_free_vlan_addresses6() argument
1797 QETH_CARD_TEXT(card, 4, "frvaddr6"); in qeth_l3_free_vlan_addresses6()
1799 netdev = __vlan_find_dev_deep(card->dev, htons(ETH_P_8021Q), vid); in qeth_l3_free_vlan_addresses6()
1812 if (!qeth_l3_delete_ip(card, addr)) in qeth_l3_free_vlan_addresses6()
1820 static void qeth_l3_free_vlan_addresses(struct qeth_card *card, in qeth_l3_free_vlan_addresses() argument
1824 qeth_l3_free_vlan_addresses4(card, vid); in qeth_l3_free_vlan_addresses()
1825 qeth_l3_free_vlan_addresses6(card, vid); in qeth_l3_free_vlan_addresses()
1832 struct qeth_card *card = dev->ml_priv; in qeth_l3_vlan_rx_add_vid() local
1834 set_bit(vid, card->active_vlans); in qeth_l3_vlan_rx_add_vid()
1841 struct qeth_card *card = dev->ml_priv; in qeth_l3_vlan_rx_kill_vid() local
1844 QETH_CARD_TEXT_(card, 4, "kid:%d", vid); in qeth_l3_vlan_rx_kill_vid()
1845 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { in qeth_l3_vlan_rx_kill_vid()
1846 QETH_CARD_TEXT(card, 3, "kidREC"); in qeth_l3_vlan_rx_kill_vid()
1849 spin_lock_irqsave(&card->vlanlock, flags); in qeth_l3_vlan_rx_kill_vid()
1851 qeth_l3_free_vlan_addresses(card, vid); in qeth_l3_vlan_rx_kill_vid()
1852 clear_bit(vid, card->active_vlans); in qeth_l3_vlan_rx_kill_vid()
1853 spin_unlock_irqrestore(&card->vlanlock, flags); in qeth_l3_vlan_rx_kill_vid()
1854 qeth_l3_set_multicast_list(card->dev); in qeth_l3_vlan_rx_kill_vid()
1858 static inline int qeth_l3_rebuild_skb(struct qeth_card *card, in qeth_l3_rebuild_skb() argument
1877 tg_addr, card->dev, 0); in qeth_l3_rebuild_skb()
1885 memcpy(tg_addr, card->dev->broadcast, in qeth_l3_rebuild_skb()
1886 card->dev->addr_len); in qeth_l3_rebuild_skb()
1888 card->stats.multicast++; in qeth_l3_rebuild_skb()
1892 memcpy(tg_addr, card->dev->broadcast, in qeth_l3_rebuild_skb()
1893 card->dev->addr_len); in qeth_l3_rebuild_skb()
1894 card->stats.multicast++; in qeth_l3_rebuild_skb()
1901 if (card->options.sniffer) in qeth_l3_rebuild_skb()
1905 memcpy(tg_addr, card->dev->dev_addr, in qeth_l3_rebuild_skb()
1906 card->dev->addr_len); in qeth_l3_rebuild_skb()
1909 card->dev->header_ops->create(skb, card->dev, prot, in qeth_l3_rebuild_skb()
1911 card->dev->addr_len); in qeth_l3_rebuild_skb()
1913 card->dev->header_ops->create(skb, card->dev, prot, in qeth_l3_rebuild_skb()
1914 tg_addr, "FAKELL", card->dev->addr_len); in qeth_l3_rebuild_skb()
1917 skb->protocol = eth_type_trans(skb, card->dev); in qeth_l3_rebuild_skb()
1926 if (card->dev->features & NETIF_F_RXCSUM) { in qeth_l3_rebuild_skb()
1941 static int qeth_l3_process_inbound_buffer(struct qeth_card *card, in qeth_l3_process_inbound_buffer() argument
1955 skb = qeth_core_get_next_skb(card, in qeth_l3_process_inbound_buffer()
1956 &card->qdio.in_q->bufs[card->rx.b_index], in qeth_l3_process_inbound_buffer()
1957 &card->rx.b_element, &card->rx.e_offset, &hdr); in qeth_l3_process_inbound_buffer()
1962 skb->dev = card->dev; in qeth_l3_process_inbound_buffer()
1966 if ((card->info.type == QETH_CARD_TYPE_IQD) && in qeth_l3_process_inbound_buffer()
1971 skb->dev = card->dev; in qeth_l3_process_inbound_buffer()
1973 card->dev->header_ops->create(skb, card->dev, 0, in qeth_l3_process_inbound_buffer()
1974 card->dev->dev_addr, "FAKELL", in qeth_l3_process_inbound_buffer()
1975 card->dev->addr_len); in qeth_l3_process_inbound_buffer()
1978 is_vlan = qeth_l3_rebuild_skb(card, skb, hdr, in qeth_l3_process_inbound_buffer()
1981 if (is_vlan && !card->options.sniffer) in qeth_l3_process_inbound_buffer()
1984 napi_gro_receive(&card->napi, skb); in qeth_l3_process_inbound_buffer()
1995 QETH_CARD_TEXT(card, 3, "inbunkno"); in qeth_l3_process_inbound_buffer()
2001 card->stats.rx_packets++; in qeth_l3_process_inbound_buffer()
2002 card->stats.rx_bytes += len; in qeth_l3_process_inbound_buffer()
2009 struct qeth_card *card = container_of(napi, struct qeth_card, napi); in qeth_l3_poll() local
2015 if (card->options.performance_stats) { in qeth_l3_poll()
2016 card->perf_stats.inbound_cnt++; in qeth_l3_poll()
2017 card->perf_stats.inbound_start_time = qeth_get_micros(); in qeth_l3_poll()
2021 if (!card->rx.b_count) { in qeth_l3_poll()
2022 card->rx.qdio_err = 0; in qeth_l3_poll()
2023 card->rx.b_count = qdio_get_next_buffers( in qeth_l3_poll()
2024 card->data.ccwdev, 0, &card->rx.b_index, in qeth_l3_poll()
2025 &card->rx.qdio_err); in qeth_l3_poll()
2026 if (card->rx.b_count <= 0) { in qeth_l3_poll()
2027 card->rx.b_count = 0; in qeth_l3_poll()
2030 card->rx.b_element = in qeth_l3_poll()
2031 &card->qdio.in_q->bufs[card->rx.b_index] in qeth_l3_poll()
2033 card->rx.e_offset = 0; in qeth_l3_poll()
2036 while (card->rx.b_count) { in qeth_l3_poll()
2037 buffer = &card->qdio.in_q->bufs[card->rx.b_index]; in qeth_l3_poll()
2038 if (!(card->rx.qdio_err && in qeth_l3_poll()
2039 qeth_check_qdio_errors(card, buffer->buffer, in qeth_l3_poll()
2040 card->rx.qdio_err, "qinerr"))) in qeth_l3_poll()
2042 card, new_budget, &done); in qeth_l3_poll()
2047 if (card->options.performance_stats) in qeth_l3_poll()
2048 card->perf_stats.bufs_rec++; in qeth_l3_poll()
2049 qeth_put_buffer_pool_entry(card, in qeth_l3_poll()
2051 qeth_queue_input_buffer(card, card->rx.b_index); in qeth_l3_poll()
2052 card->rx.b_count--; in qeth_l3_poll()
2053 if (card->rx.b_count) { in qeth_l3_poll()
2054 card->rx.b_index = in qeth_l3_poll()
2055 (card->rx.b_index + 1) % in qeth_l3_poll()
2057 card->rx.b_element = in qeth_l3_poll()
2058 &card->qdio.in_q in qeth_l3_poll()
2059 ->bufs[card->rx.b_index] in qeth_l3_poll()
2061 card->rx.e_offset = 0; in qeth_l3_poll()
2073 if (qdio_start_irq(card->data.ccwdev, 0)) in qeth_l3_poll()
2074 napi_schedule(&card->napi); in qeth_l3_poll()
2076 if (card->options.performance_stats) in qeth_l3_poll()
2077 card->perf_stats.inbound_time += qeth_get_micros() - in qeth_l3_poll()
2078 card->perf_stats.inbound_start_time; in qeth_l3_poll()
2083 struct qeth_card *card) in qeth_l3_verify_vlan_dev() argument
2088 for_each_set_bit(vid, card->active_vlans, VLAN_N_VID) { in qeth_l3_verify_vlan_dev()
2092 netdev = __vlan_find_dev_deep(card->dev, htons(ETH_P_8021Q), in qeth_l3_verify_vlan_dev()
2101 if (rc && !(vlan_dev_real_dev(dev)->ml_priv == (void *)card)) in qeth_l3_verify_vlan_dev()
2109 struct qeth_card *card; in qeth_l3_verify_dev() local
2114 list_for_each_entry(card, &qeth_core_card_list.list, list) { in qeth_l3_verify_dev()
2115 if (card->dev == dev) { in qeth_l3_verify_dev()
2119 rc = qeth_l3_verify_vlan_dev(dev, card); in qeth_l3_verify_dev()
2130 struct qeth_card *card = NULL; in qeth_l3_get_card_from_dev() local
2135 card = dev->ml_priv; in qeth_l3_get_card_from_dev()
2137 card = vlan_dev_real_dev(dev)->ml_priv; in qeth_l3_get_card_from_dev()
2138 if (card && card->options.layer2) in qeth_l3_get_card_from_dev()
2139 card = NULL; in qeth_l3_get_card_from_dev()
2140 if (card) in qeth_l3_get_card_from_dev()
2141 QETH_CARD_TEXT_(card, 4, "%d", rc); in qeth_l3_get_card_from_dev()
2142 return card ; in qeth_l3_get_card_from_dev()
2145 static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode) in qeth_l3_stop_card() argument
2150 QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); in qeth_l3_stop_card()
2152 qeth_set_allowed_threads(card, 0, 1); in qeth_l3_stop_card()
2153 if (card->options.sniffer && in qeth_l3_stop_card()
2154 (card->info.promisc_mode == SET_PROMISC_MODE_ON)) in qeth_l3_stop_card()
2155 qeth_diags_trace(card, QETH_DIAGS_CMD_TRACE_DISABLE); in qeth_l3_stop_card()
2156 if (card->read.state == CH_STATE_UP && in qeth_l3_stop_card()
2157 card->write.state == CH_STATE_UP && in qeth_l3_stop_card()
2158 (card->state == CARD_STATE_UP)) { in qeth_l3_stop_card()
2160 qeth_l3_stop(card->dev); in qeth_l3_stop_card()
2163 dev_close(card->dev); in qeth_l3_stop_card()
2166 card->state = CARD_STATE_SOFTSETUP; in qeth_l3_stop_card()
2168 if (card->state == CARD_STATE_SOFTSETUP) { in qeth_l3_stop_card()
2169 qeth_l3_clear_ip_list(card, 1); in qeth_l3_stop_card()
2170 qeth_clear_ipacmd_list(card); in qeth_l3_stop_card()
2171 card->state = CARD_STATE_HARDSETUP; in qeth_l3_stop_card()
2173 if (card->state == CARD_STATE_HARDSETUP) { in qeth_l3_stop_card()
2174 qeth_qdio_clear_card(card, 0); in qeth_l3_stop_card()
2175 qeth_clear_qdio_buffers(card); in qeth_l3_stop_card()
2176 qeth_clear_working_pool_list(card); in qeth_l3_stop_card()
2177 card->state = CARD_STATE_DOWN; in qeth_l3_stop_card()
2179 if (card->state == CARD_STATE_DOWN) { in qeth_l3_stop_card()
2180 qeth_clear_cmd_buffers(&card->read); in qeth_l3_stop_card()
2181 qeth_clear_cmd_buffers(&card->write); in qeth_l3_stop_card()
2191 qeth_l3_handle_promisc_mode(struct qeth_card *card) in qeth_l3_handle_promisc_mode() argument
2193 struct net_device *dev = card->dev; in qeth_l3_handle_promisc_mode()
2196 (card->info.promisc_mode == SET_PROMISC_MODE_ON)) || in qeth_l3_handle_promisc_mode()
2198 (card->info.promisc_mode == SET_PROMISC_MODE_OFF))) in qeth_l3_handle_promisc_mode()
2201 if (card->info.guestlan) { /* Guestlan trace */ in qeth_l3_handle_promisc_mode()
2202 if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) in qeth_l3_handle_promisc_mode()
2203 qeth_setadp_promisc_mode(card); in qeth_l3_handle_promisc_mode()
2204 } else if (card->options.sniffer && /* HiperSockets trace */ in qeth_l3_handle_promisc_mode()
2205 qeth_adp_supported(card, IPA_SETADP_SET_DIAG_ASSIST)) { in qeth_l3_handle_promisc_mode()
2207 QETH_CARD_TEXT(card, 3, "+promisc"); in qeth_l3_handle_promisc_mode()
2208 qeth_diags_trace(card, QETH_DIAGS_CMD_TRACE_ENABLE); in qeth_l3_handle_promisc_mode()
2210 QETH_CARD_TEXT(card, 3, "-promisc"); in qeth_l3_handle_promisc_mode()
2211 qeth_diags_trace(card, QETH_DIAGS_CMD_TRACE_DISABLE); in qeth_l3_handle_promisc_mode()
2218 struct qeth_card *card = dev->ml_priv; in qeth_l3_set_multicast_list() local
2220 QETH_CARD_TEXT(card, 3, "setmulti"); in qeth_l3_set_multicast_list()
2221 if (qeth_threads_running(card, QETH_RECOVER_THREAD) && in qeth_l3_set_multicast_list()
2222 (card->state != CARD_STATE_UP)) in qeth_l3_set_multicast_list()
2224 if (!card->options.sniffer) { in qeth_l3_set_multicast_list()
2225 qeth_l3_delete_mc_addresses(card); in qeth_l3_set_multicast_list()
2226 qeth_l3_add_multicast_ipv4(card); in qeth_l3_set_multicast_list()
2228 qeth_l3_add_multicast_ipv6(card); in qeth_l3_set_multicast_list()
2230 qeth_l3_set_ip_addr_list(card); in qeth_l3_set_multicast_list()
2231 if (!qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) in qeth_l3_set_multicast_list()
2234 qeth_l3_handle_promisc_mode(card); in qeth_l3_set_multicast_list()
2260 static int qeth_l3_arp_set_no_entries(struct qeth_card *card, int no_entries) in qeth_l3_arp_set_no_entries() argument
2265 QETH_CARD_TEXT(card, 3, "arpstnoe"); in qeth_l3_arp_set_no_entries()
2272 if (card->info.guestlan) in qeth_l3_arp_set_no_entries()
2274 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { in qeth_l3_arp_set_no_entries()
2277 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, in qeth_l3_arp_set_no_entries()
2283 "%s: %s (0x%x/%d)\n", QETH_CARD_IFNAME(card), in qeth_l3_arp_set_no_entries()
2289 static __u32 get_arp_entry_size(struct qeth_card *card, in get_arp_entry_size() argument
2298 QETH_CARD_TEXT(card, 4, "arpev4"); in get_arp_entry_size()
2307 QETH_CARD_TEXT(card, 4, "arpev6"); in get_arp_entry_size()
2318 QETH_CARD_TEXT(card, 4, "arpinv"); in get_arp_entry_size()
2331 static int qeth_l3_arp_query_cb(struct qeth_card *card, in qeth_l3_arp_query_cb() argument
2343 QETH_CARD_TEXT(card, 3, "arpquecb"); in qeth_l3_arp_query_cb()
2347 QETH_CARD_TEXT_(card, 4, "%i", cmd->hdr.prot_version); in qeth_l3_arp_query_cb()
2349 QETH_CARD_TEXT(card, 4, "arpcberr"); in qeth_l3_arp_query_cb()
2350 QETH_CARD_TEXT_(card, 4, "%i", cmd->hdr.return_code); in qeth_l3_arp_query_cb()
2355 QETH_CARD_TEXT(card, 4, "setaperr"); in qeth_l3_arp_query_cb()
2356 QETH_CARD_TEXT_(card, 4, "%i", cmd->hdr.return_code); in qeth_l3_arp_query_cb()
2360 QETH_CARD_TEXT_(card, 4, "anoen%i", qdata->no_entries); in qeth_l3_arp_query_cb()
2373 QETH_CARD_TEXT(card, 4, "pmis"); in qeth_l3_arp_query_cb()
2374 QETH_CARD_TEXT_(card, 4, "%i", etype->ip); in qeth_l3_arp_query_cb()
2377 esize = get_arp_entry_size(card, qdata, etype, in qeth_l3_arp_query_cb()
2379 QETH_CARD_TEXT_(card, 5, "esz%i", esize); in qeth_l3_arp_query_cb()
2384 QETH_CARD_TEXT_(card, 4, "qaer3%i", -ENOMEM); in qeth_l3_arp_query_cb()
2400 QETH_CARD_TEXT_(card, 4, "nove%i", qinfo->no_entries); in qeth_l3_arp_query_cb()
2407 QETH_CARD_TEXT_(card, 4, "rc%i", 0); in qeth_l3_arp_query_cb()
2415 static int qeth_l3_send_ipa_arp_cmd(struct qeth_card *card, in qeth_l3_send_ipa_arp_cmd() argument
2421 QETH_CARD_TEXT(card, 4, "sendarp"); in qeth_l3_send_ipa_arp_cmd()
2425 &card->token.ulp_connection_r, QETH_MPC_TOKEN_LENGTH); in qeth_l3_send_ipa_arp_cmd()
2426 return qeth_send_control_data(card, IPA_PDU_HEADER_SIZE + len, iob, in qeth_l3_send_ipa_arp_cmd()
2430 static int qeth_l3_query_arp_cache_info(struct qeth_card *card, in qeth_l3_query_arp_cache_info() argument
2439 QETH_CARD_TEXT_(card, 3, "qarpipv%i", prot); in qeth_l3_query_arp_cache_info()
2441 iob = qeth_l3_get_setassparms_cmd(card, IPA_ARP_PROCESSING, in qeth_l3_query_arp_cache_info()
2449 rc = qeth_l3_send_ipa_arp_cmd(card, iob, in qeth_l3_query_arp_cache_info()
2456 "(0x%x/%d)\n", QETH_CARD_IFNAME(card), in qeth_l3_query_arp_cache_info()
2463 static int qeth_l3_arp_query(struct qeth_card *card, char __user *udata) in qeth_l3_arp_query() argument
2468 QETH_CARD_TEXT(card, 3, "arpquery"); in qeth_l3_arp_query()
2470 if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ in qeth_l3_arp_query()
2472 QETH_CARD_TEXT(card, 3, "arpqnsup"); in qeth_l3_arp_query()
2487 rc = qeth_l3_query_arp_cache_info(card, QETH_PROT_IPV4, &qinfo); in qeth_l3_arp_query()
2496 qeth_l3_query_arp_cache_info(card, QETH_PROT_IPV6, in qeth_l3_arp_query()
2501 QETH_CARD_TEXT(card, 4, "qactf"); in qeth_l3_arp_query()
2505 QETH_CARD_TEXT_(card, 4, "qacts"); in qeth_l3_arp_query()
2513 static int qeth_l3_arp_add_entry(struct qeth_card *card, in qeth_l3_arp_add_entry() argument
2521 QETH_CARD_TEXT(card, 3, "arpadent"); in qeth_l3_arp_add_entry()
2528 if (card->info.guestlan) in qeth_l3_arp_add_entry()
2530 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { in qeth_l3_arp_add_entry()
2534 iob = qeth_l3_get_setassparms_cmd(card, IPA_ARP_PROCESSING, in qeth_l3_arp_add_entry()
2538 rc = qeth_l3_send_setassparms(card, iob, in qeth_l3_arp_add_entry()
2546 "on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card), in qeth_l3_arp_add_entry()
2552 static int qeth_l3_arp_remove_entry(struct qeth_card *card, in qeth_l3_arp_remove_entry() argument
2560 QETH_CARD_TEXT(card, 3, "arprment"); in qeth_l3_arp_remove_entry()
2567 if (card->info.guestlan) in qeth_l3_arp_remove_entry()
2569 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { in qeth_l3_arp_remove_entry()
2573 iob = qeth_l3_get_setassparms_cmd(card, IPA_ARP_PROCESSING, in qeth_l3_arp_remove_entry()
2577 rc = qeth_l3_send_setassparms(card, iob, in qeth_l3_arp_remove_entry()
2585 " on %s: %s (0x%x/%d)\n", buf, QETH_CARD_IFNAME(card), in qeth_l3_arp_remove_entry()
2591 static int qeth_l3_arp_flush_cache(struct qeth_card *card) in qeth_l3_arp_flush_cache() argument
2596 QETH_CARD_TEXT(card, 3, "arpflush"); in qeth_l3_arp_flush_cache()
2603 if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) in qeth_l3_arp_flush_cache()
2605 if (!qeth_is_supported(card, IPA_ARP_PROCESSING)) { in qeth_l3_arp_flush_cache()
2608 rc = qeth_l3_send_simple_setassparms(card, IPA_ARP_PROCESSING, in qeth_l3_arp_flush_cache()
2613 "(0x%x/%d)\n", QETH_CARD_IFNAME(card), in qeth_l3_arp_flush_cache()
2621 struct qeth_card *card = dev->ml_priv; in qeth_l3_do_ioctl() local
2626 if (!card) in qeth_l3_do_ioctl()
2629 if ((card->state != CARD_STATE_UP) && in qeth_l3_do_ioctl()
2630 (card->state != CARD_STATE_SOFTSETUP)) in qeth_l3_do_ioctl()
2639 rc = qeth_l3_arp_set_no_entries(card, rq->ifr_ifru.ifru_ivalue); in qeth_l3_do_ioctl()
2646 rc = qeth_l3_arp_query(card, rq->ifr_ifru.ifru_data); in qeth_l3_do_ioctl()
2657 rc = qeth_l3_arp_add_entry(card, &arp_entry); in qeth_l3_do_ioctl()
2668 rc = qeth_l3_arp_remove_entry(card, &arp_entry); in qeth_l3_do_ioctl()
2675 rc = qeth_l3_arp_flush_cache(card); in qeth_l3_do_ioctl()
2678 rc = qeth_snmp_command(card, rq->ifr_ifru.ifru_data); in qeth_l3_do_ioctl()
2681 if ((card->info.type == QETH_CARD_TYPE_OSD || in qeth_l3_do_ioctl()
2682 card->info.type == QETH_CARD_TYPE_OSX) && in qeth_l3_do_ioctl()
2683 !card->info.guestlan) in qeth_l3_do_ioctl()
2701 rc = qeth_query_oat_command(card, rq->ifr_ifru.ifru_data); in qeth_l3_do_ioctl()
2707 QETH_CARD_TEXT_(card, 2, "ioce%d", rc); in qeth_l3_do_ioctl()
2711 int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb) in qeth_l3_get_cast_type() argument
2749 switch (card->info.link_type) { in qeth_l3_get_cast_type()
2766 static void qeth_l3_fill_af_iucv_hdr(struct qeth_card *card, in qeth_l3_fill_af_iucv_hdr() argument
2773 card->dev->header_ops->create(skb, card->dev, 0, in qeth_l3_fill_af_iucv_hdr()
2774 card->dev->dev_addr, card->dev->dev_addr, in qeth_l3_fill_af_iucv_hdr()
2775 card->dev->addr_len); in qeth_l3_fill_af_iucv_hdr()
2790 static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, in qeth_l3_fill_header() argument
2804 if ((ipv == 4) || (card->info.type == QETH_CARD_TYPE_IQD)) in qeth_l3_fill_header()
2835 if (card->info.type == QETH_CARD_TYPE_IQD) in qeth_l3_fill_header()
2853 static inline void qeth_l3_hdr_csum(struct qeth_card *card, in qeth_l3_hdr_csum() argument
2866 if (card->options.performance_stats) in qeth_l3_hdr_csum()
2867 card->perf_stats.tx_csum++; in qeth_l3_hdr_csum()
2870 static void qeth_tso_fill_header(struct qeth_card *card, in qeth_tso_fill_header() argument
2925 struct qeth_card *card = dev->ml_priv; in qeth_l3_hard_start_xmit() local
2928 int cast_type = qeth_l3_get_cast_type(card, skb); in qeth_l3_hard_start_xmit()
2929 struct qeth_qdio_out_q *queue = card->qdio.out_qs in qeth_l3_hard_start_xmit()
2930 [qeth_get_priority_queue(card, skb, ipv, cast_type)]; in qeth_l3_hard_start_xmit()
2936 if (((card->info.type == QETH_CARD_TYPE_IQD) && in qeth_l3_hard_start_xmit()
2937 (((card->options.cq != QETH_CQ_ENABLED) && !ipv) || in qeth_l3_hard_start_xmit()
2938 ((card->options.cq == QETH_CQ_ENABLED) && in qeth_l3_hard_start_xmit()
2940 card->options.sniffer) in qeth_l3_hard_start_xmit()
2943 if ((card->state != CARD_STATE_UP) || !card->lan_online) { in qeth_l3_hard_start_xmit()
2944 card->stats.tx_carrier_errors++; in qeth_l3_hard_start_xmit()
2949 (card->info.broadcast_capable == 0)) in qeth_l3_hard_start_xmit()
2952 if (card->options.performance_stats) { in qeth_l3_hard_start_xmit()
2953 card->perf_stats.outbound_cnt++; in qeth_l3_hard_start_xmit()
2954 card->perf_stats.outbound_start_time = qeth_get_micros(); in qeth_l3_hard_start_xmit()
2959 if ((card->info.type == QETH_CARD_TYPE_IQD) && (!large_send) && in qeth_l3_hard_start_xmit()
2978 if (card->info.type == QETH_CARD_TYPE_IQD) { in qeth_l3_hard_start_xmit()
3008 if (card->options.performance_stats) in qeth_l3_hard_start_xmit()
3009 card->perf_stats.tx_lin++; in qeth_l3_hard_start_xmit()
3017 qeth_l3_fill_header(card, hdr, new_skb, ipv, cast_type); in qeth_l3_hard_start_xmit()
3018 qeth_tso_fill_header(card, hdr, new_skb); in qeth_l3_hard_start_xmit()
3024 qeth_l3_fill_header(card, hdr, new_skb, ipv, in qeth_l3_hard_start_xmit()
3028 qeth_l3_fill_af_iucv_hdr(card, hdr, new_skb); in qeth_l3_hard_start_xmit()
3030 qeth_l3_fill_header(card, hdr, new_skb, ipv, in qeth_l3_hard_start_xmit()
3037 qeth_l3_hdr_csum(card, hdr, new_skb); in qeth_l3_hard_start_xmit()
3040 elems = qeth_get_elements_no(card, new_skb, elements_needed); in qeth_l3_hard_start_xmit()
3049 if (card->info.type != QETH_CARD_TYPE_IQD) { in qeth_l3_hard_start_xmit()
3060 rc = qeth_do_send_packet(card, queue, new_skb, hdr, in qeth_l3_hard_start_xmit()
3063 rc = qeth_do_send_packet_fast(card, queue, new_skb, hdr, in qeth_l3_hard_start_xmit()
3067 card->stats.tx_packets++; in qeth_l3_hard_start_xmit()
3068 card->stats.tx_bytes += tx_bytes; in qeth_l3_hard_start_xmit()
3071 if (card->options.performance_stats) { in qeth_l3_hard_start_xmit()
3073 card->perf_stats.large_send_bytes += tx_bytes; in qeth_l3_hard_start_xmit()
3074 card->perf_stats.large_send_cnt++; in qeth_l3_hard_start_xmit()
3077 card->perf_stats.sg_skbs_sent++; in qeth_l3_hard_start_xmit()
3079 card->perf_stats.sg_frags_sent += nr_frags + 1; in qeth_l3_hard_start_xmit()
3096 if (card->options.performance_stats) in qeth_l3_hard_start_xmit()
3097 card->perf_stats.outbound_time += qeth_get_micros() - in qeth_l3_hard_start_xmit()
3098 card->perf_stats.outbound_start_time; in qeth_l3_hard_start_xmit()
3102 card->stats.tx_dropped++; in qeth_l3_hard_start_xmit()
3103 card->stats.tx_errors++; in qeth_l3_hard_start_xmit()
3113 struct qeth_card *card = dev->ml_priv; in __qeth_l3_open() local
3116 QETH_CARD_TEXT(card, 4, "qethopen"); in __qeth_l3_open()
3117 if (card->state == CARD_STATE_UP) in __qeth_l3_open()
3119 if (card->state != CARD_STATE_SOFTSETUP) in __qeth_l3_open()
3121 card->data.state = CH_STATE_UP; in __qeth_l3_open()
3122 card->state = CARD_STATE_UP; in __qeth_l3_open()
3125 if (qdio_stop_irq(card->data.ccwdev, 0) >= 0) { in __qeth_l3_open()
3126 napi_enable(&card->napi); in __qeth_l3_open()
3127 napi_schedule(&card->napi); in __qeth_l3_open()
3135 struct qeth_card *card = dev->ml_priv; in qeth_l3_open() local
3137 QETH_CARD_TEXT(card, 5, "qethope_"); in qeth_l3_open()
3138 if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { in qeth_l3_open()
3139 QETH_CARD_TEXT(card, 3, "openREC"); in qeth_l3_open()
3147 struct qeth_card *card = dev->ml_priv; in qeth_l3_stop() local
3149 QETH_CARD_TEXT(card, 4, "qethstop"); in qeth_l3_stop()
3151 if (card->state == CARD_STATE_UP) { in qeth_l3_stop()
3152 card->state = CARD_STATE_SOFTSETUP; in qeth_l3_stop()
3153 napi_disable(&card->napi); in qeth_l3_stop()
3161 struct qeth_card *card = dev->ml_priv; in qeth_l3_fix_features() local
3163 if (!qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) in qeth_l3_fix_features()
3165 if (!qeth_is_supported(card, IPA_OUTBOUND_TSO)) in qeth_l3_fix_features()
3167 if (!qeth_is_supported(card, IPA_INBOUND_CHECKSUM)) in qeth_l3_fix_features()
3176 struct qeth_card *card = dev->ml_priv; in qeth_l3_set_features() local
3183 if (card->state == CARD_STATE_DOWN || in qeth_l3_set_features()
3184 card->state == CARD_STATE_RECOVER) in qeth_l3_set_features()
3187 err = qeth_l3_set_rx_csum(card, features & NETIF_F_RXCSUM); in qeth_l3_set_features()
3260 static int qeth_l3_setup_netdev(struct qeth_card *card) in qeth_l3_setup_netdev() argument
3262 if (card->info.type == QETH_CARD_TYPE_OSD || in qeth_l3_setup_netdev()
3263 card->info.type == QETH_CARD_TYPE_OSX) { in qeth_l3_setup_netdev()
3264 if ((card->info.link_type == QETH_LINK_TYPE_LANE_TR) || in qeth_l3_setup_netdev()
3265 (card->info.link_type == QETH_LINK_TYPE_HSTR)) { in qeth_l3_setup_netdev()
3269 card->dev = alloc_etherdev(0); in qeth_l3_setup_netdev()
3270 if (!card->dev) in qeth_l3_setup_netdev()
3272 card->dev->netdev_ops = &qeth_l3_osa_netdev_ops; in qeth_l3_setup_netdev()
3275 qeth_l3_get_unique_id(card); in qeth_l3_setup_netdev()
3276 if (!(card->info.unique_id & UNIQUE_ID_NOT_BY_CARD)) in qeth_l3_setup_netdev()
3277 card->dev->dev_id = card->info.unique_id & in qeth_l3_setup_netdev()
3279 if (!card->info.guestlan) { in qeth_l3_setup_netdev()
3280 card->dev->hw_features = NETIF_F_SG | in qeth_l3_setup_netdev()
3283 card->dev->features = NETIF_F_RXCSUM; in qeth_l3_setup_netdev()
3286 } else if (card->info.type == QETH_CARD_TYPE_IQD) { in qeth_l3_setup_netdev()
3287 card->dev = alloc_netdev(0, "hsi%d", ether_setup); in qeth_l3_setup_netdev()
3288 if (!card->dev) in qeth_l3_setup_netdev()
3290 card->dev->flags |= IFF_NOARP; in qeth_l3_setup_netdev()
3291 card->dev->netdev_ops = &qeth_l3_netdev_ops; in qeth_l3_setup_netdev()
3292 qeth_l3_iqd_read_initial_mac(card); in qeth_l3_setup_netdev()
3293 if (card->options.hsuid[0]) in qeth_l3_setup_netdev()
3294 memcpy(card->dev->perm_addr, card->options.hsuid, 9); in qeth_l3_setup_netdev()
3298 card->dev->ml_priv = card; in qeth_l3_setup_netdev()
3299 card->dev->watchdog_timeo = QETH_TX_TIMEOUT; in qeth_l3_setup_netdev()
3300 card->dev->mtu = card->info.initial_mtu; in qeth_l3_setup_netdev()
3301 SET_ETHTOOL_OPS(card->dev, &qeth_l3_ethtool_ops); in qeth_l3_setup_netdev()
3302 card->dev->features |= NETIF_F_HW_VLAN_CTAG_TX | in qeth_l3_setup_netdev()
3305 card->dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; in qeth_l3_setup_netdev()
3306 card->dev->gso_max_size = 15 * PAGE_SIZE; in qeth_l3_setup_netdev()
3308 SET_NETDEV_DEV(card->dev, &card->gdev->dev); in qeth_l3_setup_netdev()
3309 netif_napi_add(card->dev, &card->napi, qeth_l3_poll, QETH_NAPI_WEIGHT); in qeth_l3_setup_netdev()
3310 return register_netdev(card->dev); in qeth_l3_setup_netdev()
3315 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l3_probe_device() local
3318 card->options.layer2 = 0; in qeth_l3_probe_device()
3319 card->info.hwtrap = 0; in qeth_l3_probe_device()
3325 struct qeth_card *card = dev_get_drvdata(&cgdev->dev); in qeth_l3_remove_device() local
3329 qeth_set_allowed_threads(card, 0, 1); in qeth_l3_remove_device()
3330 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); in qeth_l3_remove_device()
3335 if (card->dev) { in qeth_l3_remove_device()
3336 unregister_netdev(card->dev); in qeth_l3_remove_device()
3337 card->dev = NULL; in qeth_l3_remove_device()
3340 qeth_l3_clear_ip_list(card, 0); in qeth_l3_remove_device()
3341 qeth_l3_clear_ipato_list(card); in qeth_l3_remove_device()
3347 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in __qeth_l3_set_online() local
3351 mutex_lock(&card->discipline_mutex); in __qeth_l3_set_online()
3352 mutex_lock(&card->conf_mutex); in __qeth_l3_set_online()
3354 QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); in __qeth_l3_set_online()
3356 recover_flag = card->state; in __qeth_l3_set_online()
3357 rc = qeth_core_hardsetup_card(card); in __qeth_l3_set_online()
3364 if (!card->dev && qeth_l3_setup_netdev(card)) { in __qeth_l3_set_online()
3369 if (qeth_is_diagass_supported(card, QETH_DIAGS_CMD_TRAP)) { in __qeth_l3_set_online()
3370 if (card->info.hwtrap && in __qeth_l3_set_online()
3371 qeth_hw_trap(card, QETH_DIAGS_TRAP_ARM)) in __qeth_l3_set_online()
3372 card->info.hwtrap = 0; in __qeth_l3_set_online()
3374 card->info.hwtrap = 0; in __qeth_l3_set_online()
3376 card->state = CARD_STATE_HARDSETUP; in __qeth_l3_set_online()
3377 memset(&card->rx, 0, sizeof(struct qeth_rx)); in __qeth_l3_set_online()
3378 qeth_print_status_message(card); in __qeth_l3_set_online()
3383 rc = qeth_send_startlan(card); in __qeth_l3_set_online()
3387 dev_warn(&card->gdev->dev, in __qeth_l3_set_online()
3389 card->lan_online = 0; in __qeth_l3_set_online()
3395 card->lan_online = 1; in __qeth_l3_set_online()
3398 rc = qeth_l3_setadapter_parms(card); in __qeth_l3_set_online()
3401 if (!card->options.sniffer) { in __qeth_l3_set_online()
3402 rc = qeth_l3_start_ipassists(card); in __qeth_l3_set_online()
3407 rc = qeth_l3_setrouting_v4(card); in __qeth_l3_set_online()
3410 rc = qeth_l3_setrouting_v6(card); in __qeth_l3_set_online()
3414 netif_tx_disable(card->dev); in __qeth_l3_set_online()
3416 rc = qeth_init_qdio_queues(card); in __qeth_l3_set_online()
3422 card->state = CARD_STATE_SOFTSETUP; in __qeth_l3_set_online()
3424 qeth_set_allowed_threads(card, 0xffffffff, 0); in __qeth_l3_set_online()
3425 qeth_l3_set_ip_addr_list(card); in __qeth_l3_set_online()
3426 if (card->lan_online) in __qeth_l3_set_online()
3427 netif_carrier_on(card->dev); in __qeth_l3_set_online()
3429 netif_carrier_off(card->dev); in __qeth_l3_set_online()
3433 __qeth_l3_open(card->dev); in __qeth_l3_set_online()
3435 dev_open(card->dev); in __qeth_l3_set_online()
3436 qeth_l3_set_multicast_list(card->dev); in __qeth_l3_set_online()
3439 qeth_trace_features(card); in __qeth_l3_set_online()
3442 mutex_unlock(&card->conf_mutex); in __qeth_l3_set_online()
3443 mutex_unlock(&card->discipline_mutex); in __qeth_l3_set_online()
3446 qeth_l3_stop_card(card, 0); in __qeth_l3_set_online()
3447 ccw_device_set_offline(CARD_DDEV(card)); in __qeth_l3_set_online()
3448 ccw_device_set_offline(CARD_WDEV(card)); in __qeth_l3_set_online()
3449 ccw_device_set_offline(CARD_RDEV(card)); in __qeth_l3_set_online()
3451 card->state = CARD_STATE_RECOVER; in __qeth_l3_set_online()
3453 card->state = CARD_STATE_DOWN; in __qeth_l3_set_online()
3454 mutex_unlock(&card->conf_mutex); in __qeth_l3_set_online()
3455 mutex_unlock(&card->discipline_mutex); in __qeth_l3_set_online()
3467 struct qeth_card *card = dev_get_drvdata(&cgdev->dev); in __qeth_l3_set_offline() local
3471 mutex_lock(&card->discipline_mutex); in __qeth_l3_set_offline()
3472 mutex_lock(&card->conf_mutex); in __qeth_l3_set_offline()
3474 QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *)); in __qeth_l3_set_offline()
3476 if (card->dev && netif_carrier_ok(card->dev)) in __qeth_l3_set_offline()
3477 netif_carrier_off(card->dev); in __qeth_l3_set_offline()
3478 recover_flag = card->state; in __qeth_l3_set_offline()
3479 if ((!recovery_mode && card->info.hwtrap) || card->info.hwtrap == 2) { in __qeth_l3_set_offline()
3480 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in __qeth_l3_set_offline()
3481 card->info.hwtrap = 1; in __qeth_l3_set_offline()
3483 qeth_l3_stop_card(card, recovery_mode); in __qeth_l3_set_offline()
3484 if ((card->options.cq == QETH_CQ_ENABLED) && card->dev) { in __qeth_l3_set_offline()
3486 call_netdevice_notifiers(NETDEV_REBOOT, card->dev); in __qeth_l3_set_offline()
3489 rc = ccw_device_set_offline(CARD_DDEV(card)); in __qeth_l3_set_offline()
3490 rc2 = ccw_device_set_offline(CARD_WDEV(card)); in __qeth_l3_set_offline()
3491 rc3 = ccw_device_set_offline(CARD_RDEV(card)); in __qeth_l3_set_offline()
3497 card->state = CARD_STATE_RECOVER; in __qeth_l3_set_offline()
3500 mutex_unlock(&card->conf_mutex); in __qeth_l3_set_offline()
3501 mutex_unlock(&card->discipline_mutex); in __qeth_l3_set_offline()
3512 struct qeth_card *card; in qeth_l3_recover() local
3515 card = (struct qeth_card *) ptr; in qeth_l3_recover()
3516 QETH_CARD_TEXT(card, 2, "recover1"); in qeth_l3_recover()
3517 QETH_CARD_HEX(card, 2, &card, sizeof(void *)); in qeth_l3_recover()
3518 if (!qeth_do_run_thread(card, QETH_RECOVER_THREAD)) in qeth_l3_recover()
3520 QETH_CARD_TEXT(card, 2, "recover2"); in qeth_l3_recover()
3521 dev_warn(&card->gdev->dev, in qeth_l3_recover()
3523 qeth_set_recovery_task(card); in qeth_l3_recover()
3524 __qeth_l3_set_offline(card->gdev, 1); in qeth_l3_recover()
3525 rc = __qeth_l3_set_online(card->gdev, 1); in qeth_l3_recover()
3527 dev_info(&card->gdev->dev, in qeth_l3_recover()
3530 qeth_close_dev(card); in qeth_l3_recover()
3531 dev_warn(&card->gdev->dev, "The qeth device driver " in qeth_l3_recover()
3534 qeth_clear_recovery_task(card); in qeth_l3_recover()
3535 qeth_clear_thread_start_bit(card, QETH_RECOVER_THREAD); in qeth_l3_recover()
3536 qeth_clear_thread_running_bit(card, QETH_RECOVER_THREAD); in qeth_l3_recover()
3542 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l3_shutdown() local
3543 qeth_set_allowed_threads(card, 0, 1); in qeth_l3_shutdown()
3544 if ((gdev->state == CCWGROUP_ONLINE) && card->info.hwtrap) in qeth_l3_shutdown()
3545 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_l3_shutdown()
3546 qeth_qdio_clear_card(card, 0); in qeth_l3_shutdown()
3547 qeth_clear_qdio_buffers(card); in qeth_l3_shutdown()
3552 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l3_pm_suspend() local
3554 if (card->dev) in qeth_l3_pm_suspend()
3555 netif_device_detach(card->dev); in qeth_l3_pm_suspend()
3556 qeth_set_allowed_threads(card, 0, 1); in qeth_l3_pm_suspend()
3557 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); in qeth_l3_pm_suspend()
3560 if (card->state == CARD_STATE_UP) { in qeth_l3_pm_suspend()
3561 if (card->info.hwtrap) in qeth_l3_pm_suspend()
3562 qeth_hw_trap(card, QETH_DIAGS_TRAP_DISARM); in qeth_l3_pm_suspend()
3563 __qeth_l3_set_offline(card->gdev, 1); in qeth_l3_pm_suspend()
3565 __qeth_l3_set_offline(card->gdev, 0); in qeth_l3_pm_suspend()
3571 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l3_pm_resume() local
3577 if (card->state == CARD_STATE_RECOVER) { in qeth_l3_pm_resume()
3578 rc = __qeth_l3_set_online(card->gdev, 1); in qeth_l3_pm_resume()
3581 dev_close(card->dev); in qeth_l3_pm_resume()
3585 rc = __qeth_l3_set_online(card->gdev, 0); in qeth_l3_pm_resume()
3587 qeth_set_allowed_threads(card, 0xffffffff, 0); in qeth_l3_pm_resume()
3588 if (card->dev) in qeth_l3_pm_resume()
3589 netif_device_attach(card->dev); in qeth_l3_pm_resume()
3591 dev_warn(&card->gdev->dev, "The qeth device driver " in qeth_l3_pm_resume()
3618 struct qeth_card *card; in qeth_l3_ip_event() local
3623 card = qeth_l3_get_card_from_dev(dev); in qeth_l3_ip_event()
3624 if (!card) in qeth_l3_ip_event()
3626 QETH_CARD_TEXT(card, 3, "ipevent"); in qeth_l3_ip_event()
3638 if (!qeth_l3_add_ip(card, addr)) in qeth_l3_ip_event()
3642 if (!qeth_l3_delete_ip(card, addr)) in qeth_l3_ip_event()
3648 qeth_l3_set_ip_addr_list(card); in qeth_l3_ip_event()
3668 struct qeth_card *card; in qeth_l3_ip6_event() local
3670 card = qeth_l3_get_card_from_dev(dev); in qeth_l3_ip6_event()
3671 if (!card) in qeth_l3_ip6_event()
3673 QETH_CARD_TEXT(card, 3, "ip6event"); in qeth_l3_ip6_event()
3674 if (!qeth_is_supported(card, IPA_IPV6)) in qeth_l3_ip6_event()
3687 if (!qeth_l3_add_ip(card, addr)) in qeth_l3_ip6_event()
3691 if (!qeth_l3_delete_ip(card, addr)) in qeth_l3_ip6_event()
3697 qeth_l3_set_ip_addr_list(card); in qeth_l3_ip6_event()