Date: Thu, 10 Jun 2004 22:07:19 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 54582 for review Message-ID: <200406102207.i5AM7Jr0012284@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54582 Change 54582 by rwatson@rwatson_tislabs on 2004/06/10 22:07:16 Integrate netperf_socket from FreeBSD CVS HEAD. - Loop back UNIX domain socket locking. resolve -at to lose the original netperf_socket locking and replace with the rwatson_netperf locking. Affected files ... .. //depot/projects/netperf_socket/sys/alpha/alpha/pmap.c#7 integrate .. //depot/projects/netperf_socket/sys/alpha/include/pc/bios.h#2 integrate .. //depot/projects/netperf_socket/sys/amd64/acpica/madt.c#5 integrate .. //depot/projects/netperf_socket/sys/amd64/amd64/machdep.c#6 integrate .. //depot/projects/netperf_socket/sys/amd64/include/asm.h#3 integrate .. //depot/projects/netperf_socket/sys/amd64/include/md_var.h#6 integrate .. //depot/projects/netperf_socket/sys/amd64/include/profile.h#4 integrate .. //depot/projects/netperf_socket/sys/conf/NOTES#19 integrate .. //depot/projects/netperf_socket/sys/conf/files#25 integrate .. //depot/projects/netperf_socket/sys/conf/files.sparc64#5 integrate .. //depot/projects/netperf_socket/sys/conf/kmod.mk#8 integrate .. //depot/projects/netperf_socket/sys/dev/bge/if_bge.c#8 integrate .. //depot/projects/netperf_socket/sys/dev/bge/if_bgereg.h#3 integrate .. //depot/projects/netperf_socket/sys/dev/cx/if_cx.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/ed/if_ed.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/eisa/eisa_if.m#1 branch .. //depot/projects/netperf_socket/sys/dev/eisa/eisaconf.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/eisa/eisaconf.h#2 integrate .. //depot/projects/netperf_socket/sys/dev/esp/esp_sbus.c#1 branch .. //depot/projects/netperf_socket/sys/dev/esp/lsi64854.c#1 branch .. //depot/projects/netperf_socket/sys/dev/esp/lsi64854reg.h#1 branch .. //depot/projects/netperf_socket/sys/dev/esp/lsi64854var.h#1 branch .. //depot/projects/netperf_socket/sys/dev/esp/ncr53c9x.c#1 branch .. //depot/projects/netperf_socket/sys/dev/esp/ncr53c9xreg.h#1 branch .. //depot/projects/netperf_socket/sys/dev/esp/ncr53c9xvar.h#1 branch .. //depot/projects/netperf_socket/sys/dev/fb/vga.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/fe/if_fe.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/gem/if_gem.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/hme/if_hme.c#7 integrate .. //depot/projects/netperf_socket/sys/dev/kbd/atkbd.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/lge/if_lge.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/lnc/if_lnc.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/my/if_my.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/nge/if_nge.c#11 integrate .. //depot/projects/netperf_socket/sys/dev/pcf/envctrl.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/pcf/pcf_ebus.c#1 branch .. //depot/projects/netperf_socket/sys/dev/pcf/pcf_isa.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/re/if_re.c#9 integrate .. //depot/projects/netperf_socket/sys/dev/sn/if_sn.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/tx/if_tx.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/usb/if_aue.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/usb/if_axe.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/usb/if_cue.c#5 integrate .. //depot/projects/netperf_socket/sys/dev/usb/if_rue.c#6 integrate .. //depot/projects/netperf_socket/sys/dev/usb/uhub.c#2 integrate .. //depot/projects/netperf_socket/sys/dev/wi/if_wi_pccard.c#5 integrate .. //depot/projects/netperf_socket/sys/geom/geom_io.c#4 integrate .. //depot/projects/netperf_socket/sys/i386/acpica/acpi_machdep.c#5 integrate .. //depot/projects/netperf_socket/sys/i386/acpica/madt.c#6 integrate .. //depot/projects/netperf_socket/sys/i386/bios/mca_machdep.c#2 integrate .. //depot/projects/netperf_socket/sys/i386/bios/smapi.c#4 integrate .. //depot/projects/netperf_socket/sys/i386/bios/smbios.c#3 integrate .. //depot/projects/netperf_socket/sys/i386/bios/vpd.c#3 integrate .. //depot/projects/netperf_socket/sys/i386/i386/bios.c#4 integrate .. //depot/projects/netperf_socket/sys/i386/i386/machdep.c#4 integrate .. //depot/projects/netperf_socket/sys/i386/i386/symbols.raw#2 integrate .. //depot/projects/netperf_socket/sys/i386/include/md_var.h#3 integrate .. //depot/projects/netperf_socket/sys/i386/include/pc/bios.h#3 integrate .. //depot/projects/netperf_socket/sys/i386/isa/vesa.c#2 integrate .. //depot/projects/netperf_socket/sys/i386/pci/pci_pir.c#5 integrate .. //depot/projects/netperf_socket/sys/isa/syscons_isa.c#2 integrate .. //depot/projects/netperf_socket/sys/kern/kern_proc.c#7 integrate .. //depot/projects/netperf_socket/sys/kern/kern_thread.c#11 integrate .. //depot/projects/netperf_socket/sys/kern/tty.c#6 integrate .. //depot/projects/netperf_socket/sys/kern/tty_pty.c#6 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_mbuf.c#6 integrate .. //depot/projects/netperf_socket/sys/kern/uipc_usrreq.c#9 integrate .. //depot/projects/netperf_socket/sys/modules/aic7xxx/ahc/ahc_eisa/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/em/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/esp/Makefile#1 branch .. //depot/projects/netperf_socket/sys/modules/ixgb/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/vx/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/netinet/in.h#3 integrate .. //depot/projects/netperf_socket/sys/netinet/ip_fw.h#5 integrate .. //depot/projects/netperf_socket/sys/netinet/ip_fw2.c#6 integrate .. //depot/projects/netperf_socket/sys/netinet/raw_ip.c#7 integrate .. //depot/projects/netperf_socket/sys/pc98/i386/machdep.c#3 integrate .. //depot/projects/netperf_socket/sys/pci/if_dc.c#7 integrate .. //depot/projects/netperf_socket/sys/pci/if_de.c#6 integrate .. //depot/projects/netperf_socket/sys/pci/if_pcn.c#6 integrate .. //depot/projects/netperf_socket/sys/pci/if_rl.c#11 integrate .. //depot/projects/netperf_socket/sys/pci/if_sf.c#6 integrate .. //depot/projects/netperf_socket/sys/pci/if_sis.c#8 integrate .. //depot/projects/netperf_socket/sys/pci/if_sk.c#10 integrate .. //depot/projects/netperf_socket/sys/pci/if_ste.c#15 integrate .. //depot/projects/netperf_socket/sys/pci/if_vr.c#8 integrate .. //depot/projects/netperf_socket/sys/pci/if_wb.c#6 integrate .. //depot/projects/netperf_socket/sys/pci/if_xl.c#8 integrate .. //depot/projects/netperf_socket/sys/sparc64/conf/GENERIC#5 integrate .. //depot/projects/netperf_socket/sys/sys/tty.h#5 integrate .. //depot/projects/netperf_socket/sys/vm/uma_core.c#6 integrate Differences ... ==== //depot/projects/netperf_socket/sys/alpha/alpha/pmap.c#7 (text+ko) ==== @@ -148,7 +148,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.146 2004/04/26 17:49:05 gallatin Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/pmap.c,v 1.147 2004/06/10 04:30:59 alc Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -612,7 +612,6 @@ pmap_init(void) { int i; - int initial_pvs; /* * Allocate memory for random pmap data structures. Includes the @@ -630,12 +629,9 @@ /* * init the pv free list */ - initial_pvs = vm_page_array_size; - if (initial_pvs < MINPV) - initial_pvs = MINPV; pvzone = uma_zcreate("PV ENTRY", sizeof (struct pv_entry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE); - uma_prealloc(pvzone, initial_pvs); + uma_prealloc(pvzone, MINPV); /* * Now it is safe to enable pv_table recording. ==== //depot/projects/netperf_socket/sys/alpha/include/pc/bios.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/alpha/include/pc/bios.h,v 1.5 1999/08/28 00:38:56 peter Exp $ + * $FreeBSD: src/sys/alpha/include/pc/bios.h,v 1.6 2004/06/10 20:30:54 jhb Exp $ * from: i386/include/pc bios.h,v 1.2 */ @@ -71,13 +71,8 @@ }; extern void bios32(caddr_t func_addr, struct bios32_args *args); -#if 0 -#define BIOS_PADDRTOVADDR(x) (((x) - ISA_HOLE_START) + atdevbase) -#define BIOS_VADDRTOPADDR(x) (((x) - atdevbase) + ISA_HOLE_START) -#else #define BIOS_PADDRTOVADDR(x) (x) #define BIOS_VADDRTOPADDR(x) (x) -#endif /* * System Management BIOS / Desktop Management Interface tables ==== //depot/projects/netperf_socket/sys/amd64/acpica/madt.c#5 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.13 2004/06/03 20:25:04 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/acpica/madt.c,v 1.14 2004/06/10 21:30:08 peter Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -65,7 +65,6 @@ } ioapics[NIOAPICS]; struct lapic_info { - u_int la_present:1; u_int la_enabled:1; u_int la_acpi_id:8; } lapics[NLAPICS]; @@ -447,18 +446,17 @@ printf("MADT: Found CPU APIC ID %d ACPI ID %d: %s\n", proc->LocalApicId, proc->ProcessorId, proc->ProcessorEnabled ? "enabled" : "disabled"); + if (!proc->ProcessorEnabled) + break; if (proc->LocalApicId >= NLAPICS) panic("%s: CPU ID %d too high", __func__, proc->LocalApicId); la = &lapics[proc->LocalApicId]; - KASSERT(la->la_present == 0, + KASSERT(la->la_enabled == 0, ("Duplicate local APIC ID %d", proc->LocalApicId)); - la->la_present = 1; + la->la_enabled = 1; la->la_acpi_id = proc->ProcessorId; - if (proc->ProcessorEnabled) { - la->la_enabled = 1; - lapic_create(proc->LocalApicId, 0); - } + lapic_create(proc->LocalApicId, 0); break; } } @@ -548,15 +546,12 @@ int i; for (i = 0; i < NLAPICS; i++) { - if (!lapics[i].la_present) + if (!lapics[i].la_enabled) continue; if (lapics[i].la_acpi_id != acpi_id) continue; *apic_id = i; - if (lapics[i].la_enabled) - return (0); - else - return (ENXIO); + return (0); } return (ENOENT); } @@ -770,7 +765,7 @@ pc = pcpu_find(i); KASSERT(pc != NULL, ("no pcpu data for CPU %d", i)); la = &lapics[pc->pc_apic_id]; - if (!la->la_present || !la->la_enabled) + if (!la->la_enabled) panic("APIC: CPU with APIC ID %u is not enabled", pc->pc_apic_id); pc->pc_acpi_id = la->la_acpi_id; ==== //depot/projects/netperf_socket/sys/amd64/amd64/machdep.c#6 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.608 2004/06/08 01:02:51 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.609 2004/06/10 20:30:55 jhb Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -140,7 +140,6 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) int _udatasel, _ucodesel, _ucode32sel; -u_long atdevbase; int cold = 1; @@ -1116,8 +1115,6 @@ thread0.td_pcb = (struct pcb *) (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; - atdevbase = ISA_HOLE_START + KERNBASE; - /* * This may be done better later if it gets more high level * components in it. If so just link td->td_proc here. ==== //depot/projects/netperf_socket/sys/amd64/include/asm.h#3 (text+ko) ==== @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * from: @(#)DEFS.h 5.1 (Berkeley) 4/23/90 - * $FreeBSD: src/sys/amd64/include/asm.h,v 1.15 2004/04/05 21:25:51 imp Exp $ + * $FreeBSD: src/sys/amd64/include/asm.h,v 1.16 2004/06/10 22:02:26 peter Exp $ */ #ifndef _MACHINE_ASM_H_ @@ -64,10 +64,14 @@ #ifdef PROF #define ALTENTRY(x) _ENTRY(x); \ + pushq %rbp; movq %rsp,%rbp; \ call PIC_PLT(HIDENAME(mcount)); \ + popq %rbp; \ jmp 9f #define ENTRY(x) _ENTRY(x); \ + pushq %rbp; movq %rsp,%rbp; \ call PIC_PLT(HIDENAME(mcount)); \ + popq %rbp; \ 9: #else #define ALTENTRY(x) _ENTRY(x) ==== //depot/projects/netperf_socket/sys/amd64/include/md_var.h#6 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.74 2004/06/08 01:02:52 peter Exp $ + * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.75 2004/06/10 20:30:55 jhb Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -37,7 +37,6 @@ */ extern long Maxmem; -extern u_long atdevbase; /* offset in virtual memory of ISA io mem */ extern u_int basemem; extern int busdma_swi_pending; extern u_int cpu_exthigh; ==== //depot/projects/netperf_socket/sys/amd64/include/profile.h#4 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)profile.h 8.1 (Berkeley) 6/11/93 - * $FreeBSD: src/sys/amd64/include/profile.h,v 1.39 2004/05/20 16:22:57 bde Exp $ + * $FreeBSD: src/sys/amd64/include/profile.h,v 1.40 2004/06/10 22:00:58 peter Exp $ */ #ifndef _MACHINE_PROFILE_H_ @@ -108,10 +108,12 @@ pushq %rcx \n\ pushq %r8 \n\ pushq %r9 \n\ + pushq %rax \n\ movq 8(%rbp),%rsi \n\ movq (%rbp),%rdi \n\ movq 8(%rdi),%rdi \n\ call _mcount \n\ + popq %rax \n\ popq %r9 \n\ popq %r8 \n\ popq %rcx \n\ ==== //depot/projects/netperf_socket/sys/conf/NOTES#19 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1228 2004/06/07 19:33:05 netchild Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1229 2004/06/10 05:43:36 scottl Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -1205,6 +1205,7 @@ # such as the Tekram DC-390(T). # bt: Most Buslogic controllers: including BT-445, BT-54x, BT-64x, BT-74x, # BT-75x, BT-946, BT-948, BT-956, BT-958, SDC3211B, SDC3211F, SDC3222F +# esp: NCR53c9x. Only for SBUS hardware right now. # isp: Qlogic ISP 1020, 1040 and 1040B PCI SCSI host adapters, # ISP 1240 Dual Ultra SCSI, ISP 1080 and 1280 (Dual) Ultra2, # ISP 12160 Ultra3 SCSI, @@ -1239,6 +1240,7 @@ device ahc device ahd device amd +device esp device isp hint.isp.0.disable="1" hint.isp.0.role="3" ==== //depot/projects/netperf_socket/sys/conf/files#25 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.901 2004/06/07 19:00:56 julian Exp $ +# $FreeBSD: src/sys/conf/files,v 1.903 2004/06/10 05:21:44 scottl Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -417,6 +417,7 @@ dev/ed/if_ed_pccard.c optional ed card dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci +dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa dev/em/if_em.c optional em dev/em/if_em_hw.c optional em @@ -428,6 +429,7 @@ dev/ep/if_ep_mca.c optional ep mca dev/ep/if_ep_pccard.c optional ep card dev/ep/if_ep_pccard.c optional ep pccard +dev/esp/ncr53c9x.c optional esp dev/ex/if_ex.c optional ex dev/ex/if_ex_isa.c optional ex isa dev/ex/if_ex_pccard.c optional ex card ==== //depot/projects/netperf_socket/sys/conf/files.sparc64#5 (text+ko) ==== @@ -1,7 +1,7 @@ # This file tells config what files go into building a kernel, # files marked standard are always included. # -# $FreeBSD: src/sys/conf/files.sparc64,v 1.53 2004/05/08 13:53:46 marius Exp $ +# $FreeBSD: src/sys/conf/files.sparc64,v 1.54 2004/06/10 05:21:44 scottl Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -12,6 +12,8 @@ crypto/des/des_enc.c optional ipsec ipsec_esp crypto/blowfish/bf_enc.c optional crypto crypto/des/des_enc.c optional crypto +dev/esp/esp_sbus.c optional esp sbus +dev/esp/lsi64854.c optional esp sbus dev/fb/creator.c optional creator sc dev/fb/fb.c optional sc dev/fb/splash.c optional splash ==== //depot/projects/netperf_socket/sys/conf/kmod.mk#8 (text+ko) ==== @@ -1,5 +1,5 @@ # From: @(#)bsd.prog.mk 5.26 (Berkeley) 6/25/91 -# $FreeBSD: src/sys/conf/kmod.mk,v 1.159 2004/05/26 00:52:52 imp Exp $ +# $FreeBSD: src/sys/conf/kmod.mk,v 1.160 2004/06/09 16:08:20 imp Exp $ # # The include file <bsd.kmod.mk> handles installing Kernel Loadable Device # drivers (KLD's). @@ -289,7 +289,7 @@ MFILES?= kern/bus_if.m kern/device_if.m dev/iicbus/iicbb_if.m \ dev/iicbus/iicbus_if.m isa/isa_if.m \ libkern/iconv_converter_if.m \ - dev/mii/miibus_if.m \ + dev/eisa/eisa_if.m dev/mii/miibus_if.m \ dev/pccard/card_if.m dev/pccard/power_if.m dev/pci/pci_if.m \ dev/pci/pcib_if.m dev/ppbus/ppbus_if.m dev/smbus/smbus_if.m \ dev/usb/usb_if.m dev/sound/pcm/ac97_if.m dev/sound/pcm/channel_if.m \ ==== //depot/projects/netperf_socket/sys/dev/bge/if_bge.c#8 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.69 2004/05/30 20:08:27 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/bge/if_bge.c,v 1.71 2004/06/09 16:01:59 wpaul Exp $"); /* * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. @@ -211,7 +211,6 @@ static u_int8_t bge_eeprom_getbyte (struct bge_softc *, int, u_int8_t *); static int bge_read_eeprom (struct bge_softc *, caddr_t, int, int); -static uint32_t bge_mchash (const uint8_t *); static void bge_setmulti (struct bge_softc *); static void bge_handle_events (struct bge_softc *); @@ -1133,27 +1132,6 @@ return(0); } -#define BGE_POLY 0xEDB88320 - -static uint32_t -bge_mchash(addr) - const uint8_t *addr; -{ - uint32_t crc; - int idx, bit; - uint8_t data; - - /* Compute CRC for the address value. */ - crc = 0xFFFFFFFF; /* initial value */ - - for (idx = 0; idx < 6; idx++) { - for (data = *addr++, bit = 0; bit < 8; bit++, data >>= 1) - crc = (crc >> 1) ^ (((crc ^ data) & 1) ? BGE_POLY : 0); - } - - return(crc & 0x7F); -} - static void bge_setmulti(sc) struct bge_softc *sc; @@ -1181,7 +1159,8 @@ TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - h = bge_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + h = ether_crc32_le(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) & 0x7F; hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); } @@ -2403,6 +2382,7 @@ IFM_ETHER|IFM_1000_SX|IFM_FDX, 0, NULL); ifmedia_add(&sc->bge_ifmedia, IFM_ETHER|IFM_AUTO, 0, NULL); ifmedia_set(&sc->bge_ifmedia, IFM_ETHER|IFM_AUTO); + sc->bge_ifmedia.ifm_media = sc->bge_ifmedia.ifm_cur->ifm_media; } else { /* * Do transceiver setup. @@ -2602,6 +2582,18 @@ CSR_WRITE_4(sc, BGE_MAC_MODE, 0); + /* + * The 5704 in TBI mode apparently needs some special + * adjustment to insure the SERDES drive level is set + * to 1.2V. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5704 && sc->bge_tbi) { + uint32_t serdescfg; + serdescfg = CSR_READ_4(sc, BGE_SERDES_CFG); + serdescfg = (serdescfg & ~0xFFF) | 0x880; + CSR_WRITE_4(sc, BGE_SERDES_CFG, serdescfg); + } + DELAY(10000); return; @@ -2937,6 +2929,9 @@ if (CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_TBI_PCS_SYNCHED) { sc->bge_link++; + if (sc->bge_asicrev == BGE_ASICREV_BCM5704) + BGE_CLRBIT(sc, BGE_MAC_MODE, + BGE_MACMODE_TBI_SEND_CFGS); CSR_WRITE_4(sc, BGE_MAC_STS, 0xFFFFFFFF); printf("bge%d: gigabit link up\n", sc->bge_unit); if (ifp->if_snd.ifq_head != NULL) @@ -3333,6 +3328,23 @@ return(EINVAL); switch(IFM_SUBTYPE(ifm->ifm_media)) { case IFM_AUTO: + /* + * The BCM5704 ASIC appears to have a special + * mechanism for programming the autoneg + * advertisement registers in TBI mode. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5704) { + uint32_t sgdig; + CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0); + sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG); + sgdig |= BGE_SGDIGCFG_AUTO| + BGE_SGDIGCFG_PAUSE_CAP| + BGE_SGDIGCFG_ASYM_PAUSE; + CSR_WRITE_4(sc, BGE_SGDIG_CFG, + sgdig|BGE_SGDIGCFG_SEND); + DELAY(5); + CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig); + } break; case IFM_1000_SX: if ((ifm->ifm_media & IFM_GMASK) == IFM_FDX) { ==== //depot/projects/netperf_socket/sys/dev/bge/if_bgereg.h#3 (text+ko) ==== @@ -30,7 +30,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/bge/if_bgereg.h,v 1.27 2004/05/24 04:46:54 ps Exp $ + * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.28 2004/06/09 16:01:59 wpaul Exp $ */ /* @@ -525,6 +525,10 @@ #define BGE_RX_BD_RULES_CTL15 0x04F8 #define BGE_RX_BD_RULES_MASKVAL15 0x04FC #define BGE_RX_RULES_CFG 0x0500 +#define BGE_SERDES_CFG 0x0590 +#define BGE_SERDES_STS 0x0594 +#define BGE_SGDIG_CFG 0x05B0 +#define BGE_SGDIG_STS 0x05B4 #define BGE_RX_STATS 0x0800 #define BGE_TX_STATS 0x0880 @@ -655,6 +659,40 @@ #define BGE_RXRULEMASK_VALUE 0x0000FFFF #define BGE_RXRULEMASK_MASKVAL 0xFFFF0000 +/* SERDES configuration register */ +#define BGE_SERDESCFG_RXR 0x00000007 /* phase interpolator */ +#define BGE_SERDESCFG_RXG 0x00000018 /* rx gain setting */ +#define BGE_SERDESCFG_RXEDGESEL 0x00000040 /* rising/falling egde */ +#define BGE_SERDESCFG_TX_BIAS 0x00000380 /* TXDAC bias setting */ +#define BGE_SERDESCFG_IBMAX 0x00000400 /* bias current +25% */ +#define BGE_SERDESCFG_IBMIN 0x00000800 /* bias current -25% */ +#define BGE_SERDESCFG_TXMODE 0x00001000 +#define BGE_SERDESCFG_TXEDGESEL 0x00002000 /* rising/falling edge */ +#define BGE_SERDESCFG_MODE 0x00004000 /* TXCP/TXCN disabled */ +#define BGE_SERDESCFG_PLLTEST 0x00008000 /* PLL test mode */ +#define BGE_SERDESCFG_CDET 0x00010000 /* comma detect enable */ +#define BGE_SERDESCFG_TBILOOP 0x00020000 /* local loopback */ +#define BGE_SERDESCFG_REMLOOP 0x00040000 /* remote loopback */ +#define BGE_SERDESCFG_INVPHASE 0x00080000 /* Reverse 125Mhz clock */ +#define BGE_SERDESCFG_12REGCTL 0x00300000 /* 1.2v regulator ctl */ +#define BGE_SERDESCFG_REGCTL 0x00C00000 /* regulator ctl (2.5v) */ + +/* SERDES status register */ +#define BGE_SERDESSTS_RXSTAT 0x0000000F /* receive status bits */ +#define BGE_SERDESSTS_CDET 0x00000010 /* comma code detected */ + +/* SGDIG config (not documented) */ +#define BGE_SGDIGCFG_PAUSE_CAP 0x00000800 +#define BGE_SGDIGCFG_ASYM_PAUSE 0x00001000 +#define BGE_SGDIGCFG_SEND 0x40000000 +#define BGE_SGDIGCFG_AUTO 0x80000000 + +/* SGDIG status (not documented) */ +#define BGE_SGDIGSTS_PAUSE_CAP 0x00080000 +#define BGE_SGDIGSTS_ASYM_PAUSE 0x00100000 +#define BGE_SGDIGSTS_DONE 0x00000002 + + /* MI communication register */ #define BGE_MICOMM_DATA 0x0000FFFF #define BGE_MICOMM_REG 0x001F0000 ==== //depot/projects/netperf_socket/sys/dev/cx/if_cx.c#7 (text+ko) ==== @@ -22,7 +22,7 @@ * Cronyx Id: if_cx.c,v 1.1.2.23 2004/02/26 17:56:40 rik Exp $ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/cx/if_cx.c,v 1.17 2004/06/08 10:38:20 rik Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/cx/if_cx.c,v 1.19 2004/06/10 13:50:28 rik Exp $"); #include <sys/param.h> @@ -1037,6 +1037,14 @@ if (!d || d->chan->type == T_NONE) continue; + +#if __FreeBSD_version >= 502113 + if (d->tty) { + ttyrel (d->tty); + d->tty = NULL; + } +#endif + #ifdef NETGRAPH #if __FreeBSD_version >= 500000 if (d->node) { @@ -1735,7 +1743,13 @@ splx (s); d->callout = 0; - /* Wake up bidirectional opens. */ + /* + * Wake up bidirectional opens. + * Since we may be opened twice we couldn't call ttyrel() here. + * So just keep d->tty for future use. It would be freed by + * ttyrel() at cx_detach(). + */ + wakeup (d); d->open_dev &= ~0x2; @@ -2140,7 +2154,7 @@ return 0; } - if (c->mode == M_ASYNC && d->tty) { + if (c->mode == M_ASYNC && !IF_CUNIT(dev) && d->tty) { #if __FreeBSD_version >= 502113 error = ttyioctl (dev, cmd, data, flag, td); ttyldoptim (d->tty); ==== //depot/projects/netperf_socket/sys/dev/ed/if_ed.c#7 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ed/if_ed.c,v 1.231 2004/05/23 16:11:46 mux Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ed/if_ed.c,v 1.232 2004/06/09 14:33:58 naddy Exp $"); /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -104,8 +104,6 @@ static void ed_setrcr (struct ed_softc *); -static uint32_t ds_mchash (const uint8_t *); - /* * Interrupt conversion table for WD/SMC ASIC/83C584 */ @@ -3520,30 +3518,6 @@ } /* - * Compute crc for ethernet address - */ -static uint32_t -ds_mchash(addr) - const uint8_t *addr; -{ -#define ED_POLYNOMIAL 0x04c11db6 - register uint32_t crc = 0xffffffff; - register int carry, idx, bit; - register uint8_t data; - - for (idx = 6; --idx >= 0;) { - for (data = *addr++, bit = 8; --bit >= 0; data >>=1 ) { - carry = ((crc & 0x80000000) ? 1 : 0) ^ (data & 0x01); - crc <<= 1; - if (carry) - crc = (crc ^ ED_POLYNOMIAL) | carry; - } - } - return crc; -#undef POLYNOMIAL -} - -/* * Compute the multicast address filter from the * list of multicast addresses we need to listen to. */ @@ -3562,8 +3536,8 @@ TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - index = ds_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)) - >> 26; + index = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; af[index >> 3] |= 1 << (index & 7); } } ==== //depot/projects/netperf_socket/sys/dev/eisa/eisaconf.c#2 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/eisa/eisaconf.c,v 1.65 2003/08/24 17:46:04 obrien Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/eisa/eisaconf.c,v 1.66 2004/06/09 16:08:20 imp Exp $"); #include "opt_eisa.h" @@ -508,8 +508,8 @@ return rv; } -int -eisa_add_intr(device_t dev, int irq, int trigger) +static int +eisa_add_intr_m(device_t eisa, device_t dev, int irq, int trigger) { struct eisa_device *e_dev = device_get_ivars(dev); struct irq_node *irq_info; @@ -575,8 +575,9 @@ return (0); } -int -eisa_add_mspace(device_t dev, u_long mbase, u_long msize, int flags) +static int +eisa_add_mspace_m(device_t eisa, device_t dev, u_long mbase, u_long msize, + int flags) { struct eisa_device *e_dev = device_get_ivars(dev); @@ -584,8 +585,9 @@ flags); } -int -eisa_add_iospace(device_t dev, u_long iobase, u_long iosize, int flags) +static int +eisa_add_iospace_m(device_t eisa, device_t dev, u_long iobase, u_long iosize, + int flags) { struct eisa_device *e_dev = device_get_ivars(dev); @@ -614,6 +616,11 @@ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + /* EISA interface */ + DEVMETHOD(eisa_add_intr, eisa_add_intr_m), + DEVMETHOD(eisa_add_iospace, eisa_add_iospace_m), + DEVMETHOD(eisa_add_mspace, eisa_add_mspace_m), + { 0, 0 } }; ==== //depot/projects/netperf_socket/sys/dev/eisa/eisaconf.h#2 (text+ko) ==== @@ -28,12 +28,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/eisa/eisaconf.h,v 1.22 2002/08/20 12:32:06 mux Exp $ + * $FreeBSD: src/sys/dev/eisa/eisaconf.h,v 1.23 2004/06/09 16:08:20 imp Exp $ */ -#ifndef _I386_EISA_EISACONF_H_ -#define _I386_EISA_EISACONF_H_ 1 +#ifndef _DEV_EISA_EISACONF_H_ +#define _DEV_EISA_EISACONF_H_ 1 +#include "eisa_if.h" #define EISA_SLOT_SIZE 0x1000 #define EISA_MFCTR_CHAR0(ID) (char)(((ID>>26) & 0x1F) | '@') /* Bits 26-30 */ @@ -68,14 +69,30 @@ #undef EISA_ACCESSOR -int eisa_add_intr(device_t, int, int); - #define RESVADDR_NONE 0x00 #define RESVADDR_BITMASK 0x01 /* size is a mask of reserved * bits at addr */ #define RESVADDR_RELOCATABLE 0x02 -int eisa_add_iospace(device_t, u_long, u_long, int); -int eisa_add_mspace(device_t, u_long, u_long, int); + +static __inline int +eisa_add_intr(device_t dev, int irq, int trigger) +{ + return (EISA_ADD_INTR(device_get_parent(dev), dev, irq, trigger)); +} + +static __inline int +eisa_add_iospace(device_t dev, u_long iobase, u_long iosize, int flags) +{ + return (EISA_ADD_IOSPACE(device_get_parent(dev), dev, iobase, iosize, + flags)); +} + +static __inline int +eisa_add_mspace(device_t dev, u_long mbase, u_long msize, int flags) +{ + return (EISA_ADD_MSPACE(device_get_parent(dev), dev, mbase, msize, + flags)); +} -#endif /* _I386_EISA_EISACONF_H_ */ +#endif /* _DEV_EISA_EISACONF_H_ */ ==== //depot/projects/netperf_socket/sys/dev/fb/vga.c#3 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fb/vga.c,v 1.29 2004/04/03 15:28:25 nectar Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fb/vga.c,v 1.30 2004/06/10 20:30:56 jhb Exp $"); #include "opt_vga.h" #include "opt_fb.h" @@ -67,7 +67,7 @@ #if !defined(__amd64__) #define BIOS_PADDRTOVADDR(x) (x) #else -#define BIOS_PADDRTOVADDR(x) (((x) - ISA_HOLE_START) + atdevbase) +#define BIOS_PADDRTOVADDR(x) ((x) + KERNBASE) #endif #endif ==== //depot/projects/netperf_socket/sys/dev/fe/if_fe.c#6 (text+ko) ==== @@ -21,7 +21,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/fe/if_fe.c,v 1.84 2004/05/23 16:11:47 mux Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/fe/if_fe.c,v 1.85 2004/06/09 14:33:59 naddy Exp $"); /* * @@ -2033,29 +2033,6 @@ } /* - * Compute hash value for an Ethernet address - */ -static uint32_t -fe_mchash (const uint8_t *addr) -{ -#define FE_POLY 0xEDB88320L - - uint32_t carry, crc = 0xFFFFFFFFL; - int idx, bit; - uint8_t data; - - for ( idx = ETHER_ADDR_LEN; --idx >= 0; ) { - for (data = *addr++, bit = 8; --bit >= 0; data >>= 1) { - carry = crc; - crc >>= 1; - if ((carry ^ data) & 1) - crc ^= FE_POLY; - } - } - return (crc >> 26); -} - -/* * Compute the multicast address filter from the * list of multicast addresses we need to listen to. */ @@ -2070,7 +2047,8 @@ TAILQ_FOREACH(ifma, &sc->arpcom.ac_if.if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - index = fe_mchash(LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = ether_crc32_le(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; #ifdef FE_DEBUG printf("%s: hash(%6D) == %d\n", sc->sc_xname, enm->enm_addrlo , ":", index); ==== //depot/projects/netperf_socket/sys/dev/gem/if_gem.c#6 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.24 2004/06/03 06:09:59 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/gem/if_gem.c,v 1.26 2004/06/10 00:04:16 marius Exp $"); /* * Driver for Sun GEM ethernet controllers. @@ -1844,14 +1844,11 @@ { struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct ifmultiaddr *inm; - struct sockaddr_dl *sdl; bus_space_tag_t t = sc->sc_bustag; bus_space_handle_t h = sc->sc_h; - u_char *cp; u_int32_t crc; u_int32_t hash[16]; u_int32_t v; - int len; int i; /* Get current RX configuration */ @@ -1891,24 +1888,9 @@ TAILQ_FOREACH(inm, &sc->sc_arpcom.ac_if.if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; - sdl = (struct sockaddr_dl *)inm->ifma_addr; - cp = LLADDR(sdl); - crc = 0xffffffff; - for (len = sdl->sdl_alen; --len >= 0;) { - int octet = *cp++; - int i; + crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) + inm->ifma_addr), ETHER_ADDR_LEN); -#define MC_POLY_LE 0xedb88320UL /* mcast crc, little endian */ - for (i = 0; i < 8; i++) { - if ((crc & 1) ^ (octet & 1)) { - crc >>= 1; - crc ^= MC_POLY_LE; - } else { - crc >>= 1; - } - octet >>= 1; - } - } /* Just want the 8 most significant bits. */ crc >>= 24; ==== //depot/projects/netperf_socket/sys/dev/hme/if_hme.c#7 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/hme/if_hme.c,v 1.24 2004/06/03 06:09:59 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/hme/if_hme.c,v 1.26 2004/06/10 00:06:04 marius Exp $"); /* * HME Ethernet module driver. @@ -1404,12 +1404,9 @@ { struct ifnet *ifp = &sc->sc_arpcom.ac_if; struct ifmultiaddr *inm; - struct sockaddr_dl *sdl; - u_char *cp; u_int32_t crc; u_int32_t hash[4]; u_int32_t macc; - int len; /* Clear hash table */ hash[3] = hash[2] = hash[1] = hash[0] = 0; @@ -1458,24 +1455,9 @@ TAILQ_FOREACH(inm, &sc->sc_arpcom.ac_if.if_multiaddrs, ifma_link) { if (inm->ifma_addr->sa_family != AF_LINK) continue; - sdl = (struct sockaddr_dl *)inm->ifma_addr; - cp = LLADDR(sdl); - crc = 0xffffffff; - for (len = sdl->sdl_alen; --len >= 0;) { - int octet = *cp++; - int i; + crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406102207.i5AM7Jr0012284>