Lines Matching full:card
31 static int qeth_l2_setdelmac_makerc(struct qeth_card *card, u16 retcode) in qeth_l2_setdelmac_makerc() argument
36 QETH_CARD_TEXT_(card, 2, "err%04x", retcode); in qeth_l2_setdelmac_makerc()
65 static int qeth_l2_send_setdelmac_cb(struct qeth_card *card, in qeth_l2_send_setdelmac_cb() argument
71 return qeth_l2_setdelmac_makerc(card, cmd->hdr.return_code); in qeth_l2_send_setdelmac_cb()
74 static int qeth_l2_send_setdelmac(struct qeth_card *card, const __u8 *mac, in qeth_l2_send_setdelmac() argument
80 QETH_CARD_TEXT(card, 2, "L2sdmac"); in qeth_l2_send_setdelmac()
81 iob = qeth_ipa_alloc_cmd(card, ipacmd, QETH_PROT_IPV4, in qeth_l2_send_setdelmac()
88 return qeth_send_ipa_cmd(card, iob, qeth_l2_send_setdelmac_cb, NULL); in qeth_l2_send_setdelmac()
91 static int qeth_l2_send_setmac(struct qeth_card *card, const __u8 *mac) in qeth_l2_send_setmac() argument
95 QETH_CARD_TEXT(card, 2, "L2Setmac"); in qeth_l2_send_setmac()
96 rc = qeth_l2_send_setdelmac(card, mac, IPA_CMD_SETVMAC); in qeth_l2_send_setmac()
98 dev_info(&card->gdev->dev, in qeth_l2_send_setmac()
103 dev_warn(&card->gdev->dev, in qeth_l2_send_setmac()
107 dev_warn(&card->gdev->dev, in qeth_l2_send_setmac()
115 static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) in qeth_l2_write_mac() argument
121 QETH_CARD_TEXT(card, 2, "L2Wmac"); in qeth_l2_write_mac()
122 rc = qeth_l2_send_setdelmac(card, mac, cmd); in qeth_l2_write_mac()
125 ether_addr_to_u64(mac), CARD_DEVID(card)); in qeth_l2_write_mac()
128 ether_addr_to_u64(mac), CARD_DEVID(card), rc); in qeth_l2_write_mac()
132 static int qeth_l2_remove_mac(struct qeth_card *card, u8 *mac) in qeth_l2_remove_mac() argument
138 QETH_CARD_TEXT(card, 2, "L2Rmac"); in qeth_l2_remove_mac()
139 rc = qeth_l2_send_setdelmac(card, mac, cmd); in qeth_l2_remove_mac()
142 ether_addr_to_u64(mac), CARD_DEVID(card), rc); in qeth_l2_remove_mac()
146 static void qeth_l2_drain_rx_mode_cache(struct qeth_card *card) in qeth_l2_drain_rx_mode_cache() argument
152 hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) { in qeth_l2_drain_rx_mode_cache()
192 static int qeth_l2_setdelvlan_makerc(struct qeth_card *card, u16 retcode) in qeth_l2_setdelvlan_makerc() argument
195 QETH_CARD_TEXT_(card, 2, "err%04x", retcode); in qeth_l2_setdelvlan_makerc()
213 static int qeth_l2_send_setdelvlan_cb(struct qeth_card *card, in qeth_l2_send_setdelvlan_cb() argument
219 QETH_CARD_TEXT(card, 2, "L2sdvcb"); in qeth_l2_send_setdelvlan_cb()
223 CARD_DEVID(card), cmd->hdr.return_code); in qeth_l2_send_setdelvlan_cb()
224 QETH_CARD_TEXT_(card, 2, "L2VL%4x", cmd->hdr.command); in qeth_l2_send_setdelvlan_cb()
226 return qeth_l2_setdelvlan_makerc(card, cmd->hdr.return_code); in qeth_l2_send_setdelvlan_cb()
229 static int qeth_l2_send_setdelvlan(struct qeth_card *card, __u16 i, in qeth_l2_send_setdelvlan() argument
235 QETH_CARD_TEXT_(card, 4, "L2sdv%x", ipacmd); in qeth_l2_send_setdelvlan()
236 iob = qeth_ipa_alloc_cmd(card, ipacmd, QETH_PROT_IPV4, in qeth_l2_send_setdelvlan()
242 return qeth_send_ipa_cmd(card, iob, qeth_l2_send_setdelvlan_cb, NULL); in qeth_l2_send_setdelvlan()
248 struct qeth_card *card = dev->ml_priv; in qeth_l2_vlan_rx_add_vid() local
250 QETH_CARD_TEXT_(card, 4, "aid:%d", vid); in qeth_l2_vlan_rx_add_vid()
254 return qeth_l2_send_setdelvlan(card, vid, IPA_CMD_SETVLAN); in qeth_l2_vlan_rx_add_vid()
260 struct qeth_card *card = dev->ml_priv; in qeth_l2_vlan_rx_kill_vid() local
262 QETH_CARD_TEXT_(card, 4, "kid:%d", vid); in qeth_l2_vlan_rx_kill_vid()
266 return qeth_l2_send_setdelvlan(card, vid, IPA_CMD_DELVLAN); in qeth_l2_vlan_rx_kill_vid()
269 static void qeth_l2_set_pnso_mode(struct qeth_card *card, in qeth_l2_set_pnso_mode() argument
272 spin_lock_irq(get_ccwdev_lock(CARD_RDEV(card))); in qeth_l2_set_pnso_mode()
273 WRITE_ONCE(card->info.pnso_mode, mode); in qeth_l2_set_pnso_mode()
274 spin_unlock_irq(get_ccwdev_lock(CARD_RDEV(card))); in qeth_l2_set_pnso_mode()
277 drain_workqueue(card->event_wq); in qeth_l2_set_pnso_mode()
280 static void qeth_l2_dev2br_fdb_flush(struct qeth_card *card) in qeth_l2_dev2br_fdb_flush() argument
284 QETH_CARD_TEXT(card, 2, "fdbflush"); in qeth_l2_dev2br_fdb_flush()
293 card->dev, &info.info, NULL); in qeth_l2_dev2br_fdb_flush()
296 static int qeth_l2_request_initial_mac(struct qeth_card *card) in qeth_l2_request_initial_mac() argument
300 QETH_CARD_TEXT(card, 2, "l2reqmac"); in qeth_l2_request_initial_mac()
303 rc = qeth_vm_request_mac(card); in qeth_l2_request_initial_mac()
307 CARD_DEVID(card), rc); in qeth_l2_request_initial_mac()
308 QETH_CARD_TEXT_(card, 2, "err%04x", rc); in qeth_l2_request_initial_mac()
312 rc = qeth_setadpparms_change_macaddr(card); in qeth_l2_request_initial_mac()
316 CARD_DEVID(card), rc); in qeth_l2_request_initial_mac()
317 QETH_CARD_TEXT_(card, 2, "1err%04x", rc); in qeth_l2_request_initial_mac()
322 if (IS_OSM(card) || IS_OSX(card)) in qeth_l2_request_initial_mac()
324 eth_hw_addr_random(card->dev); in qeth_l2_request_initial_mac()
327 QETH_CARD_HEX(card, 2, card->dev->dev_addr, card->dev->addr_len); in qeth_l2_request_initial_mac()
331 static void qeth_l2_register_dev_addr(struct qeth_card *card) in qeth_l2_register_dev_addr() argument
333 if (!is_valid_ether_addr(card->dev->dev_addr)) in qeth_l2_register_dev_addr()
334 qeth_l2_request_initial_mac(card); in qeth_l2_register_dev_addr()
336 if (!qeth_l2_send_setmac(card, card->dev->dev_addr)) in qeth_l2_register_dev_addr()
337 card->info.dev_addr_is_registered = 1; in qeth_l2_register_dev_addr()
339 card->info.dev_addr_is_registered = 0; in qeth_l2_register_dev_addr()
344 struct qeth_card *card = dev->ml_priv; in qeth_l2_validate_addr() local
346 if (card->info.dev_addr_is_registered) in qeth_l2_validate_addr()
349 QETH_CARD_TEXT(card, 4, "nomacadr"); in qeth_l2_validate_addr()
356 struct qeth_card *card = dev->ml_priv; in qeth_l2_set_mac_address() local
360 QETH_CARD_TEXT(card, 3, "setmac"); in qeth_l2_set_mac_address()
362 if (IS_OSM(card) || IS_OSX(card)) { in qeth_l2_set_mac_address()
363 QETH_CARD_TEXT(card, 3, "setmcTYP"); in qeth_l2_set_mac_address()
366 QETH_CARD_HEX(card, 3, addr->sa_data, ETH_ALEN); in qeth_l2_set_mac_address()
372 card->info.dev_addr_is_registered) in qeth_l2_set_mac_address()
376 rc = qeth_l2_send_setmac(card, addr->sa_data); in qeth_l2_set_mac_address()
382 if (card->info.dev_addr_is_registered) in qeth_l2_set_mac_address()
383 qeth_l2_remove_mac(card, old_addr); in qeth_l2_set_mac_address()
384 card->info.dev_addr_is_registered = 1; in qeth_l2_set_mac_address()
388 static void qeth_l2_promisc_to_bridge(struct qeth_card *card, bool enable) in qeth_l2_promisc_to_bridge() argument
393 QETH_CARD_TEXT(card, 3, "pmisc2br"); in qeth_l2_promisc_to_bridge()
396 if (card->options.sbp.reflect_promisc_primary) in qeth_l2_promisc_to_bridge()
403 rc = qeth_bridgeport_setrole(card, role); in qeth_l2_promisc_to_bridge()
404 QETH_CARD_TEXT_(card, 2, "bpm%c%04x", enable ? '+' : '-', rc); in qeth_l2_promisc_to_bridge()
406 card->options.sbp.role = role; in qeth_l2_promisc_to_bridge()
407 card->info.promisc_mode = enable; in qeth_l2_promisc_to_bridge()
411 static void qeth_l2_set_promisc_mode(struct qeth_card *card) in qeth_l2_set_promisc_mode() argument
413 bool enable = card->dev->flags & IFF_PROMISC; in qeth_l2_set_promisc_mode()
415 if (card->info.promisc_mode == enable) in qeth_l2_set_promisc_mode()
418 if (qeth_adp_supported(card, IPA_SETADP_SET_PROMISC_MODE)) { in qeth_l2_set_promisc_mode()
419 qeth_setadp_promisc_mode(card, enable); in qeth_l2_set_promisc_mode()
421 mutex_lock(&card->sbp_lock); in qeth_l2_set_promisc_mode()
422 if (card->options.sbp.reflect_promisc) in qeth_l2_set_promisc_mode()
423 qeth_l2_promisc_to_bridge(card, enable); in qeth_l2_set_promisc_mode()
424 mutex_unlock(&card->sbp_lock); in qeth_l2_set_promisc_mode()
428 /* New MAC address is added to the hash table and marked to be written on card
432 static void qeth_l2_add_mac(struct qeth_card *card, struct netdev_hw_addr *ha) in qeth_l2_add_mac() argument
437 hash_for_each_possible(card->rx_mode_addrs, mac, hnode, mac_hash) { in qeth_l2_add_mac()
451 hash_add(card->rx_mode_addrs, &mac->hnode, mac_hash); in qeth_l2_add_mac()
456 struct qeth_card *card = container_of(work, struct qeth_card, in qeth_l2_rx_mode_work() local
458 struct net_device *dev = card->dev; in qeth_l2_rx_mode_work()
465 QETH_CARD_TEXT(card, 3, "setmulti"); in qeth_l2_rx_mode_work()
469 qeth_l2_add_mac(card, ha); in qeth_l2_rx_mode_work()
471 qeth_l2_add_mac(card, ha); in qeth_l2_rx_mode_work()
474 hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) { in qeth_l2_rx_mode_work()
477 qeth_l2_remove_mac(card, mac->mac_addr); in qeth_l2_rx_mode_work()
482 rc = qeth_l2_write_mac(card, mac->mac_addr); in qeth_l2_rx_mode_work()
495 qeth_l2_set_promisc_mode(card); in qeth_l2_rx_mode_work()
501 struct qeth_card *card = dev->ml_priv; in qeth_l2_hard_start_xmit() local
508 if (IS_IQD(card)) in qeth_l2_hard_start_xmit()
510 queue = card->qdio.out_qs[txq]; in qeth_l2_hard_start_xmit()
512 rc = qeth_xmit(card, skb, queue, vlan_get_protocol(skb), in qeth_l2_hard_start_xmit()
531 struct qeth_card *card = dev->ml_priv; in qeth_l2_set_rx_mode() local
533 schedule_work(&card->rx_mode_work); in qeth_l2_set_rx_mode()
538 * @card: qeth_card structure pointer
550 static int qeth_l2_pnso(struct qeth_card *card, u8 oc, int cnc, in qeth_l2_pnso() argument
554 struct ccw_device *ddev = CARD_DDEV(card); in qeth_l2_pnso()
565 QETH_CARD_TEXT(card, 2, "PNSO"); in qeth_l2_pnso()
598 QETH_CARD_TEXT_(card, 2, "PNrp%04x", rr->response.code); in qeth_l2_pnso()
604 static bool qeth_is_my_net_if_token(struct qeth_card *card, in qeth_is_my_net_if_token() argument
607 return ((card->info.ddev_devno == token->devnum) && in qeth_is_my_net_if_token()
608 (card->info.cssid == token->cssid) && in qeth_is_my_net_if_token()
609 (card->info.iid == token->iid) && in qeth_is_my_net_if_token()
610 (card->info.ssid == token->ssid) && in qeth_is_my_net_if_token()
611 (card->info.chpid == token->chpid) && in qeth_is_my_net_if_token()
612 (card->info.chid == token->chid)); in qeth_is_my_net_if_token()
617 * @card: qeth_card structure pointer
627 static void qeth_l2_dev2br_fdb_notify(struct qeth_card *card, u8 code, in qeth_l2_dev2br_fdb_notify() argument
642 if (qeth_is_my_net_if_token(card, token)) in qeth_l2_dev2br_fdb_notify()
653 card->dev, &info.info, NULL); in qeth_l2_dev2br_fdb_notify()
654 QETH_CARD_TEXT(card, 4, "andelmac"); in qeth_l2_dev2br_fdb_notify()
655 QETH_CARD_TEXT_(card, 4, in qeth_l2_dev2br_fdb_notify()
659 card->dev, &info.info, NULL); in qeth_l2_dev2br_fdb_notify()
660 QETH_CARD_TEXT(card, 4, "anaddmac"); in qeth_l2_dev2br_fdb_notify()
661 QETH_CARD_TEXT_(card, 4, in qeth_l2_dev2br_fdb_notify()
670 struct qeth_card *card = priv; in qeth_l2_dev2br_an_set_cb() local
674 qeth_l2_dev2br_fdb_notify(card, code, in qeth_l2_dev2br_an_set_cb()
682 * @card: qeth_card structure pointer
690 static int qeth_l2_dev2br_an_set(struct qeth_card *card, bool enable) in qeth_l2_dev2br_an_set() argument
695 QETH_CARD_TEXT(card, 2, "anseton"); in qeth_l2_dev2br_an_set()
696 rc = qeth_l2_pnso(card, PNSO_OC_NET_ADDR_INFO, 1, in qeth_l2_dev2br_an_set()
697 qeth_l2_dev2br_an_set_cb, card); in qeth_l2_dev2br_an_set()
702 qeth_l2_pnso(card, PNSO_OC_NET_ADDR_INFO, 0, in qeth_l2_dev2br_an_set()
705 QETH_CARD_TEXT(card, 2, "ansetoff"); in qeth_l2_dev2br_an_set()
706 rc = qeth_l2_pnso(card, PNSO_OC_NET_ADDR_INFO, 0, NULL, NULL); in qeth_l2_dev2br_an_set()
756 struct qeth_card *card = lsyncdev->ml_priv; in qeth_l2_br2dev_worker() local
761 QETH_CARD_TEXT_(card, 4, "b2dw%04lx", event); in qeth_l2_br2dev_worker()
762 QETH_CARD_TEXT_(card, 4, "ma%012llx", ether_addr_to_u64(addr)); in qeth_l2_br2dev_worker()
789 QETH_CARD_TEXT(card, 2, "b2derris"); in qeth_l2_br2dev_worker()
790 QETH_CARD_TEXT_(card, 2, in qeth_l2_br2dev_worker()
809 QETH_CARD_TEXT_(card, 2, "b2derr%02lx", event); in qeth_l2_br2dev_worker()
827 struct qeth_card *card; in qeth_l2_br2dev_queue_work() local
839 card = lsyncdev->ml_priv; in qeth_l2_br2dev_queue_work()
844 queue_work(card->event_wq, &worker_data->work); in qeth_l2_br2dev_queue_work()
856 struct qeth_card *card; in qeth_l2_switchdev_event() local
874 card = lowerdev->ml_priv; in qeth_l2_switchdev_event()
875 QETH_CARD_TEXT_(card, 4, "b2dqw%03lx", event); in qeth_l2_switchdev_event()
880 QETH_CARD_TEXT(card, 2, "b2dqwerr"); in qeth_l2_switchdev_event()
940 struct qeth_card *card = dev->ml_priv; in qeth_l2_bridge_getlink() local
945 qeth_bridgeport_is_in_use(card)) in qeth_l2_bridge_getlink()
972 struct qeth_card *card = dev->ml_priv; in qeth_l2_bridge_setlink() local
1020 mutex_lock(&card->sbp_lock); in qeth_l2_bridge_setlink()
1022 if (qeth_bridgeport_is_in_use(card)) { in qeth_l2_bridge_setlink()
1026 qeth_l2_set_pnso_mode(card, QETH_PNSO_ADDR_INFO); in qeth_l2_bridge_setlink()
1027 rc = qeth_l2_dev2br_an_set(card, true); in qeth_l2_bridge_setlink()
1029 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_l2_bridge_setlink()
1035 rc = qeth_l2_dev2br_an_set(card, false); in qeth_l2_bridge_setlink()
1037 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_l2_bridge_setlink()
1039 qeth_l2_dev2br_fdb_flush(card); in qeth_l2_bridge_setlink()
1043 mutex_unlock(&card->sbp_lock); in qeth_l2_bridge_setlink()
1088 static int qeth_l2_setup_netdev(struct qeth_card *card) in qeth_l2_setup_netdev() argument
1090 card->dev->netdev_ops = IS_IQD(card) ? &qeth_l2_iqd_netdev_ops : in qeth_l2_setup_netdev()
1092 card->dev->needed_headroom = sizeof(struct qeth_hdr); in qeth_l2_setup_netdev()
1093 card->dev->priv_flags |= IFF_UNICAST_FLT; in qeth_l2_setup_netdev()
1095 if (IS_OSM(card)) { in qeth_l2_setup_netdev()
1096 card->dev->features |= NETIF_F_VLAN_CHALLENGED; in qeth_l2_setup_netdev()
1098 if (!IS_VM_NIC(card)) in qeth_l2_setup_netdev()
1099 card->dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; in qeth_l2_setup_netdev()
1100 card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; in qeth_l2_setup_netdev()
1103 if (IS_OSD(card) && !IS_VM_NIC(card)) { in qeth_l2_setup_netdev()
1104 card->dev->features |= NETIF_F_SG; in qeth_l2_setup_netdev()
1106 if (qeth_is_supported(card, IPA_OUTBOUND_CHECKSUM)) { in qeth_l2_setup_netdev()
1107 card->dev->hw_features |= NETIF_F_IP_CSUM; in qeth_l2_setup_netdev()
1108 card->dev->vlan_features |= NETIF_F_IP_CSUM; in qeth_l2_setup_netdev()
1111 if (qeth_is_supported6(card, IPA_OUTBOUND_CHECKSUM_V6)) { in qeth_l2_setup_netdev()
1112 card->dev->hw_features |= NETIF_F_IPV6_CSUM; in qeth_l2_setup_netdev()
1113 card->dev->vlan_features |= NETIF_F_IPV6_CSUM; in qeth_l2_setup_netdev()
1115 if (qeth_is_supported(card, IPA_INBOUND_CHECKSUM) || in qeth_l2_setup_netdev()
1116 qeth_is_supported6(card, IPA_INBOUND_CHECKSUM_V6)) { in qeth_l2_setup_netdev()
1117 card->dev->hw_features |= NETIF_F_RXCSUM; in qeth_l2_setup_netdev()
1118 card->dev->vlan_features |= NETIF_F_RXCSUM; in qeth_l2_setup_netdev()
1120 if (qeth_is_supported(card, IPA_OUTBOUND_TSO)) { in qeth_l2_setup_netdev()
1121 card->dev->hw_features |= NETIF_F_TSO; in qeth_l2_setup_netdev()
1122 card->dev->vlan_features |= NETIF_F_TSO; in qeth_l2_setup_netdev()
1124 if (qeth_is_supported6(card, IPA_OUTBOUND_TSO)) { in qeth_l2_setup_netdev()
1125 card->dev->hw_features |= NETIF_F_TSO6; in qeth_l2_setup_netdev()
1126 card->dev->vlan_features |= NETIF_F_TSO6; in qeth_l2_setup_netdev()
1129 if (card->dev->hw_features & (NETIF_F_TSO | NETIF_F_TSO6)) { in qeth_l2_setup_netdev()
1130 card->dev->needed_headroom = sizeof(struct qeth_hdr_tso); in qeth_l2_setup_netdev()
1131 netif_keep_dst(card->dev); in qeth_l2_setup_netdev()
1132 netif_set_tso_max_size(card->dev, in qeth_l2_setup_netdev()
1136 netif_napi_add(card->dev, &card->napi, qeth_poll); in qeth_l2_setup_netdev()
1137 return register_netdev(card->dev); in qeth_l2_setup_netdev()
1140 static void qeth_l2_trace_features(struct qeth_card *card) in qeth_l2_trace_features() argument
1143 QETH_CARD_TEXT(card, 2, "featuSBP"); in qeth_l2_trace_features()
1144 QETH_CARD_HEX(card, 2, &card->options.sbp.supported_funcs, in qeth_l2_trace_features()
1145 sizeof(card->options.sbp.supported_funcs)); in qeth_l2_trace_features()
1147 QETH_CARD_TEXT(card, 2, "feaVNICC"); in qeth_l2_trace_features()
1148 QETH_CARD_HEX(card, 2, &card->options.vnicc.sup_chars, in qeth_l2_trace_features()
1149 sizeof(card->options.vnicc.sup_chars)); in qeth_l2_trace_features()
1152 static void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card) in qeth_l2_setup_bridgeport_attrs() argument
1154 if (!card->options.sbp.reflect_promisc && in qeth_l2_setup_bridgeport_attrs()
1155 card->options.sbp.role != QETH_SBP_ROLE_NONE) { in qeth_l2_setup_bridgeport_attrs()
1157 qeth_bridgeport_setrole(card, card->options.sbp.role); in qeth_l2_setup_bridgeport_attrs()
1159 qeth_bridgeport_query_ports(card, &card->options.sbp.role, in qeth_l2_setup_bridgeport_attrs()
1162 if (card->options.sbp.hostnotification) { in qeth_l2_setup_bridgeport_attrs()
1163 if (qeth_bridgeport_an_set(card, 1)) in qeth_l2_setup_bridgeport_attrs()
1164 card->options.sbp.hostnotification = 0; in qeth_l2_setup_bridgeport_attrs()
1170 * Detect whether this card supports 'dev to bridge fdb network address
1173 * @card: qeth_card structure pointer
1175 static void qeth_l2_detect_dev2br_support(struct qeth_card *card) in qeth_l2_detect_dev2br_support() argument
1177 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_l2_detect_dev2br_support()
1180 QETH_CARD_TEXT(card, 2, "d2brsup"); in qeth_l2_detect_dev2br_support()
1181 if (!IS_IQD(card)) in qeth_l2_detect_dev2br_support()
1185 dev2br_supported = card->info.ids_valid && in qeth_l2_detect_dev2br_support()
1187 QETH_CARD_TEXT_(card, 2, "D2Bsup%02x", dev2br_supported); in qeth_l2_detect_dev2br_support()
1195 static void qeth_l2_enable_brport_features(struct qeth_card *card) in qeth_l2_enable_brport_features() argument
1197 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_l2_enable_brport_features()
1202 qeth_l2_set_pnso_mode(card, QETH_PNSO_ADDR_INFO); in qeth_l2_enable_brport_features()
1203 rc = qeth_l2_dev2br_an_set(card, true); in qeth_l2_enable_brport_features()
1206 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_l2_enable_brport_features()
1207 qeth_l2_dev2br_fdb_flush(card); in qeth_l2_enable_brport_features()
1208 qeth_l2_set_pnso_mode(card, QETH_PNSO_ADDR_INFO); in qeth_l2_enable_brport_features()
1209 rc = qeth_l2_dev2br_an_set(card, true); in qeth_l2_enable_brport_features()
1212 netdev_err(card->dev, in qeth_l2_enable_brport_features()
1215 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_l2_enable_brport_features()
1216 qeth_l2_dev2br_fdb_flush(card); in qeth_l2_enable_brport_features()
1220 dev_warn(&card->gdev->dev, in qeth_l2_enable_brport_features()
1233 * @card: qeth_card structure pointer, for udev events.
1246 static void qeth_bridge_emit_host_event(struct qeth_card *card, in qeth_bridge_emit_host_event() argument
1293 kobject_uevent_env(&card->gdev->dev.kobj, KOBJ_CHANGE, env); in qeth_bridge_emit_host_event()
1298 struct qeth_card *card; member
1328 kobject_uevent_env(&data->card->gdev->dev.kobj, in qeth_bridge_state_change_worker()
1333 static void qeth_bridge_state_change(struct qeth_card *card, in qeth_bridge_state_change() argument
1339 QETH_CARD_TEXT(card, 2, "brstchng"); in qeth_bridge_state_change()
1341 QETH_CARD_TEXT(card, 2, "BPempty"); in qeth_bridge_state_change()
1345 QETH_CARD_TEXT_(card, 2, "BPsz%04x", qports->entry_length); in qeth_bridge_state_change()
1351 QETH_CARD_TEXT(card, 2, "BPSalloc"); in qeth_bridge_state_change()
1355 data->card = card; in qeth_bridge_state_change()
1360 queue_work(card->event_wq, &data->worker); in qeth_bridge_state_change()
1365 struct qeth_card *card; member
1373 struct qeth_card *card; in qeth_l2_dev2br_worker() local
1379 card = data->card; in qeth_l2_dev2br_worker()
1380 priv = netdev_priv(card->dev); in qeth_l2_dev2br_worker()
1382 QETH_CARD_TEXT(card, 4, "dev2brew"); in qeth_l2_dev2br_worker()
1384 if (READ_ONCE(card->info.pnso_mode) == QETH_PNSO_NONE) in qeth_l2_dev2br_worker()
1390 queue_delayed_work(card->event_wq, dwork, in qeth_l2_dev2br_worker()
1395 if (!netif_device_present(card->dev)) { in qeth_l2_dev2br_worker()
1402 CARD_DEVID(card)); in qeth_l2_dev2br_worker()
1403 /* Card fdb and bridge fdb are out of sync, card has stopped in qeth_l2_dev2br_worker()
1408 qeth_l2_dev2br_fdb_flush(card); in qeth_l2_dev2br_worker()
1409 rc = qeth_l2_dev2br_an_set(card, true); in qeth_l2_dev2br_worker()
1416 netdev_err(card->dev, in qeth_l2_dev2br_worker()
1419 WRITE_ONCE(card->info.pnso_mode, in qeth_l2_dev2br_worker()
1422 qeth_l2_dev2br_fdb_flush(card); in qeth_l2_dev2br_worker()
1427 CARD_DEVID(card)); in qeth_l2_dev2br_worker()
1435 qeth_l2_dev2br_fdb_notify(card, in qeth_l2_dev2br_worker()
1450 struct qeth_card *card; in qeth_addr_change_event_worker() local
1454 card = data->card; in qeth_addr_change_event_worker()
1456 QETH_CARD_TEXT(data->card, 4, "adrchgew"); in qeth_addr_change_event_worker()
1458 if (READ_ONCE(card->info.pnso_mode) == QETH_PNSO_NONE) in qeth_addr_change_event_worker()
1463 if (!mutex_trylock(&card->sbp_lock)) { in qeth_addr_change_event_worker()
1464 queue_delayed_work(card->event_wq, dwork, in qeth_addr_change_event_worker()
1469 dev_info(&data->card->gdev->dev, in qeth_addr_change_event_worker()
1471 netdev_name(card->dev), in qeth_addr_change_event_worker()
1478 data->card->options.sbp.hostnotification = 0; in qeth_addr_change_event_worker()
1479 card->info.pnso_mode = QETH_PNSO_NONE; in qeth_addr_change_event_worker()
1480 mutex_unlock(&data->card->sbp_lock); in qeth_addr_change_event_worker()
1481 qeth_bridge_emit_host_event(data->card, anev_abort, in qeth_addr_change_event_worker()
1487 qeth_bridge_emit_host_event(data->card, in qeth_addr_change_event_worker()
1498 static void qeth_addr_change_event(struct qeth_card *card, in qeth_addr_change_event() argument
1506 if (card->info.pnso_mode == QETH_PNSO_NONE) in qeth_addr_change_event()
1509 QETH_CARD_TEXT(card, 4, "adrchgev"); in qeth_addr_change_event()
1515 QETH_CARD_TEXT_(card, 2, "ACHN%04x", in qeth_addr_change_event()
1525 QETH_CARD_TEXT(card, 2, "ACNalloc"); in qeth_addr_change_event()
1528 if (card->info.pnso_mode == QETH_PNSO_BRIDGEPORT) in qeth_addr_change_event()
1532 data->card = card; in qeth_addr_change_event()
1535 queue_delayed_work(card->event_wq, &data->dwork, 0); in qeth_addr_change_event()
1550 static int qeth_bridgeport_makerc(struct qeth_card *card, in qeth_bridgeport_makerc() argument
1562 if ((IS_IQD(card) && ipa_rc == IPA_RC_SUCCESS) || in qeth_bridgeport_makerc()
1563 (!IS_IQD(card) && ipa_rc == sbp_rc)) { in qeth_bridgeport_makerc()
1575 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1581 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1589 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1594 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1604 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1610 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1616 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1622 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1642 QETH_CARD_TEXT_(card, 2, "SBPi%04x", ipa_rc); in qeth_bridgeport_makerc()
1643 QETH_CARD_TEXT_(card, 2, "SBPc%04x", sbp_rc); in qeth_bridgeport_makerc()
1648 static struct qeth_cmd_buffer *qeth_sbp_build_cmd(struct qeth_card *card, in qeth_sbp_build_cmd() argument
1652 enum qeth_ipa_cmds ipa_cmd = IS_IQD(card) ? IPA_CMD_SETBRIDGEPORT_IQD : in qeth_sbp_build_cmd()
1657 iob = qeth_ipa_alloc_cmd(card, ipa_cmd, QETH_PROT_NONE, in qeth_sbp_build_cmd()
1672 static int qeth_bridgeport_query_support_cb(struct qeth_card *card, in qeth_bridgeport_query_support_cb() argument
1679 QETH_CARD_TEXT(card, 2, "brqsupcb"); in qeth_bridgeport_query_support_cb()
1680 rc = qeth_bridgeport_makerc(card, cmd); in qeth_bridgeport_query_support_cb()
1691 * @card: qeth_card structure pointer.
1694 * strucutre: card->options.sbp.supported_funcs.
1696 static void qeth_bridgeport_query_support(struct qeth_card *card) in qeth_bridgeport_query_support() argument
1701 QETH_CARD_TEXT(card, 2, "brqsuppo"); in qeth_bridgeport_query_support()
1702 iob = qeth_sbp_build_cmd(card, IPA_SBP_QUERY_COMMANDS_SUPPORTED, in qeth_bridgeport_query_support()
1707 if (qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_support_cb, in qeth_bridgeport_query_support()
1709 card->options.sbp.role = QETH_SBP_ROLE_NONE; in qeth_bridgeport_query_support()
1710 card->options.sbp.supported_funcs = 0; in qeth_bridgeport_query_support()
1713 card->options.sbp.supported_funcs = cbctl.data.supported; in qeth_bridgeport_query_support()
1716 static int qeth_bridgeport_query_ports_cb(struct qeth_card *card, in qeth_bridgeport_query_ports_cb() argument
1724 QETH_CARD_TEXT(card, 2, "brqprtcb"); in qeth_bridgeport_query_ports_cb()
1725 rc = qeth_bridgeport_makerc(card, cmd); in qeth_bridgeport_query_ports_cb()
1731 QETH_CARD_TEXT_(card, 2, "SBPs%04x", qports->entry_length); in qeth_bridgeport_query_ports_cb()
1746 * @card: qeth_card structure pointer.
1754 int qeth_bridgeport_query_ports(struct qeth_card *card, in qeth_bridgeport_query_ports() argument
1767 QETH_CARD_TEXT(card, 2, "brqports"); in qeth_bridgeport_query_ports()
1768 if (!(card->options.sbp.supported_funcs & IPA_SBP_QUERY_BRIDGE_PORTS)) in qeth_bridgeport_query_ports()
1770 iob = qeth_sbp_build_cmd(card, IPA_SBP_QUERY_BRIDGE_PORTS, 0); in qeth_bridgeport_query_ports()
1774 return qeth_send_ipa_cmd(card, iob, qeth_bridgeport_query_ports_cb, in qeth_bridgeport_query_ports()
1778 static int qeth_bridgeport_set_cb(struct qeth_card *card, in qeth_bridgeport_set_cb() argument
1783 QETH_CARD_TEXT(card, 2, "brsetrcb"); in qeth_bridgeport_set_cb()
1784 return qeth_bridgeport_makerc(card, cmd); in qeth_bridgeport_set_cb()
1789 * @card: qeth_card structure pointer.
1794 int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role) in qeth_bridgeport_setrole() argument
1800 QETH_CARD_TEXT(card, 2, "brsetrol"); in qeth_bridgeport_setrole()
1815 if (!(card->options.sbp.supported_funcs & setcmd)) in qeth_bridgeport_setrole()
1817 iob = qeth_sbp_build_cmd(card, setcmd, cmdlength); in qeth_bridgeport_setrole()
1821 return qeth_send_ipa_cmd(card, iob, qeth_bridgeport_set_cb, NULL); in qeth_bridgeport_setrole()
1827 struct qeth_card *card = (struct qeth_card *)priv; in qeth_bridgeport_an_set_cb() local
1833 qeth_bridge_emit_host_event(card, anev_reg_unreg, code, in qeth_bridgeport_an_set_cb()
1840 * @card: qeth_card structure pointer.
1848 int qeth_bridgeport_an_set(struct qeth_card *card, int enable) in qeth_bridgeport_an_set() argument
1852 if (!card->options.sbp.supported_funcs) in qeth_bridgeport_an_set()
1856 qeth_bridge_emit_host_event(card, anev_reset, 0, NULL, NULL); in qeth_bridgeport_an_set()
1857 qeth_l2_set_pnso_mode(card, QETH_PNSO_BRIDGEPORT); in qeth_bridgeport_an_set()
1858 rc = qeth_l2_pnso(card, PNSO_OC_NET_BRIDGE_INFO, 1, in qeth_bridgeport_an_set()
1859 qeth_bridgeport_an_set_cb, card); in qeth_bridgeport_an_set()
1861 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_bridgeport_an_set()
1863 rc = qeth_l2_pnso(card, PNSO_OC_NET_BRIDGE_INFO, 0, NULL, NULL); in qeth_bridgeport_an_set()
1864 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_bridgeport_an_set()
1872 static int qeth_l2_vnicc_makerc(struct qeth_card *card, u16 ipa_rc) in qeth_l2_vnicc_makerc() argument
1899 QETH_CARD_TEXT_(card, 2, "err%04x", ipa_rc); in qeth_l2_vnicc_makerc()
1904 static int qeth_l2_vnicc_request_cb(struct qeth_card *card, in qeth_l2_vnicc_request_cb() argument
1912 QETH_CARD_TEXT(card, 2, "vniccrcb"); in qeth_l2_vnicc_request_cb()
1914 return qeth_l2_vnicc_makerc(card, cmd->hdr.return_code); in qeth_l2_vnicc_request_cb()
1916 card->options.vnicc.sup_chars = rep->vnicc_cmds.supported; in qeth_l2_vnicc_request_cb()
1917 card->options.vnicc.cur_chars = rep->vnicc_cmds.enabled; in qeth_l2_vnicc_request_cb()
1927 static struct qeth_cmd_buffer *qeth_l2_vnicc_build_cmd(struct qeth_card *card, in qeth_l2_vnicc_build_cmd() argument
1934 iob = qeth_ipa_alloc_cmd(card, IPA_CMD_VNICC, QETH_PROT_NONE, in qeth_l2_vnicc_build_cmd()
1947 static int qeth_l2_vnicc_query_chars(struct qeth_card *card) in qeth_l2_vnicc_query_chars() argument
1951 QETH_CARD_TEXT(card, 2, "vniccqch"); in qeth_l2_vnicc_query_chars()
1952 iob = qeth_l2_vnicc_build_cmd(card, IPA_VNICC_QUERY_CHARS, 0); in qeth_l2_vnicc_query_chars()
1956 return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, NULL); in qeth_l2_vnicc_query_chars()
1960 static int qeth_l2_vnicc_query_cmds(struct qeth_card *card, u32 vnic_char, in qeth_l2_vnicc_query_cmds() argument
1965 QETH_CARD_TEXT(card, 2, "vniccqcm"); in qeth_l2_vnicc_query_cmds()
1966 iob = qeth_l2_vnicc_build_cmd(card, IPA_VNICC_QUERY_CMDS, in qeth_l2_vnicc_query_cmds()
1973 return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, sup_cmds); in qeth_l2_vnicc_query_cmds()
1977 static int qeth_l2_vnicc_set_char(struct qeth_card *card, u32 vnic_char, in qeth_l2_vnicc_set_char() argument
1982 QETH_CARD_TEXT(card, 2, "vniccedc"); in qeth_l2_vnicc_set_char()
1983 iob = qeth_l2_vnicc_build_cmd(card, cmd, VNICC_DATA_SIZEOF(set_char)); in qeth_l2_vnicc_set_char()
1989 return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, NULL); in qeth_l2_vnicc_set_char()
1993 static int qeth_l2_vnicc_getset_timeout(struct qeth_card *card, u32 vnicc, in qeth_l2_vnicc_getset_timeout() argument
1999 QETH_CARD_TEXT(card, 2, "vniccgst"); in qeth_l2_vnicc_getset_timeout()
2000 iob = qeth_l2_vnicc_build_cmd(card, cmd, in qeth_l2_vnicc_getset_timeout()
2011 return qeth_send_ipa_cmd(card, iob, qeth_l2_vnicc_request_cb, timeout); in qeth_l2_vnicc_getset_timeout()
2015 static bool qeth_l2_vnicc_recover_timeout(struct qeth_card *card, u32 vnicc, in qeth_l2_vnicc_recover_timeout() argument
2018 if (card->options.vnicc.sup_chars & vnicc && in qeth_l2_vnicc_recover_timeout()
2019 card->options.vnicc.getset_timeout_sup & vnicc && in qeth_l2_vnicc_recover_timeout()
2020 !qeth_l2_vnicc_getset_timeout(card, vnicc, IPA_VNICC_SET_TIMEOUT, in qeth_l2_vnicc_recover_timeout()
2028 int qeth_l2_vnicc_set_state(struct qeth_card *card, u32 vnicc, bool state) in qeth_l2_vnicc_set_state() argument
2033 QETH_CARD_TEXT(card, 2, "vniccsch"); in qeth_l2_vnicc_set_state()
2036 if (!(card->options.vnicc.sup_chars & vnicc) || in qeth_l2_vnicc_set_state()
2037 !(card->options.vnicc.set_char_sup & vnicc)) in qeth_l2_vnicc_set_state()
2040 if (qeth_bridgeport_is_in_use(card)) in qeth_l2_vnicc_set_state()
2046 card->options.vnicc.wanted_chars |= vnicc; in qeth_l2_vnicc_set_state()
2049 card->options.vnicc.wanted_chars &= ~vnicc; in qeth_l2_vnicc_set_state()
2053 if (card->options.vnicc.cur_chars == card->options.vnicc.wanted_chars) in qeth_l2_vnicc_set_state()
2056 /* if card is not ready, simply stop here */ in qeth_l2_vnicc_set_state()
2057 if (!qeth_card_hw_is_reachable(card)) { in qeth_l2_vnicc_set_state()
2059 card->options.vnicc.cur_chars |= vnicc; in qeth_l2_vnicc_set_state()
2061 card->options.vnicc.cur_chars &= ~vnicc; in qeth_l2_vnicc_set_state()
2065 rc = qeth_l2_vnicc_set_char(card, vnicc, cmd); in qeth_l2_vnicc_set_state()
2067 card->options.vnicc.wanted_chars = in qeth_l2_vnicc_set_state()
2068 card->options.vnicc.cur_chars; in qeth_l2_vnicc_set_state()
2072 card->options.vnicc.rx_bcast_enabled = true; in qeth_l2_vnicc_set_state()
2074 qeth_l2_vnicc_recover_timeout(card, vnicc, in qeth_l2_vnicc_set_state()
2075 &card->options.vnicc.learning_timeout); in qeth_l2_vnicc_set_state()
2082 int qeth_l2_vnicc_get_state(struct qeth_card *card, u32 vnicc, bool *state) in qeth_l2_vnicc_get_state() argument
2086 QETH_CARD_TEXT(card, 2, "vniccgch"); in qeth_l2_vnicc_get_state()
2089 if (!(card->options.vnicc.sup_chars & vnicc)) in qeth_l2_vnicc_get_state()
2092 if (qeth_bridgeport_is_in_use(card)) in qeth_l2_vnicc_get_state()
2095 /* if card is ready, query current VNICC state */ in qeth_l2_vnicc_get_state()
2096 if (qeth_card_hw_is_reachable(card)) in qeth_l2_vnicc_get_state()
2097 rc = qeth_l2_vnicc_query_chars(card); in qeth_l2_vnicc_get_state()
2099 *state = (card->options.vnicc.cur_chars & vnicc) ? true : false; in qeth_l2_vnicc_get_state()
2106 int qeth_l2_vnicc_set_timeout(struct qeth_card *card, u32 timeout) in qeth_l2_vnicc_set_timeout() argument
2110 QETH_CARD_TEXT(card, 2, "vniccsto"); in qeth_l2_vnicc_set_timeout()
2113 if (!(card->options.vnicc.sup_chars & QETH_VNICC_LEARNING) || in qeth_l2_vnicc_set_timeout()
2114 !(card->options.vnicc.getset_timeout_sup & QETH_VNICC_LEARNING)) in qeth_l2_vnicc_set_timeout()
2117 if (qeth_bridgeport_is_in_use(card)) in qeth_l2_vnicc_set_timeout()
2121 if (card->options.vnicc.learning_timeout == timeout) in qeth_l2_vnicc_set_timeout()
2124 /* if card is not ready, simply store the value internally and return */ in qeth_l2_vnicc_set_timeout()
2125 if (!qeth_card_hw_is_reachable(card)) { in qeth_l2_vnicc_set_timeout()
2126 card->options.vnicc.learning_timeout = timeout; in qeth_l2_vnicc_set_timeout()
2130 /* send timeout value to card; if successful, store value internally */ in qeth_l2_vnicc_set_timeout()
2131 rc = qeth_l2_vnicc_getset_timeout(card, QETH_VNICC_LEARNING, in qeth_l2_vnicc_set_timeout()
2134 card->options.vnicc.learning_timeout = timeout; in qeth_l2_vnicc_set_timeout()
2142 int qeth_l2_vnicc_get_timeout(struct qeth_card *card, u32 *timeout) in qeth_l2_vnicc_get_timeout() argument
2146 QETH_CARD_TEXT(card, 2, "vniccgto"); in qeth_l2_vnicc_get_timeout()
2149 if (!(card->options.vnicc.sup_chars & QETH_VNICC_LEARNING) || in qeth_l2_vnicc_get_timeout()
2150 !(card->options.vnicc.getset_timeout_sup & QETH_VNICC_LEARNING)) in qeth_l2_vnicc_get_timeout()
2153 if (qeth_bridgeport_is_in_use(card)) in qeth_l2_vnicc_get_timeout()
2156 /* if card is ready, get timeout. Otherwise, just return stored value */ in qeth_l2_vnicc_get_timeout()
2157 *timeout = card->options.vnicc.learning_timeout; in qeth_l2_vnicc_get_timeout()
2158 if (qeth_card_hw_is_reachable(card)) in qeth_l2_vnicc_get_timeout()
2159 rc = qeth_l2_vnicc_getset_timeout(card, QETH_VNICC_LEARNING, in qeth_l2_vnicc_get_timeout()
2167 static bool _qeth_l2_vnicc_is_in_use(struct qeth_card *card) in _qeth_l2_vnicc_is_in_use() argument
2169 if (!card->options.vnicc.sup_chars) in _qeth_l2_vnicc_is_in_use()
2172 * or the card is offline. in _qeth_l2_vnicc_is_in_use()
2174 if (card->options.vnicc.cur_chars == QETH_VNICC_DEFAULT) { in _qeth_l2_vnicc_is_in_use()
2175 if (!card->options.vnicc.rx_bcast_enabled || in _qeth_l2_vnicc_is_in_use()
2176 !qeth_card_hw_is_reachable(card)) in _qeth_l2_vnicc_is_in_use()
2184 * @card: qeth_card structure pointer
2189 bool qeth_bridgeport_allowed(struct qeth_card *card) in qeth_bridgeport_allowed() argument
2191 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_bridgeport_allowed()
2193 return (!_qeth_l2_vnicc_is_in_use(card) && in qeth_bridgeport_allowed()
2198 static bool qeth_l2_vnicc_recover_char(struct qeth_card *card, u32 vnicc, in qeth_l2_vnicc_recover_char() argument
2203 if (card->options.vnicc.sup_chars & vnicc && in qeth_l2_vnicc_recover_char()
2204 card->options.vnicc.set_char_sup & vnicc && in qeth_l2_vnicc_recover_char()
2205 !qeth_l2_vnicc_set_char(card, vnicc, cmd)) in qeth_l2_vnicc_recover_char()
2207 card->options.vnicc.wanted_chars &= ~vnicc; in qeth_l2_vnicc_recover_char()
2208 card->options.vnicc.wanted_chars |= QETH_VNICC_DEFAULT & vnicc; in qeth_l2_vnicc_recover_char()
2213 static void qeth_l2_vnicc_init(struct qeth_card *card) in qeth_l2_vnicc_init() argument
2215 u32 *timeout = &card->options.vnicc.learning_timeout; in qeth_l2_vnicc_init()
2221 QETH_CARD_TEXT(card, 2, "vniccini"); in qeth_l2_vnicc_init()
2223 card->options.vnicc.rx_bcast_enabled = 0; in qeth_l2_vnicc_init()
2225 if (qeth_l2_vnicc_query_chars(card)) { in qeth_l2_vnicc_init()
2226 if (card->options.vnicc.wanted_chars != QETH_VNICC_DEFAULT || in qeth_l2_vnicc_init()
2228 dev_err(&card->gdev->dev, "Configuring the VNIC characteristics failed\n"); in qeth_l2_vnicc_init()
2230 card->options.vnicc.sup_chars = 0; in qeth_l2_vnicc_init()
2231 card->options.vnicc.cur_chars = 0; in qeth_l2_vnicc_init()
2232 card->options.vnicc.wanted_chars = QETH_VNICC_DEFAULT; in qeth_l2_vnicc_init()
2236 chars_tmp = card->options.vnicc.sup_chars; in qeth_l2_vnicc_init()
2237 chars_len = sizeof(card->options.vnicc.sup_chars) * BITS_PER_BYTE; in qeth_l2_vnicc_init()
2240 if (qeth_l2_vnicc_query_cmds(card, vnicc, &sup_cmds)) { in qeth_l2_vnicc_init()
2246 card->options.vnicc.getset_timeout_sup |= vnicc; in qeth_l2_vnicc_init()
2248 card->options.vnicc.getset_timeout_sup &= ~vnicc; in qeth_l2_vnicc_init()
2251 card->options.vnicc.set_char_sup |= vnicc; in qeth_l2_vnicc_init()
2253 card->options.vnicc.set_char_sup &= ~vnicc; in qeth_l2_vnicc_init()
2256 error |= qeth_l2_vnicc_recover_timeout(card, QETH_VNICC_LEARNING, in qeth_l2_vnicc_init()
2259 chars_tmp = card->options.vnicc.wanted_chars ^ in qeth_l2_vnicc_init()
2260 card->options.vnicc.cur_chars; in qeth_l2_vnicc_init()
2261 chars_len = sizeof(card->options.vnicc.wanted_chars) * BITS_PER_BYTE; in qeth_l2_vnicc_init()
2264 enable = card->options.vnicc.wanted_chars & vnicc; in qeth_l2_vnicc_init()
2265 error |= qeth_l2_vnicc_recover_char(card, vnicc, enable); in qeth_l2_vnicc_init()
2268 dev_err(&card->gdev->dev, "Configuring the VNIC characteristics failed\n"); in qeth_l2_vnicc_init()
2272 static void qeth_l2_vnicc_set_defaults(struct qeth_card *card) in qeth_l2_vnicc_set_defaults() argument
2275 card->options.vnicc.sup_chars = QETH_VNICC_ALL; in qeth_l2_vnicc_set_defaults()
2276 card->options.vnicc.cur_chars = QETH_VNICC_DEFAULT; in qeth_l2_vnicc_set_defaults()
2277 card->options.vnicc.learning_timeout = QETH_VNICC_DEFAULT_TIMEOUT; in qeth_l2_vnicc_set_defaults()
2279 card->options.vnicc.set_char_sup = QETH_VNICC_ALL; in qeth_l2_vnicc_set_defaults()
2280 card->options.vnicc.getset_timeout_sup = QETH_VNICC_LEARNING; in qeth_l2_vnicc_set_defaults()
2282 card->options.vnicc.wanted_chars = QETH_VNICC_DEFAULT; in qeth_l2_vnicc_set_defaults()
2292 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_probe_device() local
2295 qeth_l2_vnicc_set_defaults(card); in qeth_l2_probe_device()
2296 mutex_init(&card->sbp_lock); in qeth_l2_probe_device()
2306 INIT_WORK(&card->rx_mode_work, qeth_l2_rx_mode_work); in qeth_l2_probe_device()
2312 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_remove_device() local
2318 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_remove_device()
2319 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); in qeth_l2_remove_device()
2322 qeth_set_offline(card, card->discipline, false); in qeth_l2_remove_device()
2324 if (card->dev->reg_state == NETREG_REGISTERED) { in qeth_l2_remove_device()
2325 priv = netdev_priv(card->dev); in qeth_l2_remove_device()
2331 unregister_netdev(card->dev); in qeth_l2_remove_device()
2335 static int qeth_l2_set_online(struct qeth_card *card, bool carrier_ok) in qeth_l2_set_online() argument
2337 struct net_device *dev = card->dev; in qeth_l2_set_online()
2340 qeth_l2_detect_dev2br_support(card); in qeth_l2_set_online()
2342 mutex_lock(&card->sbp_lock); in qeth_l2_set_online()
2343 qeth_bridgeport_query_support(card); in qeth_l2_set_online()
2344 if (card->options.sbp.supported_funcs) { in qeth_l2_set_online()
2345 qeth_l2_setup_bridgeport_attrs(card); in qeth_l2_set_online()
2346 dev_info(&card->gdev->dev, in qeth_l2_set_online()
2349 mutex_unlock(&card->sbp_lock); in qeth_l2_set_online()
2351 qeth_l2_register_dev_addr(card); in qeth_l2_set_online()
2354 qeth_l2_vnicc_init(card); in qeth_l2_set_online()
2356 qeth_l2_trace_features(card); in qeth_l2_set_online()
2359 QETH_CARD_TEXT(card, 2, "softsetp"); in qeth_l2_set_online()
2361 card->state = CARD_STATE_SOFTSETUP; in qeth_l2_set_online()
2363 qeth_set_allowed_threads(card, 0xffffffff, 0); in qeth_l2_set_online()
2366 rc = qeth_l2_setup_netdev(card); in qeth_l2_set_online()
2374 rc = qeth_set_real_num_tx_queues(card, in qeth_l2_set_online()
2375 qeth_tx_actual_queues(card)); in qeth_l2_set_online()
2388 qeth_l2_enable_brport_features(card); in qeth_l2_set_online()
2390 if (card->info.open_when_online) { in qeth_l2_set_online()
2391 card->info.open_when_online = 0; in qeth_l2_set_online()
2400 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_set_online()
2401 card->state = CARD_STATE_DOWN; in qeth_l2_set_online()
2405 static void qeth_l2_set_offline(struct qeth_card *card) in qeth_l2_set_offline() argument
2407 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_l2_set_offline()
2409 qeth_set_allowed_threads(card, 0, 1); in qeth_l2_set_offline()
2410 qeth_l2_drain_rx_mode_cache(card); in qeth_l2_set_offline()
2412 if (card->state == CARD_STATE_SOFTSETUP) in qeth_l2_set_offline()
2413 card->state = CARD_STATE_DOWN; in qeth_l2_set_offline()
2415 qeth_l2_set_pnso_mode(card, QETH_PNSO_NONE); in qeth_l2_set_offline()
2417 qeth_l2_dev2br_fdb_flush(card); in qeth_l2_set_offline()
2421 static int qeth_l2_control_event(struct qeth_card *card, in qeth_l2_control_event() argument
2429 qeth_bridge_state_change(card, cmd); in qeth_l2_control_event()
2435 qeth_addr_change_event(card, cmd); in qeth_l2_control_event()