From owner-p4-projects@FreeBSD.ORG Mon Jan 22 19:07:49 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 33CCE16A407; Mon, 22 Jan 2007 19:07:49 +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 EB0A116A401 for ; Mon, 22 Jan 2007 19:07:48 +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 DB80113C4C9 for ; Mon, 22 Jan 2007 19:07:48 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l0MJ7mZK074430 for ; Mon, 22 Jan 2007 19:07:48 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l0MJ7mAq074427 for perforce@freebsd.org; Mon, 22 Jan 2007 19:07:48 GMT (envelope-from sam@freebsd.org) Date: Mon, 22 Jan 2007 19:07:48 GMT Message-Id: <200701221907.l0MJ7mAq074427@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 113375 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: Mon, 22 Jan 2007 19:07:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=113375 Change 113375 by sam@sam_ebb on 2007/01/22 19:07:03 o remove hack channel mapping for psb; we don't need it now that we can uniquely identify a channel o key psb mapping on frequency; may need to also use the regdomain/sku but I think this is good for now o add channel width to ieee80211_announce_channels Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211.c#39 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211.c#39 (text+ko) ==== @@ -303,7 +303,7 @@ static __inline int mappsb(u_int freq, u_int flags) { - return 37 + ((freq * 10) + ((freq % 5) == 2 ? 5 : 0) - 49400) / 5; + return ((freq * 10) + (((freq % 5) == 2) ? 5 : 0) - 49400) / 5; } /* @@ -312,6 +312,7 @@ int ieee80211_mhz2ieee(u_int freq, u_int flags) { +#define IS_FREQ_IN_PSB(_freq) ((_freq) > 4940 && (_freq) < 4990) if (flags & IEEE80211_CHAN_GSM) return mapgsm(freq, flags); if (flags & IEEE80211_CHAN_2GHZ) { /* 2GHz band */ @@ -323,7 +324,8 @@ return 15 + ((freq - 2512) / 20); } else if (flags & IEEE80211_CHAN_5GHZ) { /* 5Ghz band */ if (freq <= 5000) { - if (flags &(IEEE80211_CHAN_HALF|IEEE80211_CHAN_QUARTER)) + /* XXX check regdomain? */ + if (IS_FREQ_IN_PSB(freq)) return mappsb(freq, flags); return (freq - 4000) / 5; } else @@ -337,7 +339,7 @@ return ((int) freq - 2407) / 5; } if (freq < 5000) { - if (flags &(IEEE80211_CHAN_HALF|IEEE80211_CHAN_QUARTER)) + if (IS_FREQ_IN_PSB(freq)) return mappsb(freq, flags); else if (freq > 4900) return (freq - 4000) / 5; @@ -346,6 +348,7 @@ } return (freq - 5000) / 5; } +#undef IS_FREQ_IN_PSB } /* @@ -584,9 +587,9 @@ { const struct ieee80211_channel *c; char type; - int i; + int i, cw; - printf("Chan Freq RegPwr MinPwr MaxPwr\n"); + printf("Chan Freq CW RegPwr MinPwr MaxPwr\n"); for (i = 0; i < ic->ic_nchans; i++) { c = &ic->ic_channels[i]; if (IEEE80211_IS_CHAN_ST(c)) @@ -603,8 +606,15 @@ type = 'b'; else type = 'f'; - printf("%4d %4d%c %6d %6d %6d\n" + if (IEEE80211_IS_CHAN_HALF(c)) + cw = 10; + else if (IEEE80211_IS_CHAN_QUARTER(c)) + cw = 5; + else + cw = 20; + printf("%4d %4d%c %2d %6d %6d %6d\n" , c->ic_ieee, c->ic_freq, type + , cw , c->ic_maxregpower , c->ic_minpower, c->ic_maxpower );