Skip to content

Commit 7d27a0b

Browse files
masapjmberg-intel
authored andcommitted
cfg80211: Add mesh peer AID setting API
Previously, mesh power management functionality works only with kernel MPM. Because user space MPM did not report mesh peer AID to kernel, the kernel could not identify the bit in TIM element. So this patch adds mesh peer AID setting API. Signed-off-by: Masashi Honma <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 92b3a28 commit 7d27a0b

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

include/net/cfg80211.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,7 @@ enum station_parameters_apply_mask {
780780
* (bitmask of BIT(NL80211_STA_FLAG_...))
781781
* @listen_interval: listen interval or -1 for no change
782782
* @aid: AID or zero for no change
783+
* @peer_aid: mesh peer AID or zero for no change
783784
* @plink_action: plink action to take
784785
* @plink_state: set the peer link state for a station
785786
* @ht_capa: HT capabilities of station
@@ -811,6 +812,7 @@ struct station_parameters {
811812
u32 sta_modify_mask;
812813
int listen_interval;
813814
u16 aid;
815+
u16 peer_aid;
814816
u8 supported_rates_len;
815817
u8 plink_action;
816818
u8 plink_state;

include/uapi/linux/nl80211.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,6 +1864,9 @@ enum nl80211_commands {
18641864
* mandatory. If this flag is not set, the duration is the maximum duration
18651865
* and the actual measurement duration may be shorter.
18661866
*
1867+
* @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
1868+
* used to pull the stored data for mesh peer in power save state.
1869+
*
18671870
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
18681871
* @NL80211_ATTR_MAX: highest attribute number currently defined
18691872
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2256,6 +2259,8 @@ enum nl80211_attrs {
22562259
NL80211_ATTR_MEASUREMENT_DURATION,
22572260
NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY,
22582261

2262+
NL80211_ATTR_MESH_PEER_AID,
2263+
22592264
/* add attributes here, update the policy in nl80211.c */
22602265

22612266
__NL80211_ATTR_AFTER_LAST,

net/mac80211/cfg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,7 @@ static void sta_apply_mesh_params(struct ieee80211_local *local,
997997
if (sta->mesh->plink_state != NL80211_PLINK_ESTAB)
998998
changed = mesh_plink_inc_estab_count(sdata);
999999
sta->mesh->plink_state = params->plink_state;
1000+
sta->mesh->aid = params->peer_aid;
10001001

10011002
ieee80211_mps_sta_status_update(sta);
10021003
changed |= ieee80211_mps_set_sta_local_pm(sta,

net/wireless/nl80211.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4446,6 +4446,12 @@ static int nl80211_set_station(struct sk_buff *skb, struct genl_info *info)
44464446
nla_get_u8(info->attrs[NL80211_ATTR_STA_PLINK_STATE]);
44474447
if (params.plink_state >= NUM_NL80211_PLINK_STATES)
44484448
return -EINVAL;
4449+
if (info->attrs[NL80211_ATTR_MESH_PEER_AID]) {
4450+
params.peer_aid = nla_get_u16(
4451+
info->attrs[NL80211_ATTR_MESH_PEER_AID]);
4452+
if (params.peer_aid > IEEE80211_MAX_AID)
4453+
return -EINVAL;
4454+
}
44494455
params.sta_modify_mask |= STATION_PARAM_APPLY_PLINK_STATE;
44504456
}
44514457

0 commit comments

Comments
 (0)