diff --git a/sys/dev/ral/if_ral.c b/sys/dev/ral/if_ral.c index c17d86af7664..770c18d0c6e7 100644 --- a/sys/dev/ral/if_ral.c +++ b/sys/dev/ral/if_ral.c @@ -90,6 +90,8 @@ static void ral_free_rx_ring(struct ral_softc *, struct ral_rx_ring *); static struct ieee80211_node *ral_node_alloc( struct ieee80211_node_table *); +static int ral_key_alloc(struct ieee80211com *, + const struct ieee80211_key *); static int ral_media_change(struct ifnet *); static void ral_next_scan(void *); static void ral_iter_func(void *, struct ieee80211_node *); @@ -456,6 +458,7 @@ ral_attach(device_t dev) /* override state transition machine */ sc->sc_newstate = ic->ic_newstate; ic->ic_newstate = ral_newstate; + ic->ic_crypto.cs_key_alloc = ral_key_alloc; ieee80211_media_init(ic, ral_media_change, ieee80211_media_status); bpfattach2(ifp, DLT_IEEE802_11_RADIO, @@ -899,6 +902,15 @@ ral_node_alloc(struct ieee80211_node_table *nt) return (rn != NULL) ? &rn->ni : NULL; } +static int +ral_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *k) +{ + if (k >= ic->ic_nw_keys && k < &ic->ic_nw_keys[IEEE80211_WEP_NKID]) + return k - ic->ic_nw_keys; + + return IEEE80211_KEYIX_NONE; +} + static int ral_media_change(struct ifnet *ifp) { diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c index 31677cd03446..bf220cd38a94 100644 --- a/sys/dev/usb/if_ural.c +++ b/sys/dev/usb/if_ural.c @@ -99,6 +99,8 @@ Static int ural_alloc_tx_list(struct ural_softc *); Static void ural_free_tx_list(struct ural_softc *); Static int ural_alloc_rx_list(struct ural_softc *); Static void ural_free_rx_list(struct ural_softc *); +Static int ural_key_alloc(struct ieee80211com *, + const struct ieee80211_key *); Static int ural_media_change(struct ifnet *); Static void ural_next_scan(void *); Static void ural_task(void *); @@ -470,6 +472,7 @@ USB_ATTACH(ural) /* override state transition machine */ sc->sc_newstate = ic->ic_newstate; ic->ic_newstate = ural_newstate; + ic->ic_crypto.cs_key_alloc = ural_key_alloc; ieee80211_media_init(ic, ural_media_change, ieee80211_media_status); bpfattach2(ifp, DLT_IEEE802_11_RADIO, @@ -641,6 +644,15 @@ ural_free_rx_list(struct ural_softc *sc) } } +Static int +ural_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *k) +{ + if (k >= ic->ic_nw_keys && k < &ic->ic_nw_keys[IEEE80211_WEP_NKID]) + return k - ic->ic_nw_keys; + + return IEEE80211_KEYIX_NONE; +} + Static int ural_media_change(struct ifnet *ifp) {