X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Fsrc%2Fwlan.c;h=844036376a2532efb4e51d5ce2c11ef660eae4ad;hb=cdced53c2ede33a9fe9004db4d93cfc984ad4243;hp=4e0feafa12615c96806ee5e52f2b73c79a0b369b;hpb=29c96874116d87d35be5f636d107679f4120ee77;p=carl9170fw.git diff --git a/carlfw/src/wlan.c b/carlfw/src/wlan.c index 4e0feaf..8440363 100644 --- a/carlfw/src/wlan.c +++ b/carlfw/src/wlan.c @@ -356,11 +356,9 @@ static void _wlan_tx(struct dma_desc *desc) static bool wlan_tx_status(struct dma_queue *queue, struct dma_desc *desc) { - struct ar9170_tx_frame *frame = DESC_PAYLOAD(desc); struct carl9170_tx_superframe *super = get_super(desc); - struct ieee80211_hdr *hdr = &super->f.data.i3e; unsigned int qidx = super->s.queue; - bool txfail, success; + bool txfail = false, success; success = true; @@ -381,7 +379,7 @@ static bool wlan_tx_status(struct dma_queue *queue, * order. */ - if (!frame->hdr.mac.ampdu) { + if (!super->f.hdr.mac.ampdu) { /* * 802.11 - 7.1.3.1.5. * set "Retry Field" for consecutive attempts @@ -389,8 +387,8 @@ static bool wlan_tx_status(struct dma_queue *queue, * Note: For AMPDU see: * 802.11n 9.9.1.6 "Retransmit Procedures" */ - - hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_RETRY); + super->f.data.i3e.frame_control |= + cpu_to_le16(IEEE80211_FCTL_RETRY); } if (txfail) { @@ -440,13 +438,11 @@ static bool wlan_tx_status(struct dma_queue *queue, unhide_super(desc); -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ if (unlikely(super == (void *) &dma_mem.reserved.ba)) { fw.wlan.ba_desc = desc; fw.wlan.ba_desc_available = 1; return true; } -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ wlan_tx_complete(super, success); @@ -464,7 +460,6 @@ static bool wlan_tx_status(struct dma_queue *queue, static void handle_tx_completion(void) { struct dma_desc *desc; - unsigned int map = 0; int i; for (i = AR9170_TXQ_SPECIAL; i >= AR9170_TXQ0; i--) { @@ -480,10 +475,8 @@ static void handle_tx_completion(void) wlan_tx_ampdu_end(i); if (!queue_empty(&fw.wlan.tx_queue[i])) - map |= BIT(i); - + wlan_trigger(BIT(i)); } - wlan_trigger(map); } void __hot wlan_tx(struct dma_desc *desc) @@ -507,7 +500,6 @@ void __hot wlan_tx(struct dma_desc *desc) wlan_trigger(BIT(super->s.queue)); } -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ static void wlan_send_buffered_ba(void) { struct carl9170_tx_ba_superframe *baf = &dma_mem.reserved.ba.ba; @@ -521,8 +513,9 @@ static void wlan_send_buffered_ba(void) if (!fw.wlan.ba_desc_available) return; - ctx = &fw.wlan.ba_cache[fw.wlan.ba_head_idx % CONFIG_CARL9170FW_BACK_REQS_NUM]; + ctx = &fw.wlan.ba_cache[fw.wlan.ba_head_idx]; fw.wlan.ba_head_idx++; + fw.wlan.ba_head_idx %= CONFIG_CARL9170FW_BACK_REQS_NUM; /* Format BlockAck */ fw.wlan.ba_desc->status = 0; @@ -536,8 +529,8 @@ static void wlan_send_buffered_ba(void) sizeof(struct ar9170_tx_hwdesc) + sizeof(struct ieee80211_ba); - baf->s.ri[0].tries = 3; - baf->s.queue = 0; + baf->s.ri[0].tries = 1; + baf->s.queue = AR9170_TXQ_VO; baf->f.hdr.length = sizeof(struct ieee80211_ba) + FCS_LEN; /* HW Duration / Backoff */ @@ -575,12 +568,9 @@ static struct carl9170_bar_ctx *wlan_get_bar_cache_buffer(void) { struct carl9170_bar_ctx *tmp; - /* expire oldest entry, if we ran out of ba_ctx' */ - if (fw.wlan.ba_head_idx + CONFIG_CARL9170FW_BACK_REQS_NUM < fw.wlan.ba_tail_idx) - fw.wlan.ba_head_idx++; - - tmp = &fw.wlan.ba_cache[fw.wlan.ba_tail_idx % CONFIG_CARL9170FW_BACK_REQS_NUM]; + tmp = &fw.wlan.ba_cache[fw.wlan.ba_tail_idx]; fw.wlan.ba_tail_idx++; + fw.wlan.ba_tail_idx %= CONFIG_CARL9170FW_BACK_REQS_NUM; return tmp; } @@ -636,7 +626,6 @@ static void handle_bar(struct dma_desc *desc, struct ieee80211_hdr *hdr, ctx->phy = cpu_to_le32(0x2cc301); } } -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ static void wlan_check_rx_overrun(void) { @@ -836,9 +825,7 @@ static unsigned int wlan_rx_filter(struct dma_desc *desc) } else if (ieee80211_is_ctl(hdr->frame_control)) { switch (le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_STYPE) { case IEEE80211_STYPE_BACK_REQ: -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ handle_bar(desc, hdr, data_len, mac_err); -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ /* fallthrough */ rx_filter |= CARL9170_RX_FILTER_CTL_BACKR; break; @@ -1048,9 +1035,7 @@ static void wlan_janitor(void) wlan_send_buffered_tx_status(); -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ wlan_send_buffered_ba(); -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ } void handle_wlan(void)