aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/mac80211.h20
-rw-r--r--net/mac80211/sta_info.c13
2 files changed, 23 insertions, 10 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index eac670a22ef4..9bc03f053af0 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -613,6 +613,18 @@ enum set_key_cmd {
613 SET_KEY, DISABLE_KEY, 613 SET_KEY, DISABLE_KEY,
614}; 614};
615 615
616/**
617 * enum sta_notify_cmd - sta notify command
618 *
619 * Used with the sta_notify() callback in &struct ieee80211_ops, this
620 * indicates addition and removal of a station to station table
621 *
622 * @STA_NOTIFY_ADD: a station was added to the station table
623 * @STA_NOTIFY_REMOVE: a station being removed from the station table
624 */
625enum sta_notify_cmd {
626 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE
627};
616 628
617/** 629/**
618 * enum ieee80211_hw_flags - hardware flags 630 * enum ieee80211_hw_flags - hardware flags
@@ -957,8 +969,8 @@ enum ieee80211_erp_change_flags {
957 * 969 *
958 * @set_retry_limit: Configuration of retry limits (if device needs it) 970 * @set_retry_limit: Configuration of retry limits (if device needs it)
959 * 971 *
960 * @sta_table_notification: Number of STAs in STA table notification. Must 972 * @sta_notify: Notifies low level driver about addition or removal
961 * be atomic. 973 * of assocaited station or AP.
962 * 974 *
963 * @erp_ie_changed: Handle ERP IE change notifications. Must be atomic. 975 * @erp_ie_changed: Handle ERP IE change notifications. Must be atomic.
964 * 976 *
@@ -1025,8 +1037,8 @@ struct ieee80211_ops {
1025 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); 1037 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1026 int (*set_retry_limit)(struct ieee80211_hw *hw, 1038 int (*set_retry_limit)(struct ieee80211_hw *hw,
1027 u32 short_retry, u32 long_retr); 1039 u32 short_retry, u32 long_retr);
1028 void (*sta_table_notification)(struct ieee80211_hw *hw, 1040 void (*sta_notify)(struct ieee80211_hw *hw, int if_id,
1029 int num_sta); 1041 enum sta_notify_cmd, const u8 *addr);
1030 void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes, 1042 void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes,
1031 int cts_protection, int preamble); 1043 int cts_protection, int preamble);
1032 int (*conf_tx)(struct ieee80211_hw *hw, int queue, 1044 int (*conf_tx)(struct ieee80211_hw *hw, int queue,
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 7c7df87f673c..e8491554a5dc 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -159,9 +159,9 @@ struct sta_info * sta_info_add(struct ieee80211_local *local,
159 list_add(&sta->list, &local->sta_list); 159 list_add(&sta->list, &local->sta_list);
160 local->num_sta++; 160 local->num_sta++;
161 sta_info_hash_add(local, sta); 161 sta_info_hash_add(local, sta);
162 if (local->ops->sta_table_notification) 162 if (local->ops->sta_notify)
163 local->ops->sta_table_notification(local_to_hw(local), 163 local->ops->sta_notify(local_to_hw(local), dev->ifindex,
164 local->num_sta); 164 STA_NOTIFY_ADD, addr);
165 write_unlock_bh(&local->sta_lock); 165 write_unlock_bh(&local->sta_lock);
166 166
167#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 167#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
@@ -199,9 +199,6 @@ void sta_info_remove(struct sta_info *sta)
199 local->num_sta--; 199 local->num_sta--;
200 sta_info_remove_aid_ptr(sta); 200 sta_info_remove_aid_ptr(sta);
201 201
202 if (local->ops->sta_table_notification)
203 local->ops->sta_table_notification(local_to_hw(local),
204 local->num_sta);
205} 202}
206 203
207void sta_info_free(struct sta_info *sta) 204void sta_info_free(struct sta_info *sta)
@@ -232,6 +229,10 @@ void sta_info_free(struct sta_info *sta)
232 ieee80211_key_free(sta->key); 229 ieee80211_key_free(sta->key);
233 sta->key = NULL; 230 sta->key = NULL;
234 231
232 if (local->ops->sta_notify)
233 local->ops->sta_notify(local_to_hw(local), sta->dev->ifindex,
234 STA_NOTIFY_REMOVE, sta->addr);
235
235 rate_control_remove_sta_debugfs(sta); 236 rate_control_remove_sta_debugfs(sta);
236 ieee80211_sta_debugfs_remove(sta); 237 ieee80211_sta_debugfs_remove(sta);
237 238