X-Git-Url: https://jxself.org/git/?p=carl9170fw.git;a=blobdiff_plain;f=carlfw%2Fsrc%2Fwlan.c;h=d0adb5964dfcd999e1e8ac1d8a80ee5187234f1a;hp=3661871e342e908cc001405a1660b9793e9c01d0;hb=b96940e2ea6b783faea07da811ab4ad4c8de59cb;hpb=a4cf4c3aa345a046f8f4d3d1eb66edb590b62554 diff --git a/carlfw/src/wlan.c b/carlfw/src/wlan.c index 3661871..d0adb59 100644 --- a/carlfw/src/wlan.c +++ b/carlfw/src/wlan.c @@ -44,32 +44,6 @@ static void wlan_txupdate(unsigned int queue) wlan_trigger(BIT(queue)); } -static void wlan_dma_bump(unsigned int qidx) -{ - unsigned int offset = qidx; - uint32_t status, trigger; - - status = get(AR9170_MAC_REG_DMA_STATUS) >> 12; - trigger = get(AR9170_MAC_REG_DMA_TRIGGER) >> 12; - - while (offset != 0) { - status >>= 4; - trigger >>= 4; - offset--; - } - - status &= 0xf; - trigger &= 0xf; - - if ((trigger == 0xa) && (status == 0x8)) { - DBG("UNSTUCK"); - wlan_txunstuck(qidx); - } else { - DBG("UPDATE"); - wlan_txupdate(qidx); - } -} - #ifdef CONFIG_CARL9170FW_DEBUG static void wlan_dump_queue(unsigned int qidx) { @@ -858,6 +832,32 @@ void handle_wlan(void) #undef HANDLER } +static void wlan_dma_bump(unsigned int qidx) +{ + unsigned int offset = qidx; + uint32_t status, trigger; + + status = get(AR9170_MAC_REG_DMA_STATUS) >> 12; + trigger = get(AR9170_MAC_REG_DMA_TRIGGER) >> 12; + + while (offset != 0) { + status >>= 4; + trigger >>= 4; + offset--; + } + + status &= 0xf; + trigger &= 0xf; + + if ((trigger == 0xa) && (status == 0x8)) { + DBG("UNSTUCK"); + wlan_txunstuck(qidx); + } else { + DBG("UPDATE"); + wlan_txupdate(qidx); + } +} + static void wlan_check_hang(void) { struct dma_desc *desc;