wlan-ap-Telecominfraproject/feeds/wifi-ax/hostapd/patches/h00-003-02-hostapd-Rename-functions-used-for-reduced-neighbor-r.patch
Felix Fietkau 5b397d54ce wifi-ax: backport hostapd reload support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-08-31 16:08:34 +02:00

188 lines
6.6 KiB
Diff

From a0eb57f97ecf06c6244dc15ae9cbc4f14b793563 Mon Sep 17 00:00:00 2001
From: Aloka Dixit <alokad@codeaurora.org>
Date: Thu, 10 Dec 2020 10:55:55 -0800
Subject: [PATCH 2/9] hostapd: Rename functions used for reduced neighbor
report
This patch rename functions from *_reduced_neighbor_report_* to *_rnr_*
to make those shorter.
Signed-off-by: Aloka Dixit <alokad@codeaurora.org>
---
src/ap/beacon.c | 12 ++++++------
src/ap/ieee802_11.c | 34 +++++++++++++++-------------------
src/ap/ieee802_11.h | 4 ++--
3 files changed, 23 insertions(+), 27 deletions(-)
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -486,7 +486,7 @@ static u8 * hostapd_gen_probe_resp(struc
known_bssids,
known_bssids_len);
if (hapd->conf->rnr_beacon)
- buflen += hostapd_eid_reduced_neighbor_report_len(hapd, 1);
+ buflen += hostapd_eid_rnr_len(hapd, 1);
resp = os_zalloc(buflen);
if (resp == NULL)
@@ -668,7 +668,7 @@ static u8 * hostapd_gen_probe_resp(struc
pos = hostapd_eid_owe_trans(hapd, pos, (u8 *) resp + buflen - pos);
pos = hostapd_eid_dpp_cc(hapd, pos, (u8 *) resp + buflen - pos);
if (hapd->conf->rnr_beacon)
- pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 1);
+ pos = hostapd_eid_rnr(hapd, pos, 1);
if (hapd->conf->vendor_elements) {
os_memcpy(pos, wpabuf_head(hapd->conf->vendor_elements),
@@ -1368,7 +1368,7 @@ static u8 * hostapd_gen_fils_discovery(s
total_len += 3;
}
- total_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0);
+ total_len += hostapd_eid_rnr_len(hapd, 0);
pos = hostapd_eid_fils_indic(hapd, buf, 0);
buf_len = pos - buf;
@@ -1438,7 +1438,7 @@ static u8 * hostapd_gen_fils_discovery(s
/* Fill in the Length field value */
*length_pos = pos - (length_pos + 1);
- pos = hostapd_eid_reduced_neighbor_report(hapd, pos, 0);
+ pos = hostapd_eid_rnr(hapd, pos, 0);
/* FILS Indication element */
if (buf_len) {
@@ -1530,7 +1530,7 @@ int ieee802_11_build_ap_params(struct ho
tail_len += hostapd_eid_owe_trans_len(hapd);
tail_len += hostapd_eid_dpp_cc_len(hapd);
if (hapd->conf->rnr_beacon)
- tail_len += hostapd_eid_reduced_neighbor_report_len(hapd, 0);
+ tail_len += hostapd_eid_rnr_len(hapd, 0);
tailpos = tail = os_malloc(tail_len);
if (head == NULL || tail == NULL) {
@@ -1716,7 +1716,7 @@ int ieee802_11_build_ap_params(struct ho
tail + tail_len - tailpos);
tailpos = hostapd_eid_dpp_cc(hapd, tailpos, tail + tail_len - tailpos);
if (hapd->conf->rnr_beacon)
- tailpos = hostapd_eid_reduced_neighbor_report(hapd, tailpos, 0);
+ tailpos = hostapd_eid_rnr(hapd, tailpos, 0);
if (hapd->conf->vendor_elements) {
os_memcpy(tailpos, wpabuf_head(hapd->conf->vendor_elements),
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -7323,8 +7323,8 @@ u8 * hostapd_eid_multiple_bssid(struct h
}
-size_t hostapd_eid_reduced_neighbor_report_iface_len(struct hostapd_data *hapd,
- struct hostapd_data *reporting_hapd)
+size_t hostapd_eid_rnr_iface_len(struct hostapd_data *hapd,
+ struct hostapd_data *reporting_hapd)
{
size_t len = 0;
int i;
@@ -7338,15 +7338,14 @@ size_t hostapd_eid_reduced_neighbor_repo
}
-size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp)
+size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, bool probe_resp)
{
size_t len = 0;
int i;
if (hapd->iface->num_bss > 1)
len += (TBTT_HEADER_LENGTH +
- hostapd_eid_reduced_neighbor_report_iface_len(hapd,
- hapd));
+ hostapd_eid_rnr_iface_len(hapd, hapd));
for (i = 0; i < hapd->iface->interfaces->count; i++) {
struct hostapd_iface *iface = hapd->iface->interfaces->iface[i];
@@ -7355,8 +7354,7 @@ size_t hostapd_eid_reduced_neighbor_repo
continue;
len += (TBTT_HEADER_LENGTH +
- hostapd_eid_reduced_neighbor_report_iface_len(iface->bss[0],
- hapd));
+ hostapd_eid_rnr_iface_len(iface->bss[0], hapd));
}
if (!probe_resp && !dl_list_empty(&hapd->nr_db))
@@ -7369,9 +7367,9 @@ size_t hostapd_eid_reduced_neighbor_repo
}
-static u8 *hostapd_eid_reduced_neighbor_report_iface(struct hostapd_data *hapd,
- struct hostapd_data *reporting_hapd,
- u8 *eid, int *count)
+static u8 *hostapd_eid_rnr_iface(struct hostapd_data *hapd,
+ struct hostapd_data *reporting_hapd,
+ u8 *eid, int *count)
{
u8 *eid_start = eid, *tbtt_count_pos;
u8 tbtt_count = 0;
@@ -7435,7 +7433,8 @@ static u8 *hostapd_eid_reduced_neighbor_
}
-static u8 *hostapd_eid_reduced_neighbor_report_nr_db(struct hostapd_data *hapd, u8 *eid, int *count)
+static u8 *hostapd_eid_neighbor_report_db(struct hostapd_data *hapd, u8 *eid,
+ int *count)
{
struct hostapd_neighbor_entry *nr;
@@ -7464,9 +7463,9 @@ static u8 *hostapd_eid_reduced_neighbor_
}
-u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp)
+u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, bool probe_resp)
{
- size_t len = hostapd_eid_reduced_neighbor_report_len(hapd, probe_resp);
+ size_t len = hostapd_eid_rnr_len(hapd, probe_resp);
int i, count = 0;
u8 *size_offset;
@@ -7477,8 +7476,7 @@ u8 * hostapd_eid_reduced_neighbor_report
size_offset = eid++;
if (hapd->iface->num_bss > 1)
- eid = hostapd_eid_reduced_neighbor_report_iface(hapd, hapd,
- eid, &count);
+ eid = hostapd_eid_rnr_iface(hapd, hapd, eid, &count);
for (i = 0; i < hapd->iface->interfaces->count; i++) {
struct hostapd_iface *iface = hapd->iface->interfaces->iface[i];
@@ -7486,13 +7484,11 @@ u8 * hostapd_eid_reduced_neighbor_report
if (iface == hapd->iface || !iface->conf->he_co_locate)
continue;
- eid = hostapd_eid_reduced_neighbor_report_iface(iface->bss[0],
- hapd, eid,
- &count);
+ eid = hostapd_eid_rnr_iface(iface->bss[0], hapd, eid, &count);
}
if (!probe_resp)
- hostapd_eid_reduced_neighbor_report_nr_db(hapd, eid, &count);
+ eid = hostapd_eid_neighbor_report_db(hapd, eid, &count);
if (!count)
eid -= 2;
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -137,8 +137,8 @@ u8 * hostapd_eid_multiple_bssid(struct h
int hostapd_eid_multiple_bssid_len(struct hostapd_data *hapd,
struct hostapd_data *req_bss, u8 is_beacon,
const u8 *known_bssids, u8 known_bssids_len);
-u8 * hostapd_eid_reduced_neighbor_report(struct hostapd_data *hapd, u8 *eid, bool probe_resp);
-size_t hostapd_eid_reduced_neighbor_report_len(struct hostapd_data *hapd, bool probe_resp);
+u8 * hostapd_eid_rnr(struct hostapd_data *hapd, u8 *eid, bool probe_resp);
+size_t hostapd_eid_rnr_len(struct hostapd_data *hapd, bool probe_resp);
int auth_sae_init_committed(struct hostapd_data *hapd, struct sta_info *sta);
#ifdef CONFIG_SAE
void sae_clear_retransmit_timer(struct hostapd_data *hapd,