summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAloka Dixit <quic_alokad@quicinc.com>2023-04-04 10:59:00 -0700
committerJouni Malinen <j@w1.fi>2023-04-18 11:39:32 +0300
commitac54b612739751c4d9548cca9ce86aa670477279 (patch)
treea9c073ee1889db1d903e373b2a87316f6e81655a
parent5d06acefdd4c0a4cc7bdb0f8df3c6f446f296ac6 (diff)
downloadhostap-ac54b612739751c4d9548cca9ce86aa670477279.tar.gz
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>
-rw-r--r--src/drivers/driver_nl80211.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 31be2a547..467f46cf4 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -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;
}