diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-01-20 07:55:21 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:48:24 -0500 |
commit | f09603a259ffef69ad4516a04eb06cd65ac522fe (patch) | |
tree | 3f826769c697eb15a76771e25291bbb54f9f58ab /include/net/mac80211.h | |
parent | 71ec375c75095002f36f083ceb32bbb8725734ae (diff) |
mac80211: add sta_state callback
(based on Eliad's patch)
Add a callback to notify the low-level driver whenever
the state of a station changes. The driver is only
notified when the station is actually in the mac80211
hash table, not for pre-insert state transitions.
To allow the driver to replace sta_add/remove calls
with this, call extra transitions with the NOTEXIST
state.
This callback can fail, so we need to be careful in
handling it when a station is inserted, particularly
in the IBSS case where we still keep the station entry
around for mac80211 purposes.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r-- | include/net/mac80211.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 520eb4c5e5a2..922313f0b39b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -982,6 +982,25 @@ enum set_key_cmd { | |||
982 | }; | 982 | }; |
983 | 983 | ||
984 | /** | 984 | /** |
985 | * enum ieee80211_sta_state - station state | ||
986 | * | ||
987 | * @IEEE80211_STA_NOTEXIST: station doesn't exist at all, | ||
988 | * this is a special state for add/remove transitions | ||
989 | * @IEEE80211_STA_NONE: station exists without special state | ||
990 | * @IEEE80211_STA_AUTH: station is authenticated | ||
991 | * @IEEE80211_STA_ASSOC: station is associated | ||
992 | * @IEEE80211_STA_AUTHORIZED: station is authorized (802.1X) | ||
993 | */ | ||
994 | enum ieee80211_sta_state { | ||
995 | /* NOTE: These need to be ordered correctly! */ | ||
996 | IEEE80211_STA_NOTEXIST, | ||
997 | IEEE80211_STA_NONE, | ||
998 | IEEE80211_STA_AUTH, | ||
999 | IEEE80211_STA_ASSOC, | ||
1000 | IEEE80211_STA_AUTHORIZED, | ||
1001 | }; | ||
1002 | |||
1003 | /** | ||
985 | * struct ieee80211_sta - station table entry | 1004 | * struct ieee80211_sta - station table entry |
986 | * | 1005 | * |
987 | * A station table entry represents a station we are possibly | 1006 | * A station table entry represents a station we are possibly |
@@ -1974,6 +1993,13 @@ enum ieee80211_frame_release_type { | |||
1974 | * in AP mode, this callback will not be called when the flag | 1993 | * in AP mode, this callback will not be called when the flag |
1975 | * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic. | 1994 | * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic. |
1976 | * | 1995 | * |
1996 | * @sta_state: Notifies low level driver about state transition of a | ||
1997 | * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) | ||
1998 | * This callback is mutually exclusive with @sta_add/@sta_remove. | ||
1999 | * It must not fail for down transitions but may fail for transitions | ||
2000 | * up the list of states. | ||
2001 | * The callback can sleep. | ||
2002 | * | ||
1977 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 2003 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1978 | * bursting) for a hardware TX queue. | 2004 | * bursting) for a hardware TX queue. |
1979 | * Returns a negative error code on failure. | 2005 | * Returns a negative error code on failure. |
@@ -2193,6 +2219,10 @@ struct ieee80211_ops { | |||
2193 | struct ieee80211_sta *sta); | 2219 | struct ieee80211_sta *sta); |
2194 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2220 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2195 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2221 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
2222 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
2223 | struct ieee80211_sta *sta, | ||
2224 | enum ieee80211_sta_state old_state, | ||
2225 | enum ieee80211_sta_state new_state); | ||
2196 | int (*conf_tx)(struct ieee80211_hw *hw, | 2226 | int (*conf_tx)(struct ieee80211_hw *hw, |
2197 | struct ieee80211_vif *vif, u16 queue, | 2227 | struct ieee80211_vif *vif, u16 queue, |
2198 | const struct ieee80211_tx_queue_params *params); | 2228 | const struct ieee80211_tx_queue_params *params); |