Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Dec 2006 02:34:20 GMT
From:      Kip Macy <kmacy@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 112264 for review
Message-ID:  <200612290234.kBT2YKTv010359@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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<<IEEE80211_MODE_AUTO;
-	for (i = 0; i < ic->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) ====




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612290234.kBT2YKTv010359>