Date: Mon, 1 Nov 2004 22:49:39 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 64070 for review Message-ID: <200411012249.iA1MndrA066035@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=64070 Change 64070 by sam@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'' */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411012249.iA1MndrA066035>