Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Dec 2005 20:45:49 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 87655 for review
Message-ID:  <200512022045.jB2KjnWQ079641@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=87655

Change 87655 by sam@sam_ebb on 2005/12/02 20:45:17

	correct initial media setting; strip media_status mode bits
	since they are incorrect

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211.c#33 edit

Differences ...

==== //depot/projects/wifi/sys/net80211/ieee80211.c#33 (text+ko) ====

@@ -62,6 +62,9 @@
 	"sturboA",	/* IEEE80211_MODE_STURBO_A */
 };
 
+static	int media_status(enum ieee80211_opmode ,
+		const struct ieee80211_channel *);
+
 /* list of all instances */
 SLIST_HEAD(ieee80211_list, ieee80211com);
 static struct ieee80211_list ieee80211_list =
@@ -354,7 +357,6 @@
 	ifmedia_add(&(_ic)->ic_media, \
 		IFM_MAKEWORD(IFM_IEEE80211, (_s), (_o), 0), 0, NULL)
 	struct ifnet *ifp = ic->ic_ifp;
-	struct ifmediareq imr;
 	int i, j, mode, rate, maxrate, mword, mopt, r;
 	struct ieee80211_rateset *rs;
 	struct ieee80211_rateset allrates;
@@ -444,8 +446,9 @@
 		if (ic->ic_caps & IEEE80211_C_MONITOR)
 			ADD(ic, mword, IFM_IEEE80211_MONITOR);
 	}
-	ieee80211_media_status(ifp, &imr);
-	ifmedia_set(&ic->ic_media, imr.ifm_active);
+	/* NB: strip explicit mode; we're actually in autoselect */
+	ifmedia_set(&ic->ic_media,
+		media_status(ic->ic_opmode, ic->ic_curchan) &~ IFM_MMASK);
 
 	if (maxrate)
 		ifp->if_baudrate = IF_Mbps(maxrate);
@@ -752,6 +755,8 @@
 		status |= IFM_IEEE80211_MONITOR;
 		break;
 	case IEEE80211_M_AHDEMO:
+		status |= IFM_IEEE80211_ADHOC | IFM_FLAG0;
+		break;
 	case IEEE80211_M_WDS:
 		/* should not come here */
 		break;



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