From owner-p4-projects@FreeBSD.ORG Sat Dec 1 02:39:04 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2DECC16A52A; Sat, 1 Dec 2007 02:39:03 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4FDF16A469 for ; Sat, 1 Dec 2007 02:39:02 +0000 (UTC) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B0F4A13C478 for ; Sat, 1 Dec 2007 02:39:02 +0000 (UTC) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lB12d252046382 for ; Sat, 1 Dec 2007 02:39:02 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lB12d2Tx046379 for perforce@freebsd.org; Sat, 1 Dec 2007 02:39:02 GMT (envelope-from peter@freebsd.org) Date: Sat, 1 Dec 2007 02:39:02 GMT Message-Id: <200712010239.lB12d2Tx046379@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 129862 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2007 02:39:04 -0000 http://perforce.freebsd.org/chv.cgi?CH=129862 Change 129862 by peter@peter_overcee on 2007/12/01 02:38:55 IFC @129859 Affected files ... .. //depot/projects/hammer/sys/conf/options.amd64#45 integrate .. //depot/projects/hammer/sys/conf/options.i386#50 integrate .. //depot/projects/hammer/sys/dev/sio/sio_isa.c#9 integrate .. //depot/projects/hammer/sys/dev/sio/sio_puc.c#9 integrate .. //depot/projects/hammer/sys/kern/kern_sysctl.c#34 integrate .. //depot/projects/hammer/sys/kern/subr_bus.c#55 integrate .. //depot/projects/hammer/sys/netgraph/ng_cisco.c#11 integrate .. //depot/projects/hammer/sys/netinet/tcp_output.c#48 integrate .. //depot/projects/hammer/sys/netinet/tcp_syncache.c#53 integrate .. //depot/projects/hammer/sys/sparc64/pci/ofw_pcibus.c#17 integrate .. //depot/projects/hammer/sys/sparc64/pci/psycho.c#36 integrate .. //depot/projects/hammer/sys/sparc64/pci/psychovar.h#13 integrate .. //depot/projects/hammer/sys/sys/sysctl.h#36 integrate Differences ... ==== //depot/projects/hammer/sys/conf/options.amd64#45 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.amd64,v 1.29 2007/07/04 00:18:38 bz Exp $ +# $FreeBSD: src/sys/conf/options.amd64,v 1.30 2007/11/30 21:45:06 peter Exp $ # Options specific to AMD64 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -30,6 +30,7 @@ COM_MULTIPORT opt_sio.h CONSPEED opt_sio.h GDBSPEED opt_sio.h +COM_NO_ACPI opt_sio.h VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h ==== //depot/projects/hammer/sys/conf/options.i386#50 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/options.i386,v 1.238 2007/07/04 00:18:38 bz Exp $ +# $FreeBSD: src/sys/conf/options.i386,v 1.239 2007/11/30 21:45:06 peter Exp $ # Options specific to the i386 platform kernels AUTO_EOI_1 opt_auto_eoi.h @@ -80,6 +80,7 @@ COM_MULTIPORT opt_sio.h CONSPEED opt_sio.h GDBSPEED opt_sio.h +COM_NO_ACPI opt_sio.h VGA_ALT_SEQACCESS opt_vga.h VGA_DEBUG opt_vga.h ==== //depot/projects/hammer/sys/dev/sio/sio_isa.c#9 (text+ko) ==== @@ -23,7 +23,9 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sio/sio_isa.c,v 1.16 2005/05/29 04:42:25 nyan Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sio/sio_isa.c,v 1.17 2007/11/30 21:45:07 peter Exp $"); + +#include "opt_sio.h" #include #include @@ -167,4 +169,6 @@ } DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0); -/* DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0); */ +#ifndef COM_NO_ACPI +DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0); +#endif ==== //depot/projects/hammer/sys/dev/sio/sio_puc.c#9 (text+ko) ==== @@ -24,7 +24,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/dev/sio/sio_puc.c,v 1.10 2006/04/28 21:21:52 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/sio/sio_puc.c,v 1.11 2007/11/30 21:36:12 peter Exp $"); #include #include ==== //depot/projects/hammer/sys/kern/kern_sysctl.c#34 (text+ko) ==== @@ -36,7 +36,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/kern_sysctl.c,v 1.178 2007/10/24 19:03:54 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_sysctl.c,v 1.179 2007/11/30 21:29:08 peter Exp $"); #include "opt_compat.h" #include "opt_mac.h" ==== //depot/projects/hammer/sys/kern/subr_bus.c#55 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.201 2007/07/27 11:59:56 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/subr_bus.c,v 1.202 2007/11/30 21:30:14 peter Exp $"); #include "opt_bus.h" ==== //depot/projects/hammer/sys/netgraph/ng_cisco.c#11 (text+ko) ==== @@ -37,7 +37,7 @@ * * Author: Julian Elischer * - * $FreeBSD: src/sys/netgraph/ng_cisco.c,v 1.28 2005/04/13 14:03:28 glebius Exp $ + * $FreeBSD: src/sys/netgraph/ng_cisco.c,v 1.29 2007/11/30 23:27:39 julian Exp $ * $Whistle: ng_cisco.c,v 1.25 1999/11/01 09:24:51 julian Exp $ */ @@ -228,6 +228,9 @@ } else if (strcmp(name, NG_CISCO_HOOK_INET) == 0) { sc->inet.hook = hook; NG_HOOK_SET_PRIVATE(hook, &sc->inet); + } else if (strcmp(name, NG_CISCO_HOOK_INET6) == 0) { + sc->inet6.hook = hook; + NG_HOOK_SET_PRIVATE(hook, &sc->inet6); } else if (strcmp(name, NG_CISCO_HOOK_APPLETALK) == 0) { sc->atalk.hook = hook; NG_HOOK_SET_PRIVATE(hook, &sc->atalk); ==== //depot/projects/hammer/sys/netinet/tcp_output.c#48 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/tcp_output.c,v 1.144 2007/11/28 13:33:27 bz Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/tcp_output.c,v 1.145 2007/11/30 23:46:51 bz Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -128,9 +128,6 @@ struct socket *so = tp->t_inpcb->inp_socket; long len, recwin, sendwin; int off, flags, error; -#ifdef TCP_SIGNATURE - int sigoff = 0; -#endif struct mbuf *m; struct ip *ip = NULL; struct ipovly *ipov = NULL; @@ -694,10 +691,6 @@ /* Processing the options. */ hdrlen += optlen = tcp_addoptions(&to, opt); - -#ifdef TCP_SIGNATURE - sigoff = to.to_signature - (u_char *)&to; -#endif /* TCP_SIGNATURE */ } #ifdef INET6 @@ -964,9 +957,11 @@ #ifdef INET6 if (!isipv6) #endif - if (tp->t_flags & TF_SIGNATURE) + if (tp->t_flags & TF_SIGNATURE) { + int sigoff = to.to_signature - opt; tcp_signature_compute(m, sizeof(struct ip), len, optlen, (u_char *)(th + 1) + sigoff, IPSEC_DIR_OUTBOUND); + } #endif /* ==== //depot/projects/hammer/sys/netinet/tcp_syncache.c#53 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/netinet/tcp_syncache.c,v 1.134 2007/11/20 06:56:04 silby Exp $"); +__FBSDID("$FreeBSD: src/sys/netinet/tcp_syncache.c,v 1.135 2007/11/30 23:41:51 bz Exp $"); #include "opt_inet.h" #include "opt_inet6.h" @@ -1349,15 +1349,16 @@ #endif optlen = tcp_addoptions(&to, (u_char *)(th + 1)); -#ifdef TCP_SIGNATURE - tcp_signature_compute(m, sizeof(struct ip), 0, optlen, - to.to_signature, IPSEC_DIR_OUTBOUND); -#endif - /* Adjust headers by option size. */ th->th_off = (sizeof(struct tcphdr) + optlen) >> 2; m->m_len += optlen; m->m_pkthdr.len += optlen; + +#ifdef TCP_SIGNATURE + if (sc->sc_flags & SCF_SIGNATURE) + tcp_signature_compute(m, sizeof(struct ip), 0, optlen, + to.to_signature, IPSEC_DIR_OUTBOUND); +#endif #ifdef INET6 if (sc->sc_inc.inc_isipv6) ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) + optlen); ==== //depot/projects/hammer/sys/sparc64/pci/ofw_pcibus.c#17 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/pci/ofw_pcibus.c,v 1.16 2007/09/30 11:05:17 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sparc64/pci/ofw_pcibus.c,v 1.17 2007/11/30 23:02:42 marius Exp $"); #include "opt_ofw_pci.h" @@ -189,6 +189,19 @@ domain, busno); node = ofw_bus_get_node(dev); + +#ifndef SUN4V + /* Add the PCI side of the HOST-PCI bridge itself to the bus. */ + if (strcmp(device_get_name(device_get_parent(pcib)), "nexus") == 0 && + (dinfo = (struct ofw_pcibus_devinfo *)pci_read_device(pcib, + domain, busno, 0, 0, sizeof(*dinfo))) != NULL) { + if (ofw_bus_gen_setup_devinfo(&dinfo->opd_obdinfo, node) != 0) + pci_freecfg((struct pci_devinfo *)dinfo); + else + pci_add_child(dev, (struct pci_devinfo *)dinfo); + } +#endif + for (child = OF_child(node); child != 0; child = OF_peer(child)) { if (OF_getprop(child, "reg", &pcir, sizeof(pcir)) == -1) continue; ==== //depot/projects/hammer/sys/sparc64/pci/psycho.c#36 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include -__FBSDID("$FreeBSD: src/sys/sparc64/pci/psycho.c,v 1.70 2007/09/30 11:05:17 marius Exp $"); +__FBSDID("$FreeBSD: src/sys/sparc64/pci/psycho.c,v 1.71 2007/11/30 23:02:42 marius Exp $"); /* * Support for `Hummingbird' (UltraSPARC IIe), `Psycho' and `Psycho+' @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -160,14 +161,10 @@ { 0, 0 } }; -static driver_t psycho_driver = { - "pcib", - psycho_methods, - sizeof(struct psycho_softc), -}; - static devclass_t psycho_devclass; +DEFINE_CLASS_0(pcib, psycho_driver, psycho_methods, + sizeof(struct psycho_softc)); DRIVER_MODULE(psycho, nexus, psycho_driver, psycho_devclass, 0, 0); static SLIST_HEAD(, psycho_softc) psycho_softcs = @@ -304,9 +301,9 @@ struct psycho_softc *asc, *sc, *osc; struct ofw_pci_ranges *range; const struct psycho_desc *desc; - phandle_t child, node; bus_addr_t intrclr, intrmap; uint64_t csr, dr; + phandle_t child, node; uint32_t dvmabase, psycho_br[2]; int32_t rev; u_int ver; @@ -676,6 +673,16 @@ PCIB_WRITE_CONFIG(dev, psycho_br[0], PCS_DEVICE, PCS_FUNC, PCSR_SECBUS, sc->sc_pci_secbus, 1); + for (n = PCIR_VENDOR; n < PCIR_STATUS; n += sizeof(uint16_t)) + le16enc(&sc->sc_pci_hpbcfg[n], bus_space_read_2( + sc->sc_pci_cfgt, sc->sc_pci_bh[OFW_PCI_CS_CONFIG], + PSYCHO_CONF_OFF(sc->sc_pci_secbus, PCS_DEVICE, + PCS_FUNC, n))); + for (n = PCIR_REVID; n <= PCIR_BIST; n += sizeof(uint8_t)) + sc->sc_pci_hpbcfg[n] = bus_space_read_1(sc->sc_pci_cfgt, + sc->sc_pci_bh[OFW_PCI_CS_CONFIG], PSYCHO_CONF_OFF( + sc->sc_pci_secbus, PCS_DEVICE, PCS_FUNC, n)); + ofw_bus_setup_iinfo(node, &sc->sc_pci_iinfo, sizeof(ofw_pci_intr_t)); /* * On E250 the interrupt map entry for the EBus bridge is wrong, @@ -924,13 +931,53 @@ u_long offset = 0; uint8_t byte; uint16_t shrt; - uint32_t wrd; - uint32_t r; + uint32_t r, wrd; int i; sc = device_get_softc(dev); + bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; + + /* + * The Hummingbird and Sabre bridges are picky in that they + * only allow their config space to be accessed using the + * "native" width of the respective register being accessed + * and return semi-random other content of their config space + * otherwise. Given that the PCI specs don't say anything + * about such a (unusual) limitation and lots of stuff expects + * to be able to access the contents of the config space at + * any width we allow just that. We do this by using a copy + * of the header of the bridge (the rest is all zero anyway) + * read during attach (expect for PCIR_STATUS) in order to + * simplify things. + * The Psycho bridges contain a dupe of their header at 0x80 + * which we nullify that way also. + */ + if (bus == sc->sc_pci_secbus && slot == PCS_DEVICE && + func == PCS_FUNC) { + if (offset % width != 0) + return (-1); + + if (reg > sizeof(sc->sc_pci_hpbcfg)) + return (0); + + if ((reg < PCIR_STATUS && reg + width > PCIR_STATUS) || + reg == PCIR_STATUS || reg == PCIR_STATUS + 1) + le16enc(&sc->sc_pci_hpbcfg[PCIR_STATUS], + bus_space_read_2(sc->sc_pci_cfgt, bh, + PSYCHO_CONF_OFF(sc->sc_pci_secbus, + PCS_DEVICE, PCS_FUNC, PCIR_STATUS))); + + switch (width) { + case 1: + return (sc->sc_pci_hpbcfg[reg]); + case 2: + return (le16dec(&sc->sc_pci_hpbcfg[reg])); + case 4: + return (le32dec(&sc->sc_pci_hpbcfg[reg])); + } + } + offset = PSYCHO_CONF_OFF(bus, slot, func, reg); - bh = sc->sc_pci_bh[OFW_PCI_CS_CONFIG]; switch (width) { case 1: i = bus_space_peek_1(sc->sc_pci_cfgt, bh, offset, &byte); @@ -1001,7 +1048,7 @@ /* * If this is outside of the range for an intpin, it's likely a full * INO, and no mapping is required at all; this happens on the U30, - * where there's no interrupt map at the Psycho node. Fortunately, + * where there's no interrupt map at the Psycho node. Fortunately, * there seem to be no INOs in the intpin range on this boxen, so * this easy heuristics will do. */ ==== //depot/projects/hammer/sys/sparc64/pci/psychovar.h#13 (text+ko) ==== @@ -27,7 +27,7 @@ * * from: NetBSD: psychovar.h,v 1.6 2001/07/20 00:07:13 eeh Exp * - * $FreeBSD: src/sys/sparc64/pci/psychovar.h,v 1.16 2007/06/16 23:46:41 marius Exp $ + * $FreeBSD: src/sys/sparc64/pci/psychovar.h,v 1.17 2007/11/30 23:02:42 marius Exp $ */ #ifndef _SPARC64_PCI_PSYCHOVAR_H_ @@ -43,17 +43,17 @@ struct mtx *sc_mtx; /* Interrupt Group Number for this device */ - int sc_ign; + uint32_t sc_ign; bus_addr_t sc_pcictl; phandle_t sc_node; /* Firmware node */ - int sc_mode; + u_int sc_mode; #define PSYCHO_MODE_SABRE 1 #define PSYCHO_MODE_PSYCHO 2 /* Bus A or B of a psycho pair? */ - int sc_half; + u_int sc_half; struct iommu_state *sc_is; @@ -77,6 +77,8 @@ struct rman sc_pci_mem_rman; struct rman sc_pci_io_rman; + uint8_t sc_pci_hpbcfg[16]; + SLIST_ENTRY(psycho_softc) sc_link; }; ==== //depot/projects/hammer/sys/sys/sysctl.h#36 (text+ko) ==== @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sysctl.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/sys/sys/sysctl.h,v 1.151 2007/10/16 11:46:44 ru Exp $ + * $FreeBSD: src/sys/sys/sysctl.h,v 1.152 2007/11/30 21:29:08 peter Exp $ */ #ifndef _SYS_SYSCTL_H_