net80211: define mask for ss_flags rather than using hardcoded 0xfff

scan state ss_flags in two places cut off the "internal" GOTPICK
options.  Replace the hardcoded 0xfff with a defined mask.
Note that "internal" flags is confusing as we also supplement the
the 16bit by another 16bit of "internal flags" passed around but
comaparing to GOTPICK never stored to my understanding.

No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D38832
This commit is contained in:
Bjoern A. Zeeb 2023-03-14 21:00:48 +00:00
parent 6c9fe35743
commit 3346164ce8
2 changed files with 3 additions and 3 deletions

View File

@ -136,6 +136,7 @@ struct ieee80211_scan_state {
#define IEEE80211_SCAN_ONCE 0x0010 /* do one complete pass */
#define IEEE80211_SCAN_NOBCAST 0x0020 /* no broadcast probe req */
#define IEEE80211_SCAN_NOJOIN 0x0040 /* no auto-sequencing */
#define IEEE80211_SCAN_PUBLIC_MASK 0x0fff /* top 4 bits for internal use */
#define IEEE80211_SCAN_GOTPICK 0x1000 /* got candidate, can stop */
uint8_t ss_nssid; /* # ssid's to probe/match */
struct ieee80211_scan_ssid ss_ssid[IEEE80211_SCAN_MAX_SSID];

View File

@ -196,8 +196,7 @@ ieee80211_swscan_start_scan_locked(const struct ieee80211_scanner *scan,
if ((flags & IEEE80211_SCAN_NOSSID) == 0)
ieee80211_scan_copy_ssid(vap, ss, nssid, ssids);
/* NB: top 4 bits for internal use */
ss->ss_flags = flags & 0xfff;
ss->ss_flags = flags & IEEE80211_SCAN_PUBLIC_MASK;
if (ss->ss_flags & IEEE80211_SCAN_ACTIVE)
vap->iv_stats.is_scan_active++;
else
@ -307,7 +306,7 @@ ieee80211_swscan_check_scan(const struct ieee80211_scanner *scan,
ic->ic_flags |= IEEE80211_F_SCAN;
/* NB: need to use supplied flags in check */
ss->ss_flags = flags & 0xff;
ss->ss_flags = flags & IEEE80211_SCAN_PUBLIC_MASK;
result = ss->ss_ops->scan_end(ss, vap);
ic->ic_flags &= ~IEEE80211_F_SCAN;