PERFORCE change 77114 for review
Sam Leffler
sam at FreeBSD.org
Tue May 17 16:34:41 PDT 2005
http://perforce.freebsd.org/chv.cgi?CH=77114
Change 77114 by sam at sam_ebb on 2005/05/17 23:34:12
Synchronize wme and dynamic turbo state for multiple vap's by
marking ic_flags with the intersection of all vap's. This permits
drivers to check ic_flags to see if wme/dturbo should be setup.
Affected files ...
.. //depot/projects/vap/sys/net80211/ieee80211.c#10 edit
.. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#10 edit
.. //depot/projects/vap/sys/net80211/ieee80211_var.h#11 edit
Differences ...
==== //depot/projects/vap/sys/net80211/ieee80211.c#10 (text+ko) ====
@@ -329,6 +329,8 @@
IEEE80211_LOCK(ic);
TAILQ_INSERT_TAIL(&ic->ic_vaps, vap, iv_next);
+ ieee80211_syncflag(ic, IEEE80211_F_WME);
+ ieee80211_syncflag(ic, IEEE80211_F_TURBOP);
IEEE80211_UNLOCK(ic);
return 1;
@@ -347,6 +349,8 @@
TAILQ_REMOVE(&ic->ic_vaps, vap, iv_next);
if (TAILQ_EMPTY(&ic->ic_vaps)) /* reset to supported mode */
ic->ic_opmode = IEEE80211_M_STA;
+ ieee80211_syncflag(ic, IEEE80211_F_WME);
+ ieee80211_syncflag(ic, IEEE80211_F_TURBOP);
IEEE80211_UNLOCK(ic);
ifmedia_removeall(&vap->iv_media);
@@ -363,6 +367,23 @@
ieee80211_node_vdetach(vap);
}
+void
+ieee80211_syncflag(struct ieee80211com *ic, int flag)
+{
+ struct ieee80211vap *vap;
+ int bit;
+
+ bit = 1;
+ /* XXX locking */
+ TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
+ if ((vap->iv_flags & flag) == 0)
+ bit = 0;
+ if (bit)
+ ic->ic_flags |= flag;
+ else
+ ic->ic_flags &= ~flag;
+}
+
/*
* Convert MHz frequency to IEEE channel number.
*/
==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#10 (text+ko) ====
@@ -1620,6 +1620,7 @@
vap->iv_flags |= IEEE80211_F_WME;
} else
vap->iv_flags &= ~IEEE80211_F_WME;
+ ieee80211_syncflag(ic, IEEE80211_F_WME);
error = ENETRESET; /* XXX maybe not for station? */
break;
case IEEE80211_IOC_HIDESSID:
@@ -1716,6 +1717,8 @@
error = ieee80211_ioctl_setchanlist(vap, ireq);
break;
case IEEE80211_IOC_SCAN_REQ:
+ IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
+ "%s: active scan request\n", __func__);
error = ieee80211_start_scan(vap,
IEEE80211_SCAN_ACTIVE |
IEEE80211_SCAN_NOPICK |
@@ -1777,6 +1780,7 @@
vap->iv_flags |= IEEE80211_F_TURBOP;
} else
vap->iv_flags &= ~IEEE80211_F_TURBOP;
+ ieee80211_syncflag(ic, IEEE80211_F_TURBOP);
error = ENETRESET; /* XXX maybe not for station? */
break;
case IEEE80211_IOC_BGSCAN:
==== //depot/projects/vap/sys/net80211/ieee80211_var.h#11 (text+ko) ====
@@ -391,6 +391,7 @@
int ieee80211_rate2media(struct ieee80211com *, int,
enum ieee80211_phymode);
int ieee80211_media2rate(int);
+void ieee80211_syncflag(struct ieee80211com *, int);
u_int ieee80211_mhz2ieee(u_int, u_int);
u_int ieee80211_chan2ieee(struct ieee80211com *,
const struct ieee80211_channel *);
More information about the p4-projects
mailing list