PERFORCE change 87655 for review

Sam Leffler sam at FreeBSD.org
Fri Dec 2 20:45:51 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=87655

Change 87655 by sam at 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;


More information about the p4-projects mailing list