? mydiffs ? arch/i386/compile/XTERM ? arch/i386/compile/ARMADA ? arch/i386/conf/XTERM ? arch/i386/conf/ARMADA ? arch/i386/conf/PW1100 ? arch/i386/pci/191 ? arch/i386/pci/188 ? arch/i386/stand/biosboot/lib ? arch/i386/stand/biosboot/vers.c ? arch/i386/stand/biosboot/biosboot.list ? arch/i386/stand/biosboot/biosboot.sym ? arch/i386/stand/biosboot_com0/lib ? arch/i386/stand/biosboot_com0/vers.c ? arch/i386/stand/biosboot_com0/biosboot_com0.list ? arch/i386/stand/biosboot_com0/biosboot_com0.sym ? dev/cardbus/rbus_ppb.c Index: arch/i386/i386/rbus_machdep.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/i386/rbus_machdep.c,v retrieving revision 1.7.2.1 diff -u -r1.7.2.1 rbus_machdep.c --- rbus_machdep.c 2000/10/20 17:29:13 1.7.2.1 +++ rbus_machdep.c 2001/06/12 23:13:55 @@ -184,14 +184,19 @@ struct extent *ex; bus_addr_t start; bus_size_t size; + rbus_tag_t ret; #ifdef PCIBIOS_ADDR_FIXUP ex = pciaddr.extent_port; #else extern struct extent *ioport_ex; ex = ioport_ex; #endif - start = 0x2000; - size = 0x1000; + start = 0x4000; + size = 0x2000; - return rbus_new_root_share(pa->pa_iot, ex, start, size, 0); + ret = rbus_new_root_share(pa->pa_iot, ex, start, size, 0); + if(ret == NULL) { + panic("failed to alloc I/O space"); + } + return ret; } Index: arch/i386/pci/pci_addr_fixup.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pci_addr_fixup.c,v retrieving revision 1.3.2.1 diff -u -r1.3.2.1 pci_addr_fixup.c --- pci_addr_fixup.c 2000/08/10 22:42:05 1.3.2.1 +++ pci_addr_fixup.c 2001/06/12 23:13:55 @@ -45,21 +45,17 @@ struct pciaddr pciaddr; -typedef int (*pciaddr_resource_manage_func_t) - (pci_chipset_tag_t, pcitag_t, int, struct extent *, int, - bus_addr_t *, bus_size_t); -void pciaddr_resource_manage __P((pci_chipset_tag_t, pcitag_t, - pciaddr_resource_manage_func_t)); -void pciaddr_resource_reserve __P((pci_chipset_tag_t, pcitag_t)); +void pciaddr_resource_reserve __P((pci_chipset_tag_t, pcitag_t, + void *context)); int pciaddr_do_resource_reserve __P((pci_chipset_tag_t, pcitag_t, int, - struct extent *, int, bus_addr_t *, + void *, int, bus_addr_t *, bus_size_t)); -void pciaddr_resource_allocate __P((pci_chipset_tag_t, pcitag_t)); +void pciaddr_resource_allocate __P((pci_chipset_tag_t, pcitag_t, + void *context)); int pciaddr_do_resource_allocate __P((pci_chipset_tag_t, pcitag_t, int, - struct extent *, int, bus_addr_t *, + void *, int, bus_addr_t *, bus_size_t)); -bus_addr_t pciaddr_ioaddr __P((u_int32_t)); -void pciaddr_print_devid __P((pci_chipset_tag_t, pcitag_t)); +int device_is_agp __P((pci_chipset_tag_t, pcitag_t)); #define PCIADDR_MEM_START 0x0 #define PCIADDR_MEM_END 0xffffffff @@ -113,7 +109,7 @@ * 1. check & reserve system BIOS setting. */ PCIBIOS_PRINTV((verbose_header, "System BIOS Setting")); - pci_device_foreach(pc, maxbus, pciaddr_resource_reserve); + pci_device_foreach(pc, maxbus, pciaddr_resource_reserve, NULL); PCIBIOS_PRINTV((verbose_footer, pciaddr.nbogus)); /* @@ -149,43 +145,48 @@ */ PCIBIOS_PRINTV((verbose_header, "PCIBIOS fixup stage")); pciaddr.nbogus = 0; - /* XXX bus #0 only. */ - pci_device_foreach(pc, 0, pciaddr_resource_allocate); + pci_device_foreach(pc, maxbus, pciaddr_resource_allocate, NULL); PCIBIOS_PRINTV((verbose_footer, pciaddr.nbogus)); } void -pciaddr_resource_reserve(pc, tag) +pciaddr_resource_reserve(pc, tag, context) pci_chipset_tag_t pc; pcitag_t tag; + void *context; { #ifdef PCIBIOSVERBOSE if (pcibiosverbose) pciaddr_print_devid(pc, tag); #endif - pciaddr_resource_manage(pc, tag, pciaddr_do_resource_reserve); + pciaddr_resource_manage(pc, tag, + pciaddr_do_resource_reserve, + &pciaddr); } void -pciaddr_resource_allocate(pc, tag) +pciaddr_resource_allocate(pc, tag, context) pci_chipset_tag_t pc; pcitag_t tag; + void *context; { #ifdef PCIBIOSVERBOSE if (pcibiosverbose) pciaddr_print_devid(pc, tag); #endif - pciaddr_resource_manage(pc, tag, pciaddr_do_resource_allocate); + pciaddr_resource_manage(pc, tag, + pciaddr_do_resource_allocate, + &pciaddr); } void -pciaddr_resource_manage(pc, tag, func) +pciaddr_resource_manage(pc, tag, func, ctx) pci_chipset_tag_t pc; pcitag_t tag; pciaddr_resource_manage_func_t func; + void *ctx; { - struct extent *ex; pcireg_t val, mask; bus_addr_t addr; bus_size_t size; @@ -237,10 +238,8 @@ width = 8; } size = PCI_MAPREG_MEM_SIZE(mask); - ex = pciaddr.extent_mem; } else { size = PCI_MAPREG_IO_SIZE(mask); - ex = pciaddr.extent_port; } addr = pciaddr_ioaddr(val); @@ -253,7 +252,7 @@ ++useport; /* reservation/allocation phase */ - error += (*func) (pc, tag, mapreg, ex, type, &addr, size); + error += (*func) (pc, tag, mapreg, ctx, type, &addr, size); PCIBIOS_PRINTV(("\n\t%02xh %s 0x%08x 0x%08x", mapreg, type ? "port" : "mem ", @@ -277,22 +276,32 @@ } int -pciaddr_do_resource_allocate(pc, tag, mapreg, ex, type, addr, size) +pciaddr_do_resource_allocate(pc, tag, mapreg, ctx, type, addr, size) pci_chipset_tag_t pc; pcitag_t tag; - struct extent *ex; + void *ctx; int mapreg, type; bus_addr_t *addr; bus_size_t size; { + struct pciaddr *pciaddrmap = (struct pciaddr *)ctx; bus_addr_t start; int error; - + struct extent *ex; + if (*addr) /* no need to allocate */ return (0); + + /* XXX Do not fixup AGP device */ + if (device_is_agp(pc, tag)) + return (0); + + ex = (type == PCI_MAPREG_TYPE_MEM ? + pciaddrmap->extent_mem : pciaddrmap->extent_port); - start = type == PCI_MAPREG_TYPE_MEM ? pciaddr.mem_alloc_start - : pciaddr.port_alloc_start; + start = (type == PCI_MAPREG_TYPE_MEM ? + pciaddrmap->mem_alloc_start : pciaddrmap->port_alloc_start); + if (start < ex->ex_start || start + size - 1 >= ex->ex_end) { PCIBIOS_PRINTV(("No available resources. fixup failed\n")); return (1); @@ -329,19 +338,24 @@ } int -pciaddr_do_resource_reserve(pc, tag, mapreg, ex, type, addr, size) +pciaddr_do_resource_reserve(pc, tag, mapreg, ctx, type, addr, size) pci_chipset_tag_t pc; pcitag_t tag; - struct extent *ex; + void *ctx; int type, mapreg; bus_addr_t *addr; bus_size_t size; { + struct extent *ex; + struct pciaddr *pciaddrmap = (struct pciaddr *)ctx; int error; if (*addr == 0) return (1); + ex = (type == PCI_MAPREG_TYPE_MEM ? + pciaddrmap->extent_mem : pciaddrmap->extent_port); + error = extent_alloc_region(ex, *addr, size, EX_NOWAIT| EX_MALLOCOK); if (error) { PCIBIOS_PRINTV(("Resource conflict.\n")); @@ -374,3 +388,30 @@ printf("%03d:%02d:%d 0x%04x 0x%04x ", bus, device, function, PCI_VENDOR(id), PCI_PRODUCT(id)); } + +int +device_is_agp(pc, tag) + pci_chipset_tag_t pc; + pcitag_t tag; +{ + pcireg_t class, status, rval; + int off; + + class = pci_conf_read(pc, tag, PCI_CLASS_REG); + if (PCI_CLASS(class) == PCI_CLASS_DISPLAY) { + status = pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG); + if (status & PCI_STATUS_CAPLIST_SUPPORT) { + rval = pci_conf_read(pc, tag, PCI_CAPLISTPTR_REG); + for (off = PCI_CAPLIST_PTR(rval); + off != 0; + off = PCI_CAPLIST_NEXT(rval) ) { + rval = pci_conf_read(pc, tag, off); + if (PCI_CAPLIST_CAP(rval) == PCI_CAP_AGP) { + return (1); + } + } + } + } + return (0); +} + Index: arch/i386/pci/pci_addr_fixup.h =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pci_addr_fixup.h,v retrieving revision 1.2 diff -u -r1.2 pci_addr_fixup.h --- pci_addr_fixup.h 2000/05/31 16:38:55 1.2 +++ pci_addr_fixup.h 2001/06/12 23:13:55 @@ -37,3 +37,17 @@ extern struct pciaddr pciaddr; void pci_addr_fixup __P((pci_chipset_tag_t, int)); + +/* for cardbus stuff */ +typedef int (*pciaddr_resource_manage_func_t) + (pci_chipset_tag_t, pcitag_t, int, void *, int, + bus_addr_t *, bus_size_t); + +void pciaddr_resource_manage __P((pci_chipset_tag_t, pcitag_t, + pciaddr_resource_manage_func_t, + void *)); + +void pciaddr_print_devid __P((pci_chipset_tag_t, pcitag_t)); + +bus_addr_t pciaddr_ioaddr __P((u_int32_t)); + Index: arch/i386/pci/pci_bus_fixup.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pci_bus_fixup.c,v retrieving revision 1.1 diff -u -r1.1 pci_bus_fixup.c --- pci_bus_fixup.c 1999/11/17 07:32:58 1.1 +++ pci_bus_fixup.c 2001/06/12 23:13:55 @@ -45,6 +45,12 @@ #include #include +/* this array lists the parent for each bus number */ +int pci_bus_parent[256]; + +/* this array lists the pcitag to program each bridge */ +pcitag_t pci_bus_tag[256]; + int pci_bus_fixup(pc, bus) pci_chipset_tag_t pc; @@ -97,6 +103,11 @@ if (PCI_VENDOR(reg) == 0) continue; +#ifdef PCIBIOSVERBOSE + printf("PCI fixup examining %02x:%02x\n", + PCI_VENDOR(reg), PCI_PRODUCT(reg)); +#endif + reg = pci_conf_read(pc, tag, PCI_CLASS_REG); if (PCI_CLASS(reg) == PCI_CLASS_BRIDGE && (PCI_SUBCLASS(reg) == PCI_SUBCLASS_BRIDGE_PCI || @@ -119,6 +130,11 @@ reg &= 0xff000000; reg |= bus | (bus_max << 8) | (bus_sub << 16); pci_conf_write(pc, tag, PPB_REG_BUSINFO, reg); + + /* record relationship */ + pci_bus_parent[bus_max]=bus; + + pci_bus_tag[bus_max]=tag; #ifdef PCIBIOSVERBOSE printf("PCI bridge %d: primary %d, " Index: arch/i386/pci/pci_bus_fixup.h =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pci_bus_fixup.h,v retrieving revision 1.1 diff -u -r1.1 pci_bus_fixup.h --- pci_bus_fixup.h 1999/11/17 07:32:58 1.1 +++ pci_bus_fixup.h 2001/06/12 23:13:55 @@ -26,3 +26,7 @@ */ int pci_bus_fixup __P((pci_chipset_tag_t, int)); + +extern int pci_bus_parent[256]; +extern pcitag_t pci_bus_tag[256]; + Index: arch/i386/pci/pci_intr_fixup.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pci_intr_fixup.c,v retrieving revision 1.5.6.3 diff -u -r1.5.6.3 pci_intr_fixup.c --- pci_intr_fixup.c 2001/06/07 15:46:56 1.5.6.3 +++ pci_intr_fixup.c 2001/06/12 23:13:55 @@ -116,7 +116,7 @@ int pciintr_link_route __P((u_int16_t *)); int pciintr_irq_release __P((u_int16_t *)); int pciintr_header_fixup __P((pci_chipset_tag_t)); -void pciintr_do_header_fixup __P((pci_chipset_tag_t, pcitag_t)); +void pciintr_do_header_fixup __P((pci_chipset_tag_t, pcitag_t, void*)); SIMPLEQ_HEAD(, pciintr_link_map) pciintr_link_map_list; @@ -579,16 +579,17 @@ PCIBIOS_PRINTV(("------------------------------------------\n")); PCIBIOS_PRINTV((" device vendor product pin PIRQ IRQ stage\n")); PCIBIOS_PRINTV(("------------------------------------------\n")); - pci_device_foreach(pc, pcibios_max_bus, pciintr_do_header_fixup); + pci_device_foreach(pc, pcibios_max_bus, pciintr_do_header_fixup, NULL); PCIBIOS_PRINTV(("------------------------------------------\n")); return (0); } void -pciintr_do_header_fixup(pc, tag) +pciintr_do_header_fixup(pc, tag, context) pci_chipset_tag_t pc; pcitag_t tag; + void *context; { struct pcibios_intr_routing *pir; struct pciintr_link_map *l; @@ -603,12 +604,14 @@ pin = PCI_INTERRUPT_PIN(intr); irq = PCI_INTERRUPT_LINE(intr); +#if 0 if (pin == 0) { /* * No interrupt used. */ return; } +#endif pir = pciintr_pir_lookup(bus, device); if (pir == NULL || (link = pir->linkmap[pin - 1].link) == 0) { Index: arch/i386/pci/pci_machdep.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pci_machdep.c,v retrieving revision 1.36.2.1 diff -u -r1.36.2.1 pci_machdep.c --- pci_machdep.c 2000/08/10 22:25:57 1.36.2.1 +++ pci_machdep.c 2001/06/12 23:13:55 @@ -499,7 +499,8 @@ * the BIOS has not configured the device. */ if (line == 0 || line == I386_PCI_INTERRUPT_LINE_NO_CONNECTION) { - printf("pci_intr_map: no mapping for pin %c\n", '@' + pin); + printf("pci_intr_map: no mapping for pin %c (line=%02x)\n", + '@' + pin, line); goto bad; } else { if (line >= ICU_LEN) { Index: arch/i386/pci/pcibios.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pcibios.c,v retrieving revision 1.3.6.1 diff -u -r1.3.6.1 pcibios.c --- pcibios.c 2000/08/10 22:42:04 1.3.6.1 +++ pcibios.c 2001/06/12 23:13:56 @@ -484,18 +484,30 @@ } #endif +void +pci_device_foreach(pc, maxbus, func, context) + pci_chipset_tag_t pc; + int maxbus; + void (*func) __P((pci_chipset_tag_t, pcitag_t, void *)); + void *context; +{ + pci_device_foreach_min(pc, 0, maxbus, func, context); +} + void -pci_device_foreach(pc, maxbus, func) +pci_device_foreach_min(pc, minbus, maxbus, func, context) pci_chipset_tag_t pc; + int minbus; int maxbus; - void (*func) __P((pci_chipset_tag_t, pcitag_t)); + void (*func) __P((pci_chipset_tag_t, pcitag_t, void *)); + void *context; { const struct pci_quirkdata *qd; int bus, device, function, maxdevs, nfuncs; pcireg_t id, bhlcr; pcitag_t tag; - for (bus = 0; bus <= maxbus; bus++) { + for (bus = minbus; bus <= maxbus; bus++) { maxdevs = pci_bus_maxdevs(pc, bus); for (device = 0; device < maxdevs; device++) { tag = pci_make_tag(pc, bus, device, 0); @@ -532,7 +544,7 @@ */ if (PCI_VENDOR(id) == 0) continue; - (*func)(pc, tag); + (*func)(pc, tag, context); } } } Index: arch/i386/pci/pcibios.h =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/pci/pcibios.h,v retrieving revision 1.2.6.1 diff -u -r1.2.6.1 pcibios.h --- pcibios.h 2000/08/10 22:42:04 1.2.6.1 +++ pcibios.h 2001/06/12 23:13:56 @@ -90,7 +90,12 @@ extern int pcibios_max_bus; void pci_device_foreach __P((pci_chipset_tag_t, int, - void (*) (pci_chipset_tag_t, pcitag_t))); + void (*) (pci_chipset_tag_t, pcitag_t, void*), + void *context)); + +void pci_device_foreach_min __P((pci_chipset_tag_t, int, int, + void (*) (pci_chipset_tag_t, pcitag_t, void*), + void *context)); #ifdef PCIBIOSVERBOSE extern int pcibiosverbose; Index: arch/i386/stand/biosboot/main.c =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/stand/biosboot/main.c,v retrieving revision 1.22.4.1 diff -u -r1.22.4.1 main.c --- main.c 2000/08/13 09:09:26 1.22.4.1 +++ main.c 2001/06/12 23:13:57 @@ -67,7 +67,9 @@ #define MAXDEVNAME 16 +#ifndef TIMEOUT #define TIMEOUT 5 +#endif int boottimeout = TIMEOUT; /* patchable */ static char *default_devname; @@ -255,15 +257,18 @@ "Press return to boot now, any other key for boot menu\n"); currname = 0; for (;;) { - printf("booting %s - starting in ", - sprint_bootsel(names[currname])); + if(boottimeout > 0) { + printf("booting %s - starting in ", + sprint_bootsel(names[currname])); - c = awaitkey(boottimeout, 1); - if ((c != '\r') && (c != '\n') && (c != '\0') + c = awaitkey(boottimeout, 1); + } + if (boottimeout == 0 || + ((c != '\r') && (c != '\n') && (c != '\0') #ifdef BOOTPASSWD && checkpasswd() #endif - ) { + )) { printf("type \"?\" or \"help\" for help.\n"); bootmenu(); /* does not return */ } Index: arch/i386/stand/biosboot_com0/Makefile =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/stand/biosboot_com0/Makefile,v retrieving revision 1.1 diff -u -r1.1 Makefile --- Makefile 1999/07/11 01:23:53 1.1 +++ Makefile 2001/06/12 23:13:57 @@ -1,5 +1,6 @@ # $NetBSD: Makefile,v 1.1 1999/07/11 01:23:53 kim Exp $ BASE= biosboot_com0 +CPPFLAGS+=-DTIMEOUT=0 .include "../biosboot/Makefile" Index: arch/i386/stand/biosboot_ser/Makefile =================================================================== RCS file: /cvsroot/syssrc/sys/arch/i386/stand/biosboot_ser/Makefile,v retrieving revision 1.5.2.1 diff -u -r1.5.2.1 Makefile --- Makefile 2001/04/01 16:30:03 1.5.2.1 +++ Makefile 2001/06/12 23:13:57 @@ -12,6 +12,7 @@ CLEANFILES+= ${BSSTART} +CPPFLAGS+= -DTIMEOUT=0 CPPFLAGS+= -DCOMPAT_OLDBOOT -DCOMPAT_386BSD_MBRPART -DDEBUG #Sample use of serial line debugger Index: dev/cardbus/cardbus.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/cardbus/cardbus.c,v retrieving revision 1.26 diff -u -r1.26 cardbus.c --- cardbus.c 2000/06/16 23:41:33 1.26 +++ cardbus.c 2001/06/12 23:14:20 @@ -506,6 +506,11 @@ ca.ca_memt = sc->sc_memt; ca.ca_dmat = sc->sc_dmat; +#if rbus + ca.ca_rbus_iot = sc->sc_rbus_iot; + ca.ca_rbus_memt= sc->sc_rbus_memt; +#endif + ca.ca_tag = tag; ca.ca_device = sc->sc_device; ca.ca_function = function; Index: dev/cardbus/files.cardbus =================================================================== RCS file: /cvsroot/syssrc/sys/dev/cardbus/files.cardbus,v retrieving revision 1.12 diff -u -r1.12 files.cardbus --- files.cardbus 2000/05/10 00:24:14 1.12 +++ files.cardbus 2001/06/12 23:14:20 @@ -58,3 +58,9 @@ attach rtk at cardbus with rtk_cardbus file dev/cardbus/if_rtk_cardbus.c rtk_cardbus +# +# PCI bridge +# +attach ppb at cardbus with rbus_ppb +file dev/cardbus/rbus_ppb.c rbus_ppb + Index: dev/cardbus/rbus.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/cardbus/rbus.c,v retrieving revision 1.8 diff -u -r1.8 rbus.c --- rbus.c 2000/05/30 09:18:06 1.8 +++ rbus.c 2001/06/12 23:14:21 @@ -123,15 +123,27 @@ } if (decodesize == align) { - if(extent_alloc_subregion(rbt->rb_ext, substart, - subend, size, align, 0, exflags, (u_long *)&result)) { + if(extent_alloc_subregion(rbt->rb_ext, + substart, + subend, + size, + align, + 0 /* skew */, + exflags, + (u_long *)&result)) { return 1; } } else if (decodesize == 0) { /* maybe, the resister is overflowed. */ - if (extent_alloc_subregion(rbt->rb_ext, addr, - addr + size, size, 0, 0, exflags, (u_long *)&result)) { + if (extent_alloc_subregion(rbt->rb_ext, + addr, + addr + size, + size, + 0 /* align */, + 0, + exflags, + (u_long *)&result)) { return 1; } } else { @@ -148,8 +160,13 @@ for (; search_addr + size <= subend; search_addr += boundary) { val = extent_alloc_subregion(rbt->rb_ext, - search_addr, search_addr + size, size, - align, 0, exflags, (u_long *)&result); + search_addr, + search_addr +size, + size, + align, + 0, + exflags, + (u_long *)&result); DPRINTF(("rbus: trying [%lx:%lx] %lx\n", search_addr, search_addr + size, align)); if (val == 0) { Index: dev/ic/rtl81x9.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/ic/rtl81x9.c,v retrieving revision 1.11.4.5 diff -u -r1.11.4.5 rtl81x9.c --- rtl81x9.c 2001/05/06 15:05:17 1.11.4.5 +++ rtl81x9.c 2001/06/12 23:14:21 @@ -1229,6 +1229,7 @@ struct ifnet *ifp; u_int16_t status; int handled = 0; + int maxloop; sc = arg; ifp = &sc->ethercom.ec_if; @@ -1236,8 +1237,10 @@ /* Disable interrupts. */ CSR_WRITE_2(sc, RTK_IMR, 0x0000); - for (;;) { + maxloop = 100; + while(maxloop--) { + status = CSR_READ_2(sc, RTK_ISR); if (status) CSR_WRITE_2(sc, RTK_ISR, status); @@ -1257,9 +1260,13 @@ rtk_txeof(sc); if (status & RTK_ISR_SYSTEM_ERR) { + printf("rtk status %04x reset/reinit\n", status); rtk_reset(sc); rtk_init(sc); } + } + if(maxloop == 0) { + printf("rtk status: %04x\n", status); } /* Re-enable interrupts. */ Index: dev/pci/if_rtk_pci.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/pci/if_rtk_pci.c,v retrieving revision 1.3.4.1 diff -u -r1.3.4.1 if_rtk_pci.c --- if_rtk_pci.c 2001/06/11 19:34:39 1.3.4.1 +++ if_rtk_pci.c 2001/06/12 23:14:23 @@ -283,7 +283,7 @@ #else if (pci_mapreg_map(pa, RTK_PCI_LOMEM, PCI_MAPREG_TYPE_MEM, 0, &sc->rtk_btag, &sc->rtk_bhandle, NULL, NULL)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + printf("%s: can't map mem space\n", sc->sc_dev.dv_xname); return; } #endif Index: dev/pci/pccbb.c =================================================================== RCS file: /cvsroot/syssrc/sys/dev/pci/pccbb.c,v retrieving revision 1.42.2.4 diff -u -r1.42.2.4 pccbb.c --- pccbb.c 2001/05/01 12:54:28 1.42.2.4 +++ pccbb.c 2001/06/12 23:14:23 @@ -416,6 +416,11 @@ #if rbus sc->sc_rbus_iot = rbus_pccbb_parent_io(pa); sc->sc_rbus_memt = rbus_pccbb_parent_mem(pa); + +#if 0 + printf("pa->pa_memt: %08x vs rbus_mem->rb_bt: %08x\n", + pa->pa_memt, sc->sc_rbus_memt->rb_bt); +#endif #endif /* rbus */ sc->sc_base_memh = 0; @@ -1646,6 +1651,29 @@ } +void +pccbb_intr_route(sc) + struct pccbb_softc *sc; +{ + pcireg_t reg; + + /* initialize bridge intr routing */ + reg = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_BCR_INTR); + reg &= ~CB_BCR_INTR_IREQ_ENABLE; + pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_BCR_INTR, reg); + + switch (sc->sc_chipset) { + case CB_TI113X: + reg = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_CBCTRL); + /* functional intr enabled */ + reg |= PCI113X_CBCTRL_PCI_INTR; + pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_CBCTRL, reg); + break; + default: + break; + } +} + /* * static void *pccbb_intr_establish(struct pccbb_softc *sc, * int irq, @@ -1667,26 +1695,12 @@ void *arg; { struct pccbb_intrhand_list *pil, *newpil; - pcireg_t reg; DPRINTF(("pccbb_intr_establish start. %p\n", sc->sc_pil)); if (sc->sc_pil == NULL) { - /* initialize bridge intr routing */ - reg = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_BCR_INTR); - reg &= ~CB_BCR_INTR_IREQ_ENABLE; - pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_BCR_INTR, reg); + pccbb_intr_route(sc); - switch (sc->sc_chipset) { - case CB_TI113X: - reg = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_CBCTRL); - /* functional intr enabled */ - reg |= PCI113X_CBCTRL_PCI_INTR; - pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_CBCTRL, reg); - break; - default: - break; - } } /* @@ -2845,8 +2859,8 @@ } else { DPRINTF( - ("pccbb_rbus_cb_space_alloc: Bus space tag %x is NOT used.\n", - rb->rb_bt)); + ("pccbb_rbus_cb_space_alloc: Bus space tag %x is NOT used. io: %d, mem: %d\n", + rb->rb_bt, sc->sc_iot, sc->sc_memt)); return 1; /* XXX: panic here? */ } Index: dev/pci/pccbbvar.h =================================================================== RCS file: /cvsroot/syssrc/sys/dev/pci/pccbbvar.h,v retrieving revision 1.13 diff -u -r1.13 pccbbvar.h --- pccbbvar.h 2000/06/08 10:28:29 1.13 +++ pccbbvar.h 2001/06/12 23:14:23 @@ -173,4 +173,7 @@ struct pccbb_intrhand_list *pil_next; }; +void pccbb_intr_route __P((struct pccbb_softc *sc)); + + #endif /* _DEV_PCI_PCCBBREG_H_ */ Index: dev/pci/ppbreg.h =================================================================== RCS file: /cvsroot/syssrc/sys/dev/pci/ppbreg.h,v retrieving revision 1.2 diff -u -r1.2 ppbreg.h --- ppbreg.h 1996/03/14 02:35:35 1.2 +++ ppbreg.h 2001/06/12 23:14:24 @@ -70,3 +70,21 @@ */ #define PPB_INTERRUPT_SWIZZLE(pin, device) \ ((((pin) + (device) - 1) % 4) + 1) + +/* + * secondary bus I/O base and limits + */ +#define PPB_IOBASE_SHIFT 0 +#define PPB_IOLIMIT_SHIFT 8 +#define PPB_IO_MASK 0xf000 +#define PPB_IO_MIN 4096 + +/* + * secondary bus memory base and limits + */ +#define PPB_MEMBASE_SHIFT 0 +#define PPB_MEMLIMIT_SHIFT 16 +#define PPB_MEM_MASK 0xfff00000 +#define PPB_MEM_SHIFT 16 +#define PPB_MEM_MIN 0x00100000 + Index: netinet/in.h =================================================================== RCS file: /cvsroot/syssrc/sys/netinet/in.h,v retrieving revision 1.47.4.2 diff -u -r1.47.4.2 in.h --- in.h 2001/04/24 22:21:35 1.47.4.2 +++ in.h 2001/06/12 23:14:31 @@ -348,7 +348,8 @@ #define IPCTL_LOWPORTMIN 16 /* minimum reserved port */ #define IPCTL_LOWPORTMAX 17 /* maximum reserved port */ #define IPCTL_MAXFRAGPACKETS 18 /* max packets in reassembly queue */ -#define IPCTL_MAXID 19 +#define IPCTL_REFUSALS 19 /* whether to return ICMP on no-pcb*/ +#define IPCTL_MAXID 20 #define IPCTL_NAMES { \ { 0, 0 }, \ @@ -370,6 +371,7 @@ { "lowportmin", CTLTYPE_INT }, \ { "lowportmax", CTLTYPE_INT }, \ { "maxfragpackets", CTLTYPE_INT }, \ + { "refusals", CTLTYPE_INT }, \ } #endif /* !_XOPEN_SOURCE */ Index: netinet/ip_input.c =================================================================== RCS file: /cvsroot/syssrc/sys/netinet/ip_input.c,v retrieving revision 1.114.4.6 diff -u -r1.114.4.6 ip_input.c --- ip_input.c 2001/04/24 22:21:20 1.114.4.6 +++ ip_input.c 2001/06/12 23:14:32 @@ -209,6 +209,7 @@ int ipq_locked; int ip_nfragpackets = 0; int ip_maxfragpackets = 200; +int inet_silent_refused = 0; static __inline int ipq_lock_try __P((void)); static __inline void ipq_unlock __P((void)); @@ -1794,11 +1795,14 @@ } return (error); #endif - case IPCTL_MAXFRAGPACKETS: return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_maxfragpackets)); + case IPCTL_REFUSALS: + return (sysctl_int(oldp, oldlenp, newp, newlen, + &inet_silent_refused)); + default: return (EOPNOTSUPP); } Index: netinet/ip_var.h =================================================================== RCS file: /cvsroot/syssrc/sys/netinet/ip_var.h,v retrieving revision 1.41.4.1 diff -u -r1.41.4.1 ip_var.h --- ip_var.h 2000/08/26 16:38:33 1.41.4.1 +++ ip_var.h 2001/06/12 23:14:32 @@ -190,6 +190,7 @@ extern int anonportmax; /* maximum ephemeral port */ extern int lowportmin; /* minimum reserved port */ extern int lowportmax; /* maximum reserved port */ +extern int inet_silent_refused; /* 1 - don't send ICMP port unreach */ extern struct rttimer_queue *ip_mtudisc_timeout_q; #ifdef GATEWAY extern int ip_maxflows; Index: netinet/tcp_input.c =================================================================== RCS file: /cvsroot/syssrc/sys/netinet/tcp_input.c,v retrieving revision 1.108.4.9 diff -u -r1.108.4.9 tcp_input.c --- tcp_input.c 2001/05/09 19:37:19 1.108.4.9 +++ tcp_input.c 2001/06/12 23:14:33 @@ -864,7 +864,11 @@ src, ntohs(th->th_sport)); } TCP_FIELDS_TO_HOST(th); - goto dropwithreset_ratelim; + if(inet_silent_refused) { + goto drop; + } else { + goto dropwithreset_ratelim; + } } #ifdef IPSEC if (inp && ipsec4_in_reject(m, inp)) { Index: netinet/udp_usrreq.c =================================================================== RCS file: /cvsroot/syssrc/sys/netinet/udp_usrreq.c,v retrieving revision 1.66.4.5 diff -u -r1.66.4.5 udp_usrreq.c --- udp_usrreq.c 2001/05/09 19:37:41 1.66.4.5 +++ udp_usrreq.c 2001/06/12 23:14:33 @@ -654,6 +654,10 @@ goto bad; } #endif + if(inet_silent_refused) { + return rcvcnt; + } + if ((n = m_copy(m, 0, M_COPYALL)) != NULL) { icmp_error(n, ICMP_UNREACH, ICMP_UNREACH_PORT, 0, 0);