aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2008-08-14 03:56:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:04 -0400
commit927e70e9244e6ecdc7c28bc5424b0b8c11dee314 (patch)
treeac2b65f0a465d39dc1f4811bf7cc53b9281219d5 /drivers
parentb14ecdd0afa4f616fcd1fcff4b902e15334256c7 (diff)
ath9k: Remove remaining occurences of ath_skb_map functions
Use direct pci functions instead. Also, use sc_ht_info.tx_chan_width directly and remove ath_cwm_macmode. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath9k/core.c27
-rw-r--r--drivers/net/wireless/ath9k/core.h9
-rw-r--r--drivers/net/wireless/ath9k/recv.c40
-rw-r--r--drivers/net/wireless/ath9k/xmit.c8
4 files changed, 24 insertions, 60 deletions
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index 9737775aad3c..a9e8ad053a30 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -314,7 +314,6 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
314{ 314{
315 struct ath_hal *ah = sc->sc_ah; 315 struct ath_hal *ah = sc->sc_ah;
316 bool fastcc = true, stopped; 316 bool fastcc = true, stopped;
317 enum ath9k_ht_macmode ht_macmode;
318 317
319 if (sc->sc_flags & SC_OP_INVALID) /* the device is invalid or removed */ 318 if (sc->sc_flags & SC_OP_INVALID) /* the device is invalid or removed */
320 return -EIO; 319 return -EIO;
@@ -328,8 +327,6 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
328 ath9k_hw_mhz2ieee(ah, hchan->channel, hchan->channelFlags), 327 ath9k_hw_mhz2ieee(ah, hchan->channel, hchan->channelFlags),
329 hchan->channel, hchan->channelFlags); 328 hchan->channel, hchan->channelFlags);
330 329
331 ht_macmode = ath_cwm_macmode(sc);
332
333 if (hchan->channel != sc->sc_ah->ah_curchan->channel || 330 if (hchan->channel != sc->sc_ah->ah_curchan->channel ||
334 hchan->channelFlags != sc->sc_ah->ah_curchan->channelFlags || 331 hchan->channelFlags != sc->sc_ah->ah_curchan->channelFlags ||
335 (sc->sc_flags & SC_OP_CHAINMASK_UPDATE) || 332 (sc->sc_flags & SC_OP_CHAINMASK_UPDATE) ||
@@ -357,10 +354,11 @@ int ath_set_channel(struct ath_softc *sc, struct ath9k_channel *hchan)
357 354
358 spin_lock_bh(&sc->sc_resetlock); 355 spin_lock_bh(&sc->sc_resetlock);
359 if (!ath9k_hw_reset(ah, hchan, 356 if (!ath9k_hw_reset(ah, hchan,
360 ht_macmode, sc->sc_tx_chainmask, 357 sc->sc_ht_info.tx_chan_width,
361 sc->sc_rx_chainmask, 358 sc->sc_tx_chainmask,
362 sc->sc_ht_extprotspacing, 359 sc->sc_rx_chainmask,
363 fastcc, &status)) { 360 sc->sc_ht_extprotspacing,
361 fastcc, &status)) {
364 DPRINTF(sc, ATH_DBG_FATAL, 362 DPRINTF(sc, ATH_DBG_FATAL,
365 "%s: unable to reset channel %u (%uMhz) " 363 "%s: unable to reset channel %u (%uMhz) "
366 "flags 0x%x hal status %u\n", __func__, 364 "flags 0x%x hal status %u\n", __func__,
@@ -682,7 +680,6 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
682 struct ath_hal *ah = sc->sc_ah; 680 struct ath_hal *ah = sc->sc_ah;
683 int status; 681 int status;
684 int error = 0; 682 int error = 0;
685 enum ath9k_ht_macmode ht_macmode = ath_cwm_macmode(sc);
686 683
687 DPRINTF(sc, ATH_DBG_CONFIG, "%s: mode %d\n", 684 DPRINTF(sc, ATH_DBG_CONFIG, "%s: mode %d\n",
688 __func__, sc->sc_ah->ah_opmode); 685 __func__, sc->sc_ah->ah_opmode);
@@ -709,9 +706,10 @@ int ath_open(struct ath_softc *sc, struct ath9k_channel *initial_chan)
709 */ 706 */
710 707
711 spin_lock_bh(&sc->sc_resetlock); 708 spin_lock_bh(&sc->sc_resetlock);
712 if (!ath9k_hw_reset(ah, initial_chan, ht_macmode, 709 if (!ath9k_hw_reset(ah, initial_chan,
713 sc->sc_tx_chainmask, sc->sc_rx_chainmask, 710 sc->sc_ht_info.tx_chan_width,
714 sc->sc_ht_extprotspacing, false, &status)) { 711 sc->sc_tx_chainmask, sc->sc_rx_chainmask,
712 sc->sc_ht_extprotspacing, false, &status)) {
715 DPRINTF(sc, ATH_DBG_FATAL, 713 DPRINTF(sc, ATH_DBG_FATAL,
716 "%s: unable to reset hardware; hal status %u " 714 "%s: unable to reset hardware; hal status %u "
717 "(freq %u flags 0x%x)\n", __func__, status, 715 "(freq %u flags 0x%x)\n", __func__, status,
@@ -788,7 +786,6 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
788 struct ath_hal *ah = sc->sc_ah; 786 struct ath_hal *ah = sc->sc_ah;
789 int status; 787 int status;
790 int error = 0; 788 int error = 0;
791 enum ath9k_ht_macmode ht_macmode = ath_cwm_macmode(sc);
792 789
793 ath9k_hw_set_interrupts(ah, 0); /* disable interrupts */ 790 ath9k_hw_set_interrupts(ah, 0); /* disable interrupts */
794 ath_draintxq(sc, retry_tx); /* stop xmit */ 791 ath_draintxq(sc, retry_tx); /* stop xmit */
@@ -798,9 +795,9 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
798 /* Reset chip */ 795 /* Reset chip */
799 spin_lock_bh(&sc->sc_resetlock); 796 spin_lock_bh(&sc->sc_resetlock);
800 if (!ath9k_hw_reset(ah, sc->sc_ah->ah_curchan, 797 if (!ath9k_hw_reset(ah, sc->sc_ah->ah_curchan,
801 ht_macmode, 798 sc->sc_ht_info.tx_chan_width,
802 sc->sc_tx_chainmask, sc->sc_rx_chainmask, 799 sc->sc_tx_chainmask, sc->sc_rx_chainmask,
803 sc->sc_ht_extprotspacing, false, &status)) { 800 sc->sc_ht_extprotspacing, false, &status)) {
804 DPRINTF(sc, ATH_DBG_FATAL, 801 DPRINTF(sc, ATH_DBG_FATAL,
805 "%s: unable to reset hardware; hal status %u\n", 802 "%s: unable to reset hardware; hal status %u\n",
806 __func__, status); 803 __func__, status);
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h
index c242942bbc18..51bf528e4c15 100644
--- a/drivers/net/wireless/ath9k/core.h
+++ b/drivers/net/wireless/ath9k/core.h
@@ -1023,14 +1023,5 @@ int ath_cabq_update(struct ath_softc *);
1023void ath_get_currentCountry(struct ath_softc *sc, 1023void ath_get_currentCountry(struct ath_softc *sc,
1024 struct ath9k_country_entry *ctry); 1024 struct ath9k_country_entry *ctry);
1025u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp); 1025u64 ath_extend_tsf(struct ath_softc *sc, u32 rstamp);
1026dma_addr_t ath_skb_map_single(struct ath_softc *sc,
1027 struct sk_buff *skb,
1028 int direction,
1029 dma_addr_t *pa);
1030void ath_skb_unmap_single(struct ath_softc *sc,
1031 struct sk_buff *skb,
1032 int direction,
1033 dma_addr_t *pa);
1034enum ath9k_ht_macmode ath_cwm_macmode(struct ath_softc *sc);
1035 1026
1036#endif /* CORE_H */ 1027#endif /* CORE_H */
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index af2011fb05a0..91f635411ab5 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -454,11 +454,10 @@ static int ath_rx_indicate(struct ath_softc *sc,
454 nskb = ath_rxbuf_alloc(sc, sc->sc_rxbufsize); 454 nskb = ath_rxbuf_alloc(sc, sc->sc_rxbufsize);
455 if (nskb != NULL) { 455 if (nskb != NULL) {
456 bf->bf_mpdu = nskb; 456 bf->bf_mpdu = nskb;
457 bf->bf_buf_addr = ath_skb_map_single(sc, 457 bf->bf_buf_addr = pci_map_single(sc->pdev, nskb->data,
458 nskb, 458 skb_end_pointer(nskb) - nskb->head,
459 PCI_DMA_FROMDEVICE, 459 PCI_DMA_FROMDEVICE);
460 /* XXX: Remove get_dma_mem_context() */ 460 bf->bf_dmacontext = bf->bf_buf_addr;
461 get_dma_mem_context(bf, bf_dmacontext));
462 ATH_RX_CONTEXT(nskb)->ctx_rxbuf = bf; 461 ATH_RX_CONTEXT(nskb)->ctx_rxbuf = bf;
463 462
464 /* queue the new wbuf to H/W */ 463 /* queue the new wbuf to H/W */
@@ -541,9 +540,10 @@ int ath_rx_init(struct ath_softc *sc, int nbufs)
541 } 540 }
542 541
543 bf->bf_mpdu = skb; 542 bf->bf_mpdu = skb;
544 bf->bf_buf_addr = 543 bf->bf_buf_addr = pci_map_single(sc->pdev, skb->data,
545 ath_skb_map_single(sc, skb, PCI_DMA_FROMDEVICE, 544 skb_end_pointer(skb) - skb->head,
546 get_dma_mem_context(bf, bf_dmacontext)); 545 PCI_DMA_FROMDEVICE);
546 bf->bf_dmacontext = bf->bf_buf_addr;
547 ATH_RX_CONTEXT(skb)->ctx_rxbuf = bf; 547 ATH_RX_CONTEXT(skb)->ctx_rxbuf = bf;
548 } 548 }
549 sc->sc_rxlink = NULL; 549 sc->sc_rxlink = NULL;
@@ -1297,27 +1297,3 @@ void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an)
1297{ 1297{
1298 ath_rx_node_cleanup(sc, an); 1298 ath_rx_node_cleanup(sc, an);
1299} 1299}
1300
1301dma_addr_t ath_skb_map_single(struct ath_softc *sc,
1302 struct sk_buff *skb,
1303 int direction,
1304 dma_addr_t *pa)
1305{
1306 /*
1307 * NB: do NOT use skb->len, which is 0 on initialization.
1308 * Use skb's entire data area instead.
1309 */
1310 *pa = pci_map_single(sc->pdev, skb->data,
1311 skb_end_pointer(skb) - skb->head, direction);
1312 return *pa;
1313}
1314
1315void ath_skb_unmap_single(struct ath_softc *sc,
1316 struct sk_buff *skb,
1317 int direction,
1318 dma_addr_t *pa)
1319{
1320 /* Unmap skb's entire data area */
1321 pci_unmap_single(sc->pdev, *pa,
1322 skb_end_pointer(skb) - skb->head, direction);
1323}
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index 55f3c8e5bbbc..8d31ad7952be 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -1427,7 +1427,6 @@ static void ath_drain_txdataq(struct ath_softc *sc, bool retry_tx)
1427 struct ath_hal *ah = sc->sc_ah; 1427 struct ath_hal *ah = sc->sc_ah;
1428 int i; 1428 int i;
1429 int npend = 0; 1429 int npend = 0;
1430 enum ath9k_ht_macmode ht_macmode = ath_cwm_macmode(sc);
1431 1430
1432 /* XXX return value */ 1431 /* XXX return value */
1433 if (!(sc->sc_flags & SC_OP_INVALID)) { 1432 if (!(sc->sc_flags & SC_OP_INVALID)) {
@@ -1452,9 +1451,10 @@ static void ath_drain_txdataq(struct ath_softc *sc, bool retry_tx)
1452 1451
1453 spin_lock_bh(&sc->sc_resetlock); 1452 spin_lock_bh(&sc->sc_resetlock);
1454 if (!ath9k_hw_reset(ah, 1453 if (!ath9k_hw_reset(ah,
1455 sc->sc_ah->ah_curchan, ht_macmode, 1454 sc->sc_ah->ah_curchan,
1456 sc->sc_tx_chainmask, sc->sc_rx_chainmask, 1455 sc->sc_ht_info.tx_chan_width,
1457 sc->sc_ht_extprotspacing, true, &status)) { 1456 sc->sc_tx_chainmask, sc->sc_rx_chainmask,
1457 sc->sc_ht_extprotspacing, true, &status)) {
1458 1458
1459 DPRINTF(sc, ATH_DBG_FATAL, 1459 DPRINTF(sc, ATH_DBG_FATAL,
1460 "%s: unable to reset hardware; hal status %u\n", 1460 "%s: unable to reset hardware; hal status %u\n",