aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-01-24 13:23:18 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-28 15:42:00 -0500
commit9ac58615d93c8a28b1c649a90a5e2ede4dfd368a (patch)
treec17d665e6de3b05bc20d75af1c90d4d15e686e45 /drivers/net
parent0cdd5c60e4538d02414144e0682941a4eb20ffa8 (diff)
ath9k: fold struct ath_wiphy into struct ath_softc
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/ahb.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h13
-rw-r--r--drivers/net/wireless/ath/ath9k/beacon.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c78
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c9
10 files changed, 52 insertions, 105 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c
index 72f430e956ec..993672105963 100644
--- a/drivers/net/wireless/ath/ath9k/ahb.c
+++ b/drivers/net/wireless/ath/ath9k/ahb.c
@@ -54,7 +54,6 @@ static struct ath_bus_ops ath_ahb_bus_ops = {
54static int ath_ahb_probe(struct platform_device *pdev) 54static int ath_ahb_probe(struct platform_device *pdev)
55{ 55{
56 void __iomem *mem; 56 void __iomem *mem;
57 struct ath_wiphy *aphy;
58 struct ath_softc *sc; 57 struct ath_softc *sc;
59 struct ieee80211_hw *hw; 58 struct ieee80211_hw *hw;
60 struct resource *res; 59 struct resource *res;
@@ -92,8 +91,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
92 91
93 irq = res->start; 92 irq = res->start;
94 93
95 hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + 94 hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
96 sizeof(struct ath_softc), &ath9k_ops);
97 if (hw == NULL) { 95 if (hw == NULL) {
98 dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); 96 dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
99 ret = -ENOMEM; 97 ret = -ENOMEM;
@@ -103,10 +101,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
103 SET_IEEE80211_DEV(hw, &pdev->dev); 101 SET_IEEE80211_DEV(hw, &pdev->dev);
104 platform_set_drvdata(pdev, hw); 102 platform_set_drvdata(pdev, hw);
105 103
106 aphy = hw->priv; 104 sc = hw->priv;
107 sc = (struct ath_softc *) (aphy + 1);
108 aphy->sc = sc;
109 aphy->hw = hw;
110 sc->hw = hw; 105 sc->hw = hw;
111 sc->dev = &pdev->dev; 106 sc->dev = &pdev->dev;
112 sc->mem = mem; 107 sc->mem = mem;
@@ -150,8 +145,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
150 struct ieee80211_hw *hw = platform_get_drvdata(pdev); 145 struct ieee80211_hw *hw = platform_get_drvdata(pdev);
151 146
152 if (hw) { 147 if (hw) {
153 struct ath_wiphy *aphy = hw->priv; 148 struct ath_softc *sc = hw->priv;
154 struct ath_softc *sc = aphy->sc;
155 void __iomem *mem = sc->mem; 149 void __iomem *mem = sc->mem;
156 150
157 ath9k_deinit_device(sc); 151 ath9k_deinit_device(sc);
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 01306a3c4475..75d54a53865f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -32,7 +32,6 @@
32 */ 32 */
33 33
34struct ath_node; 34struct ath_node;
35struct ath_wiphy;
36 35
37/* Macro to expand scalars to 64-bit objects */ 36/* Macro to expand scalars to 64-bit objects */
38 37
@@ -398,7 +397,7 @@ struct ath_beacon {
398 397
399void ath_beacon_tasklet(unsigned long data); 398void ath_beacon_tasklet(unsigned long data);
400void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); 399void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif);
401int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif); 400int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif);
402void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp); 401void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
403int ath_beaconq_config(struct ath_softc *sc); 402int ath_beaconq_config(struct ath_softc *sc);
404 403
@@ -628,6 +627,9 @@ struct ath_softc {
628 int led_on_cnt; 627 int led_on_cnt;
629 int led_off_cnt; 628 int led_off_cnt;
630 629
630 struct ath9k_hw_cal_data caldata;
631 int last_rssi;
632
631 int beacon_interval; 633 int beacon_interval;
632 634
633#ifdef CONFIG_ATH9K_DEBUGFS 635#ifdef CONFIG_ATH9K_DEBUGFS
@@ -647,13 +649,6 @@ struct ath_softc {
647 struct pm_qos_request_list pm_qos_req; 649 struct pm_qos_request_list pm_qos_req;
648}; 650};
649 651
650struct ath_wiphy {
651 struct ath_softc *sc; /* shared for all virtual wiphys */
652 struct ieee80211_hw *hw;
653 struct ath9k_hw_cal_data caldata;
654 int last_rssi;
655};
656
657void ath9k_tasklet(unsigned long data); 652void ath9k_tasklet(unsigned long data);
658int ath_reset(struct ath_softc *sc, bool retry_tx); 653int ath_reset(struct ath_softc *sc, bool retry_tx);
659int ath_cabq_update(struct ath_softc *); 654int ath_cabq_update(struct ath_softc *);
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 77c8e70db0a0..87ba44c06692 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -112,8 +112,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
112 112
113static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) 113static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
114{ 114{
115 struct ath_wiphy *aphy = hw->priv; 115 struct ath_softc *sc = hw->priv;
116 struct ath_softc *sc = aphy->sc;
117 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 116 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
118 struct ath_tx_control txctl; 117 struct ath_tx_control txctl;
119 118
@@ -132,8 +131,7 @@ static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
132static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, 131static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
133 struct ieee80211_vif *vif) 132 struct ieee80211_vif *vif)
134{ 133{
135 struct ath_wiphy *aphy = hw->priv; 134 struct ath_softc *sc = hw->priv;
136 struct ath_softc *sc = aphy->sc;
137 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 135 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
138 struct ath_buf *bf; 136 struct ath_buf *bf;
139 struct ath_vif *avp; 137 struct ath_vif *avp;
@@ -222,9 +220,8 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
222 return bf; 220 return bf;
223} 221}
224 222
225int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) 223int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif)
226{ 224{
227 struct ath_softc *sc = aphy->sc;
228 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 225 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
229 struct ath_vif *avp; 226 struct ath_vif *avp;
230 struct ath_buf *bf; 227 struct ath_buf *bf;
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 133764069246..fb4f17a5183d 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -201,8 +201,7 @@ static bool ath_is_rfkill_set(struct ath_softc *sc)
201 201
202void ath9k_rfkill_poll_state(struct ieee80211_hw *hw) 202void ath9k_rfkill_poll_state(struct ieee80211_hw *hw)
203{ 203{
204 struct ath_wiphy *aphy = hw->priv; 204 struct ath_softc *sc = hw->priv;
205 struct ath_softc *sc = aphy->sc;
206 bool blocked = !!ath_is_rfkill_set(sc); 205 bool blocked = !!ath_is_rfkill_set(sc);
207 206
208 wiphy_rfkill_set_hw_state(hw->wiphy, blocked); 207 wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 88ff39940e92..c1e159219065 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -254,8 +254,7 @@ static int ath9k_reg_notifier(struct wiphy *wiphy,
254 struct regulatory_request *request) 254 struct regulatory_request *request)
255{ 255{
256 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); 256 struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
257 struct ath_wiphy *aphy = hw->priv; 257 struct ath_softc *sc = hw->priv;
258 struct ath_softc *sc = aphy->sc;
259 struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah); 258 struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah);
260 259
261 return ath_reg_notifier_apply(wiphy, request, reg); 260 return ath_reg_notifier_apply(wiphy, request, reg);
@@ -704,7 +703,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
704 const struct ath_bus_ops *bus_ops) 703 const struct ath_bus_ops *bus_ops)
705{ 704{
706 struct ieee80211_hw *hw = sc->hw; 705 struct ieee80211_hw *hw = sc->hw;
707 struct ath_wiphy *aphy = hw->priv;
708 struct ath_common *common; 706 struct ath_common *common;
709 struct ath_hw *ah; 707 struct ath_hw *ah;
710 int error = 0; 708 int error = 0;
@@ -759,7 +757,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
759 757
760 INIT_WORK(&sc->hw_check_work, ath_hw_check); 758 INIT_WORK(&sc->hw_check_work, ath_hw_check);
761 INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); 759 INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
762 aphy->last_rssi = ATH_RSSI_DUMMY_MARKER; 760 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
763 761
764 ath_init_leds(sc); 762 ath_init_leds(sc);
765 ath_start_rfkill_poll(sc); 763 ath_start_rfkill_poll(sc);
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2d9951080864..422be2675a06 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -215,7 +215,6 @@ static void ath_update_survey_stats(struct ath_softc *sc)
215int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, 215int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
216 struct ath9k_channel *hchan) 216 struct ath9k_channel *hchan)
217{ 217{
218 struct ath_wiphy *aphy = hw->priv;
219 struct ath_hw *ah = sc->sc_ah; 218 struct ath_hw *ah = sc->sc_ah;
220 struct ath_common *common = ath9k_hw_common(ah); 219 struct ath_common *common = ath9k_hw_common(ah);
221 struct ieee80211_conf *conf = &common->hw->conf; 220 struct ieee80211_conf *conf = &common->hw->conf;
@@ -262,7 +261,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
262 fastcc = false; 261 fastcc = false;
263 262
264 if (!(sc->sc_flags & SC_OP_OFFCHANNEL)) 263 if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
265 caldata = &aphy->caldata; 264 caldata = &sc->caldata;
266 265
267 ath_dbg(common, ATH_DBG_CONFIG, 266 ath_dbg(common, ATH_DBG_CONFIG,
268 "(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n", 267 "(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n",
@@ -854,7 +853,6 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
854 struct ieee80211_vif *vif, 853 struct ieee80211_vif *vif,
855 struct ieee80211_bss_conf *bss_conf) 854 struct ieee80211_bss_conf *bss_conf)
856{ 855{
857 struct ath_wiphy *aphy = hw->priv;
858 struct ath_hw *ah = sc->sc_ah; 856 struct ath_hw *ah = sc->sc_ah;
859 struct ath_common *common = ath9k_hw_common(ah); 857 struct ath_common *common = ath9k_hw_common(ah);
860 858
@@ -878,7 +876,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
878 ath_beacon_config(sc, vif); 876 ath_beacon_config(sc, vif);
879 877
880 /* Reset rssi stats */ 878 /* Reset rssi stats */
881 aphy->last_rssi = ATH_RSSI_DUMMY_MARKER; 879 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
882 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; 880 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
883 881
884 sc->sc_flags |= SC_OP_ANI_RUN; 882 sc->sc_flags |= SC_OP_ANI_RUN;
@@ -1075,8 +1073,7 @@ void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
1075 1073
1076static int ath9k_start(struct ieee80211_hw *hw) 1074static int ath9k_start(struct ieee80211_hw *hw)
1077{ 1075{
1078 struct ath_wiphy *aphy = hw->priv; 1076 struct ath_softc *sc = hw->priv;
1079 struct ath_softc *sc = aphy->sc;
1080 struct ath_hw *ah = sc->sc_ah; 1077 struct ath_hw *ah = sc->sc_ah;
1081 struct ath_common *common = ath9k_hw_common(ah); 1078 struct ath_common *common = ath9k_hw_common(ah);
1082 struct ieee80211_channel *curchan = hw->conf.channel; 1079 struct ieee80211_channel *curchan = hw->conf.channel;
@@ -1193,8 +1190,7 @@ mutex_unlock:
1193static int ath9k_tx(struct ieee80211_hw *hw, 1190static int ath9k_tx(struct ieee80211_hw *hw,
1194 struct sk_buff *skb) 1191 struct sk_buff *skb)
1195{ 1192{
1196 struct ath_wiphy *aphy = hw->priv; 1193 struct ath_softc *sc = hw->priv;
1197 struct ath_softc *sc = aphy->sc;
1198 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1194 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1199 struct ath_tx_control txctl; 1195 struct ath_tx_control txctl;
1200 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1196 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
@@ -1257,8 +1253,7 @@ exit:
1257 1253
1258static void ath9k_stop(struct ieee80211_hw *hw) 1254static void ath9k_stop(struct ieee80211_hw *hw)
1259{ 1255{
1260 struct ath_wiphy *aphy = hw->priv; 1256 struct ath_softc *sc = hw->priv;
1261 struct ath_softc *sc = aphy->sc;
1262 struct ath_hw *ah = sc->sc_ah; 1257 struct ath_hw *ah = sc->sc_ah;
1263 struct ath_common *common = ath9k_hw_common(ah); 1258 struct ath_common *common = ath9k_hw_common(ah);
1264 1259
@@ -1393,8 +1388,7 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
1393 struct ieee80211_vif *vif, 1388 struct ieee80211_vif *vif,
1394 struct ath9k_vif_iter_data *iter_data) 1389 struct ath9k_vif_iter_data *iter_data)
1395{ 1390{
1396 struct ath_wiphy *aphy = hw->priv; 1391 struct ath_softc *sc = hw->priv;
1397 struct ath_softc *sc = aphy->sc;
1398 struct ath_hw *ah = sc->sc_ah; 1392 struct ath_hw *ah = sc->sc_ah;
1399 struct ath_common *common = ath9k_hw_common(ah); 1393 struct ath_common *common = ath9k_hw_common(ah);
1400 1394
@@ -1418,8 +1412,7 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
1418static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, 1412static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
1419 struct ieee80211_vif *vif) 1413 struct ieee80211_vif *vif)
1420{ 1414{
1421 struct ath_wiphy *aphy = hw->priv; 1415 struct ath_softc *sc = hw->priv;
1422 struct ath_softc *sc = aphy->sc;
1423 struct ath_hw *ah = sc->sc_ah; 1416 struct ath_hw *ah = sc->sc_ah;
1424 struct ath_common *common = ath9k_hw_common(ah); 1417 struct ath_common *common = ath9k_hw_common(ah);
1425 struct ath9k_vif_iter_data iter_data; 1418 struct ath9k_vif_iter_data iter_data;
@@ -1475,8 +1468,7 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
1475static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw, 1468static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
1476 struct ieee80211_vif *vif) 1469 struct ieee80211_vif *vif)
1477{ 1470{
1478 struct ath_wiphy *aphy = hw->priv; 1471 struct ath_softc *sc = hw->priv;
1479 struct ath_softc *sc = aphy->sc;
1480 1472
1481 ath9k_calculate_summary_state(hw, vif); 1473 ath9k_calculate_summary_state(hw, vif);
1482 1474
@@ -1489,7 +1481,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
1489 * in the info_changed method and set up beacons properly 1481 * in the info_changed method and set up beacons properly
1490 * there. 1482 * there.
1491 */ 1483 */
1492 error = ath_beacon_alloc(aphy, vif); 1484 error = ath_beacon_alloc(sc, vif);
1493 if (error) 1485 if (error)
1494 ath9k_reclaim_beacon(sc, vif); 1486 ath9k_reclaim_beacon(sc, vif);
1495 else 1487 else
@@ -1501,8 +1493,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
1501static int ath9k_add_interface(struct ieee80211_hw *hw, 1493static int ath9k_add_interface(struct ieee80211_hw *hw,
1502 struct ieee80211_vif *vif) 1494 struct ieee80211_vif *vif)
1503{ 1495{
1504 struct ath_wiphy *aphy = hw->priv; 1496 struct ath_softc *sc = hw->priv;
1505 struct ath_softc *sc = aphy->sc;
1506 struct ath_hw *ah = sc->sc_ah; 1497 struct ath_hw *ah = sc->sc_ah;
1507 struct ath_common *common = ath9k_hw_common(ah); 1498 struct ath_common *common = ath9k_hw_common(ah);
1508 struct ath_vif *avp = (void *)vif->drv_priv; 1499 struct ath_vif *avp = (void *)vif->drv_priv;
@@ -1562,8 +1553,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1562 enum nl80211_iftype new_type, 1553 enum nl80211_iftype new_type,
1563 bool p2p) 1554 bool p2p)
1564{ 1555{
1565 struct ath_wiphy *aphy = hw->priv; 1556 struct ath_softc *sc = hw->priv;
1566 struct ath_softc *sc = aphy->sc;
1567 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1557 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1568 int ret = 0; 1558 int ret = 0;
1569 1559
@@ -1605,8 +1595,7 @@ out:
1605static void ath9k_remove_interface(struct ieee80211_hw *hw, 1595static void ath9k_remove_interface(struct ieee80211_hw *hw,
1606 struct ieee80211_vif *vif) 1596 struct ieee80211_vif *vif)
1607{ 1597{
1608 struct ath_wiphy *aphy = hw->priv; 1598 struct ath_softc *sc = hw->priv;
1609 struct ath_softc *sc = aphy->sc;
1610 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1599 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1611 1600
1612 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1601 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
@@ -1660,8 +1649,7 @@ static void ath9k_disable_ps(struct ath_softc *sc)
1660 1649
1661static int ath9k_config(struct ieee80211_hw *hw, u32 changed) 1650static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1662{ 1651{
1663 struct ath_wiphy *aphy = hw->priv; 1652 struct ath_softc *sc = hw->priv;
1664 struct ath_softc *sc = aphy->sc;
1665 struct ath_hw *ah = sc->sc_ah; 1653 struct ath_hw *ah = sc->sc_ah;
1666 struct ath_common *common = ath9k_hw_common(ah); 1654 struct ath_common *common = ath9k_hw_common(ah);
1667 struct ieee80211_conf *conf = &hw->conf; 1655 struct ieee80211_conf *conf = &hw->conf;
@@ -1805,8 +1793,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
1805 unsigned int *total_flags, 1793 unsigned int *total_flags,
1806 u64 multicast) 1794 u64 multicast)
1807{ 1795{
1808 struct ath_wiphy *aphy = hw->priv; 1796 struct ath_softc *sc = hw->priv;
1809 struct ath_softc *sc = aphy->sc;
1810 u32 rfilt; 1797 u32 rfilt;
1811 1798
1812 changed_flags &= SUPPORTED_FILTERS; 1799 changed_flags &= SUPPORTED_FILTERS;
@@ -1826,8 +1813,7 @@ static int ath9k_sta_add(struct ieee80211_hw *hw,
1826 struct ieee80211_vif *vif, 1813 struct ieee80211_vif *vif,
1827 struct ieee80211_sta *sta) 1814 struct ieee80211_sta *sta)
1828{ 1815{
1829 struct ath_wiphy *aphy = hw->priv; 1816 struct ath_softc *sc = hw->priv;
1830 struct ath_softc *sc = aphy->sc;
1831 1817
1832 ath_node_attach(sc, sta); 1818 ath_node_attach(sc, sta);
1833 1819
@@ -1838,8 +1824,7 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw,
1838 struct ieee80211_vif *vif, 1824 struct ieee80211_vif *vif,
1839 struct ieee80211_sta *sta) 1825 struct ieee80211_sta *sta)
1840{ 1826{
1841 struct ath_wiphy *aphy = hw->priv; 1827 struct ath_softc *sc = hw->priv;
1842 struct ath_softc *sc = aphy->sc;
1843 1828
1844 ath_node_detach(sc, sta); 1829 ath_node_detach(sc, sta);
1845 1830
@@ -1849,8 +1834,7 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw,
1849static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, 1834static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
1850 const struct ieee80211_tx_queue_params *params) 1835 const struct ieee80211_tx_queue_params *params)
1851{ 1836{
1852 struct ath_wiphy *aphy = hw->priv; 1837 struct ath_softc *sc = hw->priv;
1853 struct ath_softc *sc = aphy->sc;
1854 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1838 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1855 struct ath_txq *txq; 1839 struct ath_txq *txq;
1856 struct ath9k_tx_queue_info qi; 1840 struct ath9k_tx_queue_info qi;
@@ -1894,8 +1878,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
1894 struct ieee80211_sta *sta, 1878 struct ieee80211_sta *sta,
1895 struct ieee80211_key_conf *key) 1879 struct ieee80211_key_conf *key)
1896{ 1880{
1897 struct ath_wiphy *aphy = hw->priv; 1881 struct ath_softc *sc = hw->priv;
1898 struct ath_softc *sc = aphy->sc;
1899 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1882 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1900 int ret = 0; 1883 int ret = 0;
1901 1884
@@ -1939,8 +1922,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1939 struct ieee80211_bss_conf *bss_conf, 1922 struct ieee80211_bss_conf *bss_conf,
1940 u32 changed) 1923 u32 changed)
1941{ 1924{
1942 struct ath_wiphy *aphy = hw->priv; 1925 struct ath_softc *sc = hw->priv;
1943 struct ath_softc *sc = aphy->sc;
1944 struct ath_hw *ah = sc->sc_ah; 1926 struct ath_hw *ah = sc->sc_ah;
1945 struct ath_common *common = ath9k_hw_common(ah); 1927 struct ath_common *common = ath9k_hw_common(ah);
1946 struct ath_vif *avp = (void *)vif->drv_priv; 1928 struct ath_vif *avp = (void *)vif->drv_priv;
@@ -1970,7 +1952,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1970 if ((changed & BSS_CHANGED_BEACON) || 1952 if ((changed & BSS_CHANGED_BEACON) ||
1971 ((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) { 1953 ((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) {
1972 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 1954 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
1973 error = ath_beacon_alloc(aphy, vif); 1955 error = ath_beacon_alloc(sc, vif);
1974 if (!error) 1956 if (!error)
1975 ath_beacon_config(sc, vif); 1957 ath_beacon_config(sc, vif);
1976 } 1958 }
@@ -2007,7 +1989,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
2007 if (vif->type == NL80211_IFTYPE_AP) { 1989 if (vif->type == NL80211_IFTYPE_AP) {
2008 sc->sc_flags |= SC_OP_TSF_RESET; 1990 sc->sc_flags |= SC_OP_TSF_RESET;
2009 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); 1991 ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
2010 error = ath_beacon_alloc(aphy, vif); 1992 error = ath_beacon_alloc(sc, vif);
2011 if (!error) 1993 if (!error)
2012 ath_beacon_config(sc, vif); 1994 ath_beacon_config(sc, vif);
2013 } else { 1995 } else {
@@ -2045,9 +2027,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
2045 2027
2046static u64 ath9k_get_tsf(struct ieee80211_hw *hw) 2028static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
2047{ 2029{
2030 struct ath_softc *sc = hw->priv;
2048 u64 tsf; 2031 u64 tsf;
2049 struct ath_wiphy *aphy = hw->priv;
2050 struct ath_softc *sc = aphy->sc;
2051 2032
2052 mutex_lock(&sc->mutex); 2033 mutex_lock(&sc->mutex);
2053 ath9k_ps_wakeup(sc); 2034 ath9k_ps_wakeup(sc);
@@ -2060,8 +2041,7 @@ static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
2060 2041
2061static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf) 2042static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
2062{ 2043{
2063 struct ath_wiphy *aphy = hw->priv; 2044 struct ath_softc *sc = hw->priv;
2064 struct ath_softc *sc = aphy->sc;
2065 2045
2066 mutex_lock(&sc->mutex); 2046 mutex_lock(&sc->mutex);
2067 ath9k_ps_wakeup(sc); 2047 ath9k_ps_wakeup(sc);
@@ -2072,8 +2052,7 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
2072 2052
2073static void ath9k_reset_tsf(struct ieee80211_hw *hw) 2053static void ath9k_reset_tsf(struct ieee80211_hw *hw)
2074{ 2054{
2075 struct ath_wiphy *aphy = hw->priv; 2055 struct ath_softc *sc = hw->priv;
2076 struct ath_softc *sc = aphy->sc;
2077 2056
2078 mutex_lock(&sc->mutex); 2057 mutex_lock(&sc->mutex);
2079 2058
@@ -2090,8 +2069,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
2090 struct ieee80211_sta *sta, 2069 struct ieee80211_sta *sta,
2091 u16 tid, u16 *ssn, u8 buf_size) 2070 u16 tid, u16 *ssn, u8 buf_size)
2092{ 2071{
2093 struct ath_wiphy *aphy = hw->priv; 2072 struct ath_softc *sc = hw->priv;
2094 struct ath_softc *sc = aphy->sc;
2095 int ret = 0; 2073 int ret = 0;
2096 2074
2097 local_bh_disable(); 2075 local_bh_disable();
@@ -2136,8 +2114,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
2136static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, 2114static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
2137 struct survey_info *survey) 2115 struct survey_info *survey)
2138{ 2116{
2139 struct ath_wiphy *aphy = hw->priv; 2117 struct ath_softc *sc = hw->priv;
2140 struct ath_softc *sc = aphy->sc;
2141 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 2118 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
2142 struct ieee80211_supported_band *sband; 2119 struct ieee80211_supported_band *sband;
2143 struct ieee80211_channel *chan; 2120 struct ieee80211_channel *chan;
@@ -2173,8 +2150,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
2173 2150
2174static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class) 2151static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
2175{ 2152{
2176 struct ath_wiphy *aphy = hw->priv; 2153 struct ath_softc *sc = hw->priv;
2177 struct ath_softc *sc = aphy->sc;
2178 struct ath_hw *ah = sc->sc_ah; 2154 struct ath_hw *ah = sc->sc_ah;
2179 2155
2180 mutex_lock(&sc->mutex); 2156 mutex_lock(&sc->mutex);
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index 1f60b8c47d2f..e83128c50f7b 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -126,7 +126,6 @@ static const struct ath_bus_ops ath_pci_bus_ops = {
126static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 126static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
127{ 127{
128 void __iomem *mem; 128 void __iomem *mem;
129 struct ath_wiphy *aphy;
130 struct ath_softc *sc; 129 struct ath_softc *sc;
131 struct ieee80211_hw *hw; 130 struct ieee80211_hw *hw;
132 u8 csz; 131 u8 csz;
@@ -198,8 +197,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
198 goto err_iomap; 197 goto err_iomap;
199 } 198 }
200 199
201 hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + 200 hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
202 sizeof(struct ath_softc), &ath9k_ops);
203 if (!hw) { 201 if (!hw) {
204 dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); 202 dev_err(&pdev->dev, "No memory for ieee80211_hw\n");
205 ret = -ENOMEM; 203 ret = -ENOMEM;
@@ -209,10 +207,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
209 SET_IEEE80211_DEV(hw, &pdev->dev); 207 SET_IEEE80211_DEV(hw, &pdev->dev);
210 pci_set_drvdata(pdev, hw); 208 pci_set_drvdata(pdev, hw);
211 209
212 aphy = hw->priv; 210 sc = hw->priv;
213 sc = (struct ath_softc *) (aphy + 1);
214 aphy->sc = sc;
215 aphy->hw = hw;
216 sc->hw = hw; 211 sc->hw = hw;
217 sc->dev = &pdev->dev; 212 sc->dev = &pdev->dev;
218 sc->mem = mem; 213 sc->mem = mem;
@@ -259,8 +254,7 @@ err_dma:
259static void ath_pci_remove(struct pci_dev *pdev) 254static void ath_pci_remove(struct pci_dev *pdev)
260{ 255{
261 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 256 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
262 struct ath_wiphy *aphy = hw->priv; 257 struct ath_softc *sc = hw->priv;
263 struct ath_softc *sc = aphy->sc;
264 void __iomem *mem = sc->mem; 258 void __iomem *mem = sc->mem;
265 259
266 if (!is_ath9k_unloaded) 260 if (!is_ath9k_unloaded)
@@ -280,8 +274,7 @@ static int ath_pci_suspend(struct device *device)
280{ 274{
281 struct pci_dev *pdev = to_pci_dev(device); 275 struct pci_dev *pdev = to_pci_dev(device);
282 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 276 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
283 struct ath_wiphy *aphy = hw->priv; 277 struct ath_softc *sc = hw->priv;
284 struct ath_softc *sc = aphy->sc;
285 278
286 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); 279 ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
287 280
@@ -292,8 +285,7 @@ static int ath_pci_resume(struct device *device)
292{ 285{
293 struct pci_dev *pdev = to_pci_dev(device); 286 struct pci_dev *pdev = to_pci_dev(device);
294 struct ieee80211_hw *hw = pci_get_drvdata(pdev); 287 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
295 struct ath_wiphy *aphy = hw->priv; 288 struct ath_softc *sc = hw->priv;
296 struct ath_softc *sc = aphy->sc;
297 u32 val; 289 u32 val;
298 290
299 /* 291 /*
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index e45147820eae..960d717ca7c2 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1560,8 +1560,7 @@ static void ath_rate_add_sta_debugfs(void *priv, void *priv_sta,
1560 1560
1561static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) 1561static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
1562{ 1562{
1563 struct ath_wiphy *aphy = hw->priv; 1563 return hw->priv;
1564 return aphy->sc;
1565} 1564}
1566 1565
1567static void ath_rate_free(void *priv) 1566static void ath_rate_free(void *priv)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index c84a675c6912..b2b12a293c70 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -927,7 +927,7 @@ static void ath9k_process_rssi(struct ath_common *common,
927 struct ieee80211_hdr *hdr, 927 struct ieee80211_hdr *hdr,
928 struct ath_rx_status *rx_stats) 928 struct ath_rx_status *rx_stats)
929{ 929{
930 struct ath_wiphy *aphy = hw->priv; 930 struct ath_softc *sc = hw->priv;
931 struct ath_hw *ah = common->ah; 931 struct ath_hw *ah = common->ah;
932 int last_rssi; 932 int last_rssi;
933 __le16 fc; 933 __le16 fc;
@@ -947,9 +947,9 @@ static void ath9k_process_rssi(struct ath_common *common,
947 } 947 }
948 948
949 if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr) 949 if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr)
950 ATH_RSSI_LPF(aphy->last_rssi, rx_stats->rs_rssi); 950 ATH_RSSI_LPF(sc->last_rssi, rx_stats->rs_rssi);
951 951
952 last_rssi = aphy->last_rssi; 952 last_rssi = sc->last_rssi;
953 if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) 953 if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
954 rx_stats->rs_rssi = ATH_EP_RND(last_rssi, 954 rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
955 ATH_RSSI_EP_MULTIPLIER); 955 ATH_RSSI_EP_MULTIPLIER);
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index d7e3f8c0602e..dd919488077d 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1443,8 +1443,7 @@ static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb)
1443static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, 1443static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
1444 int framelen) 1444 int framelen)
1445{ 1445{
1446 struct ath_wiphy *aphy = hw->priv; 1446 struct ath_softc *sc = hw->priv;
1447 struct ath_softc *sc = aphy->sc;
1448 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 1447 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
1449 struct ieee80211_sta *sta = tx_info->control.sta; 1448 struct ieee80211_sta *sta = tx_info->control.sta;
1450 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 1449 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
@@ -1662,8 +1661,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw,
1662 struct ath_txq *txq, 1661 struct ath_txq *txq,
1663 struct sk_buff *skb) 1662 struct sk_buff *skb)
1664{ 1663{
1665 struct ath_wiphy *aphy = hw->priv; 1664 struct ath_softc *sc = hw->priv;
1666 struct ath_softc *sc = aphy->sc;
1667 struct ath_hw *ah = sc->sc_ah; 1665 struct ath_hw *ah = sc->sc_ah;
1668 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1666 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
1669 struct ath_frame_info *fi = get_frame_info(skb); 1667 struct ath_frame_info *fi = get_frame_info(skb);
@@ -1764,8 +1762,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
1764 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1762 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1765 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1763 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1766 struct ieee80211_sta *sta = info->control.sta; 1764 struct ieee80211_sta *sta = info->control.sta;
1767 struct ath_wiphy *aphy = hw->priv; 1765 struct ath_softc *sc = hw->priv;
1768 struct ath_softc *sc = aphy->sc;
1769 struct ath_txq *txq = txctl->txq; 1766 struct ath_txq *txq = txctl->txq;
1770 struct ath_buf *bf; 1767 struct ath_buf *bf;
1771 int padpos, padsize; 1768 int padpos, padsize;