PERFORCE change 66378 for review

Sam Leffler sam at FreeBSD.org
Fri Dec 3 16:20:47 PST 2004


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

Change 66378 by sam at sam_ebb on 2004/12/04 00:20:23

	o get/set beacon interval
	o disallow dtim period set in other than ap + ibss modes

Affected files ...

.. //depot/projects/wifi/sys/net80211/ieee80211.c#14 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#25 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#15 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_var.h#17 edit

Differences ...

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

@@ -168,7 +168,7 @@
 	(void) ieee80211_setmode(ic, ic->ic_curmode);
 
 	if (ic->ic_lintval == 0)
-		ic->ic_lintval = 100;		/* default sleep */
+		ic->ic_lintval = IEEE80211_BINTVAL_DEFAULT;
 	ic->ic_bmisstimeout = 7*ic->ic_lintval;	/* default 7 beacons */
 	ic->ic_dtim_period = IEEE80211_DTIM_DEFAULT;
 	IEEE80211_BEACON_LOCK_INIT(ic, "beacon");

==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#25 (text+ko) ====

@@ -1438,6 +1438,10 @@
 	case IEEE80211_IOC_DTIM_PERIOD:
 		ireq->i_val = ic->ic_dtim_period;
 		break;
+	case IEEE80211_IOC_BEACON_INTERVAL:
+		/* NB: get from ic_bss for station mode */
+		ireq->i_val = ic->ic_bss->ni_intval;
+		break;
 	default:
 		error = EINVAL;
 		break;
@@ -2231,7 +2235,7 @@
 		error = ieee80211_ioctl_setchanlist(ic, ireq);
 		break;
 	case IEEE80211_IOC_SCAN_REQ:
-		if (ic->ic_opmode == IEEE80211_M_HOSTAP)
+		if (ic->ic_opmode == IEEE80211_M_HOSTAP)	/* XXX ignore */
 			break;
 		error = ieee80211_setupscan(ic, ic->ic_chan_avail);
 		if (error == 0)		/* XXX background scan */
@@ -2252,6 +2256,9 @@
 		error = ieee80211_ioctl_setwmeparam(ic, ireq);
 		break;
 	case IEEE80211_IOC_DTIM_PERIOD:
+		if (ic->ic_opmode != IEEE80211_M_HOSTAP &&
+		    ic->ic_opmode != IEEE80211_M_IBSS)
+			return EINVAL;
 		if (IEEE80211_DTIM_MIN <= ireq->i_val &&
 		    ireq->i_val <= IEEE80211_DTIM_MAX) {
 			IEEE80211_BEACON_LOCK(ic);
@@ -2260,6 +2267,17 @@
 		} else
 			error = EINVAL;
 		break;
+	case IEEE80211_IOC_BEACON_INTERVAL:
+		if (ic->ic_opmode != IEEE80211_M_HOSTAP &&
+		    ic->ic_opmode != IEEE80211_M_IBSS)
+			return EINVAL;
+		if (IEEE80211_BINTVAL_MIN <= ireq->i_val &&
+		    ireq->i_val <= IEEE80211_BINTVAL_MAX) {
+			ic->ic_lintval = ireq->i_val;
+			error = ENETRESET;		/* requires restart */
+		} else
+			error = EINVAL;
+		break;
 	default:
 		error = EINVAL;
 		break;

==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#15 (text+ko) ====

@@ -419,7 +419,8 @@
 #define	IEEE80211_IOC_WME_TXOPLIMIT	49	/* WME: txops limit */
 #define	IEEE80211_IOC_WME_ACM		50	/* WME: ACM (bss only) */
 #define	IEEE80211_IOC_WME_ACKPOLICY	51	/* WME: ACK policy (!bss only)*/
-#define	IEEE80211_IOC_DTIM_PERIOD	52	/* DTIM period */
+#define	IEEE80211_IOC_DTIM_PERIOD	52	/* DTIM period (beacons) */
+#define	IEEE80211_IOC_BEACON_INTERVAL	53	/* beacon interval (ms) */
 
 /*
  * Scan result data returned for IEEE80211_IOC_SCAN_RESULTS.

==== //depot/projects/wifi/sys/net80211/ieee80211_var.h#17 (text+ko) ====

@@ -65,6 +65,10 @@
 #define	IEEE80211_DTIM_MIN	1	/* min DTIM period */
 #define	IEEE80211_DTIM_DEFAULT	1	/* default DTIM period */
 
+#define	IEEE80211_BINTVAL_MAX	500	/* max beacon interval (ms) */
+#define	IEEE80211_BINTVAL_MIN	25	/* min beacon interval */
+#define	IEEE80211_BINTVAL_DEFAULT 100	/* default beacon interval */
+
 #define	IEEE80211_PS_SLEEP	0x1	/* STA is in power saving mode */
 #define	IEEE80211_PS_MAX_QUEUE	50	/* maximum saved packets */
 


More information about the p4-projects mailing list