diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-08-12 12:57:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:14:06 -0400 |
commit | aeb63cfd4ccc813c204a0d81ad6c5a90c33d8f61 (patch) | |
tree | d47ff31b81121f4935a9be60f6eafa11ff20d022 /drivers/net/wireless/ath | |
parent | d15dd3e5d74186a3b0a4db271b440bbdc0f6da36 (diff) |
ath5k: use common ath.ko ath_rxbuf_alloc()
Now that its shared we can remove ath5k's own implementation.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 21 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.h | 3 |
2 files changed, 9 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index acbcfc2a9f71..63c2b5714d2f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -544,7 +544,7 @@ ath5k_pci_probe(struct pci_dev *pdev, | |||
544 | __set_bit(ATH_STAT_INVALID, sc->status); | 544 | __set_bit(ATH_STAT_INVALID, sc->status); |
545 | 545 | ||
546 | sc->iobase = mem; /* So we can unmap it on detach */ | 546 | sc->iobase = mem; /* So we can unmap it on detach */ |
547 | sc->cachelsz = csz * sizeof(u32); /* convert to bytes */ | 547 | sc->common.cachelsz = csz * sizeof(u32); /* convert to bytes */ |
548 | sc->opmode = NL80211_IFTYPE_STATION; | 548 | sc->opmode = NL80211_IFTYPE_STATION; |
549 | sc->bintval = 1000; | 549 | sc->bintval = 1000; |
550 | mutex_init(&sc->lock); | 550 | mutex_init(&sc->lock); |
@@ -1151,27 +1151,20 @@ static | |||
1151 | struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr) | 1151 | struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr) |
1152 | { | 1152 | { |
1153 | struct sk_buff *skb; | 1153 | struct sk_buff *skb; |
1154 | unsigned int off; | ||
1155 | 1154 | ||
1156 | /* | 1155 | /* |
1157 | * Allocate buffer with headroom_needed space for the | 1156 | * Allocate buffer with headroom_needed space for the |
1158 | * fake physical layer header at the start. | 1157 | * fake physical layer header at the start. |
1159 | */ | 1158 | */ |
1160 | skb = dev_alloc_skb(sc->rxbufsize + sc->cachelsz - 1); | 1159 | skb = ath_rxbuf_alloc(&sc->common, |
1160 | sc->rxbufsize + sc->common.cachelsz - 1, | ||
1161 | GFP_ATOMIC); | ||
1161 | 1162 | ||
1162 | if (!skb) { | 1163 | if (!skb) { |
1163 | ATH5K_ERR(sc, "can't alloc skbuff of size %u\n", | 1164 | ATH5K_ERR(sc, "can't alloc skbuff of size %u\n", |
1164 | sc->rxbufsize + sc->cachelsz - 1); | 1165 | sc->rxbufsize + sc->common.cachelsz - 1); |
1165 | return NULL; | 1166 | return NULL; |
1166 | } | 1167 | } |
1167 | /* | ||
1168 | * Cache-line-align. This is important (for the | ||
1169 | * 5210 at least) as not doing so causes bogus data | ||
1170 | * in rx'd frames. | ||
1171 | */ | ||
1172 | off = ((unsigned long)skb->data) % sc->cachelsz; | ||
1173 | if (off != 0) | ||
1174 | skb_reserve(skb, sc->cachelsz - off); | ||
1175 | 1168 | ||
1176 | *skb_addr = pci_map_single(sc->pdev, | 1169 | *skb_addr = pci_map_single(sc->pdev, |
1177 | skb->data, sc->rxbufsize, PCI_DMA_FROMDEVICE); | 1170 | skb->data, sc->rxbufsize, PCI_DMA_FROMDEVICE); |
@@ -1613,10 +1606,10 @@ ath5k_rx_start(struct ath5k_softc *sc) | |||
1613 | struct ath5k_buf *bf; | 1606 | struct ath5k_buf *bf; |
1614 | int ret; | 1607 | int ret; |
1615 | 1608 | ||
1616 | sc->rxbufsize = roundup(IEEE80211_MAX_LEN, sc->cachelsz); | 1609 | sc->rxbufsize = roundup(IEEE80211_MAX_LEN, sc->common.cachelsz); |
1617 | 1610 | ||
1618 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "cachelsz %u rxbufsize %u\n", | 1611 | ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "cachelsz %u rxbufsize %u\n", |
1619 | sc->cachelsz, sc->rxbufsize); | 1612 | sc->common.cachelsz, sc->rxbufsize); |
1620 | 1613 | ||
1621 | spin_lock_bh(&sc->rxbuflock); | 1614 | spin_lock_bh(&sc->rxbuflock); |
1622 | sc->rxlink = NULL; | 1615 | sc->rxlink = NULL; |
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h index 667bd9dc1900..25a72a85aaa5 100644 --- a/drivers/net/wireless/ath/ath5k/base.h +++ b/drivers/net/wireless/ath/ath5k/base.h | |||
@@ -50,6 +50,7 @@ | |||
50 | 50 | ||
51 | #include "ath5k.h" | 51 | #include "ath5k.h" |
52 | #include "debug.h" | 52 | #include "debug.h" |
53 | #include "../ath.h" | ||
53 | 54 | ||
54 | #define ATH_RXBUF 40 /* number of RX buffers */ | 55 | #define ATH_RXBUF 40 /* number of RX buffers */ |
55 | #define ATH_TXBUF 200 /* number of TX buffers */ | 56 | #define ATH_TXBUF 200 /* number of TX buffers */ |
@@ -112,6 +113,7 @@ struct ath5k_rfkill { | |||
112 | * associated with an instance of a device */ | 113 | * associated with an instance of a device */ |
113 | struct ath5k_softc { | 114 | struct ath5k_softc { |
114 | struct pci_dev *pdev; /* for dma mapping */ | 115 | struct pci_dev *pdev; /* for dma mapping */ |
116 | struct ath_common common; | ||
115 | void __iomem *iobase; /* address of the device */ | 117 | void __iomem *iobase; /* address of the device */ |
116 | struct mutex lock; /* dev-level lock */ | 118 | struct mutex lock; /* dev-level lock */ |
117 | struct ieee80211_tx_queue_stats tx_stats[AR5K_NUM_TX_QUEUES]; | 119 | struct ieee80211_tx_queue_stats tx_stats[AR5K_NUM_TX_QUEUES]; |
@@ -134,7 +136,6 @@ struct ath5k_softc { | |||
134 | struct ath5k_desc *desc; /* TX/RX descriptors */ | 136 | struct ath5k_desc *desc; /* TX/RX descriptors */ |
135 | dma_addr_t desc_daddr; /* DMA (physical) address */ | 137 | dma_addr_t desc_daddr; /* DMA (physical) address */ |
136 | size_t desc_len; /* size of TX/RX descriptors */ | 138 | size_t desc_len; /* size of TX/RX descriptors */ |
137 | u16 cachelsz; /* cache line size */ | ||
138 | 139 | ||
139 | DECLARE_BITMAP(status, 5); | 140 | DECLARE_BITMAP(status, 5); |
140 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ | 141 | #define ATH_STAT_INVALID 0 /* disable hardware accesses */ |