nl80211: Support for RNR elements

Add new nested netlink attribute, NL80211_ATTR_EMA_RNR_ELEMS, to send
the reduced neighbor report (RNR) elements to the driver when EMA is
enabled. This attribute includes the count of RNR elements and data at
each index. While generating EMA beacons, the driver will include RNR
group at a given index along with MBSSID group. The last element, if
present, has RNR data common for all EMA beacons such as neighbor APs.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
This commit is contained in:
Aloka Dixit 2023-04-04 10:59:00 -07:00 committed by Jouni Malinen
parent 5d06acefdd
commit ac54b61273

View file

@ -4725,6 +4725,28 @@ static int nl80211_mbssid(struct nl_msg *msg,
nla_nest_end(msg, elems);
}
if (!params->ema)
return 0;
if (params->rnr_elem_count && params->rnr_elem_len &&
params->rnr_elem_offset && *params->rnr_elem_offset) {
u8 i, **offs = params->rnr_elem_offset;
elems = nla_nest_start(msg, NL80211_ATTR_EMA_RNR_ELEMS);
if (!elems)
return -1;
for (i = 0; i < params->rnr_elem_count - 1; i++) {
if (nla_put(msg, i + 1, offs[i + 1] - offs[i], offs[i]))
return -1;
}
if (nla_put(msg, i + 1, *offs + params->rnr_elem_len - offs[i],
offs[i]))
return -1;
nla_nest_end(msg, elems);
}
return 0;
}