Lines Matching refs:bf

628 ath5k_rxbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)  in ath5k_rxbuf_setup()  argument
630 struct sk_buff *skb = bf->skb; in ath5k_rxbuf_setup()
635 skb = ath5k_rx_skb_alloc(ah, &bf->skbaddr); in ath5k_rxbuf_setup()
638 bf->skb = skb; in ath5k_rxbuf_setup()
656 ds = bf->desc; in ath5k_rxbuf_setup()
657 ds->ds_link = bf->daddr; /* link to self */ in ath5k_rxbuf_setup()
658 ds->ds_data = bf->skbaddr; in ath5k_rxbuf_setup()
666 *ah->rxlink = bf->daddr; in ath5k_rxbuf_setup()
697 struct ath5k_buf *bf, int idx) in ath5k_get_rate() argument
703 if (bf->rates[idx].idx < 0) { in ath5k_get_rate()
707 return &hw->wiphy->bands[info->band]->bitrates[ bf->rates[idx].idx ]; in ath5k_get_rate()
713 struct ath5k_buf *bf, int idx) in ath5k_get_rate_hw_value() argument
719 rate = ath5k_get_rate(hw, info, bf, idx); in ath5k_get_rate_hw_value()
723 rc_flags = bf->rates[idx].flags; in ath5k_get_rate_hw_value()
731 struct ath5k_buf *bf, in ath5k_merge_ratetbl() argument
749 bf->rates[0] = tx_info->control.rates[0]; in ath5k_merge_ratetbl()
754 bf->rates[i].idx = ratetbl->rate[i].idx; in ath5k_merge_ratetbl()
755 bf->rates[i].flags = ratetbl->rate[i].flags; in ath5k_merge_ratetbl()
757 bf->rates[i].count = ratetbl->rate[i].count_rts; in ath5k_merge_ratetbl()
759 bf->rates[i].count = ratetbl->rate[i].count_cts; in ath5k_merge_ratetbl()
761 bf->rates[i].count = ratetbl->rate[i].count; in ath5k_merge_ratetbl()
768 ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf, in ath5k_txbuf_setup() argument
772 struct ath5k_desc *ds = bf->desc; in ath5k_txbuf_setup()
773 struct sk_buff *skb = bf->skb; in ath5k_txbuf_setup()
788 bf->skbaddr = dma_map_single(ah->dev, skb->data, skb->len, in ath5k_txbuf_setup()
791 if (dma_mapping_error(ah->dev, bf->skbaddr)) in ath5k_txbuf_setup()
799 if (!ath5k_merge_ratetbl(sta, bf, info)) { in ath5k_txbuf_setup()
801 sta, skb, bf->rates, in ath5k_txbuf_setup()
802 ARRAY_SIZE(bf->rates)); in ath5k_txbuf_setup()
805 rate = ath5k_get_rate(ah->hw, info, bf, 0); in ath5k_txbuf_setup()
815 rc_flags = bf->rates[0].flags; in ath5k_txbuf_setup()
817 hw_rate = ath5k_get_rate_hw_value(ah->hw, info, bf, 0); in ath5k_txbuf_setup()
846 bf->rates[0].count, keyidx, ah->ah_tx_ant, flags, in ath5k_txbuf_setup()
858 rate = ath5k_get_rate(ah->hw, info, bf, i); in ath5k_txbuf_setup()
862 mrr_rate[i] = ath5k_get_rate_hw_value(ah->hw, info, bf, i); in ath5k_txbuf_setup()
863 mrr_tries[i] = bf->rates[i].count; in ath5k_txbuf_setup()
873 ds->ds_data = bf->skbaddr; in ath5k_txbuf_setup()
876 list_add_tail(&bf->list, &txq->q); in ath5k_txbuf_setup()
879 ath5k_hw_set_txdp(ah, txq->qnum, bf->daddr); in ath5k_txbuf_setup()
881 *txq->link = bf->daddr; in ath5k_txbuf_setup()
889 dma_unmap_single(ah->dev, bf->skbaddr, skb->len, DMA_TO_DEVICE); in ath5k_txbuf_setup()
901 struct ath5k_buf *bf; in ath5k_desc_alloc() local
922 bf = kcalloc(1 + ATH_TXBUF + ATH_RXBUF + ATH_BCBUF, in ath5k_desc_alloc()
924 if (bf == NULL) { in ath5k_desc_alloc()
929 ah->bufptr = bf; in ath5k_desc_alloc()
932 for (i = 0; i < ATH_RXBUF; i++, bf++, ds++, da += sizeof(*ds)) { in ath5k_desc_alloc()
933 bf->desc = ds; in ath5k_desc_alloc()
934 bf->daddr = da; in ath5k_desc_alloc()
935 list_add_tail(&bf->list, &ah->rxbuf); in ath5k_desc_alloc()
940 for (i = 0; i < ATH_TXBUF; i++, bf++, ds++, da += sizeof(*ds)) { in ath5k_desc_alloc()
941 bf->desc = ds; in ath5k_desc_alloc()
942 bf->daddr = da; in ath5k_desc_alloc()
943 list_add_tail(&bf->list, &ah->txbuf); in ath5k_desc_alloc()
948 for (i = 0; i < ATH_BCBUF; i++, bf++, ds++, da += sizeof(*ds)) { in ath5k_desc_alloc()
949 bf->desc = ds; in ath5k_desc_alloc()
950 bf->daddr = da; in ath5k_desc_alloc()
951 list_add_tail(&bf->list, &ah->bcbuf); in ath5k_desc_alloc()
963 ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf) in ath5k_txbuf_free_skb() argument
965 BUG_ON(!bf); in ath5k_txbuf_free_skb()
966 if (!bf->skb) in ath5k_txbuf_free_skb()
968 dma_unmap_single(ah->dev, bf->skbaddr, bf->skb->len, in ath5k_txbuf_free_skb()
970 ieee80211_free_txskb(ah->hw, bf->skb); in ath5k_txbuf_free_skb()
971 bf->skb = NULL; in ath5k_txbuf_free_skb()
972 bf->skbaddr = 0; in ath5k_txbuf_free_skb()
973 bf->desc->ds_data = 0; in ath5k_txbuf_free_skb()
977 ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf) in ath5k_rxbuf_free_skb() argument
981 BUG_ON(!bf); in ath5k_rxbuf_free_skb()
982 if (!bf->skb) in ath5k_rxbuf_free_skb()
984 dma_unmap_single(ah->dev, bf->skbaddr, common->rx_bufsize, in ath5k_rxbuf_free_skb()
986 dev_kfree_skb_any(bf->skb); in ath5k_rxbuf_free_skb()
987 bf->skb = NULL; in ath5k_rxbuf_free_skb()
988 bf->skbaddr = 0; in ath5k_rxbuf_free_skb()
989 bf->desc->ds_data = 0; in ath5k_rxbuf_free_skb()
995 struct ath5k_buf *bf; in ath5k_desc_free() local
997 list_for_each_entry(bf, &ah->txbuf, list) in ath5k_desc_free()
998 ath5k_txbuf_free_skb(ah, bf); in ath5k_desc_free()
999 list_for_each_entry(bf, &ah->rxbuf, list) in ath5k_desc_free()
1000 ath5k_rxbuf_free_skb(ah, bf); in ath5k_desc_free()
1001 list_for_each_entry(bf, &ah->bcbuf, list) in ath5k_desc_free()
1002 ath5k_txbuf_free_skb(ah, bf); in ath5k_desc_free()
1158 struct ath5k_buf *bf, *bf0; in ath5k_drain_tx_buffs() local
1165 list_for_each_entry_safe(bf, bf0, &txq->q, list) { in ath5k_drain_tx_buffs()
1166 ath5k_debug_printtxbuf(ah, bf); in ath5k_drain_tx_buffs()
1168 ath5k_txbuf_free_skb(ah, bf); in ath5k_drain_tx_buffs()
1171 list_move_tail(&bf->list, &ah->txbuf); in ath5k_drain_tx_buffs()
1208 struct ath5k_buf *bf; in ath5k_rx_start() local
1218 list_for_each_entry(bf, &ah->rxbuf, list) { in ath5k_rx_start()
1219 ret = ath5k_rxbuf_setup(ah, bf); in ath5k_rx_start()
1225 bf = list_first_entry(&ah->rxbuf, struct ath5k_buf, list); in ath5k_rx_start()
1226 ath5k_hw_set_rxdp(ah, bf->daddr); in ath5k_rx_start()
1591 struct ath5k_buf *bf; in ath5k_tasklet_rx() local
1601 bf = list_first_entry(&ah->rxbuf, struct ath5k_buf, list); in ath5k_tasklet_rx()
1602 BUG_ON(bf->skb == NULL); in ath5k_tasklet_rx()
1603 skb = bf->skb; in ath5k_tasklet_rx()
1604 ds = bf->desc; in ath5k_tasklet_rx()
1607 if (ath5k_hw_get_rxdp(ah) == bf->daddr) in ath5k_tasklet_rx()
1629 dma_unmap_single(ah->dev, bf->skbaddr, in ath5k_tasklet_rx()
1637 bf->skb = next_skb; in ath5k_tasklet_rx()
1638 bf->skbaddr = next_skb_addr; in ath5k_tasklet_rx()
1641 list_move_tail(&bf->list, &ah->rxbuf); in ath5k_tasklet_rx()
1642 } while (ath5k_rxbuf_setup(ah, bf) == 0); in ath5k_tasklet_rx()
1659 struct ath5k_buf *bf; in ath5k_tx_queue() local
1687 bf = list_first_entry(&ah->txbuf, struct ath5k_buf, list); in ath5k_tx_queue()
1688 list_del(&bf->list); in ath5k_tx_queue()
1694 bf->skb = skb; in ath5k_tx_queue()
1696 if (ath5k_txbuf_setup(ah, bf, txq, padsize, control)) { in ath5k_tx_queue()
1697 bf->skb = NULL; in ath5k_tx_queue()
1699 list_add_tail(&bf->list, &ah->txbuf); in ath5k_tx_queue()
1713 struct ath5k_buf *bf) in ath5k_tx_frame_completed() argument
1724 size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates)); in ath5k_tx_frame_completed()
1725 memcpy(info->status.rates, bf->rates, size); in ath5k_tx_frame_completed()
1780 struct ath5k_buf *bf, *bf0; in ath5k_tx_processq() local
1786 list_for_each_entry_safe(bf, bf0, &txq->q, list) { in ath5k_tx_processq()
1791 if (bf->skb != NULL) { in ath5k_tx_processq()
1792 ds = bf->desc; in ath5k_tx_processq()
1804 skb = bf->skb; in ath5k_tx_processq()
1805 bf->skb = NULL; in ath5k_tx_processq()
1807 dma_unmap_single(ah->dev, bf->skbaddr, skb->len, in ath5k_tx_processq()
1809 ath5k_tx_frame_completed(ah, skb, txq, &ts, bf); in ath5k_tx_processq()
1818 if (ath5k_hw_get_txdp(ah, txq->qnum) != bf->daddr) { in ath5k_tx_processq()
1820 list_move_tail(&bf->list, &ah->txbuf); in ath5k_tx_processq()
1854 ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf) in ath5k_beacon_setup() argument
1856 struct sk_buff *skb = bf->skb; in ath5k_beacon_setup()
1864 bf->skbaddr = dma_map_single(ah->dev, skb->data, skb->len, in ath5k_beacon_setup()
1868 (unsigned long long)bf->skbaddr); in ath5k_beacon_setup()
1870 if (dma_mapping_error(ah->dev, bf->skbaddr)) { in ath5k_beacon_setup()
1873 bf->skb = NULL; in ath5k_beacon_setup()
1877 ds = bf->desc; in ath5k_beacon_setup()
1882 ds->ds_link = bf->daddr; /* self-linked */ in ath5k_beacon_setup()
1912 ds->ds_data = bf->skbaddr; in ath5k_beacon_setup()
1925 dma_unmap_single(ah->dev, bf->skbaddr, skb->len, DMA_TO_DEVICE); in ath5k_beacon_setup()
1977 struct ath5k_buf *bf; in ath5k_beacon_send() local
2028 bf = avf->bbuf; in ath5k_beacon_send()
2048 if (unlikely(bf->skb == NULL || ah->opmode == NL80211_IFTYPE_STATION || in ath5k_beacon_send()
2050 ATH5K_WARN(ah, "bf=%p bf_skb=%p\n", bf, bf->skb); in ath5k_beacon_send()
2054 trace_ath5k_tx(ah, bf->skb, &ah->txqs[ah->bhalq]); in ath5k_beacon_send()
2056 ath5k_hw_set_txdp(ah, ah->bhalq, bf->daddr); in ath5k_beacon_send()
2059 ah->bhalq, (unsigned long long)bf->daddr, bf->desc); in ath5k_beacon_send()