diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-08-05 15:05:55 (GMT) |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-16 19:26:40 (GMT) |
commit | d1f5b7a34aa5ff703c4966ea2652d4212ac75940 (patch) | |
tree | ecc8f06625bf4e48334420586d7e16f9645aa1e4 /net/mac80211/ht.c | |
parent | 7da7cc1d42d8ce02cca16df8c021e6d657f1f8fd (diff) | |
download | linux-d1f5b7a34aa5ff703c4966ea2652d4212ac75940.tar.xz |
mac80211: allow drivers to request SM PS mode change
Sometimes drivers have more information than the
stack about how their antennas/chains are used,
and may require that the SM PS mode be changed.
This could happen, for example, when detecting
that the user disconnected an antenna. Thus this
patch introduces API to allow drivers to request
SM PS mode changes.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ht.c')
-rw-r--r-- | net/mac80211/ht.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index 9d101fb..11f74f5 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c @@ -265,3 +265,31 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata, return 0; } + +void ieee80211_request_smps_work(struct work_struct *work) +{ + struct ieee80211_sub_if_data *sdata = + container_of(work, struct ieee80211_sub_if_data, + u.mgd.request_smps_work); + + mutex_lock(&sdata->u.mgd.mtx); + __ieee80211_request_smps(sdata, sdata->u.mgd.driver_smps_mode); + mutex_unlock(&sdata->u.mgd.mtx); +} + +void ieee80211_request_smps(struct ieee80211_vif *vif, + enum ieee80211_smps_mode smps_mode) +{ + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + + if (WARN_ON(vif->type != NL80211_IFTYPE_STATION)) + return; + + if (WARN_ON(smps_mode == IEEE80211_SMPS_OFF)) + smps_mode = IEEE80211_SMPS_AUTOMATIC; + + ieee80211_queue_work(&sdata->local->hw, + &sdata->u.mgd.request_smps_work); +} +/* this might change ... don't want non-open drivers using it */ +EXPORT_SYMBOL_GPL(ieee80211_request_smps); |