aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-10-11 17:30:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-14 13:39:59 -0400
commit2297f1c7beec785e437da3da0157666bca525c99 (patch)
tree1c6e13d2725f847fda293d2887a0c7f3befdbf35
parent6b21fd2027f8deb6fb7d3283b4c2eacabc8eeb95 (diff)
ath9k: make ath9k_cmn_update_ichannel static
Rework its wrapper function to make it more generic, using it as a replacement for previous calls to ath9k_cmn_update_ichannel. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/common.c16
-rw-r--r--drivers/net/wireless/ath/ath9k/common.h7
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c7
5 files changed, 17 insertions, 21 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index b5ac26994f19..a7e5a05b2eff 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -52,8 +52,8 @@ EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_keytype);
52/* 52/*
53 * Update internal channel flags. 53 * Update internal channel flags.
54 */ 54 */
55void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, 55static void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
56 struct cfg80211_chan_def *chandef) 56 struct cfg80211_chan_def *chandef)
57{ 57{
58 struct ieee80211_channel *chan = chandef->chan; 58 struct ieee80211_channel *chan = chandef->chan;
59 u16 flags = 0; 59 u16 flags = 0;
@@ -88,25 +88,25 @@ void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan,
88 88
89 ichan->channelFlags = flags; 89 ichan->channelFlags = flags;
90} 90}
91EXPORT_SYMBOL(ath9k_cmn_update_ichannel);
92 91
93/* 92/*
94 * Get the internal channel reference. 93 * Get the internal channel reference.
95 */ 94 */
96struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw, 95struct ath9k_channel *ath9k_cmn_get_channel(struct ieee80211_hw *hw,
97 struct ath_hw *ah) 96 struct ath_hw *ah,
97 struct cfg80211_chan_def *chandef)
98{ 98{
99 struct ieee80211_channel *curchan = hw->conf.chandef.chan; 99 struct ieee80211_channel *curchan = chandef->chan;
100 struct ath9k_channel *channel; 100 struct ath9k_channel *channel;
101 u8 chan_idx; 101 u8 chan_idx;
102 102
103 chan_idx = curchan->hw_value; 103 chan_idx = curchan->hw_value;
104 channel = &ah->channels[chan_idx]; 104 channel = &ah->channels[chan_idx];
105 ath9k_cmn_update_ichannel(channel, &hw->conf.chandef); 105 ath9k_cmn_update_ichannel(channel, chandef);
106 106
107 return channel; 107 return channel;
108} 108}
109EXPORT_SYMBOL(ath9k_cmn_get_curchannel); 109EXPORT_SYMBOL(ath9k_cmn_get_channel);
110 110
111int ath9k_cmn_count_streams(unsigned int chainmask, int max) 111int ath9k_cmn_count_streams(unsigned int chainmask, int max)
112{ 112{
diff --git a/drivers/net/wireless/ath/ath9k/common.h b/drivers/net/wireless/ath/ath9k/common.h
index e039bcbfbd79..eb85e1bdca88 100644
--- a/drivers/net/wireless/ath/ath9k/common.h
+++ b/drivers/net/wireless/ath/ath9k/common.h
@@ -43,10 +43,9 @@
43 (((x) + ((mul)/2)) / (mul)) 43 (((x) + ((mul)/2)) / (mul))
44 44
45int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb); 45int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
46void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, 46struct ath9k_channel *ath9k_cmn_get_channel(struct ieee80211_hw *hw,
47 struct cfg80211_chan_def *chandef); 47 struct ath_hw *ah,
48struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw, 48 struct cfg80211_chan_def *chandef);
49 struct ath_hw *ah);
50int ath9k_cmn_count_streams(unsigned int chainmask, int max); 49int ath9k_cmn_count_streams(unsigned int chainmask, int max);
51void ath9k_cmn_btcoex_bt_stomp(struct ath_common *common, 50void ath9k_cmn_btcoex_bt_stomp(struct ath_common *common,
52 enum ath_stomp_type stomp_type); 51 enum ath_stomp_type stomp_type);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index fa71af11fc5e..9a2657fdd9cc 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -906,7 +906,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
906 WMI_CMD(WMI_FLUSH_RECV_CMDID); 906 WMI_CMD(WMI_FLUSH_RECV_CMDID);
907 907
908 /* setup initial channel */ 908 /* setup initial channel */
909 init_channel = ath9k_cmn_get_curchannel(hw, ah); 909 init_channel = ath9k_cmn_get_channel(hw, ah, &hw->conf.chandef);
910 910
911 ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false); 911 ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
912 if (ret) { 912 if (ret) {
@@ -1188,9 +1188,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1188 ath_dbg(common, CONFIG, "Set channel: %d MHz\n", 1188 ath_dbg(common, CONFIG, "Set channel: %d MHz\n",
1189 curchan->center_freq); 1189 curchan->center_freq);
1190 1190
1191 ath9k_cmn_update_ichannel(&priv->ah->channels[pos], 1191 ath9k_cmn_get_channel(hw, priv->ah, &hw->conf.chandef);
1192 &hw->conf.chandef);
1193
1194 if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) { 1192 if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
1195 ath_err(common, "Unable to set channel\n"); 1193 ath_err(common, "Unable to set channel\n");
1196 ret = -EINVAL; 1194 ret = -EINVAL;
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 2306f5788675..9c145faa997d 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -802,7 +802,7 @@ static void ath9k_init_band_txpower(struct ath_softc *sc, int band)
802 chan = &sband->channels[i]; 802 chan = &sband->channels[i];
803 ah->curchan = &ah->channels[chan->hw_value]; 803 ah->curchan = &ah->channels[chan->hw_value];
804 cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20); 804 cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20);
805 ath9k_cmn_update_ichannel(ah->curchan, &chandef); 805 ath9k_cmn_get_channel(sc->hw, ah, &chandef);
806 ath9k_hw_set_txpowerlimit(ah, MAX_RATE_POWER, true); 806 ath9k_hw_set_txpowerlimit(ah, MAX_RATE_POWER, true);
807 } 807 }
808} 808}
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index cdb3b1e10b95..ecbeccdb60bc 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -601,7 +601,7 @@ static int ath9k_start(struct ieee80211_hw *hw)
601 ath9k_ps_wakeup(sc); 601 ath9k_ps_wakeup(sc);
602 mutex_lock(&sc->mutex); 602 mutex_lock(&sc->mutex);
603 603
604 init_channel = ath9k_cmn_get_curchannel(hw, ah); 604 init_channel = ath9k_cmn_get_channel(hw, ah, &hw->conf.chandef);
605 605
606 /* Reset SERDES registers */ 606 /* Reset SERDES registers */
607 ath9k_hw_configpcipowersave(ah, false); 607 ath9k_hw_configpcipowersave(ah, false);
@@ -804,7 +804,7 @@ static void ath9k_stop(struct ieee80211_hw *hw)
804 } 804 }
805 805
806 if (!ah->curchan) 806 if (!ah->curchan)
807 ah->curchan = ath9k_cmn_get_curchannel(hw, ah); 807 ah->curchan = ath9k_cmn_get_channel(hw, ah, &hw->conf.chandef);
808 808
809 ath9k_hw_reset(ah, ah->curchan, ah->caldata, false); 809 ath9k_hw_reset(ah, ah->curchan, ah->caldata, false);
810 ath9k_hw_phy_disable(ah); 810 ath9k_hw_phy_disable(ah);
@@ -1224,8 +1224,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1224 ath_update_survey_stats(sc); 1224 ath_update_survey_stats(sc);
1225 spin_unlock_irqrestore(&common->cc_lock, flags); 1225 spin_unlock_irqrestore(&common->cc_lock, flags);
1226 1226
1227 ath9k_cmn_update_ichannel(&sc->sc_ah->channels[pos], 1227 ath9k_cmn_get_channel(hw, ah, &conf->chandef);
1228 &conf->chandef);
1229 1228
1230 /* 1229 /*
1231 * If the operating channel changes, change the survey in-use flags 1230 * If the operating channel changes, change the survey in-use flags