From owner-p4-projects@FreeBSD.ORG Wed May 9 16:45:44 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DB0D616A406; Wed, 9 May 2007 16:45:43 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8707916A478 for ; Wed, 9 May 2007 16:45:43 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 7446313C4B9 for ; Wed, 9 May 2007 16:45:43 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l49GjhR1005133 for ; Wed, 9 May 2007 16:45:43 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l49GjgL1005130 for perforce@freebsd.org; Wed, 9 May 2007 16:45:42 GMT (envelope-from sam@freebsd.org) Date: Wed, 9 May 2007 16:45:42 GMT Message-Id: <200705091645.l49GjgL1005130@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 119575 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2007 16:45:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=119575 Change 119575 by sam@sam_ebb on 2007/05/09 16:45:36 o add 11n flag o fixes for gcc 4 complaints Affected files ... .. //depot/projects/wifi/tools/tools/net80211/wlandebug/wlandebug.c#3 edit Differences ... ==== //depot/projects/wifi/tools/tools/net80211/wlandebug/wlandebug.c#3 (text+ko) ==== @@ -43,14 +43,17 @@ #include #include +#include #include #include #include +#include #define N(a) (sizeof(a)/sizeof(a[0])) const char *progname; +#define IEEE80211_MSG_11N 0x80000000 /* 11n mode debug */ #define IEEE80211_MSG_DEBUG 0x40000000 /* IFF_DEBUG equivalent */ #define IEEE80211_MSG_DUMPPKTS 0x20000000 /* IFF_LINK2 equivalant */ #define IEEE80211_MSG_CRYPTO 0x10000000 /* crypto work */ @@ -82,6 +85,7 @@ const char *name; u_int bit; } flags[] = { + { "11n", IEEE80211_MSG_11N }, { "debug", IEEE80211_MSG_DEBUG }, { "dumppkts", IEEE80211_MSG_DUMPPKTS }, { "crypto", IEEE80211_MSG_CRYPTO }, @@ -150,7 +154,7 @@ const char *ifname = "ath0"; const char *cp, *tp; const char *sep; - int c, op, i, unit; + int op, i, unit; u_int32_t debug, ndebug; size_t debuglen, parentlen; char oid[256], parent[256]; @@ -173,8 +177,9 @@ snprintf(oid, sizeof(oid), "net.wlan.%d.%%parent", unit); #endif parentlen = sizeof(parent); - if (sysctlbyname(oid, parent, &parentlen, NULL, 0) >= 0 && - strncmp(parent, ifname, parentlen) == 0) + if (sysctlbyname(oid, parent, &parentlen, NULL, 0) < 0) + continue; + if (strncmp(parent, ifname, parentlen) == 0) break; } if (unit == 10) @@ -210,11 +215,12 @@ ndebug |= bit; else { if (bit == 0) { - if (isdigit(*cp)) + int c = *cp; + if (isdigit(c)) bit = strtoul(cp, NULL, 0); else errx(1, "unknown flag %.*s", - tp-cp, cp); + (int)(tp-cp), cp); } ndebug = bit; }