Lines Matching full:adapter

20 	struct idpf_adapter *adapter = pci_get_drvdata(pdev);  in idpf_remove()  local
23 set_bit(IDPF_REMOVE_IN_PROG, adapter->flags); in idpf_remove()
30 cancel_delayed_work_sync(&adapter->vc_event_task); in idpf_remove()
31 if (adapter->num_vfs) in idpf_remove()
34 idpf_vc_core_deinit(adapter); in idpf_remove()
37 adapter->dev_ops.reg_ops.trigger_reset(adapter, IDPF_HR_FUNC_RESET); in idpf_remove()
38 idpf_deinit_dflt_mbx(adapter); in idpf_remove()
40 if (!adapter->netdevs) in idpf_remove()
48 for (i = 0; i < adapter->max_vports; i++) { in idpf_remove()
49 if (!adapter->netdevs[i]) in idpf_remove()
51 if (adapter->netdevs[i]->reg_state != NETREG_UNINITIALIZED) in idpf_remove()
52 unregister_netdev(adapter->netdevs[i]); in idpf_remove()
53 free_netdev(adapter->netdevs[i]); in idpf_remove()
54 adapter->netdevs[i] = NULL; in idpf_remove()
58 destroy_workqueue(adapter->init_wq); in idpf_remove()
59 destroy_workqueue(adapter->serv_wq); in idpf_remove()
60 destroy_workqueue(adapter->mbx_wq); in idpf_remove()
61 destroy_workqueue(adapter->stats_wq); in idpf_remove()
62 destroy_workqueue(adapter->vc_event_wq); in idpf_remove()
64 for (i = 0; i < adapter->max_vports; i++) { in idpf_remove()
65 kfree(adapter->vport_config[i]); in idpf_remove()
66 adapter->vport_config[i] = NULL; in idpf_remove()
68 kfree(adapter->vport_config); in idpf_remove()
69 adapter->vport_config = NULL; in idpf_remove()
70 kfree(adapter->netdevs); in idpf_remove()
71 adapter->netdevs = NULL; in idpf_remove()
72 kfree(adapter->vcxn_mngr); in idpf_remove()
73 adapter->vcxn_mngr = NULL; in idpf_remove()
75 mutex_destroy(&adapter->vport_ctrl_lock); in idpf_remove()
76 mutex_destroy(&adapter->vector_lock); in idpf_remove()
77 mutex_destroy(&adapter->queue_lock); in idpf_remove()
78 mutex_destroy(&adapter->vc_buf_lock); in idpf_remove()
81 kfree(adapter); in idpf_remove()
98 * @adapter: adapter to setup hw struct for
102 static int idpf_cfg_hw(struct idpf_adapter *adapter) in idpf_cfg_hw() argument
104 struct pci_dev *pdev = adapter->pdev; in idpf_cfg_hw()
105 struct idpf_hw *hw = &adapter->hw; in idpf_cfg_hw()
114 hw->back = adapter; in idpf_cfg_hw()
129 struct idpf_adapter *adapter; in idpf_probe() local
132 adapter = kzalloc(sizeof(*adapter), GFP_KERNEL); in idpf_probe()
133 if (!adapter) in idpf_probe()
136 adapter->req_tx_splitq = true; in idpf_probe()
137 adapter->req_rx_splitq = true; in idpf_probe()
141 idpf_dev_ops_init(adapter); in idpf_probe()
144 idpf_vf_dev_ops_init(adapter); in idpf_probe()
145 adapter->crc_enable = true; in idpf_probe()
154 adapter->pdev = pdev; in idpf_probe()
175 pci_set_drvdata(pdev, adapter); in idpf_probe()
177 adapter->init_wq = alloc_workqueue("%s-%s-init", 0, 0, in idpf_probe()
180 if (!adapter->init_wq) { in idpf_probe()
186 adapter->serv_wq = alloc_workqueue("%s-%s-service", 0, 0, in idpf_probe()
189 if (!adapter->serv_wq) { in idpf_probe()
195 adapter->mbx_wq = alloc_workqueue("%s-%s-mbx", 0, 0, in idpf_probe()
198 if (!adapter->mbx_wq) { in idpf_probe()
204 adapter->stats_wq = alloc_workqueue("%s-%s-stats", 0, 0, in idpf_probe()
207 if (!adapter->stats_wq) { in idpf_probe()
213 adapter->vc_event_wq = alloc_workqueue("%s-%s-vc_event", 0, 0, in idpf_probe()
216 if (!adapter->vc_event_wq) { in idpf_probe()
223 adapter->msg_enable = netif_msg_init(-1, IDPF_AVAIL_NETIF_M); in idpf_probe()
225 err = idpf_cfg_hw(adapter); in idpf_probe()
227 dev_err(dev, "Failed to configure HW structure for adapter: %d\n", in idpf_probe()
232 mutex_init(&adapter->vport_ctrl_lock); in idpf_probe()
233 mutex_init(&adapter->vector_lock); in idpf_probe()
234 mutex_init(&adapter->queue_lock); in idpf_probe()
235 mutex_init(&adapter->vc_buf_lock); in idpf_probe()
237 INIT_DELAYED_WORK(&adapter->init_task, idpf_init_task); in idpf_probe()
238 INIT_DELAYED_WORK(&adapter->serv_task, idpf_service_task); in idpf_probe()
239 INIT_DELAYED_WORK(&adapter->mbx_task, idpf_mbx_task); in idpf_probe()
240 INIT_DELAYED_WORK(&adapter->stats_task, idpf_statistics_task); in idpf_probe()
241 INIT_DELAYED_WORK(&adapter->vc_event_task, idpf_vc_event_task); in idpf_probe()
243 adapter->dev_ops.reg_ops.reset_reg_init(adapter); in idpf_probe()
244 set_bit(IDPF_HR_DRV_LOAD, adapter->flags); in idpf_probe()
245 queue_delayed_work(adapter->vc_event_wq, &adapter->vc_event_task, in idpf_probe()
251 destroy_workqueue(adapter->vc_event_wq); in idpf_probe()
253 destroy_workqueue(adapter->stats_wq); in idpf_probe()
255 destroy_workqueue(adapter->mbx_wq); in idpf_probe()
257 destroy_workqueue(adapter->serv_wq); in idpf_probe()
259 destroy_workqueue(adapter->init_wq); in idpf_probe()
261 kfree(adapter); in idpf_probe()