aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-01-04 14:36:21 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-10 15:40:52 -0500
commit55de80d64545e5c4cca7f574fdf04b1f02a5f8fd (patch)
tree149179436e08a8983224fa6c896f28e324df52b7
parent4976b4eb9d083f035aa97afec560c7e1c16c6afd (diff)
ath9k_htc: Really fix packet injection
The chainmask value along with other configuration has to be set on the target for packet injection. Fix this and also move the monitor interface addition before the channel set segment to ensure that the opmode is updated properly. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c37
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,
433void ath9k_htc_beaconep(void *drv_priv, struct sk_buff *skb, 433void 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
436int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv);
436void ath9k_htc_station_work(struct work_struct *work); 437void ath9k_htc_station_work(struct work_struct *work);
437void ath9k_htc_aggr_work(struct work_struct *work); 438void ath9k_htc_aggr_work(struct work_struct *work);
438void ath9k_ani_work(struct work_struct *work);; 439void 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
306err_vif: 316err_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
422static int ath9k_htc_update_cap_target(struct ath9k_htc_priv *priv) 433int 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) {