From owner-p4-projects@FreeBSD.ORG Fri Dec 29 12:15:59 2006 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 6657516A6BA; Fri, 29 Dec 2006 12:15:57 +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 42A6616A52F for ; Fri, 29 Dec 2006 11:49:06 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 333A413C474 for ; Fri, 29 Dec 2006 11:49:06 +0000 (UTC) (envelope-from kmacy@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 kBT2YKcf010362 for ; Fri, 29 Dec 2006 02:34:20 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBT2YKTv010359 for perforce@freebsd.org; Fri, 29 Dec 2006 02:34:20 GMT (envelope-from kmacy@freebsd.org) Date: Fri, 29 Dec 2006 02:34:20 GMT Message-Id: <200612290234.kBT2YKTv010359@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 112264 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: Fri, 29 Dec 2006 12:15:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=112264 Change 112264 by kmacy@kmacy_storage:kmacy_wifi on 2006/12/29 02:33:57 integrate by hand some channel handling changes so that we don't panic while attaching in ath Affected files ... .. //depot/projects/kmacy_wifi/sys/net80211/ieee80211.c#6 edit .. //depot/projects/kmacy_wifi/sys/net80211/ieee80211_proto.c#3 edit .. //depot/projects/kmacy_wifi/sys/net80211/ieee80211_var.h#3 edit Differences ... ==== //depot/projects/kmacy_wifi/sys/net80211/ieee80211.c#6 (text+ko) ==== @@ -159,7 +159,7 @@ ("invalid number of channels specified: %u", ic->ic_nchans)); memset(ic->ic_chan_avail, 0, sizeof(ic->ic_chan_avail)); ic->ic_modecaps = 1<ic_nchans; i++) { + for (i = 0; i <= IEEE80211_CHAN_MAX; i++) { c = &ic->ic_channels[i]; if (c->ic_flags) { /* @@ -196,10 +196,11 @@ } } } +#if 0 /* initialize candidate channels to all available */ memcpy(ic->ic_chan_active, ic->ic_chan_avail, sizeof(ic->ic_chan_avail)); - +#endif /* fillin well-known rate sets if driver has not specified */ DEFAULTRATES(IEEE80211_MODE_11B, ieee80211_rateset_11b); DEFAULTRATES(IEEE80211_MODE_11G, ieee80211_rateset_11g); @@ -348,11 +349,18 @@ int ieee80211_chan2ieee(struct ieee80211com *ic, const struct ieee80211_channel *c) { - if (c == NULL) { + if (ic->ic_channels <= c && c <= &ic->ic_channels[IEEE80211_CHAN_MAX]) + return c - ic->ic_channels; + else if (c == IEEE80211_CHAN_ANYC) + return IEEE80211_CHAN_ANY; + else if (c != NULL) { + if_printf(ic->ic_ifp, "invalid channel freq %u flags %x\n", + c->ic_freq, c->ic_flags); + return 0; /* XXX */ + } else { if_printf(ic->ic_ifp, "invalid channel (NULL)\n"); return 0; /* XXX */ } - return (c == IEEE80211_CHAN_ANYC ? IEEE80211_CHAN_ANY : c->ic_ieee); } /* ==== //depot/projects/kmacy_wifi/sys/net80211/ieee80211_proto.c#3 (text+ko) ==== @@ -631,7 +631,7 @@ * entering the RUN state with bsschan setup properly * so state will eventually get set correctly */ - if (ic->ic_bsschan != IEEE80211_CHAN_ANYC) + if (ic->ic_bsschan != NULL) mode = ieee80211_chan2mode(ic, ic->ic_bsschan); else mode = IEEE80211_MODE_AUTO; ==== //depot/projects/kmacy_wifi/sys/net80211/ieee80211_var.h#3 (text+ko) ====