aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-02-20 21:18:46 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-23 16:25:26 -0500
commit585895cdfc683a067d803fead83267cee309ffd0 (patch)
treea18e29f8f8f74a5e5146386dab3d40cfe690a4bc /drivers
parent7c277349ecbd66e19fad3d949fa6ef6c131a3b62 (diff)
ath9k_htc: Set the BSSID mask for multiple interfaces
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h5
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c35
2 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index eecb42b24bc5..11d028f2156e 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -210,6 +210,11 @@ struct ath9k_htc_vif {
210 u8 index; 210 u8 index;
211}; 211};
212 212
213struct ath9k_vif_iter_data {
214 const u8 *hw_macaddr;
215 u8 mask[ETH_ALEN];
216};
217
213#define ATH9K_HTC_MAX_STA 8 218#define ATH9K_HTC_MAX_STA 8
214#define ATH9K_HTC_MAX_TID 8 219#define ATH9K_HTC_MAX_TID 8
215 220
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 5ef076978181..9620f4532f02 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -133,6 +133,39 @@ static void ath9k_htc_vif_reconfig(struct ath9k_htc_priv *priv)
133 } 133 }
134} 134}
135 135
136static void ath9k_htc_bssid_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
137{
138 struct ath9k_vif_iter_data *iter_data = data;
139 int i;
140
141 for (i = 0; i < ETH_ALEN; i++)
142 iter_data->mask[i] &= ~(iter_data->hw_macaddr[i] ^ mac[i]);
143}
144
145static void ath9k_htc_set_bssid_mask(struct ath9k_htc_priv *priv,
146 struct ieee80211_vif *vif)
147{
148 struct ath_common *common = ath9k_hw_common(priv->ah);
149 struct ath9k_vif_iter_data iter_data;
150
151 /*
152 * Use the hardware MAC address as reference, the hardware uses it
153 * together with the BSSID mask when matching addresses.
154 */
155 iter_data.hw_macaddr = common->macaddr;
156 memset(&iter_data.mask, 0xff, ETH_ALEN);
157
158 if (vif)
159 ath9k_htc_bssid_iter(&iter_data, vif->addr, vif);
160
161 /* Get list of all active MAC addresses */
162 ieee80211_iterate_active_interfaces_atomic(priv->hw, ath9k_htc_bssid_iter,
163 &iter_data);
164
165 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
166 ath_hw_setbssidmask(common);
167}
168
136void ath9k_htc_reset(struct ath9k_htc_priv *priv) 169void ath9k_htc_reset(struct ath9k_htc_priv *priv)
137{ 170{
138 struct ath_hw *ah = priv->ah; 171 struct ath_hw *ah = priv->ah;
@@ -1200,6 +1233,8 @@ static int ath9k_htc_add_interface(struct ieee80211_hw *hw,
1200 goto out; 1233 goto out;
1201 } 1234 }
1202 1235
1236 ath9k_htc_set_bssid_mask(priv, vif);
1237
1203 priv->ah->opmode = vif->type; 1238 priv->ah->opmode = vif->type;
1204 priv->vif_slot |= (1 << avp->index); 1239 priv->vif_slot |= (1 << avp->index);
1205 priv->nvifs++; 1240 priv->nvifs++;