Lines Matching refs:ndp
33 bool ncsi_channel_is_last(struct ncsi_dev_priv *ndp, in ncsi_channel_is_last() argument
39 NCSI_FOR_EACH_PACKAGE(ndp, np) in ncsi_channel_is_last()
51 static void ncsi_report_link(struct ncsi_dev_priv *ndp, bool force_down) in ncsi_report_link() argument
53 struct ncsi_dev *nd = &ndp->ndev; in ncsi_report_link()
65 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_report_link()
93 struct ncsi_dev_priv *ndp = np->ndp; in ncsi_channel_monitor() local
116 netdev_warn(ndp->ndev.dev, in ncsi_channel_monitor()
128 nca.ndp = ndp; in ncsi_channel_monitor()
135 netdev_err(ndp->ndev.dev, "Error %d sending GLS\n", in ncsi_channel_monitor()
141 netdev_err(ndp->ndev.dev, "NCSI Channel %d timed out!\n", in ncsi_channel_monitor()
143 ncsi_report_link(ndp, true); in ncsi_channel_monitor()
144 ndp->flags |= NCSI_DEV_RESHUFFLE; in ncsi_channel_monitor()
153 spin_lock_irqsave(&ndp->lock, flags); in ncsi_channel_monitor()
155 list_add_tail_rcu(&nc->link, &ndp->channel_queue); in ncsi_channel_monitor()
156 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_channel_monitor()
157 ncsi_process_next_channel(ndp); in ncsi_channel_monitor()
269 struct ncsi_package *ncsi_find_package(struct ncsi_dev_priv *ndp, in ncsi_find_package() argument
274 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_find_package()
282 struct ncsi_package *ncsi_add_package(struct ncsi_dev_priv *ndp, in ncsi_add_package() argument
293 np->ndp = ndp; in ncsi_add_package()
298 spin_lock_irqsave(&ndp->lock, flags); in ncsi_add_package()
299 tmp = ncsi_find_package(ndp, id); in ncsi_add_package()
301 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_add_package()
306 list_add_tail_rcu(&np->node, &ndp->packages); in ncsi_add_package()
307 ndp->package_num++; in ncsi_add_package()
308 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_add_package()
315 struct ncsi_dev_priv *ndp = np->ndp; in ncsi_remove_package() local
324 spin_lock_irqsave(&ndp->lock, flags); in ncsi_remove_package()
326 ndp->package_num--; in ncsi_remove_package()
327 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_remove_package()
332 void ncsi_find_package_and_channel(struct ncsi_dev_priv *ndp, in ncsi_find_package_and_channel() argument
340 p = ncsi_find_package(ndp, NCSI_PACKAGE_INDEX(id)); in ncsi_find_package_and_channel()
353 struct ncsi_request *ncsi_alloc_request(struct ncsi_dev_priv *ndp, in ncsi_alloc_request() argument
357 int i, limit = ARRAY_SIZE(ndp->requests); in ncsi_alloc_request()
361 spin_lock_irqsave(&ndp->lock, flags); in ncsi_alloc_request()
362 for (i = ndp->request_id; i < limit; i++) { in ncsi_alloc_request()
363 if (ndp->requests[i].used) in ncsi_alloc_request()
366 nr = &ndp->requests[i]; in ncsi_alloc_request()
369 ndp->request_id = i + 1; in ncsi_alloc_request()
374 for (i = NCSI_REQ_START_IDX; i < ndp->request_id; i++) { in ncsi_alloc_request()
375 if (ndp->requests[i].used) in ncsi_alloc_request()
378 nr = &ndp->requests[i]; in ncsi_alloc_request()
381 ndp->request_id = i + 1; in ncsi_alloc_request()
386 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_alloc_request()
392 struct ncsi_dev_priv *ndp = nr->ndp; in ncsi_free_request() local
402 spin_lock_irqsave(&ndp->lock, flags); in ncsi_free_request()
409 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_free_request()
411 if (driven && cmd && --ndp->pending_req_num == 0) in ncsi_free_request()
412 schedule_work(&ndp->work); in ncsi_free_request()
421 struct ncsi_dev_priv *ndp; in ncsi_find_dev() local
423 NCSI_FOR_EACH_DEV(ndp) { in ncsi_find_dev()
424 if (ndp->ndev.dev == dev) in ncsi_find_dev()
425 return &ndp->ndev; in ncsi_find_dev()
434 struct ncsi_dev_priv *ndp = nr->ndp; in ncsi_request_timeout() local
443 spin_lock_irqsave(&ndp->lock, flags); in ncsi_request_timeout()
446 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_request_timeout()
449 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_request_timeout()
456 ncsi_find_package_and_channel(ndp, in ncsi_request_timeout()
467 static void ncsi_suspend_channel(struct ncsi_dev_priv *ndp) in ncsi_suspend_channel() argument
469 struct ncsi_dev *nd = &ndp->ndev; in ncsi_suspend_channel()
476 np = ndp->active_package; in ncsi_suspend_channel()
477 nc = ndp->active_channel; in ncsi_suspend_channel()
478 nca.ndp = ndp; in ncsi_suspend_channel()
485 ndp->pending_req_num = 1; in ncsi_suspend_channel()
490 if (ndp->flags & NCSI_DEV_HWA) in ncsi_suspend_channel()
503 if (ndp->flags & NCSI_DEV_RESHUFFLE) in ncsi_suspend_channel()
513 ndp->pending_req_num = np->channel_num; in ncsi_suspend_channel()
528 ndp->pending_req_num = 1; in ncsi_suspend_channel()
541 ndp->pending_req_num = 1; in ncsi_suspend_channel()
564 ndp->pending_req_num = 1; in ncsi_suspend_channel()
580 if (ndp->flags & NCSI_DEV_RESET) in ncsi_suspend_channel()
583 ncsi_process_next_channel(ndp); in ncsi_suspend_channel()
598 static int clear_one_vid(struct ncsi_dev_priv *ndp, struct ncsi_channel *nc, in clear_one_vid() argument
633 static int set_one_vid(struct ncsi_dev_priv *ndp, struct ncsi_channel *nc, in set_one_vid() argument
643 if (list_empty(&ndp->vlan_vids)) in set_one_vid()
652 list_for_each_entry_rcu(vlan, &ndp->vlan_vids, list) { in set_one_vid()
672 netdev_err(ndp->ndev.dev, in set_one_vid()
713 netdev_err(nca->ndp->ndev.dev, in ncsi_oem_keep_phy_intel()
739 netdev_err(nca->ndp->ndev.dev, in ncsi_oem_gma_handler_bcm()
764 netdev_err(nca->ndp->ndev.dev, in ncsi_oem_gma_handler_mlx()
783 nca->ndp->ndev.dev->dev_addr, ETH_ALEN); in ncsi_oem_smaf_mlx()
792 netdev_err(nca->ndp->ndev.dev, in ncsi_oem_smaf_mlx()
813 netdev_err(nca->ndp->ndev.dev, in ncsi_oem_gma_handler_intel()
836 if (nca->ndp->gma_flag == 1) in ncsi_gma_handler()
849 netdev_err(nca->ndp->ndev.dev, in ncsi_gma_handler()
862 static bool ncsi_channel_is_tx(struct ncsi_dev_priv *ndp, in ncsi_channel_is_tx() argument
872 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_channel_is_tx()
873 if (!ndp->multi_package && np != nc->package) in ncsi_channel_is_tx()
883 list_for_each_entry_rcu(channel, &ndp->channel_queue, link) { in ncsi_channel_is_tx()
895 list_for_each_entry_rcu(channel, &ndp->channel_queue, link) in ncsi_channel_is_tx()
904 int ncsi_update_tx_channel(struct ncsi_dev_priv *ndp, in ncsi_update_tx_channel() argument
914 if (!package->multi_channel && !ndp->multi_package) in ncsi_update_tx_channel()
915 netdev_warn(ndp->ndev.dev, in ncsi_update_tx_channel()
917 nca.ndp = ndp; in ncsi_update_tx_channel()
921 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_update_tx_channel()
924 if (!ndp->multi_package && np != package) in ncsi_update_tx_channel()
935 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_update_tx_channel()
938 if (!ndp->multi_package && np != package) in ncsi_update_tx_channel()
940 if (!(ndp->package_whitelist & (0x1 << np->id))) in ncsi_update_tx_channel()
973 netdev_err(ndp->ndev.dev, in ncsi_update_tx_channel()
978 netdev_info(ndp->ndev.dev, "NCSI: channel %u enables Tx\n", enable->id); in ncsi_update_tx_channel()
985 netdev_err(ndp->ndev.dev, in ncsi_update_tx_channel()
992 static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) in ncsi_configure_channel() argument
994 struct ncsi_package *np = ndp->active_package; in ncsi_configure_channel()
995 struct ncsi_channel *nc = ndp->active_channel; in ncsi_configure_channel()
997 struct ncsi_dev *nd = &ndp->ndev; in ncsi_configure_channel()
1004 nca.ndp = ndp; in ncsi_configure_channel()
1009 ndp->pending_req_num = 1; in ncsi_configure_channel()
1013 if (ndp->flags & NCSI_DEV_HWA) in ncsi_configure_channel()
1021 netdev_err(ndp->ndev.dev, in ncsi_configure_channel()
1029 ndp->pending_req_num = 1; in ncsi_configure_channel()
1037 netdev_err(ndp->ndev.dev, in ncsi_configure_channel()
1052 ndp->pending_req_num = 1; in ncsi_configure_channel()
1057 schedule_work(&ndp->work); in ncsi_configure_channel()
1070 ndp->pending_req_num = 1; in ncsi_configure_channel()
1077 ret = clear_one_vid(ndp, nc, &nca); in ncsi_configure_channel()
1080 schedule_work(&ndp->work); in ncsi_configure_channel()
1087 ret = set_one_vid(ndp, nc, &nca); in ncsi_configure_channel()
1090 schedule_work(&ndp->work); in ncsi_configure_channel()
1097 if (list_empty(&ndp->vlan_vids)) { in ncsi_configure_channel()
1125 else if (ncsi_channel_is_tx(ndp, nc)) in ncsi_configure_channel()
1131 if (ncsi_channel_is_tx(ndp, nc)) in ncsi_configure_channel()
1138 netdev_info(ndp->ndev.dev, in ncsi_configure_channel()
1161 netdev_err(ndp->ndev.dev, in ncsi_configure_channel()
1168 netdev_dbg(ndp->ndev.dev, "NCSI: channel %u config done\n", in ncsi_configure_channel()
1173 if (ndp->flags & NCSI_DEV_RESET) { in ncsi_configure_channel()
1190 spin_lock_irqsave(&ndp->lock, flags); in ncsi_configure_channel()
1191 list_add_tail_rcu(&nc->link, &ndp->channel_queue); in ncsi_configure_channel()
1192 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_configure_channel()
1195 ncsi_process_next_channel(ndp); in ncsi_configure_channel()
1203 netdev_dbg(ndp->ndev.dev, in ncsi_configure_channel()
1210 spin_lock_irqsave(&ndp->lock, flags); in ncsi_configure_channel()
1211 ndp->hot_channel = hot_nc; in ncsi_configure_channel()
1212 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_configure_channel()
1215 ncsi_process_next_channel(ndp); in ncsi_configure_channel()
1225 ncsi_report_link(ndp, true); in ncsi_configure_channel()
1228 static int ncsi_choose_active_channel(struct ncsi_dev_priv *ndp) in ncsi_choose_active_channel() argument
1236 spin_lock_irqsave(&ndp->lock, flags); in ncsi_choose_active_channel()
1237 hot_nc = ndp->hot_channel; in ncsi_choose_active_channel()
1238 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_choose_active_channel()
1247 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_choose_active_channel()
1248 if (!(ndp->package_whitelist & (0x1 << np->id))) in ncsi_choose_active_channel()
1279 spin_lock_irqsave(&ndp->lock, flags); in ncsi_choose_active_channel()
1281 &ndp->channel_queue); in ncsi_choose_active_channel()
1282 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_choose_active_channel()
1284 netdev_dbg(ndp->ndev.dev, in ncsi_choose_active_channel()
1295 if (with_link && !ndp->multi_package) in ncsi_choose_active_channel()
1299 if (list_empty(&ndp->channel_queue) && found) { in ncsi_choose_active_channel()
1300 netdev_info(ndp->ndev.dev, in ncsi_choose_active_channel()
1303 spin_lock_irqsave(&ndp->lock, flags); in ncsi_choose_active_channel()
1304 list_add_tail_rcu(&found->link, &ndp->channel_queue); in ncsi_choose_active_channel()
1305 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_choose_active_channel()
1307 netdev_warn(ndp->ndev.dev, in ncsi_choose_active_channel()
1309 ncsi_report_link(ndp, true); in ncsi_choose_active_channel()
1313 return ncsi_process_next_channel(ndp); in ncsi_choose_active_channel()
1316 static bool ncsi_check_hwa(struct ncsi_dev_priv *ndp) in ncsi_check_hwa() argument
1326 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_check_hwa()
1334 ndp->flags &= ~NCSI_DEV_HWA; in ncsi_check_hwa()
1341 ndp->flags |= NCSI_DEV_HWA; in ncsi_check_hwa()
1345 ndp->flags &= ~NCSI_DEV_HWA; in ncsi_check_hwa()
1349 static void ncsi_probe_channel(struct ncsi_dev_priv *ndp) in ncsi_probe_channel() argument
1351 struct ncsi_dev *nd = &ndp->ndev; in ncsi_probe_channel()
1358 nca.ndp = ndp; in ncsi_probe_channel()
1365 ndp->pending_req_num = 8; in ncsi_probe_channel()
1380 ndp->pending_req_num = 1; in ncsi_probe_channel()
1384 nca.package = ndp->package_probe_id; in ncsi_probe_channel()
1392 ndp->active_package = ncsi_find_package(ndp, in ncsi_probe_channel()
1393 ndp->package_probe_id); in ncsi_probe_channel()
1394 if (!ndp->active_package) { in ncsi_probe_channel()
1397 schedule_work(&ndp->work); in ncsi_probe_channel()
1402 ndp->mlx_multi_host) in ncsi_probe_channel()
1405 schedule_work(&ndp->work); in ncsi_probe_channel()
1409 ndp->pending_req_num = 1; in ncsi_probe_channel()
1412 nca.package = ndp->active_package->id; in ncsi_probe_channel()
1421 ndp->pending_req_num = 1; in ncsi_probe_channel()
1424 nca.package = ndp->active_package->id; in ncsi_probe_channel()
1434 ndp->pending_req_num = NCSI_RESERVED_CHANNEL; in ncsi_probe_channel()
1438 nca.package = ndp->active_package->id; in ncsi_probe_channel()
1452 ndp->pending_req_num = 1; in ncsi_probe_channel()
1455 nca.package = ndp->active_package->id; in ncsi_probe_channel()
1467 np = ndp->active_package; in ncsi_probe_channel()
1468 ndp->pending_req_num = np->channel_num; in ncsi_probe_channel()
1494 ndp->pending_req_num = 1; in ncsi_probe_channel()
1498 nca.package = ndp->package_probe_id; in ncsi_probe_channel()
1505 ndp->package_probe_id++; in ncsi_probe_channel()
1506 if (ndp->package_probe_id >= 8) { in ncsi_probe_channel()
1508 ndp->flags |= NCSI_DEV_PROBED; in ncsi_probe_channel()
1512 ndp->active_package = NULL; in ncsi_probe_channel()
1519 if (ndp->flags & NCSI_DEV_PROBED) { in ncsi_probe_channel()
1521 ncsi_check_hwa(ndp); in ncsi_probe_channel()
1522 ncsi_choose_active_channel(ndp); in ncsi_probe_channel()
1527 netdev_err(ndp->ndev.dev, in ncsi_probe_channel()
1530 ncsi_report_link(ndp, true); in ncsi_probe_channel()
1535 struct ncsi_dev_priv *ndp = container_of(work, in ncsi_dev_work() local
1537 struct ncsi_dev *nd = &ndp->ndev; in ncsi_dev_work()
1541 ncsi_probe_channel(ndp); in ncsi_dev_work()
1544 ncsi_suspend_channel(ndp); in ncsi_dev_work()
1547 ncsi_configure_channel(ndp); in ncsi_dev_work()
1555 int ncsi_process_next_channel(struct ncsi_dev_priv *ndp) in ncsi_process_next_channel() argument
1561 spin_lock_irqsave(&ndp->lock, flags); in ncsi_process_next_channel()
1562 nc = list_first_or_null_rcu(&ndp->channel_queue, in ncsi_process_next_channel()
1565 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_process_next_channel()
1570 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_process_next_channel()
1577 ndp->active_channel = nc; in ncsi_process_next_channel()
1578 ndp->active_package = nc->package; in ncsi_process_next_channel()
1582 ndp->ndev.state = ncsi_dev_state_config; in ncsi_process_next_channel()
1583 netdev_dbg(ndp->ndev.dev, "NCSI: configuring channel %u\n", in ncsi_process_next_channel()
1585 ncsi_configure_channel(ndp); in ncsi_process_next_channel()
1588 ndp->ndev.state = ncsi_dev_state_suspend; in ncsi_process_next_channel()
1589 netdev_dbg(ndp->ndev.dev, "NCSI: suspending channel %u\n", in ncsi_process_next_channel()
1591 ncsi_suspend_channel(ndp); in ncsi_process_next_channel()
1594 netdev_err(ndp->ndev.dev, "Invalid state 0x%x on %d:%d\n", in ncsi_process_next_channel()
1596 ncsi_report_link(ndp, false); in ncsi_process_next_channel()
1603 ndp->active_channel = NULL; in ncsi_process_next_channel()
1604 ndp->active_package = NULL; in ncsi_process_next_channel()
1605 if (ndp->flags & NCSI_DEV_RESHUFFLE) { in ncsi_process_next_channel()
1606 ndp->flags &= ~NCSI_DEV_RESHUFFLE; in ncsi_process_next_channel()
1607 return ncsi_choose_active_channel(ndp); in ncsi_process_next_channel()
1610 ncsi_report_link(ndp, false); in ncsi_process_next_channel()
1614 static int ncsi_kick_channels(struct ncsi_dev_priv *ndp) in ncsi_kick_channels() argument
1616 struct ncsi_dev *nd = &ndp->ndev; in ncsi_kick_channels()
1622 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_kick_channels()
1633 if ((ndp->ndev.state & 0xff00) == in ncsi_kick_channels()
1652 spin_lock_irqsave(&ndp->lock, flags); in ncsi_kick_channels()
1653 list_add_tail_rcu(&nc->link, &ndp->channel_queue); in ncsi_kick_channels()
1654 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_kick_channels()
1666 struct ncsi_dev_priv *ndp; in ncsi_vlan_rx_add_vid() local
1681 ndp = TO_NCSI_DEV_PRIV(nd); in ncsi_vlan_rx_add_vid()
1684 list_for_each_entry_rcu(vlan, &ndp->vlan_vids, list) { in ncsi_vlan_rx_add_vid()
1705 list_add_rcu(&vlan->list, &ndp->vlan_vids); in ncsi_vlan_rx_add_vid()
1709 found = ncsi_kick_channels(ndp) != 0; in ncsi_vlan_rx_add_vid()
1711 return found ? ncsi_process_next_channel(ndp) : 0; in ncsi_vlan_rx_add_vid()
1718 struct ncsi_dev_priv *ndp; in ncsi_vlan_rx_kill_vid() local
1731 ndp = TO_NCSI_DEV_PRIV(nd); in ncsi_vlan_rx_kill_vid()
1734 list_for_each_entry_safe(vlan, tmp, &ndp->vlan_vids, list) in ncsi_vlan_rx_kill_vid()
1747 found = ncsi_kick_channels(ndp) != 0; in ncsi_vlan_rx_kill_vid()
1749 return found ? ncsi_process_next_channel(ndp) : 0; in ncsi_vlan_rx_kill_vid()
1756 struct ncsi_dev_priv *ndp; in ncsi_register_dev() local
1769 ndp = kzalloc(sizeof(*ndp), GFP_ATOMIC); in ncsi_register_dev()
1770 if (!ndp) in ncsi_register_dev()
1773 nd = &ndp->ndev; in ncsi_register_dev()
1777 ndp->pending_req_num = 0; in ncsi_register_dev()
1778 INIT_LIST_HEAD(&ndp->channel_queue); in ncsi_register_dev()
1779 INIT_LIST_HEAD(&ndp->vlan_vids); in ncsi_register_dev()
1780 INIT_WORK(&ndp->work, ncsi_dev_work); in ncsi_register_dev()
1781 ndp->package_whitelist = UINT_MAX; in ncsi_register_dev()
1784 spin_lock_init(&ndp->lock); in ncsi_register_dev()
1785 INIT_LIST_HEAD(&ndp->packages); in ncsi_register_dev()
1786 ndp->request_id = NCSI_REQ_START_IDX; in ncsi_register_dev()
1787 for (i = 0; i < ARRAY_SIZE(ndp->requests); i++) { in ncsi_register_dev()
1788 ndp->requests[i].id = i; in ncsi_register_dev()
1789 ndp->requests[i].ndp = ndp; in ncsi_register_dev()
1790 timer_setup(&ndp->requests[i].timer, ncsi_request_timeout, 0); in ncsi_register_dev()
1794 list_add_tail_rcu(&ndp->node, &ncsi_dev_list); in ncsi_register_dev()
1798 ndp->ptype.type = cpu_to_be16(ETH_P_NCSI); in ncsi_register_dev()
1799 ndp->ptype.func = ncsi_rcv_rsp; in ncsi_register_dev()
1800 ndp->ptype.dev = dev; in ncsi_register_dev()
1801 dev_add_pack(&ndp->ptype); in ncsi_register_dev()
1808 ndp->mlx_multi_host = true; in ncsi_register_dev()
1817 struct ncsi_dev_priv *ndp = TO_NCSI_DEV_PRIV(nd); in ncsi_start_dev() local
1823 if (!(ndp->flags & NCSI_DEV_PROBED)) { in ncsi_start_dev()
1824 ndp->package_probe_id = 0; in ncsi_start_dev()
1826 schedule_work(&ndp->work); in ncsi_start_dev()
1836 struct ncsi_dev_priv *ndp = TO_NCSI_DEV_PRIV(nd); in ncsi_stop_dev() local
1847 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_stop_dev()
1861 netdev_dbg(ndp->ndev.dev, "NCSI: Stopping device\n"); in ncsi_stop_dev()
1862 ncsi_report_link(ndp, true); in ncsi_stop_dev()
1868 struct ncsi_dev_priv *ndp = TO_NCSI_DEV_PRIV(nd); in ncsi_reset_dev() local
1873 spin_lock_irqsave(&ndp->lock, flags); in ncsi_reset_dev()
1875 if (!(ndp->flags & NCSI_DEV_RESET)) { in ncsi_reset_dev()
1881 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_reset_dev()
1889 ndp->flags |= NCSI_DEV_RESET; in ncsi_reset_dev()
1890 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_reset_dev()
1902 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_reset_dev()
1907 if (!list_empty(&ndp->channel_queue)) { in ncsi_reset_dev()
1909 list_for_each_entry_safe(nc, tmp, &ndp->channel_queue, link) in ncsi_reset_dev()
1912 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_reset_dev()
1915 NCSI_FOR_EACH_PACKAGE(ndp, np) { in ncsi_reset_dev()
1935 spin_lock_irqsave(&ndp->lock, flags); in ncsi_reset_dev()
1936 ndp->flags &= ~NCSI_DEV_RESET; in ncsi_reset_dev()
1937 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_reset_dev()
1938 return ncsi_choose_active_channel(ndp); in ncsi_reset_dev()
1941 spin_lock_irqsave(&ndp->lock, flags); in ncsi_reset_dev()
1942 ndp->flags |= NCSI_DEV_RESET; in ncsi_reset_dev()
1943 ndp->active_channel = active; in ncsi_reset_dev()
1944 ndp->active_package = active->package; in ncsi_reset_dev()
1945 spin_unlock_irqrestore(&ndp->lock, flags); in ncsi_reset_dev()
1948 schedule_work(&ndp->work); in ncsi_reset_dev()
1954 struct ncsi_dev_priv *ndp = TO_NCSI_DEV_PRIV(nd); in ncsi_unregister_dev() local
1958 dev_remove_pack(&ndp->ptype); in ncsi_unregister_dev()
1960 list_for_each_entry_safe(np, tmp, &ndp->packages, node) in ncsi_unregister_dev()
1964 list_del_rcu(&ndp->node); in ncsi_unregister_dev()
1967 kfree(ndp); in ncsi_unregister_dev()