PERFORCE change 64070 for review
Sam Leffler
sam at FreeBSD.org
Mon Nov 1 14:49:40 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=64070
Change 64070 by sam at sam_ebb on 2004/11/01 22:48:48
add ioctls to futz with the inactivity timers and to get to
the mac acl support
Affected files ...
.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#9 edit
.. //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#4 edit
Differences ...
==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.c#9 (text+ko) ====
@@ -1186,6 +1186,15 @@
case IEEE80211_IOC_STA_STATS:
error = ieee80211_ioctl_getstastats(ic, ireq);
break;
+ case IEEE80211_IOC_INACT:
+ ireq->i_val = ic->ic_inact_run * IEEE80211_INACT_WAIT;
+ break;
+ case IEEE80211_IOC_INACT_AUTH:
+ ireq->i_val = ic->ic_inact_auth * IEEE80211_INACT_WAIT;
+ break;
+ case IEEE80211_IOC_INACT_INIT:
+ ireq->i_val = ic->ic_inact_init * IEEE80211_INACT_WAIT;
+ break;
default:
error = EINVAL;
break;
@@ -1397,6 +1406,40 @@
}
static int
+ieee80211_ioctl_maccmd(struct ieee80211com *ic, struct ieee80211req *ireq)
+{
+ const struct ieee80211_aclator *acl = ic->ic_acl;
+
+ switch (ireq->i_val) {
+ case IEEE80211_MACCMD_POLICY_OPEN:
+ case IEEE80211_MACCMD_POLICY_ALLOW:
+ case IEEE80211_MACCMD_POLICY_DENY:
+ if (acl == NULL) {
+ acl = ieee80211_aclator_get("mac");
+ if (acl == NULL || !acl->iac_attach(ic))
+ return EINVAL;
+ ic->ic_acl = acl;
+ }
+ acl->iac_setpolicy(ic, ireq->i_val);
+ break;
+ case IEEE80211_MACCMD_FLUSH:
+ if (acl != NULL)
+ acl->iac_flush(ic);
+ /* NB: silently ignore when not in use */
+ break;
+ case IEEE80211_MACCMD_DETACH:
+ if (acl != NULL) {
+ ic->ic_acl = NULL;
+ acl->iac_detach(ic);
+ }
+ break;
+ default:
+ return EINVAL;
+ }
+ return 0;
+}
+
+static int
ieee80211_ioctl_setchanlist(struct ieee80211com *ic, struct ieee80211req *ireq)
{
struct ieee80211req_chanlist list;
@@ -1818,6 +1861,18 @@
if (error == 0)
error = ieee80211_new_state(ic, IEEE80211_S_SCAN, -1);
break;
+ case IEEE80211_IOC_MACCMD:
+ error = ieee80211_ioctl_maccmd(ic, ireq);
+ break;
+ case IEEE80211_IOC_INACT:
+ ic->ic_inact_run = ireq->i_val / IEEE80211_INACT_WAIT;
+ break;
+ case IEEE80211_IOC_INACT_AUTH:
+ ic->ic_inact_auth = ireq->i_val / IEEE80211_INACT_WAIT;
+ break;
+ case IEEE80211_IOC_INACT_INIT:
+ ic->ic_inact_init = ireq->i_val / IEEE80211_INACT_WAIT;
+ break;
default:
error = EINVAL;
break;
==== //depot/projects/wifi/sys/net80211/ieee80211_ioctl.h#4 (text+ko) ====
@@ -332,6 +332,10 @@
#define IEEE80211_IOC_RSNCAPS 38 /* RSN capabilities */
#define IEEE80211_IOC_WPAIE 39 /* WPA information element */
#define IEEE80211_IOC_STA_STATS 40 /* per-station statistics */
+#define IEEE80211_IOC_MACCMD 41 /* MAC ACL operation */
+#define IEEE80211_IOC_INACT 42 /* station inactivity timeout */
+#define IEEE80211_IOC_INACT_AUTH 43 /* station auth inact timeout */
+#define IEEE80211_IOC_INACT_INIT 44 /* station init inact timeout */
#ifndef IEEE80211_CHAN_ANY
#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */
More information about the p4-projects
mailing list