summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2026-10-07 16:33:32 -0700
committerJakub Kicinski <kuba@kernel.org>2026-10-07 16:33:33 -0700
commit991a02c881995d8b5220b35aa435ff5fff926e63 (patch)
treefc5940ce34f5c4bfde173282ebe6779a11ad410f /include/linux
parent171ffb0948ced8c5360f61eeb4b5287ce8ba6dc8 (diff)
parentb6f009284138884c4b07bbef7b07d780aa9b5daf (diff)
Merge tag 'wireless-next-2026-10-07' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next
Johannes Berg says: ==================== Not too much going on: - brcmfmac: plenty of improvements - mac80211: NAN Instant Communications support - iwlegacy: remove sysfs - nxpwifi: IW610 support - couple of fixes for recent regressions * tag 'wireless-next-2026-10-07' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next: (50 commits) wifi: mac80211: use the AP address as RA for a 4-addr MLO station wifi: mac80211: acquire wiphy lock for unlisted sdata teardown wifi: mac80211: fix non-MLD link ID handling wifi: brcmsmac: Adjust txpwrindex value in nphy_ipa_rxcal_gaintbl_2GHz wifi: iwlegacy: 3945: remove custom sysfs files wifi: iwlegacy: 4965: remove custom sysfs files wifi: iwlegacy: set debug level using debugfs wifi: nxpwifi: bound debug info output wifi: nxpwifi: bound histogram debugfs output wifi: nxpwifi: validate variable IE lengths in beacon parser wifi: nxpwifi: fix missing error codes in _nxpwifi_fw_dpc() wifi: mac80211_hwsim: add NAN Instant Communication support wifi: mac80211_hwsim: nan: Handle more of the NAN configuration wifi: mac80211_hwsim: nan: prepare for more configurable NAN settings wifi: mac80211_hwsim: nan: use ieee80211_is_nan_beacon() helper wifi: ieee80211: add NAN service ID list attribute definitions wifi: mac80211: accept NAN beacons only when IC is enabled wifi: mac80211: nan: allow Rx registration for NAN beacons wifi: cfg80211: do not use NAN beacons to update the BSS table wifi: cfg80211: nan: check Rx registration for NAN beacons ... ==================== Link: https://patch.msgid.link/20261007205827.467974-3-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ieee80211-nan.h28
-rw-r--r--include/linux/ieee80211.h17
-rw-r--r--include/linux/mmc/sdio_ids.h2
3 files changed, 43 insertions, 4 deletions
diff --git a/include/linux/ieee80211-nan.h b/include/linux/ieee80211-nan.h
index 455033955e54..7815a6cf8160 100644
--- a/include/linux/ieee80211-nan.h
+++ b/include/linux/ieee80211-nan.h
@@ -40,6 +40,8 @@
/* NAN attributes, as defined in Wi-Fi Aware (TM) specification 4.0 Table 42 */
#define NAN_ATTR_MASTER_INDICATION 0x00
#define NAN_ATTR_CLUSTER_INFO 0x01
+#define NAN_ATTR_SERVICE_ID_LIST 0x02
+#define NAN_ATTR_SUBSCRIBE_SERVICE_ID_LIST 0x28
struct ieee80211_nan_attr {
u8 attr;
@@ -74,4 +76,30 @@ struct ieee80211_nan_anchor_master_info {
_attr = (const struct ieee80211_nan_attr *) \
(_attr->data + le16_to_cpu(_attr->length)))
+static inline bool ieee80211_is_nan_beacon(const struct ieee80211_mgmt *mgmt,
+ size_t len)
+{
+ const struct element *elem;
+
+ /* The NAN IE is at least 6 octets */
+ if (len < offsetofend(struct ieee80211_mgmt, u.beacon) + 6)
+ return false;
+
+ if (!ieee80211_is_beacon(mgmt->frame_control))
+ return false;
+
+ /* NAN Cluster IDs range from 50-6F-9A-01-00-00 to 50-6F-9A-01-FF-FF */
+ if (get_unaligned_be32(mgmt->bssid) != ((WLAN_OUI_WFA << 8) | 0x01))
+ return false;
+
+ elem = (const struct element *)mgmt->u.beacon.variable;
+ if (elem->id != WLAN_EID_VENDOR_SPECIFIC ||
+ elem->datalen < 4 ||
+ get_unaligned_be32(elem->data) !=
+ (WLAN_OUI_WFA << 8 | WLAN_OUI_TYPE_WFA_NAN))
+ return false;
+
+ return true;
+}
+
#endif /* LINUX_IEEE80211_NAN_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 73ac5336a17a..66f9ebe79c61 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -2730,6 +2730,10 @@ struct element {
u8 data[];
} __packed;
+/* trigger enum comparison warnings if applicable (constant id) */
+#define element_iteration_typecheck(type, id) \
+ (((type)0 == (id)) || true)
+
/* element iteration helpers */
#define for_each_element(_elem, _data, _datalen) \
for (_elem = (const struct element *)(_data); \
@@ -2741,11 +2745,15 @@ struct element {
#define for_each_element_id(element, _id, data, datalen) \
for_each_element(element, data, datalen) \
- if (element->id == (_id))
+ if (element_iteration_typecheck(enum ieee80211_eid, \
+ _id) && \
+ element->id == (_id))
#define for_each_element_extid(element, extid, _data, _datalen) \
for_each_element(element, _data, _datalen) \
- if (element->id == WLAN_EID_EXTENSION && \
+ if (element_iteration_typecheck(enum ieee80211_eid_ext, \
+ extid) && \
+ element->id == WLAN_EID_EXTENSION && \
element->datalen > 0 && \
element->data[0] == (extid))
@@ -2753,10 +2761,11 @@ struct element {
for_each_element(sub, (element)->data, (element)->datalen)
#define for_each_subelement_id(sub, id, element) \
- for_each_element_id(sub, id, (element)->data, (element)->datalen)
+ for_each_element_id(sub, (u8)id, (element)->data, (element)->datalen)
#define for_each_subelement_extid(sub, extid, element) \
- for_each_element_extid(sub, extid, (element)->data, (element)->datalen)
+ for_each_element_extid(sub, (u8)extid, (element)->data, \
+ (element)->datalen)
/**
* for_each_element_completed - determine if element parsing consumed all data
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index afae93f6f245..dfffda3d8002 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -123,6 +123,8 @@
#define SDIO_VENDOR_ID_NXP 0x0471
#define SDIO_DEVICE_ID_NXP_IW61X_BASE 0x0204
#define SDIO_DEVICE_ID_NXP_IW61X 0x0205
+#define SDIO_DEVICE_ID_NXP_IW610_BASE 0x0214
+#define SDIO_DEVICE_ID_NXP_IW610 0x0215
#define SDIO_VENDOR_ID_REALTEK 0x024c
#define SDIO_DEVICE_ID_REALTEK_RTW8723BS 0xb723