aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-12-18 19:31:26 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:09:36 -0500
commit32bfd35d4b63bd63de4bb0d791ef049c3c868726 (patch)
treec1c213a35a00bcbe71a2ecc6521e19dec66cf6eb /net/mac80211/sta_info.c
parentf653211197f3841f383fa9757ef8ce182c6cf627 (diff)
mac80211: dont use interface indices in drivers
This patch gets rid of the if_id stuff where possible in favour of a new per-virtual-interface structure "struct ieee80211_vif". This structure is located at the end of the per-interface structure and contains a variable length driver-use data area. This has two advantages: * removes the need to look up interfaces by if_id, this is better for working with network namespaces and performance * allows drivers to store and retrieve per-interface data without having to allocate own lists/hash tables Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 1257c7aab2a5..32e241764725 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -177,9 +177,16 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
177 list_add(&sta->list, &local->sta_list); 177 list_add(&sta->list, &local->sta_list);
178 local->num_sta++; 178 local->num_sta++;
179 sta_info_hash_add(local, sta); 179 sta_info_hash_add(local, sta);
180 if (local->ops->sta_notify) 180 if (local->ops->sta_notify) {
181 local->ops->sta_notify(local_to_hw(local), dev->ifindex, 181 struct ieee80211_sub_if_data *sdata;
182 STA_NOTIFY_ADD, addr); 182
183 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
184 if (sdata->type == IEEE80211_IF_TYPE_VLAN)
185 sdata = sdata->u.vlan.ap;
186
187 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
188 STA_NOTIFY_ADD, addr);
189 }
183 write_unlock_bh(&local->sta_lock); 190 write_unlock_bh(&local->sta_lock);
184 191
185#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 192#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -247,9 +254,17 @@ void sta_info_free(struct sta_info *sta)
247 ieee80211_key_free(sta->key); 254 ieee80211_key_free(sta->key);
248 sta->key = NULL; 255 sta->key = NULL;
249 256
250 if (local->ops->sta_notify) 257 if (local->ops->sta_notify) {
251 local->ops->sta_notify(local_to_hw(local), sta->dev->ifindex, 258 struct ieee80211_sub_if_data *sdata;
252 STA_NOTIFY_REMOVE, sta->addr); 259
260 sdata = IEEE80211_DEV_TO_SUB_IF(sta->dev);
261
262 if (sdata->type == IEEE80211_IF_TYPE_VLAN)
263 sdata = sdata->u.vlan.ap;
264
265 local->ops->sta_notify(local_to_hw(local), &sdata->vif,
266 STA_NOTIFY_REMOVE, sta->addr);
267 }
253 268
254 rate_control_remove_sta_debugfs(sta); 269 rate_control_remove_sta_debugfs(sta);
255 ieee80211_sta_debugfs_remove(sta); 270 ieee80211_sta_debugfs_remove(sta);