Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net80211 Instead of always checking for ANYC, make it a ...



details:   https://anonhg.NetBSD.org/src/rev/1536d10f3f97
branches:  trunk
changeset: 785587:1536d10f3f97
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 21 18:30:09 2013 +0000

description:
Instead of always checking for ANYC, make it a valid channel

diffstat:

 sys/net80211/_ieee80211.h |  8 ++++----
 sys/net80211/ieee80211.c  |  8 ++++++--
 2 files changed, 10 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r 56e343257ba5 -r 1536d10f3f97 sys/net80211/_ieee80211.h
--- a/sys/net80211/_ieee80211.h Thu Mar 21 17:45:03 2013 +0000
+++ b/sys/net80211/_ieee80211.h Thu Mar 21 18:30:09 2013 +0000
@@ -107,11 +107,12 @@
        u_int16_t       ic_flags;       /* see below */
 };
 
+extern const struct ieee80211_channel ieee80211_channel_anyc;
+
 #define        IEEE80211_CHAN_MAX      255
 #define        IEEE80211_CHAN_BYTES    32      /* howmany(IEEE80211_CHAN_MAX, NBBY) */
 #define        IEEE80211_CHAN_ANY      0xffff  /* token for ``any channel'' */
-#define        IEEE80211_CHAN_ANYC \
-       ((struct ieee80211_channel *) 0x1)
+#define        IEEE80211_CHAN_ANYC     (__UNCONST(&ieee80211_channel_anyc))
 
 /* bits 0-3 are for private use by drivers */
 /* channel attributes */
@@ -155,8 +156,7 @@
        ((_c) == IEEE80211_CHAN_ANYC)
 
 #define _IEEE80211_IS_CHAN(_c, _ch) \
-       (!IEEE80211_IS_CHAN_ANYC(_c) && \
-       ((_c)->ic_flags & IEEE80211_CHAN_ ## _ch) == IEEE80211_CHAN_ ## _ch)
+       (((_c)->ic_flags & IEEE80211_CHAN_ ## _ch) == IEEE80211_CHAN_ ## _ch)
 
 #define        IEEE80211_IS_CHAN_FHSS(_c)      _IEEE80211_IS_CHAN(_c, FHSS)
 #define        IEEE80211_IS_CHAN_A(_c)         _IEEE80211_IS_CHAN(_c, A)
diff -r 56e343257ba5 -r 1536d10f3f97 sys/net80211/ieee80211.c
--- a/sys/net80211/ieee80211.c  Thu Mar 21 17:45:03 2013 +0000
+++ b/sys/net80211/ieee80211.c  Thu Mar 21 18:30:09 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee80211.c,v 1.53 2010/04/05 07:22:24 joerg Exp $     */
+/*     $NetBSD: ieee80211.c,v 1.54 2013/03/21 18:30:09 christos Exp $  */
 /*-
  * Copyright (c) 2001 Atsushi Onoe
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -36,7 +36,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.22 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211.c,v 1.53 2010/04/05 07:22:24 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211.c,v 1.54 2013/03/21 18:30:09 christos Exp $");
 #endif
 
 /*
@@ -73,6 +73,10 @@
 #include <net/if_ether.h>
 #endif
 
+const struct ieee80211_channel ieee80211_channel_anyc = {
+       0, 0
+};
+
 struct ieee80211com_head ieee80211com_head =
     LIST_HEAD_INITIALIZER(ieee80211com_head);
 



Home | Main Index | Thread Index | Old Index