aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_netdev.c
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2013-10-01 09:45:43 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-10-28 10:05:11 -0400
commit687da132234feb70748df04a007bc1820f392254 (patch)
tree6255afe03b39518c2f83251fd0dd0afed647dd44 /net/mac80211/debugfs_netdev.c
parent7ec7c4a9a686c608315739ab6a2b0527a240883c (diff)
mac80211: implement SMPS for AP
When the driver requests to move to STATIC or DYNAMIC SMPS, we send an action frame to each associated station and reconfigure the channel context / driver. Of course, non-MIMO stations are ignored. The beacon isn't updated. The association response will include the original capabilities. Stations that associate while in non-OFF SMPS mode will get an action frame right after association to inform them about our current state. Note that we wait until the end of the EAPOL. Sending an action frame before the EAPOL is finished can be an issue for a few clients. Clients aren't likely to send EAPOL frames in MIMO anyway. When the SMPS configuration gets more permissive (e.g. STATIC -> OFF), we don't wake up stations that are asleep We remember that they don't know about the change and send the action frame when they wake up. When the SMPS configuration gets more restrictive (e.g. OFF -> STATIC), we set the TIM bit for every sleeping STA. uAPSD stations might send MIMO until they poll the action frame, but this is for a short period of time. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> [fix vht streams loop, initialisation] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/debugfs_netdev.c')
-rw-r--r--net/mac80211/debugfs_netdev.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index cafe614ef93d..04b5a14c8a05 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -224,12 +224,15 @@ static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
224 smps_mode == IEEE80211_SMPS_AUTOMATIC)) 224 smps_mode == IEEE80211_SMPS_AUTOMATIC))
225 return -EINVAL; 225 return -EINVAL;
226 226
227 /* supported only on managed interfaces for now */ 227 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
228 if (sdata->vif.type != NL80211_IFTYPE_STATION) 228 sdata->vif.type != NL80211_IFTYPE_AP)
229 return -EOPNOTSUPP; 229 return -EOPNOTSUPP;
230 230
231 sdata_lock(sdata); 231 sdata_lock(sdata);
232 err = __ieee80211_request_smps(sdata, smps_mode); 232 if (sdata->vif.type == NL80211_IFTYPE_STATION)
233 err = __ieee80211_request_smps_mgd(sdata, smps_mode);
234 else
235 err = __ieee80211_request_smps_ap(sdata, smps_mode);
233 sdata_unlock(sdata); 236 sdata_unlock(sdata);
234 237
235 return err; 238 return err;
@@ -245,12 +248,15 @@ static const char *smps_modes[IEEE80211_SMPS_NUM_MODES] = {
245static ssize_t ieee80211_if_fmt_smps(const struct ieee80211_sub_if_data *sdata, 248static ssize_t ieee80211_if_fmt_smps(const struct ieee80211_sub_if_data *sdata,
246 char *buf, int buflen) 249 char *buf, int buflen)
247{ 250{
248 if (sdata->vif.type != NL80211_IFTYPE_STATION) 251 if (sdata->vif.type == NL80211_IFTYPE_STATION)
249 return -EOPNOTSUPP; 252 return snprintf(buf, buflen, "request: %s\nused: %s\n",
250 253 smps_modes[sdata->u.mgd.req_smps],
251 return snprintf(buf, buflen, "request: %s\nused: %s\n", 254 smps_modes[sdata->smps_mode]);
252 smps_modes[sdata->u.mgd.req_smps], 255 if (sdata->vif.type == NL80211_IFTYPE_AP)
253 smps_modes[sdata->smps_mode]); 256 return snprintf(buf, buflen, "request: %s\nused: %s\n",
257 smps_modes[sdata->u.ap.req_smps],
258 smps_modes[sdata->smps_mode]);
259 return -EINVAL;
254} 260}
255 261
256static ssize_t ieee80211_if_parse_smps(struct ieee80211_sub_if_data *sdata, 262static ssize_t ieee80211_if_parse_smps(struct ieee80211_sub_if_data *sdata,
@@ -563,6 +569,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
563static void add_ap_files(struct ieee80211_sub_if_data *sdata) 569static void add_ap_files(struct ieee80211_sub_if_data *sdata)
564{ 570{
565 DEBUGFS_ADD(num_mcast_sta); 571 DEBUGFS_ADD(num_mcast_sta);
572 DEBUGFS_ADD_MODE(smps, 0600);
566 DEBUGFS_ADD(num_sta_ps); 573 DEBUGFS_ADD(num_sta_ps);
567 DEBUGFS_ADD(dtim_count); 574 DEBUGFS_ADD(dtim_count);
568 DEBUGFS_ADD(num_buffered_multicast); 575 DEBUGFS_ADD(num_buffered_multicast);