diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2023-12-15 15:38:51 +0300 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2023-12-19 19:32:24 +0300 |
commit | 1c1c2b37325934b4318c46966feb03ad9fe83d8a (patch) | |
tree | 3d5a4af88f06eb333b5837396405491db6d8bdf3 /include/net | |
parent | 4e87ca403e2008b9e182239e1abbf6876a55eb33 (diff) | |
download | linux-1c1c2b37325934b4318c46966feb03ad9fe83d8a.tar.xz |
wifi: cfg80211: introduce cfg80211_ssid_eq()
Since SSIDs comparison is commonly used across many drivers, introduce
generic 'cfg80211_ssid_eq()' to replace driver-private implementations.
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://msgid.link/20231215123859.196350-1-dmantipov@yandex.ru
[fix kernel-doc return docs]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cfg80211.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index ac1fb326dcda..033a0a25397f 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -7166,6 +7166,23 @@ int cfg80211_get_ies_channel_number(const u8 *ie, size_t ielen, enum nl80211_band band); /** + * cfg80211_ssid_eq - compare two SSIDs + * @a: first SSID + * @b: second SSID + * + * Return: %true if SSIDs are equal, %false otherwise. + */ +static inline bool +cfg80211_ssid_eq(struct cfg80211_ssid *a, struct cfg80211_ssid *b) +{ + if (WARN_ON(!a || !b)) + return false; + if (a->ssid_len != b->ssid_len) + return false; + return memcmp(a->ssid, b->ssid, a->ssid_len) ? false : true; +} + +/** * cfg80211_inform_bss_data - inform cfg80211 of a new BSS * * @wiphy: the wiphy reporting the BSS |