introduce new debug flag "tsf" (ATH_DEBUG_TSF) so TSF timestamp processing
[madwifi/.git] / tools / wlanconfig.c
index 7cb60c46ccad6283045ba2edac909a0ea4d6fe14..360a26124dc5f4c2357659748e41414a084da1ae 100644 (file)
@@ -74,6 +74,9 @@
 
 #define        streq(a,b)      (strncasecmp(a, b, sizeof(b) - 1) == 0)
 
+#undef ARRAY_SIZE
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
 static int if_split_name(const char *, char **, unsigned int *);
 static void vap_create(struct ifreq *);
 static void vap_destroy(const char *);
@@ -694,11 +697,8 @@ list_scan(const char *ifname)
 static void
 print_chaninfo(const struct ieee80211_channel *c)
 {
-#define        IEEE80211_IS_CHAN_PASSIVE(_c) \
-       (((_c)->ic_flags & IEEE80211_CHAN_PASSIVE))
-#define        IEEE80211_IS_CHAN_RADAR(_c) \
-       (((_c)->ic_flags & IEEE80211_CHAN_RADAR) != 0)
        char buf[14];
+
        buf[0] = '\0';
        if (IEEE80211_IS_CHAN_FHSS(c))
                strlcat(buf, " FHSS", sizeof(buf));
@@ -723,7 +723,6 @@ print_chaninfo(const struct ieee80211_channel *c)
                IEEE80211_IS_CHAN_PASSIVE(c) ? '*' : ' ', 
                IEEE80211_IS_CHAN_RADAR(c) ? '!' : ' ', 
               buf);
-#undef IEEE80211_IS_CHAN_PASSIVE
 }
 
 static void
@@ -929,8 +928,6 @@ get80211param(const char *ifname, int param, void *data, size_t len)
 static int
 do80211priv(struct iwreq *iwr, const char *ifname, int op, void *data, size_t len)
 {
-#define        N(a)    (sizeof(a)/sizeof(a[0]))
-
        memset(iwr, 0, sizeof(struct iwreq));
        strncpy(iwr->ifr_name, ifname, IFNAMSIZ);
        if (len < IFNAMSIZ) {
@@ -974,14 +971,13 @@ do80211priv(struct iwreq *iwr, const char *ifname, int op, void *data, size_t le
                        IOCTL_ERR(IEEE80211_IOCTL_WRITEREG),
                };
                op -= SIOCIWFIRSTPRIV;
-               if (0 <= op && op < N(opnames))
+               if (0 <= op && op < ARRAY_SIZE(opnames))
                        perror(opnames[op]);
                else
                        perror("ioctl[unknown???]");
                return -1;
        }
        return 0;
-#undef N
 }
 
 static int