From owner-svn-src-head@freebsd.org Sat Oct 3 21:48:30 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E1D8A0F3BD; Sat, 3 Oct 2015 21:48:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 726211E49; Sat, 3 Oct 2015 21:48:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t93LmUUl030991; Sat, 3 Oct 2015 21:48:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t93LmRvC030979; Sat, 3 Oct 2015 21:48:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510032148.t93LmRvC030979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Oct 2015 21:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288635 - in head/sys: dev/ath dev/if_ndis dev/mwl dev/usb/wlan dev/wpi net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2015 21:48:30 -0000 Author: adrian Date: Sat Oct 3 21:48:27 2015 New Revision: 288635 URL: https://svnweb.freebsd.org/changeset/base/288635 Log: net80211: drop redundant 3rd parameter from iv_key_set(). The MAC can be fetched from the key struct. I added the ndis updates to make it compile. Submitted by: Differential Revision: https://reviews.freebsd.org/D3657 Modified: head/sys/dev/ath/if_ath_keycache.c head/sys/dev/ath/if_ath_keycache.h head/sys/dev/if_ndis/if_ndis.c head/sys/dev/mwl/if_mwl.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/wpi/if_wpi.c head/sys/net80211/ieee80211_crypto.c head/sys/net80211/ieee80211_var.h Modified: head/sys/dev/ath/if_ath_keycache.c ============================================================================== --- head/sys/dev/ath/if_ath_keycache.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/ath/if_ath_keycache.c Sat Oct 3 21:48:27 2015 (r288635) @@ -527,8 +527,7 @@ ath_key_delete(struct ieee80211vap *vap, * slot(s) must already have been allocated by ath_key_alloc. */ int -ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, - const u_int8_t mac[IEEE80211_ADDR_LEN]) +ath_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct ath_softc *sc = vap->iv_ic->ic_softc; Modified: head/sys/dev/ath/if_ath_keycache.h ============================================================================== --- head/sys/dev/ath/if_ath_keycache.h Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/ath/if_ath_keycache.h Sat Oct 3 21:48:27 2015 (r288635) @@ -35,8 +35,7 @@ extern int ath_key_alloc(struct ieee80211vap *, struct ieee80211_key *, ieee80211_keyix *, ieee80211_keyix *); extern int ath_key_delete(struct ieee80211vap *, const struct ieee80211_key *); -extern int ath_key_set(struct ieee80211vap *, const struct ieee80211_key *, - const u_int8_t mac[IEEE80211_ADDR_LEN]); +extern int ath_key_set(struct ieee80211vap *, const struct ieee80211_key *); extern int ath_keyset(struct ath_softc *sc, struct ieee80211vap *vap, const struct ieee80211_key *k, struct ieee80211_node *bss); Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/if_ndis/if_ndis.c Sat Oct 3 21:48:27 2015 (r288635) @@ -194,7 +194,7 @@ static void ndis_media_status (struct if static int ndis_set_cipher (struct ndis_softc *, int); static int ndis_set_wpa (struct ndis_softc *, void *, int); static int ndis_add_key (struct ieee80211vap *, - const struct ieee80211_key *, const u_int8_t []); + const struct ieee80211_key *); static int ndis_del_key (struct ieee80211vap *, const struct ieee80211_key *); static void ndis_setmulti (struct ndis_softc *); @@ -3070,8 +3070,7 @@ ndis_del_key(struct ieee80211vap *vap, c * set after initial authentication with the AP. */ static int -ndis_add_key(struct ieee80211vap *vap, const struct ieee80211_key *key, - const uint8_t mac[IEEE80211_ADDR_LEN]) +ndis_add_key(struct ieee80211vap *vap, const struct ieee80211_key *key) { struct ndis_softc *sc = vap->iv_ic->ic_softc; ndis_80211_key rkey; Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/mwl/if_mwl.c Sat Oct 3 21:48:27 2015 (r288635) @@ -111,7 +111,10 @@ static int mwl_key_alloc(struct ieee8021 ieee80211_keyix *, ieee80211_keyix *); static int mwl_key_delete(struct ieee80211vap *, const struct ieee80211_key *); -static int mwl_key_set(struct ieee80211vap *, const struct ieee80211_key *, +static int mwl_key_set(struct ieee80211vap *, + const struct ieee80211_key *); +static int _mwl_key_set(struct ieee80211vap *, + const struct ieee80211_key *, const uint8_t mac[IEEE80211_ADDR_LEN]); static int mwl_mode_init(struct mwl_softc *); static void mwl_update_mcast(struct ieee80211com *); @@ -1604,7 +1607,13 @@ addgroupflags(MWL_HAL_KEYVAL *hk, const * slot(s) must already have been allocated by mwl_key_alloc. */ static int -mwl_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, +mwl_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) +{ + return (_mwl_key_set(vap, k, k->wk_macaddr)); +} + +static int +_mwl_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, const uint8_t mac[IEEE80211_ADDR_LEN]) { #define GRPXMIT (IEEE80211_KEY_XMIT | IEEE80211_KEY_GROUP) @@ -3911,7 +3920,8 @@ mwl_setanywepkey(struct ieee80211vap *va IEEE80211_F_PRIVACY && vap->iv_def_txkey != IEEE80211_KEYIX_NONE && vap->iv_nw_keys[vap->iv_def_txkey].wk_keyix != IEEE80211_KEYIX_NONE) - (void) mwl_key_set(vap, &vap->iv_nw_keys[vap->iv_def_txkey], mac); + (void) _mwl_key_set(vap, &vap->iv_nw_keys[vap->iv_def_txkey], + mac); } static int @@ -3956,7 +3966,7 @@ mwl_setglobalkeys(struct ieee80211vap *v wk = &vap->iv_nw_keys[0]; for (; wk < &vap->iv_nw_keys[IEEE80211_WEP_NKID]; wk++) if (wk->wk_keyix != IEEE80211_KEYIX_NONE) - (void) mwl_key_set(vap, wk, vap->iv_myaddr); + (void) _mwl_key_set(vap, wk, vap->iv_myaddr); } /* Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/usb/wlan/if_rum.c Sat Oct 3 21:48:27 2015 (r288635) @@ -249,8 +249,7 @@ static int rum_key_alloc(struct ieee802 struct ieee80211_key *, ieee80211_keyix *, ieee80211_keyix *); static int rum_key_set(struct ieee80211vap *, - const struct ieee80211_key *, - const uint8_t mac[IEEE80211_ADDR_LEN]); + const struct ieee80211_key *); static int rum_key_delete(struct ieee80211vap *, const struct ieee80211_key *); static int rum_raw_xmit(struct ieee80211_node *, struct mbuf *, @@ -2659,8 +2658,7 @@ rum_key_alloc(struct ieee80211vap *vap, } static int -rum_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, - const uint8_t mac[IEEE80211_ADDR_LEN]) +rum_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { struct rum_softc *sc = vap->iv_ic->ic_softc; int group; Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/usb/wlan/if_run.c Sat Oct 3 21:48:27 2015 (r288635) @@ -382,8 +382,7 @@ static int run_newstate(struct ieee80211 static int run_wme_update(struct ieee80211com *); static void run_wme_update_cb(void *); static void run_key_set_cb(void *); -static int run_key_set(struct ieee80211vap *, struct ieee80211_key *, - const uint8_t mac[IEEE80211_ADDR_LEN]); +static int run_key_set(struct ieee80211vap *, struct ieee80211_key *); static void run_key_delete_cb(void *); static int run_key_delete(struct ieee80211vap *, struct ieee80211_key *); static void run_ratectl_to(void *); @@ -2361,8 +2360,7 @@ run_key_set_cb(void *arg) * return 0 on error */ static int -run_key_set(struct ieee80211vap *vap, struct ieee80211_key *k, - const uint8_t mac[IEEE80211_ADDR_LEN]) +run_key_set(struct ieee80211vap *vap, struct ieee80211_key *k) { struct ieee80211com *ic = vap->iv_ic; struct run_softc *sc = ic->ic_softc; @@ -2374,7 +2372,7 @@ run_key_set(struct ieee80211vap *vap, st sc->cmdq[i].arg0 = NULL; sc->cmdq[i].arg1 = vap; sc->cmdq[i].k = k; - IEEE80211_ADDR_COPY(sc->cmdq[i].mac, mac); + IEEE80211_ADDR_COPY(sc->cmdq[i].mac, k->wk_macaddr); ieee80211_runtask(ic, &sc->cmdq_task); /* Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/dev/wpi/if_wpi.c Sat Oct 3 21:48:27 2015 (r288635) @@ -254,8 +254,7 @@ static void wpi_del_key_cb(void *, struc static int wpi_process_key(struct ieee80211vap *, const struct ieee80211_key *, int); static int wpi_key_set(struct ieee80211vap *, - const struct ieee80211_key *, - const uint8_t mac[IEEE80211_ADDR_LEN]); + const struct ieee80211_key *); static int wpi_key_delete(struct ieee80211vap *, const struct ieee80211_key *); static int wpi_post_alive(struct wpi_softc *); @@ -4799,8 +4798,7 @@ wpi_process_key(struct ieee80211vap *vap } static int -wpi_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, - const uint8_t mac[IEEE80211_ADDR_LEN]) +wpi_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { return wpi_process_key(vap, k, 1); } Modified: head/sys/net80211/ieee80211_crypto.c ============================================================================== --- head/sys/net80211/ieee80211_crypto.c Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/net80211/ieee80211_crypto.c Sat Oct 3 21:48:27 2015 (r288635) @@ -89,8 +89,7 @@ null_key_delete(struct ieee80211vap *vap return 1; } static int -null_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k, - const uint8_t mac[IEEE80211_ADDR_LEN]) +null_key_set(struct ieee80211vap *vap, const struct ieee80211_key *k) { return 1; } @@ -132,7 +131,7 @@ dev_key_delete(struct ieee80211vap *vap, static __inline int dev_key_set(struct ieee80211vap *vap, const struct ieee80211_key *key) { - return vap->iv_key_set(vap, key, key->wk_macaddr); + return vap->iv_key_set(vap, key); } /* Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Oct 3 20:53:10 2015 (r288634) +++ head/sys/net80211/ieee80211_var.h Sat Oct 3 21:48:27 2015 (r288635) @@ -461,8 +461,7 @@ struct ieee80211vap { int (*iv_key_delete)(struct ieee80211vap *, const struct ieee80211_key *); int (*iv_key_set)(struct ieee80211vap *, - const struct ieee80211_key *, - const uint8_t mac[IEEE80211_ADDR_LEN]); + const struct ieee80211_key *); void (*iv_key_update_begin)(struct ieee80211vap *); void (*iv_key_update_end)(struct ieee80211vap *);