Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142138882
D48172.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48172.id.diff
View Options
diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h
--- a/sys/net80211/_ieee80211.h
+++ b/sys/net80211/_ieee80211.h
@@ -163,6 +163,9 @@
#define IEEE80211_CHAN_ANYC \
((struct ieee80211_channel *) IEEE80211_CHAN_ANY)
+#define IEEE80211_IS_CHAN_DEFINED(c) ((c) != NULL)
+#define IEEE80211_IS_CHAN_ANYC(c) ((c) == IEEE80211_CHAN_ANYC)
+
/* channel attributes */
#define IEEE80211_CHAN_PRIV0 0x00000001 /* driver private bit 0 */
#define IEEE80211_CHAN_PRIV1 0x00000002 /* driver private bit 1 */
diff --git a/sys/net80211/ieee80211_dfs.c b/sys/net80211/ieee80211_dfs.c
--- a/sys/net80211/ieee80211_dfs.c
+++ b/sys/net80211/ieee80211_dfs.c
@@ -271,7 +271,7 @@
announce_radar(struct ieee80211com *ic, const struct ieee80211_channel *curchan,
const struct ieee80211_channel *newchan)
{
- if (newchan == NULL)
+ if (!IEEE80211_IS_CHAN_DEFINED(newchan))
ic_printf(ic, "radar detected on channel %u (%u MHz)\n",
curchan->ic_ieee, curchan->ic_freq);
else
@@ -364,7 +364,7 @@
if (callout_pending(&dfs->cac_timer))
callout_schedule(&dfs->cac_timer, 0);
- else if (dfs->newchan != NULL) {
+ else if (IEEE80211_IS_CHAN_DEFINED(dfs->newchan)) {
/* XXX mode 1, switch count 2 */
/* XXX calculate switch count based on max
switch time and beacon interval? */
diff --git a/sys/net80211/ieee80211_vht.c b/sys/net80211/ieee80211_vht.c
--- a/sys/net80211/ieee80211_vht.c
+++ b/sys/net80211/ieee80211_vht.c
@@ -883,14 +883,15 @@
const struct ieee80211vap *vap;
const struct ieee80211_channel *bss_chan;
- if (ni == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC ||
- ni->ni_vap == NULL || ni->ni_vap->iv_bss == NULL)
+ if (ni == NULL || IEEE80211_IS_CHAN_ANYC(ni->ni_chan) ||
+ ni->ni_vap == NULL ||
+ !IEEE80211_IS_CHAN_DEFINED(ni->ni_vap->iv_bss))
return (false);
vap = ni->ni_vap;
bss_chan = vap->iv_bss->ni_chan;
- if (bss_chan == IEEE80211_CHAN_ANYC)
+ if (IEEE80211_IS_CHAN_ANYC(bss_chan))
return (false);
return (IEEE80211_IS_CHAN_VHT(ni->ni_chan));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 17, 9:54 AM (3 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27661252
Default Alt Text
D48172.id.diff (1 KB)
Attached To
Mode
D48172: net80211: add macros for testing if a channel is defined / channel is "any channel"
Attached
Detach File
Event Timeline
Log In to Comment