Skip to content

Commit f699317

Browse files
elpjmberg-intel
authored andcommitted
mac80211: set smps_mode according to ap params
Take the requested smps mode from the ap params (instead of always starting with SMPS_OFF) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 18998c3 commit f699317

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

net/mac80211/cfg.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,19 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
683683
if (old)
684684
return -EALREADY;
685685

686-
/* TODO: make hostapd tell us what it wants */
687-
sdata->smps_mode = IEEE80211_SMPS_OFF;
686+
switch (params->smps_mode) {
687+
case NL80211_SMPS_OFF:
688+
sdata->smps_mode = IEEE80211_SMPS_OFF;
689+
break;
690+
case NL80211_SMPS_STATIC:
691+
sdata->smps_mode = IEEE80211_SMPS_STATIC;
692+
break;
693+
case NL80211_SMPS_DYNAMIC:
694+
sdata->smps_mode = IEEE80211_SMPS_DYNAMIC;
695+
break;
696+
default:
697+
return -EINVAL;
698+
}
688699
sdata->needed_rx_chains = sdata->local->rx_chains;
689700

690701
mutex_lock(&local->mtx);

0 commit comments

Comments
 (0)