diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2010-02-03 07:59:58 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-02-08 16:50:53 -0500 |
commit | 34e895075e21be3e21e71d6317440d1ee7969ad0 (patch) | |
tree | 217fe70e32e54ef0134f477510472f3992655d79 /include/net | |
parent | 070bb5477fb4029131aad4941d7aaf0093db0c38 (diff) |
mac80211: allow station add/remove to sleep
Many drivers would like to sleep during station
addition and removal, and currently have a high
complexity there from not being able to.
This introduces two new callbacks sta_add() and
sta_remove() that drivers can implement instead
of using sta_notify() and that can sleep, and
the new sta_add() callback is also allowed to
fail.
The reason we didn't do this previously is that
the IBSS code wants to insert stations from the
RX path, which is a tasklet, so cannot sleep.
This patch will keep the station allocation in
that path, but moves adding the station to the
driver out of line. Since the addition can now
fail, we can have IBSS peer structs the driver
rejected -- in that case we still talk to the
station but never tell the driver about it in
the control.sta pointer. If there will ever be
a driver that has a low limit on the number of
stations and that cannot talk to any stations
that are not known to it, we need to do come up
with a new strategy of handling larger IBSSs,
maybe quicker expiry or rejecting peers.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/mac80211.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 74ccf30fdf8e..a19fac35259a 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -814,7 +814,7 @@ enum set_key_cmd { | |||
814 | * mac80211, any ieee80211_sta pointer you get access to must | 814 | * mac80211, any ieee80211_sta pointer you get access to must |
815 | * either be protected by rcu_read_lock() explicitly or implicitly, | 815 | * either be protected by rcu_read_lock() explicitly or implicitly, |
816 | * or you must take good care to not use such a pointer after a | 816 | * or you must take good care to not use such a pointer after a |
817 | * call to your sta_notify callback that removed it. | 817 | * call to your sta_remove callback that removed it. |
818 | * | 818 | * |
819 | * @addr: MAC address | 819 | * @addr: MAC address |
820 | * @aid: AID we assigned to the station if we're an AP | 820 | * @aid: AID we assigned to the station if we're an AP |
@@ -840,8 +840,8 @@ struct ieee80211_sta { | |||
840 | * indicates addition and removal of a station to station table, | 840 | * indicates addition and removal of a station to station table, |
841 | * or if a associated station made a power state transition. | 841 | * or if a associated station made a power state transition. |
842 | * | 842 | * |
843 | * @STA_NOTIFY_ADD: a station was added to the station table | 843 | * @STA_NOTIFY_ADD: (DEPRECATED) a station was added to the station table |
844 | * @STA_NOTIFY_REMOVE: a station being removed from the station table | 844 | * @STA_NOTIFY_REMOVE: (DEPRECATED) a station being removed from the station table |
845 | * @STA_NOTIFY_SLEEP: a station is now sleeping | 845 | * @STA_NOTIFY_SLEEP: a station is now sleeping |
846 | * @STA_NOTIFY_AWAKE: a sleeping station woke up | 846 | * @STA_NOTIFY_AWAKE: a sleeping station woke up |
847 | */ | 847 | */ |
@@ -1534,9 +1534,14 @@ enum ieee80211_ampdu_mlme_action { | |||
1534 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) | 1534 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) |
1535 | * The callback can sleep. | 1535 | * The callback can sleep. |
1536 | * | 1536 | * |
1537 | * @sta_notify: Notifies low level driver about addition, removal or power | 1537 | * @sta_add: Notifies low level driver about addition of an associated station, |
1538 | * state transition of an associated station, AP, IBSS/WDS/mesh peer etc. | 1538 | * AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
1539 | * Must be atomic. | 1539 | * |
1540 | * @sta_remove: Notifies low level driver about removal of an associated | ||
1541 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | ||
1542 | * | ||
1543 | * @sta_notify: Notifies low level driver about power state transition of an | ||
1544 | * associated station, AP, IBSS/WDS/mesh peer etc. Must be atomic. | ||
1540 | * | 1545 | * |
1541 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1546 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
1542 | * bursting) for a hardware TX queue. | 1547 | * bursting) for a hardware TX queue. |
@@ -1635,6 +1640,10 @@ struct ieee80211_ops { | |||
1635 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1640 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
1636 | u32 *iv32, u16 *iv16); | 1641 | u32 *iv32, u16 *iv16); |
1637 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1642 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
1643 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
1644 | struct ieee80211_sta *sta); | ||
1645 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
1646 | struct ieee80211_sta *sta); | ||
1638 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1647 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1639 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 1648 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
1640 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, | 1649 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |