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: <[email protected]>
  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 *);
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to