Date: Mon, 8 Aug 2005 23:39:17 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 81691 for review Message-ID: <200508082339.j78NdHbC061926@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=81691 Change 81691 by rwatson@rwatson_peppercorn on 2005/08/08 23:38:23 Integrate netsmp: - dev_clone prototype change - libkern strcasecmp() - more 802.11 - fxp locking fixes - sysctl warnings on locks held over copyin/copyout w/o wiring - ule preemption fixes - mac_policy_ops place holders Affected files ... .. //depot/projects/netsmp/src/sys/cam/scsi/scsi_target.c#2 integrate .. //depot/projects/netsmp/src/sys/coda/coda_fbsd.c#2 integrate .. //depot/projects/netsmp/src/sys/conf/files#5 integrate .. //depot/projects/netsmp/src/sys/dev/aac/aac_compat.h#2 delete .. //depot/projects/netsmp/src/sys/dev/aac/aac_debug.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/aac/aac_pci.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/amr/amr.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/amr/amr_cam.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/amr/amr_compat.h#2 delete .. //depot/projects/netsmp/src/sys/dev/amr/amr_disk.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/amr/amr_pci.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/ath/if_ath.c#8 integrate .. //depot/projects/netsmp/src/sys/dev/ath/if_athvar.h#3 integrate .. //depot/projects/netsmp/src/sys/dev/firewire/firewirereg.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/firewire/fwdev.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/fxp/if_fxp.c#6 integrate .. //depot/projects/netsmp/src/sys/dev/fxp/if_fxpvar.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/mly/mly.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/mly/mlyvar.h#2 integrate .. //depot/projects/netsmp/src/sys/dev/nmdm/nmdm.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/snp/snp.c#2 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pcm/dsp.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/sound/pcm/mixer.c#3 integrate .. //depot/projects/netsmp/src/sys/dev/vkbd/vkbd.c#3 integrate .. //depot/projects/netsmp/src/sys/fs/devfs/devfs_vnops.c#3 integrate .. //depot/projects/netsmp/src/sys/geom/eli/g_eli.h#2 integrate .. //depot/projects/netsmp/src/sys/kern/kern_sysctl.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/sched_ule.c#3 integrate .. //depot/projects/netsmp/src/sys/kern/tty_pty.c#2 integrate .. //depot/projects/netsmp/src/sys/kern/tty_tty.c#2 integrate .. //depot/projects/netsmp/src/sys/libkern/strcasecmp.c#1 branch .. //depot/projects/netsmp/src/sys/net/bpf.c#3 integrate .. //depot/projects/netsmp/src/sys/net/if_bridge.c#5 integrate .. //depot/projects/netsmp/src/sys/net/if_tap.c#3 integrate .. //depot/projects/netsmp/src/sys/net/if_tun.c#3 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_crypto.c#3 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_crypto.h#2 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_crypto_tkip.c#2 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_freebsd.c#2 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_freebsd.h#2 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_ioctl.c#5 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_node.c#7 integrate .. //depot/projects/netsmp/src/sys/net80211/ieee80211_node.h#4 integrate .. //depot/projects/netsmp/src/sys/netgraph/netgraph.h#4 integrate .. //depot/projects/netsmp/src/sys/netsmb/smb_dev.c#2 integrate .. //depot/projects/netsmp/src/sys/sys/conf.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/libkern.h#2 integrate .. //depot/projects/netsmp/src/sys/sys/mac_policy.h#2 integrate .. //depot/projects/netsmp/src/sys/vm/vnode_pager.c#2 integrate Differences ... ==== //depot/projects/netsmp/src/sys/cam/scsi/scsi_target.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.67 2005/07/01 16:28:30 ssouhlal Exp $"); +__FBSDID("$FreeBSD: src/sys/cam/scsi/scsi_target.c,v 1.68 2005/08/08 19:55:30 rwatson Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -141,8 +141,8 @@ static struct targ_cmd_descr * targgetdescr(struct targ_softc *softc); static periph_init_t targinit; -static void targclone(void *arg, char *name, int namelen, - struct cdev **dev); +static void targclone(void *arg, struct ucred *cred, char *name, + int namelen, struct cdev **dev); static void targasync(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg); static void abort_all_pending(struct targ_softc *softc); @@ -1025,7 +1025,8 @@ } static void -targclone(void *arg, char *name, int namelen, struct cdev **dev) +targclone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) { int u; ==== //depot/projects/netsmp/src/sys/coda/coda_fbsd.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/coda/coda_fbsd.c,v 1.42 2005/03/31 12:19:42 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/coda/coda_fbsd.c,v 1.43 2005/08/08 19:55:30 rwatson Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -70,8 +70,8 @@ #define VCDEBUG if (vcdebug) printf /* for DEVFS, using bpf & tun drivers as examples*/ -static void coda_fbsd_clone(void *arg, char *name, int namelen, - struct cdev **dev); +static void coda_fbsd_clone(void *arg, struct ucred *cred, char *name, + int namelen, struct cdev **dev); static int codadev_modevent(module_t mod, int type, void *data) @@ -105,8 +105,9 @@ }; DECLARE_MODULE(codadev, codadev_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); -static void coda_fbsd_clone(arg, name, namelen, dev) +static void coda_fbsd_clone(arg, cred, name, namelen, dev) void *arg; + struct ucred *cred; char *name; int namelen; struct cdev **dev; ==== //depot/projects/netsmp/src/sys/conf/files#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1039 2005/08/03 04:27:39 jeff Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1040 2005/08/08 18:31:13 pjd Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1331,6 +1331,7 @@ libkern/rindex.c standard libkern/scanc.c standard libkern/skpc.c standard +libkern/strcasecmp.c standard libkern/strcat.c standard libkern/strcmp.c standard libkern/strcpy.c standard ==== //depot/projects/netsmp/src/sys/dev/aac/aac_debug.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/aac/aac_debug.c,v 1.20 2004/12/09 22:20:25 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac_debug.c,v 1.21 2005/08/08 12:19:19 scottl Exp $"); /* * Debugging support. @@ -45,7 +45,6 @@ #include <machine/resource.h> #include <machine/bus.h> -#include <dev/aac/aac_compat.h> #include <dev/aac/aacreg.h> #include <sys/aac_ioctl.h> #include <dev/aac/aacvar.h> ==== //depot/projects/netsmp/src/sys/dev/aac/aac_pci.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.55 2005/07/14 17:43:00 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/aac/aac_pci.c,v 1.56 2005/08/08 19:39:58 ps Exp $"); /* * PCI bus interface and resource allocation. @@ -133,6 +133,8 @@ "Adaptec SCSI RAID 2810SA"}, {0x9005, 0x0285, 0x9005, 0x0293, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, "Adaptec SCSI RAID 21610SA"}, + {0x9005, 0x0285, 0x103c, 0x3227, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB, + "HP ML110 G2 (Adaptec 2610SA)"}, {0x9005, 0x0286, 0x9005, 0x028c, AAC_HWIF_RKT, 0, "Adaptec SCSI RAID 2230S"}, {0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0, ==== //depot/projects/netsmp/src/sys/dev/amr/amr.c#3 (text+ko) ==== @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/amr/amr.c,v 1.67 2005/07/29 01:53:45 ps Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr.c,v 1.68 2005/08/08 12:16:21 scottl Exp $"); /* * Driver for the AMI MegaRaid family of controllers. @@ -67,7 +67,7 @@ #include <sys/malloc.h> #include <sys/kernel.h> -#include <dev/amr/amr_compat.h> +#include <sys/bio.h> #include <sys/bus.h> #include <sys/conf.h> #include <sys/stat.h> @@ -929,7 +929,7 @@ ac->ac_bio = bio; ac->ac_data = bio->bio_data; ac->ac_length = bio->bio_bcount; - if (BIO_IS_READ(bio)) { + if (bio->bio_cmd == BIO_READ) { ac->ac_flags |= AMR_CMD_DATAIN; cmd = AMR_CMD_LREAD; } else { ==== //depot/projects/netsmp/src/sys/dev/amr/amr_cam.c#2 (text+ko) ==== @@ -55,14 +55,14 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/amr/amr_cam.c,v 1.15 2005/02/09 17:19:12 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr_cam.c,v 1.16 2005/08/08 12:16:21 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/malloc.h> #include <sys/kernel.h> -#include <dev/amr/amr_compat.h> +#include <sys/bio.h> #include <sys/bus.h> #include <sys/conf.h> #include <sys/stat.h> ==== //depot/projects/netsmp/src/sys/dev/amr/amr_disk.c#3 (text+ko) ==== @@ -56,7 +56,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/amr/amr_disk.c,v 1.36 2005/08/07 23:51:53 scottl Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr_disk.c,v 1.37 2005/08/08 12:16:21 scottl Exp $"); /* * Disk driver for AMI MegaRaid controllers @@ -67,7 +67,7 @@ #include <sys/kernel.h> #include <sys/module.h> -#include <dev/amr/amr_compat.h> +#include <sys/bio.h> #include <sys/bus.h> #include <sys/conf.h> @@ -196,7 +196,7 @@ bio->bio_resid = 0; } - AMR_BIO_FINISH(bio); + biodone(bio); } static int ==== //depot/projects/netsmp/src/sys/dev/amr/amr_pci.c#2 (text+ko) ==== @@ -55,14 +55,14 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/amr/amr_pci.c,v 1.29 2005/05/29 04:42:17 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/amr/amr_pci.c,v 1.30 2005/08/08 12:16:21 scottl Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> #include <sys/module.h> -#include <dev/amr/amr_compat.h> +#include <sys/bio.h> #include <sys/bus.h> #include <sys/conf.h> ==== //depot/projects/netsmp/src/sys/dev/ath/if_ath.c#8 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.99 2005/08/03 00:18:28 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.100 2005/08/08 18:46:36 sam Exp $"); /* * Driver for the Atheros Wireless LAN controller. @@ -112,7 +112,8 @@ static void ath_rxorn_proc(void *, int); static void ath_bmiss_proc(void *, int); static int ath_key_alloc(struct ieee80211com *, - const struct ieee80211_key *); + const struct ieee80211_key *, + ieee80211_keyix *, ieee80211_keyix *); static int ath_key_delete(struct ieee80211com *, const struct ieee80211_key *); static int ath_key_set(struct ieee80211com *, const struct ieee80211_key *, @@ -568,6 +569,7 @@ ic->ic_recv_mgmt = ath_recv_mgmt; sc->sc_newstate = ic->ic_newstate; ic->ic_newstate = ath_newstate; + ic->ic_crypto.cs_max_keyix = sc->sc_keymax; ic->ic_crypto.cs_key_alloc = ath_key_alloc; ic->ic_crypto.cs_key_delete = ath_key_delete; ic->ic_crypto.cs_key_set = ath_key_set; @@ -1263,7 +1265,7 @@ KASSERT(sc->sc_splitmic, ("key cache !split")); if ((k->wk_flags & IEEE80211_KEY_XR) == IEEE80211_KEY_XR) { /* - * TX key goes at first index, RX key at +32. + * TX key goes at first index, RX key at the rx index. * The hal handles the MIC keys at index+64. */ memcpy(hk->kv_mic, k->wk_txmic, sizeof(hk->kv_mic)); @@ -1358,7 +1360,8 @@ * each key, one for decrypt/encrypt and the other for the MIC. */ static u_int16_t -key_alloc_2pair(struct ath_softc *sc) +key_alloc_2pair(struct ath_softc *sc, + ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix) { #define N(a) (sizeof(a)/sizeof(a[0])) u_int i, keyix; @@ -1397,19 +1400,22 @@ "%s: key pair %u,%u %u,%u\n", __func__, keyix, keyix+64, keyix+32, keyix+32+64); - return keyix; + *txkeyix = keyix; + *rxkeyix = keyix+32; + return 1; } } DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of pair space\n", __func__); - return IEEE80211_KEYIX_NONE; + return 0; #undef N } /* * Allocate a single key cache slot. */ -static u_int16_t -key_alloc_single(struct ath_softc *sc) +static int +key_alloc_single(struct ath_softc *sc, + ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix) { #define N(a) (sizeof(a)/sizeof(a[0])) u_int i, keyix; @@ -1427,11 +1433,12 @@ setbit(sc->sc_keymap, keyix); DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: key %u\n", __func__, keyix); - return keyix; + *txkeyix = *rxkeyix = keyix; + return 1; } } DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: out of space\n", __func__); - return IEEE80211_KEYIX_NONE; + return 0; #undef N } @@ -1445,7 +1452,8 @@ * 64 entries. */ static int -ath_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *k) +ath_key_alloc(struct ieee80211com *ic, const struct ieee80211_key *k, + ieee80211_keyix *keyix, ieee80211_keyix *rxkeyix) { struct ath_softc *sc = ic->ic_ifp->if_softc; @@ -1461,21 +1469,19 @@ * multi-station operation. */ if ((k->wk_flags & IEEE80211_KEY_GROUP) && !sc->sc_mcastkey) { - u_int keyix; - if (!(&ic->ic_nw_keys[0] <= k && k < &ic->ic_nw_keys[IEEE80211_WEP_NKID])) { /* should not happen */ DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: bogus group key\n", __func__); - return IEEE80211_KEYIX_NONE; + return 0; } - keyix = k - ic->ic_nw_keys; /* * XXX we pre-allocate the global keys so * have no way to check if they've already been allocated. */ - return keyix; + *keyix = *rxkeyix = k - ic->ic_nw_keys; + return 1; } /* @@ -1487,12 +1493,12 @@ * those requests to slot 0. */ if (k->wk_flags & IEEE80211_KEY_SWCRYPT) { - return key_alloc_single(sc); + return key_alloc_single(sc, keyix, rxkeyix); } else if (k->wk_cipher->ic_cipher == IEEE80211_CIPHER_TKIP && (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic) { - return key_alloc_2pair(sc); + return key_alloc_2pair(sc, keyix, rxkeyix); } else { - return key_alloc_single(sc); + return key_alloc_single(sc, keyix, rxkeyix); } } @@ -1505,32 +1511,17 @@ struct ath_softc *sc = ic->ic_ifp->if_softc; struct ath_hal *ah = sc->sc_ah; const struct ieee80211_cipher *cip = k->wk_cipher; - struct ieee80211_node *ni; u_int keyix = k->wk_keyix; DPRINTF(sc, ATH_DEBUG_KEYCACHE, "%s: delete key %u\n", __func__, keyix); ath_hal_keyreset(ah, keyix); /* - * Check the key->node map and flush any ref. - */ - ni = sc->sc_keyixmap[keyix]; - if (ni != NULL) { - ieee80211_free_node(ni); - sc->sc_keyixmap[keyix] = NULL; - } - /* * Handle split tx/rx keying required for TKIP with h/w MIC. */ if (cip->ic_cipher == IEEE80211_CIPHER_TKIP && - (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic) { + (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && sc->sc_splitmic) ath_hal_keyreset(ah, keyix+32); /* RX key */ - ni = sc->sc_keyixmap[keyix+32]; - if (ni != NULL) { /* as above... */ - ieee80211_free_node(ni); - sc->sc_keyixmap[keyix+32] = NULL; - } - } if (keyix >= IEEE80211_WEP_NKID) { /* * Don't touch keymap entries for global keys so @@ -2822,50 +2813,22 @@ /* * Locate the node for sender, track state, and then * pass the (referenced) node up to the 802.11 layer - * for its use. If the sender is unknown spam the - * frame; it'll be dropped where it's not wanted. + * for its use. + */ + ni = ieee80211_find_rxnode_withkey(ic, + mtod(m, const struct ieee80211_frame_min *), + ds->ds_rxstat.rs_keyix == HAL_RXKEYIX_INVALID ? + IEEE80211_KEYIX_NONE : ds->ds_rxstat.rs_keyix); + /* + * Track rx rssi and do any rx antenna management. + */ + an = ATH_NODE(ni); + ATH_RSSI_LPF(an->an_avgrssi, ds->ds_rxstat.rs_rssi); + /* + * Send frame up for processing. */ - if (ds->ds_rxstat.rs_keyix != HAL_RXKEYIX_INVALID && - (ni = sc->sc_keyixmap[ds->ds_rxstat.rs_keyix]) != NULL) { - /* - * Fast path: node is present in the key map; - * grab a reference for processing the frame. - */ - an = ATH_NODE(ieee80211_ref_node(ni)); - ATH_RSSI_LPF(an->an_avgrssi, ds->ds_rxstat.rs_rssi); - type = ieee80211_input(ic, m, ni, - ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); - } else { - /* - * Locate the node for sender, track state, and then - * pass the (referenced) node up to the 802.11 layer - * for its use. - */ - ni = ieee80211_find_rxnode(ic, - mtod(m, const struct ieee80211_frame_min *)); - /* - * Track rx rssi and do any rx antenna management. - */ - an = ATH_NODE(ni); - ATH_RSSI_LPF(an->an_avgrssi, ds->ds_rxstat.rs_rssi); - /* - * Send frame up for processing. - */ - type = ieee80211_input(ic, m, ni, - ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); - if (ni != ic->ic_bss) { - u_int16_t keyix; - /* - * If the station has a key cache slot assigned - * update the key->node mapping table. - */ - keyix = ni->ni_ucastkey.wk_keyix; - if (keyix != IEEE80211_KEYIX_NONE && - sc->sc_keyixmap[keyix] == NULL) - sc->sc_keyixmap[keyix] = - ieee80211_ref_node(ni); - } - } + type = ieee80211_input(ic, m, ni, + ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); ieee80211_free_node(ni); if (sc->sc_diversity) { /* @@ -4266,10 +4229,9 @@ { struct ieee80211com *ic = ni->ni_ic; struct ath_softc *sc = ic->ic_ifp->if_softc; - u_int16_t keyix; + ieee80211_keyix keyix, rxkeyix; - keyix = ath_key_alloc(ic, &ni->ni_ucastkey); - if (keyix == IEEE80211_KEYIX_NONE) { + if (!ath_key_alloc(ic, &ni->ni_ucastkey, &keyix, &rxkeyix)) { /* * Key cache is full; we'll fall back to doing * the more expensive lookup in software. Note @@ -4277,7 +4239,9 @@ */ /* XXX msg+statistic */ } else { + /* XXX locking? */ ni->ni_ucastkey.wk_keyix = keyix; + ni->ni_ucastkey.wk_rxkeyix = rxkeyix; /* NB: this will create a pass-thru key entry */ ath_keyset(sc, &ni->ni_ucastkey, ni->ni_macaddr, ic->ic_bss); } ==== //depot/projects/netsmp/src/sys/dev/ath/if_athvar.h#3 (text+ko) ==== @@ -33,7 +33,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGES. * - * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.28 2005/07/24 05:11:39 sam Exp $ + * $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.29 2005/08/08 18:46:36 sam Exp $ */ /* @@ -224,7 +224,6 @@ HAL_INT sc_imask; /* interrupt mask copy */ u_int sc_keymax; /* size of key cache */ u_int8_t sc_keymap[ATH_KEYBYTES];/* key use bit map */ - struct ieee80211_node *sc_keyixmap[ATH_KEYMAX];/* key ix->node map */ u_int sc_ledpin; /* GPIO pin for driving LED */ u_int sc_ledon; /* pin setting for LED on */ ==== //depot/projects/netsmp/src/sys/dev/firewire/firewirereg.h#2 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/firewirereg.h,v 1.37 2005/01/06 01:42:41 imp Exp $ + * $FreeBSD: src/sys/dev/firewire/firewirereg.h,v 1.38 2005/08/08 19:55:30 rwatson Exp $ * */ @@ -303,7 +303,7 @@ void fw_drain_txq (struct firewire_comm *); int fwdev_makedev (struct firewire_softc *); int fwdev_destroydev (struct firewire_softc *); -void fwdev_clone (void *, char *, int, struct cdev **); +void fwdev_clone (void *, struct ucred *, char *, int, struct cdev **); extern int firewire_debug; extern devclass_t firewire_devclass; ==== //depot/projects/netsmp/src/sys/dev/firewire/fwdev.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/firewire/fwdev.c,v 1.46 2005/03/31 12:19:42 phk Exp $ + * $FreeBSD: src/sys/dev/firewire/fwdev.c,v 1.47 2005/08/08 19:55:30 rwatson Exp $ * */ @@ -840,7 +840,8 @@ #if defined(__FreeBSD__) && __FreeBSD_version >= 500000 #define NDEVTYPE 2 void -fwdev_clone(void *arg, char *name, int namelen, struct cdev **dev) +fwdev_clone(void *arg, struct ucred *cred, char *name, int namelen, + struct cdev **dev) { struct firewire_softc *sc; char *devnames[NDEVTYPE] = {"fw", "fwmem"}; ==== //depot/projects/netsmp/src/sys/dev/fxp/if_fxp.c#6 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.242 2005/08/03 00:18:30 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fxp/if_fxp.c,v 1.243 2005/08/08 21:03:53 jhb Exp $"); /* * Intel EtherExpress Pro/100B PCI Fast Ethernet driver @@ -376,19 +376,17 @@ uint16_t data, myea[ETHER_ADDR_LEN / 2]; u_char eaddr[ETHER_ADDR_LEN]; int i, rid, m1, m2, prefer_iomap; - int error, s; + int error; error = 0; sc = device_get_softc(dev); sc->dev = dev; - callout_init(&sc->stat_ch, CALLOUT_MPSAFE); mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); + callout_init_mtx(&sc->stat_ch, &sc->sc_mtx, 0); ifmedia_init(&sc->sc_media, 0, fxp_serial_ifmedia_upd, fxp_serial_ifmedia_sts); - s = splimp(); - ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { device_printf(dev, "can not if_alloc()\n"); @@ -811,7 +809,6 @@ } fail: - splx(s); if (error) fxp_release(sc); return (error); @@ -895,18 +892,10 @@ fxp_detach(device_t dev) { struct fxp_softc *sc = device_get_softc(dev); - int s; FXP_LOCK(sc); - s = splimp(); - sc->suspended = 1; /* Do same thing as we do for suspend */ /* - * Close down routes etc. - */ - ether_ifdetach(sc->ifp); - - /* * Stop DMA and drop transmit queue, but disable interrupts first. */ CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE); @@ -914,14 +903,17 @@ FXP_UNLOCK(sc); /* + * Close down routes etc. + */ + ether_ifdetach(sc->ifp); + + /* * Unhook interrupt before dropping lock. This is to prevent * races with fxp_intr(). */ bus_teardown_intr(sc->dev, sc->irq, sc->ih); sc->ih = NULL; - splx(s); - /* Release our allocated resources. */ fxp_release(sc); return (0); @@ -935,12 +927,16 @@ static int fxp_shutdown(device_t dev) { + struct fxp_softc *sc = device_get_softc(dev); + /* * Make sure that DMA is disabled prior to reboot. Not doing * do could allow DMA to corrupt kernel memory during the * reboot before the driver initializes. */ - fxp_stop((struct fxp_softc *) device_get_softc(dev)); + FXP_LOCK(sc); + fxp_stop(sc); + FXP_UNLOCK(sc); return (0); } @@ -953,17 +949,14 @@ fxp_suspend(device_t dev) { struct fxp_softc *sc = device_get_softc(dev); - int s; FXP_LOCK(sc); - s = splimp(); fxp_stop(sc); sc->suspended = 1; FXP_UNLOCK(sc); - splx(s); return (0); } @@ -976,16 +969,8 @@ { struct fxp_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->ifp; - uint16_t pci_command; - int s; FXP_LOCK(sc); - s = splimp(); - - /* reenable busmastering */ - pci_command = pci_read_config(dev, PCIR_COMMAND, 2); - pci_command |= (PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); - pci_write_config(dev, PCIR_COMMAND, pci_command, 2); CSR_WRITE_4(sc, FXP_CSR_PORT, FXP_PORT_SELECTIVE_RESET); DELAY(10); @@ -997,7 +982,6 @@ sc->suspended = 0; FXP_UNLOCK(sc); - splx(s); return (0); } @@ -1752,10 +1736,8 @@ struct fxp_softc *sc = xsc; struct ifnet *ifp = sc->ifp; struct fxp_stats *sp = sc->fxp_stats; - int s; - FXP_LOCK(sc); - s = splimp(); + FXP_LOCK_ASSERT(sc, MA_OWNED); bus_dmamap_sync(sc->fxp_stag, sc->fxp_smap, BUS_DMASYNC_POSTREAD); ifp->if_opackets += le32toh(sp->tx_good); ifp->if_collisions += le32toh(sp->tx_total_collisions); @@ -1840,8 +1822,6 @@ * Schedule another timeout one second from now. */ callout_reset(&sc->stat_ch, hz, fxp_tick, sc); - FXP_UNLOCK(sc); - splx(s); } /* @@ -1941,10 +1921,9 @@ struct fxp_cb_tx *tcbp; struct fxp_tx *txp; struct fxp_cb_mcs *mcsp; - int i, prm, s; + int i, prm; FXP_LOCK_ASSERT(sc, MA_OWNED); - s = splimp(); /* * Cancel any pending I/O */ @@ -2195,7 +2174,6 @@ * Start stats updater. */ callout_reset(&sc->stat_ch, hz, fxp_tick, sc); - splx(s); } static int @@ -2222,7 +2200,9 @@ struct mii_data *mii; mii = device_get_softc(sc->miibus); + FXP_LOCK(sc); mii_mediachg(mii); + FXP_UNLOCK(sc); return (0); } @@ -2236,6 +2216,7 @@ struct mii_data *mii; mii = device_get_softc(sc->miibus); + FXP_LOCK(sc); mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; @@ -2244,6 +2225,7 @@ sc->cu_resume_bug = 1; else sc->cu_resume_bug = 0; + FXP_UNLOCK(sc); } /* @@ -2377,20 +2359,11 @@ struct fxp_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; - int flag, mask, s, error = 0; - - /* - * Detaching causes us to call ioctl with the mutex owned. Preclude - * that by saying we're busy if the lock is already held. - */ - if (FXP_LOCKED(sc)) - return (EBUSY); + int flag, mask, error = 0; - FXP_LOCK(sc); - s = splimp(); - switch (command) { case SIOCSIFFLAGS: + FXP_LOCK(sc); if (ifp->if_flags & IFF_ALLMULTI) sc->flags |= FXP_FLAG_ALL_MCAST; else @@ -2408,10 +2381,12 @@ if (ifp->if_drv_flags & IFF_DRV_RUNNING) fxp_stop(sc); } + FXP_UNLOCK(sc); break; case SIOCADDMULTI: case SIOCDELMULTI: + FXP_LOCK(sc); if (ifp->if_flags & IFF_ALLMULTI) sc->flags |= FXP_FLAG_ALL_MCAST; else @@ -2428,6 +2403,7 @@ */ if (sc->flags & FXP_FLAG_ALL_MCAST) fxp_init_body(sc); + FXP_UNLOCK(sc); error = 0; break; @@ -2443,6 +2419,7 @@ break; case SIOCSIFCAP: + FXP_LOCK(sc); mask = ifp->if_capenable ^ ifr->ifr_reqcap; if (mask & IFCAP_POLLING) ifp->if_capenable ^= IFCAP_POLLING; @@ -2456,19 +2433,12 @@ if (ifp->if_flags & IFF_UP) fxp_init_body(sc); } + FXP_UNLOCK(sc); break; default: - /* - * ether_ioctl() will eventually call fxp_start() which - * will result in mutex recursion so drop it first. - */ - FXP_UNLOCK(sc); error = ether_ioctl(ifp, command, data); } - if (FXP_LOCKED(sc)) - FXP_UNLOCK(sc); - splx(s); return (error); } @@ -2486,11 +2456,7 @@ nmcasts = 0; if ((sc->flags & FXP_FLAG_ALL_MCAST) == 0) { IF_ADDR_LOCK(ifp); -#if __FreeBSD_version < 500000 - LIST_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { -#else TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { -#endif if (ifma->ifma_addr->sa_family != AF_LINK) continue; if (nmcasts >= MAXMCADDR) { ==== //depot/projects/netsmp/src/sys/dev/fxp/if_fxpvar.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/fxp/if_fxpvar.h,v 1.37 2005/06/10 16:49:09 brooks Exp $ + * $FreeBSD: src/sys/dev/fxp/if_fxpvar.h,v 1.38 2005/08/08 21:03:54 jhb Exp $ */ /* @@ -101,21 +101,9 @@ */ #define TUNABLE_BUNDLE_MAX 6 -#if __FreeBSD_version < 500000 -#define FXP_LOCK(_sc) -#define FXP_UNLOCK(_sc) -#define FXP_LOCKED(_sc) -#define FXP_LOCK_ASSERT(_sc, _what) -#define INTR_MPSAFE 0 -#define mtx_init(a, b, c, d) -#define mtx_destroy(a) -struct mtx { int dummy; }; -#else #define FXP_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define FXP_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define FXP_LOCKED(_sc) mtx_owned(&(_sc)->sc_mtx) #define FXP_LOCK_ASSERT(_sc, _what) mtx_assert(&(_sc)->sc_mtx, (_what)) -#endif /* * Structures to handle TX and RX descriptors. ==== //depot/projects/netsmp/src/sys/dev/mly/mly.c#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mly/mly.c,v 1.38 2005/05/29 04:42:23 nyan Exp $ + * $FreeBSD: src/sys/dev/mly/mly.c,v 1.39 2005/08/08 12:23:26 scottl Exp $ */ #include <sys/param.h> @@ -234,12 +234,10 @@ mly_initq_busy(sc); mly_initq_complete(sc); -#if __FreeBSD_version >= 500005 /* * Initialise command-completion task. */ TASK_INIT(&sc->mly_task_complete, 0, mly_complete, sc); -#endif /* disable interrupts before we start talking to the controller */ MLY_MASK_INTERRUPTS(sc); @@ -1605,11 +1603,9 @@ splx(s); if (worked) { -#if __FreeBSD_version >= 500005 if (sc->mly_state & MLY_STATE_INTERRUPTS_ON) taskqueue_enqueue(taskqueue_swi_giant, &sc->mly_task_complete); else -#endif mly_complete(sc, 0); } } ==== //depot/projects/netsmp/src/sys/dev/mly/mlyvar.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mly/mlyvar.h,v 1.6 2004/06/16 09:46:51 phk Exp $ + * $FreeBSD: src/sys/dev/mly/mlyvar.h,v 1.7 2005/08/08 12:23:27 scottl Exp $ */ /******************************************************************************** @@ -57,15 +57,7 @@ ******************************************************************************** ********************************************************************************/ -#if __FreeBSD_version >= 500005 >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508082339.j78NdHbC061926>