aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-02-20 21:19:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-23 16:25:27 -0500
commitffbe7c83cb4a9d05ff49cdc8e2b02b88ccbae826 (patch)
treecc4d5380f18c525c1b2342cff19fb08a5b9da6a1 /drivers/net/wireless/ath
parentda8d9d937b34cf5d82e01420d015d8ee14f76467 (diff)
ath9k_htc: Calculate and set the HW opmode
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 51a8c51510e8..9733580579a9 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -166,6 +166,18 @@ static void ath9k_htc_set_bssid_mask(struct ath9k_htc_priv *priv,
166 ath_hw_setbssidmask(common); 166 ath_hw_setbssidmask(common);
167} 167}
168 168
169static void ath9k_htc_set_opmode(struct ath9k_htc_priv *priv)
170{
171 if (priv->num_ibss_vif)
172 priv->ah->opmode = NL80211_IFTYPE_ADHOC;
173 else if (priv->num_ap_vif)
174 priv->ah->opmode = NL80211_IFTYPE_AP;
175 else
176 priv->ah->opmode = NL80211_IFTYPE_STATION;
177
178 ath9k_hw_setopmode(priv->ah);
179}
180
169void ath9k_htc_reset(struct ath9k_htc_priv *priv) 181void ath9k_htc_reset(struct ath9k_htc_priv *priv)
170{ 182{
171 struct ath_hw *ah = priv->ah; 183 struct ath_hw *ah = priv->ah;
@@ -1252,12 +1264,12 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
1252 1264
1253 ath9k_htc_set_bssid_mask(priv, vif); 1265 ath9k_htc_set_bssid_mask(priv, vif);
1254 1266
1255 priv->ah->opmode = vif->type;
1256 priv->vif_slot |= (1 << avp->index); 1267 priv->vif_slot |= (1 << avp->index);
1257 priv->nvifs++; 1268 priv->nvifs++;
1258 priv->vif = vif; 1269 priv->vif = vif;
1259 1270
1260 INC_VIF(priv, vif->type); 1271 INC_VIF(priv, vif->type);
1272 ath9k_htc_set_opmode(priv);
1261 1273
1262 ath_dbg(common, ATH_DBG_CONFIG, 1274 ath_dbg(common, ATH_DBG_CONFIG,
1263 "Attach a VIF of type: %d at idx: %d\n", vif->type, avp->index); 1275 "Attach a VIF of type: %d at idx: %d\n", vif->type, avp->index);
@@ -1293,6 +1305,7 @@ static void ath9k_htc_remove_interface(struct ieee80211_hw *hw,
1293 priv->vif = NULL; 1305 priv->vif = NULL;
1294 1306
1295 DEC_VIF(priv, vif->type); 1307 DEC_VIF(priv, vif->type);
1308 ath9k_htc_set_opmode(priv);
1296 1309
1297 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface at idx: %d\n", avp->index); 1310 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface at idx: %d\n", avp->index);
1298 1311