mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
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: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3657
This commit is contained in:
parent
ed5711a11b
commit
bc813c40bf
9 changed files with 28 additions and 29 deletions
|
|
@ -527,8 +527,7 @@ ath_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k)
|
|||
* 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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ static void ndis_media_status (struct ifnet *, struct ifmediareq *);
|
|||
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, const struct ieee80211_key *key)
|
|||
* 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;
|
||||
|
|
|
|||
|
|
@ -111,7 +111,10 @@ static int mwl_key_alloc(struct ieee80211vap *,
|
|||
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 struct ieee80211_key *k)
|
|||
* 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 *vap, const uint8_t mac[IEEE80211_ADDR_LEN]
|
|||
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 *vap)
|
|||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -249,8 +249,7 @@ static int rum_key_alloc(struct ieee80211vap *,
|
|||
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, struct ieee80211_key *k,
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -382,8 +382,7 @@ static int run_newstate(struct ieee80211vap *, enum ieee80211_state, int);
|
|||
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, struct ieee80211_key *k,
|
|||
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);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -254,8 +254,7 @@ static void wpi_del_key_cb(void *, struct ieee80211_node *);
|
|||
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, const struct ieee80211_key *k,
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,8 +89,7 @@ null_key_delete(struct ieee80211vap *vap, const struct ieee80211_key *k)
|
|||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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 *);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue