aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanoharan@atheros.com>2010-10-26 10:41:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:24:42 -0500
commit446fad5a5b6be765c8ec39bfdbbc6c7aa63fbcbb (patch)
treedca66ba6f4c95a8457da784d54c319bca39e4a5a /drivers/net
parentf60dc0138aa19769bf8bab9f93b043235428b66f (diff)
ath9k_htc: Handle monitor mode properly for HTC devices
No need to inform about monitor interface changes to firmware. Set the HW mode to monitor type based on mac80211 indication flag is sufficient. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c64
1 files changed, 5 insertions, 59 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 8266ce1f02e3..e9761c2c8700 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -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)
@@ -1423,16 +1372,13 @@ static int ath9k_htc_config(struct ieee80211_hw *hw, u32 changed)
1423 } 1372 }
1424 } 1373 }
1425 1374
1426 if (changed & IEEE80211_CONF_CHANGE_MONITOR) { 1375 if (changed & IEEE80211_CONF_CHANGE_MONITOR)
1427 if (conf->flags & IEEE80211_CONF_MONITOR) { 1376 if (conf->flags & IEEE80211_CONF_MONITOR) {
1428 if (ath9k_htc_add_monitor_interface(priv)) 1377 ath_print(common, ATH_DBG_CONFIG,
1429 ath_print(common, ATH_DBG_FATAL, 1378 "HW opmode set to Monitor mode\n");
1430 "Failed to set monitor mode\n"); 1379 priv->ah->opmode = NL80211_IFTYPE_MONITOR;
1431 else
1432 ath_print(common, ATH_DBG_CONFIG,
1433 "HW opmode set to Monitor mode\n");
1434 } 1380 }
1435 } 1381
1436 1382
1437 if (changed & IEEE80211_CONF_CHANGE_IDLE) { 1383 if (changed & IEEE80211_CONF_CHANGE_IDLE) {
1438 mutex_lock(&priv->htc_pm_lock); 1384 mutex_lock(&priv->htc_pm_lock);