Date: Wed, 11 Jun 2008 22:39:17 GMT From: Julian Elischer <julian@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 143326 for review Message-ID: <200806112239.m5BMdH5o007048@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143326 Change 143326 by julian@julian_trafmon1 on 2008/06/11 22:38:48 IFC@143323 Affected files ... .. //depot/projects/vimage-commit/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c#2 integrate .. //depot/projects/vimage-commit/src/sys/compat/ndis/subr_ndis.c#2 integrate .. //depot/projects/vimage-commit/src/sys/conf/files#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/ata/ata-all.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/ata/ata-chipset.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/ata/ata-pci.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/if_ndis/if_ndis.c#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/if_ndis/if_ndisvar.h#3 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe.h#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/tcp_lro.c#2 delete .. //depot/projects/vimage-commit/src/sys/dev/ixgbe/tcp_lro.h#2 delete .. //depot/projects/vimage-commit/src/sys/dev/nmdm/nmdm.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/smc/if_smc.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/smc/if_smcvar.h#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/snp/snp.c#2 integrate .. //depot/projects/vimage-commit/src/sys/dev/vkbd/vkbd.c#2 integrate .. //depot/projects/vimage-commit/src/sys/fs/cd9660/cd9660_vnops.c#2 integrate .. //depot/projects/vimage-commit/src/sys/fs/ntfs/ntfs_ihash.c#2 integrate .. //depot/projects/vimage-commit/src/sys/i386/acpica/acpi_machdep.c#2 integrate .. //depot/projects/vimage-commit/src/sys/kern/kern_conf.c#2 integrate .. //depot/projects/vimage-commit/src/sys/modules/ixgbe/Makefile#2 integrate .. //depot/projects/vimage-commit/src/sys/net/if_tap.c#3 integrate .. //depot/projects/vimage-commit/src/sys/net/if_tun.c#3 integrate .. //depot/projects/vimage-commit/src/sys/netinet/tcp_lro.c#1 branch .. //depot/projects/vimage-commit/src/sys/netinet/tcp_lro.h#1 branch .. //depot/projects/vimage-commit/src/sys/powerpc/booke/pmap.c#2 integrate .. //depot/projects/vimage-commit/src/sys/security/audit/audit_pipe.c#2 integrate .. //depot/projects/vimage-commit/src/sys/sys/conf.h#2 integrate Differences ... ==== //depot/projects/vimage-commit/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c#2 (text+ko) ==== @@ -18,7 +18,7 @@ * * CDDL HEADER END * - * $FreeBSD: src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c,v 1.4 2008/06/01 01:46:37 jb Exp $ + * $FreeBSD: src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c,v 1.5 2008/06/11 18:55:19 ed Exp $ */ /* @@ -16445,6 +16445,7 @@ static struct cdevsw dtrace_cdevsw = { .d_version = D_VERSION, + .d_flags = D_NEEDMINOR, .d_close = dtrace_close, .d_ioctl = dtrace_ioctl, .d_open = dtrace_open, ==== //depot/projects/vimage-commit/src/sys/compat/ndis/subr_ndis.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.112 2008/05/15 04:29:28 weongyo Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.113 2008/06/11 07:55:07 weongyo Exp $"); /* * This file implements a translation layer between the BSD networking @@ -1018,7 +1018,7 @@ sc = device_get_softc(dev); ifp = sc->ifp; - if (ifp->if_flags & IFF_DEBUG) { + if (ifp != NULL && ifp->if_flags & IFF_DEBUG) { error = pe_get_message((vm_offset_t)drv->dro_driverstart, code, &str, &i, &flags); if (error == 0) { @@ -1036,7 +1036,7 @@ device_printf (dev, "NDIS ERROR: %x (%s)\n", code, str == NULL ? "unknown error" : str); - if (ifp->if_flags & IFF_DEBUG) { + if (ifp != NULL && ifp->if_flags & IFF_DEBUG) { device_printf (dev, "NDIS NUMERRORS: %x\n", numerrors); va_start(ap, numerrors); for (i = 0; i < numerrors; i++) ==== //depot/projects/vimage-commit/src/sys/conf/files#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.1307 2008/06/06 05:00:49 benno Exp $ +# $FreeBSD: src/sys/conf/files,v 1.1308 2008/06/11 22:10:10 jfv Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -1946,6 +1946,7 @@ netinet/tcp_debug.c optional tcpdebug netinet/tcp_hostcache.c optional inet netinet/tcp_input.c optional inet +netinet/tcp_lro.c optional inet netinet/tcp_output.c optional inet netinet/tcp_offload.c optional inet netinet/tcp_reass.c optional inet ==== //depot/projects/vimage-commit/src/sys/dev/ata/ata-all.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.288 2008/05/26 08:58:48 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.289 2008/06/11 06:44:58 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -129,6 +129,10 @@ ATA_RESET(dev); ATA_LOCKING(dev, ATA_LF_UNLOCK); + /* allocate DMA resources if DMA HW present*/ + if (ch->dma.alloc) + ch->dma.alloc(dev); + /* setup interrupt delivery */ rid = ATA_IRQ_RID; ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, ==== //depot/projects/vimage-commit/src/sys/dev/ata/ata-chipset.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.219 2008/04/21 10:51:38 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-chipset.c,v 1.220 2008/06/11 08:48:25 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -1059,10 +1059,10 @@ struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << 7; + int timeout = 0; #ifdef AHCI_PM struct ata_ahci_cmd_tab *ctp = (struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET); - int timeout = 0; /* kick controller into sane state if needed */ ata_ahci_restart(dev); @@ -1091,7 +1091,7 @@ ata_udelay(150000); - timeout = 0; +#endif do { DELAY(1000); if (timeout++ > 1000) { @@ -1101,7 +1101,7 @@ } while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & ATA_S_BUSY); if (bootverbose) device_printf(dev, "BUSY wait time=%dms\n", timeout); -#endif + return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } ==== //depot/projects/vimage-commit/src/sys/dev/ata/ata-pci.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.127 2008/04/21 10:51:38 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-pci.c,v 1.128 2008/06/11 06:44:58 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -611,7 +611,6 @@ ata_pcichannel_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); - struct ata_channel *ch = device_get_softc(dev); int error; if (ctlr->dmainit) @@ -620,11 +619,7 @@ if ((error = ctlr->allocate(dev))) return error; - if ((error = ata_attach(dev))) - return error; - - ch->dma.alloc(dev); - return 0; + return ata_attach(dev); } static int ==== //depot/projects/vimage-commit/src/sys/dev/if_ndis/if_ndis.c#3 (text+ko) ==== @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.141 2008/06/03 00:55:48 cokane Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis.c,v 1.142 2008/06/11 13:40:15 cokane Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -533,7 +533,8 @@ sc = device_get_softc(dev); - KeInitializeSpinLock(&sc->ndis_spinlock); + mtx_init(&sc->ndis_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK, + MTX_DEF); KeInitializeSpinLock(&sc->ndis_rxlock); InitializeListHead(&sc->ndis_shlist); callout_init(&sc->ndis_stat_callout, CALLOUT_MPSAFE); @@ -1644,7 +1645,6 @@ struct ndis_softc *sc; sc = xsc; - NDIS_LOCK(sc); if (sc->ndis_hang_timer && --sc->ndis_hang_timer == 0) { IoQueueWorkItem(sc->ndis_tickitem, @@ -1666,7 +1666,6 @@ } callout_reset(&sc->ndis_stat_callout, hz, ndis_tick, sc); - NDIS_UNLOCK(sc); } static void ==== //depot/projects/vimage-commit/src/sys/dev/if_ndis/if_ndisvar.h#3 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/if_ndis/if_ndisvar.h,v 1.32 2008/06/03 00:55:48 cokane Exp $ + * $FreeBSD: src/sys/dev/if_ndis/if_ndisvar.h,v 1.33 2008/06/11 13:40:15 cokane Exp $ */ #define NDIS_DEFAULT_NODENAME "FreeBSD NDIS node" @@ -129,7 +129,7 @@ struct resource *ndis_res_cm; /* common mem (pccard) */ struct resource_list ndis_rl; int ndis_rescnt; - kspin_lock ndis_spinlock; + struct mtx ndis_mtx; uint8_t ndis_irql; device_t ndis_dev; int ndis_unit; @@ -185,7 +185,5 @@ int ndis_hang_timer; }; -#define NDIS_LOCK(_sc) KeAcquireSpinLock(&(_sc)->ndis_spinlock, \ - &(_sc)->ndis_irql); -#define NDIS_UNLOCK(_sc) KeReleaseSpinLock(&(_sc)->ndis_spinlock, \ - (_sc)->ndis_irql); +#define NDIS_LOCK(_sc) mtx_lock(&(_sc)->ndis_mtx) +#define NDIS_UNLOCK(_sc) mtx_unlock(&(_sc)->ndis_mtx) ==== //depot/projects/vimage-commit/src/sys/dev/ixgbe/ixgbe.h#2 (text+ko) ==== @@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ -/*$FreeBSD: src/sys/dev/ixgbe/ixgbe.h,v 1.4 2008/05/16 18:46:30 jfv Exp $*/ +/*$FreeBSD: src/sys/dev/ixgbe/ixgbe.h,v 1.5 2008/06/11 22:29:47 jfv Exp $*/ #ifndef _IXGBE_H_ #define _IXGBE_H_ @@ -63,6 +63,7 @@ #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/tcp.h> +#include <netinet/tcp_lro.h> #include <netinet/udp.h> #include <machine/in_cksum.h> @@ -83,7 +84,6 @@ #include <sys/pcpu.h> #include "ixgbe_api.h" -#include "tcp_lro.h" /* Tunables */ ==== //depot/projects/vimage-commit/src/sys/dev/nmdm/nmdm.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/nmdm/nmdm.c,v 1.39 2007/08/01 21:38:11 emax Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/nmdm/nmdm.c,v 1.40 2008/06/11 18:55:19 ed Exp $"); /* * Pseudo-nulmodem driver @@ -68,7 +68,7 @@ .d_open = nmdmopen, .d_close = nmdmclose, .d_name = "nmdn", - .d_flags = D_TTY | D_PSEUDO | D_NEEDGIANT, + .d_flags = D_TTY | D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, }; #define BUFSIZ 100 /* Chunk size iomoved to/from user */ ==== //depot/projects/vimage-commit/src/sys/dev/smc/if_smc.c#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Benno Rice. All rights reserved. + * Copyright (c) 2008 Benno Rice. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,7 +23,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/smc/if_smc.c,v 1.1 2008/06/06 05:00:49 benno Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/smc/if_smc.c,v 1.3 2008/06/11 07:26:02 benno Exp $"); /* * Driver for SMSC LAN91C111, may work for older variants. @@ -76,6 +76,14 @@ #include <dev/mii/mii.h> #include <dev/mii/miivar.h> +#define SMC_LOCK(sc) mtx_lock(&(sc)->smc_mtx) +#define SMC_UNLOCK(sc) mtx_unlock(&(sc)->smc_mtx) +#define SMC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->smc_mtx, MA_OWNED) + +#define SMC_INTR_PRIORITY 0 +#define SMC_RX_PRIORITY 5 +#define SMC_TX_PRIORITY 10 + devclass_t smc_devclass; static const char *smc_chip_ids[16] = { @@ -104,6 +112,7 @@ static void smc_mii_mediachg(struct smc_softc *); static int smc_mii_mediaioctl(struct smc_softc *, struct ifreq *, u_long); +static void smc_task_intr(void *, int); static void smc_task_rx(void *, int); static void smc_task_tx(void *, int); @@ -117,7 +126,7 @@ smc_select_bank(struct smc_softc *sc, uint16_t bank) { - bus_space_write_2(sc->smc_bst, sc->smc_bsh, BSR, bank & BSR_BANK_MASK); + bus_write_2(sc->smc_reg, BSR, bank & BSR_BANK_MASK); } /* Never call this when not in bank 2. */ @@ -125,10 +134,10 @@ smc_mmu_wait(struct smc_softc *sc) { - KASSERT((bus_space_read_2(sc->smc_bst, sc->smc_bsh, BSR) & + KASSERT((bus_read_2(sc->smc_reg, BSR) & BSR_BANK_MASK) == 2, ("%s: smc_mmu_wait called when not in bank 2", device_get_nameunit(sc->smc_dev))); - while (bus_space_read_2(sc->smc_bst, sc->smc_bsh, MMUCR) & MMUCR_BUSY) + while (bus_read_2(sc->smc_reg, MMUCR) & MMUCR_BUSY) ; } @@ -136,28 +145,28 @@ smc_read_1(struct smc_softc *sc, bus_addr_t offset) { - return (bus_space_read_1(sc->smc_bst, sc->smc_bsh, offset)); + return (bus_read_1(sc->smc_reg, offset)); } static __inline void smc_write_1(struct smc_softc *sc, bus_addr_t offset, uint8_t val) { - bus_space_write_1(sc->smc_bst, sc->smc_bsh, offset, val); + bus_write_1(sc->smc_reg, offset, val); } static __inline uint16_t smc_read_2(struct smc_softc *sc, bus_addr_t offset) { - return (bus_space_read_2(sc->smc_bst, sc->smc_bsh, offset)); + return (bus_read_2(sc->smc_reg, offset)); } static __inline void smc_write_2(struct smc_softc *sc, bus_addr_t offset, uint16_t val) { - bus_space_write_2(sc->smc_bst, sc->smc_bsh, offset, val); + bus_write_2(sc->smc_reg, offset, val); } static __inline void @@ -165,7 +174,7 @@ bus_size_t count) { - bus_space_read_multi_2(sc->smc_bst, sc->smc_bsh, offset, datap, count); + bus_read_multi_2(sc->smc_reg, offset, datap, count); } static __inline void @@ -173,7 +182,7 @@ bus_size_t count) { - bus_space_write_multi_2(sc->smc_bst, sc->smc_bsh, offset, datap, count); + bus_write_multi_2(sc->smc_reg, offset, datap, count); } int @@ -183,8 +192,6 @@ uint16_t val; struct smc_softc *sc; struct resource *reg; - bus_space_tag_t bst; - bus_space_handle_t bsh; sc = device_get_softc(dev); rid = 0; @@ -202,11 +209,8 @@ return (ENXIO); } - bst = rman_get_bustag(reg); - bsh = rman_get_bushandle(reg); - /* Check for the identification value in the BSR. */ - val = bus_space_read_2(bst, bsh, BSR); + val = bus_read_2(reg, BSR); if ((val & BSR_IDENTIFY_MASK) != BSR_IDENTIFY) { if (bootverbose) device_printf(dev, "identification value not in BSR\n"); @@ -218,8 +222,8 @@ * Try switching banks and make sure we still get the identification * value. */ - bus_space_write_2(bst, bsh, BSR, 0); - val = bus_space_read_2(bst, bsh, BSR); + bus_write_2(reg, BSR, 0); + val = bus_read_2(reg, BSR); if ((val & BSR_IDENTIFY_MASK) != BSR_IDENTIFY) { if (bootverbose) device_printf(dev, @@ -230,8 +234,8 @@ #if 0 /* Check the BAR. */ - bus_space_write_2(bst, bsh, BSR, 1); - val = bus_space_read_2(bst, bsh, BAR); + bus_write_2(reg, BSR, 1); + val = bus_read_2(reg, BAR); val = BAR_ADDRESS(val); if (rman_get_start(reg) != val) { if (bootverbose) @@ -244,8 +248,8 @@ #endif /* Compare REV against known chip revisions. */ - bus_space_write_2(bst, bsh, BSR, 3); - val = bus_space_read_2(bst, bsh, REV); + bus_write_2(reg, BSR, 3); + val = bus_read_2(reg, REV); val = (val & REV_CHIP_MASK) >> REV_CHIP_SHIFT; if (smc_chip_ids[val] == NULL) { if (bootverbose) @@ -284,7 +288,7 @@ goto done; } - mtx_init(&sc->smc_mtx, device_get_nameunit(dev), NULL, MTX_SPIN); + mtx_init(&sc->smc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); type = SYS_RES_IOPORT; if (sc->smc_usemem) @@ -305,9 +309,6 @@ goto done; } - sc->smc_bst = rman_get_bustag(sc->smc_reg); - sc->smc_bsh = rman_get_bushandle(sc->smc_reg); - SMC_LOCK(sc); smc_reset(sc); SMC_UNLOCK(sc); @@ -356,6 +357,7 @@ ether_ifattach(ifp, eaddr); /* Set up taskqueue */ + TASK_INIT(&sc->smc_intr, SMC_INTR_PRIORITY, smc_task_intr, ifp); TASK_INIT(&sc->smc_rx, SMC_RX_PRIORITY, smc_task_rx, ifp); TASK_INIT(&sc->smc_tx, SMC_TX_PRIORITY, smc_task_tx, ifp); sc->smc_tq = taskqueue_create_fast("smc_taskq", M_NOWAIT, @@ -369,7 +371,7 @@ /* Wire up interrupt */ error = bus_setup_intr(dev, sc->smc_irq, - INTR_TYPE_NET|INTR_MPSAFE, smc_intr, NULL, ifp, &sc->smc_ih); + INTR_TYPE_NET|INTR_MPSAFE, smc_intr, NULL, sc, &sc->smc_ih); if (error != 0) goto done; @@ -389,9 +391,6 @@ callout_stop(&sc->smc_watchdog); - if (mtx_initialized(&sc->smc_mtx)) - SMC_LOCK(sc); - #ifdef DEVICE_POLLING if (sc->smc_ifp->if_capenable & IFCAP_POLLING) ether_poll_deregister(sc->smc_ifp); @@ -461,9 +460,7 @@ /* * Grab the next packet. If it's too big, drop it. */ - SMC_UNLOCK(sc); IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - SMC_LOCK(sc); len = m_length(m, NULL); len += (len & 1); if (len > ETHER_MAX_LEN - ETHER_CRC_LEN) { @@ -603,7 +600,7 @@ */ smc_mmu_wait(sc); smc_write_2(sc, MMUCR, MMUCR_CMD_ENQUEUE); - callout_reset(&sc->smc_watchdog, hz * 2, smc_watchdog, ifp); + callout_reset(&sc->smc_watchdog, hz * 2, smc_watchdog, sc); /* * Finish up. @@ -751,7 +748,7 @@ SMC_UNLOCK(sc); if (cmd == POLL_AND_CHECK_STATUS) - smc_intr(ifp); + taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); } #endif @@ -759,9 +756,20 @@ smc_intr(void *context) { struct smc_softc *sc; + + sc = (struct smc_softc *)context; + taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); + return (FILTER_HANDLED); +} + +static void +smc_task_intr(void *context, int pending) +{ + struct smc_softc *sc; struct ifnet *ifp; u_int status, packet, counter, tcr; + (void)pending; ifp = (struct ifnet *)context; sc = ifp->if_softc; @@ -871,8 +879,6 @@ smc_write_1(sc, MSK, sc->smc_mask); SMC_UNLOCK(sc); - - return (FILTER_HANDLED); } static u_int @@ -1215,11 +1221,11 @@ static void smc_watchdog(void *arg) { - struct ifnet *ifp; + struct smc_softc *sc; - ifp = (struct ifnet *)arg; - if_printf(ifp, "watchdog timeout\n"); - smc_intr(ifp); + sc = (struct smc_softc *)arg; + device_printf(sc->smc_dev, "watchdog timeout\n"); + taskqueue_enqueue_fast(sc->smc_tq, &sc->smc_intr); } static void ==== //depot/projects/vimage-commit/src/sys/dev/smc/if_smcvar.h#2 (text+ko) ==== @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006 Benno Rice. All rights reserved. + * Copyright (c) 2008 Benno Rice. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/smc/if_smcvar.h,v 1.1 2008/06/06 05:00:49 benno Exp $ + * $FreeBSD: src/sys/dev/smc/if_smcvar.h,v 1.3 2008/06/11 07:26:02 benno Exp $ * */ @@ -36,10 +36,6 @@ u_int smc_rev; u_int smc_mask; - /* Bus space glue */ - bus_space_tag_t smc_bst; - bus_space_handle_t smc_bsh; - /* Resources */ int smc_usemem; int smc_reg_rid; @@ -50,6 +46,7 @@ /* Tasks */ struct taskqueue *smc_tq; + struct task smc_intr; struct task smc_rx; struct task smc_tx; struct mbuf *smc_pending; @@ -69,13 +66,6 @@ void *smc_read_arg; }; -#define SMC_LOCK(sc) mtx_lock_spin(&(sc)->smc_mtx) -#define SMC_UNLOCK(sc) mtx_unlock_spin(&(sc)->smc_mtx) -#define SMC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->smc_mtx, MA_OWNED) - -#define SMC_RX_PRIORITY 0 -#define SMC_TX_PRIORITY 10 - int smc_probe(device_t); int smc_attach(device_t); int smc_detach(device_t); ==== //depot/projects/vimage-commit/src/sys/dev/snp/snp.c#2 (text+ko) ==== @@ -15,7 +15,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/snp/snp.c,v 1.107 2007/12/24 13:47:16 kib Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/snp/snp.c,v 1.108 2008/06/11 18:55:19 ed Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -44,7 +44,7 @@ static struct cdevsw snp_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, .d_open = snpopen, .d_close = snpclose, .d_read = snpread, ==== //depot/projects/vimage-commit/src/sys/dev/vkbd/vkbd.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $Id: vkbd.c,v 1.20 2004/11/15 23:53:30 max Exp $ - * $FreeBSD: src/sys/dev/vkbd/vkbd.c,v 1.12 2007/12/29 21:55:25 wkoszek Exp $ + * $FreeBSD: src/sys/dev/vkbd/vkbd.c,v 1.13 2008/06/11 18:55:19 ed Exp $ */ #include "opt_compat.h" @@ -158,7 +158,7 @@ static struct cdevsw vkbd_dev_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, .d_open = vkbd_dev_open, .d_close = vkbd_dev_close, .d_read = vkbd_dev_read, ==== //depot/projects/vimage-commit/src/sys/fs/cd9660/cd9660_vnops.c#2 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/fs/cd9660/cd9660_vnops.c,v 1.113 2007/02/15 22:08:34 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/fs/cd9660/cd9660_vnops.c,v 1.114 2008/06/11 12:46:09 kib Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -495,6 +495,7 @@ } idp->eofflag = 1; idp->curroff = uio->uio_offset; + idp->uio_off = uio->uio_offset; if ((entryoffsetinblock = idp->curroff & bmask) && (error = cd9660_blkatoff(vdp, (off_t)idp->curroff, NULL, &bp))) { ==== //depot/projects/vimage-commit/src/sys/fs/ntfs/ntfs_ihash.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ * SUCH DAMAGE. * * @(#)ufs_ihash.c 8.7 (Berkeley) 5/17/95 - * $FreeBSD: src/sys/fs/ntfs/ntfs_ihash.c,v 1.23 2007/11/13 19:34:06 maxim Exp $ + * $FreeBSD: src/sys/fs/ntfs/ntfs_ihash.c,v 1.24 2008/06/11 18:55:19 ed Exp $ */ #include <sys/param.h> @@ -52,7 +52,7 @@ */ static LIST_HEAD(nthashhead, ntnode) *ntfs_nthashtbl; static u_long ntfs_nthash; /* size of hash table - 1 */ -#define NTNOHASH(device, inum) (&ntfs_nthashtbl[(minor(device) + (inum)) & ntfs_nthash]) +#define NTNOHASH(inum) (&ntfs_nthashtbl[(inum) & ntfs_nthash]) static struct mtx ntfs_nthash_mtx; struct lock ntfs_hashlock; @@ -90,7 +90,7 @@ struct ntnode *ip; mtx_lock(&ntfs_nthash_mtx); - LIST_FOREACH(ip, NTNOHASH(dev, inum), i_hash) + LIST_FOREACH(ip, NTNOHASH(inum), i_hash) if (inum == ip->i_number && dev == ip->i_dev) break; mtx_unlock(&ntfs_nthash_mtx); @@ -108,7 +108,7 @@ struct nthashhead *ipp; mtx_lock(&ntfs_nthash_mtx); - ipp = NTNOHASH(ip->i_dev, ip->i_number); + ipp = NTNOHASH(ip->i_number); LIST_INSERT_HEAD(ipp, ip, i_hash); ip->i_flag |= IN_HASHED; mtx_unlock(&ntfs_nthash_mtx); ==== //depot/projects/vimage-commit/src/sys/i386/acpica/acpi_machdep.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.38 2008/03/13 20:39:04 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.39 2008/06/11 18:55:19 ed Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -84,7 +84,7 @@ static struct cdevsw apm_cdevsw = { .d_version = D_VERSION, - .d_flags = D_TRACKCLOSE, + .d_flags = D_TRACKCLOSE | D_NEEDMINOR, .d_open = apmopen, .d_close = apmclose, .d_write = apmwrite, ==== //depot/projects/vimage-commit/src/sys/kern/kern_conf.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_conf.c,v 1.215 2008/05/29 12:50:45 ed Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_conf.c,v 1.216 2008/06/11 18:55:19 ed Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -566,10 +566,13 @@ mtx_assert(&devmtx, MA_OWNED); udev = y; - LIST_FOREACH(si2, &csw->d_devs, si_list) { - if (si2->si_drv0 == udev) { - dev_free_devlocked(si); - return (si2); + if (csw->d_flags & D_NEEDMINOR) { + /* We may want to return an existing device */ + LIST_FOREACH(si2, &csw->d_devs, si_list) { + if (si2->si_drv0 == udev) { + dev_free_devlocked(si); + return (si2); + } } } si->si_drv0 = udev; @@ -1016,6 +1019,8 @@ ("Illegal extra bits (0x%x) in clone_create", extra)); KASSERT(*up <= CLONE_UNITMASK, ("Too high unit (0x%x) in clone_create", *up)); + KASSERT(csw->d_flags & D_NEEDMINOR, + ("clone_create() on cdevsw without minor numbers")); /* ==== //depot/projects/vimage-commit/src/sys/modules/ixgbe/Makefile#2 (text+ko) ==== @@ -1,8 +1,8 @@ -#$FreeBSD: src/sys/modules/ixgbe/Makefile,v 1.3 2008/05/16 18:46:30 jfv Exp $ +#$FreeBSD: src/sys/modules/ixgbe/Makefile,v 1.4 2008/06/11 22:18:50 jfv Exp $ .PATH: ${.CURDIR}/../../dev/ixgbe KMOD = ixgbe SRCS = device_if.h bus_if.h pci_if.h -SRCS += ixgbe.c tcp_lro.c +SRCS += ixgbe.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_82598.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe ==== //depot/projects/vimage-commit/src/sys/net/if_tap.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ /* - * $FreeBSD: src/sys/net/if_tap.c,v 1.72 2008/04/15 16:54:39 emax Exp $ + * $FreeBSD: src/sys/net/if_tap.c,v 1.73 2008/06/11 18:55:19 ed Exp $ * $Id: if_tap.c,v 0.21 2000/07/23 21:46:02 max Exp $ */ @@ -134,7 +134,7 @@ static struct cdevsw tap_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, .d_open = tapopen, .d_close = tapclose, .d_read = tapread, ==== //depot/projects/vimage-commit/src/sys/net/if_tun.c#3 (text+ko) ==== @@ -13,7 +13,7 @@ * UCL. This driver is based much more on read/write/poll mode of * operation though. * - * $FreeBSD: src/sys/net/if_tun.c,v 1.164 2007/10/24 19:03:57 rwatson Exp $ + * $FreeBSD: src/sys/net/if_tun.c,v 1.165 2008/06/11 18:55:19 ed Exp $ */ #include "opt_atalk.h" @@ -164,7 +164,7 @@ static struct cdevsw tun_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, .d_open = tunopen, .d_close = tunclose, .d_read = tunread, ==== //depot/projects/vimage-commit/src/sys/powerpc/booke/pmap.c#2 (text+ko) ==== @@ -39,7 +39,7 @@ * Virtual address space layout: * ----------------------------- * 0x0000_0000 - 0xbfff_efff : user process - * 0xc000_0000 - 0xc1ff_ffff : kerel reserved + * 0xc000_0000 - 0xc1ff_ffff : kernel reserved * 0xc000_0000 - kernelend : kernel code &data * 0xc1ff_c000 - 0xc200_0000 : kstack0 * 0xc200_0000 - 0xffef_ffff : KVA @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/powerpc/booke/pmap.c,v 1.3 2008/05/18 04:16:56 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/powerpc/booke/pmap.c,v 1.4 2008/06/11 20:05:25 wkoszek Exp $"); #include <sys/types.h> #include <sys/param.h> ==== //depot/projects/vimage-commit/src/sys/security/audit/audit_pipe.c#2 (text) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/security/audit/audit_pipe.c,v 1.15 2008/04/13 22:06:56 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/security/audit/audit_pipe.c,v 1.16 2008/06/11 18:55:19 ed Exp $"); #include <sys/param.h> #include <sys/condvar.h> @@ -177,7 +177,7 @@ static struct cdevsw audit_pipe_cdevsw = { .d_version = D_VERSION, - .d_flags = D_PSEUDO | D_NEEDGIANT, + .d_flags = D_PSEUDO | D_NEEDGIANT | D_NEEDMINOR, .d_open = audit_pipe_open, .d_close = audit_pipe_close, .d_read = audit_pipe_read, ==== //depot/projects/vimage-commit/src/sys/sys/conf.h#2 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)conf.h 8.5 (Berkeley) 1/9/95 - * $FreeBSD: src/sys/sys/conf.h,v 1.239 2008/05/29 12:50:46 ed Exp $ + * $FreeBSD: src/sys/sys/conf.h,v 1.240 2008/06/11 18:55:19 ed Exp $ */ #ifndef _SYS_CONF_H_ @@ -71,7 +71,7 @@ gid_t si_gid; mode_t si_mode; struct ucred *si_cred; /* cached clone-time credential */ - u_int si_drv0; + int si_drv0; int si_refcount; LIST_ENTRY(cdev) si_list; LIST_ENTRY(cdev) si_clone; @@ -171,6 +171,7 @@ #define D_MMAP_ANON 0x00100000 /* special treatment in vm_mmap.c */ #define D_PSEUDO 0x00200000 /* make_dev() can return NULL */ #define D_NEEDGIANT 0x00400000 /* driver want Giant */ +#define D_NEEDMINOR 0x00800000 /* driver uses clone_create() */ /* * Version numbers.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806112239.m5BMdH5o007048>