aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index d44258172c0f..9a2657fdd9cc 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -24,30 +24,10 @@
24static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv, 24static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv,
25 struct ath9k_channel *ichan) 25 struct ath9k_channel *ichan)
26{ 26{
27 enum htc_phymode mode; 27 if (IS_CHAN_5GHZ(ichan))
28 28 return HTC_MODE_11NA;
29 mode = -EINVAL;
30
31 switch (ichan->chanmode) {
32 case CHANNEL_G:
33 case CHANNEL_G_HT20:
34 case CHANNEL_G_HT40PLUS:
35 case CHANNEL_G_HT40MINUS:
36 mode = HTC_MODE_11NG;
37 break;
38 case CHANNEL_A:
39 case CHANNEL_A_HT20:
40 case CHANNEL_A_HT40PLUS:
41 case CHANNEL_A_HT40MINUS:
42 mode = HTC_MODE_11NA;
43 break;
44 default:
45 break;
46 }
47 29
48 WARN_ON(mode < 0); 30 return HTC_MODE_11NG;
49
50 return mode;
51} 31}
52 32
53bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, 33bool ath9k_htc_setpower(struct ath9k_htc_priv *priv,
@@ -926,7 +906,7 @@ static int ath9k_htc_start(struct ieee80211_hw *hw)
926 WMI_CMD(WMI_FLUSH_RECV_CMDID); 906 WMI_CMD(WMI_FLUSH_RECV_CMDID);
927 907
928 /* setup initial channel */ 908 /* setup initial channel */
929 init_channel = ath9k_cmn_get_curchannel(hw, ah); 909 init_channel = ath9k_cmn_get_channel(hw, ah, &hw->conf.chandef);
930 910
931 ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false); 911 ret = ath9k_hw_reset(ah, init_channel, ah->caldata, false);
932 if (ret) { 912 if (ret) {
@@ -1208,9 +1188,7 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1208 ath_dbg(common, CONFIG, "Set channel: %d MHz\n", 1188 ath_dbg(common, CONFIG, "Set channel: %d MHz\n",
1209 curchan->center_freq); 1189 curchan->center_freq);
1210 1190
1211 ath9k_cmn_update_ichannel(&priv->ah->channels[pos], 1191 ath9k_cmn_get_channel(hw, priv->ah, &hw->conf.chandef);
1212 &hw->conf.chandef);
1213
1214 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) {
1215 ath_err(common, "Unable to set channel\n"); 1193 ath_err(common, "Unable to set channel\n");
1216 ret = -EINVAL; 1194 ret = -EINVAL;