X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Fsrc%2Fwlan.c;h=cb2dc75c0ef43805b86989ec3a9798cbaee764fe;hb=bd3e83c8a4065c23c0f437b231e8d4c26f82e20a;hp=69d90e628d97062ac968aaadc025e8d4617ed3d8;hpb=5afdefe0d025f110bb270d8a2ad4e1773fbd70b9;p=carl9170fw.git diff --git a/carlfw/src/wlan.c b/carlfw/src/wlan.c index 69d90e6..cb2dc75 100644 --- a/carlfw/src/wlan.c +++ b/carlfw/src/wlan.c @@ -292,25 +292,12 @@ static void __wlan_tx(struct dma_desc *desc) wlan_tx_ampdu(super); -#if (defined CONFIG_CARL9170FW_LOOPBACK) || (defined CONFIG_CARL9170FW_DISCARD) - wlan_tx_complete(super, true); - unhide_super(desc); -# ifdef CONFIG_CARL9170FW_LOOPBACK - dma_put(&fw.pta.up_queue, desc); - up_trigger(); -# elif CONFIG_CARL9170FW_DISCARD - dma_reclaim(&fw.pta.down_queue, desc); - down_trigger(); -# endif -#else /* CONFIG_CARL9170FW_LOOPBACK */ - -# ifdef CONFIG_CARL9170FW_DEBUG +#ifdef CONFIG_CARL9170FW_DEBUG BUG_ON(fw.phy.psm.state != CARL9170_PSM_WAKE); -# endif /* CONFIG_CARL9170FW_DEBUG */ +#endif /* CONFIG_CARL9170FW_DEBUG */ /* insert desc into the right queue */ dma_put(&fw.wlan.tx_queue[super->s.queue], desc); -#endif /* CONFIG_CARL9170FW_LOOPBACK */ } static void wlan_assign_seq(struct ieee80211_hdr *hdr, unsigned int vif) @@ -343,8 +330,6 @@ static void _wlan_tx(struct dma_desc *desc) get(AR9170_MAC_REG_AMPDU_FACTOR), 8 << super->s.ampdu_factor)); } - - __wlan_tx(desc); } /* propagate transmission status back to the driver */ @@ -410,7 +395,11 @@ static bool wlan_tx_status(struct dma_queue *queue, * be aware of this so the frames don't get lost. */ +#ifndef CONFIG_CARL9170FW_DEBUG dma_unlink_head(queue); +#else /* CONFIG_CARL9170FW_DEBUG */ + BUG_ON(dma_unlink_head(queue) != desc); +#endif /* CONFIG_CARL9170FW_DEBUG */ dma_put(&fw.wlan.tx_retry, desc); return true; } @@ -420,7 +409,11 @@ static bool wlan_tx_status(struct dma_queue *queue, } } +#ifndef CONFIG_CARL9170FW_DEBUG dma_unlink_head(queue); +#else /* CONFIG_CARL9170FW_DEBUG */ + BUG_ON(dma_unlink_head(queue) != desc); +#endif /* CONFIG_CARL9170FW_DEBUG */ if (txfail) { /* * Issue the queue bump, @@ -469,7 +462,6 @@ static void handle_tx_completion(void) } } - wlan_tx_ampdu_reset(i); for_each_desc(desc, &fw.wlan.tx_retry) @@ -499,6 +491,7 @@ void __hot wlan_tx(struct dma_desc *desc) #endif /* CONFIG_CARL9170FW_CAB_QUEUE */ _wlan_tx(desc); + __wlan_tx(desc); wlan_trigger(BIT(super->s.queue)); } @@ -707,12 +700,10 @@ static unsigned int wlan_rx_filter(struct dma_desc *desc) rx_filter |= CARL9170_RX_FILTER_MGMT; } -#ifdef CONFIG_CARL9170FW_WOL if (unlikely(fw.suspend_mode == CARL9170_HOST_SUSPENDED)) { wol_rx(rx_filter, hdr, min(data_len, (unsigned int)AR9170_BLOCK_SIZE)); } -#endif /* CONFIG_CARL9170FW_WOL */ #undef AR9170_RX_ERROR_BAD @@ -762,6 +753,7 @@ void wlan_cab_flush_queue(const unsigned int vif) /* ready to roll! */ _wlan_tx(desc); + __wlan_tx(desc); wlan_trigger(BIT(super->s.queue)); } }