diff options
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_main.c | 37 |
2 files changed, 27 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index a099b3e87ed3..1ce506f23110 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -433,6 +433,7 @@ void ath9k_htc_txep(void *priv, struct sk_buff *skb, enum htc_endpoint_id ep_id, | |||
433 | void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, | 433 | void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, |
434 | enum htc_endpoint_id ep_id, bool txok); | 434 | enum htc_endpoint_id ep_id, bool txok); |
435 | 435 | ||
436 | int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv); | ||
436 | void ath9k_htc_station_work(struct work_struct *work); | 437 | void ath9k_htc_station_work(struct work_struct *work); |
437 | void ath9k_htc_aggr_work(struct work_struct *work); | 438 | void ath9k_htc_aggr_work(struct work_struct *work); |
438 | void ath9k_ani_work(struct work_struct *work);; | 439 | void ath9k_ani_work(struct work_struct *work);; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 845b4c938d16..f4d576bc3ccd 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -301,6 +301,16 @@ static int ath9k_htc_add_monitor_interface(struct ath9k_htc_priv *priv) | |||
301 | 301 | ||
302 | priv->nstations++; | 302 | priv->nstations++; |
303 | 303 | ||
304 | /* | ||
305 | * Set chainmask etc. on the target. | ||
306 | */ | ||
307 | ret = ath9k_htc_update_cap_target(priv); | ||
308 | if (ret) | ||
309 | ath_dbg(common, ATH_DBG_CONFIG, | ||
310 | "Failed to update capability in target\n"); | ||
311 | |||
312 | priv->ah->is_monitoring = true; | ||
313 | |||
304 | return 0; | 314 | return 0; |
305 | 315 | ||
306 | err_vif: | 316 | err_vif: |
@@ -328,6 +338,7 @@ static int ath9k_htc_remove_monitor_interface(struct ath9k_htc_priv *priv) | |||
328 | } | 338 | } |
329 | 339 | ||
330 | priv->nstations--; | 340 | priv->nstations--; |
341 | priv->ah->is_monitoring = false; | ||
331 | 342 | ||
332 | return 0; | 343 | return 0; |
333 | } | 344 | } |
@@ -419,7 +430,7 @@ static int ath9k_htc_remove_station(struct ath9k_htc_priv *priv, | |||
419 | return 0; | 430 | return 0; |
420 | } | 431 | } |
421 | 432 | ||
422 | static int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv) | 433 | int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv) |
423 | { | 434 | { |
424 | struct ath9k_htc_cap_target tcap; | 435 | struct ath9k_htc_cap_target tcap; |
425 | int ret; | 436 | int ret; |
@@ -1186,6 +1197,20 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) | |||
1186 | } | 1197 | } |
1187 | } | 1198 | } |
1188 | 1199 | ||
1200 | /* | ||
1201 | * Monitor interface should be added before | ||
1202 | * IEEE80211_CONF_CHANGE_CHANNEL is handled. | ||
1203 | */ | ||
1204 | if (changed & IEEE80211_CONF_CHANGE_MONITOR) { | ||
1205 | if (conf->flags & IEEE80211_CONF_MONITOR) { | ||
1206 | if (ath9k_htc_add_monitor_interface(priv)) | ||
1207 | ath_err(common, "Failed to set monitor mode\n"); | ||
1208 | else | ||
1209 | ath_dbg(common, ATH_DBG_CONFIG, | ||
1210 | "HW opmode set to Monitor mode\n"); | ||
1211 | } | ||
1212 | } | ||
1213 | |||
1189 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { | 1214 | if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { |
1190 | struct ieee80211_channel *curchan = hw->conf.channel; | 1215 | struct ieee80211_channel *curchan = hw->conf.channel; |
1191 | int pos = curchan->hw_value; | 1216 | int pos = curchan->hw_value; |
@@ -1221,16 +1246,6 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed) | |||
1221 | ath_update_txpow(priv); | 1246 | ath_update_txpow(priv); |
1222 | } | 1247 | } |
1223 | 1248 | ||
1224 | if (changed & IEEE80211_CONF_CHANGE_MONITOR) { | ||
1225 | if (conf->flags & IEEE80211_CONF_MONITOR) { | ||
1226 | if (ath9k_htc_add_monitor_interface(priv)) | ||
1227 | ath_err(common, "Failed to set monitor mode\n"); | ||
1228 | else | ||
1229 | ath_dbg(common, ATH_DBG_CONFIG, | ||
1230 | "HW opmode set to Monitor mode\n"); | ||
1231 | } | ||
1232 | } | ||
1233 | |||
1234 | if (changed & IEEE80211_CONF_CHANGE_IDLE) { | 1249 | if (changed & IEEE80211_CONF_CHANGE_IDLE) { |
1235 | mutex_lock(&priv->htc_pm_lock); | 1250 | mutex_lock(&priv->htc_pm_lock); |
1236 | if (!priv->ps_idle) { | 1251 | if (!priv->ps_idle) { |