Lines Matching +full:data +full:- +full:role

1 // SPDX-License-Identifier: GPL-2.0
42 rc = -EOPNOTSUPP; in qeth_l2_setdelmac_makerc()
45 rc = -ENOSPC; in qeth_l2_setdelmac_makerc()
49 rc = -EADDRINUSE; in qeth_l2_setdelmac_makerc()
53 rc = -EADDRNOTAVAIL; in qeth_l2_setdelmac_makerc()
56 rc = -ENOENT; in qeth_l2_setdelmac_makerc()
59 rc = -EIO; in qeth_l2_setdelmac_makerc()
67 unsigned long data) in qeth_l2_send_setdelmac_cb() argument
69 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; in qeth_l2_send_setdelmac_cb()
71 return qeth_l2_setdelmac_makerc(card, cmd->hdr.return_code); in qeth_l2_send_setdelmac_cb()
84 return -ENOMEM; in qeth_l2_send_setdelmac()
86 cmd->data.setdelmac.mac_length = ETH_ALEN; in qeth_l2_send_setdelmac()
87 ether_addr_copy(cmd->data.setdelmac.mac, mac); in qeth_l2_send_setdelmac()
98 dev_info(&card->gdev->dev, in qeth_l2_send_setmac()
102 case -EADDRINUSE: in qeth_l2_send_setmac()
103 dev_warn(&card->gdev->dev, in qeth_l2_send_setmac()
106 case -EADDRNOTAVAIL: in qeth_l2_send_setmac()
107 dev_warn(&card->gdev->dev, in qeth_l2_send_setmac()
123 if (rc == -EADDRINUSE) in qeth_l2_write_mac()
152 hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) { in qeth_l2_drain_rx_mode_cache()
153 hash_del(&mac->hnode); in qeth_l2_drain_rx_mode_cache()
165 hdr->hdr.l2.pkt_length = data_len; in qeth_l2_fill_header()
168 hdr->hdr.l2.id = QETH_HEADER_TYPE_L2_TSO; in qeth_l2_fill_header()
170 hdr->hdr.l2.id = QETH_HEADER_TYPE_LAYER2; in qeth_l2_fill_header()
171 if (skb->ip_summed == CHECKSUM_PARTIAL) in qeth_l2_fill_header()
172 qeth_tx_csum(skb, &hdr->hdr.l2.flags[1], ipv); in qeth_l2_fill_header()
177 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_MULTICAST; in qeth_l2_fill_header()
179 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_BROADCAST; in qeth_l2_fill_header()
181 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_UNICAST; in qeth_l2_fill_header()
186 if (veth->h_vlan_proto == htons(ETH_P_8021Q)) { in qeth_l2_fill_header()
187 hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_VLAN; in qeth_l2_fill_header()
188 hdr->hdr.l2.vlan_id = ntohs(veth->h_vlan_TCI); in qeth_l2_fill_header()
201 return -EINVAL; in qeth_l2_setdelvlan_makerc()
203 return -EEXIST; in qeth_l2_setdelvlan_makerc()
205 return -ENOENT; in qeth_l2_setdelvlan_makerc()
207 return -EPERM; in qeth_l2_setdelvlan_makerc()
209 return -EIO; in qeth_l2_setdelvlan_makerc()
215 unsigned long data) in qeth_l2_send_setdelvlan_cb() argument
217 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; in qeth_l2_send_setdelvlan_cb()
220 if (cmd->hdr.return_code) { in qeth_l2_send_setdelvlan_cb()
222 cmd->data.setdelvlan.vlan_id, 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()
239 return -ENOMEM; in qeth_l2_send_setdelvlan()
241 cmd->data.setdelvlan.vlan_id = i; in qeth_l2_send_setdelvlan()
248 struct qeth_card *card = dev->ml_priv; in qeth_l2_vlan_rx_add_vid()
260 struct qeth_card *card = dev->ml_priv; in qeth_l2_vlan_rx_kill_vid()
273 WRITE_ONCE(card->info.pnso_mode, mode); in qeth_l2_set_pnso_mode()
277 drain_workqueue(card->event_wq); in qeth_l2_set_pnso_mode()
293 card->dev, &info.info, NULL); in qeth_l2_dev2br_fdb_flush()
324 return (rc) ? rc : -EADDRNOTAVAIL; in qeth_l2_request_initial_mac()
325 eth_hw_addr_random(card->dev); in qeth_l2_request_initial_mac()
328 QETH_CARD_HEX(card, 2, card->dev->dev_addr, card->dev->addr_len); in qeth_l2_request_initial_mac()
334 if (!is_valid_ether_addr(card->dev->dev_addr)) in qeth_l2_register_dev_addr()
337 if (!IS_OSN(card) && !qeth_l2_send_setmac(card, card->dev->dev_addr)) in qeth_l2_register_dev_addr()
338 card->info.dev_addr_is_registered = 1; in qeth_l2_register_dev_addr()
340 card->info.dev_addr_is_registered = 0; in qeth_l2_register_dev_addr()
345 struct qeth_card *card = dev->ml_priv; in qeth_l2_validate_addr()
347 if (card->info.dev_addr_is_registered) in qeth_l2_validate_addr()
351 return -EPERM; in qeth_l2_validate_addr()
357 struct qeth_card *card = dev->ml_priv; in qeth_l2_set_mac_address()
365 return -EOPNOTSUPP; in qeth_l2_set_mac_address()
367 QETH_CARD_HEX(card, 3, addr->sa_data, ETH_ALEN); in qeth_l2_set_mac_address()
368 if (!is_valid_ether_addr(addr->sa_data)) in qeth_l2_set_mac_address()
369 return -EADDRNOTAVAIL; in qeth_l2_set_mac_address()
372 if (ether_addr_equal_64bits(dev->dev_addr, addr->sa_data) && in qeth_l2_set_mac_address()
373 card->info.dev_addr_is_registered) in qeth_l2_set_mac_address()
377 rc = qeth_l2_send_setmac(card, addr->sa_data); in qeth_l2_set_mac_address()
380 ether_addr_copy(old_addr, dev->dev_addr); in qeth_l2_set_mac_address()
381 ether_addr_copy(dev->dev_addr, addr->sa_data); in qeth_l2_set_mac_address()
383 if (card->info.dev_addr_is_registered) in qeth_l2_set_mac_address()
385 card->info.dev_addr_is_registered = 1; in qeth_l2_set_mac_address()
391 int role; in qeth_l2_promisc_to_bridge() local
397 if (card->options.sbp.reflect_promisc_primary) in qeth_l2_promisc_to_bridge()
398 role = QETH_SBP_ROLE_PRIMARY; in qeth_l2_promisc_to_bridge()
400 role = QETH_SBP_ROLE_SECONDARY; in qeth_l2_promisc_to_bridge()
402 role = QETH_SBP_ROLE_NONE; in qeth_l2_promisc_to_bridge()
404 rc = qeth_bridgeport_setrole(card, role); in qeth_l2_promisc_to_bridge()
405 QETH_CARD_TEXT_(card, 2, "bpm%c%04x", enable ? '+' : '-', rc); in qeth_l2_promisc_to_bridge()
407 card->options.sbp.role = role; in qeth_l2_promisc_to_bridge()
408 card->info.promisc_mode = enable; in qeth_l2_promisc_to_bridge()
414 bool enable = card->dev->flags & IFF_PROMISC; in qeth_l2_set_promisc_mode()
416 if (card->info.promisc_mode == enable) in qeth_l2_set_promisc_mode()
422 mutex_lock(&card->sbp_lock); in qeth_l2_set_promisc_mode()
423 if (card->options.sbp.reflect_promisc) in qeth_l2_set_promisc_mode()
425 mutex_unlock(&card->sbp_lock); in qeth_l2_set_promisc_mode()
435 u32 mac_hash = get_unaligned((u32 *)(&ha->addr[2])); in qeth_l2_add_mac()
438 hash_for_each_possible(card->rx_mode_addrs, mac, hnode, mac_hash) { in qeth_l2_add_mac()
439 if (ether_addr_equal_64bits(ha->addr, mac->mac_addr)) { in qeth_l2_add_mac()
440 mac->disp_flag = QETH_DISP_ADDR_DO_NOTHING; in qeth_l2_add_mac()
449 ether_addr_copy(mac->mac_addr, ha->addr); in qeth_l2_add_mac()
450 mac->disp_flag = QETH_DISP_ADDR_ADD; in qeth_l2_add_mac()
452 hash_add(card->rx_mode_addrs, &mac->hnode, mac_hash); in qeth_l2_add_mac()
459 struct net_device *dev = card->dev; in qeth_l2_rx_mode_work()
475 hash_for_each_safe(card->rx_mode_addrs, i, tmp, mac, hnode) { in qeth_l2_rx_mode_work()
476 switch (mac->disp_flag) { in qeth_l2_rx_mode_work()
478 qeth_l2_remove_mac(card, mac->mac_addr); in qeth_l2_rx_mode_work()
479 hash_del(&mac->hnode); in qeth_l2_rx_mode_work()
483 rc = qeth_l2_write_mac(card, mac->mac_addr); in qeth_l2_rx_mode_work()
485 hash_del(&mac->hnode); in qeth_l2_rx_mode_work()
492 mac->disp_flag = QETH_DISP_ADDR_DELETE; in qeth_l2_rx_mode_work()
503 struct qeth_hdr *hdr = (struct qeth_hdr *)skb->data; in qeth_l2_xmit_osn()
504 addr_t end = (addr_t)(skb->data + sizeof(*hdr)); in qeth_l2_xmit_osn()
505 addr_t start = (addr_t)skb->data; in qeth_l2_xmit_osn()
510 if (skb->protocol == htons(ETH_P_IPV6)) in qeth_l2_xmit_osn()
511 return -EPROTONOSUPPORT; in qeth_l2_xmit_osn()
517 return -ENOMEM; in qeth_l2_xmit_osn()
524 if (elements > queue->max_elements) { in qeth_l2_xmit_osn()
525 rc = -E2BIG; in qeth_l2_xmit_osn()
540 struct qeth_card *card = dev->ml_priv; in qeth_l2_hard_start_xmit()
546 qdisc_skb_cb(skb)->pkt_len = skb->len; in qeth_l2_hard_start_xmit()
549 queue = card->qdio.out_qs[txq]; in qeth_l2_hard_start_xmit()
568 struct qeth_card *card = dev->ml_priv; in qeth_l2_select_queue()
582 struct qeth_card *card = dev->ml_priv; in qeth_l2_set_rx_mode()
584 schedule_work(&card->rx_mode_work); in qeth_l2_set_rx_mode()
588 * qeth_l2_pnso() - perform network subchannel operation
591 * @cnc: Boolean Change-Notification Control
597 * callback function for every entry in the list. If "change-notification-
614 return -ENOMEM; in qeth_l2_pnso()
618 rc = ccw_device_pnso(ddev, rr, oc, rr->naihdr.resume_token, in qeth_l2_pnso()
625 size = rr->naihdr.naids; in qeth_l2_pnso()
631 elems = (rr->response.length - sizeof(struct chsc_header) - in qeth_l2_pnso()
634 if (!isfirstblock && (rr->naihdr.instance != prev_instance)) { in qeth_l2_pnso()
636 /* the data that was already reported via cb */ in qeth_l2_pnso()
637 rc = -EAGAIN; in qeth_l2_pnso()
641 prev_instance = rr->naihdr.instance; in qeth_l2_pnso()
643 (*cb)(priv, &rr->entries[i]); in qeth_l2_pnso()
644 } while ((rc == -EBUSY) || (!rc && /* list stored */ in qeth_l2_pnso()
645 /* resume token is non-zero => list incomplete */ in qeth_l2_pnso()
646 (rr->naihdr.resume_token.t1 || rr->naihdr.resume_token.t2))); in qeth_l2_pnso()
649 QETH_CARD_TEXT_(card, 2, "PNrp%04x", rr->response.code); in qeth_l2_pnso()
658 return ((card->info.ddev_devno == token->devnum) && in qeth_is_my_net_if_token()
659 (card->info.cssid == token->cssid) && in qeth_is_my_net_if_token()
660 (card->info.iid == token->iid) && in qeth_is_my_net_if_token()
661 (card->info.ssid == token->ssid) && in qeth_is_my_net_if_token()
662 (card->info.chpid == token->chpid) && in qeth_is_my_net_if_token()
663 (card->info.chid == token->chid)); in qeth_is_my_net_if_token()
667 * qeth_l2_dev2br_fdb_notify() - update fdb of master bridge
670 * 1 - removal of an object
671 * 0 - addition of an object
673 * 0x01 - VLAN, 0x02 - MAC, 0x03 - VLAN and MAC
685 ether_addr_copy(ntfy_mac, addr_lnid->mac); in qeth_l2_dev2br_fdb_notify()
704 card->dev, &info.info, NULL); in qeth_l2_dev2br_fdb_notify()
710 card->dev, &info.info, NULL); in qeth_l2_dev2br_fdb_notify()
723 if (entry->addr_lnid.lnid < VLAN_N_VID) in qeth_l2_dev2br_an_set_cb()
726 (struct net_if_token *)&entry->nit, in qeth_l2_dev2br_an_set_cb()
727 (struct mac_addr_lnid *)&entry->addr_lnid); in qeth_l2_dev2br_an_set_cb()
731 * qeth_l2_dev2br_an_set() -
736 * Returns negative errno-compatible error indication or 0 on success.
751 if (rc == -EAGAIN) in qeth_l2_dev2br_an_set()
753 * addresses reported -> disable address notification in qeth_l2_dev2br_an_set()
770 struct qeth_card *card = dev->ml_priv; in qeth_l2_bridge_getlink()
774 if (!priv->brport_hw_features || !netif_device_present(dev) || in qeth_l2_bridge_getlink()
776 return -EOPNOTSUPP; in qeth_l2_bridge_getlink()
779 mode, priv->brport_features, in qeth_l2_bridge_getlink()
780 priv->brport_hw_features, in qeth_l2_bridge_getlink()
789 * qeth_l2_bridge_setlink() - set bridgeport attributes
802 struct qeth_card *card = dev->ml_priv; in qeth_l2_bridge_setlink()
809 return -ENODEV; in qeth_l2_bridge_setlink()
810 if (!(priv->brport_hw_features)) in qeth_l2_bridge_setlink()
811 return -EOPNOTSUPP; in qeth_l2_bridge_setlink()
826 return -EINVAL; in qeth_l2_bridge_setlink()
830 return -EINVAL; in qeth_l2_bridge_setlink()
836 return -EINVAL; in qeth_l2_bridge_setlink()
839 if (enable == !!(priv->brport_features & BR_LEARNING_SYNC)) in qeth_l2_bridge_setlink()
842 mutex_lock(&card->sbp_lock); in qeth_l2_bridge_setlink()
846 rc = -EBUSY; in qeth_l2_bridge_setlink()
853 priv->brport_features |= BR_LEARNING_SYNC; in qeth_l2_bridge_setlink()
858 priv->brport_features ^= BR_LEARNING_SYNC; in qeth_l2_bridge_setlink()
862 mutex_unlock(&card->sbp_lock); in qeth_l2_bridge_setlink()
899 card->dev->netdev_ops = &qeth_osn_netdev_ops; in qeth_l2_setup_netdev()
900 card->dev->flags |= IFF_NOARP; in qeth_l2_setup_netdev()
904 card->dev->needed_headroom = sizeof(struct qeth_hdr); in qeth_l2_setup_netdev()
905 card->dev->netdev_ops = &qeth_l2_netdev_ops; in qeth_l2_setup_netdev()
906 card->dev->priv_flags |= IFF_UNICAST_FLT; in qeth_l2_setup_netdev()
909 card->dev->features |= NETIF_F_VLAN_CHALLENGED; in qeth_l2_setup_netdev()
912 card->dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER; in qeth_l2_setup_netdev()
913 card->dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; in qeth_l2_setup_netdev()
917 card->dev->features |= NETIF_F_SG; in qeth_l2_setup_netdev()
920 card->dev->hw_features |= NETIF_F_IP_CSUM; in qeth_l2_setup_netdev()
921 card->dev->vlan_features |= NETIF_F_IP_CSUM; in qeth_l2_setup_netdev()
925 card->dev->hw_features |= NETIF_F_IPV6_CSUM; in qeth_l2_setup_netdev()
926 card->dev->vlan_features |= NETIF_F_IPV6_CSUM; in qeth_l2_setup_netdev()
930 card->dev->hw_features |= NETIF_F_RXCSUM; in qeth_l2_setup_netdev()
931 card->dev->vlan_features |= NETIF_F_RXCSUM; in qeth_l2_setup_netdev()
934 card->dev->hw_features |= NETIF_F_TSO; in qeth_l2_setup_netdev()
935 card->dev->vlan_features |= NETIF_F_TSO; in qeth_l2_setup_netdev()
938 card->dev->hw_features |= NETIF_F_TSO6; in qeth_l2_setup_netdev()
939 card->dev->vlan_features |= NETIF_F_TSO6; in qeth_l2_setup_netdev()
942 if (card->dev->hw_features & (NETIF_F_TSO | NETIF_F_TSO6)) { in qeth_l2_setup_netdev()
943 card->dev->needed_headroom = sizeof(struct qeth_hdr_tso); in qeth_l2_setup_netdev()
944 netif_keep_dst(card->dev); in qeth_l2_setup_netdev()
945 netif_set_gso_max_size(card->dev, in qeth_l2_setup_netdev()
946 PAGE_SIZE * (QDIO_MAX_ELEMENTS_PER_BUFFER - 1)); in qeth_l2_setup_netdev()
950 netif_napi_add(card->dev, &card->napi, qeth_poll, QETH_NAPI_WEIGHT); in qeth_l2_setup_netdev()
951 return register_netdev(card->dev); in qeth_l2_setup_netdev()
958 QETH_CARD_HEX(card, 2, &card->options.sbp.supported_funcs, in qeth_l2_trace_features()
959 sizeof(card->options.sbp.supported_funcs)); in qeth_l2_trace_features()
962 QETH_CARD_HEX(card, 2, &card->options.vnicc.sup_chars, in qeth_l2_trace_features()
963 sizeof(card->options.vnicc.sup_chars)); in qeth_l2_trace_features()
968 if (!card->options.sbp.reflect_promisc && in qeth_l2_setup_bridgeport_attrs()
969 card->options.sbp.role != QETH_SBP_ROLE_NONE) { in qeth_l2_setup_bridgeport_attrs()
971 qeth_bridgeport_setrole(card, card->options.sbp.role); in qeth_l2_setup_bridgeport_attrs()
972 /* Let the callback function refresh the stored role value. */ in qeth_l2_setup_bridgeport_attrs()
973 qeth_bridgeport_query_ports(card, &card->options.sbp.role, in qeth_l2_setup_bridgeport_attrs()
976 if (card->options.sbp.hostnotification) { in qeth_l2_setup_bridgeport_attrs()
978 card->options.sbp.hostnotification = 0; in qeth_l2_setup_bridgeport_attrs()
983 * qeth_l2_detect_dev2br_support() -
991 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_l2_detect_dev2br_support()
999 dev2br_supported = card->info.ids_valid && in qeth_l2_detect_dev2br_support()
1004 priv->brport_hw_features |= BR_LEARNING_SYNC; in qeth_l2_detect_dev2br_support()
1006 priv->brport_hw_features &= ~BR_LEARNING_SYNC; in qeth_l2_detect_dev2br_support()
1011 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_l2_enable_brport_features()
1014 if (priv->brport_features & BR_LEARNING_SYNC) { in qeth_l2_enable_brport_features()
1015 if (priv->brport_hw_features & BR_LEARNING_SYNC) { in qeth_l2_enable_brport_features()
1018 if (rc == -EAGAIN) { in qeth_l2_enable_brport_features()
1026 netdev_err(card->dev, in qeth_l2_enable_brport_features()
1031 priv->brport_features ^= BR_LEARNING_SYNC; in qeth_l2_enable_brport_features()
1034 dev_warn(&card->gdev->dev, in qeth_l2_enable_brport_features()
1036 priv->brport_features ^= BR_LEARNING_SYNC; in qeth_l2_enable_brport_features()
1050 int qeth_osn_assist(struct net_device *dev, void *data, int data_len) in qeth_osn_assist() argument
1056 return -EINVAL; in qeth_osn_assist()
1058 return -ENODEV; in qeth_osn_assist()
1059 card = dev->ml_priv; in qeth_osn_assist()
1061 return -ENODEV; in qeth_osn_assist()
1064 return -ENODEV; in qeth_osn_assist()
1066 iob = qeth_alloc_cmd(&card->write, IPA_PDU_HEADER_SIZE + data_len, 1, in qeth_osn_assist()
1069 return -ENOMEM; in qeth_osn_assist()
1073 memcpy(__ipa_cmd(iob), data, data_len); in qeth_osn_assist()
1074 iob->callback = qeth_osn_assist_cb; in qeth_osn_assist()
1091 return -ENODEV; in qeth_osn_register()
1092 *dev = card->dev; in qeth_osn_register()
1096 return -EINVAL; in qeth_osn_register()
1097 card->osn_info.assist_cb = assist_cb; in qeth_osn_register()
1098 card->osn_info.data_cb = data_cb; in qeth_osn_register()
1109 card = dev->ml_priv; in qeth_osn_deregister()
1113 card->osn_info.assist_cb = NULL; in qeth_osn_deregister()
1114 card->osn_info.data_cb = NULL; in qeth_osn_deregister()
1124 * qeth_bridge_emit_host_event() - bridgeport address change notification
1129 * object, 0 - addition of an object.
1130 * 0x01 - VLAN, 0x02 - MAC, 0x03 - VLAN and MAC.
1135 * reported by the hardware, and also when notifications are enabled -
1156 addr_lnid->lnid); in qeth_bridge_emit_host_event()
1161 addr_lnid->mac); in qeth_bridge_emit_host_event()
1165 token->cssid, token->ssid, token->devnum); in qeth_bridge_emit_host_event()
1167 snprintf(str[i], sizeof(str[i]), "NTOK_IID=%02x", token->iid); in qeth_bridge_emit_host_event()
1170 token->chpid); in qeth_bridge_emit_host_event()
1172 snprintf(str[i], sizeof(str[i]), "NTOK_CHID=%04x", token->chid); in qeth_bridge_emit_host_event()
1185 kobject_uevent_env(&card->gdev->dev.kobj, KOBJ_CHANGE, env); in qeth_bridge_emit_host_event()
1191 u8 role; member
1197 struct qeth_bridge_state_data *data = in qeth_bridge_state_change_worker() local
1210 snprintf(env_role, sizeof(env_role), "ROLE=%s", in qeth_bridge_state_change_worker()
1211 (data->role == QETH_SBP_ROLE_NONE) ? "none" : in qeth_bridge_state_change_worker()
1212 (data->role == QETH_SBP_ROLE_PRIMARY) ? "primary" : in qeth_bridge_state_change_worker()
1213 (data->role == QETH_SBP_ROLE_SECONDARY) ? "secondary" : in qeth_bridge_state_change_worker()
1216 (data->state == QETH_SBP_STATE_INACTIVE) ? "inactive" : in qeth_bridge_state_change_worker()
1217 (data->state == QETH_SBP_STATE_STANDBY) ? "standby" : in qeth_bridge_state_change_worker()
1218 (data->state == QETH_SBP_STATE_ACTIVE) ? "active" : in qeth_bridge_state_change_worker()
1220 kobject_uevent_env(&data->card->gdev->dev.kobj, in qeth_bridge_state_change_worker()
1222 kfree(data); in qeth_bridge_state_change_worker()
1228 struct qeth_sbp_port_data *qports = &cmd->data.sbp.data.port_data; in qeth_bridge_state_change()
1229 struct qeth_bridge_state_data *data; in qeth_bridge_state_change() local
1232 if (qports->num_entries == 0) { in qeth_bridge_state_change()
1236 if (qports->entry_length != sizeof(struct qeth_sbp_port_entry)) { in qeth_bridge_state_change()
1237 QETH_CARD_TEXT_(card, 2, "BPsz%04x", qports->entry_length); in qeth_bridge_state_change()
1241 data = kzalloc(sizeof(*data), GFP_ATOMIC); in qeth_bridge_state_change()
1242 if (!data) { in qeth_bridge_state_change()
1246 INIT_WORK(&data->worker, qeth_bridge_state_change_worker); in qeth_bridge_state_change()
1247 data->card = card; in qeth_bridge_state_change()
1249 data->role = qports->entry[0].role; in qeth_bridge_state_change()
1250 data->state = qports->entry[0].state; in qeth_bridge_state_change()
1252 queue_work(card->event_wq, &data->worker); in qeth_bridge_state_change()
1264 struct qeth_addr_change_data *data; in qeth_l2_dev2br_worker() local
1270 data = container_of(dwork, struct qeth_addr_change_data, dwork); in qeth_l2_dev2br_worker()
1271 card = data->card; in qeth_l2_dev2br_worker()
1272 priv = netdev_priv(card->dev); in qeth_l2_dev2br_worker()
1276 if (READ_ONCE(card->info.pnso_mode) == QETH_PNSO_NONE) in qeth_l2_dev2br_worker()
1279 /* Potential re-config in progress, try again later: */ in qeth_l2_dev2br_worker()
1281 queue_delayed_work(card->event_wq, dwork, in qeth_l2_dev2br_worker()
1285 if (!netif_device_present(card->dev)) in qeth_l2_dev2br_worker()
1288 if (data->ac_event.lost_event_mask) { in qeth_l2_dev2br_worker()
1300 /* TODO: if we want to retry after -EAGAIN, be in qeth_l2_dev2br_worker()
1305 netdev_err(card->dev, in qeth_l2_dev2br_worker()
1308 WRITE_ONCE(card->info.pnso_mode, in qeth_l2_dev2br_worker()
1312 priv->brport_features ^= BR_LEARNING_SYNC; in qeth_l2_dev2br_worker()
1319 for (i = 0; i < data->ac_event.num_entries; i++) { in qeth_l2_dev2br_worker()
1321 &data->ac_event.entry[i]; in qeth_l2_dev2br_worker()
1323 entry->change_code, in qeth_l2_dev2br_worker()
1324 &entry->token, in qeth_l2_dev2br_worker()
1325 &entry->addr_lnid); in qeth_l2_dev2br_worker()
1333 kfree(data); in qeth_l2_dev2br_worker()
1339 struct qeth_addr_change_data *data; in qeth_addr_change_event_worker() local
1343 data = container_of(dwork, struct qeth_addr_change_data, dwork); in qeth_addr_change_event_worker()
1344 card = data->card; in qeth_addr_change_event_worker()
1346 QETH_CARD_TEXT(data->card, 4, "adrchgew"); in qeth_addr_change_event_worker()
1348 if (READ_ONCE(card->info.pnso_mode) == QETH_PNSO_NONE) in qeth_addr_change_event_worker()
1351 if (data->ac_event.lost_event_mask) { in qeth_addr_change_event_worker()
1352 /* Potential re-config in progress, try again later: */ in qeth_addr_change_event_worker()
1353 if (!mutex_trylock(&card->sbp_lock)) { in qeth_addr_change_event_worker()
1354 queue_delayed_work(card->event_wq, dwork, in qeth_addr_change_event_worker()
1359 dev_info(&data->card->gdev->dev, in qeth_addr_change_event_worker()
1361 netdev_name(card->dev), in qeth_addr_change_event_worker()
1362 (data->ac_event.lost_event_mask == 0x01) in qeth_addr_change_event_worker()
1364 : (data->ac_event.lost_event_mask == 0x02) in qeth_addr_change_event_worker()
1368 data->card->options.sbp.hostnotification = 0; in qeth_addr_change_event_worker()
1369 card->info.pnso_mode = QETH_PNSO_NONE; in qeth_addr_change_event_worker()
1370 mutex_unlock(&data->card->sbp_lock); in qeth_addr_change_event_worker()
1371 qeth_bridge_emit_host_event(data->card, anev_abort, in qeth_addr_change_event_worker()
1374 for (i = 0; i < data->ac_event.num_entries; i++) { in qeth_addr_change_event_worker()
1376 &data->ac_event.entry[i]; in qeth_addr_change_event_worker()
1377 qeth_bridge_emit_host_event(data->card, in qeth_addr_change_event_worker()
1379 entry->change_code, in qeth_addr_change_event_worker()
1380 &entry->token, in qeth_addr_change_event_worker()
1381 &entry->addr_lnid); in qeth_addr_change_event_worker()
1385 kfree(data); in qeth_addr_change_event_worker()
1392 &cmd->data.addrchange; in qeth_addr_change_event()
1393 struct qeth_addr_change_data *data; in qeth_addr_change_event() local
1396 if (card->info.pnso_mode == QETH_PNSO_NONE) in qeth_addr_change_event()
1400 if (cmd->hdr.return_code != 0x0000) { in qeth_addr_change_event()
1401 if (cmd->hdr.return_code == 0x0010) { in qeth_addr_change_event()
1402 if (hostevs->lost_event_mask == 0x00) in qeth_addr_change_event()
1403 hostevs->lost_event_mask = 0xff; in qeth_addr_change_event()
1406 cmd->hdr.return_code); in qeth_addr_change_event()
1411 hostevs->num_entries; in qeth_addr_change_event()
1412 data = kzalloc(sizeof(struct qeth_addr_change_data) + extrasize, in qeth_addr_change_event()
1414 if (!data) { in qeth_addr_change_event()
1418 if (card->info.pnso_mode == QETH_PNSO_BRIDGEPORT) in qeth_addr_change_event()
1419 INIT_DELAYED_WORK(&data->dwork, qeth_addr_change_event_worker); in qeth_addr_change_event()
1421 INIT_DELAYED_WORK(&data->dwork, qeth_l2_dev2br_worker); in qeth_addr_change_event()
1422 data->card = card; in qeth_addr_change_event()
1423 memcpy(&data->ac_event, hostevs, in qeth_addr_change_event()
1425 queue_delayed_work(card->event_wq, &data->dwork, 0); in qeth_addr_change_event()
1434 enum qeth_sbp_roles *role; member
1437 } data; member
1443 struct qeth_ipacmd_setbridgeport *sbp = &cmd->data.sbp; in qeth_bridgeport_makerc()
1444 enum qeth_ipa_sbp_cmd setcmd = sbp->hdr.command_code; in qeth_bridgeport_makerc()
1445 u16 ipa_rc = cmd->hdr.return_code; in qeth_bridgeport_makerc()
1446 u16 sbp_rc = sbp->hdr.return_code; in qeth_bridgeport_makerc()
1460 rc = -EOPNOTSUPP; in qeth_bridgeport_makerc()
1464 rc = -ENODEV; /* maybe not the best code here? */ in qeth_bridgeport_makerc()
1465 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1470 rc = -EPERM; in qeth_bridgeport_makerc()
1471 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1478 rc = -EEXIST; in qeth_bridgeport_makerc()
1479 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1483 rc = -EBUSY; in qeth_bridgeport_makerc()
1484 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1488 rc = -EIO; in qeth_bridgeport_makerc()
1493 rc = -EBUSY; in qeth_bridgeport_makerc()
1494 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1499 rc = -EEXIST; in qeth_bridgeport_makerc()
1500 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1505 rc = -EBUSY; in qeth_bridgeport_makerc()
1506 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1511 rc = -EACCES; in qeth_bridgeport_makerc()
1512 dev_err(&card->gdev->dev, in qeth_bridgeport_makerc()
1516 rc = -EIO; in qeth_bridgeport_makerc()
1521 rc = -EOPNOTSUPP; in qeth_bridgeport_makerc()
1524 rc = -EOPNOTSUPP; in qeth_bridgeport_makerc()
1527 rc = -EIO; in qeth_bridgeport_makerc()
1550 data)); in qeth_sbp_build_cmd()
1554 hdr = &__ipa_cmd(iob)->data.sbp.hdr; in qeth_sbp_build_cmd()
1555 hdr->cmdlength = sizeof(*hdr) + data_length; in qeth_sbp_build_cmd()
1556 hdr->command_code = sbp_cmd; in qeth_sbp_build_cmd()
1557 hdr->used_total = 1; in qeth_sbp_build_cmd()
1558 hdr->seq_no = 1; in qeth_sbp_build_cmd()
1563 struct qeth_reply *reply, unsigned long data) in qeth_bridgeport_query_support_cb() argument
1565 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; in qeth_bridgeport_query_support_cb()
1566 struct _qeth_sbp_cbctl *cbctl = (struct _qeth_sbp_cbctl *)reply->param; in qeth_bridgeport_query_support_cb()
1574 cbctl->data.supported = in qeth_bridgeport_query_support_cb()
1575 cmd->data.sbp.data.query_cmds_supp.supported_cmds; in qeth_bridgeport_query_support_cb()
1580 * qeth_bridgeport_query_support() - store bitmask of supported subfunctions.
1584 * strucutre: card->options.sbp.supported_funcs.
1599 card->options.sbp.role = QETH_SBP_ROLE_NONE; in qeth_bridgeport_query_support()
1600 card->options.sbp.supported_funcs = 0; in qeth_bridgeport_query_support()
1603 card->options.sbp.supported_funcs = cbctl.data.supported; in qeth_bridgeport_query_support()
1607 struct qeth_reply *reply, unsigned long data) in qeth_bridgeport_query_ports_cb() argument
1609 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; in qeth_bridgeport_query_ports_cb()
1610 struct _qeth_sbp_cbctl *cbctl = (struct _qeth_sbp_cbctl *)reply->param; in qeth_bridgeport_query_ports_cb()
1619 qports = &cmd->data.sbp.data.port_data; in qeth_bridgeport_query_ports_cb()
1620 if (qports->entry_length != sizeof(struct qeth_sbp_port_entry)) { in qeth_bridgeport_query_ports_cb()
1621 QETH_CARD_TEXT_(card, 2, "SBPs%04x", qports->entry_length); in qeth_bridgeport_query_ports_cb()
1622 return -EINVAL; in qeth_bridgeport_query_ports_cb()
1625 if (qports->num_entries > 0) { in qeth_bridgeport_query_ports_cb()
1626 if (cbctl->data.qports.role) in qeth_bridgeport_query_ports_cb()
1627 *cbctl->data.qports.role = qports->entry[0].role; in qeth_bridgeport_query_ports_cb()
1628 if (cbctl->data.qports.state) in qeth_bridgeport_query_ports_cb()
1629 *cbctl->data.qports.state = qports->entry[0].state; in qeth_bridgeport_query_ports_cb()
1635 * qeth_bridgeport_query_ports() - query local bridgeport status.
1637 * @role: Role of the port: 0-none, 1-primary, 2-secondary.
1638 * @state: State of the port: 0-inactive, 1-standby, 2-active.
1640 * Returns negative errno-compatible error indication or 0 on success.
1642 * 'role' and 'state' are not updated in case of hardware operation failure.
1645 enum qeth_sbp_roles *role, enum qeth_sbp_states *state) in qeth_bridgeport_query_ports() argument
1649 .data = { in qeth_bridgeport_query_ports()
1651 .role = role, in qeth_bridgeport_query_ports()
1658 if (!(card->options.sbp.supported_funcs & IPA_SBP_QUERY_BRIDGE_PORTS)) in qeth_bridgeport_query_ports()
1659 return -EOPNOTSUPP; in qeth_bridgeport_query_ports()
1662 return -ENOMEM; in qeth_bridgeport_query_ports()
1669 struct qeth_reply *reply, unsigned long data) in qeth_bridgeport_set_cb() argument
1671 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *)data; in qeth_bridgeport_set_cb()
1678 * qeth_bridgeport_setrole() - Assign primary role to the port.
1680 * @role: Role to assign.
1682 * Returns negative errno-compatible error indication or 0 on success.
1684 int qeth_bridgeport_setrole(struct qeth_card *card, enum qeth_sbp_roles role) in qeth_bridgeport_setrole() argument
1691 switch (role) { in qeth_bridgeport_setrole()
1703 return -EINVAL; in qeth_bridgeport_setrole()
1705 if (!(card->options.sbp.supported_funcs & setcmd)) in qeth_bridgeport_setrole()
1706 return -EOPNOTSUPP; in qeth_bridgeport_setrole()
1709 return -ENOMEM; in qeth_bridgeport_setrole()
1721 if (entry->addr_lnid.lnid < VLAN_N_VID) in qeth_bridgeport_an_set_cb()
1724 (struct net_if_token *)&entry->nit, in qeth_bridgeport_an_set_cb()
1725 (struct mac_addr_lnid *)&entry->addr_lnid); in qeth_bridgeport_an_set_cb()
1729 * qeth_bridgeport_an_set() - Enable or disable bridgeport address notification
1731 * @enable: 0 - disable, non-zero - enable notifications
1733 * Returns negative errno-compatible error indication or 0 on success.
1742 if (!card->options.sbp.supported_funcs) in qeth_bridgeport_an_set()
1743 return -EOPNOTSUPP; in qeth_bridgeport_an_set()
1771 rc = -EOPNOTSUPP; in qeth_l2_vnicc_makerc()
1774 rc = -EALREADY; in qeth_l2_vnicc_makerc()
1777 rc = -EBUSY; in qeth_l2_vnicc_makerc()
1780 rc = -ENOSPC; in qeth_l2_vnicc_makerc()
1783 rc = -EACCES; in qeth_l2_vnicc_makerc()
1786 rc = -EIO; in qeth_l2_vnicc_makerc()
1796 unsigned long data) in qeth_l2_vnicc_request_cb() argument
1798 struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data; in qeth_l2_vnicc_request_cb()
1799 struct qeth_ipacmd_vnicc *rep = &cmd->data.vnicc; in qeth_l2_vnicc_request_cb()
1800 u32 sub_cmd = cmd->data.vnicc.hdr.sub_command; in qeth_l2_vnicc_request_cb()
1803 if (cmd->hdr.return_code) in qeth_l2_vnicc_request_cb()
1804 return qeth_l2_vnicc_makerc(card, cmd->hdr.return_code); in qeth_l2_vnicc_request_cb()
1806 card->options.vnicc.sup_chars = rep->vnicc_cmds.supported; in qeth_l2_vnicc_request_cb()
1807 card->options.vnicc.cur_chars = rep->vnicc_cmds.enabled; in qeth_l2_vnicc_request_cb()
1810 *(u32 *)reply->param = rep->data.query_cmds.sup_cmds; in qeth_l2_vnicc_request_cb()
1812 *(u32 *)reply->param = rep->data.getset_timeout.timeout; in qeth_l2_vnicc_request_cb()
1826 offsetof(struct qeth_ipacmd_vnicc, data)); in qeth_l2_vnicc_build_cmd()
1830 hdr = &__ipa_cmd(iob)->data.vnicc.hdr; in qeth_l2_vnicc_build_cmd()
1831 hdr->data_length = sizeof(*hdr) + data_length; in qeth_l2_vnicc_build_cmd()
1832 hdr->sub_command = vnicc_cmd; in qeth_l2_vnicc_build_cmd()
1844 return -ENOMEM; in qeth_l2_vnicc_query_chars()
1859 return -ENOMEM; in qeth_l2_vnicc_query_cmds()
1861 __ipa_cmd(iob)->data.vnicc.data.query_cmds.vnic_char = vnic_char; in qeth_l2_vnicc_query_cmds()
1875 return -ENOMEM; in qeth_l2_vnicc_set_char()
1877 __ipa_cmd(iob)->data.vnicc.data.set_char.vnic_char = vnic_char; in qeth_l2_vnicc_set_char()
1893 return -ENOMEM; in qeth_l2_vnicc_getset_timeout()
1895 getset_timeout = &__ipa_cmd(iob)->data.vnicc.data.getset_timeout; in qeth_l2_vnicc_getset_timeout()
1896 getset_timeout->vnic_char = vnicc; in qeth_l2_vnicc_getset_timeout()
1899 getset_timeout->timeout = *timeout; in qeth_l2_vnicc_getset_timeout()
1908 if (card->options.vnicc.sup_chars & vnicc && in qeth_l2_vnicc_recover_timeout()
1909 card->options.vnicc.getset_timeout_sup & vnicc && in qeth_l2_vnicc_recover_timeout()
1926 if (!(card->options.vnicc.sup_chars & vnicc) || in qeth_l2_vnicc_set_state()
1927 !(card->options.vnicc.set_char_sup & vnicc)) in qeth_l2_vnicc_set_state()
1928 return -EOPNOTSUPP; in qeth_l2_vnicc_set_state()
1931 return -EBUSY; in qeth_l2_vnicc_set_state()
1936 card->options.vnicc.wanted_chars |= vnicc; in qeth_l2_vnicc_set_state()
1939 card->options.vnicc.wanted_chars &= ~vnicc; in qeth_l2_vnicc_set_state()
1943 if (card->options.vnicc.cur_chars == card->options.vnicc.wanted_chars) in qeth_l2_vnicc_set_state()
1949 card->options.vnicc.cur_chars |= vnicc; in qeth_l2_vnicc_set_state()
1951 card->options.vnicc.cur_chars &= ~vnicc; in qeth_l2_vnicc_set_state()
1957 card->options.vnicc.wanted_chars = in qeth_l2_vnicc_set_state()
1958 card->options.vnicc.cur_chars; in qeth_l2_vnicc_set_state()
1962 card->options.vnicc.rx_bcast_enabled = true; in qeth_l2_vnicc_set_state()
1965 &card->options.vnicc.learning_timeout); in qeth_l2_vnicc_set_state()
1979 if (!(card->options.vnicc.sup_chars & vnicc)) in qeth_l2_vnicc_get_state()
1980 return -EOPNOTSUPP; in qeth_l2_vnicc_get_state()
1983 return -EBUSY; in qeth_l2_vnicc_get_state()
1989 *state = (card->options.vnicc.cur_chars & vnicc) ? true : false; in qeth_l2_vnicc_get_state()
2003 if (!(card->options.vnicc.sup_chars & QETH_VNICC_LEARNING) || in qeth_l2_vnicc_set_timeout()
2004 !(card->options.vnicc.getset_timeout_sup & QETH_VNICC_LEARNING)) in qeth_l2_vnicc_set_timeout()
2005 return -EOPNOTSUPP; in qeth_l2_vnicc_set_timeout()
2008 return -EBUSY; in qeth_l2_vnicc_set_timeout()
2011 if (card->options.vnicc.learning_timeout == timeout) in qeth_l2_vnicc_set_timeout()
2016 card->options.vnicc.learning_timeout = timeout; in qeth_l2_vnicc_set_timeout()
2024 card->options.vnicc.learning_timeout = timeout; in qeth_l2_vnicc_set_timeout()
2039 if (!(card->options.vnicc.sup_chars & QETH_VNICC_LEARNING) || in qeth_l2_vnicc_get_timeout()
2040 !(card->options.vnicc.getset_timeout_sup & QETH_VNICC_LEARNING)) in qeth_l2_vnicc_get_timeout()
2041 return -EOPNOTSUPP; in qeth_l2_vnicc_get_timeout()
2044 return -EBUSY; in qeth_l2_vnicc_get_timeout()
2047 *timeout = card->options.vnicc.learning_timeout; in qeth_l2_vnicc_get_timeout()
2059 if (!card->options.vnicc.sup_chars) in _qeth_l2_vnicc_is_in_use()
2064 if (card->options.vnicc.cur_chars == QETH_VNICC_DEFAULT) { in _qeth_l2_vnicc_is_in_use()
2065 if (!card->options.vnicc.rx_bcast_enabled || in _qeth_l2_vnicc_is_in_use()
2073 * qeth_bridgeport_allowed - are any qeth_bridgeport functions allowed?
2081 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_bridgeport_allowed()
2084 !(priv->brport_features & BR_LEARNING_SYNC)); in qeth_bridgeport_allowed()
2093 if (card->options.vnicc.sup_chars & vnicc && in qeth_l2_vnicc_recover_char()
2094 card->options.vnicc.set_char_sup & vnicc && in qeth_l2_vnicc_recover_char()
2097 card->options.vnicc.wanted_chars &= ~vnicc; in qeth_l2_vnicc_recover_char()
2098 card->options.vnicc.wanted_chars |= QETH_VNICC_DEFAULT & vnicc; in qeth_l2_vnicc_recover_char()
2102 /* (re-)initialize VNICC */
2105 u32 *timeout = &card->options.vnicc.learning_timeout; in qeth_l2_vnicc_init()
2113 card->options.vnicc.rx_bcast_enabled = 0; in qeth_l2_vnicc_init()
2116 if (card->options.vnicc.wanted_chars != QETH_VNICC_DEFAULT || in qeth_l2_vnicc_init()
2118 dev_err(&card->gdev->dev, "Configuring the VNIC characteristics failed\n"); in qeth_l2_vnicc_init()
2120 card->options.vnicc.sup_chars = 0; in qeth_l2_vnicc_init()
2121 card->options.vnicc.cur_chars = 0; in qeth_l2_vnicc_init()
2122 card->options.vnicc.wanted_chars = QETH_VNICC_DEFAULT; in qeth_l2_vnicc_init()
2126 chars_tmp = card->options.vnicc.sup_chars; in qeth_l2_vnicc_init()
2127 chars_len = sizeof(card->options.vnicc.sup_chars) * BITS_PER_BYTE; in qeth_l2_vnicc_init()
2136 card->options.vnicc.getset_timeout_sup |= vnicc; in qeth_l2_vnicc_init()
2138 card->options.vnicc.getset_timeout_sup &= ~vnicc; in qeth_l2_vnicc_init()
2141 card->options.vnicc.set_char_sup |= vnicc; in qeth_l2_vnicc_init()
2143 card->options.vnicc.set_char_sup &= ~vnicc; in qeth_l2_vnicc_init()
2149 chars_tmp = card->options.vnicc.wanted_chars ^ in qeth_l2_vnicc_init()
2150 card->options.vnicc.cur_chars; in qeth_l2_vnicc_init()
2151 chars_len = sizeof(card->options.vnicc.wanted_chars) * BITS_PER_BYTE; in qeth_l2_vnicc_init()
2154 enable = card->options.vnicc.wanted_chars & vnicc; in qeth_l2_vnicc_init()
2158 dev_err(&card->gdev->dev, "Configuring the VNIC characteristics failed\n"); in qeth_l2_vnicc_init()
2165 card->options.vnicc.sup_chars = QETH_VNICC_ALL; in qeth_l2_vnicc_set_defaults()
2166 card->options.vnicc.cur_chars = QETH_VNICC_DEFAULT; in qeth_l2_vnicc_set_defaults()
2167 card->options.vnicc.learning_timeout = QETH_VNICC_DEFAULT_TIMEOUT; in qeth_l2_vnicc_set_defaults()
2169 card->options.vnicc.set_char_sup = QETH_VNICC_ALL; in qeth_l2_vnicc_set_defaults()
2170 card->options.vnicc.getset_timeout_sup = QETH_VNICC_LEARNING; in qeth_l2_vnicc_set_defaults()
2172 card->options.vnicc.wanted_chars = QETH_VNICC_DEFAULT; in qeth_l2_vnicc_set_defaults()
2182 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_probe_device()
2186 dev_notice(&gdev->dev, "OSN support will be dropped in 2021\n"); in qeth_l2_probe_device()
2189 mutex_init(&card->sbp_lock); in qeth_l2_probe_device()
2191 if (gdev->dev.type == &qeth_generic_devtype) { in qeth_l2_probe_device()
2192 rc = qeth_l2_create_device_attributes(&gdev->dev); in qeth_l2_probe_device()
2197 INIT_WORK(&card->rx_mode_work, qeth_l2_rx_mode_work); in qeth_l2_probe_device()
2203 struct qeth_card *card = dev_get_drvdata(&gdev->dev); in qeth_l2_remove_device()
2205 if (gdev->dev.type == &qeth_generic_devtype) in qeth_l2_remove_device()
2206 qeth_l2_remove_device_attributes(&gdev->dev); in qeth_l2_remove_device()
2208 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); in qeth_l2_remove_device()
2210 if (gdev->state == CCWGROUP_ONLINE) in qeth_l2_remove_device()
2213 cancel_work_sync(&card->close_dev_work); in qeth_l2_remove_device()
2214 if (card->dev->reg_state == NETREG_REGISTERED) in qeth_l2_remove_device()
2215 unregister_netdev(card->dev); in qeth_l2_remove_device()
2220 struct net_device *dev = card->dev; in qeth_l2_set_online()
2225 mutex_lock(&card->sbp_lock); in qeth_l2_set_online()
2227 if (card->options.sbp.supported_funcs) { in qeth_l2_set_online()
2229 dev_info(&card->gdev->dev, in qeth_l2_set_online()
2232 mutex_unlock(&card->sbp_lock); in qeth_l2_set_online()
2244 card->state = CARD_STATE_SOFTSETUP; in qeth_l2_set_online()
2248 if (dev->reg_state != NETREG_REGISTERED) { in qeth_l2_set_online()
2273 if (card->info.open_when_online) { in qeth_l2_set_online()
2274 card->info.open_when_online = 0; in qeth_l2_set_online()
2284 card->state = CARD_STATE_DOWN; in qeth_l2_set_online()
2290 struct qeth_priv *priv = netdev_priv(card->dev); in qeth_l2_set_offline()
2295 if (card->state == CARD_STATE_SOFTSETUP) in qeth_l2_set_offline()
2296 card->state = CARD_STATE_DOWN; in qeth_l2_set_offline()
2299 if (priv->brport_features & BR_LEARNING_SYNC) { in qeth_l2_set_offline()
2310 switch (cmd->hdr.command) { in qeth_l2_control_event()
2313 if (cmd->data.sbp.hdr.command_code == in qeth_l2_control_event()