Lines Matching refs:snic
37 struct snic *snic = data; in snic_isr_msix_wq() local
40 snic->s_stats.misc.last_isr_time = jiffies; in snic_isr_msix_wq()
41 atomic64_inc(&snic->s_stats.misc.ack_isr_cnt); in snic_isr_msix_wq()
43 wq_work_done = snic_wq_cmpl_handler(snic, -1); in snic_isr_msix_wq()
44 svnic_intr_return_credits(&snic->intr[SNIC_MSIX_WQ], in snic_isr_msix_wq()
55 struct snic *snic = data; in snic_isr_msix_io_cmpl() local
58 snic->s_stats.misc.last_isr_time = jiffies; in snic_isr_msix_io_cmpl()
59 atomic64_inc(&snic->s_stats.misc.cmpl_isr_cnt); in snic_isr_msix_io_cmpl()
61 iocmpl_work_done = snic_fwcq_cmpl_handler(snic, -1); in snic_isr_msix_io_cmpl()
62 svnic_intr_return_credits(&snic->intr[SNIC_MSIX_IO_CMPL], in snic_isr_msix_io_cmpl()
73 struct snic *snic = data; in snic_isr_msix_err_notify() local
75 snic->s_stats.misc.last_isr_time = jiffies; in snic_isr_msix_err_notify()
76 atomic64_inc(&snic->s_stats.misc.errnotify_isr_cnt); in snic_isr_msix_err_notify()
78 svnic_intr_return_all_credits(&snic->intr[SNIC_MSIX_ERR_NOTIFY]); in snic_isr_msix_err_notify()
79 snic_log_q_error(snic); in snic_isr_msix_err_notify()
82 snic_handle_link_event(snic); in snic_isr_msix_err_notify()
89 snic_free_intr(struct snic *snic) in snic_free_intr() argument
94 for (i = 0; i < ARRAY_SIZE(snic->msix); i++) { in snic_free_intr()
95 if (snic->msix[i].requested) { in snic_free_intr()
96 free_irq(pci_irq_vector(snic->pdev, i), in snic_free_intr()
97 snic->msix[i].devid); in snic_free_intr()
103 snic_request_intr(struct snic *snic) in snic_request_intr() argument
108 intr_mode = svnic_dev_get_intr_mode(snic->vdev); in snic_request_intr()
118 sprintf(snic->msix[SNIC_MSIX_WQ].devname, in snic_request_intr()
120 snic->name); in snic_request_intr()
121 snic->msix[SNIC_MSIX_WQ].isr = snic_isr_msix_wq; in snic_request_intr()
122 snic->msix[SNIC_MSIX_WQ].devid = snic; in snic_request_intr()
124 sprintf(snic->msix[SNIC_MSIX_IO_CMPL].devname, in snic_request_intr()
126 snic->name); in snic_request_intr()
127 snic->msix[SNIC_MSIX_IO_CMPL].isr = snic_isr_msix_io_cmpl; in snic_request_intr()
128 snic->msix[SNIC_MSIX_IO_CMPL].devid = snic; in snic_request_intr()
130 sprintf(snic->msix[SNIC_MSIX_ERR_NOTIFY].devname, in snic_request_intr()
132 snic->name); in snic_request_intr()
133 snic->msix[SNIC_MSIX_ERR_NOTIFY].isr = snic_isr_msix_err_notify; in snic_request_intr()
134 snic->msix[SNIC_MSIX_ERR_NOTIFY].devid = snic; in snic_request_intr()
136 for (i = 0; i < ARRAY_SIZE(snic->msix); i++) { in snic_request_intr()
137 ret = request_irq(pci_irq_vector(snic->pdev, i), in snic_request_intr()
138 snic->msix[i].isr, in snic_request_intr()
140 snic->msix[i].devname, in snic_request_intr()
141 snic->msix[i].devid); in snic_request_intr()
143 SNIC_HOST_ERR(snic->shost, in snic_request_intr()
147 snic_free_intr(snic); in snic_request_intr()
150 snic->msix[i].requested = 1; in snic_request_intr()
157 snic_set_intr_mode(struct snic *snic) in snic_set_intr_mode() argument
159 unsigned int n = ARRAY_SIZE(snic->wq); in snic_set_intr_mode()
167 BUILD_BUG_ON((ARRAY_SIZE(snic->wq) + SNIC_CQ_IO_CMPL_MAX) > in snic_set_intr_mode()
168 ARRAY_SIZE(snic->intr)); in snic_set_intr_mode()
170 if (snic->wq_count < n || snic->cq_count < n + m) in snic_set_intr_mode()
173 if (pci_alloc_irq_vectors(snic->pdev, vecs, vecs, PCI_IRQ_MSIX) < 0) in snic_set_intr_mode()
176 snic->wq_count = n; in snic_set_intr_mode()
177 snic->cq_count = n + m; in snic_set_intr_mode()
178 snic->intr_count = vecs; in snic_set_intr_mode()
179 snic->err_intr_offset = SNIC_MSIX_ERR_NOTIFY; in snic_set_intr_mode()
181 SNIC_ISR_DBG(snic->shost, "Using MSI-X Interrupts\n"); in snic_set_intr_mode()
182 svnic_dev_set_intr_mode(snic->vdev, VNIC_DEV_INTR_MODE_MSIX); in snic_set_intr_mode()
185 svnic_dev_set_intr_mode(snic->vdev, VNIC_DEV_INTR_MODE_UNKNOWN); in snic_set_intr_mode()
190 snic_clear_intr_mode(struct snic *snic) in snic_clear_intr_mode() argument
192 pci_free_irq_vectors(snic->pdev); in snic_clear_intr_mode()
193 svnic_dev_set_intr_mode(snic->vdev, VNIC_DEV_INTR_MODE_INTX); in snic_clear_intr_mode()