aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath5k')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c32
-rw-r--r--drivers/net/wireless/ath/ath5k/base.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c2
3 files changed, 21 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index cb3dc892d697..a4c086f069b1 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -323,10 +323,13 @@ static inline void ath5k_txbuf_free(struct ath5k_softc *sc,
323static inline void ath5k_rxbuf_free(struct ath5k_softc *sc, 323static inline void ath5k_rxbuf_free(struct ath5k_softc *sc,
324 struct ath5k_buf *bf) 324 struct ath5k_buf *bf)
325{ 325{
326 struct ath5k_hw *ah = sc->ah;
327 struct ath_common *common = ath5k_hw_common(ah);
328
326 BUG_ON(!bf); 329 BUG_ON(!bf);
327 if (!bf->skb) 330 if (!bf->skb)
328 return; 331 return;
329 pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize, 332 pci_unmap_single(sc->pdev, bf->skbaddr, common->rx_bufsize,
330 PCI_DMA_FROMDEVICE); 333 PCI_DMA_FROMDEVICE);
331 dev_kfree_skb_any(bf->skb); 334 dev_kfree_skb_any(bf->skb);
332 bf->skb = NULL; 335 bf->skb = NULL;
@@ -1181,17 +1184,18 @@ struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr)
1181 * fake physical layer header at the start. 1184 * fake physical layer header at the start.
1182 */ 1185 */
1183 skb = ath_rxbuf_alloc(common, 1186 skb = ath_rxbuf_alloc(common,
1184 sc->rxbufsize + common->cachelsz - 1, 1187 common->rx_bufsize,
1185 GFP_ATOMIC); 1188 GFP_ATOMIC);
1186 1189
1187 if (!skb) { 1190 if (!skb) {
1188 ATH5K_ERR(sc, "can't alloc skbuff of size %u\n", 1191 ATH5K_ERR(sc, "can't alloc skbuff of size %u\n",
1189 sc->rxbufsize + common->cachelsz - 1); 1192 common->rx_bufsize);
1190 return NULL; 1193 return NULL;
1191 } 1194 }
1192 1195
1193 *skb_addr = pci_map_single(sc->pdev, 1196 *skb_addr = pci_map_single(sc->pdev,
1194 skb->data, sc->rxbufsize, PCI_DMA_FROMDEVICE); 1197 skb->data, common->rx_bufsize,
1198 PCI_DMA_FROMDEVICE);
1195 if (unlikely(pci_dma_mapping_error(sc->pdev, *skb_addr))) { 1199 if (unlikely(pci_dma_mapping_error(sc->pdev, *skb_addr))) {
1196 ATH5K_ERR(sc, "%s: DMA mapping failed\n", __func__); 1200 ATH5K_ERR(sc, "%s: DMA mapping failed\n", __func__);
1197 dev_kfree_skb(skb); 1201 dev_kfree_skb(skb);
@@ -1631,10 +1635,10 @@ ath5k_rx_start(struct ath5k_softc *sc)
1631 struct ath5k_buf *bf; 1635 struct ath5k_buf *bf;
1632 int ret; 1636 int ret;
1633 1637
1634 sc->rxbufsize = roundup(IEEE80211_MAX_LEN, common->cachelsz); 1638 common->rx_bufsize = roundup(IEEE80211_MAX_LEN, common->cachelsz);
1635 1639
1636 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "cachelsz %u rxbufsize %u\n", 1640 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "cachelsz %u rx_bufsize %u\n",
1637 common->cachelsz, sc->rxbufsize); 1641 common->cachelsz, common->rx_bufsize);
1638 1642
1639 spin_lock_bh(&sc->rxbuflock); 1643 spin_lock_bh(&sc->rxbuflock);
1640 sc->rxlink = NULL; 1644 sc->rxlink = NULL;
@@ -1679,6 +1683,8 @@ static unsigned int
1679ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds, 1683ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds,
1680 struct sk_buff *skb, struct ath5k_rx_status *rs) 1684 struct sk_buff *skb, struct ath5k_rx_status *rs)
1681{ 1685{
1686 struct ath5k_hw *ah = sc->ah;
1687 struct ath_common *common = ath5k_hw_common(ah);
1682 struct ieee80211_hdr *hdr = (void *)skb->data; 1688 struct ieee80211_hdr *hdr = (void *)skb->data;
1683 unsigned int keyix, hlen; 1689 unsigned int keyix, hlen;
1684 1690
@@ -1695,7 +1701,7 @@ ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds,
1695 skb->len >= hlen + 4) { 1701 skb->len >= hlen + 4) {
1696 keyix = skb->data[hlen + 3] >> 6; 1702 keyix = skb->data[hlen + 3] >> 6;
1697 1703
1698 if (test_bit(keyix, sc->keymap)) 1704 if (test_bit(keyix, common->keymap))
1699 return RX_FLAG_DECRYPTED; 1705 return RX_FLAG_DECRYPTED;
1700 } 1706 }
1701 1707
@@ -1769,6 +1775,8 @@ ath5k_tasklet_rx(unsigned long data)
1769 struct sk_buff *skb, *next_skb; 1775 struct sk_buff *skb, *next_skb;
1770 dma_addr_t next_skb_addr; 1776 dma_addr_t next_skb_addr;
1771 struct ath5k_softc *sc = (void *)data; 1777 struct ath5k_softc *sc = (void *)data;
1778 struct ath5k_hw *ah = sc->ah;
1779 struct ath_common *common = ath5k_hw_common(ah);
1772 struct ath5k_buf *bf; 1780 struct ath5k_buf *bf;
1773 struct ath5k_desc *ds; 1781 struct ath5k_desc *ds;
1774 int ret; 1782 int ret;
@@ -1846,7 +1854,7 @@ accept:
1846 if (!next_skb) 1854 if (!next_skb)
1847 goto next; 1855 goto next;
1848 1856
1849 pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize, 1857 pci_unmap_single(sc->pdev, bf->skbaddr, common->rx_bufsize,
1850 PCI_DMA_FROMDEVICE); 1858 PCI_DMA_FROMDEVICE);
1851 skb_put(skb, rs.rs_datalen); 1859 skb_put(skb, rs.rs_datalen);
1852 1860
@@ -3032,6 +3040,8 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3032 struct ieee80211_key_conf *key) 3040 struct ieee80211_key_conf *key)
3033{ 3041{
3034 struct ath5k_softc *sc = hw->priv; 3042 struct ath5k_softc *sc = hw->priv;
3043 struct ath5k_hw *ah = sc->ah;
3044 struct ath_common *common = ath5k_hw_common(ah);
3035 int ret = 0; 3045 int ret = 0;
3036 3046
3037 if (modparam_nohwcrypt) 3047 if (modparam_nohwcrypt)
@@ -3064,14 +3074,14 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3064 ATH5K_ERR(sc, "can't set the key\n"); 3074 ATH5K_ERR(sc, "can't set the key\n");
3065 goto unlock; 3075 goto unlock;
3066 } 3076 }
3067 __set_bit(key->keyidx, sc->keymap); 3077 __set_bit(key->keyidx, common->keymap);
3068 key->hw_key_idx = key->keyidx; 3078 key->hw_key_idx = key->keyidx;
3069 key->flags |= (IEEE80211_KEY_FLAG_GENERATE_IV | 3079 key->flags |= (IEEE80211_KEY_FLAG_GENERATE_IV |
3070 IEEE80211_KEY_FLAG_GENERATE_MMIC); 3080 IEEE80211_KEY_FLAG_GENERATE_MMIC);
3071 break; 3081 break;
3072 case DISABLE_KEY: 3082 case DISABLE_KEY:
3073 ath5k_hw_reset_key(sc->ah, key->keyidx); 3083 ath5k_hw_reset_key(sc->ah, key->keyidx);
3074 __clear_bit(key->keyidx, sc->keymap); 3084 __clear_bit(key->keyidx, common->keymap);
3075 break; 3085 break;
3076 default: 3086 default:
3077 ret = -EINVAL; 3087 ret = -EINVAL;
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h
index b14ba07e9157..b72338c9bde7 100644
--- a/drivers/net/wireless/ath/ath5k/base.h
+++ b/drivers/net/wireless/ath/ath5k/base.h
@@ -153,8 +153,6 @@ struct ath5k_softc {
153 153
154 enum ath5k_int imask; /* interrupt mask copy */ 154 enum ath5k_int imask; /* interrupt mask copy */
155 155
156 DECLARE_BITMAP(keymap, AR5K_KEYCACHE_SIZE); /* key use bit map */
157
158 u8 bssidmask[ETH_ALEN]; 156 u8 bssidmask[ETH_ALEN];
159 157
160 unsigned int led_pin, /* GPIO pin for driving LED */ 158 unsigned int led_pin, /* GPIO pin for driving LED */
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 895990751d36..721ec5ee381d 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -3025,8 +3025,6 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
3025 ATH5K_ERR(ah->ah_sc, "invalid tx power: %u\n", txpower); 3025 ATH5K_ERR(ah->ah_sc, "invalid tx power: %u\n", txpower);
3026 return -EINVAL; 3026 return -EINVAL;
3027 } 3027 }
3028 if (txpower == 0)
3029 txpower = AR5K_TUNE_DEFAULT_TXPOWER;
3030 3028
3031 /* Reset TX power values */ 3029 /* Reset TX power values */
3032 memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower)); 3030 memset(&ah->ah_txpower, 0, sizeof(ah->ah_txpower));