aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/base.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-09-10 14:20:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:27 -0400
commitdb7197184802578314d974e4b2bc961bdcec8f8c (patch)
tree80b4436d96b2a0ef46ecba806592e7f6d6c71b8b /drivers/net/wireless/ath/ath5k/base.c
parent27c51f1a349f3e4eb9c1d6d3a548eafe1828cc7a (diff)
ath5k: move ath_common to ath5k_hw
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/ath5k/base.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index efee68c8b1ab..06fc893723fa 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -444,6 +444,7 @@ ath5k_pci_probe(struct pci_dev *pdev,
444{ 444{
445 void __iomem *mem; 445 void __iomem *mem;
446 struct ath5k_softc *sc; 446 struct ath5k_softc *sc;
447 struct ath_common *common;
447 struct ieee80211_hw *hw; 448 struct ieee80211_hw *hw;
448 int ret; 449 int ret;
449 u8 csz; 450 u8 csz;
@@ -547,7 +548,6 @@ ath5k_pci_probe(struct pci_dev *pdev,
547 __set_bit(ATH_STAT_INVALID, sc->status); 548 __set_bit(ATH_STAT_INVALID, sc->status);
548 549
549 sc->iobase = mem; /* So we can unmap it on detach */ 550 sc->iobase = mem; /* So we can unmap it on detach */
550 sc->common.cachelsz = csz << 2; /* convert to bytes */
551 sc->opmode = NL80211_IFTYPE_STATION; 551 sc->opmode = NL80211_IFTYPE_STATION;
552 sc->bintval = 1000; 552 sc->bintval = 1000;
553 mutex_init(&sc->lock); 553 mutex_init(&sc->lock);
@@ -572,6 +572,9 @@ ath5k_pci_probe(struct pci_dev *pdev,
572 goto err_irq; 572 goto err_irq;
573 } 573 }
574 574
575 common = ath5k_hw_common(sc->ah);
576 common->cachelsz = csz << 2; /* convert to bytes */
577
575 /* set up multi-rate retry capabilities */ 578 /* set up multi-rate retry capabilities */
576 if (sc->ah->ah_version == AR5K_AR5212) { 579 if (sc->ah->ah_version == AR5K_AR5212) {
577 hw->max_rates = 4; 580 hw->max_rates = 4;
@@ -718,7 +721,7 @@ static int ath5k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *re
718{ 721{
719 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); 722 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
720 struct ath5k_softc *sc = hw->priv; 723 struct ath5k_softc *sc = hw->priv;
721 struct ath_regulatory *regulatory = &sc->common.regulatory; 724 struct ath_regulatory *regulatory = ath5k_hw_regulatory(sc->ah);
722 725
723 return ath_reg_notifier_apply(wiphy, request, regulatory); 726 return ath_reg_notifier_apply(wiphy, request, regulatory);
724} 727}
@@ -728,7 +731,7 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw)
728{ 731{
729 struct ath5k_softc *sc = hw->priv; 732 struct ath5k_softc *sc = hw->priv;
730 struct ath5k_hw *ah = sc->ah; 733 struct ath5k_hw *ah = sc->ah;
731 struct ath_regulatory *regulatory = &sc->common.regulatory; 734 struct ath_regulatory *regulatory = ath5k_hw_regulatory(ah);
732 u8 mac[ETH_ALEN] = {}; 735 u8 mac[ETH_ALEN] = {};
733 int ret; 736 int ret;
734 737
@@ -1153,19 +1156,20 @@ ath5k_hw_to_driver_rix(struct ath5k_softc *sc, int hw_rix)
1153static 1156static
1154struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr) 1157struct sk_buff *ath5k_rx_skb_alloc(struct ath5k_softc *sc, dma_addr_t *skb_addr)
1155{ 1158{
1159 struct ath_common *common = ath5k_hw_common(sc->ah);
1156 struct sk_buff *skb; 1160 struct sk_buff *skb;
1157 1161
1158 /* 1162 /*
1159 * Allocate buffer with headroom_needed space for the 1163 * Allocate buffer with headroom_needed space for the
1160 * fake physical layer header at the start. 1164 * fake physical layer header at the start.
1161 */ 1165 */
1162 skb = ath_rxbuf_alloc(&sc->common, 1166 skb = ath_rxbuf_alloc(common,
1163 sc->rxbufsize + sc->common.cachelsz - 1, 1167 sc->rxbufsize + common->cachelsz - 1,
1164 GFP_ATOMIC); 1168 GFP_ATOMIC);
1165 1169
1166 if (!skb) { 1170 if (!skb) {
1167 ATH5K_ERR(sc, "can't alloc skbuff of size %u\n", 1171 ATH5K_ERR(sc, "can't alloc skbuff of size %u\n",
1168 sc->rxbufsize + sc->common.cachelsz - 1); 1172 sc->rxbufsize + common->cachelsz - 1);
1169 return NULL; 1173 return NULL;
1170 } 1174 }
1171 1175
@@ -1606,13 +1610,14 @@ static int
1606ath5k_rx_start(struct ath5k_softc *sc) 1610ath5k_rx_start(struct ath5k_softc *sc)
1607{ 1611{
1608 struct ath5k_hw *ah = sc->ah; 1612 struct ath5k_hw *ah = sc->ah;
1613 struct ath_common *common = ath5k_hw_common(ah);
1609 struct ath5k_buf *bf; 1614 struct ath5k_buf *bf;
1610 int ret; 1615 int ret;
1611 1616
1612 sc->rxbufsize = roundup(IEEE80211_MAX_LEN, sc->common.cachelsz); 1617 sc->rxbufsize = roundup(IEEE80211_MAX_LEN, common->cachelsz);
1613 1618
1614 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "cachelsz %u rxbufsize %u\n", 1619 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "cachelsz %u rxbufsize %u\n",
1615 sc->common.cachelsz, sc->rxbufsize); 1620 common->cachelsz, sc->rxbufsize);
1616 1621
1617 spin_lock_bh(&sc->rxbuflock); 1622 spin_lock_bh(&sc->rxbuflock);
1618 sc->rxlink = NULL; 1623 sc->rxlink = NULL;