Commit 9ac58615 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: fold struct ath_wiphy into struct ath_softc

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0cdd5c60
...@@ -54,7 +54,6 @@ static struct ath_bus_ops ath_ahb_bus_ops = { ...@@ -54,7 +54,6 @@ static struct ath_bus_ops ath_ahb_bus_ops = {
static int ath_ahb_probe(struct platform_device *pdev) static int ath_ahb_probe(struct platform_device *pdev)
{ {
void __iomem *mem; void __iomem *mem;
struct ath_wiphy *aphy;
struct ath_softc *sc; struct ath_softc *sc;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
struct resource *res; struct resource *res;
...@@ -92,8 +91,7 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -92,8 +91,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
irq = res->start; irq = res->start;
hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
sizeof(struct ath_softc), &ath9k_ops);
if (hw == NULL) { if (hw == NULL) {
dev_err(&pdev->dev, "no memory for ieee80211_hw\n"); dev_err(&pdev->dev, "no memory for ieee80211_hw\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -103,10 +101,7 @@ static int ath_ahb_probe(struct platform_device *pdev) ...@@ -103,10 +101,7 @@ static int ath_ahb_probe(struct platform_device *pdev)
SET_IEEE80211_DEV(hw, &pdev->dev); SET_IEEE80211_DEV(hw, &pdev->dev);
platform_set_drvdata(pdev, hw); platform_set_drvdata(pdev, hw);
aphy = hw->priv; sc = hw->priv;
sc = (struct ath_softc *) (aphy + 1);
aphy->sc = sc;
aphy->hw = hw;
sc->hw = hw; sc->hw = hw;
sc->dev = &pdev->dev; sc->dev = &pdev->dev;
sc->mem = mem; sc->mem = mem;
...@@ -150,8 +145,7 @@ static int ath_ahb_remove(struct platform_device *pdev) ...@@ -150,8 +145,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
struct ieee80211_hw *hw = platform_get_drvdata(pdev); struct ieee80211_hw *hw = platform_get_drvdata(pdev);
if (hw) { if (hw) {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
void __iomem *mem = sc->mem; void __iomem *mem = sc->mem;
ath9k_deinit_device(sc); ath9k_deinit_device(sc);
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
*/ */
struct ath_node; struct ath_node;
struct ath_wiphy;
/* Macro to expand scalars to 64-bit objects */ /* Macro to expand scalars to 64-bit objects */
...@@ -398,7 +397,7 @@ struct ath_beacon { ...@@ -398,7 +397,7 @@ struct ath_beacon {
void ath_beacon_tasklet(unsigned long data); void ath_beacon_tasklet(unsigned long data);
void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif); void ath_beacon_config(struct ath_softc *sc, struct ieee80211_vif *vif);
int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif); int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif);
void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp); void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
int ath_beaconq_config(struct ath_softc *sc); int ath_beaconq_config(struct ath_softc *sc);
...@@ -628,6 +627,9 @@ struct ath_softc { ...@@ -628,6 +627,9 @@ struct ath_softc {
int led_on_cnt; int led_on_cnt;
int led_off_cnt; int led_off_cnt;
struct ath9k_hw_cal_data caldata;
int last_rssi;
int beacon_interval; int beacon_interval;
#ifdef CONFIG_ATH9K_DEBUGFS #ifdef CONFIG_ATH9K_DEBUGFS
...@@ -647,13 +649,6 @@ struct ath_softc { ...@@ -647,13 +649,6 @@ struct ath_softc {
struct pm_qos_request_list pm_qos_req; struct pm_qos_request_list pm_qos_req;
}; };
struct ath_wiphy {
struct ath_softc *sc; /* shared for all virtual wiphys */
struct ieee80211_hw *hw;
struct ath9k_hw_cal_data caldata;
int last_rssi;
};
void ath9k_tasklet(unsigned long data); void ath9k_tasklet(unsigned long data);
int ath_reset(struct ath_softc *sc, bool retry_tx); int ath_reset(struct ath_softc *sc, bool retry_tx);
int ath_cabq_update(struct ath_softc *); int ath_cabq_update(struct ath_softc *);
......
...@@ -112,8 +112,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp, ...@@ -112,8 +112,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_tx_control txctl; struct ath_tx_control txctl;
...@@ -132,8 +131,7 @@ static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb) ...@@ -132,8 +131,7 @@ static void ath_tx_cabq(struct ieee80211_hw *hw, struct sk_buff *skb)
static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_buf *bf; struct ath_buf *bf;
struct ath_vif *avp; struct ath_vif *avp;
...@@ -222,9 +220,8 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw, ...@@ -222,9 +220,8 @@ static struct ath_buf *ath_beacon_generate(struct ieee80211_hw *hw,
return bf; return bf;
} }
int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif) int ath_beacon_alloc(struct ath_softc *sc, struct ieee80211_vif *vif)
{ {
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_vif *avp; struct ath_vif *avp;
struct ath_buf *bf; struct ath_buf *bf;
......
...@@ -201,8 +201,7 @@ static bool ath_is_rfkill_set(struct ath_softc *sc) ...@@ -201,8 +201,7 @@ static bool ath_is_rfkill_set(struct ath_softc *sc)
void ath9k_rfkill_poll_state(struct ieee80211_hw *hw) void ath9k_rfkill_poll_state(struct ieee80211_hw *hw)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
bool blocked = !!ath_is_rfkill_set(sc); bool blocked = !!ath_is_rfkill_set(sc);
wiphy_rfkill_set_hw_state(hw->wiphy, blocked); wiphy_rfkill_set_hw_state(hw->wiphy, blocked);
......
...@@ -254,8 +254,7 @@ static int ath9k_reg_notifier(struct wiphy *wiphy, ...@@ -254,8 +254,7 @@ static int ath9k_reg_notifier(struct wiphy *wiphy,
struct regulatory_request *request) struct regulatory_request *request)
{ {
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah); struct ath_regulatory *reg = ath9k_hw_regulatory(sc->sc_ah);
return ath_reg_notifier_apply(wiphy, request, reg); 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,7 +703,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
const struct ath_bus_ops *bus_ops) const struct ath_bus_ops *bus_ops)
{ {
struct ieee80211_hw *hw = sc->hw; struct ieee80211_hw *hw = sc->hw;
struct ath_wiphy *aphy = hw->priv;
struct ath_common *common; struct ath_common *common;
struct ath_hw *ah; struct ath_hw *ah;
int error = 0; int error = 0;
...@@ -759,7 +757,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, ...@@ -759,7 +757,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
INIT_WORK(&sc->hw_check_work, ath_hw_check); INIT_WORK(&sc->hw_check_work, ath_hw_check);
INIT_WORK(&sc->paprd_work, ath_paprd_calibrate); INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
aphy->last_rssi = ATH_RSSI_DUMMY_MARKER; sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
ath_init_leds(sc); ath_init_leds(sc);
ath_start_rfkill_poll(sc); ath_start_rfkill_poll(sc);
......
...@@ -215,7 +215,6 @@ static void ath_update_survey_stats(struct ath_softc *sc) ...@@ -215,7 +215,6 @@ static void ath_update_survey_stats(struct ath_softc *sc)
int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
struct ath9k_channel *hchan) struct ath9k_channel *hchan)
{ {
struct ath_wiphy *aphy = hw->priv;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_conf *conf = &common->hw->conf; struct ieee80211_conf *conf = &common->hw->conf;
...@@ -262,7 +261,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, ...@@ -262,7 +261,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
fastcc = false; fastcc = false;
if (!(sc->sc_flags & SC_OP_OFFCHANNEL)) if (!(sc->sc_flags & SC_OP_OFFCHANNEL))
caldata = &aphy->caldata; caldata = &sc->caldata;
ath_dbg(common, ATH_DBG_CONFIG, ath_dbg(common, ATH_DBG_CONFIG,
"(%u MHz) -> (%u MHz), conf_is_ht40: %d fastcc: %d\n", "(%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,7 +853,6 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *bss_conf) struct ieee80211_bss_conf *bss_conf)
{ {
struct ath_wiphy *aphy = hw->priv;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
...@@ -878,7 +876,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc, ...@@ -878,7 +876,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
ath_beacon_config(sc, vif); ath_beacon_config(sc, vif);
/* Reset rssi stats */ /* Reset rssi stats */
aphy->last_rssi = ATH_RSSI_DUMMY_MARKER; sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
sc->sc_flags |= SC_OP_ANI_RUN; sc->sc_flags |= SC_OP_ANI_RUN;
...@@ -1075,8 +1073,7 @@ void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw, ...@@ -1075,8 +1073,7 @@ void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
static int ath9k_start(struct ieee80211_hw *hw) static int ath9k_start(struct ieee80211_hw *hw)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_channel *curchan = hw->conf.channel; struct ieee80211_channel *curchan = hw->conf.channel;
...@@ -1193,8 +1190,7 @@ static int ath9k_start(struct ieee80211_hw *hw) ...@@ -1193,8 +1190,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
static int ath9k_tx(struct ieee80211_hw *hw, static int ath9k_tx(struct ieee80211_hw *hw,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_tx_control txctl; struct ath_tx_control txctl;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
...@@ -1257,8 +1253,7 @@ static int ath9k_tx(struct ieee80211_hw *hw, ...@@ -1257,8 +1253,7 @@ static int ath9k_tx(struct ieee80211_hw *hw,
static void ath9k_stop(struct ieee80211_hw *hw) static void ath9k_stop(struct ieee80211_hw *hw)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
...@@ -1393,8 +1388,7 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw, ...@@ -1393,8 +1388,7 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ath9k_vif_iter_data *iter_data) struct ath9k_vif_iter_data *iter_data)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
...@@ -1418,8 +1412,7 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw, ...@@ -1418,8 +1412,7 @@ void ath9k_calculate_iter_data(struct ieee80211_hw *hw,
static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ath9k_vif_iter_data iter_data; struct ath9k_vif_iter_data iter_data;
...@@ -1475,8 +1468,7 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw, ...@@ -1475,8 +1468,7 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw, static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
ath9k_calculate_summary_state(hw, vif); ath9k_calculate_summary_state(hw, vif);
...@@ -1489,7 +1481,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw, ...@@ -1489,7 +1481,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
* in the info_changed method and set up beacons properly * in the info_changed method and set up beacons properly
* there. * there.
*/ */
error = ath_beacon_alloc(aphy, vif); error = ath_beacon_alloc(sc, vif);
if (error) if (error)
ath9k_reclaim_beacon(sc, vif); ath9k_reclaim_beacon(sc, vif);
else else
...@@ -1501,8 +1493,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw, ...@@ -1501,8 +1493,7 @@ static void ath9k_do_vif_add_setup(struct ieee80211_hw *hw,
static int ath9k_add_interface(struct ieee80211_hw *hw, static int ath9k_add_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ath_vif *avp = (void *)vif->drv_priv; struct ath_vif *avp = (void *)vif->drv_priv;
...@@ -1562,8 +1553,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1562,8 +1553,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
enum nl80211_iftype new_type, enum nl80211_iftype new_type,
bool p2p) bool p2p)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
int ret = 0; int ret = 0;
...@@ -1605,8 +1595,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw, ...@@ -1605,8 +1595,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
static void ath9k_remove_interface(struct ieee80211_hw *hw, static void ath9k_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif) struct ieee80211_vif *vif)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n"); ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
...@@ -1660,8 +1649,7 @@ static void ath9k_disable_ps(struct ath_softc *sc) ...@@ -1660,8 +1649,7 @@ static void ath9k_disable_ps(struct ath_softc *sc)
static int ath9k_config(struct ieee80211_hw *hw, u32 changed) static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_conf *conf = &hw->conf; struct ieee80211_conf *conf = &hw->conf;
...@@ -1805,8 +1793,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw, ...@@ -1805,8 +1793,7 @@ static void ath9k_configure_filter(struct ieee80211_hw *hw,
unsigned int *total_flags, unsigned int *total_flags,
u64 multicast) u64 multicast)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
u32 rfilt; u32 rfilt;
changed_flags &= SUPPORTED_FILTERS; changed_flags &= SUPPORTED_FILTERS;
...@@ -1826,8 +1813,7 @@ static int ath9k_sta_add(struct ieee80211_hw *hw, ...@@ -1826,8 +1813,7 @@ static int ath9k_sta_add(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta) struct ieee80211_sta *sta)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
ath_node_attach(sc, sta); ath_node_attach(sc, sta);
...@@ -1838,8 +1824,7 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw, ...@@ -1838,8 +1824,7 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta) struct ieee80211_sta *sta)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
ath_node_detach(sc, sta); ath_node_detach(sc, sta);
...@@ -1849,8 +1834,7 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw, ...@@ -1849,8 +1834,7 @@ static int ath9k_sta_remove(struct ieee80211_hw *hw,
static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
const struct ieee80211_tx_queue_params *params) const struct ieee80211_tx_queue_params *params)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_txq *txq; struct ath_txq *txq;
struct ath9k_tx_queue_info qi; struct ath9k_tx_queue_info qi;
...@@ -1894,8 +1878,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw, ...@@ -1894,8 +1878,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
int ret = 0; int ret = 0;
...@@ -1939,8 +1922,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1939,8 +1922,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_bss_conf *bss_conf, struct ieee80211_bss_conf *bss_conf,
u32 changed) u32 changed)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
struct ath_vif *avp = (void *)vif->drv_priv; struct ath_vif *avp = (void *)vif->drv_priv;
...@@ -1970,7 +1952,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1970,7 +1952,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
if ((changed & BSS_CHANGED_BEACON) || if ((changed & BSS_CHANGED_BEACON) ||
((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) { ((changed & BSS_CHANGED_BEACON_ENABLED) && bss_conf->enable_beacon)) {
ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
error = ath_beacon_alloc(aphy, vif); error = ath_beacon_alloc(sc, vif);
if (!error) if (!error)
ath_beacon_config(sc, vif); ath_beacon_config(sc, vif);
} }
...@@ -2007,7 +1989,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2007,7 +1989,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
if (vif->type == NL80211_IFTYPE_AP) { if (vif->type == NL80211_IFTYPE_AP) {
sc->sc_flags |= SC_OP_TSF_RESET; sc->sc_flags |= SC_OP_TSF_RESET;
ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq);
error = ath_beacon_alloc(aphy, vif); error = ath_beacon_alloc(sc, vif);
if (!error) if (!error)
ath_beacon_config(sc, vif); ath_beacon_config(sc, vif);
} else { } else {
...@@ -2045,9 +2027,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2045,9 +2027,8 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
static u64 ath9k_get_tsf(struct ieee80211_hw *hw) static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
{ {
struct ath_softc *sc = hw->priv;
u64 tsf; u64 tsf;
struct ath_wiphy *aphy = hw->priv;
struct ath_softc *sc = aphy->sc;
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
...@@ -2060,8 +2041,7 @@ static u64 ath9k_get_tsf(struct ieee80211_hw *hw) ...@@ -2060,8 +2041,7 @@ static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf) static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
ath9k_ps_wakeup(sc); ath9k_ps_wakeup(sc);
...@@ -2072,8 +2052,7 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf) ...@@ -2072,8 +2052,7 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
static void ath9k_reset_tsf(struct ieee80211_hw *hw) static void ath9k_reset_tsf(struct ieee80211_hw *hw)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
...@@ -2090,8 +2069,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, ...@@ -2090,8 +2069,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
u16 tid, u16 *ssn, u8 buf_size) u16 tid, u16 *ssn, u8 buf_size)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
int ret = 0; int ret = 0;
local_bh_disable(); local_bh_disable();
...@@ -2136,8 +2114,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, ...@@ -2136,8 +2114,7 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
struct survey_info *survey) struct survey_info *survey)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct ieee80211_channel *chan; struct ieee80211_channel *chan;
...@@ -2173,8 +2150,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx, ...@@ -2173,8 +2150,7 @@ static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class) static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
......
...@@ -126,7 +126,6 @@ static const struct ath_bus_ops ath_pci_bus_ops = { ...@@ -126,7 +126,6 @@ static const struct ath_bus_ops ath_pci_bus_ops = {
static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
{ {
void __iomem *mem; void __iomem *mem;
struct ath_wiphy *aphy;
struct ath_softc *sc; struct ath_softc *sc;
struct ieee80211_hw *hw; struct ieee80211_hw *hw;
u8 csz; u8 csz;
...@@ -198,8 +197,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -198,8 +197,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto err_iomap; goto err_iomap;
} }
hw = ieee80211_alloc_hw(sizeof(struct ath_wiphy) + hw = ieee80211_alloc_hw(sizeof(struct ath_softc), &ath9k_ops);
sizeof(struct ath_softc), &ath9k_ops);
if (!hw) { if (!hw) {
dev_err(&pdev->dev, "No memory for ieee80211_hw\n"); dev_err(&pdev->dev, "No memory for ieee80211_hw\n");
ret = -ENOMEM; ret = -ENOMEM;
...@@ -209,10 +207,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -209,10 +207,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
SET_IEEE80211_DEV(hw, &pdev->dev); SET_IEEE80211_DEV(hw, &pdev->dev);
pci_set_drvdata(pdev, hw); pci_set_drvdata(pdev, hw);
aphy = hw->priv; sc = hw->priv;
sc = (struct ath_softc *) (aphy + 1);
aphy->sc = sc;
aphy->hw = hw;
sc->hw = hw; sc->hw = hw;
sc->dev = &pdev->dev; sc->dev = &pdev->dev;
sc->mem = mem; sc->mem = mem;
...@@ -259,8 +254,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -259,8 +254,7 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
static void ath_pci_remove(struct pci_dev *pdev) static void ath_pci_remove(struct pci_dev *pdev)
{ {
struct ieee80211_hw *hw = pci_get_drvdata(pdev); struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
void __iomem *mem = sc->mem; void __iomem *mem = sc->mem;
if (!is_ath9k_unloaded) if (!is_ath9k_unloaded)
...@@ -280,8 +274,7 @@ static int ath_pci_suspend(struct device *device) ...@@ -280,8 +274,7 @@ static int ath_pci_suspend(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
struct ieee80211_hw *hw = pci_get_drvdata(pdev); struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1); ath9k_hw_set_gpio(sc->sc_ah, sc->sc_ah->led_pin, 1);
...@@ -292,8 +285,7 @@ static int ath_pci_resume(struct device *device) ...@@ -292,8 +285,7 @@ static int ath_pci_resume(struct device *device)
{ {
struct pci_dev *pdev = to_pci_dev(device); struct pci_dev *pdev = to_pci_dev(device);
struct ieee80211_hw *hw = pci_get_drvdata(pdev); struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
u32 val; u32 val;
/* /*
......
...@@ -1560,8 +1560,7 @@ static void ath_rate_add_sta_debugfs(void *priv, void *priv_sta, ...@@ -1560,8 +1560,7 @@ static void ath_rate_add_sta_debugfs(void *priv, void *priv_sta,
static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
{ {
struct ath_wiphy *aphy = hw->priv; return hw->priv;
return aphy->sc;
} }
static void ath_rate_free(void *priv) static void ath_rate_free(void *priv)
......
...@@ -927,7 +927,7 @@ static void ath9k_process_rssi(struct ath_common *common, ...@@ -927,7 +927,7 @@ static void ath9k_process_rssi(struct ath_common *common,
struct ieee80211_hdr *hdr, struct ieee80211_hdr *hdr,
struct ath_rx_status *rx_stats) struct ath_rx_status *rx_stats)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_hw *ah = common->ah; struct ath_hw *ah = common->ah;
int last_rssi; int last_rssi;
__le16 fc; __le16 fc;
...@@ -947,9 +947,9 @@ static void ath9k_process_rssi(struct ath_common *common, ...@@ -947,9 +947,9 @@ static void ath9k_process_rssi(struct ath_common *common,
} }
if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr) if (rx_stats->rs_rssi != ATH9K_RSSI_BAD && !rx_stats->rs_moreaggr)
ATH_RSSI_LPF(aphy->last_rssi, rx_stats->rs_rssi); ATH_RSSI_LPF(sc->last_rssi, rx_stats->rs_rssi);
last_rssi = aphy->last_rssi; last_rssi = sc->last_rssi;
if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER)) if (likely(last_rssi != ATH_RSSI_DUMMY_MARKER))
rx_stats->rs_rssi = ATH_EP_RND(last_rssi, rx_stats->rs_rssi = ATH_EP_RND(last_rssi,
ATH_RSSI_EP_MULTIPLIER); ATH_RSSI_EP_MULTIPLIER);
......
...@@ -1443,8 +1443,7 @@ static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb) ...@@ -1443,8 +1443,7 @@ static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb)
static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb,
int framelen) int framelen)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_sta *sta = tx_info->control.sta; struct ieee80211_sta *sta = tx_info->control.sta;
struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 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,8 +1661,7 @@ static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw,
struct ath_txq *txq, struct ath_txq *txq,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_common *common = ath9k_hw_common(sc->sc_ah);
struct ath_frame_info *fi = get_frame_info(skb); 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,8 +1762,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_sta *sta = info->control.sta; struct ieee80211_sta *sta = info->control.sta;
struct ath_wiphy *aphy = hw->priv; struct ath_softc *sc = hw->priv;
struct ath_softc *sc = aphy->sc;
struct ath_txq *txq = txctl->txq; struct ath_txq *txq = txctl->txq;
struct ath_buf *bf; struct ath_buf *bf;
int padpos, padsize; int padpos, padsize;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment