[PATCH v2 01/44] driver_nl80211: Rename the per iface-type capabilities struct
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Mon May 22 12:33:29 PDT 2023
From: Benjamin Berg <benjamin.berg at intel.com>
We will start using this structure to also track MLD related
capabilities instead of just extended capabilities. As such, give the
structure a more generic name.
Signed-off-by: Benjamin Berg <benjamin.berg at intel.com>
---
src/drivers/driver_nl80211.c | 16 ++++++++--------
src/drivers/driver_nl80211.h | 6 +++---
src/drivers/driver_nl80211_capa.c | 22 +++++++++++-----------
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index eb25730c56..63c04d1b8e 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3150,9 +3150,9 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss)
os_free(drv->extended_capa);
os_free(drv->extended_capa_mask);
- for (i = 0; i < drv->num_iface_ext_capa; i++) {
- os_free(drv->iface_ext_capa[i].ext_capa);
- os_free(drv->iface_ext_capa[i].ext_capa_mask);
+ for (i = 0; i < drv->num_iface_capa; i++) {
+ os_free(drv->iface_capa[i].ext_capa);
+ os_free(drv->iface_capa[i].ext_capa_mask);
}
os_free(drv->first_bss);
#ifdef CONFIG_DRIVER_NL80211_QCA
@@ -13155,11 +13155,11 @@ static int nl80211_get_ext_capab(void *priv, enum wpa_driver_if_type type,
*ext_capa_len = drv->extended_capa_len;
/* Replace the default value if a per-interface type value exists */
- for (i = 0; i < drv->num_iface_ext_capa; i++) {
- if (nlmode == drv->iface_ext_capa[i].iftype) {
- *ext_capa = drv->iface_ext_capa[i].ext_capa;
- *ext_capa_mask = drv->iface_ext_capa[i].ext_capa_mask;
- *ext_capa_len = drv->iface_ext_capa[i].ext_capa_len;
+ for (i = 0; i < drv->num_iface_capa; i++) {
+ if (nlmode == drv->iface_capa[i].iftype) {
+ *ext_capa = drv->iface_capa[i].ext_capa;
+ *ext_capa_mask = drv->iface_capa[i].ext_capa_mask;
+ *ext_capa_len = drv->iface_capa[i].ext_capa_len;
break;
}
}
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index 38b59ab505..0a6726bccd 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -119,12 +119,12 @@ struct wpa_driver_nl80211_data {
struct wpa_driver_capa capa;
u8 *extended_capa, *extended_capa_mask;
unsigned int extended_capa_len;
- struct drv_nl80211_ext_capa {
+ struct drv_nl80211_iface_capa {
enum nl80211_iftype iftype;
u8 *ext_capa, *ext_capa_mask;
unsigned int ext_capa_len;
- } iface_ext_capa[NL80211_IFTYPE_MAX];
- unsigned int num_iface_ext_capa;
+ } iface_capa[NL80211_IFTYPE_MAX];
+ unsigned int num_iface_capa;
int has_capability;
int has_driver_key_mgmt;
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index b904398ca3..9711379cd2 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -817,12 +817,12 @@ static void wiphy_info_extended_capab(struct wpa_driver_nl80211_data *drv,
int rem = 0, i;
struct nlattr *tb1[NL80211_ATTR_MAX + 1], *attr;
- if (!tb || drv->num_iface_ext_capa == NL80211_IFTYPE_MAX)
+ if (!tb || drv->num_iface_capa == NL80211_IFTYPE_MAX)
return;
nla_for_each_nested(attr, tb, rem) {
unsigned int len;
- struct drv_nl80211_ext_capa *capa;
+ struct drv_nl80211_iface_capa *capa;
nla_parse(tb1, NL80211_ATTR_MAX, nla_data(attr),
nla_len(attr), NULL);
@@ -832,7 +832,7 @@ static void wiphy_info_extended_capab(struct wpa_driver_nl80211_data *drv,
!tb1[NL80211_ATTR_EXT_CAPA_MASK])
continue;
- capa = &drv->iface_ext_capa[drv->num_iface_ext_capa];
+ capa = &drv->iface_capa[drv->num_iface_capa];
capa->iftype = nla_get_u32(tb1[NL80211_ATTR_IFTYPE]);
wpa_printf(MSG_DEBUG,
"nl80211: Driver-advertised extended capabilities for interface type %s",
@@ -858,8 +858,8 @@ static void wiphy_info_extended_capab(struct wpa_driver_nl80211_data *drv,
wpa_hexdump(MSG_DEBUG, "nl80211: Extended capabilities mask",
capa->ext_capa_mask, capa->ext_capa_len);
- drv->num_iface_ext_capa++;
- if (drv->num_iface_ext_capa == NL80211_IFTYPE_MAX)
+ drv->num_iface_capa++;
+ if (drv->num_iface_capa == NL80211_IFTYPE_MAX)
break;
}
@@ -868,13 +868,13 @@ static void wiphy_info_extended_capab(struct wpa_driver_nl80211_data *drv,
err:
/* Cleanup allocated memory on error */
for (i = 0; i < NL80211_IFTYPE_MAX; i++) {
- os_free(drv->iface_ext_capa[i].ext_capa);
- drv->iface_ext_capa[i].ext_capa = NULL;
- os_free(drv->iface_ext_capa[i].ext_capa_mask);
- drv->iface_ext_capa[i].ext_capa_mask = NULL;
- drv->iface_ext_capa[i].ext_capa_len = 0;
+ os_free(drv->iface_capa[i].ext_capa);
+ drv->iface_capa[i].ext_capa = NULL;
+ os_free(drv->iface_capa[i].ext_capa_mask);
+ drv->iface_capa[i].ext_capa_mask = NULL;
+ drv->iface_capa[i].ext_capa_len = 0;
}
- drv->num_iface_ext_capa = 0;
+ drv->num_iface_capa = 0;
}
--
2.38.1
More information about the Hostap
mailing list