diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-09-10 14:08:14 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-07 16:39:26 -0400 |
commit | 27c51f1a349f3e4eb9c1d6d3a548eafe1828cc7a (patch) | |
tree | 4bd882ed2bd08fb60e3f1cfd33c3c6304a9c94e6 | |
parent | 394317fc793eb25dbbda4432d29d97cd80f3b561 (diff) |
ath9k: move ath_common to ath_hw
This ensures that we can access common on hw related code
independent of the driver core.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/recv.c | 10 |
4 files changed, 19 insertions, 18 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 757f17fddcfd..0c64c801a150 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -553,8 +553,6 @@ struct ath_softc { | |||
553 | struct ieee80211_hw *hw; | 553 | struct ieee80211_hw *hw; |
554 | struct device *dev; | 554 | struct device *dev; |
555 | 555 | ||
556 | struct ath_common common; | ||
557 | |||
558 | spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */ | 556 | spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */ |
559 | struct ath_wiphy *pri_wiphy; | 557 | struct ath_wiphy *pri_wiphy; |
560 | struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may | 558 | struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may |
@@ -649,7 +647,7 @@ int ath_cabq_update(struct ath_softc *); | |||
649 | 647 | ||
650 | static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah) | 648 | static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah) |
651 | { | 649 | { |
652 | return &ah->ah_sc->common; | 650 | return &ah->common; |
653 | } | 651 | } |
654 | 652 | ||
655 | static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah) | 653 | static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah) |
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 6aee01343d3a..f1dc98927c4a 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -435,6 +435,7 @@ struct ath_gen_timer_table { | |||
435 | 435 | ||
436 | struct ath_hw { | 436 | struct ath_hw { |
437 | struct ath_softc *ah_sc; | 437 | struct ath_softc *ah_sc; |
438 | struct ath_common common; | ||
438 | struct ath9k_hw_version hw_version; | 439 | struct ath9k_hw_version hw_version; |
439 | struct ath9k_ops_config config; | 440 | struct ath9k_ops_config config; |
440 | struct ath9k_hw_capabilities caps; | 441 | struct ath9k_hw_capabilities caps; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index a96350d2aace..dc8d47e4d0f5 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1348,7 +1348,7 @@ static int ath9k_reg_notifier(struct wiphy *wiphy, | |||
1348 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); | 1348 | struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); |
1349 | struct ath_wiphy *aphy = hw->priv; | 1349 | struct ath_wiphy *aphy = hw->priv; |
1350 | struct ath_softc *sc = aphy->sc; | 1350 | struct ath_softc *sc = aphy->sc; |
1351 | struct ath_regulatory *reg = &sc->common.regulatory; | 1351 | struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah); |
1352 | 1352 | ||
1353 | return ath_reg_notifier_apply(wiphy, request, reg); | 1353 | return ath_reg_notifier_apply(wiphy, request, reg); |
1354 | } | 1354 | } |
@@ -1516,14 +1516,6 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) | |||
1516 | tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet, | 1516 | tasklet_init(&sc->bcon_tasklet, ath_beacon_tasklet, |
1517 | (unsigned long)sc); | 1517 | (unsigned long)sc); |
1518 | 1518 | ||
1519 | /* | ||
1520 | * Cache line size is used to size and align various | ||
1521 | * structures used to communicate with the hardware. | ||
1522 | */ | ||
1523 | ath_read_cachesize(sc, &csz); | ||
1524 | /* XXX assert csz is non-zero */ | ||
1525 | sc->common.cachelsz = csz << 2; /* convert to bytes */ | ||
1526 | |||
1527 | ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL); | 1519 | ah = kzalloc(sizeof(struct ath_hw), GFP_KERNEL); |
1528 | if (!ah) { | 1520 | if (!ah) { |
1529 | r = -ENOMEM; | 1521 | r = -ENOMEM; |
@@ -1535,6 +1527,16 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) | |||
1535 | ah->hw_version.subsysid = subsysid; | 1527 | ah->hw_version.subsysid = subsysid; |
1536 | sc->sc_ah = ah; | 1528 | sc->sc_ah = ah; |
1537 | 1529 | ||
1530 | common = ath9k_hw_common(ah); | ||
1531 | |||
1532 | /* | ||
1533 | * Cache line size is used to size and align various | ||
1534 | * structures used to communicate with the hardware. | ||
1535 | */ | ||
1536 | ath_read_cachesize(sc, &csz); | ||
1537 | /* XXX assert csz is non-zero */ | ||
1538 | common->cachelsz = csz << 2; /* convert to bytes */ | ||
1539 | |||
1538 | if (ath9k_init_debug(ah) < 0) | 1540 | if (ath9k_init_debug(ah) < 0) |
1539 | dev_err(sc->dev, "Unable to create debugfs files\n"); | 1541 | dev_err(sc->dev, "Unable to create debugfs files\n"); |
1540 | 1542 | ||
@@ -1677,8 +1679,6 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid) | |||
1677 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); | 1679 | ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL); |
1678 | sc->rx.defant = ath9k_hw_getdefantenna(ah); | 1680 | sc->rx.defant = ath9k_hw_getdefantenna(ah); |
1679 | 1681 | ||
1680 | common = ath9k_hw_common(ah); | ||
1681 | |||
1682 | if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) | 1682 | if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK) |
1683 | memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); | 1683 | memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); |
1684 | 1684 | ||
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 3bdd4e637219..97a5efe18d66 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -297,6 +297,7 @@ static void ath_opmode_init(struct ath_softc *sc) | |||
297 | 297 | ||
298 | int ath_rx_init(struct ath_softc *sc, int nbufs) | 298 | int ath_rx_init(struct ath_softc *sc, int nbufs) |
299 | { | 299 | { |
300 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
300 | struct sk_buff *skb; | 301 | struct sk_buff *skb; |
301 | struct ath_buf *bf; | 302 | struct ath_buf *bf; |
302 | int error = 0; | 303 | int error = 0; |
@@ -306,10 +307,10 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) | |||
306 | spin_lock_init(&sc->rx.rxbuflock); | 307 | spin_lock_init(&sc->rx.rxbuflock); |
307 | 308 | ||
308 | sc->rx.bufsize = roundup(IEEE80211_MAX_MPDU_LEN, | 309 | sc->rx.bufsize = roundup(IEEE80211_MAX_MPDU_LEN, |
309 | min(sc->common.cachelsz, (u16)64)); | 310 | min(common->cachelsz, (u16)64)); |
310 | 311 | ||
311 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "cachelsz %u rxbufsize %u\n", | 312 | DPRINTF(sc->sc_ah, ATH_DBG_CONFIG, "cachelsz %u rxbufsize %u\n", |
312 | sc->common.cachelsz, sc->rx.bufsize); | 313 | common->cachelsz, sc->rx.bufsize); |
313 | 314 | ||
314 | /* Initialize rx descriptors */ | 315 | /* Initialize rx descriptors */ |
315 | 316 | ||
@@ -322,7 +323,7 @@ int ath_rx_init(struct ath_softc *sc, int nbufs) | |||
322 | } | 323 | } |
323 | 324 | ||
324 | list_for_each_entry(bf, &sc->rx.rxbuf, list) { | 325 | list_for_each_entry(bf, &sc->rx.rxbuf, list) { |
325 | skb = ath_rxbuf_alloc(&sc->common, sc->rx.bufsize, GFP_KERNEL); | 326 | skb = ath_rxbuf_alloc(common, sc->rx.bufsize, GFP_KERNEL); |
326 | if (skb == NULL) { | 327 | if (skb == NULL) { |
327 | error = -ENOMEM; | 328 | error = -ENOMEM; |
328 | goto err; | 329 | goto err; |
@@ -654,6 +655,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
654 | struct sk_buff *skb = NULL, *requeue_skb; | 655 | struct sk_buff *skb = NULL, *requeue_skb; |
655 | struct ieee80211_rx_status rx_status; | 656 | struct ieee80211_rx_status rx_status; |
656 | struct ath_hw *ah = sc->sc_ah; | 657 | struct ath_hw *ah = sc->sc_ah; |
658 | struct ath_common *common = ath9k_hw_common(ah); | ||
657 | struct ieee80211_hdr *hdr; | 659 | struct ieee80211_hdr *hdr; |
658 | int hdrlen, padsize, retval; | 660 | int hdrlen, padsize, retval; |
659 | bool decrypt_error = false; | 661 | bool decrypt_error = false; |
@@ -752,7 +754,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush) | |||
752 | 754 | ||
753 | /* Ensure we always have an skb to requeue once we are done | 755 | /* Ensure we always have an skb to requeue once we are done |
754 | * processing the current buffer's skb */ | 756 | * processing the current buffer's skb */ |
755 | requeue_skb = ath_rxbuf_alloc(&sc->common, sc->rx.bufsize, GFP_ATOMIC); | 757 | requeue_skb = ath_rxbuf_alloc(common, sc->rx.bufsize, GFP_ATOMIC); |
756 | 758 | ||
757 | /* If there is no memory we ignore the current RX'd frame, | 759 | /* If there is no memory we ignore the current RX'd frame, |
758 | * tell hardware it can give us a new frame using the old | 760 | * tell hardware it can give us a new frame using the old |