aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-12-01 07:37:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-22 13:31:16 -0500
commit0f78231bffb868a30e8533aace142213266bb811 (patch)
tree317f65dc6d89e9a89ad83f94fadd780dd1e0ca83 /include/net/mac80211.h
parent18974b5b0b5e758d416c550553b143e5c8038281 (diff)
mac80211: enable spatial multiplexing powersave
Enable spatial multiplexing in mac80211 by telling the driver what to do and, where necessary, sending action frames to the AP to update the requested SMPS mode. Also includes a trivial implementation for hwsim that just logs the requested mode. For now, the userspace interface is in debugfs only, and let you toggle the requested mode at any time. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e94cc526b0f6..e6b6bf81d5b9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -597,8 +597,10 @@ enum ieee80211_conf_flags {
597 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed 597 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed
598 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 598 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
599 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 599 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
600 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
600 */ 601 */
601enum ieee80211_conf_changed { 602enum ieee80211_conf_changed {
603 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
602 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), 604 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
603 IEEE80211_CONF_CHANGE_MONITOR = BIT(3), 605 IEEE80211_CONF_CHANGE_MONITOR = BIT(3),
604 IEEE80211_CONF_CHANGE_PS = BIT(4), 606 IEEE80211_CONF_CHANGE_PS = BIT(4),
@@ -609,6 +611,21 @@ enum ieee80211_conf_changed {
609}; 611};
610 612
611/** 613/**
614 * enum ieee80211_smps_mode - spatial multiplexing power save mode
615 *
616 * @
617 */
618enum ieee80211_smps_mode {
619 IEEE80211_SMPS_AUTOMATIC,
620 IEEE80211_SMPS_OFF,
621 IEEE80211_SMPS_STATIC,
622 IEEE80211_SMPS_DYNAMIC,
623
624 /* keep last */
625 IEEE80211_SMPS_NUM_MODES,
626};
627
628/**
612 * struct ieee80211_conf - configuration of the device 629 * struct ieee80211_conf - configuration of the device
613 * 630 *
614 * This struct indicates how the driver shall configure the hardware. 631 * This struct indicates how the driver shall configure the hardware.
@@ -636,6 +653,10 @@ enum ieee80211_conf_changed {
636 * @short_frame_max_tx_count: Maximum number of transmissions for a "short" 653 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
637 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the 654 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
638 * number of transmissions not the number of retries 655 * number of transmissions not the number of retries
656 *
657 * @smps_mode: spatial multiplexing powersave mode; note that
658 * %IEEE80211_SMPS_STATIC is used when the device is not
659 * configured for an HT channel
639 */ 660 */
640struct ieee80211_conf { 661struct ieee80211_conf {
641 u32 flags; 662 u32 flags;
@@ -648,6 +669,7 @@ struct ieee80211_conf {
648 669
649 struct ieee80211_channel *channel; 670 struct ieee80211_channel *channel;
650 enum nl80211_channel_type channel_type; 671 enum nl80211_channel_type channel_type;
672 enum ieee80211_smps_mode smps_mode;
651}; 673};
652 674
653/** 675/**
@@ -930,6 +952,16 @@ enum ieee80211_tkip_key_type {
930 * @IEEE80211_HW_BEACON_FILTER: 952 * @IEEE80211_HW_BEACON_FILTER:
931 * Hardware supports dropping of irrelevant beacon frames to 953 * Hardware supports dropping of irrelevant beacon frames to
932 * avoid waking up cpu. 954 * avoid waking up cpu.
955 *
956 * @IEEE80211_HW_SUPPORTS_STATIC_SMPS:
957 * Hardware supports static spatial multiplexing powersave,
958 * ie. can turn off all but one chain even on HT connections
959 * that should be using more chains.
960 *
961 * @IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS:
962 * Hardware supports dynamic spatial multiplexing powersave,
963 * ie. can turn off all but one chain and then wake the rest
964 * up as required after, for example, rts/cts handshake.
933 */ 965 */
934enum ieee80211_hw_flags { 966enum ieee80211_hw_flags {
935 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 967 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -947,6 +979,8 @@ enum ieee80211_hw_flags {
947 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, 979 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12,
948 IEEE80211_HW_MFP_CAPABLE = 1<<13, 980 IEEE80211_HW_MFP_CAPABLE = 1<<13,
949 IEEE80211_HW_BEACON_FILTER = 1<<14, 981 IEEE80211_HW_BEACON_FILTER = 1<<14,
982 IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15,
983 IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16,
950}; 984};
951 985
952/** 986/**
@@ -1215,6 +1249,31 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1215 */ 1249 */
1216 1250
1217/** 1251/**
1252 * DOC: Spatial multiplexing power save
1253 *
1254 * SMPS (Spatial multiplexing power save) is a mechanism to conserve
1255 * power in an 802.11n implementation. For details on the mechanism
1256 * and rationale, please refer to 802.11 (as amended by 802.11n-2009)
1257 * "11.2.3 SM power save".
1258 *
1259 * The mac80211 implementation is capable of sending action frames
1260 * to update the AP about the station's SMPS mode, and will instruct
1261 * the driver to enter the specific mode. It will also announce the
1262 * requested SMPS mode during the association handshake. Hardware
1263 * support for this feature is required, and can be indicated by
1264 * hardware flags.
1265 *
1266 * The default mode will be "automatic", which nl80211/cfg80211
1267 * defines to be dynamic SMPS in (regular) powersave, and SMPS
1268 * turned off otherwise.
1269 *
1270 * To support this feature, the driver must set the appropriate
1271 * hardware support flags, and handle the SMPS flag to the config()
1272 * operation. It will then with this mechanism be instructed to
1273 * enter the requested SMPS mode while associated to an HT AP.
1274 */
1275
1276/**
1218 * DOC: Frame filtering 1277 * DOC: Frame filtering
1219 * 1278 *
1220 * mac80211 requires to see many management frames for proper 1279 * mac80211 requires to see many management frames for proper