• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/wireless/ath/ath9k/

Lines Matching defs:bf

54 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
59 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf);
60 static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf,
62 static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
146 struct ath_buf *bf;
156 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
157 list_move_tail(&bf->list, &bf_head);
159 if (bf_isretried(bf)) {
160 ath_tx_update_baw(sc, tid, bf->bf_seqno);
161 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
187 struct ath_buf *bf)
191 if (bf_isretried(bf))
194 index = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno);
198 tid->tx_buf[cindex] = bf;
217 struct ath_buf *bf;
228 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
229 list_move_tail(&bf->list, &bf_head);
231 if (bf_isretried(bf))
232 ath_tx_update_baw(sc, tid, bf->bf_seqno);
235 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
244 struct ath_buf *bf)
249 bf->bf_state.bf_type |= BUF_RETRY;
250 bf->bf_retries++;
253 skb = bf->bf_mpdu;
260 struct ath_buf *bf = NULL;
269 bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list);
270 list_del(&bf->list);
274 return bf;
277 static void ath_tx_return_buffer(struct ath_softc *sc, struct ath_buf *bf)
280 list_add_tail(&bf->list, &sc->tx.txbuf);
284 static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf)
294 tbf->aphy = bf->aphy;
295 tbf->bf_mpdu = bf->bf_mpdu;
296 tbf->bf_buf_addr = bf->bf_buf_addr;
297 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
298 tbf->bf_state = bf->bf_state;
299 tbf->bf_dmacontext = bf->bf_dmacontext;
305 struct ath_buf *bf, struct list_head *bf_q,
315 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
324 skb = bf->bf_mpdu;
328 hw = bf->aphy->hw;
331 nframes = bf->bf_nframes;
340 while (bf) {
341 bf_next = bf->bf_next;
343 bf->bf_state.bf_type |= BUF_XRETRY;
345 !bf->bf_stale || bf_next != NULL)
346 list_move_tail(&bf->list, &bf_head);
348 ath_tx_rc_status(bf, ts, 1, 0, false);
349 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
352 bf = bf_next;
358 tid = ATH_AN_2_TID(an, bf->bf_tidno);
365 if (bf->bf_tidno != ts->tid)
368 isaggr = bf_isaggr(bf);
391 nbad = ath_tx_num_badfrms(sc, bf, ts, txok);
392 while (bf) {
394 bf_next = bf->bf_next;
396 skb = bf->bf_mpdu;
399 if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, bf->bf_seqno))) {
409 if (bf->bf_retries < ATH_MAX_SW_RETRIES) {
410 ath_tx_set_retry(sc, txq, bf);
413 bf->bf_state.bf_type |= BUF_XRETRY;
434 list_move_tail(&bf->list, &bf_head);
439 list_move_tail(&bf->list, &bf_head);
448 ath_tx_update_baw(sc, tid, bf->bf_seqno);
453 bf->bf_nframes = nframes;
454 ath_tx_rc_status(bf, ts, nbad, txok, true);
457 ath_tx_rc_status(bf, ts, nbad, txok, false);
460 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
465 if (bf->bf_next == NULL && bf_last->bf_stale) {
477 bf->bf_seqno);
480 bf->bf_state.bf_type |=
482 ath_tx_rc_status(bf, ts, nbad,
484 ath_tx_complete_buf(sc, bf, txq,
499 bf->bf_desc);
510 bf = bf_next;
536 static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
546 skb = bf->bf_mpdu;
609 struct ath_buf *bf, u16 frmlen)
611 struct sk_buff *skb = bf->bf_mpdu;
627 if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR)
674 struct ath_buf *bf, *bf_first, *bf_prev = NULL;
683 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
686 if (!BAW_WITHIN(tid->seq_start, tid->baw_size, bf->bf_seqno)) {
692 aggr_limit = ath_lookup_rate(sc, bf, tid);
697 al_delta = ATH_AGGR_DELIM_SZ + bf->bf_frmlen;
719 ndelim = ath_compute_num_delims(sc, tid, bf_first, bf->bf_frmlen);
722 bf->bf_next = NULL;
723 ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, 0);
726 ath_tx_addto_baw(sc, tid, bf);
727 ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim);
728 list_move_tail(&bf->list, bf_q);
730 bf_prev->bf_next = bf;
732 bf->bf_daddr);
734 bf_prev = bf;
748 struct ath_buf *bf;
767 bf = list_first_entry(&bf_q, struct ath_buf, list);
768 bf->bf_lastbf = list_entry(bf_q.prev, struct ath_buf, list);
771 if (bf->bf_nframes == 1) {
772 bf->bf_state.bf_type &= ~BUF_AGGR;
773 ath9k_hw_clr11n_aggr(sc->sc_ah, bf->bf_desc);
774 ath_buf_set_rate(sc, bf);
780 bf->bf_state.bf_type |= BUF_AGGR;
781 ath_buf_set_rate(sc, bf);
782 ath9k_hw_set11n_aggr_first(sc->sc_ah, bf->bf_desc, bf->bf_al);
785 ath9k_hw_set11n_aggr_last(sc->sc_ah, bf->bf_lastbf->bf_desc);
1033 struct ath_buf *bf, *lastbf;
1049 bf = list_first_entry(&txq->txq_fifo[txq->txq_tailidx],
1058 bf = list_first_entry(&txq->axq_q, struct ath_buf,
1061 if (bf->bf_stale) {
1062 list_del(&bf->list);
1065 ath_tx_return_buffer(sc, bf);
1070 lastbf = bf->bf_lastbf;
1088 if (bf_isampdu(bf))
1089 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0);
1091 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
1101 bf = list_first_entry(&txq->txq_fifo_pending,
1105 &bf->bf_lastbf->list);
1108 if (bf_isampdu(bf))
1109 ath_tx_complete_aggr(sc, txq, bf, &bf_head,
1112 ath_tx_complete_buf(sc, bf, txq, &bf_head,
1252 struct ath_buf *bf;
1262 bf = list_first_entry(head, struct ath_buf, list);
1280 ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
1283 txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc);
1288 ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
1291 txq->axq_qnum, ito64(bf->bf_daddr),
1292 bf->bf_desc);
1294 *txq->axq_link = bf->bf_daddr;
1298 ito64(bf->bf_daddr), bf->bf_desc);
1300 ath9k_hw_get_desc_link(ah, bf->bf_lastbf->bf_desc,
1311 struct ath_buf *bf;
1313 bf = list_first_entry(bf_head, struct ath_buf, list);
1314 bf->bf_state.bf_type |= BUF_AMPDU;
1325 !BAW_WITHIN(tid->seq_start, tid->baw_size, bf->bf_seqno) ||
1331 list_move_tail(&bf->list, &tid->buf_q);
1337 ath_tx_addto_baw(sc, tid, bf);
1340 bf->bf_nframes = 1;
1341 bf->bf_lastbf = bf;
1342 ath_buf_set_rate(sc, bf);
1350 struct ath_buf *bf;
1352 bf = list_first_entry(bf_head, struct ath_buf, list);
1353 bf->bf_state.bf_type &= ~BUF_AMPDU;
1358 bf->bf_nframes = 1;
1359 bf->bf_lastbf = bf;
1360 ath_buf_set_rate(sc, bf);
1368 struct ath_buf *bf;
1370 bf = list_first_entry(bf_head, struct ath_buf, list);
1372 bf->bf_lastbf = bf;
1373 bf->bf_nframes = 1;
1374 ath_buf_set_rate(sc, bf);
1419 struct ath_buf *bf)
1437 bf->bf_tidno = qc[0] & 0xf;
1445 tid = ATH_AN_2_TID(an, bf->bf_tidno);
1447 bf->bf_seqno = tid->seq_next;
1474 static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf,
1480 pktlen = bf_isaggr(bf) ? bf->bf_al : bf->bf_frmlen;
1499 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
1514 skb = bf->bf_mpdu;
1541 if ((sc->config.ath_aggr_prot && bf_isaggr(bf)) ||
1562 series[i].PktDuration = ath_pkt_duration(sc, rix, bf,
1586 phy, rate->bitrate * 100, bf->bf_frmlen, rix, is_sp);
1590 if (bf_isaggr(bf) && (bf->bf_al > sc->sc_ah->caps.rts_aggr_limit))
1598 ath9k_hw_set11n_ratescenario(sc->sc_ah, bf->bf_desc,
1599 bf->bf_lastbf->bf_desc,
1604 ath9k_hw_set11n_burstduration(sc->sc_ah, bf->bf_desc, 8192);
1607 static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
1634 ATH_TXBUF_RESET(bf);
1636 bf->aphy = aphy;
1637 bf->bf_frmlen = skb->len + FCS_LEN;
1642 bf->bf_frmlen -= padsize;
1646 bf->bf_state.bf_type |= BUF_HT;
1651 bf->bf_state.bfs_paprd = txctl->paprd;
1653 bf->bf_state.bfs_paprd_timestamp = jiffies;
1654 bf->bf_flags = setup_tx_flags(skb, use_ldpc);
1656 bf->bf_keytype = get_hw_crypto_keytype(skb);
1657 if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR) {
1658 bf->bf_frmlen += tx_info->control.hw_key->icv_len;
1659 bf->bf_keyix = tx_info->control.hw_key->hw_key_idx;
1661 bf->bf_keyix = ATH9K_TXKEYIX_INVALID;
1664 if (ieee80211_is_data_qos(fc) && bf_isht(bf) &&
1666 assign_aggr_tid_seqno(skb, bf);
1668 bf->bf_mpdu = skb;
1670 bf->bf_dmacontext = dma_map_single(sc->dev, skb->data,
1672 if (unlikely(dma_mapping_error(sc->dev, bf->bf_dmacontext))) {
1673 bf->bf_mpdu = NULL;
1679 bf->bf_buf_addr = bf->bf_dmacontext;
1683 bf->bf_isnullfunc = true;
1686 bf->bf_isnullfunc = false;
1688 bf->bf_tx_aborted = false;
1693 static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
1696 struct sk_buff *skb = bf->bf_mpdu;
1711 list_add_tail(&bf->list, &bf_head);
1713 ds = bf->bf_desc;
1716 ath9k_hw_set11n_txdesc(ah, ds, bf->bf_frmlen, frm_type, MAX_RATE_POWER,
1717 bf->bf_keyix, bf->bf_keytype, bf->bf_flags);
1724 bf->bf_buf_addr,
1727 if (bf->bf_state.bfs_paprd)
1728 ar9003_hw_set_paprd_txdesc(ah, ds, bf->bf_state.bfs_paprd);
1732 if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR) &&
1735 tid = ATH_AN_2_TID(an, bf->bf_tidno);
1772 struct ath_buf *bf;
1775 bf = ath_tx_get_buffer(sc);
1776 if (!bf) {
1781 r = ath_tx_setup_buffer(hw, bf, skb, txctl);
1796 ath_tx_return_buffer(sc, bf);
1812 ath_tx_start_dma(sc, bf, txctl);
1927 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
1931 struct sk_buff *skb = bf->bf_mpdu;
1941 if (bf_isxretried(bf))
1945 dma_unmap_single(sc->dev, bf->bf_dmacontext, skb->len, DMA_TO_DEVICE);
1947 if (bf->bf_state.bfs_paprd) {
1949 bf->bf_state.bfs_paprd_timestamp +
1955 ath_tx_complete(sc, skb, bf->aphy, tx_flags);
1956 ath_debug_stat_tx(sc, txq, bf, ts);
1967 static int ath_tx_num_badfrms(struct ath_softc *sc, struct ath_buf *bf,
1976 if (bf->bf_lastbf->bf_tx_aborted)
1979 isaggr = bf_isaggr(bf);
1985 while (bf) {
1986 ba_index = ATH_BA_INDEX(seq_st, bf->bf_seqno);
1990 bf = bf->bf_next;
1996 static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
1999 struct sk_buff *skb = bf->bf_mpdu;
2002 struct ieee80211_hw *hw = bf->aphy->hw;
2016 BUG_ON(nbad > bf->bf_nframes);
2018 tx_info->status.ampdu_len = bf->bf_nframes;
2019 tx_info->status.ampdu_ack_len = bf->bf_nframes - nbad;
2023 (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0 && update_rc) {
2062 struct ath_buf *bf, *lastbf, *bf_held = NULL;
2080 bf = list_first_entry(&txq->axq_q, struct ath_buf, list);
2091 if (bf->bf_stale) {
2092 bf_held = bf;
2097 bf = list_entry(bf_held->list.next,
2102 lastbf = bf->bf_lastbf;
2116 if (bf->bf_isnullfunc &&
2145 if (!bf_isampdu(bf)) {
2151 bf->bf_state.bf_type |= BUF_XRETRY;
2152 ath_tx_rc_status(bf, &ts, txok ? 0 : 1, txok, true);
2155 if (bf_isampdu(bf))
2156 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, txok);
2158 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, txok, 0);
2226 struct ath_buf *bf, *lastbf;
2253 bf = list_first_entry(&txq->txq_fifo[txq->txq_tailidx],
2255 lastbf = bf->bf_lastbf;
2271 if (bf->bf_isnullfunc && txok) {
2278 if (!bf_isampdu(bf)) {
2280 bf->bf_state.bf_type |= BUF_XRETRY;
2281 ath_tx_rc_status(bf, &txs, txok ? 0 : 1, txok, true);
2284 if (bf_isampdu(bf))
2285 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &txs, txok);
2287 ath_tx_complete_buf(sc, bf, txq, &bf_head,
2295 bf = list_first_entry(&txq->txq_fifo_pending,
2298 &bf->bf_lastbf->list);