aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
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')
-rw-r--r--include/linux/ieee80211.h25
-rw-r--r--include/net/mac80211.h59
2 files changed, 83 insertions, 1 deletions
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index d9724a28c0c2..e8d43d0ff2c3 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -707,6 +707,10 @@ struct ieee80211_mgmt {
707 u8 action; 707 u8 action;
708 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; 708 u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN];
709 } __attribute__ ((packed)) sa_query; 709 } __attribute__ ((packed)) sa_query;
710 struct {
711 u8 action;
712 u8 smps_control;
713 } __attribute__ ((packed)) ht_smps;
710 } u; 714 } u;
711 } __attribute__ ((packed)) action; 715 } __attribute__ ((packed)) action;
712 } u; 716 } u;
@@ -824,6 +828,7 @@ struct ieee80211_ht_cap {
824#define IEEE80211_HT_CAP_LDPC_CODING 0x0001 828#define IEEE80211_HT_CAP_LDPC_CODING 0x0001
825#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 829#define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002
826#define IEEE80211_HT_CAP_SM_PS 0x000C 830#define IEEE80211_HT_CAP_SM_PS 0x000C
831#define IEEE80211_HT_CAP_SM_PS_SHIFT 2
827#define IEEE80211_HT_CAP_GRN_FLD 0x0010 832#define IEEE80211_HT_CAP_GRN_FLD 0x0010
828#define IEEE80211_HT_CAP_SGI_20 0x0020 833#define IEEE80211_HT_CAP_SGI_20 0x0020
829#define IEEE80211_HT_CAP_SGI_40 0x0040 834#define IEEE80211_HT_CAP_SGI_40 0x0040
@@ -839,6 +844,7 @@ struct ieee80211_ht_cap {
839/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ 844/* 802.11n HT capability AMPDU settings (for ampdu_params_info) */
840#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 845#define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03
841#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C 846#define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C
847#define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2
842 848
843/* 849/*
844 * Maximum length of AMPDU that the STA can receive. 850 * Maximum length of AMPDU that the STA can receive.
@@ -922,12 +928,17 @@ struct ieee80211_ht_info {
922#define IEEE80211_MAX_AMPDU_BUF 0x40 928#define IEEE80211_MAX_AMPDU_BUF 0x40
923 929
924 930
925/* Spatial Multiplexing Power Save Modes */ 931/* Spatial Multiplexing Power Save Modes (for capability) */
926#define WLAN_HT_CAP_SM_PS_STATIC 0 932#define WLAN_HT_CAP_SM_PS_STATIC 0
927#define WLAN_HT_CAP_SM_PS_DYNAMIC 1 933#define WLAN_HT_CAP_SM_PS_DYNAMIC 1
928#define WLAN_HT_CAP_SM_PS_INVALID 2 934#define WLAN_HT_CAP_SM_PS_INVALID 2
929#define WLAN_HT_CAP_SM_PS_DISABLED 3 935#define WLAN_HT_CAP_SM_PS_DISABLED 3
930 936
937/* for SM power control field lower two bits */
938#define WLAN_HT_SMPS_CONTROL_DISABLED 0
939#define WLAN_HT_SMPS_CONTROL_STATIC 1
940#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
941
931/* Authentication algorithms */ 942/* Authentication algorithms */
932#define WLAN_AUTH_OPEN 0 943#define WLAN_AUTH_OPEN 0
933#define WLAN_AUTH_SHARED_KEY 1 944#define WLAN_AUTH_SHARED_KEY 1
@@ -1150,6 +1161,18 @@ enum ieee80211_spectrum_mgmt_actioncode {
1150 WLAN_ACTION_SPCT_CHL_SWITCH = 4, 1161 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
1151}; 1162};
1152 1163
1164/* HT action codes */
1165enum ieee80211_ht_actioncode {
1166 WLAN_HT_ACTION_NOTIFY_CHANWIDTH = 0,
1167 WLAN_HT_ACTION_SMPS = 1,
1168 WLAN_HT_ACTION_PSMP = 2,
1169 WLAN_HT_ACTION_PCO_PHASE = 3,
1170 WLAN_HT_ACTION_CSI = 4,
1171 WLAN_HT_ACTION_NONCOMPRESSED_BF = 5,
1172 WLAN_HT_ACTION_COMPRESSED_BF = 6,
1173 WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7,
1174};
1175
1153/* Security key length */ 1176/* Security key length */
1154enum ieee80211_key_len { 1177enum ieee80211_key_len {
1155 WLAN_KEY_LEN_WEP40 = 5, 1178 WLAN_KEY_LEN_WEP40 = 5,
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