Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jul 2005 01:52:06 GMT
From:      Scott Long <scottl@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 79882 for review
Message-ID:  <200507100152.j6A1q6vK013198@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=79882

Change 79882 by scottl@scottl-junior on 2005/07/10 01:51:40

	IFC

Affected files ...

.. //depot/projects/soc2005/ufsj/src/sys/dev/iwi/if_iwi.c#2 integrate
.. //depot/projects/soc2005/ufsj/src/sys/dev/ral/if_ral.c#2 integrate
.. //depot/projects/soc2005/ufsj/src/sys/dev/usb/if_ural.c#2 integrate
.. //depot/projects/soc2005/ufsj/src/sys/net80211/ieee80211_crypto.c#2 integrate

Differences ...

==== //depot/projects/soc2005/ufsj/src/sys/dev/iwi/if_iwi.c#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.7 2005/07/08 16:31:18 sam Exp $	*/
+/*	$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.8 2005/07/10 00:17:04 sam Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2005
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.7 2005/07/08 16:31:18 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/iwi/if_iwi.c,v 1.8 2005/07/10 00:17:04 sam Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -116,8 +116,6 @@
 		    int);
 static void	iwi_reset_rx_ring(struct iwi_softc *, struct iwi_rx_ring *);
 static void	iwi_free_rx_ring(struct iwi_softc *, struct iwi_rx_ring *);
-static int	iwi_key_alloc(struct ieee80211com *,
-		    const struct ieee80211_key *);
 static int	iwi_media_change(struct ifnet *);
 static void	iwi_media_status(struct ifnet *, struct ifmediareq *);
 static int	iwi_newstate(struct ieee80211com *, enum ieee80211_state, int);
@@ -365,7 +363,6 @@
 	/* override state transition machine */
 	sc->sc_newstate = ic->ic_newstate;
 	ic->ic_newstate = iwi_newstate;
-	ic->ic_crypto.cs_key_alloc = iwi_key_alloc;
 	ieee80211_media_init(ic, iwi_media_change, iwi_media_status);
 
 	bpfattach2(ifp, DLT_IEEE802_11_RADIO,
@@ -799,15 +796,6 @@
 }
 
 static int
-iwi_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
 iwi_media_change(struct ifnet *ifp)
 {
 	struct iwi_softc *sc = ifp->if_softc;

==== //depot/projects/soc2005/ufsj/src/sys/dev/ral/if_ral.c#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/ral/if_ral.c,v 1.8 2005/07/08 19:33:42 damien Exp $	*/
+/*	$FreeBSD: src/sys/dev/ral/if_ral.c,v 1.9 2005/07/10 00:17:04 sam Exp $	*/
 
 /*-
  * Copyright (c) 2005
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ral/if_ral.c,v 1.8 2005/07/08 19:33:42 damien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ral/if_ral.c,v 1.9 2005/07/10 00:17:04 sam Exp $");
 
 /*-
  * Ralink Technology RT2500 chipset driver
@@ -91,8 +91,6 @@
 			    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 *);
@@ -463,7 +461,6 @@
 	/* 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,
@@ -910,15 +907,6 @@
 }
 
 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)
 {
 	struct ral_softc *sc = ifp->if_softc;

==== //depot/projects/soc2005/ufsj/src/sys/dev/usb/if_ural.c#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/*	$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.9 2005/07/08 19:19:06 damien Exp $	*/
+/*	$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.10 2005/07/10 00:17:05 sam Exp $	*/
 
 /*-
  * Copyright (c) 2005
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.9 2005/07/08 19:19:06 damien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/usb/if_ural.c,v 1.10 2005/07/10 00:17:05 sam Exp $");
 
 /*-
  * Ralink Technology RT2500USB chipset driver
@@ -109,8 +109,6 @@
 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 *);
@@ -493,7 +491,6 @@
 	/* 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,
@@ -667,15 +664,6 @@
 }
 
 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)
 {
 	struct ural_softc *sc = ifp->if_softc;

==== //depot/projects/soc2005/ufsj/src/sys/net80211/ieee80211_crypto.c#2 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto.c,v 1.9 2005/06/10 16:11:24 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_crypto.c,v 1.10 2005/07/09 23:15:30 sam Exp $");
 
 /*
  * IEEE 802.11 generic crypto support.
@@ -61,7 +61,24 @@
 static int
 null_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *k)
 {
-	return IEEE80211_KEYIX_NONE;
+	if (!(&ic->ic_nw_keys[0] <= k &&
+	     k < &ic->ic_nw_keys[IEEE80211_WEP_NKID])) {
+		/*
+		 * Not in the global key table, the driver should handle this
+		 * by allocating a slot in the h/w key table/cache.  In
+		 * lieu of that return key slot 0 for any unicast key
+		 * request.  We disallow the request if this is a group key.
+		 * This default policy does the right thing for legacy hardware
+		 * with a 4 key table.  It also handles devices that pass
+		 * packets through untouched when marked with the WEP bit
+		 * and key index 0.
+		 */
+		if ((k->wk_flags & IEEE80211_KEY_GROUP) == 0)
+			return 0;	/* NB: use key index 0 for ucast key */
+		else
+			return IEEE80211_KEYIX_NONE;
+	}
+	return k - ic->ic_nw_keys;
 }
 static int
 null_key_delete(struct ieee80211com *ic, const struct ieee80211_key *k)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200507100152.j6A1q6vK013198>