Date: Mon, 1 Jun 2009 12:29:28 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r193227 - in projects/pnet/sys: . amd64/amd64 arm/arm arm/xscale/ixp425 boot/common boot/uboot/lib cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/fs cddl/contrib/opens... Message-ID: <200906011229.n51CTSDT078764@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rwatson Date: Mon Jun 1 12:29:27 2009 New Revision: 193227 URL: http://svn.freebsd.org/changeset/base/193227 Log: Merge r193031-r193225 from head to projects/pnet following netisr2 merge. Added: projects/pnet/sys/i386/include/xen/xen_clock_util.h - copied unchanged from r193225, head/sys/i386/include/xen/xen_clock_util.h projects/pnet/sys/i386/xen/xen_clock_util.c - copied unchanged from r193225, head/sys/i386/xen/xen_clock_util.c projects/pnet/sys/powerpc/cpufreq/ - copied from r193225, head/sys/powerpc/cpufreq/ projects/pnet/sys/powerpc/ofw/ofw_cpu.c - copied unchanged from r193225, head/sys/powerpc/ofw/ofw_cpu.c projects/pnet/sys/powerpc/powermac/vcoregpio.c - copied unchanged from r193225, head/sys/powerpc/powermac/vcoregpio.c Modified: projects/pnet/sys/ (props changed) projects/pnet/sys/amd64/amd64/dump_machdep.c projects/pnet/sys/amd64/amd64/minidump_machdep.c projects/pnet/sys/arm/arm/dump_machdep.c projects/pnet/sys/arm/xscale/ixp425/if_npe.c projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.c projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.h projects/pnet/sys/boot/common/boot.c projects/pnet/sys/boot/uboot/lib/net.c projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris.c projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/pnet/sys/compat/linux/linux_misc.c projects/pnet/sys/compat/linux/linux_socket.c projects/pnet/sys/compat/ndis/subr_usbd.c projects/pnet/sys/compat/svr4/svr4_stat.c projects/pnet/sys/conf/NOTES projects/pnet/sys/conf/files.i386 projects/pnet/sys/conf/files.powerpc projects/pnet/sys/conf/options projects/pnet/sys/ddb/db_textdump.c projects/pnet/sys/dev/ata/ (props changed) projects/pnet/sys/dev/ata/ata-usb.c projects/pnet/sys/dev/ata/chipsets/ata-intel.c projects/pnet/sys/dev/bge/if_bge.c projects/pnet/sys/dev/bwi/if_bwi.c projects/pnet/sys/dev/dc/if_dc.c projects/pnet/sys/dev/e1000/if_em.c projects/pnet/sys/dev/firewire/firewire.c projects/pnet/sys/dev/firewire/if_fwe.c projects/pnet/sys/dev/firewire/if_fwip.c projects/pnet/sys/dev/fxp/if_fxp.c projects/pnet/sys/dev/if_ndis/if_ndisvar.h projects/pnet/sys/dev/iwn/if_iwn.c projects/pnet/sys/dev/ixgb/if_ixgb.c projects/pnet/sys/dev/lmc/if_lmc.c projects/pnet/sys/dev/lmc/if_lmc.h projects/pnet/sys/dev/mge/if_mge.c projects/pnet/sys/dev/nfe/if_nfe.c projects/pnet/sys/dev/nge/if_nge.c projects/pnet/sys/dev/ral/rt2560.c projects/pnet/sys/dev/re/if_re.c projects/pnet/sys/dev/sf/if_sf.c projects/pnet/sys/dev/sis/if_sis.c projects/pnet/sys/dev/smc/if_smc.c projects/pnet/sys/dev/sound/usb/uaudio.c projects/pnet/sys/dev/ste/if_ste.c projects/pnet/sys/dev/stge/if_stge.c projects/pnet/sys/dev/syscons/daemon/daemon_saver.c projects/pnet/sys/dev/syscons/scterm-teken.c projects/pnet/sys/dev/syscons/teken/sequences projects/pnet/sys/dev/syscons/teken/teken.c projects/pnet/sys/dev/syscons/teken/teken.h projects/pnet/sys/dev/syscons/teken/teken_subr_compat.h projects/pnet/sys/dev/tsec/if_tsec.c projects/pnet/sys/dev/usb/controller/at91dci.c projects/pnet/sys/dev/usb/controller/at91dci.h projects/pnet/sys/dev/usb/controller/atmegadci.c projects/pnet/sys/dev/usb/controller/atmegadci.h projects/pnet/sys/dev/usb/controller/avr32dci.c projects/pnet/sys/dev/usb/controller/avr32dci.h projects/pnet/sys/dev/usb/controller/ehci.c projects/pnet/sys/dev/usb/controller/ehci.h projects/pnet/sys/dev/usb/controller/musb_otg.c projects/pnet/sys/dev/usb/controller/musb_otg.h projects/pnet/sys/dev/usb/controller/ohci.c projects/pnet/sys/dev/usb/controller/ohci.h projects/pnet/sys/dev/usb/controller/uhci.c projects/pnet/sys/dev/usb/controller/uhci.h projects/pnet/sys/dev/usb/controller/usb_controller.c projects/pnet/sys/dev/usb/controller/uss820dci.c projects/pnet/sys/dev/usb/controller/uss820dci.h projects/pnet/sys/dev/usb/input/uhid.c projects/pnet/sys/dev/usb/input/ukbd.c projects/pnet/sys/dev/usb/input/ums.c projects/pnet/sys/dev/usb/misc/udbp.c projects/pnet/sys/dev/usb/misc/ufm.c projects/pnet/sys/dev/usb/net/if_aue.c projects/pnet/sys/dev/usb/net/if_axe.c projects/pnet/sys/dev/usb/net/if_cdce.c projects/pnet/sys/dev/usb/net/if_cue.c projects/pnet/sys/dev/usb/net/if_kue.c projects/pnet/sys/dev/usb/net/if_rue.c projects/pnet/sys/dev/usb/net/if_udav.c projects/pnet/sys/dev/usb/net/usb_ethernet.c projects/pnet/sys/dev/usb/net/usb_ethernet.h projects/pnet/sys/dev/usb/serial/u3g.c projects/pnet/sys/dev/usb/serial/uark.c projects/pnet/sys/dev/usb/serial/ubsa.c projects/pnet/sys/dev/usb/serial/ubser.c projects/pnet/sys/dev/usb/serial/uchcom.c projects/pnet/sys/dev/usb/serial/ucycom.c projects/pnet/sys/dev/usb/serial/ufoma.c projects/pnet/sys/dev/usb/serial/uftdi.c projects/pnet/sys/dev/usb/serial/ugensa.c projects/pnet/sys/dev/usb/serial/uipaq.c projects/pnet/sys/dev/usb/serial/ulpt.c projects/pnet/sys/dev/usb/serial/umct.c projects/pnet/sys/dev/usb/serial/umodem.c projects/pnet/sys/dev/usb/serial/umoscom.c projects/pnet/sys/dev/usb/serial/uplcom.c projects/pnet/sys/dev/usb/serial/usb_serial.c projects/pnet/sys/dev/usb/serial/uslcom.c projects/pnet/sys/dev/usb/serial/uvisor.c projects/pnet/sys/dev/usb/serial/uvscom.c projects/pnet/sys/dev/usb/storage/umass.c projects/pnet/sys/dev/usb/storage/urio.c projects/pnet/sys/dev/usb/storage/ustorage_fs.c projects/pnet/sys/dev/usb/template/usb_template.c projects/pnet/sys/dev/usb/usb_bus.h projects/pnet/sys/dev/usb/usb_busdma.c projects/pnet/sys/dev/usb/usb_busdma.h projects/pnet/sys/dev/usb/usb_compat_linux.c projects/pnet/sys/dev/usb/usb_compat_linux.h projects/pnet/sys/dev/usb/usb_controller.h projects/pnet/sys/dev/usb/usb_core.h projects/pnet/sys/dev/usb/usb_dev.c projects/pnet/sys/dev/usb/usb_dev.h projects/pnet/sys/dev/usb/usb_device.c projects/pnet/sys/dev/usb/usb_device.h projects/pnet/sys/dev/usb/usb_dynamic.c projects/pnet/sys/dev/usb/usb_dynamic.h projects/pnet/sys/dev/usb/usb_error.c projects/pnet/sys/dev/usb/usb_generic.c projects/pnet/sys/dev/usb/usb_handle_request.c projects/pnet/sys/dev/usb/usb_hid.c projects/pnet/sys/dev/usb/usb_hid.h projects/pnet/sys/dev/usb/usb_hub.c projects/pnet/sys/dev/usb/usb_hub.h projects/pnet/sys/dev/usb/usb_lookup.c projects/pnet/sys/dev/usb/usb_lookup.h projects/pnet/sys/dev/usb/usb_mbuf.c projects/pnet/sys/dev/usb/usb_mbuf.h projects/pnet/sys/dev/usb/usb_msctest.c projects/pnet/sys/dev/usb/usb_msctest.h projects/pnet/sys/dev/usb/usb_process.c projects/pnet/sys/dev/usb/usb_process.h projects/pnet/sys/dev/usb/usb_request.c projects/pnet/sys/dev/usb/usb_request.h projects/pnet/sys/dev/usb/usb_transfer.c projects/pnet/sys/dev/usb/usb_transfer.h projects/pnet/sys/dev/usb/usb_util.c projects/pnet/sys/dev/usb/usbdevs projects/pnet/sys/dev/usb/wlan/if_rum.c projects/pnet/sys/dev/usb/wlan/if_uath.c projects/pnet/sys/dev/usb/wlan/if_upgt.c projects/pnet/sys/dev/usb/wlan/if_ural.c projects/pnet/sys/dev/usb/wlan/if_urtw.c projects/pnet/sys/dev/usb/wlan/if_urtwvar.h projects/pnet/sys/dev/usb/wlan/if_zyd.c projects/pnet/sys/dev/vge/if_vge.c projects/pnet/sys/dev/vr/if_vr.c projects/pnet/sys/dev/xen/netfront/ (props changed) projects/pnet/sys/dev/xen/xenpci/ (props changed) projects/pnet/sys/dev/xl/if_xl.c projects/pnet/sys/fs/cd9660/cd9660_rrip.c projects/pnet/sys/fs/nfs/nfsport.h projects/pnet/sys/fs/nfsclient/nfs_clbio.c projects/pnet/sys/fs/nfsclient/nfs_clnode.c projects/pnet/sys/fs/nfsclient/nfs_clstate.c projects/pnet/sys/fs/nfsclient/nfs_clvfsops.c projects/pnet/sys/fs/nfsclient/nfs_clvnops.c projects/pnet/sys/fs/nfsserver/nfs_nfsdport.c projects/pnet/sys/fs/nullfs/null_subr.c projects/pnet/sys/fs/nullfs/null_vnops.c projects/pnet/sys/fs/pseudofs/pseudofs_vnops.c projects/pnet/sys/geom/label/g_label.c projects/pnet/sys/geom/vinum/geom_vinum_create.c projects/pnet/sys/geom/vinum/geom_vinum_drive.c projects/pnet/sys/i386/i386/dump_machdep.c projects/pnet/sys/i386/i386/minidump_machdep.c projects/pnet/sys/i386/ibcs2/ibcs2_socksys.c projects/pnet/sys/i386/include/apicvar.h projects/pnet/sys/i386/xen/clock.c projects/pnet/sys/i386/xen/mp_machdep.c projects/pnet/sys/i386/xen/xen_rtc.c projects/pnet/sys/ia64/ia64/dump_machdep.c projects/pnet/sys/kern/kern_cpu.c projects/pnet/sys/kern/kern_jail.c projects/pnet/sys/kern/kern_mib.c projects/pnet/sys/kern/kern_mutex.c projects/pnet/sys/kern/kern_prot.c projects/pnet/sys/kern/kern_rmlock.c projects/pnet/sys/kern/kern_rwlock.c projects/pnet/sys/kern/kern_shutdown.c projects/pnet/sys/kern/kern_vimage.c projects/pnet/sys/kern/kern_xxx.c projects/pnet/sys/kern/uipc_syscalls.c projects/pnet/sys/kern/vfs_bio.c projects/pnet/sys/kern/vfs_cache.c projects/pnet/sys/kern/vfs_default.c projects/pnet/sys/kern/vfs_mount.c projects/pnet/sys/kern/vfs_subr.c projects/pnet/sys/kern/vnode_if.src projects/pnet/sys/kgssapi/gsstest.c projects/pnet/sys/modules/Makefile projects/pnet/sys/modules/cpufreq/Makefile projects/pnet/sys/modules/dtrace/dtnfsclient/ (props changed) projects/pnet/sys/modules/geom/geom_part/geom_part_ebr/Makefile projects/pnet/sys/modules/ip6_mroute_mod/ (props changed) projects/pnet/sys/modules/ipmi/ipmi_linux/ (props changed) projects/pnet/sys/modules/usb/Makefile projects/pnet/sys/modules/zfs/Makefile projects/pnet/sys/net/if.c projects/pnet/sys/net/if.h projects/pnet/sys/net/if_var.h projects/pnet/sys/net80211/ieee80211_dfs.c projects/pnet/sys/net80211/ieee80211_freebsd.c projects/pnet/sys/net80211/ieee80211_ht.c projects/pnet/sys/net80211/ieee80211_phy.h projects/pnet/sys/net80211/ieee80211_superg.c projects/pnet/sys/net80211/ieee80211_tdma.c projects/pnet/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c projects/pnet/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c projects/pnet/sys/netinet/in.h projects/pnet/sys/netinet/in_pcb.c projects/pnet/sys/netinet/in_pcb.h projects/pnet/sys/netinet/ip_output.c projects/pnet/sys/netinet/raw_ip.c projects/pnet/sys/netinet/sctp_pcb.c projects/pnet/sys/netinet/sctp_sysctl.c projects/pnet/sys/netinet/sctp_sysctl.h projects/pnet/sys/netinet/sctp_uio.h projects/pnet/sys/netinet/sctputil.c projects/pnet/sys/netinet6/icmp6.c projects/pnet/sys/netinet6/in6.h projects/pnet/sys/netinet6/in6_ifattach.c projects/pnet/sys/netinet6/in6_pcb.c projects/pnet/sys/netinet6/ip6_output.c projects/pnet/sys/nfsclient/bootp_subr.c projects/pnet/sys/nfsclient/nfs_bio.c projects/pnet/sys/nfsclient/nfs_vfsops.c projects/pnet/sys/nfsserver/nfs_srvkrpc.c projects/pnet/sys/nlm/nlm_advlock.c projects/pnet/sys/pci/if_rl.c projects/pnet/sys/powerpc/aim/machdep.c projects/pnet/sys/powerpc/booke/machdep.c projects/pnet/sys/powerpc/conf/GENERIC projects/pnet/sys/powerpc/conf/NOTES projects/pnet/sys/powerpc/mpc85xx/atpic.c projects/pnet/sys/powerpc/powermac/pmu.c projects/pnet/sys/powerpc/powerpc/cpu.c projects/pnet/sys/rpc/authunix_prot.c projects/pnet/sys/rpc/xdr.h projects/pnet/sys/sparc64/sparc64/dump_machdep.c projects/pnet/sys/sun4v/sun4v/dump_machdep.c projects/pnet/sys/sys/buf.h projects/pnet/sys/sys/cpu.h projects/pnet/sys/sys/jail.h projects/pnet/sys/sys/kernel.h projects/pnet/sys/sys/mount.h projects/pnet/sys/sys/param.h projects/pnet/sys/sys/priv.h projects/pnet/sys/sys/sockio.h projects/pnet/sys/sys/syscallsubr.h projects/pnet/sys/sys/vimage.h projects/pnet/sys/sys/vnode.h projects/pnet/sys/vm/vm_page.c projects/pnet/sys/vm/vm_page.h projects/pnet/sys/xen/evtchn/evtchn.c Modified: projects/pnet/sys/amd64/amd64/dump_machdep.c ============================================================================== --- projects/pnet/sys/amd64/amd64/dump_machdep.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/amd64/amd64/dump_machdep.c Mon Jun 1 12:29:27 2009 (r193227) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/kernel.h> #include <sys/kerneldump.h> -#include <sys/vimage.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/elf.h> Modified: projects/pnet/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- projects/pnet/sys/amd64/amd64/minidump_machdep.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/amd64/amd64/minidump_machdep.c Mon Jun 1 12:29:27 2009 (r193227) @@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/kerneldump.h> #include <sys/msgbuf.h> -#include <sys/vimage.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/atomic.h> Modified: projects/pnet/sys/arm/arm/dump_machdep.c ============================================================================== --- projects/pnet/sys/arm/arm/dump_machdep.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/arm/arm/dump_machdep.c Mon Jun 1 12:29:27 2009 (r193227) @@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/proc.h> #include <sys/kerneldump.h> -#include <sys/vimage.h> #include <vm/vm.h> #include <vm/pmap.h> #include <machine/elf.h> Modified: projects/pnet/sys/arm/xscale/ixp425/if_npe.c ============================================================================== --- projects/pnet/sys/arm/xscale/ixp425/if_npe.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/arm/xscale/ixp425/if_npe.c Mon Jun 1 12:29:27 2009 (r193227) @@ -229,7 +229,7 @@ static void npe_getmac(struct npe_softc static void npe_txdone(int qid, void *arg); static int npe_rxbuf_init(struct npe_softc *, struct npebuf *, struct mbuf *); -static void npe_rxdone(int qid, void *arg); +static int npe_rxdone(int qid, void *arg); static void npeinit(void *); static void npestart_locked(struct ifnet *); static void npestart(struct ifnet *); @@ -777,7 +777,7 @@ npe_activate(device_t dev) */ sc->rx_qid = npeconfig[sc->sc_npeid].rx_qid; ixpqmgr_qconfig(sc->rx_qid, npe_rxbuf, 0, 1, - IX_QMGR_Q_SOURCE_ID_NOT_E, npe_rxdone, sc); + IX_QMGR_Q_SOURCE_ID_NOT_E, (qconfig_hand_t *)npe_rxdone, sc); sc->rx_freeqid = npeconfig[sc->sc_npeid].rx_freeqid; ixpqmgr_qconfig(sc->rx_freeqid, npe_rxbuf, 0, npe_rxbuf/2, 0, NULL, sc); /* @@ -1091,7 +1091,7 @@ npe_rxbuf_init(struct npe_softc *sc, str * from the hardware queue and pass the frames up the * stack. Pass the rx buffers to the free list. */ -static void +static int npe_rxdone(int qid, void *arg) { #define P2V(a, dma) \ @@ -1099,6 +1099,7 @@ npe_rxdone(int qid, void *arg) struct npe_softc *sc = arg; struct npedma *dma = &sc->rxdma; uint32_t entry; + int rx_npkts = 0; while (ixpqmgr_qread(qid, &entry) == 0) { struct npebuf *npe = P2V(NPE_QM_Q_ADDR(entry), dma); @@ -1132,6 +1133,7 @@ npe_rxdone(int qid, void *arg) ifp->if_ipackets++; ifp->if_input(ifp, mrx); + rx_npkts++; } else { /* discard frame and re-use mbuf */ m = npe->ix_m; @@ -1143,19 +1145,22 @@ npe_rxdone(int qid, void *arg) /* XXX should not happen */ } } + return rx_npkts; #undef P2V } #ifdef DEVICE_POLLING -static void +static int npe_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct npe_softc *sc = ifp->if_softc; + int rx_npkts = 0; if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - npe_rxdone(sc->rx_qid, sc); + rx_npkts = npe_rxdone(sc->rx_qid, sc); npe_txdone(sc->tx_doneqid, sc); /* XXX polls both NPE's */ } + return rx_npkts; } #endif /* DEVICE_POLLING */ Modified: projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.c ============================================================================== --- projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.c Mon Jun 1 12:29:27 2009 (r193227) @@ -338,7 +338,7 @@ ixpqmgr_detach(device_t dev) int ixpqmgr_qconfig(int qId, int qEntries, int ne, int nf, int srcSel, - void (*cb)(int, void *), void *cbarg) + qconfig_hand_t *cb, void *cbarg) { struct ixpqmgr_softc *sc = ixpqmgr_sc; struct qmgrInfo *qi = &sc->qinfo[qId]; Modified: projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.h ============================================================================== --- projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.h Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/arm/xscale/ixp425/ixp425_qmgr.h Mon Jun 1 12:29:27 2009 (r193227) @@ -229,8 +229,10 @@ #define IX_QMGR_ENTRY2_OFFSET 1 #define IX_QMGR_ENTRY4_OFFSET 3 +typedef void qconfig_hand_t(int, void *); + int ixpqmgr_qconfig(int qId, int qSizeInWords, int ne, int nf, int srcSel, - void (*cb)(int, void *), void *cbarg); + qconfig_hand_t *cb, void *cbarg); int ixpqmgr_qwrite(int qId, uint32_t entry); int ixpqmgr_qread(int qId, uint32_t *entry); int ixpqmgr_qreadm(int qId, uint32_t n, uint32_t *p); Modified: projects/pnet/sys/boot/common/boot.c ============================================================================== --- projects/pnet/sys/boot/common/boot.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/boot/common/boot.c Mon Jun 1 12:29:27 2009 (r193227) @@ -287,7 +287,7 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp; + char lbuf[128], *cp, *ep, *dev, *fstyp, *options; int fd, error; if (getenv("vfs.root.mountfrom") != NULL) @@ -331,11 +331,30 @@ getrootmount(char *rootdev) *cp = 0; fstyp = strdup(ep); - /* build the final result and save it */ + /* skip whitespace up to mount options */ + cp += 1; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of mount options and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + options = strdup(ep); + /* Build the <fstype>:<device> and save it in vfs.root.mountfrom */ sprintf(lbuf, "%s:%s", fstyp, dev); free(dev); free(fstyp); setenv("vfs.root.mountfrom", lbuf, 0); + + /* Don't override vfs.root.mountfrom.options if it is already set */ + if (getenv("vfs.root.mountfrom.options") == NULL) { + /* save mount options */ + setenv("vfs.root.mountfrom.options", options, 0); + } + free(options); error = 0; break; } Modified: projects/pnet/sys/boot/uboot/lib/net.c ============================================================================== --- projects/pnet/sys/boot/uboot/lib/net.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/boot/uboot/lib/net.c Mon Jun 1 12:29:27 2009 (r193227) @@ -46,12 +46,6 @@ __FBSDID("$FreeBSD$"); #include "glue.h" #include "libuboot.h" -#define NETIF_DEBUG -#define NETIF_VERBOSE_DEBUG -#undef NETIF_DEBUG -#undef NETIF_VERBOSE_DEBUG - - static int net_probe(struct netif *, void *); static int net_match(struct netif *, void *); static void net_init(struct iodesc *, void *); @@ -138,7 +132,7 @@ net_put(struct iodesc *desc, void *pkt, #if defined(NETIF_DEBUG) struct ether_header *eh; - printf("net_put: desc 0x%x, pkt 0x%x, len %d\n", desc, pkt, len); + printf("net_put: desc %p, pkt %p, len %d\n", desc, pkt, len); eh = pkt; printf("dst: %s ", ether_sprintf(eh->ether_dhost)); printf("src: %s ", ether_sprintf(eh->ether_shost)); @@ -175,7 +169,7 @@ net_get(struct iodesc *desc, void *pkt, int err, rlen; #if defined(NETIF_DEBUG) - printf("net_get: pkt %x, len %d, timeout %d\n", pkt, len, timeout); + printf("net_get: pkt %p, len %d, timeout %d\n", pkt, len, timeout); #endif t = getsecs(); do { Modified: projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris.c ============================================================================== --- projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris.c Mon Jun 1 12:29:27 2009 (r193227) @@ -31,11 +31,11 @@ #include <sys/conf.h> #include <sys/cpuvar.h> #include <sys/errno.h> +#include <sys/jail.h> #include <sys/kernel.h> #include <sys/misc.h> #include <sys/module.h> #include <sys/mutex.h> -#include <sys/vimage.h> cpu_core_t cpu_core[MAXCPU]; kmutex_t cpu_lock; @@ -83,7 +83,7 @@ opensolaris_modevent(module_t mod __unus switch (type) { case MOD_LOAD: - utsname.nodename = G_hostname; + utsname.nodename = prison0.pr_host; break; case MOD_UNLOAD: Modified: projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c ============================================================================== --- projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c Mon Jun 1 12:29:27 2009 (r193227) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> +#include <sys/jail.h> #include <sys/kernel.h> #include <sys/libkern.h> #include <sys/limits.h> @@ -57,7 +58,7 @@ ddi_strtoul(const char *str, char **nptr { if (str == hw_serial) { - *result = hostid; + *result = prison0.pr_hostid; return (0); } Modified: projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c ============================================================================== --- projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c Mon Jun 1 12:29:27 2009 (r193227) @@ -564,8 +564,13 @@ gfs_file_inactive(vnode_t *vp) if (fp->gfs_parent == NULL || (vp->v_flag & V_XATTRDIR)) goto found; - dp = fp->gfs_parent->v_data; - + /* + * XXX cope with a FreeBSD-specific race wherein the parent's + * snapshot data can be freed before the parent is + */ + if ((dp = fp->gfs_parent->v_data) == NULL) + return (NULL); + /* * First, see if this vnode is cached in the parent. */ Modified: projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Jun 1 12:29:27 2009 (r193227) @@ -2392,13 +2392,23 @@ vdev_set_state(vdev_t *vd, boolean_t iso /* * Check the vdev configuration to ensure that it's capable of supporting - * a root pool. Currently, we do not support RAID-Z or partial configuration. - * In addition, only a single top-level vdev is allowed and none of the leaves - * can be wholedisks. + * a root pool. + * + * On Solaris, we do not support RAID-Z or partial configuration. In + * addition, only a single top-level vdev is allowed and none of the + * leaves can be wholedisks. + * + * For FreeBSD, we can boot from any configuration. There is a + * limitation that the boot filesystem must be either uncompressed or + * compresses with lzjb compression but I'm not sure how to enforce + * that here. */ boolean_t vdev_is_bootable(vdev_t *vd) { +#ifdef __FreeBSD_version + return (B_TRUE); +#else int c; if (!vd->vdev_ops->vdev_op_leaf) { @@ -2420,4 +2430,5 @@ vdev_is_bootable(vdev_t *vd) return (B_FALSE); } return (B_TRUE); +#endif } Modified: projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Mon Jun 1 12:29:27 2009 (r193227) @@ -3121,3 +3121,4 @@ static moduledata_t zfs_mod = { }; DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); MODULE_DEPEND(zfsctrl, opensolaris, 1, 1, 1); +MODULE_DEPEND(zfsctrl, krpc, 1, 1, 1); Modified: projects/pnet/sys/compat/linux/linux_misc.c ============================================================================== --- projects/pnet/sys/compat/linux/linux_misc.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/compat/linux/linux_misc.c Mon Jun 1 12:29:27 2009 (r193227) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include <sys/vnode.h> #include <sys/wait.h> #include <sys/cpuset.h> -#include <sys/vimage.h> #include <security/mac/mac_framework.h> @@ -715,10 +714,10 @@ linux_times(struct thread *td, struct li int linux_newuname(struct thread *td, struct linux_newuname_args *args) { - INIT_VPROCG(TD_TO_VPROCG(td)); struct l_new_utsname utsname; char osname[LINUX_MAX_UTSNAME]; char osrelease[LINUX_MAX_UTSNAME]; + struct prison *pr; char *p; #ifdef DEBUG @@ -741,9 +740,10 @@ linux_newuname(struct thread *td, struct } strlcpy(utsname.machine, linux_platform, LINUX_MAX_UTSNAME); - mtx_lock(&hostname_mtx); - strlcpy(utsname.domainname, V_domainname, LINUX_MAX_UTSNAME); - mtx_unlock(&hostname_mtx); + pr = td->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + strlcpy(utsname.domainname, pr->pr_domain, LINUX_MAX_UTSNAME); + mtx_unlock(&pr->pr_mtx); return (copyout(&utsname, args->buf, sizeof(utsname))); } Modified: projects/pnet/sys/compat/linux/linux_socket.c ============================================================================== --- projects/pnet/sys/compat/linux/linux_socket.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/compat/linux/linux_socket.c Mon Jun 1 12:29:27 2009 (r193227) @@ -445,8 +445,6 @@ bsd_to_linux_cmsg_type(int cmsg_type) return (-1); } - - static int linux_to_bsd_msghdr(struct msghdr *bhdr, const struct l_msghdr *lhdr) { @@ -477,6 +475,24 @@ bsd_to_linux_msghdr(const struct msghdr } static int +linux_set_socket_flags(struct thread *td, int s, int flags) +{ + int error; + + if (flags & LINUX_SOCK_NONBLOCK) { + error = kern_fcntl(td, s, F_SETFL, O_NONBLOCK); + if (error) + return (error); + } + if (flags & LINUX_SOCK_CLOEXEC) { + error = kern_fcntl(td, s, F_SETFD, FD_CLOEXEC); + if (error) + return (error); + } + return (0); +} + +static int linux_sendit(struct thread *td, int s, struct msghdr *mp, int flags, struct mbuf *control, enum uio_seg segflg) { @@ -610,21 +626,11 @@ linux_socket(struct thread *td, struct l if (retval_socket) return (retval_socket); - if (socket_flags & LINUX_SOCK_NONBLOCK) { - retval_socket = kern_fcntl(td, td->td_retval[0], - F_SETFL, O_NONBLOCK); - if (retval_socket) { - (void)kern_close(td, td->td_retval[0]); - goto out; - } - } - if (socket_flags & LINUX_SOCK_CLOEXEC) { - retval_socket = kern_fcntl(td, td->td_retval[0], - F_SETFD, FD_CLOEXEC); - if (retval_socket) { - (void)kern_close(td, td->td_retval[0]); - goto out; - } + retval_socket = linux_set_socket_flags(td, td->td_retval[0], + socket_flags); + if (retval_socket) { + (void)kern_close(td, td->td_retval[0]); + goto out; } if (bsd_args.type == SOCK_RAW @@ -878,12 +884,20 @@ linux_socketpair(struct thread *td, stru int protocol; int *rsv; } */ bsd_args; + int error, socket_flags; + int sv[2]; bsd_args.domain = linux_to_bsd_domain(args->domain); if (bsd_args.domain != PF_LOCAL) return (EAFNOSUPPORT); - bsd_args.type = args->type; + socket_flags = args->type & ~LINUX_SOCK_TYPE_MASK; + if (socket_flags & ~(LINUX_SOCK_CLOEXEC | LINUX_SOCK_NONBLOCK)) + return (EINVAL); + bsd_args.type = args->type & LINUX_SOCK_TYPE_MASK; + if (bsd_args.type < 0 || bsd_args.type > LINUX_SOCK_MAX) + return (EINVAL); + if (args->protocol != 0 && args->protocol != PF_UNIX) /* @@ -896,7 +910,25 @@ linux_socketpair(struct thread *td, stru else bsd_args.protocol = 0; bsd_args.rsv = (int *)PTRIN(args->rsv); - return (socketpair(td, &bsd_args)); + error = kern_socketpair(td, bsd_args.domain, bsd_args.type, + bsd_args.protocol, sv); + if (error) + return (error); + error = linux_set_socket_flags(td, sv[0], socket_flags); + if (error) + goto out; + error = linux_set_socket_flags(td, sv[1], socket_flags); + if (error) + goto out; + + error = copyout(sv, bsd_args.rsv, 2 * sizeof(int)); + +out: + if (error) { + (void)kern_close(td, sv[0]); + (void)kern_close(td, sv[1]); + } + return (error); } struct linux_send_args { Modified: projects/pnet/sys/compat/ndis/subr_usbd.c ============================================================================== --- projects/pnet/sys/compat/ndis/subr_usbd.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/compat/ndis/subr_usbd.c Mon Jun 1 12:29:27 2009 (r193227) @@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$"); #include <dev/if_ndis/if_ndisvar.h> static driver_object usbd_driver; -static usb2_callback_t usbd_non_isoc_callback; -static usb2_callback_t usbd_ctrl_callback; +static usb_callback_t usbd_non_isoc_callback; +static usb_callback_t usbd_ctrl_callback; #define USBD_CTRL_READ_PIPE 0 #define USBD_CTRL_WRITE_PIPE 1 @@ -114,10 +114,10 @@ static int32_t usbd_func_bulkintr(irp static int32_t usbd_func_vendorclass(irp *); static int32_t usbd_func_selconf(irp *); static int32_t usbd_func_abort_pipe(irp *); -static usb2_error_t usbd_setup_endpoint(irp *, uint8_t, +static usb_error_t usbd_setup_endpoint(irp *, uint8_t, struct usb_endpoint_descriptor *); -static usb2_error_t usbd_setup_endpoint_default(irp *, uint8_t); -static usb2_error_t usbd_setup_endpoint_one(irp *, uint8_t, +static usb_error_t usbd_setup_endpoint_default(irp *, uint8_t); +static usb_error_t usbd_setup_endpoint_one(irp *, uint8_t, struct ndisusb_ep *, struct usb_config *); static int32_t usbd_func_getdesc(irp *); static union usbd_urb *usbd_geturb(irp *); @@ -353,7 +353,7 @@ usbd_urb2nt(status) return (STATUS_FAILURE); } -/* Convert FreeBSD's usb2_error_t to USBD_STATUS */ +/* Convert FreeBSD's usb_error_t to USBD_STATUS */ static int32_t usbd_usb2urb(int status) { @@ -463,7 +463,7 @@ usbd_func_getdesc(ip) uint32_t len; union usbd_urb *urb; usb_config_descriptor_t *cdp; - usb2_error_t status; + usb_error_t status; urb = usbd_geturb(ip); ctldesc = &urb->uu_ctldesc; @@ -527,7 +527,7 @@ usbd_func_selconf(ip) union usbd_urb *urb; usb_config_descriptor_t *conf; usb_endpoint_descriptor_t *edesc; - usb2_error_t ret; + usb_error_t ret; urb = usbd_geturb(ip); @@ -592,7 +592,7 @@ usbd_func_selconf(ip) return USBD_STATUS_SUCCESS; } -static usb2_error_t +static usb_error_t usbd_setup_endpoint_one(ip, ifidx, ne, epconf) irp *ip; uint8_t ifidx; @@ -602,7 +602,7 @@ usbd_setup_endpoint_one(ip, ifidx, ne, e device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); struct usb_xfer *xfer; - usb2_error_t status; + usb_error_t status; InitializeListHead(&ne->ne_active); InitializeListHead(&ne->ne_pending); @@ -621,14 +621,14 @@ usbd_setup_endpoint_one(ip, ifidx, ne, e return (status); } -static usb2_error_t +static usb_error_t usbd_setup_endpoint_default(ip, ifidx) irp *ip; uint8_t ifidx; { device_t dev = IRP_NDIS_DEV(ip); struct ndis_softc *sc = device_get_softc(dev); - usb2_error_t status; + usb_error_t status; if (ifidx > 0) device_printf(dev, "warning: ifidx > 0 isn't supported.\n"); @@ -643,7 +643,7 @@ usbd_setup_endpoint_default(ip, ifidx) return (status); } -static usb2_error_t +static usb_error_t usbd_setup_endpoint(ip, ifidx, ep) irp *ip; uint8_t ifidx; @@ -654,7 +654,7 @@ usbd_setup_endpoint(ip, ifidx, ep) struct ndisusb_ep *ne; struct usb_config cfg; struct usb_xfer *xfer; - usb2_error_t status; + usb_error_t status; /* check for non-supported transfer types */ if (UE_GET_XFERTYPE(ep->bmAttributes) == UE_CONTROL || @@ -810,7 +810,7 @@ usbd_irpcancel(dobj, ip) static void usbd_xfer_complete(struct ndis_softc *sc, struct ndisusb_ep *ne, - struct ndisusb_xfer *nx, usb2_error_t status) + struct ndisusb_xfer *nx, usb_error_t status) { struct ndisusb_xferdone *nd; uint8_t irql; @@ -1122,7 +1122,7 @@ usbd_xfertask(dobj, arg) struct usbd_urb_bulk_or_intr_transfer *ubi; struct usbd_urb_vendor_or_class_request *vcreq; union usbd_urb *urb; - usb2_error_t status; + usb_error_t status; void *priv; dev = sc->ndis_dev; Modified: projects/pnet/sys/compat/svr4/svr4_stat.c ============================================================================== --- projects/pnet/sys/compat/svr4/svr4_stat.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/compat/svr4/svr4_stat.c Mon Jun 1 12:29:27 2009 (r193227) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/sysproto.h> #include <sys/un.h> -#include <sys/vimage.h> #include <vm/vm.h> @@ -386,7 +385,7 @@ svr4_ustat(td, uap) return 0; } -/*extern char ostype[], hostname[], osrelease[], version[], machine[];*/ +/*extern char ostype[], osrelease[], version[], machine[];*/ int svr4_sys_uname(td, uap) @@ -412,15 +411,12 @@ svr4_sys_systeminfo(td, uap) struct thread *td; struct svr4_sys_systeminfo_args *uap; { - INIT_VPROCG(TD_TO_VPROCG(td)); + struct prison *pr; char *str = NULL; int error = 0; register_t *retval = td->td_retval; size_t len = 0; - char buf[11]; /* XXX NetBSD uses 256, but we use 11 - here as that seems like awfully - excessive kstack usage for hostid - string... */ + char buf[MAXHOSTNAMELEN]; u_int rlen = uap->len; switch (uap->what) { @@ -429,7 +425,8 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_HOSTNAME: - str = V_hostname; + getcredhostname(td->td_ucred, buf, sizeof(buf)); + str = buf; break; case SVR4_SI_RELEASE: @@ -461,7 +458,10 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_HW_SERIAL: - snprintf(buf, sizeof(buf), "%lu", hostid); + pr = td->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + snprintf(buf, sizeof(buf), "%lu", pr->pr_hostid); + mtx_unlock(&pr->pr_mtx); str = buf; break; @@ -470,8 +470,11 @@ svr4_sys_systeminfo(td, uap) break; case SVR4_SI_SRPC_DOMAIN: - /* XXXRW: locking? */ - str = V_domainname; + pr = td->td_ucred->cr_prison; + mtx_lock(&pr->pr_mtx); + strlcpy(buf, pr->pr_domain, sizeof(buf)); + mtx_unlock(&pr->pr_mtx); + str = buf; break; case SVR4_SI_PLATFORM: Modified: projects/pnet/sys/conf/NOTES ============================================================================== --- projects/pnet/sys/conf/NOTES Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/conf/NOTES Mon Jun 1 12:29:27 2009 (r193227) @@ -639,14 +639,6 @@ options ALTQ_PRIQ # Priority Queueing options ALTQ_NOPCC # Required if the TSC is unusable options ALTQ_DEBUG -# IP optional behaviour. -# IP_NONLOCALBIND disables the check that bind() usually makes that the -# address is one that is assigned to an interface on this machine. -# It allows transparent proxies to pretend to be other machines. -# How the packet GET to that machine is a problem solved elsewhere, -# smart routers, ipfw fwd, etc. -options IP_NONLOCALBIND # Allow impersonation for proxies. - # netgraph(4). Enable the base netgraph code with the NETGRAPH option. # Individual node types can be enabled with the corresponding option # listed below; however, this is not strictly necessary as netgraph Modified: projects/pnet/sys/conf/files.i386 ============================================================================== --- projects/pnet/sys/conf/files.i386 Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/conf/files.i386 Mon Jun 1 12:29:27 2009 (r193227) @@ -327,6 +327,7 @@ i386/isa/atpic.c optional atpic #i386/isa/atpic_vector.s standard i386/isa/clock.c optional native i386/xen/clock.c optional xen +i386/xen/xen_clock_util.c optional xen i386/xen/xen_rtc.c optional xen i386/isa/dpms.c optional dpms i386/isa/elcr.c standard Modified: projects/pnet/sys/conf/files.powerpc ============================================================================== --- projects/pnet/sys/conf/files.powerpc Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/conf/files.powerpc Mon Jun 1 12:29:27 2009 (r193227) @@ -97,6 +97,7 @@ powerpc/booke/pmap.c optional e500 powerpc/booke/swtch.S optional e500 powerpc/booke/trap.c optional e500 powerpc/booke/vm_machdep.c optional e500 +powerpc/cpufreq/dfs.c optional cpufreq powerpc/fpu/fpu_add.c optional fpu_emu powerpc/fpu/fpu_compare.c optional fpu_emu powerpc/fpu/fpu_div.c optional fpu_emu @@ -114,6 +115,7 @@ powerpc/mpc85xx/nexus.c optional mpc85x powerpc/mpc85xx/ocpbus.c optional mpc85xx powerpc/mpc85xx/opic.c optional mpc85xx powerpc/mpc85xx/pci_ocp.c optional pci mpc85xx +powerpc/ofw/ofw_cpu.c optional aim powerpc/ofw/ofw_pcibus.c optional pci aim powerpc/ofw/ofw_pcib_pci.c optional pci aim powerpc/ofw/ofw_real.c optional aim @@ -133,6 +135,7 @@ powerpc/powermac/cuda.c optional powerm powerpc/powermac/pmu.c optional powermac pmu powerpc/powermac/macgpio.c optional powermac pci powerpc/powermac/cpcht.c optional powermac pci +powerpc/powermac/vcoregpio.c optional powermac powerpc/powerpc/altivec.c optional aim powerpc/powerpc/atomic.S standard powerpc/powerpc/autoconf.c standard Modified: projects/pnet/sys/conf/options ============================================================================== --- projects/pnet/sys/conf/options Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/conf/options Mon Jun 1 12:29:27 2009 (r193227) @@ -400,7 +400,6 @@ IPFIREWALL_VERBOSE opt_ipfw.h IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h IPSEC opt_ipsec.h IPSEC_DEBUG opt_ipsec.h -IP_NONLOCALBIND opt_inet.h IPSEC_FILTERTUNNEL opt_ipsec.h IPSTEALTH IPX Modified: projects/pnet/sys/ddb/db_textdump.c ============================================================================== --- projects/pnet/sys/ddb/db_textdump.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/ddb/db_textdump.c Mon Jun 1 12:29:27 2009 (r193227) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include <sys/msgbuf.h> #include <sys/sysctl.h> #include <sys/systm.h> -#include <sys/vimage.h> #include <ddb/ddb.h> #include <ddb/db_lex.h> Modified: projects/pnet/sys/dev/ata/ata-usb.c ============================================================================== --- projects/pnet/sys/dev/ata/ata-usb.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/dev/ata/ata-usb.c Mon Jun 1 12:29:27 2009 (r193227) @@ -132,16 +132,16 @@ static device_probe_t atausb2_probe; static device_attach_t atausb2_attach; static device_detach_t atausb2_detach; -static usb2_callback_t atausb2_t_bbb_reset1_callback; -static usb2_callback_t atausb2_t_bbb_reset2_callback; -static usb2_callback_t atausb2_t_bbb_reset3_callback; -static usb2_callback_t atausb2_t_bbb_command_callback; -static usb2_callback_t atausb2_t_bbb_data_read_callback; -static usb2_callback_t atausb2_t_bbb_data_rd_cs_callback; -static usb2_callback_t atausb2_t_bbb_data_write_callback; -static usb2_callback_t atausb2_t_bbb_data_wr_cs_callback; -static usb2_callback_t atausb2_t_bbb_status_callback; -static usb2_callback_t atausb2_tr_error; +static usb_callback_t atausb2_t_bbb_reset1_callback; +static usb_callback_t atausb2_t_bbb_reset2_callback; +static usb_callback_t atausb2_t_bbb_reset3_callback; +static usb_callback_t atausb2_t_bbb_command_callback; +static usb_callback_t atausb2_t_bbb_data_read_callback; +static usb_callback_t atausb2_t_bbb_data_rd_cs_callback; +static usb_callback_t atausb2_t_bbb_data_write_callback; +static usb_callback_t atausb2_t_bbb_data_wr_cs_callback; +static usb_callback_t atausb2_t_bbb_status_callback; +static usb_callback_t atausb2_tr_error; static void atausb2_cancel_request(struct atausb2_softc *sc); static void atausb2_transfer_start(struct atausb2_softc *sc, uint8_t xfer_no); Modified: projects/pnet/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- projects/pnet/sys/dev/ata/chipsets/ata-intel.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/dev/ata/chipsets/ata-intel.c Mon Jun 1 12:29:27 2009 (r193227) @@ -104,9 +104,9 @@ ata_intel_probe(device_t dev) { ATA_I82801GB_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GBM_S1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, - { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, - { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7M" }, + { ATA_I82801GBM_S1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, { ATA_I63XXESB2, 0, 0, 1, ATA_UDMA5, "63XXESB2" }, { ATA_I63XXESB2_S1, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, { ATA_I63XXESB2_S2, 0, INTEL_AHCI, 0, ATA_SA300, "63XXESB2" }, Modified: projects/pnet/sys/dev/bge/if_bge.c ============================================================================== --- projects/pnet/sys/dev/bge/if_bge.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/dev/bge/if_bge.c Mon Jun 1 12:29:27 2009 (r193227) @@ -332,7 +332,7 @@ static int bge_get_eaddr_eeprom(struct b static int bge_get_eaddr(struct bge_softc *, uint8_t[]); static void bge_txeof(struct bge_softc *); -static void bge_rxeof(struct bge_softc *); +static int bge_rxeof(struct bge_softc *); static void bge_asf_driver_up (struct bge_softc *); static void bge_tick(void *); @@ -390,7 +390,7 @@ static int bge_miibus_readreg(device_t, static int bge_miibus_writereg(device_t, int, int, int); static void bge_miibus_statchg(device_t); #ifdef DEVICE_POLLING -static void bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); +static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count); #endif #define BGE_RESET_START 1 @@ -3050,18 +3050,18 @@ bge_reset(struct bge_softc *sc) * 2) the frame is from the standard receive ring */ -static void +static int bge_rxeof(struct bge_softc *sc) { struct ifnet *ifp; - int stdcnt = 0, jumbocnt = 0; + int rx_npkts = 0, stdcnt = 0, jumbocnt = 0; BGE_LOCK_ASSERT(sc); /* Nothing to do. */ if (sc->bge_rx_saved_considx == sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) - return; + return (rx_npkts); ifp = sc->bge_ifp; @@ -3193,9 +3193,10 @@ bge_rxeof(struct bge_softc *sc) BGE_UNLOCK(sc); (*ifp->if_input)(ifp, m); BGE_LOCK(sc); + rx_npkts++; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) - return; + return (rx_npkts); } if (stdcnt > 0) @@ -3219,6 +3220,7 @@ bge_rxeof(struct bge_softc *sc) if (BGE_IS_5705_PLUS(sc)) ifp->if_ierrors += CSR_READ_4(sc, BGE_RXLP_LOCSTAT_IFIN_DROPS); #endif + return (rx_npkts); } static void @@ -3271,16 +3273,17 @@ bge_txeof(struct bge_softc *sc) } #ifdef DEVICE_POLLING -static void +static int bge_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct bge_softc *sc = ifp->if_softc; uint32_t statusword; - + int rx_npkts = 0; + BGE_LOCK(sc); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { BGE_UNLOCK(sc); - return; + return (rx_npkts); } bus_dmamap_sync(sc->bge_cdata.bge_status_tag, @@ -3303,16 +3306,17 @@ bge_poll(struct ifnet *ifp, enum poll_cm bge_link_upd(sc); sc->rxcycles = count; - bge_rxeof(sc); + rx_npkts = bge_rxeof(sc); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { BGE_UNLOCK(sc); - return; + return (rx_npkts); } bge_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) bge_start_locked(ifp); BGE_UNLOCK(sc); + return (rx_npkts); } #endif /* DEVICE_POLLING */ Modified: projects/pnet/sys/dev/bwi/if_bwi.c ============================================================================== --- projects/pnet/sys/dev/bwi/if_bwi.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/dev/bwi/if_bwi.c Mon Jun 1 12:29:27 2009 (r193227) @@ -3126,6 +3126,7 @@ bwi_encap_raw(struct bwi_softc *sc, int { struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; + struct ieee80211com *ic = ni->ni_ic; struct bwi_ring_data *rd = &sc->sc_tx_rdata[BWI_TX_DATA_RING]; struct bwi_txbuf_data *tbd = &sc->sc_tx_bdata[BWI_TX_DATA_RING]; struct bwi_txbuf *tb = &tbd->tbd_buf[idx]; @@ -3152,8 +3153,20 @@ bwi_encap_raw(struct bwi_softc *sc, int * Find TX rate */ rate = params->ibp_rate0; - rate_fb = (params->ibp_try1 != 0) ? - params->ibp_rate1 : params->ibp_rate0; + if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + /* XXX fall back to mcast/mgmt rate? */ + m_freem(m); + return EINVAL; + } + if (params->ibp_try1 != 0) { + rate_fb = params->ibp_rate1; + if (!ieee80211_isratevalid(ic->ic_rt, rate_fb)) { + /* XXX fall back to rate0? */ + m_freem(m); + return EINVAL; + } + } else + rate_fb = rate; tb->tb_rate[0] = rate; tb->tb_rate[1] = rate_fb; sc->sc_tx_rate = rate; Modified: projects/pnet/sys/dev/dc/if_dc.c ============================================================================== --- projects/pnet/sys/dev/dc/if_dc.c Mon Jun 1 12:18:51 2009 (r193226) +++ projects/pnet/sys/dev/dc/if_dc.c Mon Jun 1 12:29:27 2009 (r193227) @@ -236,7 +236,7 @@ static int dc_newbuf(struct dc_softc *, static int dc_encap(struct dc_softc *, struct mbuf **); static void dc_pnic_rx_bug_war(struct dc_softc *, int); static int dc_rx_resync(struct dc_softc *); -static void dc_rxeof(struct dc_softc *); +static int dc_rxeof(struct dc_softc *); static void dc_txeof(struct dc_softc *); static void dc_tick(void *); static void dc_tx_underrun(struct dc_softc *); @@ -2640,19 +2640,21 @@ dc_rx_resync(struct dc_softc *sc) * A frame has been uploaded: pass the resulting mbuf chain up to * the higher level protocols. */ -static void +static int dc_rxeof(struct dc_softc *sc) { struct mbuf *m, *m0; struct ifnet *ifp; struct dc_desc *cur_rx; - int i, total_len = 0; + int i, total_len, rx_npkts; u_int32_t rxstat; DC_LOCK_ASSERT(sc); ifp = sc->dc_ifp; i = sc->dc_cdata.dc_rx_prod; + total_len = 0; + rx_npkts = 0; bus_dmamap_sync(sc->dc_ltag, sc->dc_lmap, BUS_DMASYNC_POSTREAD); while (!(le32toh(sc->dc_ldata->dc_rx_list[i].dc_status) & @@ -2706,7 +2708,7 @@ dc_rxeof(struct dc_softc *sc) continue; } else { dc_init_locked(sc); - return; + return (rx_npkts); } } } @@ -2745,9 +2747,11 @@ dc_rxeof(struct dc_softc *sc) DC_UNLOCK(sc); (*ifp->if_input)(ifp, m); DC_LOCK(sc); + rx_npkts++; } sc->dc_cdata.dc_rx_prod = i; + return (rx_npkts); } /* @@ -2989,20 +2993,21 @@ dc_tx_underrun(struct dc_softc *sc) #ifdef DEVICE_POLLING static poll_handler_t dc_poll; -static void +static int dc_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct dc_softc *sc = ifp->if_softc; + int rx_npkts = 0; DC_LOCK(sc); if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { DC_UNLOCK(sc); - return; + return (rx_npkts); } sc->rxcycles = count; - dc_rxeof(sc); + rx_npkts = dc_rxeof(sc); dc_txeof(sc); if (!IFQ_IS_EMPTY(&ifp->if_snd) && !(ifp->if_drv_flags & IFF_DRV_OACTIVE)) @@ -3017,7 +3022,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd DC_ISR_BUS_ERR); if (!status) { DC_UNLOCK(sc); - return; + return (rx_npkts); } /* ack what we have */ CSR_WRITE_4(sc, DC_ISR, status); @@ -3043,6 +3048,7 @@ dc_poll(struct ifnet *ifp, enum poll_cmd } } DC_UNLOCK(sc); + return (rx_npkts); } #endif /* DEVICE_POLLING */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906011229.n51CTSDT078764>