Lines Matching full:ndev
81 static void nitrox_pf_cleanup(struct nitrox_device *ndev) in nitrox_pf_cleanup() argument
84 atomic_set(&ndev->state, __NDEV_NOT_READY); in nitrox_pf_cleanup()
89 nitrox_unregister_interrupts(ndev); in nitrox_pf_cleanup()
90 nitrox_common_sw_cleanup(ndev); in nitrox_pf_cleanup()
95 * @ndev: NITROX device
97 static int nitrox_pf_reinit(struct nitrox_device *ndev) in nitrox_pf_reinit() argument
102 err = nitrox_common_sw_init(ndev); in nitrox_pf_reinit()
106 err = nitrox_register_interrupts(ndev); in nitrox_pf_reinit()
108 nitrox_common_sw_cleanup(ndev); in nitrox_pf_reinit()
113 nitrox_config_aqm_rings(ndev); in nitrox_pf_reinit()
116 nitrox_config_pkt_input_rings(ndev); in nitrox_pf_reinit()
117 nitrox_config_pkt_solicit_ports(ndev); in nitrox_pf_reinit()
120 atomic_set(&ndev->state, __NDEV_READY); in nitrox_pf_reinit()
126 static void nitrox_sriov_cleanup(struct nitrox_device *ndev) in nitrox_sriov_cleanup() argument
129 nitrox_sriov_unregister_interrupts(ndev); in nitrox_sriov_cleanup()
130 nitrox_mbox_cleanup(ndev); in nitrox_sriov_cleanup()
133 static int nitrox_sriov_init(struct nitrox_device *ndev) in nitrox_sriov_init() argument
138 ret = nitrox_sriov_register_interupts(ndev); in nitrox_sriov_init()
142 ret = nitrox_mbox_init(ndev); in nitrox_sriov_init()
149 nitrox_sriov_cleanup(ndev); in nitrox_sriov_init()
155 struct nitrox_device *ndev = pci_get_drvdata(pdev); in nitrox_sriov_enable() local
159 dev_err(DEV(ndev), "Invalid num_vfs %d\n", num_vfs); in nitrox_sriov_enable()
168 dev_err(DEV(ndev), "failed to enable PCI sriov %d\n", err); in nitrox_sriov_enable()
171 dev_info(DEV(ndev), "Enabled VF(s) %d\n", num_vfs); in nitrox_sriov_enable()
173 ndev->mode = num_vfs_to_mode(num_vfs); in nitrox_sriov_enable()
174 ndev->iov.num_vfs = num_vfs; in nitrox_sriov_enable()
175 ndev->iov.max_vf_queues = vf_mode_to_nr_queues(ndev->mode); in nitrox_sriov_enable()
177 set_bit(__NDEV_SRIOV_BIT, &ndev->flags); in nitrox_sriov_enable()
180 nitrox_pf_cleanup(ndev); in nitrox_sriov_enable()
183 err = nitrox_sriov_init(ndev); in nitrox_sriov_enable()
187 config_nps_core_vfcfg_mode(ndev, ndev->mode); in nitrox_sriov_enable()
193 clear_bit(__NDEV_SRIOV_BIT, &ndev->flags); in nitrox_sriov_enable()
194 ndev->iov.num_vfs = 0; in nitrox_sriov_enable()
195 ndev->mode = __NDEV_MODE_PF; in nitrox_sriov_enable()
197 nitrox_pf_reinit(ndev); in nitrox_sriov_enable()
203 struct nitrox_device *ndev = pci_get_drvdata(pdev); in nitrox_sriov_disable() local
205 if (!test_bit(__NDEV_SRIOV_BIT, &ndev->flags)) in nitrox_sriov_disable()
209 dev_warn(DEV(ndev), "VFs are attached to VM. Can't disable SR-IOV\n"); in nitrox_sriov_disable()
214 clear_bit(__NDEV_SRIOV_BIT, &ndev->flags); in nitrox_sriov_disable()
216 ndev->iov.num_vfs = 0; in nitrox_sriov_disable()
217 ndev->iov.max_vf_queues = 0; in nitrox_sriov_disable()
218 ndev->mode = __NDEV_MODE_PF; in nitrox_sriov_disable()
221 nitrox_sriov_cleanup(ndev); in nitrox_sriov_disable()
223 config_nps_core_vfcfg_mode(ndev, ndev->mode); in nitrox_sriov_disable()
225 return nitrox_pf_reinit(ndev); in nitrox_sriov_disable()