mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
cfg80211: allow requesting SMPS mode on ap start
Add feature bits to indicate device support for static-smps and dynamic-smps modes. Add a new NL80211_ATTR_SMPS_MODE attribue to allow configuring the smps mode to be used by the ap (e.g. configuring to ap to dynamic smps mode will reduce power consumption while having minor effect on throughput) Signed-off-by: Eliad Peller <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
This commit is contained in:
parent
59cd85cbcf
commit
18998c381b
3 changed files with 59 additions and 0 deletions
|
|
@ -394,6 +394,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
|
|||
[NL80211_ATTR_TSID] = { .type = NLA_U8 },
|
||||
[NL80211_ATTR_USER_PRIO] = { .type = NLA_U8 },
|
||||
[NL80211_ATTR_ADMITTED_TIME] = { .type = NLA_U16 },
|
||||
[NL80211_ATTR_SMPS_MODE] = { .type = NLA_U8 },
|
||||
};
|
||||
|
||||
/* policy for the key attributes */
|
||||
|
|
@ -3345,6 +3346,29 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
|
|||
return PTR_ERR(params.acl);
|
||||
}
|
||||
|
||||
if (info->attrs[NL80211_ATTR_SMPS_MODE]) {
|
||||
params.smps_mode =
|
||||
nla_get_u8(info->attrs[NL80211_ATTR_SMPS_MODE]);
|
||||
switch (params.smps_mode) {
|
||||
case NL80211_SMPS_OFF:
|
||||
break;
|
||||
case NL80211_SMPS_STATIC:
|
||||
if (!(rdev->wiphy.features &
|
||||
NL80211_FEATURE_STATIC_SMPS))
|
||||
return -EINVAL;
|
||||
break;
|
||||
case NL80211_SMPS_DYNAMIC:
|
||||
if (!(rdev->wiphy.features &
|
||||
NL80211_FEATURE_DYNAMIC_SMPS))
|
||||
return -EINVAL;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
}
|
||||
} else {
|
||||
params.smps_mode = NL80211_SMPS_OFF;
|
||||
}
|
||||
|
||||
wdev_lock(wdev);
|
||||
err = rdev_start_ap(rdev, dev, ¶ms);
|
||||
if (!err) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue