Lines Matching +full:pre +full:- +full:determined
52 #define NUM_FFPLD_FIFO 4 /* number of fifo concerned by pre-loading */
76 #define MODADD_POW2(x, y, bound) (((x) + (y)) & ((bound) - 1))
77 #define MODSUB_POW2(x, y, bound) (((x) - (y)) & ((bound) - 1))
79 /* structure to hold tx fifo information and pre-loading state
85 * ampdu_pld_size: number of bytes to be pre-loaded
86 * mcs2ampdu_table: per-mcs max # of mpdus in an ampdu
107 * ini_enable: per-tid initiator enable/disable of ampdu
112 * retry_limit_tid: per-tid mpdu transmit retry limit
113 * rr_retry_limit_tid: per-tid mpdu transmit retry limit at regular rate
114 * mpdu_density: min mpdu spacing (0-7) ==> 2^(x-1)/8 usec
117 * rx_factor: maximum rx ampdu factor (0-3) ==> 2^(13+x) bytes
160 ampdu->max_txlen[mcs][0][0] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
163 ampdu->max_txlen[mcs][1][0] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
166 ampdu->max_txlen[mcs][0][1] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
169 ampdu->max_txlen[mcs][1][1] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
175 if (BRCMS_PHY_11N_CAP(ampdu->wlc->band)) in brcms_c_ampdu_cap()
183 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_set()
184 struct bcma_device *core = wlc->hw->d11core; in brcms_c_ampdu_set()
186 wlc->pub->_ampdu = false; in brcms_c_ampdu_set()
189 if (!(wlc->pub->_n_enab & SUPPORT_11N)) { in brcms_c_ampdu_set()
191 wlc->pub->unit); in brcms_c_ampdu_set()
192 return -ENOTSUPP; in brcms_c_ampdu_set()
196 wlc->pub->unit); in brcms_c_ampdu_set()
197 return -ENOTSUPP; in brcms_c_ampdu_set()
199 wlc->pub->_ampdu = on; in brcms_c_ampdu_set()
211 fifo = (ampdu->fifo_tb + j); in brcms_c_ffpld_init()
212 fifo->ampdu_pld_size = 0; in brcms_c_ffpld_init()
214 fifo->mcs2ampdu_table[i] = 255; in brcms_c_ffpld_init()
215 fifo->dmaxferrate = 0; in brcms_c_ffpld_init()
216 fifo->accum_txampdu = 0; in brcms_c_ffpld_init()
217 fifo->prev_txfunfl = 0; in brcms_c_ffpld_init()
218 fifo->accum_txfunfl = 0; in brcms_c_ffpld_init()
232 ampdu->wlc = wlc; in brcms_c_ampdu_attach()
235 ampdu->ini_enable[i] = true; in brcms_c_ampdu_attach()
237 ampdu->ini_enable[PRIO_8021D_VO] = false; in brcms_c_ampdu_attach()
238 ampdu->ini_enable[PRIO_8021D_NC] = false; in brcms_c_ampdu_attach()
241 ampdu->ini_enable[PRIO_8021D_NONE] = false; in brcms_c_ampdu_attach()
242 ampdu->ini_enable[PRIO_8021D_BK] = false; in brcms_c_ampdu_attach()
244 ampdu->ba_tx_wsize = AMPDU_TX_BA_DEF_WSIZE; in brcms_c_ampdu_attach()
245 ampdu->ba_rx_wsize = AMPDU_RX_BA_DEF_WSIZE; in brcms_c_ampdu_attach()
246 ampdu->mpdu_density = AMPDU_DEF_MPDU_DENSITY; in brcms_c_ampdu_attach()
247 ampdu->max_pdu = AUTO; in brcms_c_ampdu_attach()
248 ampdu->dur = AMPDU_MAX_DUR; in brcms_c_ampdu_attach()
250 ampdu->ffpld_rsvd = AMPDU_DEF_FFPLD_RSVD; in brcms_c_ampdu_attach()
255 if (BRCMS_ISNPHY(wlc->band) && NREV_LT(wlc->band->phyrev, 2)) in brcms_c_ampdu_attach()
256 ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_32K; in brcms_c_ampdu_attach()
258 ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_64K; in brcms_c_ampdu_attach()
259 ampdu->retry_limit = AMPDU_DEF_RETRY_LIMIT; in brcms_c_ampdu_attach()
260 ampdu->rr_retry_limit = AMPDU_DEF_RR_RETRY_LIMIT; in brcms_c_ampdu_attach()
263 ampdu->retry_limit_tid[i] = ampdu->retry_limit; in brcms_c_ampdu_attach()
264 ampdu->rr_retry_limit_tid[i] = ampdu->rr_retry_limit; in brcms_c_ampdu_attach()
267 brcms_c_scb_ampdu_update_max_txlen(ampdu, ampdu->dur); in brcms_c_ampdu_attach()
268 ampdu->mfbr = false; in brcms_c_ampdu_attach()
270 brcms_c_ampdu_set(ampdu, wlc->pub->_ampdu); in brcms_c_ampdu_attach()
272 ampdu->tx_max_funl = FFPLD_TX_MAX_UNFL; in brcms_c_ampdu_attach()
286 struct scb_ampdu *scb_ampdu = &scb->scb_ampdu; in brcms_c_scb_ampdu_update_config()
289 scb_ampdu->max_pdu = AMPDU_NUM_MPDU; in brcms_c_scb_ampdu_update_config()
293 if (ampdu->fifo_tb[i].ampdu_pld_size > FFPLD_PLD_INCR) in brcms_c_scb_ampdu_update_config()
294 scb_ampdu->max_pdu = AMPDU_NUM_MPDU_LEGACY; in brcms_c_scb_ampdu_update_config()
298 if (ampdu->max_pdu != AUTO) in brcms_c_scb_ampdu_update_config()
299 scb_ampdu->max_pdu = (u8) ampdu->max_pdu; in brcms_c_scb_ampdu_update_config()
301 scb_ampdu->release = min_t(u8, scb_ampdu->max_pdu, in brcms_c_scb_ampdu_update_config()
304 if (scb_ampdu->max_rx_ampdu_bytes) in brcms_c_scb_ampdu_update_config()
305 scb_ampdu->release = min_t(u8, scb_ampdu->release, in brcms_c_scb_ampdu_update_config()
306 scb_ampdu->max_rx_ampdu_bytes / 1600); in brcms_c_scb_ampdu_update_config()
308 scb_ampdu->release = min(scb_ampdu->release, in brcms_c_scb_ampdu_update_config()
309 ampdu->fifo_tb[TX_AC_BE_FIFO]. in brcms_c_scb_ampdu_update_config()
315 brcms_c_scb_ampdu_update_config(ampdu, &du->wlc->pri_scb); in brcms_c_scb_ampdu_update_config_all()
323 struct brcms_fifo_info *fifo = (ampdu->fifo_tb + f); in brcms_c_ffpld_calc_mcs2ampdu_table()
327 max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS], in brcms_c_ffpld_calc_mcs2ampdu_table()
332 (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size)) in brcms_c_ffpld_calc_mcs2ampdu_table()
334 fifo->dmaxferrate = dma_rate; in brcms_c_ffpld_calc_mcs2ampdu_table()
342 tmp = ((fifo->ampdu_pld_size * phy_rate) / in brcms_c_ffpld_calc_mcs2ampdu_table()
343 ((phy_rate - dma_rate) * FFPLD_MPDU_SIZE)) + 1; in brcms_c_ffpld_calc_mcs2ampdu_table()
345 fifo->mcs2ampdu_table[i] = (u8) tmp; in brcms_c_ffpld_calc_mcs2ampdu_table()
353 * Return 1 if pre-loading not active, -1 if not an underflow event,
354 * 0 if pre-loading module took care of the event.
358 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ffpld_check_txfunfl()
365 struct brcms_fifo_info *fifo = (ampdu->fifo_tb + fid); in brcms_c_ffpld_check_txfunfl()
370 cur_txunfl = brcms_b_read_shm(wlc->hw, in brcms_c_ffpld_check_txfunfl()
373 new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl); in brcms_c_ffpld_check_txfunfl()
375 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ffpld_check_txfunfl()
377 return -1; in brcms_c_ffpld_check_txfunfl()
379 fifo->prev_txfunfl = cur_txunfl; in brcms_c_ffpld_check_txfunfl()
381 if (!ampdu->tx_max_funl) in brcms_c_ffpld_check_txfunfl()
385 if (brcms_b_xmtfifo_sz_get(wlc->hw, fid, &xmtfifo_sz)) in brcms_c_ffpld_check_txfunfl()
386 return -1; in brcms_c_ffpld_check_txfunfl()
388 if ((TXFIFO_SIZE_UNIT * (u32) xmtfifo_sz) <= ampdu->ffpld_rsvd) in brcms_c_ffpld_check_txfunfl()
391 max_pld_size = TXFIFO_SIZE_UNIT * xmtfifo_sz - ampdu->ffpld_rsvd; in brcms_c_ffpld_check_txfunfl()
392 fifo->accum_txfunfl += new_txunfl; in brcms_c_ffpld_check_txfunfl()
395 if (fifo->accum_txfunfl < 10) in brcms_c_ffpld_check_txfunfl()
398 brcms_dbg_ht(wlc->hw->d11core, "ampdu_count %d tx_underflows %d\n", in brcms_c_ffpld_check_txfunfl()
399 current_ampdu_cnt, fifo->accum_txfunfl); in brcms_c_ffpld_check_txfunfl()
410 txunfl_ratio = current_ampdu_cnt / fifo->accum_txfunfl; in brcms_c_ffpld_check_txfunfl()
412 if (txunfl_ratio > ampdu->tx_max_funl) { in brcms_c_ffpld_check_txfunfl()
414 fifo->accum_txfunfl = 0; in brcms_c_ffpld_check_txfunfl()
418 max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS], in brcms_c_ffpld_check_txfunfl()
425 if (fifo->ampdu_pld_size >= max_mpdu * FFPLD_MPDU_SIZE) { in brcms_c_ffpld_check_txfunfl()
426 fifo->accum_txfunfl = 0; in brcms_c_ffpld_check_txfunfl()
430 if (fifo->ampdu_pld_size < max_pld_size) { in brcms_c_ffpld_check_txfunfl()
433 fifo->ampdu_pld_size += FFPLD_PLD_INCR; in brcms_c_ffpld_check_txfunfl()
434 if (fifo->ampdu_pld_size > max_pld_size) in brcms_c_ffpld_check_txfunfl()
435 fifo->ampdu_pld_size = max_pld_size; in brcms_c_ffpld_check_txfunfl()
447 fifo->dmaxferrate = in brcms_c_ffpld_check_txfunfl()
449 (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size)) in brcms_c_ffpld_check_txfunfl()
452 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ffpld_check_txfunfl()
454 "pre-load size %d\n", in brcms_c_ffpld_check_txfunfl()
455 fifo->dmaxferrate, fifo->ampdu_pld_size); in brcms_c_ffpld_check_txfunfl()
459 if (fifo->mcs2ampdu_table[FFPLD_MAX_MCS] > 1) { in brcms_c_ffpld_check_txfunfl()
460 if (fifo->mcs2ampdu_table[FFPLD_MAX_MCS] == 255) in brcms_c_ffpld_check_txfunfl()
461 fifo->mcs2ampdu_table[FFPLD_MAX_MCS] = in brcms_c_ffpld_check_txfunfl()
462 AMPDU_NUM_MPDU_LEGACY - 1; in brcms_c_ffpld_check_txfunfl()
464 fifo->mcs2ampdu_table[FFPLD_MAX_MCS] -= 1; in brcms_c_ffpld_check_txfunfl()
473 fifo->accum_txfunfl = 0; in brcms_c_ffpld_check_txfunfl()
484 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ampdu_tx_operational()
485 struct scb *scb = &wlc->pri_scb; in brcms_c_ampdu_tx_operational()
486 scb_ampdu = &scb->scb_ampdu; in brcms_c_ampdu_tx_operational()
488 if (!ampdu->ini_enable[tid]) { in brcms_c_ampdu_tx_operational()
489 brcms_err(wlc->hw->d11core, "%s: Rejecting tid %d\n", in brcms_c_ampdu_tx_operational()
494 ini = &scb_ampdu->ini[tid]; in brcms_c_ampdu_tx_operational()
495 ini->tid = tid; in brcms_c_ampdu_tx_operational()
496 ini->scb = scb_ampdu->scb; in brcms_c_ampdu_tx_operational()
497 ini->ba_wsize = ba_wsize; in brcms_c_ampdu_tx_operational()
498 scb_ampdu->max_rx_ampdu_bytes = max_rx_ampdu_bytes; in brcms_c_ampdu_tx_operational()
504 session->wlc = wlc; in brcms_c_ampdu_reset_session()
505 skb_queue_head_init(&session->skb_list); in brcms_c_ampdu_reset_session()
506 session->max_ampdu_len = 0; /* determined from first MPDU */ in brcms_c_ampdu_reset_session()
507 session->max_ampdu_frames = 0; /* determined from first MPDU */ in brcms_c_ampdu_reset_session()
508 session->ampdu_len = 0; in brcms_c_ampdu_reset_session()
509 session->dma_len = 0; in brcms_c_ampdu_reset_session()
514 * frame cannot be accomodated in the current session, -ENOSPC is
520 struct brcms_c_info *wlc = session->wlc; in brcms_c_ampdu_add_frame()
521 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ampdu_add_frame()
522 struct scb *scb = &wlc->pri_scb; in brcms_c_ampdu_add_frame()
523 struct scb_ampdu *scb_ampdu = &scb->scb_ampdu; in brcms_c_ampdu_add_frame()
525 struct ieee80211_tx_rate *txrate = tx_info->status.rates; in brcms_c_ampdu_add_frame()
526 struct d11txh *txh = (struct d11txh *)p->data; in brcms_c_ampdu_add_frame()
535 ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM]; in brcms_c_ampdu_add_frame()
537 fbr_iscck = !(le16_to_cpu(txh->XtraFrameTypes) & 0x03); in brcms_c_ampdu_add_frame()
538 len = fbr_iscck ? BRCMS_GET_CCK_PLCP_LEN(txh->FragPLCPFallback) : in brcms_c_ampdu_add_frame()
539 BRCMS_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback); in brcms_c_ampdu_add_frame()
542 ampdu_frames = skb_queue_len(&session->skb_list); in brcms_c_ampdu_add_frame()
546 if (ampdu_frames + 1 > session->max_ampdu_frames || in brcms_c_ampdu_add_frame()
547 session->ampdu_len + len > session->max_ampdu_len) in brcms_c_ampdu_add_frame()
548 return -ENOSPC; in brcms_c_ampdu_add_frame()
553 * so return -ENOSPC anyway. in brcms_c_ampdu_add_frame()
558 first = skb_peek(&session->skb_list); in brcms_c_ampdu_add_frame()
559 if (p->priority != first->priority) in brcms_c_ampdu_add_frame()
560 return -ENOSPC; in brcms_c_ampdu_add_frame()
567 session->ampdu_len += len; in brcms_c_ampdu_add_frame()
568 session->dma_len += p->len; in brcms_c_ampdu_add_frame()
570 tid = (u8)p->priority; in brcms_c_ampdu_add_frame()
573 if (txrate[0].count <= ampdu->rr_retry_limit_tid[tid]) { in brcms_c_ampdu_add_frame()
583 uint fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK; in brcms_c_ampdu_add_frame()
584 struct brcms_fifo_info *f = &du->fifo_tb[fifo]; in brcms_c_ampdu_add_frame()
590 plcp0 = txh->FragPLCPFallback[0]; in brcms_c_ampdu_add_frame()
591 plcp3 = txh->FragPLCPFallback[3]; in brcms_c_ampdu_add_frame()
599 session->max_ampdu_len = min(scb_ampdu->max_rx_ampdu_bytes, in brcms_c_ampdu_add_frame()
600 ampdu->max_txlen[mcs][is40][sgi]); in brcms_c_ampdu_add_frame()
602 session->max_ampdu_frames = scb_ampdu->max_pdu; in brcms_c_ampdu_add_frame()
603 if (mcs_2_rate(mcs, true, false) >= f->dmaxferrate) { in brcms_c_ampdu_add_frame()
604 session->max_ampdu_frames = in brcms_c_ampdu_add_frame()
605 min_t(u16, f->mcs2ampdu_table[mcs], in brcms_c_ampdu_add_frame()
606 session->max_ampdu_frames); in brcms_c_ampdu_add_frame()
614 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_add_frame()
618 txh->MacTxControlLow = cpu_to_le16(mcl); in brcms_c_ampdu_add_frame()
619 txh->PreloadSize = 0; /* always default to 0 */ in brcms_c_ampdu_add_frame()
621 skb_queue_tail(&session->skb_list, p); in brcms_c_ampdu_add_frame()
628 struct brcms_c_info *wlc = session->wlc; in brcms_c_ampdu_finalize()
629 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ampdu_finalize()
644 u16 dma_len = session->dma_len; in brcms_c_ampdu_finalize()
655 if (skb_queue_empty(&session->skb_list)) in brcms_c_ampdu_finalize()
658 first = skb_peek(&session->skb_list); in brcms_c_ampdu_finalize()
659 last = skb_peek_tail(&session->skb_list); in brcms_c_ampdu_finalize()
662 txh = (struct d11txh *)last->data; in brcms_c_ampdu_finalize()
663 fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK; in brcms_c_ampdu_finalize()
664 f = &du->fifo_tb[fifo]; in brcms_c_ampdu_finalize()
666 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_finalize()
669 txh->MacTxControlLow = cpu_to_le16(mcl); in brcms_c_ampdu_finalize()
672 ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM]; in brcms_c_ampdu_finalize()
673 txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM] = 0; in brcms_c_ampdu_finalize()
674 session->ampdu_len -= ndelim * AMPDU_DELIMITER_LEN; in brcms_c_ampdu_finalize()
677 fbr_iscck = ((le16_to_cpu(txh->XtraFrameTypes) & 0x3) == 0); in brcms_c_ampdu_finalize()
678 len = fbr_iscck ? BRCMS_GET_CCK_PLCP_LEN(txh->FragPLCPFallback) : in brcms_c_ampdu_finalize()
679 BRCMS_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback); in brcms_c_ampdu_finalize()
680 session->ampdu_len -= roundup(len, 4) - len; in brcms_c_ampdu_finalize()
684 txrate = tx_info->status.rates; in brcms_c_ampdu_finalize()
685 txh = (struct d11txh *)first->data; in brcms_c_ampdu_finalize()
687 rts = (struct ieee80211_rts *)&txh->rts_frame; in brcms_c_ampdu_finalize()
689 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_finalize()
696 if (ieee80211_is_rts(rts->frame_control)) { in brcms_c_ampdu_finalize()
700 if (ieee80211_is_cts(rts->frame_control)) { in brcms_c_ampdu_finalize()
704 txh->MacTxControlLow = cpu_to_le16(mcl); in brcms_c_ampdu_finalize()
710 plcp0 = txh->FragPLCPFallback[0]; in brcms_c_ampdu_finalize()
716 if (CHSPEC_SB_UPPER(wlc_phy_chanspec_get(wlc->band->pi))) in brcms_c_ampdu_finalize()
728 fbr_iscck = !(le16_to_cpu(txh->XtraFrameTypes) & 0x03); in brcms_c_ampdu_finalize()
731 cck_rspec(cck_phy2mac_rate(txh->FragPLCPFallback[0])); in brcms_c_ampdu_finalize()
734 rspec_fallback |= txh->FragPLCPFallback[0] & ~MIMO_PLCP_40MHZ; in brcms_c_ampdu_finalize()
735 if (txh->FragPLCPFallback[0] & MIMO_PLCP_40MHZ) in brcms_c_ampdu_finalize()
748 BRCMS_SET_MIMO_PLCP_LEN(plcp, session->ampdu_len); in brcms_c_ampdu_finalize()
753 if (txh->MModeLen) { in brcms_c_ampdu_finalize()
755 session->ampdu_len); in brcms_c_ampdu_finalize()
756 txh->MModeLen = cpu_to_le16(mmodelen); in brcms_c_ampdu_finalize()
759 if (txh->MModeFbrLen) { in brcms_c_ampdu_finalize()
761 session->ampdu_len); in brcms_c_ampdu_finalize()
762 txh->MModeFbrLen = cpu_to_le16(mmfbrlen); in brcms_c_ampdu_finalize()
767 if (mcs_2_rate(mcs, true, false) >= f->dmaxferrate) { in brcms_c_ampdu_finalize()
768 dma_len = min(dma_len, f->ampdu_pld_size); in brcms_c_ampdu_finalize()
769 txh->PreloadSize = cpu_to_le16(dma_len); in brcms_c_ampdu_finalize()
771 txh->PreloadSize = 0; in brcms_c_ampdu_finalize()
774 mch = le16_to_cpu(txh->MacTxControlHigh); in brcms_c_ampdu_finalize()
790 session->ampdu_len, true); in brcms_c_ampdu_finalize()
791 rts->duration = cpu_to_le16(durid); in brcms_c_ampdu_finalize()
797 session->ampdu_len, true); in brcms_c_ampdu_finalize()
798 txh->RTSDurFallback = cpu_to_le16(durid); in brcms_c_ampdu_finalize()
800 txh->TxFesTimeNormal = rts->duration; in brcms_c_ampdu_finalize()
802 txh->TxFesTimeFallback = txh->RTSDurFallback; in brcms_c_ampdu_finalize()
808 txh->MacTxControlHigh = cpu_to_le16(mch); in brcms_c_ampdu_finalize()
810 BRCMS_SET_MIMO_PLCP_AMPDU(txh->FragPLCPFallback); in brcms_c_ampdu_finalize()
813 brcms_dbg_ht(wlc->hw->d11core, "wl%d: count %d ampdu_len %d\n", in brcms_c_ampdu_finalize()
814 wlc->pub->unit, skb_queue_len(&session->skb_list), in brcms_c_ampdu_finalize()
815 session->ampdu_len); in brcms_c_ampdu_finalize()
823 struct ieee80211_tx_rate *txrate = tx_info->status.rates; in brcms_c_ampdu_rate_status()
828 txrate[i].idx = -1; in brcms_c_ampdu_rate_status()
839 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_dotxstatus_complete()
860 scb_ampdu = &scb->scb_ampdu; in brcms_c_ampdu_dotxstatus_complete()
861 tid = (u8) (p->priority); in brcms_c_ampdu_dotxstatus_complete()
863 ini = &scb_ampdu->ini[tid]; in brcms_c_ampdu_dotxstatus_complete()
864 retry_limit = ampdu->retry_limit_tid[tid]; in brcms_c_ampdu_dotxstatus_complete()
866 queue = txs->frameid & TXFID_QUEUE_MASK; in brcms_c_ampdu_dotxstatus_complete()
867 supr_status = txs->status & TX_STATUS_SUPR_MASK; in brcms_c_ampdu_dotxstatus_complete()
869 if (txs->status & TX_STATUS_ACK_RCV) { in brcms_c_ampdu_dotxstatus_complete()
870 WARN_ON(!(txs->status & TX_STATUS_INTERMEDIATE)); in brcms_c_ampdu_dotxstatus_complete()
871 start_seq = txs->sequence >> SEQNUM_SHIFT; in brcms_c_ampdu_dotxstatus_complete()
872 bitmap[0] = (txs->status & TX_STATUS_BA_BMAP03_MASK) >> in brcms_c_ampdu_dotxstatus_complete()
894 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
897 wlc->default_bss->chanspec)); in brcms_c_ampdu_dotxstatus_complete()
900 brcms_err(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
910 * try tuning pre-loading or ampdu size in brcms_c_ampdu_dotxstatus_complete()
914 * if there were underflows, but pre-loading in brcms_c_ampdu_dotxstatus_complete()
919 } else if (txs->phyerr) { in brcms_c_ampdu_dotxstatus_complete()
920 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
922 __func__, txs->phyerr); in brcms_c_ampdu_dotxstatus_complete()
929 txh = (struct d11txh *) p->data; in brcms_c_ampdu_dotxstatus_complete()
930 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_dotxstatus_complete()
933 seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT; in brcms_c_ampdu_dotxstatus_complete()
935 trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, sizeof(*txh)); in brcms_c_ampdu_dotxstatus_complete()
939 mimoantsel = le16_to_cpu(txh->ABI_MimoAntSel); in brcms_c_ampdu_dotxstatus_complete()
946 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
953 ini->txretry[index] = 0; in brcms_c_ampdu_dotxstatus_complete()
962 tx_info->flags |= IEEE80211_TX_STAT_ACK; in brcms_c_ampdu_dotxstatus_complete()
963 tx_info->flags |= IEEE80211_TX_STAT_AMPDU; in brcms_c_ampdu_dotxstatus_complete()
964 tx_info->status.ampdu_ack_len = in brcms_c_ampdu_dotxstatus_complete()
965 tx_info->status.ampdu_len = 1; in brcms_c_ampdu_dotxstatus_complete()
970 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, in brcms_c_ampdu_dotxstatus_complete()
978 if (retry && (ini->txretry[index] < (int)retry_limit)) { in brcms_c_ampdu_dotxstatus_complete()
980 ini->txretry[index]++; in brcms_c_ampdu_dotxstatus_complete()
991 tx_info->status.ampdu_ack_len = 0; in brcms_c_ampdu_dotxstatus_complete()
992 tx_info->status.ampdu_len = 1; in brcms_c_ampdu_dotxstatus_complete()
993 tx_info->flags |= in brcms_c_ampdu_dotxstatus_complete()
997 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
1000 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, in brcms_c_ampdu_dotxstatus_complete()
1011 p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED); in brcms_c_ampdu_dotxstatus_complete()
1015 brcms_c_antsel_antsel2id(wlc->asi, mimoantsel); in brcms_c_ampdu_dotxstatus_complete()
1022 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_dotxstatus()
1029 if (txs->status & TX_STATUS_ACK_RCV) { in brcms_c_ampdu_dotxstatus()
1033 s1 = bcma_read32(wlc->hw->d11core, D11REGOFFS(frmtxstatus)); in brcms_c_ampdu_dotxstatus()
1039 s1 = bcma_read32(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus()
1043 s2 = bcma_read32(wlc->hw->d11core, D11REGOFFS(frmtxstatus2)); in brcms_c_ampdu_dotxstatus()
1050 u8 queue = txs->frameid & TXFID_QUEUE_MASK; in brcms_c_ampdu_dotxstatus()
1054 txh = (struct d11txh *) p->data; in brcms_c_ampdu_dotxstatus()
1055 trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, in brcms_c_ampdu_dotxstatus()
1057 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_dotxstatus()
1063 p = dma_getnexttxp(wlc->hw->di[queue], in brcms_c_ampdu_dotxstatus()
1075 memcpy(template, wlc->pub->cur_etheraddr, ETH_ALEN); in brcms_c_ampdu_macaddr_upd()
1076 brcms_b_write_template_ram(wlc->hw, (T_BA_TPL_BASE + 16), in brcms_c_ampdu_macaddr_upd()
1083 return wlc->ampdu->ini_enable[tid]; in brcms_c_aggregatable()
1088 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_shm_upd()
1094 if ((ampdu->rx_factor & IEEE80211_HT_AMPDU_PARM_FACTOR) == in brcms_c_ampdu_shm_upd()
1096 brcms_b_write_shm(wlc->hw, M_MIMO_MAXSYM, MIMO_MAXSYM_MAX); in brcms_c_ampdu_shm_upd()
1097 brcms_b_write_shm(wlc->hw, M_WATCHDOG_8TU, WATCHDOG_8TU_MAX); in brcms_c_ampdu_shm_upd()
1099 brcms_b_write_shm(wlc->hw, M_MIMO_MAXSYM, MIMO_MAXSYM_DEF); in brcms_c_ampdu_shm_upd()
1100 brcms_b_write_shm(wlc->hw, M_WATCHDOG_8TU, WATCHDOG_8TU_DEF); in brcms_c_ampdu_shm_upd()
1112 if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && in dma_cb_fn_ampdu()
1113 (tx_info->rate_driver_data[0] == sta || sta == NULL)) in dma_cb_fn_ampdu()
1114 tx_info->rate_driver_data[0] = NULL; in dma_cb_fn_ampdu()
1124 brcms_c_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu); in brcms_c_ampdu_flush()