static void rtmp_tx_done_tasklet(unsigned long data) { UINT32 irqsave; UINT32 irqMask; PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) data; /* device had been closed */ if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_REMOVE_IN_PROGRESS)) { return; } RTMPHandleMgmtRingDmaDoneInterrupt(pAdapter); RTMPHandleTxDoneInterrupt(pAdapter); RTMP_IRQ_LOCK(irqsave); /* * double check to avoid rotting packet */ if (pAdapter->Rtmp_Masked_Int & RTMP_MASK_INT_TX_DONE) { pAdapter->Rtmp_Masked_Int &= ~RTMP_MASK_INT_TX_DONE; tasklet_hi_schedule(&pAdapter->tx_done_task); } else { /* enable tx interrupt */ RTMP_IO_READ32(pAdapter, INT_MASK_CSR, &irqMask); RTMP_IO_WRITE32(pAdapter, INT_MASK_CSR, irqMask & ~RTMP_MASK_INT_TX_DONE); pAdapter->tx_done_running = FALSE; } RTMP_IRQ_UNLOCK(irqsave); }
/*************************************************************************** * * tasklet related procedures. * **************************************************************************/ static void mgmt_dma_done_tasklet(unsigned long data) { unsigned long flags; struct rt_rtmp_adapter *pAd = (struct rt_rtmp_adapter *)data; INT_SOURCE_CSR_STRUC IntSource; struct os_cookie *pObj; /* Do nothing if the driver is starting halt state. */ /* This might happen when timer already been fired before cancel timer with mlmehalt */ if (RTMP_TEST_FLAG (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; pObj = (struct os_cookie *)pAd->OS_Cookie; /* printk("mgmt_dma_done_process\n"); */ IntSource.word = 0; IntSource.field.MgmtDmaDone = 1; pAd->int_pending &= ~INT_MGMT_DLY; RTMPHandleMgmtRingDmaDoneInterrupt(pAd); /* if you use RTMP_SEM_LOCK, sometimes kernel will hang up, without any */ /* bug report output */ RTMP_INT_LOCK(&pAd->irq_lock, flags); /* * double check to avoid lose of interrupts */ if (pAd->int_pending & INT_MGMT_DLY) { tasklet_hi_schedule(&pObj->mgmt_dma_done_task); RTMP_INT_UNLOCK(&pAd->irq_lock, flags); return; } /* enable TxDataInt again */ rt2860_int_enable(pAd, INT_MGMT_DLY); RTMP_INT_UNLOCK(&pAd->irq_lock, flags); }