From owner-p4-projects@FreeBSD.ORG Mon Nov 1 22:49:40 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1B5BC16A4D0; Mon, 1 Nov 2004 22:49:40 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D356216A4CE for ; Mon, 1 Nov 2004 22:49:39 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB60F43D4C for ; Mon, 1 Nov 2004 22:49:39 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id iA1Mnd7o066038 for ; Mon, 1 Nov 2004 22:49:39 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id iA1MndrA066035 for perforce@freebsd.org; Mon, 1 Nov 2004 22:49:39 GMT (envelope-from sam@freebsd.org) Date: Mon, 1 Nov 2004 22:49:39 GMT Message-Id: <200411012249.iA1MndrA066035@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 64070 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2004 22:49:40 -0000 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'' */