Lines Matching refs:pUM

76 static void BnxeFindDmaHandles(um_device_t * pUM)  in BnxeFindDmaHandles()  argument
82 BNXE_LOCK_ENTER_MEM(pUM); in BnxeFindDmaHandles()
86 LM_FOREACH_SB_ID(&pUM->lm_dev, idx) in BnxeFindDmaHandles()
88 if (CHIP_IS_E1x(&pUM->lm_dev)) in BnxeFindDmaHandles()
91pUM->lm_dev.vars.status_blocks_arr[idx].hc_status_block_data.e1x_sb_data.common.host_sb_addr.lo; in BnxeFindDmaHandles()
93pUM->lm_dev.vars.status_blocks_arr[idx].hc_status_block_data.e1x_sb_data.common.host_sb_addr.hi; in BnxeFindDmaHandles()
98pUM->lm_dev.vars.status_blocks_arr[idx].hc_status_block_data.e2_sb_data.common.host_sb_addr.lo; in BnxeFindDmaHandles()
100pUM->lm_dev.vars.status_blocks_arr[idx].hc_status_block_data.e2_sb_data.common.host_sb_addr.hi; in BnxeFindDmaHandles()
103 pTmp = (BnxeMemDma *)d_list_peek_head(&pUM->memDmaList); in BnxeFindDmaHandles()
116 BnxeLogWarn(pUM, "Failed to find DMA handle for RSS status block %d", idx); in BnxeFindDmaHandles()
119 pUM->statusBlocks[idx] = pTmp; in BnxeFindDmaHandles()
124 pTmp = (BnxeMemDma *)d_list_peek_head(&pUM->memDmaList); in BnxeFindDmaHandles()
128 pUM->lm_dev.vars.gen_sp_status_block.blk_phy_address.as_ptr) in BnxeFindDmaHandles()
138 BnxeLogWarn(pUM, "Failed to find DMA handle for default status block"); in BnxeFindDmaHandles()
141 pUM->statusBlocks[DEF_STATUS_BLOCK_IGU_INDEX] = pTmp; in BnxeFindDmaHandles()
143 BNXE_LOCK_EXIT_MEM(pUM); in BnxeFindDmaHandles()
147 void BnxeIntrIguSbEnable(um_device_t * pUM, in BnxeIntrIguSbEnable() argument
151 RxQueue * pRxQ = &pUM->rxq[idx]; in BnxeIntrIguSbEnable()
152 u32_t igu_id = (FCOE_CID(&pUM->lm_dev) == idx) ? in BnxeIntrIguSbEnable()
153 LM_NON_RSS_SB(&pUM->lm_dev) : idx; in BnxeIntrIguSbEnable()
155 BNXE_LOCK_ENTER_INTR_FLIP(pUM, igu_id); in BnxeIntrIguSbEnable()
166 lm_int_ack_sb_enable(&pUM->lm_dev, igu_id); in BnxeIntrIguSbEnable()
176 BnxeDevName(pUM), igu_id); in BnxeIntrIguSbEnable()
182 lm_int_ack_sb_enable(&pUM->lm_dev, igu_id); in BnxeIntrIguSbEnable()
185 BNXE_LOCK_EXIT_INTR_FLIP(pUM, igu_id); in BnxeIntrIguSbEnable()
189 void BnxeIntrIguSbDisable(um_device_t * pUM, in BnxeIntrIguSbDisable() argument
193 RxQueue * pRxQ = &pUM->rxq[idx]; in BnxeIntrIguSbDisable()
194 u32_t igu_id = (FCOE_CID(&pUM->lm_dev) == idx) ? in BnxeIntrIguSbDisable()
195 LM_NON_RSS_SB(&pUM->lm_dev) : idx; in BnxeIntrIguSbDisable()
197 BNXE_LOCK_ENTER_INTR_FLIP(pUM, igu_id); in BnxeIntrIguSbDisable()
203 lm_int_ack_sb_disable(&pUM->lm_dev, igu_id); in BnxeIntrIguSbDisable()
212 BnxeDevName(pUM), igu_id); in BnxeIntrIguSbDisable()
222 lm_int_ack_sb_disable(&pUM->lm_dev, igu_id); in BnxeIntrIguSbDisable()
228 BNXE_LOCK_EXIT_INTR_FLIP(pUM, igu_id); in BnxeIntrIguSbDisable()
232 static void BnxeServiceDefSbIntr(um_device_t * pUM, in BnxeServiceDefSbIntr() argument
236 lm_device_t * pLM = (lm_device_t *)pUM; in BnxeServiceDefSbIntr()
246 BnxeLogDbg(pUM, "Default INTR: Handling default status block %d", DEF_STATUS_BLOCK_INDEX); in BnxeServiceDefSbIntr()
248 ddi_dma_sync(pUM->statusBlocks[DEF_STATUS_BLOCK_IGU_INDEX]->dmaHandle, in BnxeServiceDefSbIntr()
251 if (pUM->fmCapabilities && in BnxeServiceDefSbIntr()
252 BnxeCheckDmaHandle(pUM->statusBlocks[DEF_STATUS_BLOCK_IGU_INDEX]->dmaHandle) != DDI_FM_OK) in BnxeServiceDefSbIntr()
254 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeServiceDefSbIntr()
257 pUM->intrSbCnt[DEF_STATUS_BLOCK_IGU_INDEX]++; in BnxeServiceDefSbIntr()
261 BnxeLogDbg(pUM, "Default INTR: No change in default status index so bail!"); in BnxeServiceDefSbIntr()
262 pUM->intrSbNoChangeCnt[DEF_STATUS_BLOCK_IGU_INDEX]++; in BnxeServiceDefSbIntr()
264 if (pUM->fmCapabilities && in BnxeServiceDefSbIntr()
267 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeServiceDefSbIntr()
276 BnxeDbgBreakIfFastPath(pUM, !(activity_flg & LM_DEF_EVENT_MASK)); in BnxeServiceDefSbIntr()
278 BnxeLogDbg(pUM, "Default INTR: processing events on sb: %x, events: 0x%x", in BnxeServiceDefSbIntr()
299 BnxeLogDbg(pUM, "Default INTR: asserted_proc_grps: 0x%x, deasserted_proc_grps:0x%x", in BnxeServiceDefSbIntr()
306 if (pUM->fmCapabilities && in BnxeServiceDefSbIntr()
309 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeServiceDefSbIntr()
322 if (pUM->fmCapabilities && in BnxeServiceDefSbIntr()
325 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeServiceDefSbIntr()
336 BnxeDbgBreakMsg(pUM, "Unknown iSCSI Rx completion!"); in BnxeServiceDefSbIntr()
361 BnxeDbgBreakMsg(pUM, "Unknown iSCSI Tx completion!"); in BnxeServiceDefSbIntr()
378 void BnxePollRxRing(um_device_t * pUM, in BnxePollRxRing() argument
383 lm_device_t * pLM = (lm_device_t *)pUM; in BnxePollRxRing()
390 BnxeLogDbg(pUM, "Ring Poll: Handling status block sb_id:%d drv_rss_id:%d", in BnxePollRxRing()
394 ddi_dma_sync(pUM->statusBlocks[drv_rss_id]->dmaHandle, in BnxePollRxRing()
397 if (pUM->fmCapabilities && in BnxePollRxRing()
398 BnxeCheckDmaHandle(pUM->statusBlocks[drv_rss_id]->dmaHandle) != DDI_FM_OK) in BnxePollRxRing()
400 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxePollRxRing()
403 pUM->intrSbPollCnt[drv_rss_id]++; in BnxePollRxRing()
407 BnxeLogDbg(pUM, "Ring Poll: No change in status index so bail!"); in BnxePollRxRing()
408 pUM->intrSbPollNoChangeCnt[drv_rss_id]++; in BnxePollRxRing()
415 BnxeDbgBreakIf(pUM, !(activity_flg & LM_NON_DEF_EVENT_MASK)); in BnxePollRxRing()
417 BnxeLogDbg(pUM, "Ring Poll: processing events on sb: %x, events: 0x%x", in BnxePollRxRing()
451 void BnxePollRxRingFCOE(um_device_t * pUM) in BnxePollRxRingFCOE() argument
453 lm_device_t * pLM = (lm_device_t *)pUM; in BnxePollRxRingFCOE()
459 BnxeLogDbg(pUM, "Ring Poll FCoE: Handling status block sb_id:%d drv_rss_id:%d", in BnxePollRxRingFCOE()
463 ddi_dma_sync(pUM->statusBlocks[sb_id]->dmaHandle, in BnxePollRxRingFCOE()
466 if (pUM->fmCapabilities && in BnxePollRxRingFCOE()
467 BnxeCheckDmaHandle(pUM->statusBlocks[sb_id]->dmaHandle) != DDI_FM_OK) in BnxePollRxRingFCOE()
469 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxePollRxRingFCOE()
472 pUM->intrSbPollCnt[sb_id]++; in BnxePollRxRingFCOE()
476 BnxeLogDbg(pUM, "Ring Poll FCoE: No change in status index so bail!"); in BnxePollRxRingFCOE()
477 pUM->intrSbPollNoChangeCnt[sb_id]++; in BnxePollRxRingFCOE()
484 BnxeDbgBreakIf(pUM, !(activity_flg & LM_NON_DEF_EVENT_MASK)); in BnxePollRxRingFCOE()
486 BnxeLogDbg(pUM, "Ring Poll FCoE: processing events on sb: %x, events: 0x%x", in BnxePollRxRingFCOE()
499 static void BnxeServiceSbIntr(um_device_t * pUM, in BnxeServiceSbIntr() argument
504 lm_device_t * pLM = (lm_device_t *)pUM; in BnxeServiceSbIntr()
513 BnxeLogDbg(pUM, "Ring INTR: Handling status block sb_id:%d drv_rss_id:%d", in BnxeServiceSbIntr()
517 ddi_dma_sync(pUM->statusBlocks[sb_id]->dmaHandle, in BnxeServiceSbIntr()
520 if (pUM->fmCapabilities && in BnxeServiceSbIntr()
521 BnxeCheckDmaHandle(pUM->statusBlocks[sb_id]->dmaHandle) != DDI_FM_OK) in BnxeServiceSbIntr()
523 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeServiceSbIntr()
526 pUM->intrSbCnt[sb_id]++; in BnxeServiceSbIntr()
530 BnxeLogDbg(pUM, "Ring INTR: No change in status index so bail!"); in BnxeServiceSbIntr()
531 pUM->intrSbNoChangeCnt[sb_id]++; in BnxeServiceSbIntr()
541 BnxeDbgBreakIf(pUM, !(activity_flg & LM_NON_DEF_EVENT_MASK)); in BnxeServiceSbIntr()
543 BnxeLogDbg(pUM, "Ring INTR: processing events on sb: %x, events: 0x%x", in BnxeServiceSbIntr()
575 BnxeDbgBreakMsg(pUM, "Unknown TOE Tx completion!"); in BnxeServiceSbIntr()
581 BnxeDbgBreakMsg(pUM, "Unknown iSCSI EQ completion!"); in BnxeServiceSbIntr()
590 um_device_t * pUM = (um_device_t *)arg1; in BnxeIntrISR() local
591 lm_device_t * pLM = &pUM->lm_dev; in BnxeIntrISR()
598 BNXE_LOCK_ENTER_INTR(pUM, idx); in BnxeIntrISR()
600 if (!pUM->intrEnabled) in BnxeIntrISR()
604 BNXE_LOCK_EXIT_INTR(pUM, idx); in BnxeIntrISR()
608 BnxeLogDbg(pUM, "-> BNXE INTA Interrupt <-"); in BnxeIntrISR()
614 if (pUM->fmCapabilities && in BnxeIntrISR()
617 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeIntrISR()
624 BNXE_LOCK_EXIT_INTR(pUM, idx); in BnxeIntrISR()
631 BnxeLogDbg(pUM, "INTA INTR: we got an interrupt when disabled"); in BnxeIntrISR()
633 BNXE_LOCK_EXIT_INTR(pUM, idx); in BnxeIntrISR()
637 atomic_add_64((volatile uint64_t *)&pUM->intrFired, 1); in BnxeIntrISR()
647 BnxeServiceDefSbIntr(pUM, &pktsRxed, &pktsTxed); in BnxeIntrISR()
655 if (pktsTxed) BnxeTxRingProcess(pUM, FCOE_CID(pLM)); in BnxeIntrISR()
656 if (pktsRxed) BnxeRxRingProcess(pUM, FCOE_CID(pLM), B_FALSE, 0); in BnxeIntrISR()
671 BnxeServiceSbIntr(pUM, (rss_id - 1), &pktsRxed, &pktsTxed); in BnxeIntrISR()
673 if (pktsTxed) BnxeTxRingProcess(pUM, (rss_id - 1)); in BnxeIntrISR()
674 if (pktsRxed) BnxeRxRingProcess(pUM, (rss_id - 1), B_FALSE, 0); in BnxeIntrISR()
686 BNXE_LOCK_EXIT_INTR(pUM, idx); in BnxeIntrISR()
694 um_device_t * pUM = (um_device_t *)arg1; in BnxeIntrMISR() local
695 lm_device_t * pLM = &pUM->lm_dev; in BnxeIntrMISR()
701 BNXE_LOCK_ENTER_INTR(pUM, sb_id); in BnxeIntrMISR()
703 if (!pUM->intrEnabled) in BnxeIntrMISR()
707 BNXE_LOCK_EXIT_INTR(pUM, sb_id); in BnxeIntrMISR()
711 BnxeLogDbg(pUM, "-> BNXE MSIX Interrupt SB %d <-", sb_id); in BnxeIntrMISR()
716 BnxeLogDbg(pUM, "MISR INTR: we got an interrupt when disabled"); in BnxeIntrMISR()
718 BNXE_LOCK_EXIT_INTR(pUM, sb_id); in BnxeIntrMISR()
722 atomic_add_64((volatile uint64_t *)&pUM->intrFired, 1); in BnxeIntrMISR()
728 BnxeServiceDefSbIntr(pUM, &pktsRxed, &pktsTxed); in BnxeIntrMISR()
736 if (pktsTxed) BnxeTxRingProcess(pUM, FCOE_CID(pLM)); in BnxeIntrMISR()
737 if (pktsRxed) BnxeRxRingProcess(pUM, FCOE_CID(pLM), FALSE, 0); in BnxeIntrMISR()
754 CLIENT_BOUND(pUM, LM_CLI_IDX_FCOE) && in BnxeIntrMISR()
755 (pUM->rssIntr.intrCount == LM_MAX_RSS_CHAINS(&pUM->lm_dev))) ? in BnxeIntrMISR()
758 if (pUM->rxq[idx].inPollMode) in BnxeIntrMISR()
763 BnxeDevName(pUM), idx); in BnxeIntrMISR()
767 BnxeIntrIguSbDisable(pUM, idx, B_TRUE); in BnxeIntrMISR()
769 BnxeServiceSbIntr(pUM, sb_id, &pktsRxed, &pktsTxed); in BnxeIntrMISR()
771 if (pktsTxed) BnxeTxRingProcess(pUM, sb_id); in BnxeIntrMISR()
772 if (pktsRxed) BnxeRxRingProcess(pUM, sb_id, B_FALSE, 0); in BnxeIntrMISR()
777 BnxeIntrIguSbEnable(pUM, idx, B_TRUE); in BnxeIntrMISR()
780 BNXE_LOCK_EXIT_INTR(pUM, sb_id); in BnxeIntrMISR()
800 static boolean_t BnxeIntrBlockAlloc(um_device_t * pUM, in BnxeIntrBlockAlloc() argument
806 dev_info_t * pDev = pUM->pDev; in BnxeIntrBlockAlloc()
811 if ((pUM->intrType == DDI_INTR_TYPE_FIXED) && (intrCnt != 1)) in BnxeIntrBlockAlloc()
834 BnxeLogWarn(pUM, "Memory alloc failed for isr handle block (inum=%d)!", in BnxeIntrBlockAlloc()
841 pUM->intrType, in BnxeIntrBlockAlloc()
847 BnxeLogWarn(pUM, "Failed to allocate isr handle block (%d) (inum=%d cnt=%d)!", in BnxeIntrBlockAlloc()
888 BnxeLogWarn(pUM, "Failed to allocate desired isr count (%d/%d)!", in BnxeIntrBlockAlloc()
913 BnxeLogWarn(pUM, "Failed to get isr capability (%d)!", rc); in BnxeIntrBlockAlloc()
920 BnxeLogWarn(pUM, "Failed to get isr priority (%d)!", rc); in BnxeIntrBlockAlloc()
926 BnxeLogWarn(pUM, "Interrupt priority is too high!"); in BnxeIntrBlockAlloc()
947 static void BnxeIntrBlockFree(um_device_t * pUM, in BnxeIntrBlockFree() argument
970 static boolean_t BnxeIntrAddHandlers(um_device_t * pUM) in BnxeIntrAddHandlers() argument
974 switch (pUM->intrType) in BnxeIntrAddHandlers()
979 pUM->defIntr.pIntrHandleBlock[0], in BnxeIntrAddHandlers()
981 (caddr_t)pUM, in BnxeIntrAddHandlers()
985 BnxeLogWarn(pUM, "Failed to add the MSIX default isr handler (%d)", rc); in BnxeIntrAddHandlers()
989 for (i = 0; i < pUM->rssIntr.intrCount; i++) in BnxeIntrAddHandlers()
992 pUM->rssIntr.pIntrHandleBlock[i], in BnxeIntrAddHandlers()
994 (caddr_t)pUM, in BnxeIntrAddHandlers()
998 BnxeLogWarn(pUM, "Failed to add the MSIX RSS isr handler %d (%d)", in BnxeIntrAddHandlers()
999 (i + NDIS_CID(&pUM->lm_dev)), rc); in BnxeIntrAddHandlers()
1001 ddi_intr_remove_handler(pUM->defIntr.pIntrHandleBlock[0]); in BnxeIntrAddHandlers()
1005 ddi_intr_remove_handler(pUM->rssIntr.pIntrHandleBlock[j]); in BnxeIntrAddHandlers()
1017 if (pUM->fcoeIntr.intrCount == 1) in BnxeIntrAddHandlers()
1020 pUM->fcoeIntr.pIntrHandleBlock[0], in BnxeIntrAddHandlers()
1022 (caddr_t)pUM, in BnxeIntrAddHandlers()
1023 (caddr_t)(uintptr_t)LM_NON_RSS_SB(&pUM->lm_dev))) != in BnxeIntrAddHandlers()
1026 BnxeLogWarn(pUM, "Failed to add the MSIX FCoE isr handler (%d)", rc); in BnxeIntrAddHandlers()
1028 ddi_intr_remove_handler(pUM->defIntr.pIntrHandleBlock[0]); in BnxeIntrAddHandlers()
1030 for (i = 0; i < pUM->rssIntr.intrCount; i++) in BnxeIntrAddHandlers()
1032 ddi_intr_remove_handler(pUM->rssIntr.pIntrHandleBlock[i]); in BnxeIntrAddHandlers()
1044 pUM->defIntr.pIntrHandleBlock[0], in BnxeIntrAddHandlers()
1046 (caddr_t)pUM, in BnxeIntrAddHandlers()
1050 BnxeLogWarn(pUM, "Failed to add the fixed default isr handler (%d)", rc); in BnxeIntrAddHandlers()
1058 BnxeLogWarn(pUM, "Failed to add isr handler (unsupported type %d)!", in BnxeIntrAddHandlers()
1059 pUM->intrType); in BnxeIntrAddHandlers()
1067 static void BnxeIntrBlockRemoveHandler(um_device_t * pUM, in BnxeIntrBlockRemoveHandler() argument
1072 (void)pUM; in BnxeIntrBlockRemoveHandler()
1086 static boolean_t BnxeIntrBlockEnable(um_device_t * pUM, in BnxeIntrBlockEnable() argument
1101 BnxeLogWarn(pUM, "Failed to enable isr block (%d)", rc); in BnxeIntrBlockEnable()
1112 BnxeLogWarn(pUM, "Failed to enable isr %d (%d)", i, rc); in BnxeIntrBlockEnable()
1128 static void BnxeIntrBlockDisable(um_device_t * pUM, in BnxeIntrBlockDisable() argument
1152 int BnxeIntrEnable(um_device_t * pUM) in BnxeIntrEnable() argument
1157 atomic_swap_64((volatile uint64_t *)&pUM->intrFired, 0); in BnxeIntrEnable()
1161 pUM->intrSbCnt[i] = 0; in BnxeIntrEnable()
1162 pUM->intrSbNoChangeCnt[i] = 0; in BnxeIntrEnable()
1166 BnxeFindDmaHandles(pUM); in BnxeIntrEnable()
1170 if (!BnxeIntrBlockEnable(pUM, &pUM->defIntr)) in BnxeIntrEnable()
1172 BnxeLogWarn(pUM, "Failed to enable the default interrupt"); in BnxeIntrEnable()
1178 if (!BnxeIntrBlockEnable(pUM, &pUM->fcoeIntr)) in BnxeIntrEnable()
1180 BnxeLogWarn(pUM, "Failed to enable the FCoE interrupt"); in BnxeIntrEnable()
1181 BnxeIntrBlockDisable(pUM, &pUM->defIntr); in BnxeIntrEnable()
1187 if (!BnxeIntrBlockEnable(pUM, &pUM->rssIntr)) in BnxeIntrEnable()
1189 BnxeLogWarn(pUM, "Failed to enable the RSS interrupt"); in BnxeIntrEnable()
1190 BnxeIntrBlockDisable(pUM, &pUM->defIntr); in BnxeIntrEnable()
1191 BnxeIntrBlockDisable(pUM, &pUM->fcoeIntr); in BnxeIntrEnable()
1196 atomic_swap_32(&pUM->intrEnabled, B_TRUE); in BnxeIntrEnable()
1197 lm_enable_int(&pUM->lm_dev); in BnxeIntrEnable()
1199 if (pUM->fmCapabilities && in BnxeIntrEnable()
1200 BnxeCheckAccHandle(pUM->lm_dev.vars.reg_handle[BAR_0]) != DDI_FM_OK) in BnxeIntrEnable()
1202 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeIntrEnable()
1212 void BnxeIntrDisable(um_device_t * pUM) in BnxeIntrDisable() argument
1217 lm_disable_int(&pUM->lm_dev); in BnxeIntrDisable()
1219 if (pUM->fmCapabilities && in BnxeIntrDisable()
1220 BnxeCheckAccHandle(pUM->lm_dev.vars.reg_handle[BAR_0]) != DDI_FM_OK) in BnxeIntrDisable()
1222 ddi_fm_service_impact(pUM->pDev, DDI_SERVICE_DEGRADED); in BnxeIntrDisable()
1225 atomic_swap_32(&pUM->intrEnabled, B_FALSE); in BnxeIntrDisable()
1235 BNXE_LOCK_ENTER_INTR(pUM, i); in BnxeIntrDisable()
1236 BNXE_LOCK_EXIT_INTR(pUM, i); in BnxeIntrDisable()
1241 BnxeIntrBlockDisable(pUM, &pUM->defIntr); in BnxeIntrDisable()
1245 BnxeIntrBlockDisable(pUM, &pUM->fcoeIntr); in BnxeIntrDisable()
1249 BnxeIntrBlockDisable(pUM, &pUM->rssIntr); in BnxeIntrDisable()
1253 boolean_t BnxeIntrInit(um_device_t * pUM) in BnxeIntrInit() argument
1261 pDev = pUM->pDev; in BnxeIntrInit()
1263 atomic_swap_32(&pUM->intrEnabled, B_FALSE); in BnxeIntrInit()
1267 BnxeLogWarn(pUM, "Failed to get supported interrupt types (%d)", rc); in BnxeIntrInit()
1277 BnxeLogWarn(pUM, "Fixed interrupt not supported!"); in BnxeIntrInit()
1281 memset(&pUM->defIntr, 0, sizeof(BnxeIntrBlock)); in BnxeIntrInit()
1282 memset(&pUM->rssIntr, 0, sizeof(BnxeIntrBlock)); in BnxeIntrInit()
1283 memset(&pUM->fcoeIntr, 0, sizeof(BnxeIntrBlock)); in BnxeIntrInit()
1285 if (pUM->devParams.disableMsix) in BnxeIntrInit()
1287 BnxeLogInfo(pUM, "Forcing fixed level interrupts."); in BnxeIntrInit()
1288 pUM->lm_dev.params.interrupt_mode = LM_INT_MODE_INTA; in BnxeIntrInit()
1289 pUM->intrType = DDI_INTR_TYPE_FIXED; in BnxeIntrInit()
1293 pUM->lm_dev.params.interrupt_mode = LM_INT_MODE_MIMD; in BnxeIntrInit()
1294 pUM->intrType = DDI_INTR_TYPE_MSIX; in BnxeIntrInit()
1298 pUM->lm_dev.params.interrupt_mode = LM_INT_MODE_INTA; in BnxeIntrInit()
1299 pUM->intrType = DDI_INTR_TYPE_FIXED; in BnxeIntrInit()
1306 if (!BnxeIntrBlockAlloc(pUM, in BnxeIntrInit()
1309 &pUM->defIntr)) in BnxeIntrInit()
1311 BnxeLogWarn(pUM, "Failed to allocate default %s interrupt!", in BnxeIntrInit()
1312 BnxeIntrTypeName(pUM->intrType)); in BnxeIntrInit()
1318 if (pUM->intrType == DDI_INTR_TYPE_FIXED) in BnxeIntrInit()
1324 if (BnxeProtoFcoeAfex(pUM)) in BnxeIntrInit()
1326 pUM->devParams.numRings = 0; in BnxeIntrInit()
1332 while (pUM->devParams.numRings > 0) in BnxeIntrInit()
1334 if (!BnxeIntrBlockAlloc(pUM, in BnxeIntrInit()
1335 (NDIS_CID(&pUM->lm_dev) + 1), in BnxeIntrInit()
1336 pUM->devParams.numRings, in BnxeIntrInit()
1337 &pUM->rssIntr)) in BnxeIntrInit()
1339 BnxeLogWarn(pUM, "Failed to allocate %d RSS %s interrupts!", in BnxeIntrInit()
1340 pUM->devParams.numRings, in BnxeIntrInit()
1341 BnxeIntrTypeName(pUM->intrType)); in BnxeIntrInit()
1342 pUM->devParams.numRings >>= 1; in BnxeIntrInit()
1349 if (pUM->devParams.numRings == 0) in BnxeIntrInit()
1351 BnxeIntrBlockFree(pUM, &pUM->defIntr); in BnxeIntrInit()
1355 BnxeLogInfo(pUM, "Allocated %d RSS %s interrupts.", in BnxeIntrInit()
1356 pUM->rssIntr.intrCount, in BnxeIntrInit()
1357 BnxeIntrTypeName(pUM->intrType)); in BnxeIntrInit()
1359 intrTotalAlloc += pUM->rssIntr.intrCount; /* intrCount <= numRings */ in BnxeIntrInit()
1368 if (BNXE_FCOE(pUM)) in BnxeIntrInit()
1370 if (pUM->rssIntr.intrCount < LM_MAX_RSS_CHAINS(&pUM->lm_dev)) in BnxeIntrInit()
1372 if (!BnxeIntrBlockAlloc(pUM, in BnxeIntrInit()
1373 (LM_NON_RSS_SB(&pUM->lm_dev) + 1), in BnxeIntrInit()
1375 &pUM->fcoeIntr)) in BnxeIntrInit()
1377 BnxeLogWarn(pUM, "Failed to allocate FCoE %s interrupt!", in BnxeIntrInit()
1378 BnxeIntrTypeName(pUM->intrType)); in BnxeIntrInit()
1379 BnxeIntrBlockFree(pUM, &pUM->defIntr); in BnxeIntrInit()
1380 BnxeIntrBlockFree(pUM, &pUM->rssIntr); in BnxeIntrInit()
1389 memset(&pUM->fcoeIntr, 0, sizeof(BnxeIntrBlock)); in BnxeIntrInit()
1397 if (pUM->intrType == DDI_INTR_TYPE_FIXED) in BnxeIntrInit()
1404 pUM->lm_dev.params.interrupt_mode = LM_INT_MODE_INTA; in BnxeIntrInit()
1405 pUM->intrType = DDI_INTR_TYPE_FIXED; in BnxeIntrInit()
1408 if (pUM->intrType == DDI_INTR_TYPE_MSIX) in BnxeIntrInit()
1410 pUM->devParams.numRings = pUM->rssIntr.intrCount; in BnxeIntrInit()
1411 pUM->lm_dev.params.rss_chain_cnt = pUM->rssIntr.intrCount; in BnxeIntrInit()
1412 pUM->lm_dev.params.tss_chain_cnt = pUM->rssIntr.intrCount; in BnxeIntrInit()
1417 pUM->devParams.numRings = 0; in BnxeIntrInit()
1418 pUM->lm_dev.params.rss_chain_cnt = 1; in BnxeIntrInit()
1419 pUM->lm_dev.params.tss_chain_cnt = 1; in BnxeIntrInit()
1421 BnxeLogWarn(pUM, "Using Fixed Level Interrupts! (set ddi_msix_alloc_limit in /etc/system)"); in BnxeIntrInit()
1424 BnxeLogInfo(pUM, "Interrupts (Supported - %d Fixed / %d MSI / %d MSIX) (Allocated - %d %s)", in BnxeIntrInit()
1425 numFIX, numMSI, numMSIX, intrTotalAlloc, BnxeIntrTypeName(pUM->intrType)); in BnxeIntrInit()
1427 if (!BnxeIntrAddHandlers(pUM)) in BnxeIntrInit()
1429 BnxeLogWarn(pUM, "Failed to add interrupts!"); in BnxeIntrInit()
1430 BnxeIntrBlockFree(pUM, &pUM->defIntr); in BnxeIntrInit()
1431 BnxeIntrBlockFree(pUM, &pUM->fcoeIntr); in BnxeIntrInit()
1432 BnxeIntrBlockFree(pUM, &pUM->rssIntr); in BnxeIntrInit()
1437 pUM->intrPriority = pUM->defIntr.intrPriority; in BnxeIntrInit()
1443 void BnxeIntrFini(um_device_t * pUM) in BnxeIntrFini() argument
1447 BnxeIntrBlockDisable(pUM, &pUM->defIntr); in BnxeIntrFini()
1448 BnxeIntrBlockRemoveHandler(pUM, &pUM->defIntr); in BnxeIntrFini()
1449 BnxeIntrBlockFree(pUM, &pUM->defIntr); in BnxeIntrFini()
1451 BnxeIntrBlockDisable(pUM, &pUM->fcoeIntr); in BnxeIntrFini()
1452 BnxeIntrBlockRemoveHandler(pUM, &pUM->fcoeIntr); in BnxeIntrFini()
1453 BnxeIntrBlockFree(pUM, &pUM->fcoeIntr); in BnxeIntrFini()
1455 BnxeIntrBlockDisable(pUM, &pUM->rssIntr); in BnxeIntrFini()
1456 BnxeIntrBlockRemoveHandler(pUM, &pUM->rssIntr); in BnxeIntrFini()
1457 BnxeIntrBlockFree(pUM, &pUM->rssIntr); in BnxeIntrFini()