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.c70
1 files changed, 9 insertions, 61 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 9a3be8da755d..e9761c2c8700 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -29,7 +29,7 @@ static void ath_update_txpow(struct ath9k_htc_priv *priv)
29 struct ath_hw *ah = priv->ah; 29 struct ath_hw *ah = priv->ah;
30 30
31 if (priv->curtxpow != priv->txpowlimit) { 31 if (priv->curtxpow != priv->txpowlimit) {
32 ath9k_hw_set_txpowerlimit(ah, priv->txpowlimit); 32 ath9k_hw_set_txpowerlimit(ah, priv->txpowlimit, false);
33 /* read back in case value is clamped */ 33 /* read back in case value is clamped */
34 priv->curtxpow = ath9k_hw_regulatory(ah)->power_limit; 34 priv->curtxpow = ath9k_hw_regulatory(ah)->power_limit;
35 } 35 }
@@ -184,47 +184,6 @@ err:
184 return ret; 184 return ret;
185} 185}
186 186
187static int ath9k_htc_add_monitor_interface(struct ath9k_htc_priv *priv)
188{
189 struct ath_common *common = ath9k_hw_common(priv->ah);
190 struct ath9k_htc_target_vif hvif;
191 int ret = 0;
192 u8 cmd_rsp;
193
194 if (priv->nvifs > 0)
195 return -ENOBUFS;
196
197 memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif));
198 memcpy(&hvif.myaddr, common->macaddr, ETH_ALEN);
199
200 hvif.opmode = cpu_to_be32(HTC_M_MONITOR);
201 priv->ah->opmode = NL80211_IFTYPE_MONITOR;
202 hvif.index = priv->nvifs;
203
204 WMI_CMD_BUF(WMI_VAP_CREATE_CMDID, &hvif);
205 if (ret)
206 return ret;
207
208 priv->nvifs++;
209 return 0;
210}
211
212static int ath9k_htc_remove_monitor_interface(struct ath9k_htc_priv *priv)
213{
214 struct ath_common *common = ath9k_hw_common(priv->ah);
215 struct ath9k_htc_target_vif hvif;
216 int ret = 0;
217 u8 cmd_rsp;
218
219 memset(&hvif, 0, sizeof(struct ath9k_htc_target_vif));
220 memcpy(&hvif.myaddr, common->macaddr, ETH_ALEN);
221 hvif.index = 0; /* Should do for now */
222 WMI_CMD_BUF(WMI_VAP_REMOVE_CMDID, &hvif);
223 priv->nvifs--;
224
225 return ret;
226}
227
228static int ath9k_htc_add_station(struct ath9k_htc_priv *priv, 187static int ath9k_htc_add_station(struct ath9k_htc_priv *priv,
229 struct ieee80211_vif *vif, 188 struct ieee80211_vif *vif,
230 struct ieee80211_sta *sta) 189 struct ieee80211_sta *sta)
@@ -1240,16 +1199,6 @@ static void ath9k_htc_stop(struct ieee80211_hw *hw)
1240 WMI_CMD(WMI_STOP_RECV_CMDID); 1199 WMI_CMD(WMI_STOP_RECV_CMDID);
1241 skb_queue_purge(&priv->tx_queue); 1200 skb_queue_purge(&priv->tx_queue);
1242 1201
1243 /* Remove monitor interface here */
1244 if (ah->opmode == NL80211_IFTYPE_MONITOR) {
1245 if (ath9k_htc_remove_monitor_interface(priv))
1246 ath_print(common, ATH_DBG_FATAL,
1247 "Unable to remove monitor interface\n");
1248 else
1249 ath_print(common, ATH_DBG_CONFIG,
1250 "Monitor interface removed\n");
1251 }
1252
1253 if (ah->btcoex_hw.enabled) { 1202 if (ah->btcoex_hw.enabled) {
1254 ath9k_hw_btcoex_disable(ah); 1203 ath9k_hw_btcoex_disable(ah);
1255 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) 1204 if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
@@ -1400,7 +1349,9 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1400 ath_print(common, ATH_DBG_CONFIG, "Set channel: %d MHz\n", 1349 ath_print(common, ATH_DBG_CONFIG, "Set channel: %d MHz\n",
1401 curchan->center_freq); 1350 curchan->center_freq);
1402 1351
1403 ath9k_cmn_update_ichannel(hw, &priv->ah->channels[pos]); 1352 ath9k_cmn_update_ichannel(&priv->ah->channels[pos],
1353 hw->conf.channel,
1354 hw->conf.channel_type);
1404 1355
1405 if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) { 1356 if (ath9k_htc_set_channel(priv, hw, &priv->ah->channels[pos]) < 0) {
1406 ath_print(common, ATH_DBG_FATAL, 1357 ath_print(common, ATH_DBG_FATAL,
@@ -1421,16 +1372,13 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1421 } 1372 }
1422 } 1373 }
1423 1374
1424 if (changed & IEEE80211_CONF_CHANGE_MONITOR) { 1375 if (changed & IEEE80211_CONF_CHANGE_MONITOR)
1425 if (conf->flags & IEEE80211_CONF_MONITOR) { 1376 if (conf->flags & IEEE80211_CONF_MONITOR) {
1426 if (ath9k_htc_add_monitor_interface(priv)) 1377 ath_print(common, ATH_DBG_CONFIG,
1427 ath_print(common, ATH_DBG_FATAL, 1378 "HW opmode set to Monitor mode\n");
1428 "Failed to set monitor mode\n"); 1379 priv->ah->opmode = NL80211_IFTYPE_MONITOR;
1429 else
1430 ath_print(common, ATH_DBG_CONFIG,
1431 "HW opmode set to Monitor mode\n");
1432 } 1380 }
1433 } 1381
1434 1382
1435 if (changed & IEEE80211_CONF_CHANGE_IDLE) { 1383 if (changed & IEEE80211_CONF_CHANGE_IDLE) {
1436 mutex_lock(&priv->htc_pm_lock); 1384 mutex_lock(&priv->htc_pm_lock);