Lines Matching full:ndev
42 static void clear_nps_core_err_intr(struct nitrox_device *ndev) in clear_nps_core_err_intr() argument
47 value = nitrox_read_csr(ndev, NPS_CORE_INT); in clear_nps_core_err_intr()
48 nitrox_write_csr(ndev, NPS_CORE_INT, value); in clear_nps_core_err_intr()
50 dev_err_ratelimited(DEV(ndev), "NSP_CORE_INT 0x%016llx\n", value); in clear_nps_core_err_intr()
53 static void clear_nps_pkt_err_intr(struct nitrox_device *ndev) in clear_nps_pkt_err_intr() argument
59 pkt_int.value = nitrox_read_csr(ndev, NPS_PKT_INT); in clear_nps_pkt_err_intr()
60 dev_err_ratelimited(DEV(ndev), "NPS_PKT_INT 0x%016llx\n", in clear_nps_pkt_err_intr()
65 value = nitrox_read_csr(ndev, offset); in clear_nps_pkt_err_intr()
66 nitrox_write_csr(ndev, offset, value); in clear_nps_pkt_err_intr()
67 dev_err_ratelimited(DEV(ndev), in clear_nps_pkt_err_intr()
71 value = nitrox_read_csr(ndev, offset); in clear_nps_pkt_err_intr()
72 nitrox_write_csr(ndev, offset, value); in clear_nps_pkt_err_intr()
75 enable_pkt_solicit_port(ndev, i); in clear_nps_pkt_err_intr()
77 dev_err_ratelimited(DEV(ndev), in clear_nps_pkt_err_intr()
81 value = nitrox_read_csr(ndev, offset); in clear_nps_pkt_err_intr()
82 nitrox_write_csr(ndev, offset, value); in clear_nps_pkt_err_intr()
83 dev_err_ratelimited(DEV(ndev), in clear_nps_pkt_err_intr()
89 value = nitrox_read_csr(ndev, offset); in clear_nps_pkt_err_intr()
90 nitrox_write_csr(ndev, offset, value); in clear_nps_pkt_err_intr()
91 dev_err_ratelimited(DEV(ndev), in clear_nps_pkt_err_intr()
94 value = nitrox_read_csr(ndev, offset); in clear_nps_pkt_err_intr()
95 nitrox_write_csr(ndev, offset, value); in clear_nps_pkt_err_intr()
98 enable_pkt_input_ring(ndev, i); in clear_nps_pkt_err_intr()
100 dev_err_ratelimited(DEV(ndev), in clear_nps_pkt_err_intr()
104 value = nitrox_read_csr(ndev, offset); in clear_nps_pkt_err_intr()
105 nitrox_write_csr(ndev, offset, value); in clear_nps_pkt_err_intr()
106 dev_err_ratelimited(DEV(ndev), in clear_nps_pkt_err_intr()
111 static void clear_pom_err_intr(struct nitrox_device *ndev) in clear_pom_err_intr() argument
115 value = nitrox_read_csr(ndev, POM_INT); in clear_pom_err_intr()
116 nitrox_write_csr(ndev, POM_INT, value); in clear_pom_err_intr()
117 dev_err_ratelimited(DEV(ndev), "POM_INT 0x%016llx\n", value); in clear_pom_err_intr()
120 static void clear_pem_err_intr(struct nitrox_device *ndev) in clear_pem_err_intr() argument
124 value = nitrox_read_csr(ndev, PEM0_INT); in clear_pem_err_intr()
125 nitrox_write_csr(ndev, PEM0_INT, value); in clear_pem_err_intr()
126 dev_err_ratelimited(DEV(ndev), "PEM(0)_INT 0x%016llx\n", value); in clear_pem_err_intr()
129 static void clear_lbc_err_intr(struct nitrox_device *ndev) in clear_lbc_err_intr() argument
135 lbc_int.value = nitrox_read_csr(ndev, LBC_INT); in clear_lbc_err_intr()
136 dev_err_ratelimited(DEV(ndev), "LBC_INT 0x%016llx\n", lbc_int.value); in clear_lbc_err_intr()
141 value = nitrox_read_csr(ndev, offset); in clear_lbc_err_intr()
142 nitrox_write_csr(ndev, offset, value); in clear_lbc_err_intr()
144 value = nitrox_read_csr(ndev, offset); in clear_lbc_err_intr()
145 nitrox_write_csr(ndev, offset, value); in clear_lbc_err_intr()
150 dev_err_ratelimited(DEV(ndev), "CAM_SOFT_ERR, invalidating LBC\n"); in clear_lbc_err_intr()
151 invalidate_lbc(ndev); in clear_lbc_err_intr()
156 value = nitrox_read_csr(ndev, offset); in clear_lbc_err_intr()
157 nitrox_write_csr(ndev, offset, value); in clear_lbc_err_intr()
159 value = nitrox_read_csr(ndev, offset); in clear_lbc_err_intr()
160 nitrox_write_csr(ndev, offset, value); in clear_lbc_err_intr()
165 value = nitrox_read_csr(ndev, offset); in clear_lbc_err_intr()
166 nitrox_write_csr(ndev, offset, value); in clear_lbc_err_intr()
168 value = nitrox_read_csr(ndev, offset); in clear_lbc_err_intr()
169 nitrox_write_csr(ndev, offset, value); in clear_lbc_err_intr()
171 nitrox_write_csr(ndev, LBC_INT, lbc_int.value); in clear_lbc_err_intr()
174 static void clear_efl_err_intr(struct nitrox_device *ndev) in clear_efl_err_intr() argument
183 core_int.value = nitrox_read_csr(ndev, offset); in clear_efl_err_intr()
184 nitrox_write_csr(ndev, offset, core_int.value); in clear_efl_err_intr()
185 dev_err_ratelimited(DEV(ndev), "ELF_CORE(%d)_INT 0x%016llx\n", in clear_efl_err_intr()
189 value = nitrox_read_csr(ndev, offset); in clear_efl_err_intr()
190 nitrox_write_csr(ndev, offset, value); in clear_efl_err_intr()
195 static void clear_bmi_err_intr(struct nitrox_device *ndev) in clear_bmi_err_intr() argument
199 value = nitrox_read_csr(ndev, BMI_INT); in clear_bmi_err_intr()
200 nitrox_write_csr(ndev, BMI_INT, value); in clear_bmi_err_intr()
201 dev_err_ratelimited(DEV(ndev), "BMI_INT 0x%016llx\n", value); in clear_bmi_err_intr()
207 struct nitrox_device *ndev = qvec->ndev; in nps_core_int_tasklet() local
210 if (ndev->mode == __NDEV_MODE_PF) { in nps_core_int_tasklet()
226 struct nitrox_device *ndev = qvec->ndev; in nps_core_int_isr() local
229 core_int.value = nitrox_read_csr(ndev, NPS_CORE_INT_ACTIVE); in nps_core_int_isr()
232 clear_nps_core_err_intr(ndev); in nps_core_int_isr()
235 clear_nps_pkt_err_intr(ndev); in nps_core_int_isr()
238 clear_pom_err_intr(ndev); in nps_core_int_isr()
241 clear_pem_err_intr(ndev); in nps_core_int_isr()
244 clear_lbc_err_intr(ndev); in nps_core_int_isr()
247 clear_efl_err_intr(ndev); in nps_core_int_isr()
250 clear_bmi_err_intr(ndev); in nps_core_int_isr()
254 nitrox_pf2vf_mbox_handler(ndev); in nps_core_int_isr()
258 nitrox_write_csr(ndev, NPS_CORE_INT_ACTIVE, core_int.value); in nps_core_int_isr()
263 void nitrox_unregister_interrupts(struct nitrox_device *ndev) in nitrox_unregister_interrupts() argument
265 struct pci_dev *pdev = ndev->pdev; in nitrox_unregister_interrupts()
268 for (i = 0; i < ndev->num_vecs; i++) { in nitrox_unregister_interrupts()
272 qvec = ndev->qvec + i; in nitrox_unregister_interrupts()
285 kfree(ndev->qvec); in nitrox_unregister_interrupts()
286 ndev->qvec = NULL; in nitrox_unregister_interrupts()
290 int nitrox_register_interrupts(struct nitrox_device *ndev) in nitrox_register_interrupts() argument
292 struct pci_dev *pdev = ndev->pdev; in nitrox_register_interrupts()
311 dev_err(DEV(ndev), "Error in getting vec count %d\n", nr_vecs); in nitrox_register_interrupts()
318 dev_err(DEV(ndev), "msix vectors %d alloc failed\n", nr_vecs); in nitrox_register_interrupts()
321 ndev->num_vecs = nr_vecs; in nitrox_register_interrupts()
323 ndev->qvec = kcalloc(nr_vecs, sizeof(*qvec), GFP_KERNEL); in nitrox_register_interrupts()
324 if (!ndev->qvec) { in nitrox_register_interrupts()
331 qvec = &ndev->qvec[i]; in nitrox_register_interrupts()
334 if (qvec->ring >= ndev->nr_queues) in nitrox_register_interrupts()
337 qvec->cmdq = &ndev->pkt_inq[qvec->ring]; in nitrox_register_interrupts()
343 dev_err(DEV(ndev), "irq failed for pkt ring/port%d\n", in nitrox_register_interrupts()
357 qvec = &ndev->qvec[i]; in nitrox_register_interrupts()
358 qvec->ndev = ndev; in nitrox_register_interrupts()
365 dev_err(DEV(ndev), "irq failed for nitrox-core-int%d\n", i); in nitrox_register_interrupts()
378 nitrox_unregister_interrupts(ndev); in nitrox_register_interrupts()
382 void nitrox_sriov_unregister_interrupts(struct nitrox_device *ndev) in nitrox_sriov_unregister_interrupts() argument
384 struct pci_dev *pdev = ndev->pdev; in nitrox_sriov_unregister_interrupts()
387 for (i = 0; i < ndev->num_vecs; i++) { in nitrox_sriov_unregister_interrupts()
391 qvec = ndev->qvec + i; in nitrox_sriov_unregister_interrupts()
395 vec = ndev->iov.msix.vector; in nitrox_sriov_unregister_interrupts()
403 kfree(ndev->qvec); in nitrox_sriov_unregister_interrupts()
404 ndev->qvec = NULL; in nitrox_sriov_unregister_interrupts()
408 int nitrox_sriov_register_interupts(struct nitrox_device *ndev) in nitrox_sriov_register_interupts() argument
410 struct pci_dev *pdev = ndev->pdev; in nitrox_sriov_register_interupts()
419 ndev->iov.msix.entry = NON_RING_MSIX_BASE; in nitrox_sriov_register_interupts()
420 ret = pci_enable_msix_exact(pdev, &ndev->iov.msix, NR_NON_RING_VECTORS); in nitrox_sriov_register_interupts()
422 dev_err(DEV(ndev), "failed to allocate nps-core-int%d\n", in nitrox_sriov_register_interupts()
432 qvec->ndev = ndev; in nitrox_sriov_register_interupts()
434 ndev->qvec = qvec; in nitrox_sriov_register_interupts()
435 ndev->num_vecs = NR_NON_RING_VECTORS; in nitrox_sriov_register_interupts()
439 vec = ndev->iov.msix.vector; in nitrox_sriov_register_interupts()
442 dev_err(DEV(ndev), "irq failed for nitrox-core-int%d\n", in nitrox_sriov_register_interupts()
456 nitrox_sriov_unregister_interrupts(ndev); in nitrox_sriov_register_interupts()