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
154 ampdu->max_txlen[mcs][0][0] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
157 ampdu->max_txlen[mcs][1][0] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
160 ampdu->max_txlen[mcs][0][1] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
163 ampdu->max_txlen[mcs][1][1] = (rate * dur) >> 3; in brcms_c_scb_ampdu_update_max_txlen()
169 if (BRCMS_PHY_11N_CAP(ampdu->wlc->band)) in brcms_c_ampdu_cap()
177 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_set()
178 struct bcma_device *core = wlc->hw->d11core; in brcms_c_ampdu_set()
180 wlc->pub->_ampdu = false; in brcms_c_ampdu_set()
183 if (!(wlc->pub->_n_enab & SUPPORT_11N)) { in brcms_c_ampdu_set()
185 wlc->pub->unit); in brcms_c_ampdu_set()
186 return -ENOTSUPP; in brcms_c_ampdu_set()
190 wlc->pub->unit); in brcms_c_ampdu_set()
191 return -ENOTSUPP; in brcms_c_ampdu_set()
193 wlc->pub->_ampdu = on; in brcms_c_ampdu_set()
205 fifo = (ampdu->fifo_tb + j); in brcms_c_ffpld_init()
206 fifo->ampdu_pld_size = 0; in brcms_c_ffpld_init()
208 fifo->mcs2ampdu_table[i] = 255; in brcms_c_ffpld_init()
209 fifo->dmaxferrate = 0; in brcms_c_ffpld_init()
210 fifo->accum_txampdu = 0; in brcms_c_ffpld_init()
211 fifo->prev_txfunfl = 0; in brcms_c_ffpld_init()
212 fifo->accum_txfunfl = 0; in brcms_c_ffpld_init()
226 ampdu->wlc = wlc; in brcms_c_ampdu_attach()
229 ampdu->ini_enable[i] = true; in brcms_c_ampdu_attach()
231 ampdu->ini_enable[PRIO_8021D_VO] = false; in brcms_c_ampdu_attach()
232 ampdu->ini_enable[PRIO_8021D_NC] = false; in brcms_c_ampdu_attach()
235 ampdu->ini_enable[PRIO_8021D_NONE] = false; in brcms_c_ampdu_attach()
236 ampdu->ini_enable[PRIO_8021D_BK] = false; in brcms_c_ampdu_attach()
238 ampdu->ba_tx_wsize = AMPDU_TX_BA_DEF_WSIZE; in brcms_c_ampdu_attach()
239 ampdu->ba_rx_wsize = AMPDU_RX_BA_DEF_WSIZE; in brcms_c_ampdu_attach()
240 ampdu->mpdu_density = AMPDU_DEF_MPDU_DENSITY; in brcms_c_ampdu_attach()
241 ampdu->max_pdu = AUTO; in brcms_c_ampdu_attach()
242 ampdu->dur = AMPDU_MAX_DUR; in brcms_c_ampdu_attach()
244 ampdu->ffpld_rsvd = AMPDU_DEF_FFPLD_RSVD; in brcms_c_ampdu_attach()
249 if (BRCMS_ISNPHY(wlc->band) && NREV_LT(wlc->band->phyrev, 2)) in brcms_c_ampdu_attach()
250 ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_32K; in brcms_c_ampdu_attach()
252 ampdu->rx_factor = IEEE80211_HT_MAX_AMPDU_64K; in brcms_c_ampdu_attach()
253 ampdu->retry_limit = AMPDU_DEF_RETRY_LIMIT; in brcms_c_ampdu_attach()
254 ampdu->rr_retry_limit = AMPDU_DEF_RR_RETRY_LIMIT; in brcms_c_ampdu_attach()
257 ampdu->retry_limit_tid[i] = ampdu->retry_limit; in brcms_c_ampdu_attach()
258 ampdu->rr_retry_limit_tid[i] = ampdu->rr_retry_limit; in brcms_c_ampdu_attach()
261 brcms_c_scb_ampdu_update_max_txlen(ampdu, ampdu->dur); in brcms_c_ampdu_attach()
262 ampdu->mfbr = false; in brcms_c_ampdu_attach()
264 brcms_c_ampdu_set(ampdu, wlc->pub->_ampdu); in brcms_c_ampdu_attach()
266 ampdu->tx_max_funl = FFPLD_TX_MAX_UNFL; in brcms_c_ampdu_attach()
280 struct scb_ampdu *scb_ampdu = &scb->scb_ampdu; in brcms_c_scb_ampdu_update_config()
283 scb_ampdu->max_pdu = AMPDU_NUM_MPDU; in brcms_c_scb_ampdu_update_config()
287 if (ampdu->fifo_tb[i].ampdu_pld_size > FFPLD_PLD_INCR) in brcms_c_scb_ampdu_update_config()
288 scb_ampdu->max_pdu = AMPDU_NUM_MPDU_LEGACY; in brcms_c_scb_ampdu_update_config()
292 if (ampdu->max_pdu != AUTO) in brcms_c_scb_ampdu_update_config()
293 scb_ampdu->max_pdu = (u8) ampdu->max_pdu; in brcms_c_scb_ampdu_update_config()
295 scb_ampdu->release = min_t(u8, scb_ampdu->max_pdu, in brcms_c_scb_ampdu_update_config()
298 if (scb_ampdu->max_rx_ampdu_bytes) in brcms_c_scb_ampdu_update_config()
299 scb_ampdu->release = min_t(u8, scb_ampdu->release, in brcms_c_scb_ampdu_update_config()
300 scb_ampdu->max_rx_ampdu_bytes / 1600); in brcms_c_scb_ampdu_update_config()
302 scb_ampdu->release = min(scb_ampdu->release, in brcms_c_scb_ampdu_update_config()
303 ampdu->fifo_tb[TX_AC_BE_FIFO]. in brcms_c_scb_ampdu_update_config()
309 brcms_c_scb_ampdu_update_config(ampdu, &ampdu->wlc->pri_scb); in brcms_c_scb_ampdu_update_config_all()
317 struct brcms_fifo_info *fifo = (ampdu->fifo_tb + f); in brcms_c_ffpld_calc_mcs2ampdu_table()
321 max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS], in brcms_c_ffpld_calc_mcs2ampdu_table()
326 (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size)) in brcms_c_ffpld_calc_mcs2ampdu_table()
328 fifo->dmaxferrate = dma_rate; in brcms_c_ffpld_calc_mcs2ampdu_table()
336 tmp = ((fifo->ampdu_pld_size * phy_rate) / in brcms_c_ffpld_calc_mcs2ampdu_table()
337 ((phy_rate - dma_rate) * FFPLD_MPDU_SIZE)) + 1; in brcms_c_ffpld_calc_mcs2ampdu_table()
339 fifo->mcs2ampdu_table[i] = (u8) tmp; in brcms_c_ffpld_calc_mcs2ampdu_table()
347 * Return 1 if pre-loading not active, -1 if not an underflow event,
348 * 0 if pre-loading module took care of the event.
352 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ffpld_check_txfunfl()
357 struct brcms_fifo_info *fifo = (ampdu->fifo_tb + fid); in brcms_c_ffpld_check_txfunfl()
362 cur_txunfl = brcms_b_read_shm(wlc->hw, in brcms_c_ffpld_check_txfunfl()
365 new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl); in brcms_c_ffpld_check_txfunfl()
367 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ffpld_check_txfunfl()
369 return -1; in brcms_c_ffpld_check_txfunfl()
371 fifo->prev_txfunfl = cur_txunfl; in brcms_c_ffpld_check_txfunfl()
373 if (!ampdu->tx_max_funl) in brcms_c_ffpld_check_txfunfl()
377 if (brcms_b_xmtfifo_sz_get(wlc->hw, fid, &xmtfifo_sz)) in brcms_c_ffpld_check_txfunfl()
378 return -1; in brcms_c_ffpld_check_txfunfl()
380 if ((TXFIFO_SIZE_UNIT * (u32) xmtfifo_sz) <= ampdu->ffpld_rsvd) in brcms_c_ffpld_check_txfunfl()
383 max_pld_size = TXFIFO_SIZE_UNIT * xmtfifo_sz - ampdu->ffpld_rsvd; in brcms_c_ffpld_check_txfunfl()
384 fifo->accum_txfunfl += new_txunfl; in brcms_c_ffpld_check_txfunfl()
387 if (fifo->accum_txfunfl < 10) in brcms_c_ffpld_check_txfunfl()
390 brcms_dbg_ht(wlc->hw->d11core, "tx_underflows %d\n", fifo->accum_txfunfl); in brcms_c_ffpld_check_txfunfl()
392 max_mpdu = min_t(u8, fifo->mcs2ampdu_table[FFPLD_MAX_MCS], in brcms_c_ffpld_check_txfunfl()
399 if (fifo->ampdu_pld_size >= max_mpdu * FFPLD_MPDU_SIZE) { in brcms_c_ffpld_check_txfunfl()
400 fifo->accum_txfunfl = 0; in brcms_c_ffpld_check_txfunfl()
404 if (fifo->ampdu_pld_size < max_pld_size) { in brcms_c_ffpld_check_txfunfl()
407 fifo->ampdu_pld_size += FFPLD_PLD_INCR; in brcms_c_ffpld_check_txfunfl()
408 if (fifo->ampdu_pld_size > max_pld_size) in brcms_c_ffpld_check_txfunfl()
409 fifo->ampdu_pld_size = max_pld_size; in brcms_c_ffpld_check_txfunfl()
421 fifo->dmaxferrate = in brcms_c_ffpld_check_txfunfl()
423 (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size)) in brcms_c_ffpld_check_txfunfl()
426 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ffpld_check_txfunfl()
428 "pre-load size %d\n", in brcms_c_ffpld_check_txfunfl()
429 fifo->dmaxferrate, fifo->ampdu_pld_size); in brcms_c_ffpld_check_txfunfl()
433 if (fifo->mcs2ampdu_table[FFPLD_MAX_MCS] > 1) { in brcms_c_ffpld_check_txfunfl()
434 if (fifo->mcs2ampdu_table[FFPLD_MAX_MCS] == 255) in brcms_c_ffpld_check_txfunfl()
435 fifo->mcs2ampdu_table[FFPLD_MAX_MCS] = in brcms_c_ffpld_check_txfunfl()
436 AMPDU_NUM_MPDU_LEGACY - 1; in brcms_c_ffpld_check_txfunfl()
438 fifo->mcs2ampdu_table[FFPLD_MAX_MCS] -= 1; in brcms_c_ffpld_check_txfunfl()
447 fifo->accum_txfunfl = 0; in brcms_c_ffpld_check_txfunfl()
456 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ampdu_tx_operational()
457 struct scb *scb = &wlc->pri_scb; in brcms_c_ampdu_tx_operational()
458 scb_ampdu = &scb->scb_ampdu; in brcms_c_ampdu_tx_operational()
460 if (!ampdu->ini_enable[tid]) { in brcms_c_ampdu_tx_operational()
461 brcms_err(wlc->hw->d11core, "%s: Rejecting tid %d\n", in brcms_c_ampdu_tx_operational()
466 scb_ampdu->max_rx_ampdu_bytes = max_rx_ampdu_bytes; in brcms_c_ampdu_tx_operational()
472 session->wlc = wlc; in brcms_c_ampdu_reset_session()
473 skb_queue_head_init(&session->skb_list); in brcms_c_ampdu_reset_session()
474 session->max_ampdu_len = 0; /* determined from first MPDU */ in brcms_c_ampdu_reset_session()
475 session->max_ampdu_frames = 0; /* determined from first MPDU */ in brcms_c_ampdu_reset_session()
476 session->ampdu_len = 0; in brcms_c_ampdu_reset_session()
477 session->dma_len = 0; in brcms_c_ampdu_reset_session()
482 * frame cannot be accomodated in the current session, -ENOSPC is
488 struct brcms_c_info *wlc = session->wlc; in brcms_c_ampdu_add_frame()
489 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ampdu_add_frame()
490 struct scb *scb = &wlc->pri_scb; in brcms_c_ampdu_add_frame()
491 struct scb_ampdu *scb_ampdu = &scb->scb_ampdu; in brcms_c_ampdu_add_frame()
493 struct ieee80211_tx_rate *txrate = tx_info->status.rates; in brcms_c_ampdu_add_frame()
494 struct d11txh *txh = (struct d11txh *)p->data; in brcms_c_ampdu_add_frame()
503 ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM]; in brcms_c_ampdu_add_frame()
505 fbr_iscck = !(le16_to_cpu(txh->XtraFrameTypes) & 0x03); in brcms_c_ampdu_add_frame()
506 len = fbr_iscck ? BRCMS_GET_CCK_PLCP_LEN(txh->FragPLCPFallback) : in brcms_c_ampdu_add_frame()
507 BRCMS_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback); in brcms_c_ampdu_add_frame()
510 ampdu_frames = skb_queue_len(&session->skb_list); in brcms_c_ampdu_add_frame()
514 if (ampdu_frames + 1 > session->max_ampdu_frames || in brcms_c_ampdu_add_frame()
515 session->ampdu_len + len > session->max_ampdu_len) in brcms_c_ampdu_add_frame()
516 return -ENOSPC; in brcms_c_ampdu_add_frame()
521 * so return -ENOSPC anyway. in brcms_c_ampdu_add_frame()
526 first = skb_peek(&session->skb_list); in brcms_c_ampdu_add_frame()
527 if (p->priority != first->priority) in brcms_c_ampdu_add_frame()
528 return -ENOSPC; in brcms_c_ampdu_add_frame()
535 session->ampdu_len += len; in brcms_c_ampdu_add_frame()
536 session->dma_len += p->len; in brcms_c_ampdu_add_frame()
538 tid = (u8)p->priority; in brcms_c_ampdu_add_frame()
541 if (txrate[0].count <= ampdu->rr_retry_limit_tid[tid]) { in brcms_c_ampdu_add_frame()
551 uint fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK; in brcms_c_ampdu_add_frame()
552 struct brcms_fifo_info *f = &ampdu->fifo_tb[fifo]; in brcms_c_ampdu_add_frame()
558 plcp0 = txh->FragPLCPFallback[0]; in brcms_c_ampdu_add_frame()
559 plcp3 = txh->FragPLCPFallback[3]; in brcms_c_ampdu_add_frame()
567 session->max_ampdu_len = min(scb_ampdu->max_rx_ampdu_bytes, in brcms_c_ampdu_add_frame()
568 ampdu->max_txlen[mcs][is40][sgi]); in brcms_c_ampdu_add_frame()
570 session->max_ampdu_frames = scb_ampdu->max_pdu; in brcms_c_ampdu_add_frame()
571 if (mcs_2_rate(mcs, true, false) >= f->dmaxferrate) { in brcms_c_ampdu_add_frame()
572 session->max_ampdu_frames = in brcms_c_ampdu_add_frame()
573 min_t(u16, f->mcs2ampdu_table[mcs], in brcms_c_ampdu_add_frame()
574 session->max_ampdu_frames); in brcms_c_ampdu_add_frame()
582 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_add_frame()
586 txh->MacTxControlLow = cpu_to_le16(mcl); in brcms_c_ampdu_add_frame()
587 txh->PreloadSize = 0; /* always default to 0 */ in brcms_c_ampdu_add_frame()
589 skb_queue_tail(&session->skb_list, p); in brcms_c_ampdu_add_frame()
596 struct brcms_c_info *wlc = session->wlc; in brcms_c_ampdu_finalize()
597 struct ampdu_info *ampdu = wlc->ampdu; in brcms_c_ampdu_finalize()
612 u16 dma_len = session->dma_len; in brcms_c_ampdu_finalize()
623 if (skb_queue_empty(&session->skb_list)) in brcms_c_ampdu_finalize()
626 first = skb_peek(&session->skb_list); in brcms_c_ampdu_finalize()
627 last = skb_peek_tail(&session->skb_list); in brcms_c_ampdu_finalize()
630 txh = (struct d11txh *)last->data; in brcms_c_ampdu_finalize()
631 fifo = le16_to_cpu(txh->TxFrameID) & TXFID_QUEUE_MASK; in brcms_c_ampdu_finalize()
632 f = &ampdu->fifo_tb[fifo]; in brcms_c_ampdu_finalize()
634 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_finalize()
637 txh->MacTxControlLow = cpu_to_le16(mcl); in brcms_c_ampdu_finalize()
640 ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM]; in brcms_c_ampdu_finalize()
641 txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM] = 0; in brcms_c_ampdu_finalize()
642 session->ampdu_len -= ndelim * AMPDU_DELIMITER_LEN; in brcms_c_ampdu_finalize()
645 fbr_iscck = ((le16_to_cpu(txh->XtraFrameTypes) & 0x3) == 0); in brcms_c_ampdu_finalize()
646 len = fbr_iscck ? BRCMS_GET_CCK_PLCP_LEN(txh->FragPLCPFallback) : in brcms_c_ampdu_finalize()
647 BRCMS_GET_MIMO_PLCP_LEN(txh->FragPLCPFallback); in brcms_c_ampdu_finalize()
648 session->ampdu_len -= roundup(len, 4) - len; in brcms_c_ampdu_finalize()
652 txrate = tx_info->status.rates; in brcms_c_ampdu_finalize()
653 txh = (struct d11txh *)first->data; in brcms_c_ampdu_finalize()
655 rts = (struct ieee80211_rts *)&txh->rts_frame; in brcms_c_ampdu_finalize()
657 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_finalize()
664 if (ieee80211_is_rts(rts->frame_control)) { in brcms_c_ampdu_finalize()
668 if (ieee80211_is_cts(rts->frame_control)) { in brcms_c_ampdu_finalize()
672 txh->MacTxControlLow = cpu_to_le16(mcl); in brcms_c_ampdu_finalize()
678 plcp0 = txh->FragPLCPFallback[0]; in brcms_c_ampdu_finalize()
684 if (CHSPEC_SB_UPPER(wlc_phy_chanspec_get(wlc->band->pi))) in brcms_c_ampdu_finalize()
696 fbr_iscck = !(le16_to_cpu(txh->XtraFrameTypes) & 0x03); in brcms_c_ampdu_finalize()
699 cck_rspec(cck_phy2mac_rate(txh->FragPLCPFallback[0])); in brcms_c_ampdu_finalize()
702 rspec_fallback |= txh->FragPLCPFallback[0] & ~MIMO_PLCP_40MHZ; in brcms_c_ampdu_finalize()
703 if (txh->FragPLCPFallback[0] & MIMO_PLCP_40MHZ) in brcms_c_ampdu_finalize()
716 BRCMS_SET_MIMO_PLCP_LEN(plcp, session->ampdu_len); in brcms_c_ampdu_finalize()
721 if (txh->MModeLen) { in brcms_c_ampdu_finalize()
723 session->ampdu_len); in brcms_c_ampdu_finalize()
724 txh->MModeLen = cpu_to_le16(mmodelen); in brcms_c_ampdu_finalize()
727 if (txh->MModeFbrLen) { in brcms_c_ampdu_finalize()
729 session->ampdu_len); in brcms_c_ampdu_finalize()
730 txh->MModeFbrLen = cpu_to_le16(mmfbrlen); in brcms_c_ampdu_finalize()
735 if (mcs_2_rate(mcs, true, false) >= f->dmaxferrate) { in brcms_c_ampdu_finalize()
736 dma_len = min(dma_len, f->ampdu_pld_size); in brcms_c_ampdu_finalize()
737 txh->PreloadSize = cpu_to_le16(dma_len); in brcms_c_ampdu_finalize()
739 txh->PreloadSize = 0; in brcms_c_ampdu_finalize()
742 mch = le16_to_cpu(txh->MacTxControlHigh); in brcms_c_ampdu_finalize()
758 session->ampdu_len, true); in brcms_c_ampdu_finalize()
759 rts->duration = cpu_to_le16(durid); in brcms_c_ampdu_finalize()
765 session->ampdu_len, true); in brcms_c_ampdu_finalize()
766 txh->RTSDurFallback = cpu_to_le16(durid); in brcms_c_ampdu_finalize()
768 txh->TxFesTimeNormal = rts->duration; in brcms_c_ampdu_finalize()
770 txh->TxFesTimeFallback = txh->RTSDurFallback; in brcms_c_ampdu_finalize()
776 txh->MacTxControlHigh = cpu_to_le16(mch); in brcms_c_ampdu_finalize()
778 BRCMS_SET_MIMO_PLCP_AMPDU(txh->FragPLCPFallback); in brcms_c_ampdu_finalize()
781 brcms_dbg_ht(wlc->hw->d11core, "wl%d: count %d ampdu_len %d\n", in brcms_c_ampdu_finalize()
782 wlc->pub->unit, skb_queue_len(&session->skb_list), in brcms_c_ampdu_finalize()
783 session->ampdu_len); in brcms_c_ampdu_finalize()
791 struct ieee80211_tx_rate *txrate = tx_info->status.rates; in brcms_c_ampdu_rate_status()
796 txrate[i].idx = -1; in brcms_c_ampdu_rate_status()
807 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_dotxstatus_complete()
828 scb_ampdu = &scb->scb_ampdu; in brcms_c_ampdu_dotxstatus_complete()
829 tid = (u8) (p->priority); in brcms_c_ampdu_dotxstatus_complete()
831 ini = &scb_ampdu->ini[tid]; in brcms_c_ampdu_dotxstatus_complete()
832 retry_limit = ampdu->retry_limit_tid[tid]; in brcms_c_ampdu_dotxstatus_complete()
834 queue = txs->frameid & TXFID_QUEUE_MASK; in brcms_c_ampdu_dotxstatus_complete()
835 supr_status = txs->status & TX_STATUS_SUPR_MASK; in brcms_c_ampdu_dotxstatus_complete()
837 if (txs->status & TX_STATUS_ACK_RCV) { in brcms_c_ampdu_dotxstatus_complete()
838 WARN_ON(!(txs->status & TX_STATUS_INTERMEDIATE)); in brcms_c_ampdu_dotxstatus_complete()
839 start_seq = txs->sequence >> SEQNUM_SHIFT; in brcms_c_ampdu_dotxstatus_complete()
840 bitmap[0] = (txs->status & TX_STATUS_BA_BMAP03_MASK) >> in brcms_c_ampdu_dotxstatus_complete()
862 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
865 wlc->default_bss->chanspec)); in brcms_c_ampdu_dotxstatus_complete()
868 brcms_err(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
878 * try tuning pre-loading or ampdu size in brcms_c_ampdu_dotxstatus_complete()
882 * if there were underflows, but pre-loading in brcms_c_ampdu_dotxstatus_complete()
887 } else if (txs->phyerr) { in brcms_c_ampdu_dotxstatus_complete()
888 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
890 __func__, txs->phyerr); in brcms_c_ampdu_dotxstatus_complete()
897 txh = (struct d11txh *) p->data; in brcms_c_ampdu_dotxstatus_complete()
898 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_dotxstatus_complete()
901 seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT; in brcms_c_ampdu_dotxstatus_complete()
903 trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, sizeof(*txh)); in brcms_c_ampdu_dotxstatus_complete()
907 mimoantsel = le16_to_cpu(txh->ABI_MimoAntSel); in brcms_c_ampdu_dotxstatus_complete()
920 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
926 ini->txretry[index] = 0; in brcms_c_ampdu_dotxstatus_complete()
935 tx_info->flags |= IEEE80211_TX_STAT_ACK; in brcms_c_ampdu_dotxstatus_complete()
936 tx_info->flags |= IEEE80211_TX_STAT_AMPDU; in brcms_c_ampdu_dotxstatus_complete()
937 tx_info->status.ampdu_ack_len = in brcms_c_ampdu_dotxstatus_complete()
938 tx_info->status.ampdu_len = 1; in brcms_c_ampdu_dotxstatus_complete()
943 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, in brcms_c_ampdu_dotxstatus_complete()
950 if (retry && (ini->txretry[index] < (int)retry_limit)) { in brcms_c_ampdu_dotxstatus_complete()
952 ini->txretry[index]++; in brcms_c_ampdu_dotxstatus_complete()
963 tx_info->status.ampdu_ack_len = 0; in brcms_c_ampdu_dotxstatus_complete()
964 tx_info->status.ampdu_len = 1; in brcms_c_ampdu_dotxstatus_complete()
965 tx_info->flags |= in brcms_c_ampdu_dotxstatus_complete()
969 brcms_dbg_ht(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus_complete()
972 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, in brcms_c_ampdu_dotxstatus_complete()
983 p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED); in brcms_c_ampdu_dotxstatus_complete()
987 brcms_c_antsel_antsel2id(wlc->asi, mimoantsel); in brcms_c_ampdu_dotxstatus_complete()
994 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_dotxstatus()
1001 if (txs->status & TX_STATUS_ACK_RCV) { in brcms_c_ampdu_dotxstatus()
1005 s1 = bcma_read32(wlc->hw->d11core, D11REGOFFS(frmtxstatus)); in brcms_c_ampdu_dotxstatus()
1011 s1 = bcma_read32(wlc->hw->d11core, in brcms_c_ampdu_dotxstatus()
1015 s2 = bcma_read32(wlc->hw->d11core, D11REGOFFS(frmtxstatus2)); in brcms_c_ampdu_dotxstatus()
1022 u8 queue = txs->frameid & TXFID_QUEUE_MASK; in brcms_c_ampdu_dotxstatus()
1026 txh = (struct d11txh *) p->data; in brcms_c_ampdu_dotxstatus()
1027 trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, in brcms_c_ampdu_dotxstatus()
1029 mcl = le16_to_cpu(txh->MacTxControlLow); in brcms_c_ampdu_dotxstatus()
1035 p = dma_getnexttxp(wlc->hw->di[queue], in brcms_c_ampdu_dotxstatus()
1047 memcpy(template, wlc->pub->cur_etheraddr, ETH_ALEN); in brcms_c_ampdu_macaddr_upd()
1048 brcms_b_write_template_ram(wlc->hw, (T_BA_TPL_BASE + 16), in brcms_c_ampdu_macaddr_upd()
1055 return wlc->ampdu->ini_enable[tid]; in brcms_c_aggregatable()
1060 struct brcms_c_info *wlc = ampdu->wlc; in brcms_c_ampdu_shm_upd()
1066 if ((ampdu->rx_factor & IEEE80211_HT_AMPDU_PARM_FACTOR) == in brcms_c_ampdu_shm_upd()
1068 brcms_b_write_shm(wlc->hw, M_MIMO_MAXSYM, MIMO_MAXSYM_MAX); in brcms_c_ampdu_shm_upd()
1069 brcms_b_write_shm(wlc->hw, M_WATCHDOG_8TU, WATCHDOG_8TU_MAX); in brcms_c_ampdu_shm_upd()
1071 brcms_b_write_shm(wlc->hw, M_MIMO_MAXSYM, MIMO_MAXSYM_DEF); in brcms_c_ampdu_shm_upd()
1072 brcms_b_write_shm(wlc->hw, M_WATCHDOG_8TU, WATCHDOG_8TU_DEF); in brcms_c_ampdu_shm_upd()
1084 if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && in dma_cb_fn_ampdu()
1085 (tx_info->rate_driver_data[0] == sta || sta == NULL)) in dma_cb_fn_ampdu()
1086 tx_info->rate_driver_data[0] = NULL; in dma_cb_fn_ampdu()
1096 brcms_c_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu); in brcms_c_ampdu_flush()