Lines Matching refs:bf

596 ath5k_rxbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)
598 struct sk_buff *skb = bf->skb;
603 skb = ath5k_rx_skb_alloc(ah, &bf->skbaddr);
606 bf->skb = skb;
624 ds = bf->desc;
625 ds->ds_link = bf->daddr; /* link to self */
626 ds->ds_data = bf->skbaddr;
634 *ah->rxlink = bf->daddr;
663 ath5k_txbuf_setup(struct ath5k_hw *ah, struct ath5k_buf *bf,
666 struct ath5k_desc *ds = bf->desc;
667 struct sk_buff *skb = bf->skb;
681 bf->skbaddr = dma_map_single(ah->dev, skb->data, skb->len,
748 ds->ds_data = bf->skbaddr;
751 list_add_tail(&bf->list, &txq->q);
754 ath5k_hw_set_txdp(ah, txq->qnum, bf->daddr);
756 *txq->link = bf->daddr;
765 dma_unmap_single(ah->dev, bf->skbaddr, skb->len, DMA_TO_DEVICE);
777 struct ath5k_buf *bf;
798 bf = kcalloc(1 + ATH_TXBUF + ATH_RXBUF + ATH_BCBUF,
800 if (bf == NULL) {
805 ah->bufptr = bf;
808 for (i = 0; i < ATH_RXBUF; i++, bf++, ds++, da += sizeof(*ds)) {
809 bf->desc = ds;
810 bf->daddr = da;
811 list_add_tail(&bf->list, &ah->rxbuf);
816 for (i = 0; i < ATH_TXBUF; i++, bf++, ds++, da += sizeof(*ds)) {
817 bf->desc = ds;
818 bf->daddr = da;
819 list_add_tail(&bf->list, &ah->txbuf);
824 for (i = 0; i < ATH_BCBUF; i++, bf++, ds++, da += sizeof(*ds)) {
825 bf->desc = ds;
826 bf->daddr = da;
827 list_add_tail(&bf->list, &ah->bcbuf);
839 ath5k_txbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf)
841 BUG_ON(!bf);
842 if (!bf->skb)
844 dma_unmap_single(ah->dev, bf->skbaddr, bf->skb->len,
846 dev_kfree_skb_any(bf->skb);
847 bf->skb = NULL;
848 bf->skbaddr = 0;
849 bf->desc->ds_data = 0;
853 ath5k_rxbuf_free_skb(struct ath5k_hw *ah, struct ath5k_buf *bf)
857 BUG_ON(!bf);
858 if (!bf->skb)
860 dma_unmap_single(ah->dev, bf->skbaddr, common->rx_bufsize,
862 dev_kfree_skb_any(bf->skb);
863 bf->skb = NULL;
864 bf->skbaddr = 0;
865 bf->desc->ds_data = 0;
871 struct ath5k_buf *bf;
873 list_for_each_entry(bf, &ah->txbuf, list)
874 ath5k_txbuf_free_skb(ah, bf);
875 list_for_each_entry(bf, &ah->rxbuf, list)
876 ath5k_rxbuf_free_skb(ah, bf);
877 list_for_each_entry(bf, &ah->bcbuf, list)
878 ath5k_txbuf_free_skb(ah, bf);
1034 struct ath5k_buf *bf, *bf0;
1041 list_for_each_entry_safe(bf, bf0, &txq->q, list) {
1042 ath5k_debug_printtxbuf(ah, bf);
1044 ath5k_txbuf_free_skb(ah, bf);
1047 list_move_tail(&bf->list, &ah->txbuf);
1084 struct ath5k_buf *bf;
1094 list_for_each_entry(bf, &ah->rxbuf, list) {
1095 ret = ath5k_rxbuf_setup(ah, bf);
1101 bf = list_first_entry(&ah->rxbuf, struct ath5k_buf, list);
1102 ath5k_hw_set_rxdp(ah, bf->daddr);
1457 struct ath5k_buf *bf;
1467 bf = list_first_entry(&ah->rxbuf, struct ath5k_buf, list);
1468 BUG_ON(bf->skb == NULL);
1469 skb = bf->skb;
1470 ds = bf->desc;
1473 if (ath5k_hw_get_rxdp(ah) == bf->daddr)
1489 * If we can't replace bf->skb with a new skb under
1495 dma_unmap_single(ah->dev, bf->skbaddr,
1503 bf->skb = next_skb;
1504 bf->skbaddr = next_skb_addr;
1507 list_move_tail(&bf->list, &ah->rxbuf);
1508 } while (ath5k_rxbuf_setup(ah, bf) == 0);
1525 struct ath5k_buf *bf;
1553 bf = list_first_entry(&ah->txbuf, struct ath5k_buf, list);
1554 list_del(&bf->list);
1560 bf->skb = skb;
1562 if (ath5k_txbuf_setup(ah, bf, txq, padsize)) {
1563 bf->skb = NULL;
1565 list_add_tail(&bf->list, &ah->txbuf);
1641 struct ath5k_buf *bf, *bf0;
1647 list_for_each_entry_safe(bf, bf0, &txq->q, list) {
1652 if (bf->skb != NULL) {
1653 ds = bf->desc;
1665 skb = bf->skb;
1666 bf->skb = NULL;
1668 dma_unmap_single(ah->dev, bf->skbaddr, skb->len,
1679 if (ath5k_hw_get_txdp(ah, txq->qnum) != bf->daddr) {
1681 list_move_tail(&bf->list, &ah->txbuf);
1715 ath5k_beacon_setup(struct ath5k_hw *ah, struct ath5k_buf *bf)
1717 struct sk_buff *skb = bf->skb;
1725 bf->skbaddr = dma_map_single(ah->dev, skb->data, skb->len,
1729 (unsigned long long)bf->skbaddr);
1731 if (dma_mapping_error(ah->dev, bf->skbaddr)) {
1734 bf->skb = NULL;
1738 ds = bf->desc;
1743 ds->ds_link = bf->daddr; /* self-linked */
1773 ds->ds_data = bf->skbaddr;
1785 dma_unmap_single(ah->dev, bf->skbaddr, skb->len, DMA_TO_DEVICE);
1836 struct ath5k_buf *bf;
1887 bf = avf->bbuf;
1907 if (unlikely(bf->skb == NULL || ah->opmode == NL80211_IFTYPE_STATION ||
1909 ATH5K_WARN(ah, "bf=%p bf_skb=%p\n", bf, bf->skb);
1913 trace_ath5k_tx(ah, bf->skb, &ah->txqs[ah->bhalq]);
1915 ath5k_hw_set_txdp(ah, ah->bhalq, bf->daddr);
1918 ah->bhalq, (unsigned long long)bf->daddr, bf->desc);