diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-12-01 07:37:02 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-22 13:31:16 -0500 |
commit | 0f78231bffb868a30e8533aace142213266bb811 (patch) | |
tree | 317f65dc6d89e9a89ad83f94fadd780dd1e0ca83 /drivers/net/wireless/mac80211_hwsim.c | |
parent | 18974b5b0b5e758d416c550553b143e5c8038281 (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 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r-- | drivers/net/wireless/mac80211_hwsim.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 88e41176e7fd..92c669ebb358 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c | |||
@@ -618,12 +618,26 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed) | |||
618 | { | 618 | { |
619 | struct mac80211_hwsim_data *data = hw->priv; | 619 | struct mac80211_hwsim_data *data = hw->priv; |
620 | struct ieee80211_conf *conf = &hw->conf; | 620 | struct ieee80211_conf *conf = &hw->conf; |
621 | 621 | static const char *chantypes[4] = { | |
622 | printk(KERN_DEBUG "%s:%s (freq=%d idle=%d ps=%d)\n", | 622 | [NL80211_CHAN_NO_HT] = "noht", |
623 | [NL80211_CHAN_HT20] = "ht20", | ||
624 | [NL80211_CHAN_HT40MINUS] = "ht40-", | ||
625 | [NL80211_CHAN_HT40PLUS] = "ht40+", | ||
626 | }; | ||
627 | static const char *smps_modes[IEEE80211_SMPS_NUM_MODES] = { | ||
628 | [IEEE80211_SMPS_AUTOMATIC] = "auto", | ||
629 | [IEEE80211_SMPS_OFF] = "off", | ||
630 | [IEEE80211_SMPS_STATIC] = "static", | ||
631 | [IEEE80211_SMPS_DYNAMIC] = "dynamic", | ||
632 | }; | ||
633 | |||
634 | printk(KERN_DEBUG "%s:%s (freq=%d/%s idle=%d ps=%d smps=%s)\n", | ||
623 | wiphy_name(hw->wiphy), __func__, | 635 | wiphy_name(hw->wiphy), __func__, |
624 | conf->channel->center_freq, | 636 | conf->channel->center_freq, |
637 | chantypes[conf->channel_type], | ||
625 | !!(conf->flags & IEEE80211_CONF_IDLE), | 638 | !!(conf->flags & IEEE80211_CONF_IDLE), |
626 | !!(conf->flags & IEEE80211_CONF_PS)); | 639 | !!(conf->flags & IEEE80211_CONF_PS), |
640 | smps_modes[conf->smps_mode]); | ||
627 | 641 | ||
628 | data->idle = !!(conf->flags & IEEE80211_CONF_IDLE); | 642 | data->idle = !!(conf->flags & IEEE80211_CONF_IDLE); |
629 | 643 | ||
@@ -1082,7 +1096,9 @@ static int __init init_mac80211_hwsim(void) | |||
1082 | BIT(NL80211_IFTYPE_MESH_POINT); | 1096 | BIT(NL80211_IFTYPE_MESH_POINT); |
1083 | 1097 | ||
1084 | hw->flags = IEEE80211_HW_MFP_CAPABLE | | 1098 | hw->flags = IEEE80211_HW_MFP_CAPABLE | |
1085 | IEEE80211_HW_SIGNAL_DBM; | 1099 | IEEE80211_HW_SIGNAL_DBM | |
1100 | IEEE80211_HW_SUPPORTS_STATIC_SMPS | | ||
1101 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS; | ||
1086 | 1102 | ||
1087 | /* ask mac80211 to reserve space for magic */ | 1103 | /* ask mac80211 to reserve space for magic */ |
1088 | hw->vif_data_size = sizeof(struct hwsim_vif_priv); | 1104 | hw->vif_data_size = sizeof(struct hwsim_vif_priv); |