]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Support for RNR elements
authorAloka Dixit <quic_alokad@quicinc.com>
Tue, 4 Apr 2023 17:59:00 +0000 (10:59 -0700)
committerJouni Malinen <j@w1.fi>
Tue, 18 Apr 2023 08:39:32 +0000 (11:39 +0300)
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>
src/drivers/driver_nl80211.c

index 31be2a547a2c8cdda3b2abd1feb70776b1323a83..467f46cf4ac1f2333facb438b17af5d302e3dfcf 100644 (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;
 }