X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Fsrc%2Fhostif.c;h=e445d5f164ad008ef7c14e25ca08b1e17766650b;hb=bd3e83c8a4065c23c0f437b231e8d4c26f82e20a;hp=94c2d04f064cca3ce297843c6fa70dfd8a148c0f;hpb=990ce9efaea1c6e46372a6758988aff6e9d202e9;p=carl9170fw.git diff --git a/carlfw/src/hostif.c b/carlfw/src/hostif.c index 94c2d04..e445d5f 100644 --- a/carlfw/src/hostif.c +++ b/carlfw/src/hostif.c @@ -30,7 +30,7 @@ static bool length_check(struct dma_desc *desc) { - volatile struct carl9170_tx_superframe *super = DESC_PAYLOAD(desc); + volatile struct carl9170_tx_superframe *super = __get_super(desc); if (unlikely(desc->totalLen < sizeof(struct carl9170_tx_superdesc))) return false; @@ -59,7 +59,7 @@ static void handle_download(void) * is _SW ( handle_download_exception ) */ - for_each_desc_bits(desc, &fw.pta.down_queue, AR9170_OWN_BITS_SE) { + for_each_desc_not_bits(desc, &fw.pta.down_queue, AR9170_OWN_BITS_HW) { if (unlikely((length_check(desc) == false))) { /* * There is no easy way of telling what was lost. @@ -69,6 +69,7 @@ static void handle_download(void) * timeout mechanism. */ + wlan_tx_complete(__get_super(desc), false); dma_reclaim(&fw.pta.down_queue, desc); down_trigger(); } else { @@ -95,13 +96,8 @@ static void handle_upload(void) fw.usb.int_desc = desc; fw.usb.int_desc_available = 1; } else { -#ifdef CONFIG_CARL9170FW_LOOPBACK - dma_reclaim(&fw.pta.down_queue, desc); - down_trigger(); -#else dma_reclaim(&fw.wlan.rx_queue, desc); wlan_trigger(AR9170_DMA_TRIGGER_RXQ); -#endif /* CONFIG_CARL9170FW_LOOPBACK */ } } @@ -133,9 +129,8 @@ static void handle_download_exception(void) } __for_each_desc_continue(desc, &fw.pta.down_queue) { - if ((desc->status & AR9170_OWN_BITS) == AR9170_OWN_BITS_SW) { + if ((desc->status & AR9170_OWN_BITS) == AR9170_OWN_BITS_SW) dma_fix_downqueue(desc); - } }