aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2010-10-14 15:45:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-15 15:57:41 -0400
commitc1739eb3e61e160f124bc842c219011916f63068 (patch)
tree1fe33d6ce17e32e0fd3c845ccf1d6748f2dea87a /drivers/net/wireless
parent5161bec5a8b3509b8cf69418129a191cf90bbd87 (diff)
ath9k: Remove bf_dmacontext.
The bf_dmacontext seems to be totally useless and duplicated by bf_buf_addr. Remove it entirely, use bf_buf_addr in its place. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h3
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c11
4 files changed, 12 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index e435c1d38826..973c919fdd27 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -239,12 +239,11 @@ struct ath_buf {
239 struct sk_buff *bf_mpdu; /* enclosing frame structure */ 239 struct sk_buff *bf_mpdu; /* enclosing frame structure */
240 void *bf_desc; /* virtual addr of desc */ 240 void *bf_desc; /* virtual addr of desc */
241 dma_addr_t bf_daddr; /* physical addr of desc */ 241 dma_addr_t bf_daddr; /* physical addr of desc */
242 dma_addr_t bf_buf_addr; /* physical addr of data buffer */ 242 dma_addr_t bf_buf_addr; /* physical addr of data buffer, for DMA */
243 bool bf_stale; 243 bool bf_stale;
244 bool bf_tx_aborted; 244 bool bf_tx_aborted;
245 u16 bf_flags; 245 u16 bf_flags;
246 struct ath_buf_state bf_state; 246 struct ath_buf_state bf_state;
247 dma_addr_t bf_dmacontext;
248 struct ath_wiphy *aphy; 247 struct ath_wiphy *aphy;
249}; 248};
250 249
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 081192e78a46..af8fedda001b 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -136,7 +136,7 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
136 bf = avp->av_bcbuf; 136 bf = avp->av_bcbuf;
137 skb = bf->bf_mpdu; 137 skb = bf->bf_mpdu;
138 if (skb) { 138 if (skb) {
139 dma_unmap_single(sc->dev, bf->bf_dmacontext, 139 dma_unmap_single(sc->dev, bf->bf_buf_addr,
140 skb->len, DMA_TO_DEVICE); 140 skb->len, DMA_TO_DEVICE);
141 dev_kfree_skb_any(skb); 141 dev_kfree_skb_any(skb);
142 } 142 }
@@ -162,9 +162,8 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
162 hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no); 162 hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
163 } 163 }
164 164
165 bf->bf_buf_addr = bf->bf_dmacontext = 165 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data,
166 dma_map_single(sc->dev, skb->data, 166 skb->len, DMA_TO_DEVICE);
167 skb->len, DMA_TO_DEVICE);
168 if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { 167 if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
169 dev_kfree_skb_any(skb); 168 dev_kfree_skb_any(skb);
170 bf->bf_mpdu = NULL; 169 bf->bf_mpdu = NULL;
@@ -252,7 +251,7 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
252 bf = avp->av_bcbuf; 251 bf = avp->av_bcbuf;
253 if (bf->bf_mpdu != NULL) { 252 if (bf->bf_mpdu != NULL) {
254 skb = bf->bf_mpdu; 253 skb = bf->bf_mpdu;
255 dma_unmap_single(sc->dev, bf->bf_dmacontext, 254 dma_unmap_single(sc->dev, bf->bf_buf_addr,
256 skb->len, DMA_TO_DEVICE); 255 skb->len, DMA_TO_DEVICE);
257 dev_kfree_skb_any(skb); 256 dev_kfree_skb_any(skb);
258 bf->bf_mpdu = NULL; 257 bf->bf_mpdu = NULL;
@@ -296,9 +295,8 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif)
296 avp->tsf_adjust = cpu_to_le64(0); 295 avp->tsf_adjust = cpu_to_le64(0);
297 296
298 bf->bf_mpdu = skb; 297 bf->bf_mpdu = skb;
299 bf->bf_buf_addr = bf->bf_dmacontext = 298 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data,
300 dma_map_single(sc->dev, skb->data, 299 skb->len, DMA_TO_DEVICE);
301 skb->len, DMA_TO_DEVICE);
302 if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { 300 if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
303 dev_kfree_skb_any(skb); 301 dev_kfree_skb_any(skb);
304 bf->bf_mpdu = NULL; 302 bf->bf_mpdu = NULL;
@@ -324,7 +322,7 @@ void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp)
324 bf = avp->av_bcbuf; 322 bf = avp->av_bcbuf;
325 if (bf->bf_mpdu != NULL) { 323 if (bf->bf_mpdu != NULL) {
326 struct sk_buff *skb = bf->bf_mpdu; 324 struct sk_buff *skb = bf->bf_mpdu;
327 dma_unmap_single(sc->dev, bf->bf_dmacontext, 325 dma_unmap_single(sc->dev, bf->bf_buf_addr,
328 skb->len, DMA_TO_DEVICE); 326 skb->len, DMA_TO_DEVICE);
329 dev_kfree_skb_any(skb); 327 dev_kfree_skb_any(skb);
330 bf->bf_mpdu = NULL; 328 bf->bf_mpdu = NULL;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 7c90eaf9ec55..2e427522672d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -363,7 +363,6 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
363 error = -ENOMEM; 363 error = -ENOMEM;
364 goto err; 364 goto err;
365 } 365 }
366 bf->bf_dmacontext = bf->bf_buf_addr;
367 } 366 }
368 sc->rx.rxlink = NULL; 367 sc->rx.rxlink = NULL;
369 } 368 }
@@ -1739,7 +1738,6 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
1739 ath_rx_send_to_mac80211(hw, sc, skb, rxs); 1738 ath_rx_send_to_mac80211(hw, sc, skb, rxs);
1740 break; 1739 break;
1741 } 1740 }
1742 bf->bf_dmacontext = bf->bf_buf_addr;
1743 1741
1744 /* 1742 /*
1745 * change the default rx antenna if rx diversity chooses the 1743 * change the default rx antenna if rx diversity chooses the
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 9b17108adc7c..b053058ae5ea 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -294,7 +294,6 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf)
294 tbf->bf_buf_addr = bf->bf_buf_addr; 294 tbf->bf_buf_addr = bf->bf_buf_addr;
295 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); 295 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
296 tbf->bf_state = bf->bf_state; 296 tbf->bf_state = bf->bf_state;
297 tbf->bf_dmacontext = bf->bf_dmacontext;
298 297
299 return tbf; 298 return tbf;
300} 299}
@@ -1640,17 +1639,15 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
1640 1639
1641 bf->bf_mpdu = skb; 1640 bf->bf_mpdu = skb;
1642 1641
1643 bf->bf_dmacontext = dma_map_single(sc->dev, skb->data, 1642 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data,
1644 skb->len, DMA_TO_DEVICE); 1643 skb->len, DMA_TO_DEVICE);
1645 if (unlikely(dma_mapping_error(sc->dev, bf->bf_dmacontext))) { 1644 if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) {
1646 bf->bf_mpdu = NULL; 1645 bf->bf_mpdu = NULL;
1647 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL, 1646 ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
1648 "dma_mapping_error() on TX\n"); 1647 "dma_mapping_error() on TX\n");
1649 return -ENOMEM; 1648 return -ENOMEM;
1650 } 1649 }
1651 1650
1652 bf->bf_buf_addr = bf->bf_dmacontext;
1653
1654 bf->bf_tx_aborted = false; 1651 bf->bf_tx_aborted = false;
1655 1652
1656 return 0; 1653 return 0;
@@ -1914,7 +1911,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
1914 tx_flags |= ATH_TX_XRETRY; 1911 tx_flags |= ATH_TX_XRETRY;
1915 } 1912 }
1916 1913
1917 dma_unmap_single(sc->dev, bf->bf_dmacontext, skb->len, DMA_TO_DEVICE); 1914 dma_unmap_single(sc->dev, bf->bf_buf_addr, skb->len, DMA_TO_DEVICE);
1918 1915
1919 if (bf->bf_state.bfs_paprd) { 1916 if (bf->bf_state.bfs_paprd) {
1920 if (time_after(jiffies, 1917 if (time_after(jiffies,