diff --git a/Makefile.inc1 b/Makefile.inc1 index fb71ce1beb5b..3cb89c40c793 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -121,7 +121,7 @@ VERSION+= ${OSRELDATE} TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm} +TARGET= ${TARGET_ARCH:C/mipse[lb]/mips/:C/armeb/arm/} .endif # Legacy names, for a transition period mips:mips -> mipsel:mips .if defined(TARGET) && defined(TARGET_ARCH) && \ diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index ff0d20d2dd1d..e358ed9f4bc0 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -5086,7 +5086,7 @@ OLD_LIBS+=usr/lib/libthr.so.2 .endif # 20060127: revert libdisk to static-only OLD_LIBS+=usr/lib/libdisk.so.3 -# 20051027: libc_r discontinued +# 20051027: libc_r discontinued (removed 20101113) OLD_LIBS+=usr/lib/libc_r.a OLD_LIBS+=usr/lib/libc_r.so OLD_LIBS+=usr/lib/libc_r.so.7 diff --git a/README b/README index 674d93ebe0a9..4e49142a9379 100644 --- a/README +++ b/README @@ -43,6 +43,9 @@ Source Roadmap: --------------- bin System/user commands. +cddl Various commands and libraries under the Common Development + and Distribution License. + contrib Packages contributed by 3rd parties. crypto Cryptography stuff (see crypto/README). diff --git a/UPDATING b/UPDATING index 5009b099d1b5..9b42760f57d2 100644 --- a/UPDATING +++ b/UPDATING @@ -22,6 +22,32 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.x IS SLOW: machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20101114: + Generic IEEE 802.3 annex 31B full duplex flow control support has been + added to mii(4) and bge(4), bce(4), msk(4), nfe(4) and stge(4) along + with brgphy(4), e1000phy(4) as well as ip1000phy() have been converted + to take advantage of it instead of using custom implementations. This + means that these drivers now no longer unconditionally advertise + support for flow control but only do so if flow control is a selected + media option. This was implemented in the generic support that way in + order to allow flow control to be switched on and off via ifconfig(8) + with the PHY specific default to typically off in order to protect + from unwanted effects. Consequently, if you used flow control with + one of the above mentioned drivers you now need to explicitly enable + it, for example via: + ifconfig bge0 media auto mediaopt flowcontrol + + Along with the above mentioned changes generic support for setting + 1000baseT master mode also has been added and brgphy(4), ciphy(4), + e1000phy(4) as well as ip1000phy(4) have been converted to take + advantage of it. This means that these drivers now no longer take the + link0 parameter for selecting master mode but the master media option + has to be used instead, for example like in the following: + ifconfig bge0 media 1000baseT mediaopt full-duplex,master + + Selection of master mode now is also available with all other PHY + drivers supporting 1000baseT. + 20101111: The TCP stack has received a significant update to add support for modularised congestion control and generally improve the clarity of diff --git a/bin/sh/bltin/bltin.h b/bin/sh/bltin/bltin.h index c4bf8b64c377..0fc8a28fa1d5 100644 --- a/bin/sh/bltin/bltin.h +++ b/bin/sh/bltin/bltin.h @@ -54,6 +54,7 @@ #define putchar(c) out1c(c) #define fprintf outfmt #define fputs outstr +#define fwrite(ptr, size, nmemb, file) outbin(ptr, (size) * (nmemb), file) #define fflush flushout #define INITARGS(argv) #define warnx1(a, b, c) { \ diff --git a/bin/sh/output.c b/bin/sh/output.c index 9fd8478afbc5..d7fc534d7013 100644 --- a/bin/sh/output.c +++ b/bin/sh/output.c @@ -122,8 +122,7 @@ out2qstr(const char *p) void outstr(const char *p, struct output *file) { - while (*p) - outc(*p++, file); + outbin(p, strlen(p), file); } /* Like outstr(), but quote for re-input into the shell. */ @@ -165,6 +164,16 @@ outqstr(const char *p, struct output *file) outc('\'', file); } +void +outbin(const void *data, size_t len, struct output *file) +{ + const char *p; + + p = data; + while (len-- > 0) + outc(*p++, file); +} + static char out_junk[16]; void @@ -285,17 +294,11 @@ static int doformat_wr(void *cookie, const char *buf, int len) { struct output *o; - int origlen; - unsigned char c; o = (struct output *)cookie; - origlen = len; - while (len-- != 0) { - c = (unsigned char)*buf++; - outc(c, o); - } + outbin(buf, len, o); - return (origlen); + return (len); } void diff --git a/bin/sh/output.h b/bin/sh/output.h index 345fe531c400..a7c748e72b8b 100644 --- a/bin/sh/output.h +++ b/bin/sh/output.h @@ -36,6 +36,7 @@ #ifndef OUTPUT_INCL #include +#include struct output { char *nextc; @@ -59,6 +60,7 @@ void out2str(const char *); void out2qstr(const char *); void outstr(const char *, struct output *); void outqstr(const char *, struct output *); +void outbin(const void *, size_t, struct output *); void emptyoutbuf(struct output *); void flushall(void); void flushout(struct output *); diff --git a/crypto/openssl/ssl/s3_clnt.c b/crypto/openssl/ssl/s3_clnt.c index e5138b6e5eee..aa53506d073e 100644 --- a/crypto/openssl/ssl/s3_clnt.c +++ b/crypto/openssl/ssl/s3_clnt.c @@ -1377,6 +1377,7 @@ int ssl3_get_key_exchange(SSL *s) s->session->sess_cert->peer_ecdh_tmp=ecdh; ecdh=NULL; BN_CTX_free(bn_ctx); + bn_ctx = NULL; EC_POINT_free(srvr_ecpoint); srvr_ecpoint = NULL; } diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index 73fb1bebc89f..475240029648 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -140,13 +140,13 @@ LIB1ASMFUNCS = __divxf3 __divdf3 __divsf3 \ LIB2ADDEH = unwind-ia64.c unwind-sjlj.c unwind-c.c .endif -.if ${TARGET_CPUARCH} == "powerpc" +.if ${TARGET_ARCH} == "powerpc" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm LIB2FUNCS_STATIC_EXTRA = eabi.asm .endif -.if ${TARGET_CPUARCH} == "powerpc64" +.if ${TARGET_ARCH} == "powerpc64" # from config/rs6000/t-ppccomm LIB2FUNCS_EXTRA = tramp.asm .endif diff --git a/gnu/usr.bin/binutils/Makefile.inc0 b/gnu/usr.bin/binutils/Makefile.inc0 index 09bda29a3cc1..213d4940b90d 100644 --- a/gnu/usr.bin/binutils/Makefile.inc0 +++ b/gnu/usr.bin/binutils/Makefile.inc0 @@ -7,7 +7,7 @@ VERSION= "2.17.50 [FreeBSD] 2007-07-03" .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif @@ -29,7 +29,7 @@ RELSRC= ${RELTOP}/../../../contrib/binutils SRCDIR= ${.CURDIR}/${RELSRC} .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \ - ${TARGET_CPUARCH} == "powerpc" || \ + ${TARGET_ARCH} == "powerpc" || \ (${TARGET_CPUARCH} == "mips" && \ (!defined(TARGET_ABI) || ${TARGET_ABI} != "n64")) CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 diff --git a/gnu/usr.bin/cc/Makefile.tgt b/gnu/usr.bin/cc/Makefile.tgt index a1e6d08ed624..f0f15d175c78 100644 --- a/gnu/usr.bin/cc/Makefile.tgt +++ b/gnu/usr.bin/cc/Makefile.tgt @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif diff --git a/gnu/usr.bin/gdb/Makefile.inc b/gnu/usr.bin/gdb/Makefile.inc index 2888163467b4..eae2944e36b0 100644 --- a/gnu/usr.bin/gdb/Makefile.inc +++ b/gnu/usr.bin/gdb/Makefile.inc @@ -20,7 +20,7 @@ OBJ_GDB= ${OBJ_ROOT}/gdb # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif diff --git a/gnu/usr.bin/gdb/libgdb/Makefile b/gnu/usr.bin/gdb/libgdb/Makefile index bb18a8e6bdd9..8e86bf48471f 100644 --- a/gnu/usr.bin/gdb/libgdb/Makefile +++ b/gnu/usr.bin/gdb/libgdb/Makefile @@ -4,7 +4,7 @@ # MACHINE_CPUARCH, but there's no easy way to export make functions... .if defined(TARGET_ARCH) -TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/} +TARGET_CPUARCH=${TARGET_ARCH:C/mipse[bl]/mips/:C/armeb/arm/:C/powerpc64/powerpc/} .else TARGET_CPUARCH=${MACHINE_CPUARCH} .endif diff --git a/lib/libc/gen/pututxline.c b/lib/libc/gen/pututxline.c index 3b2c7a808ebe..5a9bab966e97 100644 --- a/lib/libc/gen/pututxline.c +++ b/lib/libc/gen/pututxline.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,6 +54,7 @@ futx_open(const char *file) /* Safety check: never use broken files. */ if (_fstat(fd, &sb) != -1 && sb.st_size % sizeof(struct futx) != 0) { _close(fd); + errno = EINVAL; return (NULL); } @@ -142,6 +144,7 @@ utx_active_remove(struct futx *fu) } fclose(fp); + errno = ESRCH; return (1); } diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c index 37f6a724dee1..b6d3bcd16e22 100644 --- a/lib/libkvm/kvm.c +++ b/lib/libkvm/kvm.c @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (Berkeley) 2/13/94"; #include #include #include +#include #include @@ -433,7 +434,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize) if (error > 0 && _kvm_dpcpu_initialized(kd, initialize)) error = kvm_fdnlist_prefix(kd, nl, error, - "pcpu_entry_", _kvm_dpcpu_validaddr); + DPCPU_SYMPREFIX, _kvm_dpcpu_validaddr); return (error); } @@ -473,7 +474,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize) p->n_value = _kvm_vnet_validaddr(kd, lookup.symvalue); else if (_kvm_dpcpu_initialized(kd, initialize) && - !strcmp(prefix, "pcpu_entry_")) + !strcmp(prefix, DPCPU_SYMPREFIX)) p->n_value = _kvm_dpcpu_validaddr(kd, lookup.symvalue); else @@ -495,7 +496,7 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int initialize) } if (error && _kvm_dpcpu_initialized(kd, initialize) && !tried_dpcpu) { tried_dpcpu = 1; - prefix = "pcpu_entry_"; + prefix = DPCPU_SYMPREFIX; goto again; } diff --git a/lib/libkvm/kvm_pcpu.c b/lib/libkvm/kvm_pcpu.c index 484d2ea48505..d896c4f036e9 100644 --- a/lib/libkvm/kvm_pcpu.c +++ b/lib/libkvm/kvm_pcpu.c @@ -197,9 +197,9 @@ _kvm_dpcpu_init(kvm_t *kd) { struct nlist nl[] = { #define NLIST_START_SET_PCPU 0 - { "___start_set_pcpu" }, + { "___start_" DPCPU_SETNAME }, #define NLIST_STOP_SET_PCPU 1 - { "___stop_set_pcpu" }, + { "___stop_" DPCPU_SETNAME }, #define NLIST_DPCPU_OFF 2 { "_dpcpu_off" }, #define NLIST_MP_MAXCPUS 3 diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index 5795e952ea6e..b7bf4d84ad13 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -114,7 +114,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif -. elif ${MACHINE_CPUARCH} == "powerpc" +. elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" MACHINE_CPU = booke _CPUCFLAGS = -Wa,-me500 -msoft-float diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index 786d8ecf2a91..a1a3ebcf0ffb 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -415,9 +415,9 @@ trap(struct trapframe *frame) * This check also covers the images * without the ABI-tag ELF note. */ - if (SV_CURPROC_ABI() == - SV_ABI_FREEBSD && - p->p_osrel >= 700004) { + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD + && p->p_osrel >= + __FreeBSD_version_SIGSEGV) { i = SIGSEGV; ucode = SEGV_ACCERR; } else { diff --git a/sys/boot/i386/boot2/boot1.S b/sys/boot/i386/boot2/boot1.S index 0940167718f6..14d28b3f9594 100644 --- a/sys/boot/i386/boot2/boot1.S +++ b/sys/boot/i386/boot2/boot1.S @@ -239,7 +239,7 @@ error: callw putstr # Display message xorb %ah,%ah # BIOS: Get int $0x16 # keypress movw $0x1234, BDA_BOOT # Do a warm boot - ljmp $0xffff,$0x0 # reboot the machine + ljmp $0xf000,$0xfff0 # reboot the machine /* * Display a null-terminated string using the BIOS output. */ diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index c175522fdc6e..fe7c90b4e43d 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -2470,11 +2470,15 @@ static void arcmsr_action(struct cam_sim * psim, union ccb * pccb) splx(s); } else { /* Buffer is physical */ +#ifdef PAE + panic("arcmsr: CAM_DATA_PHYS not supported"); +#else struct bus_dma_segment seg; seg.ds_addr = (bus_addr_t)pccb->csio.data_ptr; seg.ds_len = pccb->csio.dxfer_len; arcmsr_execute_srb(srb, &seg, 1, 0); +#endif } } else { /* Scatter/gather list */ diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 2d38b8ee4aa7..c9200f32c0a9 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -1143,7 +1143,7 @@ bce_attach(device_t dev) /* MII child bus by attaching the PHY. */ rc = mii_attach(dev, &sc->bce_miibus, ifp, bce_ifmedia_upd, bce_ifmedia_sts, BMSR_DEFCAPMASK, sc->bce_phy_addr, - MII_OFFSET_ANY, 0); + MII_OFFSET_ANY, MIIF_DOPAUSE); if (rc != 0) { BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, __LINE__); @@ -1769,8 +1769,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - /* FLAG0 is set if RX is enabled and FLAG1 if TX is enabled */ - if (mii->mii_media_active & IFM_FLAG0) { + if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -1780,7 +1779,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if (mii->mii_media_active & IFM_FLAG1) { + if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 59ce673896d6..c3bdcaf06fe3 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -914,11 +914,13 @@ bge_miibus_statchg(device_t dev) if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX); - if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG1) + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_TXPAUSE) != 0) BGE_SETBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); else BGE_CLRBIT(sc, BGE_TX_MODE, BGE_TXMODE_FLOWCTL_ENABLE); - if (IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) BGE_SETBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); else BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_FLOWCTL_ENABLE); @@ -2638,7 +2640,7 @@ bge_attach(device_t dev) struct bge_softc *sc; uint32_t hwcfg = 0, misccfg; u_char eaddr[ETHER_ADDR_LEN]; - int error, f, msicount, phy_addr, reg, rid, trys; + int capmask, error, f, msicount, phy_addr, reg, rid, trys; sc = device_get_softc(dev); sc->bge_dev = dev; @@ -2822,13 +2824,31 @@ bge_attach(device_t dev) if (BGE_IS_5755_PLUS(sc) == 0) sc->bge_flags |= BGE_FLAG_4G_BNDRY_BUG; + misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID; if (sc->bge_asicrev == BGE_ASICREV_BCM5705) { - misccfg = CSR_READ_4(sc, BGE_MISC_CFG) & BGE_MISCCFG_BOARD_ID; if (misccfg == BGE_MISCCFG_BOARD_ID_5788 || misccfg == BGE_MISCCFG_BOARD_ID_5788M) sc->bge_flags |= BGE_FLAG_5788; } + capmask = BMSR_DEFCAPMASK; + if ((sc->bge_asicrev == BGE_ASICREV_BCM5703 && + (misccfg == 0x4000 || misccfg == 0x8000)) || + (sc->bge_asicrev == BGE_ASICREV_BCM5705 && + pci_get_vendor(dev) == BCOM_VENDORID && + (pci_get_device(dev) == BCOM_DEVICEID_BCM5901 || + pci_get_device(dev) == BCOM_DEVICEID_BCM5901A2 || + pci_get_device(dev) == BCOM_DEVICEID_BCM5705F)) || + (pci_get_vendor(dev) == BCOM_VENDORID && + (pci_get_device(dev) == BCOM_DEVICEID_BCM5751F || + pci_get_device(dev) == BCOM_DEVICEID_BCM5753F || + pci_get_device(dev) == BCOM_DEVICEID_BCM5787F)) || + pci_get_device(dev) == BCOM_DEVICEID_BCM57790 || + sc->bge_asicrev == BGE_ASICREV_BCM5906) { + /* These chips are 10/100 only. */ + capmask &= ~BMSR_EXTSTAT; + } + /* * Some controllers seem to require a special firmware to use * TSO. But the firmware is not available to FreeBSD and Linux @@ -3102,9 +3122,9 @@ bge_attach(device_t dev) again: bge_asf_driver_up(sc); - error = (mii_attach(dev, &sc->bge_miibus, ifp, - bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, - phy_addr, MII_OFFSET_ANY, 0)); + error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd, + bge_ifmedia_sts, capmask, phy_addr, MII_OFFSET_ANY, + MIIF_DOPAUSE); if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); diff --git a/sys/dev/mii/atphy.c b/sys/dev/mii/atphy.c index 41cd72cc4afe..cfabd21ef18e 100644 --- a/sys/dev/mii/atphy.c +++ b/sys/dev/mii/atphy.c @@ -82,7 +82,7 @@ static int atphy_service(struct mii_softc *, struct mii_data *, int); static void atphy_status(struct mii_softc *); static void atphy_reset(struct mii_softc *); static uint16_t atphy_anar(struct ifmedia_entry *); -static int atphy_auto(struct mii_softc *); +static int atphy_setmedia(struct mii_softc *, int); static const struct mii_phydesc atphys[] = { MII_PHY_DESC(ATHEROS, F1), @@ -158,7 +158,7 @@ atphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { - atphy_auto(sc); + atphy_setmedia(sc, ife->ifm_media); break; } @@ -175,7 +175,7 @@ atphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) /* * XXX * Due to an unknown reason powering down PHY resulted - * in unexpected results such as inaccessbility of + * in unexpected results such as inaccessibility of * hardware of freshly rebooted system. Disable * powering down PHY until I got more information for * Attansic/Atheros PHY hardwares. @@ -189,8 +189,9 @@ atphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) anar = atphy_anar(ife); if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) { bmcr |= BMCR_FDX; - /* Enable pause. */ - anar |= (3 << 10); + if (((ife->ifm_media & IFM_GMASK) & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= ANAR_PAUSE_TOWARDS; } if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | @@ -222,7 +223,7 @@ atphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) } /* - * check for link. + * Check for link. * Read the status register twice; BMSR_LINK is latch-low. */ bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); @@ -238,7 +239,7 @@ atphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) return (0); sc->mii_ticks = 0; - atphy_auto(sc); + atphy_setmedia(sc, ife->ifm_media); break; } @@ -284,7 +285,7 @@ atphy_status(struct mii_softc *sc) case ATPHY_SSR_1000MBS: mii->mii_media_active |= IFM_1000_T; /* - * atphy(4) got a valid link so reset mii_ticks. + * atphy(4) has a valid link so reset mii_ticks. * Resetting mii_ticks is needed in order to * detect link loss after auto-negotiation. */ @@ -304,11 +305,13 @@ atphy_status(struct mii_softc *sc) } if ((ssr & ATPHY_SSR_DUPLEX) != 0) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; - /* XXX Master/Slave, Flow-control */ + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) && + (PHY_READ(sc, MII_100T2SR) & GTSR_MS_RES) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; } static void @@ -336,7 +339,7 @@ atphy_reset(struct mii_softc *sc) PHY_WRITE(sc, ATPHY_SCR, reg); /* Workaround F1 bug to reset phy. */ - atphy_auto(sc); + atphy_setmedia(sc, sc->mii_pdata->mii_media.ifm_cur->ifm_media); for (i = 0; i < 1000; i++) { DELAY(1); @@ -378,12 +381,17 @@ atphy_anar(struct ifmedia_entry *ife) } static int -atphy_auto(struct mii_softc *sc) +atphy_setmedia(struct mii_softc *sc, int media) { uint16_t anar; - anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities); - PHY_WRITE(sc, MII_ANAR, anar | (3 << 10) | ANAR_CSMA); + anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; + if (((IFM_SUBTYPE(media) == IFM_AUTO || + ((media & IFM_GMASK) & IFM_FDX) != 0) && + ((media & IFM_GMASK) & IFM_FLOW) != 0) || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= ANAR_PAUSE_TOWARDS; + PHY_WRITE(sc, MII_ANAR, anar); if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX); diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 62fcd8f360ef..96947d401f8c 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -99,9 +99,9 @@ static driver_t brgphy_driver = { DRIVER_MODULE(brgphy, miibus, brgphy_driver, brgphy_devclass, 0, 0); static int brgphy_service(struct mii_softc *, struct mii_data *, int); -static void brgphy_setmedia(struct mii_softc *, int, int); +static void brgphy_setmedia(struct mii_softc *, int); static void brgphy_status(struct mii_softc *); -static void brgphy_mii_phy_auto(struct mii_softc *); +static void brgphy_mii_phy_auto(struct mii_softc *, int); static void brgphy_reset(struct mii_softc *); static void brgphy_enable_loopback(struct mii_softc *); static void bcm5401_load_dspcode(struct mii_softc *); @@ -169,6 +169,7 @@ detect_hs21(struct bce_softc *bce_sc) static int brgphy_probe(device_t dev) { + return (mii_phy_dev_probe(dev, brgphys, BUS_PROBE_DEFAULT)); } @@ -183,7 +184,6 @@ brgphy_attach(device_t dev) struct mii_attach_args *ma; struct mii_data *mii; struct ifnet *ifp; - int fast_ether; bsc = device_get_softc(dev); sc = &bsc->mii_sc; @@ -203,8 +203,7 @@ brgphy_attach(device_t dev) * At least some variants wedge when isolating, at least some also * don't support loopback. */ - sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP; - sc->mii_anegticks = MII_ANEGTICKS_GIGE; + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOLOOP | MIIF_NOMANPAUSE; /* Initialize brgphy_softc structure */ bsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); @@ -212,8 +211,6 @@ brgphy_attach(device_t dev) bsc->mii_rev = MII_REV(ma->mii_id2); bsc->serdes_flags = 0; - fast_ether = 0; - if (bootverbose) device_printf(dev, "OUI 0x%06x, model 0x%04x, rev. %d\n", bsc->mii_oui, bsc->mii_model, bsc->mii_rev); @@ -271,18 +268,6 @@ brgphy_attach(device_t dev) bce_sc = ifp->if_softc; } - /* Todo: Need to add additional controllers such as 5906 & 5787F */ - /* The 590x chips are 10/100 only. */ - if (bge_sc && - pci_get_vendor(bge_sc->bge_dev) == BCOM_VENDORID && - (pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901 || - pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5901A2 || - pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5906 || - pci_get_device(bge_sc->bge_dev) == BCOM_DEVICEID_BCM5906M)) { - fast_ether = 1; - sc->mii_anegticks = MII_ANEGTICKS; - } - brgphy_reset(sc); /* Read the PHY's capabilities. */ @@ -295,27 +280,10 @@ brgphy_attach(device_t dev) /* Add the supported media types */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, 0, sc->mii_inst), - BRGPHY_S10); - printf("10baseT, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), - BRGPHY_S10 | BRGPHY_BMCR_FDX); - printf("10baseT-FDX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), - BRGPHY_S100); - printf("100baseTX, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), - BRGPHY_S100 | BRGPHY_BMCR_FDX); - printf("100baseTX-FDX, "); - if (fast_ether == 0) { - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), - BRGPHY_S1000); - printf("1000baseT, "); - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), - BRGPHY_S1000 | BRGPHY_BMCR_FDX); - printf("1000baseT-FDX, "); - } + mii_phy_add_media(sc); + printf("\n"); } else { + sc->mii_anegticks = MII_ANEGTICKS_GIGE; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, sc->mii_inst), BRGPHY_S1000 | BRGPHY_BMCR_FDX); printf("1000baseSX-FDX, "); @@ -337,11 +305,10 @@ brgphy_attach(device_t dev) printf("auto-neg workaround, "); bsc->serdes_flags |= BRGPHY_NOANWAIT; } + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0); + printf("auto\n"); } - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 0); - printf("auto\n"); - #undef ADD MIIBUS_MEDIAINIT(sc->mii_dev); return (0); @@ -367,15 +334,14 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: - brgphy_mii_phy_auto(sc); + brgphy_mii_phy_auto(sc, ife->ifm_media); break; case IFM_2500_SX: case IFM_1000_SX: case IFM_1000_T: case IFM_100_TX: case IFM_10_T: - brgphy_setmedia(sc, ife->ifm_media, - mii->mii_ifp->if_flags & IFF_LINK0); + brgphy_setmedia(sc, ife->ifm_media); break; default: return (EINVAL); @@ -397,7 +363,7 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) * Check to see if we have link. If we do, we don't * need to restart the autonegotiation process. */ - val = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); + val = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); if (val & BMSR_LINK) { sc->mii_ticks = 0; /* Reset autoneg timer. */ break; @@ -414,7 +380,7 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) /* Retry autonegotiation */ sc->mii_ticks = 0; - brgphy_mii_phy_auto(sc); + brgphy_mii_phy_auto(sc, ife->ifm_media); break; } @@ -456,7 +422,6 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) return (0); } - /****************************************************************************/ /* Sets the PHY link speed. */ /* */ @@ -464,12 +429,10 @@ brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) /* None */ /****************************************************************************/ static void -brgphy_setmedia(struct mii_softc *sc, int media, int master) +brgphy_setmedia(struct mii_softc *sc, int media) { - struct brgphy_softc *bsc = (struct brgphy_softc *)sc; int bmcr = 0, gig; - /* Calculate the value for the BMCR register. */ switch (IFM_SUBTYPE(media)) { case IFM_2500_SX: break; @@ -486,7 +449,6 @@ brgphy_setmedia(struct mii_softc *sc, int media, int master) break; } - /* Calculate duplex settings for 1000BasetT/1000BaseX. */ if ((media & IFM_GMASK) == IFM_FDX) { bmcr |= BRGPHY_BMCR_FDX; gig = BRGPHY_1000CTL_AFD; @@ -494,53 +456,30 @@ brgphy_setmedia(struct mii_softc *sc, int media, int master) gig = BRGPHY_1000CTL_AHD; } - /* Force loopback to disconnect PHY for Ethernet medium. */ + /* Force loopback to disconnect PHY from Ethernet medium. */ brgphy_enable_loopback(sc); - /* Disable 1000BaseT advertisements. */ PHY_WRITE(sc, BRGPHY_MII_1000CTL, 0); - /* Disable 10/100 advertisements. */ PHY_WRITE(sc, BRGPHY_MII_ANAR, BRGPHY_SEL_TYPE); - /* Write forced link speed. */ - PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr); - /* If 10/100 only then configuration is complete. */ - if ((IFM_SUBTYPE(media) != IFM_1000_T) && (IFM_SUBTYPE(media) != IFM_1000_SX)) - goto brgphy_setmedia_exit; - - /* Set duplex speed advertisement for 1000BaseT/1000BaseX. */ - PHY_WRITE(sc, BRGPHY_MII_1000CTL, gig); - /* Restart auto-negotiation for 1000BaseT/1000BaseX. */ - PHY_WRITE(sc, BRGPHY_MII_BMCR, - bmcr | BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG); - - /* If not 5701 PHY then configuration is complete. */ - if (bsc->mii_model != MII_MODEL_xxBROADCOM_BCM5701) - goto brgphy_setmedia_exit; - - /* - * When setting the link manually, one side must be the master and - * the other the slave. However ifmedia doesn't give us a good way - * to specify this, so we fake it by using one of the LINK flags. - * If LINK0 is set, we program the PHY to be a master, otherwise - * it's a slave. - */ - if (master) { - PHY_WRITE(sc, BRGPHY_MII_1000CTL, - gig | BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC); - } else { - PHY_WRITE(sc, BRGPHY_MII_1000CTL, - gig | BRGPHY_1000CTL_MSE); + if (IFM_SUBTYPE(media) != IFM_1000_T && + IFM_SUBTYPE(media) != IFM_1000_SX) { + PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr); + return; } -brgphy_setmedia_exit: - return; + if (IFM_SUBTYPE(media) == IFM_1000_T) { + gig |= BRGPHY_1000CTL_MSE; + if ((media & IFM_ETH_MASTER) != 0) + gig |= BRGPHY_1000CTL_MSC; + } + PHY_WRITE(sc, BRGPHY_MII_1000CTL, gig); + PHY_WRITE(sc, BRGPHY_MII_BMCR, + bmcr | BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG); } /****************************************************************************/ /* Set the media status based on the PHY settings. */ -/* IFM_FLAG0 = 0 (RX flow control disabled) | 1 (enabled) */ -/* IFM_FLAG1 = 0 (TX flow control disabled) | 1 (enabled) */ /* */ /* Returns: */ /* None */ @@ -550,34 +489,34 @@ brgphy_status(struct mii_softc *sc) { struct brgphy_softc *bsc = (struct brgphy_softc *)sc; struct mii_data *mii = sc->mii_pdata; - int aux, bmcr, bmsr, anar, anlpar, xstat, val; - + int aux, bmcr, bmsr, val, xstat; + u_int flowstat; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; bmsr = PHY_READ(sc, BRGPHY_MII_BMSR) | PHY_READ(sc, BRGPHY_MII_BMSR); bmcr = PHY_READ(sc, BRGPHY_MII_BMCR); - anar = PHY_READ(sc, BRGPHY_MII_ANAR); - anlpar = PHY_READ(sc, BRGPHY_MII_ANLPAR); - /* Loopback is enabled. */ if (bmcr & BRGPHY_BMCR_LOOP) { - mii->mii_media_active |= IFM_LOOP; } - /* Autoneg is still in progress. */ if ((bmcr & BRGPHY_BMCR_AUTOEN) && (bmsr & BRGPHY_BMSR_ACOMP) == 0 && (bsc->serdes_flags & BRGPHY_NOANWAIT) == 0) { /* Erg, still trying, I guess... */ mii->mii_media_active |= IFM_NONE; - goto brgphy_status_exit; + return; } - /* Autoneg is enabled and complete, link should be up. */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { + /* + * NB: reading the ANAR, ANLPAR or 1000STS after the AUXSTS + * wedges at least the PHY of BCM5704 (but not others). + */ + flowstat = mii_phy_flowstatus(sc); + xstat = PHY_READ(sc, BRGPHY_MII_1000STS); aux = PHY_READ(sc, BRGPHY_MII_AUXSTS); /* If copper link is up, get the negotiated speed/duplex. */ @@ -601,8 +540,16 @@ brgphy_status(struct mii_softc *sc) default: mii->mii_media_active |= IFM_NONE; break; } + + if ((mii->mii_media_active & IFM_FDX) != 0) + mii->mii_media_active |= flowstat; + + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T && + (xstat & BRGPHY_1000STS_MSR) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; } } else { + /* Todo: Add support for flow control. */ /* If serdes link is up, get the negotiated speed/duplex. */ if (bmsr & BRGPHY_BMSR_LINK) { mii->mii_media_status |= IFM_ACTIVE; @@ -620,7 +567,6 @@ brgphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_HDX; } - } else if (bsc->serdes_flags & BRGPHY_5708S) { PHY_WRITE(sc, BRGPHY_5708S_BLOCK_ADDR, BRGPHY_5708S_DIG_PG0); xstat = PHY_READ(sc, BRGPHY_5708S_PG0_1000X_STAT1); @@ -642,9 +588,7 @@ brgphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; - } else if (bsc->serdes_flags & BRGPHY_5709S) { - /* Select GP Status Block of the AN MMD, get autoneg results. */ PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_GP_STATUS); xstat = PHY_READ(sc, BRGPHY_GP_STATUS_TOP_ANEG_STATUS); @@ -670,65 +614,42 @@ brgphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_HDX; } - } - - /* Todo: Change bge to use these settings. */ - - /* Fetch flow control settings from the copper PHY. */ - if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - /* Set FLAG0 if RX is enabled and FLAG1 if TX is enabled */ - if ((anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANLPAR_PC)) { - mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; - } else if (!(anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANAR_ASP) && - (anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { - mii->mii_media_active |= IFM_FLAG1; - } else if ((anar & BRGPHY_ANAR_PC) && (anar & BRGPHY_ANAR_ASP) && - !(anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { - mii->mii_media_active |= IFM_FLAG0; - } - } - - /* Todo: Add support for fiber settings too. */ - - -brgphy_status_exit: - return; } static void -brgphy_mii_phy_auto(struct mii_softc *sc) +brgphy_mii_phy_auto(struct mii_softc *sc, int media) { struct brgphy_softc *bsc = (struct brgphy_softc *)sc; - int ktcr = 0; + int anar, ktcr = 0; brgphy_reset(sc); - /* Enable flow control in the advertisement register. */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - /* Pause capability advertisement (pause capable & asymmetric) */ - PHY_WRITE(sc, BRGPHY_MII_ANAR, - BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA | - BRGPHY_ANAR_ASP | BRGPHY_ANAR_PC); + anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; + if ((media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= BRGPHY_ANAR_PC | BRGPHY_ANAR_ASP; + PHY_WRITE(sc, BRGPHY_MII_ANAR, anar); } else { - PHY_WRITE(sc, BRGPHY_SERDES_ANAR, BRGPHY_SERDES_ANAR_FDX | - BRGPHY_SERDES_ANAR_HDX | BRGPHY_SERDES_ANAR_BOTH_PAUSE); + anar = BRGPHY_SERDES_ANAR_FDX | BRGPHY_SERDES_ANAR_HDX; + if ((media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= BRGPHY_SERDES_ANAR_BOTH_PAUSE; + PHY_WRITE(sc, BRGPHY_SERDES_ANAR, anar); } - /* Enable speed in the 1000baseT control register */ ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD; if (bsc->mii_model == MII_MODEL_xxBROADCOM_BCM5701) ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC; PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr); ktcr = PHY_READ(sc, BRGPHY_MII_1000CTL); - /* Start autonegotiation */ - PHY_WRITE(sc, BRGPHY_MII_BMCR,BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG); + PHY_WRITE(sc, BRGPHY_MII_BMCR, BRGPHY_BMCR_AUTOEN | + BRGPHY_BMCR_STARTNEG); PHY_WRITE(sc, BRGPHY_MII_IMR, 0xFF00); - } - /* Enable loopback to force the link down. */ static void brgphy_enable_loopback(struct mii_softc *sc) @@ -923,7 +844,6 @@ brgphy_fixup_jitter_bug(struct mii_softc *sc) PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); } - static void brgphy_fixup_disable_early_dac(struct mii_softc *sc) { @@ -936,7 +856,6 @@ brgphy_fixup_disable_early_dac(struct mii_softc *sc) } - static void brgphy_ethernet_wirespeed(struct mii_softc *sc) { @@ -948,7 +867,6 @@ brgphy_ethernet_wirespeed(struct mii_softc *sc) PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4)); } - static void brgphy_jumbo_settings(struct mii_softc *sc, u_long mtu) { @@ -989,7 +907,7 @@ brgphy_reset(struct mii_softc *sc) struct bge_softc *bge_sc = NULL; struct bce_softc *bce_sc = NULL; struct ifnet *ifp; - int val; + int val; /* Perform a standard PHY reset. */ mii_phy_reset(sc); @@ -1029,7 +947,6 @@ brgphy_reset(struct mii_softc *sc) bce_sc = ifp->if_softc; } - /* Handle any bge (NetXtreme/NetLink) workarounds. */ if (bge_sc) { /* Fix up various bugs */ if (bge_sc->bge_phy_flags & BGE_PHY_5704_A0_BUG) @@ -1060,10 +977,7 @@ brgphy_reset(struct mii_softc *sc) /* Adjust output voltage (From Linux driver) */ if (bge_sc->bge_asicrev == BGE_ASICREV_BCM5906) PHY_WRITE(sc, BRGPHY_MII_EPHY_PTEST, 0x12); - - /* Handle any bce (NetXtreme II) workarounds. */ } else if (bce_sc) { - if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5708 && (bce_sc->bce_phy_flags & BCE_PHY_SERDES_FLAG)) { @@ -1154,7 +1068,6 @@ brgphy_reset(struct mii_softc *sc) /* Restore IEEE0 block (assumed in all brgphy(4) code). */ PHY_WRITE(sc, BRGPHY_BLOCK_ADDR, BRGPHY_BLOCK_ADDR_COMBO_IEEE0); - } else if (BCE_CHIP_NUM(bce_sc) == BCE_CHIP_NUM_5709) { if ((BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Ax) || (BCE_CHIP_REV(bce_sc) == BCE_CHIP_REV_Bx)) @@ -1167,6 +1080,5 @@ brgphy_reset(struct mii_softc *sc) brgphy_jumbo_settings(sc, ifp->if_mtu); brgphy_ethernet_wirespeed(sc); } - } } diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c index cb94f85acc80..3f320fb4a464 100644 --- a/sys/dev/mii/ciphy.c +++ b/sys/dev/mii/ciphy.c @@ -165,7 +165,7 @@ ciphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (PHY_READ(sc, CIPHY_MII_BMCR) & CIPHY_BMCR_AUTOEN) return (0); #endif - (void) mii_phy_auto(sc); + (void)mii_phy_auto(sc); break; case IFM_1000_T: speed = CIPHY_S1000; @@ -190,30 +190,16 @@ ciphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) break; + gig |= CIPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= CIPHY_1000CTL_MSC; PHY_WRITE(sc, CIPHY_MII_1000CTL, gig); PHY_WRITE(sc, CIPHY_MII_BMCR, - speed|CIPHY_BMCR_AUTOEN|CIPHY_BMCR_STARTNEG); - - /* - * When setting the link manually, one side must - * be the master and the other the slave. However - * ifmedia doesn't give us a good way to specify - * this, so we fake it by using one of the LINK - * flags. If LINK0 is set, we program the PHY to - * be a master, otherwise it's a slave. - */ - if ((mii->mii_ifp->if_flags & IFF_LINK0)) { - PHY_WRITE(sc, CIPHY_MII_1000CTL, - gig|CIPHY_1000CTL_MSE|CIPHY_1000CTL_MSC); - } else { - PHY_WRITE(sc, CIPHY_MII_1000CTL, - gig|CIPHY_1000CTL_MSE); - } + speed | CIPHY_BMCR_AUTOEN | CIPHY_BMCR_STARTNEG); break; case IFM_NONE: - PHY_WRITE(sc, MII_BMCR, BMCR_ISO|BMCR_PDOWN); + PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); break; - case IFM_100_T4: default: return (EINVAL); } @@ -319,6 +305,10 @@ ciphy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_FDX; else mii->mii_media_active |= IFM_HDX; + + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) && + (PHY_READ(sc, CIPHY_MII_1000STS) & CIPHY_1000STS_MSR) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; } static void diff --git a/sys/dev/mii/e1000phy.c b/sys/dev/mii/e1000phy.c index f49f7c48c6a6..1c0a267a0834 100644 --- a/sys/dev/mii/e1000phy.c +++ b/sys/dev/mii/e1000phy.c @@ -91,7 +91,7 @@ DRIVER_MODULE(e1000phy, miibus, e1000phy_driver, e1000phy_devclass, 0, 0); static int e1000phy_service(struct mii_softc *, struct mii_data *, int); static void e1000phy_status(struct mii_softc *); static void e1000phy_reset(struct mii_softc *); -static int e1000phy_mii_phy_auto(struct e1000phy_softc *); +static int e1000phy_mii_phy_auto(struct e1000phy_softc *, int); static const struct mii_phydesc e1000phys[] = { MII_PHY_DESC(MARVELL, E1000), @@ -146,6 +146,8 @@ e1000phy_attach(device_t dev) sc->mii_service = e1000phy_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOMANPAUSE; + esc->mii_model = MII_MODEL(ma->mii_id2); ifp = sc->mii_pdata->mii_ifp; if (strcmp(ifp->if_dname, "msk") == 0 && @@ -323,7 +325,7 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) break; if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { - e1000phy_mii_phy_auto(esc); + e1000phy_mii_phy_auto(esc, ife->ifm_media); break; } @@ -366,27 +368,14 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) reg &= ~E1000_CR_AUTO_NEG_ENABLE; PHY_WRITE(sc, E1000_CR, reg | E1000_CR_RESET); - /* - * When setting the link manually, one side must - * be the master and the other the slave. However - * ifmedia doesn't give us a good way to specify - * this, so we fake it by using one of the LINK - * flags. If LINK0 is set, we program the PHY to - * be a master, otherwise it's a slave. - */ - if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T || - (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_SX)) { - if ((mii->mii_ifp->if_flags & IFF_LINK0)) - PHY_WRITE(sc, E1000_1GCR, gig | - E1000_1GCR_MS_ENABLE | E1000_1GCR_MS_VALUE); - else - PHY_WRITE(sc, E1000_1GCR, gig | - E1000_1GCR_MS_ENABLE); - } else { - if ((sc->mii_extcapabilities & - (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) - PHY_WRITE(sc, E1000_1GCR, 0); - } + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= E1000_1GCR_MS_ENABLE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= E1000_1GCR_MS_VALUE; + PHY_WRITE(sc, E1000_1GCR, gig); + } else if ((sc->mii_extcapabilities & + (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) + PHY_WRITE(sc, E1000_1GCR, 0); PHY_WRITE(sc, E1000_AR, E1000_AR_SELECTOR_FIELD); PHY_WRITE(sc, E1000_CR, speed | E1000_CR_RESET); done: @@ -424,7 +413,7 @@ e1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) sc->mii_ticks = 0; e1000phy_reset(sc); - e1000phy_mii_phy_auto(esc); + e1000phy_mii_phy_auto(esc, ife->ifm_media); break; } @@ -440,7 +429,7 @@ static void e1000phy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; - int bmcr, bmsr, gsr, ssr, ar, lpar; + int bmcr, bmsr, ssr; mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; @@ -485,38 +474,22 @@ e1000phy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_1000_SX; } - if (ssr & E1000_SSR_DUPLEX) + if (ssr & E1000_SSR_DUPLEX) { mii->mii_media_active |= IFM_FDX; - else + if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) + mii->mii_media_active |= mii_phy_flowstatus(sc); + } else mii->mii_media_active |= IFM_HDX; - if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - ar = PHY_READ(sc, E1000_AR); - lpar = PHY_READ(sc, E1000_LPAR); - /* FLAG0==rx-flow-control FLAG1==tx-flow-control */ - if ((ar & E1000_AR_PAUSE) && (lpar & E1000_LPAR_PAUSE)) { - mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; - } else if (!(ar & E1000_AR_PAUSE) && (ar & E1000_AR_ASM_DIR) && - (lpar & E1000_LPAR_PAUSE) && (lpar & E1000_LPAR_ASM_DIR)) { - mii->mii_media_active |= IFM_FLAG1; - } else if ((ar & E1000_AR_PAUSE) && (ar & E1000_AR_ASM_DIR) && - !(lpar & E1000_LPAR_PAUSE) && (lpar & E1000_LPAR_ASM_DIR)) { - mii->mii_media_active |= IFM_FLAG0; - } - } - - /* FLAG2 : local PHY resolved to MASTER */ - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) || - (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX)) { - PHY_READ(sc, E1000_1GSR); - gsr = PHY_READ(sc, E1000_1GSR); - if ((gsr & E1000_1GSR_MS_CONFIG_RES) != 0) - mii->mii_media_active |= IFM_FLAG2; + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) { + if (((PHY_READ(sc, E1000_1GSR) | PHY_READ(sc, E1000_1GSR)) & + E1000_1GSR_MS_CONFIG_RES) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; } } static int -e1000phy_mii_phy_auto(struct e1000phy_softc *esc) +e1000phy_mii_phy_auto(struct e1000phy_softc *esc, int media) { struct mii_softc *sc; uint16_t reg; @@ -525,12 +498,13 @@ e1000phy_mii_phy_auto(struct e1000phy_softc *esc) if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { reg = PHY_READ(sc, E1000_AR); reg |= E1000_AR_10T | E1000_AR_10T_FD | - E1000_AR_100TX | E1000_AR_100TX_FD | - E1000_AR_PAUSE | E1000_AR_ASM_DIR; + E1000_AR_100TX | E1000_AR_100TX_FD; + if ((media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + reg |= E1000_AR_PAUSE | E1000_AR_ASM_DIR; PHY_WRITE(sc, E1000_AR, reg | E1000_AR_SELECTOR_FIELD); } else - PHY_WRITE(sc, E1000_AR, E1000_FA_1000X_FD | E1000_FA_1000X | - E1000_FA_SYM_PAUSE | E1000_FA_ASYM_PAUSE); + PHY_WRITE(sc, E1000_AR, E1000_FA_1000X_FD | E1000_FA_1000X); if ((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, E1000_1GCR, E1000_1GCR_1000T_FD | E1000_1GCR_1000T); diff --git a/sys/dev/mii/gentbi.c b/sys/dev/mii/gentbi.c index ee08efed758f..f5d3a8b5b45f 100644 --- a/sys/dev/mii/gentbi.c +++ b/sys/dev/mii/gentbi.c @@ -267,7 +267,8 @@ gentbi_status(struct mii_softc *sc) anlpar = PHY_READ(sc, MII_ANLPAR); if ((sc->mii_extcapabilities & EXTSR_1000XFDX) != 0 && (anlpar & ANLPAR_X_FD) != 0) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= + IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; } else diff --git a/sys/dev/mii/ip1000phy.c b/sys/dev/mii/ip1000phy.c index b60fab6fc783..242baf7ed464 100644 --- a/sys/dev/mii/ip1000phy.c +++ b/sys/dev/mii/ip1000phy.c @@ -84,7 +84,7 @@ DRIVER_MODULE(ip1000phy, miibus, ip1000phy_driver, ip1000phy_devclass, 0, 0); static int ip1000phy_service(struct mii_softc *, struct mii_data *, int); static void ip1000phy_status(struct mii_softc *); static void ip1000phy_reset(struct mii_softc *); -static int ip1000phy_mii_phy_auto(struct mii_softc *); +static int ip1000phy_mii_phy_auto(struct mii_softc *, int); static const struct mii_phydesc ip1000phys[] = { MII_PHY_DESC(ICPLUS, IP1000A), @@ -120,7 +120,7 @@ ip1000phy_attach(device_t dev) sc->mii_service = ip1000phy_service; sc->mii_pdata = mii; - sc->mii_flags |= MIIF_NOISOLATE; + sc->mii_flags |= MIIF_NOISOLATE | MIIF_NOMANPAUSE; isc->model = MII_MODEL(ma->mii_id2); isc->revision = MII_REV(ma->mii_id2); @@ -163,9 +163,8 @@ ip1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) ip1000phy_reset(sc); switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: - (void)ip1000phy_mii_phy_auto(sc); + (void)ip1000phy_mii_phy_auto(sc, ife->ifm_media); goto done; - break; case IFM_1000_T: /* @@ -199,26 +198,10 @@ ip1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) break; + gig |= IP1000PHY_1000CR_MASTER | IP1000PHY_1000CR_MANUAL; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= IP1000PHY_1000CR_MMASTER; PHY_WRITE(sc, IP1000PHY_MII_1000CR, gig); - PHY_WRITE(sc, IP1000PHY_MII_BMCR, speed); - - /* - * When setting the link manually, one side must - * be the master and the other the slave. However - * ifmedia doesn't give us a good way to specify - * this, so we fake it by using one of the LINK - * flags. If LINK0 is set, we program the PHY to - * be a master, otherwise it's a slave. - */ - if ((mii->mii_ifp->if_flags & IFF_LINK0)) - PHY_WRITE(sc, IP1000PHY_MII_1000CR, gig | - IP1000PHY_1000CR_MASTER | - IP1000PHY_1000CR_MMASTER | - IP1000PHY_1000CR_MANUAL); - else - PHY_WRITE(sc, IP1000PHY_MII_1000CR, gig | - IP1000PHY_1000CR_MASTER | - IP1000PHY_1000CR_MANUAL); done: break; @@ -258,7 +241,7 @@ ip1000phy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) break; sc->mii_ticks = 0; - ip1000phy_mii_phy_auto(sc); + ip1000phy_mii_phy_auto(sc, ife->ifm_media); break; } @@ -276,7 +259,6 @@ ip1000phy_status(struct mii_softc *sc) struct ip1000phy_softc *isc; struct mii_data *mii = sc->mii_pdata; uint32_t bmsr, bmcr, stat; - uint32_t ar, lpar; isc = (struct ip1000phy_softc *)sc; @@ -345,36 +327,18 @@ ip1000phy_status(struct mii_softc *sc) mii->mii_media_active |= IFM_HDX; } - ar = PHY_READ(sc, IP1000PHY_MII_ANAR); - lpar = PHY_READ(sc, IP1000PHY_MII_ANLPAR); + if ((mii->mii_media_active & IFM_FDX) != 0) + mii->mii_media_active |= mii_phy_flowstatus(sc); - /* - * FLAG0 : Rx flow-control - * FLAG1 : Tx flow-control - */ - if ((ar & IP1000PHY_ANAR_PAUSE) && (lpar & IP1000PHY_ANLPAR_PAUSE)) - mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; - else if (!(ar & IP1000PHY_ANAR_PAUSE) && (ar & IP1000PHY_ANAR_APAUSE) && - (lpar & IP1000PHY_ANLPAR_PAUSE) && (lpar & IP1000PHY_ANLPAR_APAUSE)) - mii->mii_media_active |= IFM_FLAG1; - else if ((ar & IP1000PHY_ANAR_PAUSE) && (ar & IP1000PHY_ANAR_APAUSE) && - !(lpar & IP1000PHY_ANLPAR_PAUSE) && - (lpar & IP1000PHY_ANLPAR_APAUSE)) { - mii->mii_media_active |= IFM_FLAG0; - } - - /* - * FLAG2 : local PHY resolved to MASTER - */ if ((mii->mii_media_active & IFM_1000_T) != 0) { stat = PHY_READ(sc, IP1000PHY_MII_1000SR); if ((stat & IP1000PHY_1000SR_MASTER) != 0) - mii->mii_media_active |= IFM_FLAG2; + mii->mii_media_active |= IFM_ETH_MASTER; } } static int -ip1000phy_mii_phy_auto(struct mii_softc *sc) +ip1000phy_mii_phy_auto(struct mii_softc *sc, int media) { struct ip1000phy_softc *isc; uint32_t reg; @@ -386,8 +350,9 @@ ip1000phy_mii_phy_auto(struct mii_softc *sc) reg |= IP1000PHY_ANAR_NP; } reg |= IP1000PHY_ANAR_10T | IP1000PHY_ANAR_10T_FDX | - IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX | - IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; + IP1000PHY_ANAR_100TX | IP1000PHY_ANAR_100TX_FDX; + if ((media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + reg |= IP1000PHY_ANAR_PAUSE | IP1000PHY_ANAR_APAUSE; PHY_WRITE(sc, IP1000PHY_MII_ANAR, reg | IP1000PHY_ANAR_CSMA); reg = IP1000PHY_1000CR_1000T | IP1000PHY_1000CR_1000T_FDX; diff --git a/sys/dev/mii/jmphy.c b/sys/dev/mii/jmphy.c index 0b04d80dd068..00611c4d42d3 100644 --- a/sys/dev/mii/jmphy.c +++ b/sys/dev/mii/jmphy.c @@ -50,11 +50,11 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" -static int jmphy_probe(device_t); -static int jmphy_attach(device_t); +static int jmphy_probe(device_t); +static int jmphy_attach(device_t); static void jmphy_reset(struct mii_softc *); static uint16_t jmphy_anar(struct ifmedia_entry *); -static int jmphy_auto(struct mii_softc *, struct ifmedia_entry *); +static int jmphy_setmedia(struct mii_softc *, struct ifmedia_entry *); struct jmphy_softc { struct mii_softc mii_sc; @@ -154,7 +154,7 @@ jmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if ((mii->mii_ifp->if_flags & IFF_UP) == 0) break; - if (jmphy_auto(sc, ife) != EJUSTRETURN) + if (jmphy_setmedia(sc, ife) != EJUSTRETURN) return (EINVAL); break; @@ -186,7 +186,7 @@ jmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) return (0); sc->mii_ticks = 0; - jmphy_auto(sc, ife); + (void)jmphy_setmedia(sc, ife); break; } @@ -251,16 +251,14 @@ jmphy_status(struct mii_softc *sc) } if ((ssr & JMPHY_SSR_DUPLEX) != 0) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; - /* XXX Flow-control. */ -#ifdef notyet + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) { if ((PHY_READ(sc, MII_100T2SR) & GTSR_MS_RES) != 0) mii->mii_media_active |= IFM_ETH_MASTER; } -#endif } static void @@ -309,7 +307,7 @@ jmphy_anar(struct ifmedia_entry *ife) } static int -jmphy_auto(struct mii_softc *sc, struct ifmedia_entry *ife) +jmphy_setmedia(struct mii_softc *sc, struct ifmedia_entry *ife) { uint16_t anar, bmcr, gig; @@ -336,17 +334,18 @@ jmphy_auto(struct mii_softc *sc, struct ifmedia_entry *ife) bmcr |= BMCR_LOOP; anar = jmphy_anar(ife); - /* XXX Always advertise pause capability. */ - anar |= (3 << 10); + if (((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO || + (ife->ifm_media & IFM_FDX) != 0) && + (ife->ifm_media & IFM_FLOW) != 0) || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= ANAR_PAUSE_TOWARDS; if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { -#ifdef notyet - struct mii_data *mii; - - mii = sc->mii_pdata; - if ((mii->mii_media.ifm_media & IFM_ETH_MASTER) != 0) - gig |= GTCR_MAN_MS | GTCR_MAN_ADV; -#endif + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gig |= GTCR_MAN_MS; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= GTCR_ADV_MS; + } PHY_WRITE(sc, MII_100T2CR, gig); } PHY_WRITE(sc, MII_ANAR, anar | ANAR_CSMA); diff --git a/sys/dev/mii/mii.h b/sys/dev/mii/mii.h index b7e0a056bb6b..1d887d23ab12 100644 --- a/sys/dev/mii/mii.h +++ b/sys/dev/mii/mii.h @@ -128,6 +128,10 @@ #define ANAR_10_FD 0x0040 /* local device supports 10bT FD */ #define ANAR_10 0x0020 /* local device supports 10bT */ #define ANAR_CSMA 0x0001 /* protocol selector CSMA/CD */ +#define ANAR_PAUSE_NONE (0 << 10) +#define ANAR_PAUSE_SYM (1 << 10) +#define ANAR_PAUSE_ASYM (2 << 10) +#define ANAR_PAUSE_TOWARDS (3 << 10) #define ANAR_X_FD 0x0020 /* local device supports 1000BASE-X FD */ #define ANAR_X_HD 0x0040 /* local device supports 1000BASE-X HD */ @@ -148,6 +152,11 @@ #define ANLPAR_10_FD 0x0040 /* link partner supports 10bT FD */ #define ANLPAR_10 0x0020 /* link partner supports 10bT */ #define ANLPAR_CSMA 0x0001 /* protocol selector CSMA/CD */ +#define ANLPAR_PAUSE_MASK (3 << 10) +#define ANLPAR_PAUSE_NONE (0 << 10) +#define ANLPAR_PAUSE_SYM (1 << 10) +#define ANLPAR_PAUSE_ASYM (2 << 10) +#define ANLPAR_PAUSE_TOWARDS (3 << 10) #define ANLPAR_X_FD 0x0020 /* local device supports 1000BASE-X FD */ #define ANLPAR_X_HD 0x0040 /* local device supports 1000BASE-X HD */ diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index d1cc4f5c7520..b888937474a4 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -106,8 +106,13 @@ mii_phy_setmedia(struct mii_softc *sc) int bmcr, anar, gtcr; if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO) { + /* + * Force renegotiation if MIIF_DOPAUSE or MIIF_FORCEANEG. + * The former is necessary as we might switch from flow- + * control advertisment being off to on or vice versa. + */ if ((PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN) == 0 || - (sc->mii_flags & MIIF_FORCEANEG) != 0) + (sc->mii_flags & (MIIF_DOPAUSE | MIIF_FORCEANEG)) != 0) (void)mii_phy_auto(sc); return; } @@ -124,14 +129,23 @@ mii_phy_setmedia(struct mii_softc *sc) bmcr = mii_media_table[ife->ifm_data].mm_bmcr; gtcr = mii_media_table[ife->ifm_data].mm_gtcr; - if ((mii->mii_media.ifm_media & IFM_ETH_MASTER) != 0) { - switch (IFM_SUBTYPE(ife->ifm_media)) { - case IFM_1000_T: - gtcr |= GTCR_MAN_MS | GTCR_ADV_MS; - break; + if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { + gtcr |= GTCR_MAN_MS; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gtcr |= GTCR_ADV_MS; + } - default: - printf("mii_phy_setmedia: MASTER on wrong media\n"); + if ((ife->ifm_media & IFM_GMASK) == (IFM_FDX | IFM_FLOW) || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { + if ((sc->mii_flags & MIIF_IS_1000X) != 0) + anar |= ANAR_X_PAUSE_TOWARDS; + else { + anar |= ANAR_FC; + /* XXX Only 1000BASE-T has PAUSE_ASYM? */ + if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0 && + (sc->mii_extcapabilities & + (EXTSR_1000THDX | EXTSR_1000TFDX)) != 0) + anar |= ANAR_X_PAUSE_ASYM; } } @@ -147,6 +161,7 @@ mii_phy_setmedia(struct mii_softc *sc) int mii_phy_auto(struct mii_softc *sc) { + struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; int anar, gtcr; /* @@ -160,16 +175,23 @@ mii_phy_auto(struct mii_softc *sc) if ((sc->mii_extcapabilities & EXTSR_1000XHDX) != 0) anar |= ANAR_X_HD; - if ((sc->mii_flags & MIIF_DOPAUSE) != 0) { - /* XXX Asymmetric vs. symmetric? */ - anar |= ANLPAR_X_PAUSE_TOWARDS; - } + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= ANAR_X_PAUSE_TOWARDS; PHY_WRITE(sc, MII_ANAR, anar); } else { anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if ((sc->mii_flags & MIIF_DOPAUSE) != 0) - anar |= ANAR_FC; + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) { + if ((sc->mii_capabilities & BMSR_100TXFDX) != 0) + anar |= ANAR_FC; + /* XXX Only 1000BASE-T has PAUSE_ASYM? */ + if (((sc->mii_flags & MIIF_HAVE_GTCR) != 0) && + (sc->mii_extcapabilities & + (EXTSR_1000THDX | EXTSR_1000TFDX)) != 0) + anar |= ANAR_X_PAUSE_ASYM; + } PHY_WRITE(sc, MII_ANAR, anar); if ((sc->mii_flags & MIIF_HAVE_GTCR) != 0) { gtcr = 0; @@ -291,6 +313,7 @@ mii_phy_add_media(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; const char *sep = ""; + int fdx = 0; if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) { @@ -334,6 +357,14 @@ mii_phy_add_media(struct mii_softc *sc) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, IFM_FDX, sc->mii_inst), MII_MEDIA_10_T_FDX); PRINT("10baseT-FDX"); + if ((sc->mii_flags & MIIF_DOPAUSE) != 0 && + (sc->mii_flags & MIIF_NOMANPAUSE) == 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_T, + IFM_FDX | IFM_FLOW, sc->mii_inst), + MII_MEDIA_10_T_FDX); + PRINT("10baseT-FDX-flow"); + } + fdx = 1; } if ((sc->mii_capabilities & BMSR_100TXHDX) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, 0, sc->mii_inst), @@ -344,6 +375,14 @@ mii_phy_add_media(struct mii_softc *sc) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_FDX, sc->mii_inst), MII_MEDIA_100_TX_FDX); PRINT("100baseTX-FDX"); + if ((sc->mii_flags & MIIF_DOPAUSE) != 0 && + (sc->mii_flags & MIIF_NOMANPAUSE) == 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, + IFM_FDX | IFM_FLOW, sc->mii_inst), + MII_MEDIA_100_TX_FDX); + PRINT("100baseTX-FDX-flow"); + } + fdx = 1; } if ((sc->mii_capabilities & BMSR_100T4) != 0) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_T4, 0, sc->mii_inst), @@ -369,38 +408,67 @@ mii_phy_add_media(struct mii_softc *sc) ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, IFM_FDX, sc->mii_inst), MII_MEDIA_1000_X_FDX); PRINT("1000baseSX-FDX"); + if ((sc->mii_flags & MIIF_DOPAUSE) != 0 && + (sc->mii_flags & MIIF_NOMANPAUSE) == 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_SX, + IFM_FDX | IFM_FLOW, sc->mii_inst), + MII_MEDIA_1000_X_FDX); + PRINT("1000baseSX-FDX-flow"); + } + fdx = 1; } /* * 1000baseT media needs to be able to manipulate - * master/slave mode. We set IFM_ETH_MASTER in - * the "don't care mask" and filter it out when - * the media is set. + * master/slave mode. * * All 1000baseT PHYs have a 1000baseT control register. */ if ((sc->mii_extcapabilities & EXTSR_1000THDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; - mii->mii_media.ifm_mask |= IFM_ETH_MASTER; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, 0, sc->mii_inst), MII_MEDIA_1000_T); PRINT("1000baseT"); + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, + IFM_ETH_MASTER, sc->mii_inst), MII_MEDIA_1000_T); + PRINT("1000baseT-master"); } if ((sc->mii_extcapabilities & EXTSR_1000TFDX) != 0) { sc->mii_anegticks = MII_ANEGTICKS_GIGE; sc->mii_flags |= MIIF_HAVE_GTCR; - mii->mii_media.ifm_mask |= IFM_ETH_MASTER; ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, IFM_FDX, sc->mii_inst), MII_MEDIA_1000_T_FDX); PRINT("1000baseT-FDX"); + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, + IFM_FDX | IFM_ETH_MASTER, sc->mii_inst), + MII_MEDIA_1000_T_FDX); + PRINT("1000baseT-FDX-master"); + if ((sc->mii_flags & MIIF_DOPAUSE) != 0 && + (sc->mii_flags & MIIF_NOMANPAUSE) == 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, + IFM_FDX | IFM_FLOW, sc->mii_inst), + MII_MEDIA_1000_T_FDX); + PRINT("1000baseT-FDX-flow"); + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_1000_T, + IFM_FDX | IFM_FLOW | IFM_ETH_MASTER, + sc->mii_inst), MII_MEDIA_1000_T_FDX); + PRINT("1000baseT-FDX-flow-master"); + } + fdx = 1; } } if ((sc->mii_capabilities & BMSR_ANEG) != 0) { + /* intentionally invalid index */ ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), - MII_NMEDIA); /* intentionally invalid index */ + MII_NMEDIA); PRINT("auto"); + if (fdx != 0 && (sc->mii_flags & MIIF_DOPAUSE) != 0) { + ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, IFM_FLOW, + sc->mii_inst), MII_NMEDIA); + PRINT("auto-flow"); + } } #undef ADD #undef PRINT @@ -424,7 +492,7 @@ mii_phy_match_gen(const struct mii_attach_args *ma, { for (; mpd->mpd_name != NULL; - mpd = (const struct mii_phydesc *) ((const char *) mpd + len)) { + mpd = (const struct mii_phydesc *)((const char *)mpd + len)) { if (MII_OUI(ma->mii_id1, ma->mii_id2) == mpd->mpd_oui && MII_MODEL(ma->mii_id2) == mpd->mpd_model) return (mpd); @@ -450,3 +518,55 @@ mii_phy_dev_probe(device_t dev, const struct mii_phydesc *mpd, int mrv) } return (ENXIO); } + +/* + * Return the flow control status flag from MII_ANAR & MII_ANLPAR. + */ +u_int +mii_phy_flowstatus(struct mii_softc *sc) +{ + int anar, anlpar; + + if ((sc->mii_flags & MIIF_DOPAUSE) == 0) + return (0); + + anar = PHY_READ(sc, MII_ANAR); + anlpar = PHY_READ(sc, MII_ANLPAR); + + /* + * Check for 1000BASE-X. Autonegotiation is a bit + * different on such devices. + */ + if ((sc->mii_flags & MIIF_IS_1000X) != 0) { + anar <<= 3; + anlpar <<= 3; + } + + if ((anar & ANAR_PAUSE_SYM) != 0 && (anlpar & ANLPAR_PAUSE_SYM) != 0) + return (IFM_FLOW | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE); + + if ((anar & ANAR_PAUSE_SYM) == 0) { + if ((anar & ANAR_PAUSE_ASYM) != 0 && + (anlpar & ANLPAR_PAUSE_TOWARDS) != 0) + return (IFM_FLOW | IFM_ETH_TXPAUSE); + else + return (0); + } + + if ((anar & ANAR_PAUSE_ASYM) == 0) { + if ((anlpar & ANLPAR_PAUSE_SYM) != 0) + return (IFM_FLOW | IFM_ETH_TXPAUSE | IFM_ETH_RXPAUSE); + else + return (0); + } + + switch ((anlpar & ANLPAR_PAUSE_TOWARDS)) { + case ANLPAR_PAUSE_NONE: + return (0); + case ANLPAR_PAUSE_ASYM: + return (IFM_FLOW | IFM_ETH_RXPAUSE); + default: + return (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE); + } + /* NOTREACHED */ +} diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h index 6783cf515398..078b9a2ada98 100644 --- a/sys/dev/mii/miivar.h +++ b/sys/dev/mii/miivar.h @@ -125,6 +125,7 @@ typedef struct mii_softc mii_softc_t; #define MIIF_INITDONE 0x00000001 /* has been initialized (mii_data) */ #define MIIF_NOISOLATE 0x00000002 /* do not isolate the PHY */ #define MIIF_NOLOOP 0x00000004 /* no loopback capability */ +#define MIIF_DOINGAUTO 0x00000008 /* doing autonegotiation (mii_softc) */ #define MIIF_AUTOTSLEEP 0x00000010 /* use tsleep(), not callout() */ #define MIIF_HAVEFIBER 0x00000020 /* from parent: has fiber interface */ #define MIIF_HAVE_GTCR 0x00000040 /* has 100base-T2/1000base-T CR */ @@ -132,6 +133,8 @@ typedef struct mii_softc mii_softc_t; #define MIIF_DOPAUSE 0x00000100 /* advertise PAUSE capability */ #define MIIF_IS_HPNA 0x00000200 /* is a HomePNA device */ #define MIIF_FORCEANEG 0x00000400 /* force auto-negotiation */ +#define MIIF_NOMANPAUSE 0x00100000 /* no manual PAUSE selection */ +#define MIIF_FORCEPAUSE 0x00200000 /* force PAUSE advertisment */ #define MIIF_MACPRIV0 0x01000000 /* private to the MAC driver */ #define MIIF_MACPRIV1 0x02000000 /* private to the MAC driver */ #define MIIF_MACPRIV2 0x04000000 /* private to the MAC driver */ @@ -236,6 +239,7 @@ void mii_phy_add_media(struct mii_softc *); int mii_phy_auto(struct mii_softc *); int mii_phy_detach(device_t dev); void mii_phy_down(struct mii_softc *); +u_int mii_phy_flowstatus(struct mii_softc *); void mii_phy_reset(struct mii_softc *); void mii_phy_setmedia(struct mii_softc *sc); void mii_phy_update(struct mii_softc *, int); diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c index b3df8a205f81..7cdee42bbc25 100644 --- a/sys/dev/mii/nsgphy.c +++ b/sys/dev/mii/nsgphy.c @@ -246,7 +246,8 @@ nsgphy_status(struct mii_softc *sc) } if (physup & PHY_SUP_DUPLEX) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= + IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; } else diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index d1e0e51954e2..aa4bff7ba252 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -89,7 +89,7 @@ DRIVER_MODULE(rgephy, miibus, rgephy_driver, rgephy_devclass, 0, 0); static int rgephy_service(struct mii_softc *, struct mii_data *, int); static void rgephy_status(struct mii_softc *); -static int rgephy_mii_phy_auto(struct mii_softc *); +static int rgephy_mii_phy_auto(struct mii_softc *, int); static void rgephy_reset(struct mii_softc *); static void rgephy_loop(struct mii_softc *); static void rgephy_load_dspcode(struct mii_softc *); @@ -113,7 +113,6 @@ rgephy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; - const char *sep = ""; rsc = device_get_softc(dev); sc = &rsc->mii_sc; @@ -132,27 +131,21 @@ rgephy_attach(device_t dev) rsc->mii_revision = MII_REV(ma->mii_id2); #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) -#define PRINT(s) printf("%s%s", sep, s); sep = ", " #if 0 ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), MII_MEDIA_100_TX); #endif - sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - sc->mii_capabilities &= ~BMSR_ANEG; + /* RTL8169S do not report auto-sense; add manually. */ + sc->mii_capabilities = (PHY_READ(sc, MII_BMSR) | BMSR_ANEG) & + ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - device_printf(dev, " "); mii_phy_add_media(sc); - /* RTL8169S do not report auto-sense; add manually. */ - ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), MII_NMEDIA); - sep = ", "; - PRINT("auto"); printf("\n"); #undef ADD -#undef PRINT rgephy_reset(sc); MIIBUS_MEDIAINIT(sc->mii_dev); @@ -182,7 +175,8 @@ rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) rgephy_reset(sc); /* XXX hardware bug work-around */ anar = PHY_READ(sc, RGEPHY_MII_ANAR); - anar &= ~(RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_TX | + anar &= ~(RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP | + RGEPHY_ANAR_TX_FD | RGEPHY_ANAR_TX | RGEPHY_ANAR_10_FD | RGEPHY_ANAR_10); switch (IFM_SUBTYPE(ife->ifm_media)) { @@ -194,7 +188,7 @@ rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (PHY_READ(sc, RGEPHY_MII_BMCR) & RGEPHY_BMCR_AUTOEN) return (0); #endif - (void) rgephy_mii_phy_auto(sc); + (void)rgephy_mii_phy_auto(sc, ife->ifm_media); break; case IFM_1000_T: speed = RGEPHY_S1000; @@ -222,32 +216,26 @@ rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) PHY_WRITE(sc, RGEPHY_MII_1000CTL, 0); PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | - RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); + RGEPHY_BMCR_AUTOEN | + RGEPHY_BMCR_STARTNEG); break; } - /* - * When setting the link manually, one side must - * be the master and the other the slave. However - * ifmedia doesn't give us a good way to specify - * this, so we fake it by using one of the LINK - * flags. If LINK0 is set, we program the PHY to - * be a master, otherwise it's a slave. - */ - if ((mii->mii_ifp->if_flags & IFF_LINK0)) { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, - gig|RGEPHY_1000CTL_MSE|RGEPHY_1000CTL_MSC); - } else { - PHY_WRITE(sc, RGEPHY_MII_1000CTL, - gig|RGEPHY_1000CTL_MSE); - } + if ((ife->ifm_media & IFM_FLOW) != 0 || + (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; + + gig |= RGEPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0) + gig |= RGEPHY_1000CTL_MSC; + PHY_WRITE(sc, RGEPHY_MII_1000CTL, gig); + PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); PHY_WRITE(sc, RGEPHY_MII_BMCR, speed | RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); break; case IFM_NONE: - PHY_WRITE(sc, MII_BMCR, BMCR_ISO|BMCR_PDOWN); + PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN); break; - case IFM_100_T4: default: return (EINVAL); } @@ -297,7 +285,7 @@ rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) return (0); sc->mii_ticks = 0; - rgephy_mii_phy_auto(sc); + rgephy_mii_phy_auto(sc, ife->ifm_media); break; } @@ -395,22 +383,32 @@ rgephy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_HDX; } + + if ((mii->mii_media_active & IFM_FDX) != 0) + mii->mii_media_active |= mii_phy_flowstatus(sc); + + if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) && + (PHY_READ(sc, RGEPHY_MII_1000STS) & RGEPHY_1000STS_MSR) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; } static int -rgephy_mii_phy_auto(struct mii_softc *mii) +rgephy_mii_phy_auto(struct mii_softc *sc, int media) { + int anar; - rgephy_loop(mii); - rgephy_reset(mii); + rgephy_loop(sc); + rgephy_reset(sc); - PHY_WRITE(mii, RGEPHY_MII_ANAR, - BMSR_MEDIA_TO_ANAR(mii->mii_capabilities) | ANAR_CSMA); + anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; + if ((media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) + anar |= RGEPHY_ANAR_PC | RGEPHY_ANAR_ASP; + PHY_WRITE(sc, RGEPHY_MII_ANAR, anar); DELAY(1000); - PHY_WRITE(mii, RGEPHY_MII_1000CTL, - RGEPHY_1000CTL_AHD|RGEPHY_1000CTL_AFD); + PHY_WRITE(sc, RGEPHY_MII_1000CTL, + RGEPHY_1000CTL_AHD | RGEPHY_1000CTL_AFD); DELAY(1000); - PHY_WRITE(mii, RGEPHY_MII_BMCR, + PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); DELAY(100); diff --git a/sys/dev/mii/smcphy.c b/sys/dev/mii/smcphy.c index f442858eaa55..a04e39feabda 100644 --- a/sys/dev/mii/smcphy.c +++ b/sys/dev/mii/smcphy.c @@ -54,7 +54,7 @@ static int smcphy_attach(device_t); static int smcphy_service(struct mii_softc *, struct mii_data *, int); static int smcphy_reset(struct mii_softc *); -static void smcphy_auto(struct mii_softc *); +static void smcphy_auto(struct mii_softc *, int); static device_method_t smcphy_methods[] = { /* device interface */ @@ -148,7 +148,7 @@ smcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) switch (IFM_SUBTYPE(ife->ifm_media)) { case IFM_AUTO: - smcphy_auto(sc); + smcphy_auto(sc, ife->ifm_media); break; default: @@ -187,7 +187,7 @@ smcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (smcphy_reset(sc) != 0) { device_printf(sc->mii_dev, "reset failed\n"); } - smcphy_auto(sc); + smcphy_auto(sc, ife->ifm_media); break; } @@ -223,13 +223,13 @@ smcphy_reset(struct mii_softc *sc) } static void -smcphy_auto(struct mii_softc *sc) +smcphy_auto(struct mii_softc *sc, int media) { uint16_t anar; anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA; - if (sc->mii_flags & MIIF_DOPAUSE) + if ((media & IFM_FLOW) != 0 || (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= ANAR_FC; PHY_WRITE(sc, MII_ANAR, anar); /* Apparently this helps. */ diff --git a/sys/dev/mii/ukphy_subr.c b/sys/dev/mii/ukphy_subr.c index 9decd3639049..5f2f6341ba6a 100644 --- a/sys/dev/mii/ukphy_subr.c +++ b/sys/dev/mii/ukphy_subr.c @@ -117,6 +117,13 @@ ukphy_status(struct mii_softc *phy) mii->mii_media_active |= IFM_10_T|IFM_HDX; else mii->mii_media_active |= IFM_NONE; + + if ((mii->mii_media_active & IFM_1000_T) != 0 && + (gtsr & GTSR_MS_RES) != 0) + mii->mii_media_active |= IFM_ETH_MASTER; + + if ((mii->mii_media_active & IFM_FDX) != 0) + mii->mii_media_active |= mii_phy_flowstatus(phy); } else mii->mii_media_active = ife->ifm_media; } diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c index 745c7b33718f..d662687a243e 100644 --- a/sys/dev/mii/xmphy.c +++ b/sys/dev/mii/xmphy.c @@ -167,7 +167,7 @@ xmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) if (PHY_READ(sc, XMPHY_MII_BMCR) & XMPHY_BMCR_AUTOEN) return (0); #endif - (void) xmphy_mii_phy_auto(sc); + (void)xmphy_mii_phy_auto(sc); break; case IFM_1000_SX: mii_phy_reset(sc); @@ -179,9 +179,6 @@ xmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) PHY_WRITE(sc, XMPHY_MII_BMCR, 0); } break; - case IFM_100_T4: - case IFM_100_TX: - case IFM_10_T: default: return (EINVAL); } diff --git a/sys/dev/msk/if_msk.c b/sys/dev/msk/if_msk.c index 8eb2ffa00772..810ab035e329 100644 --- a/sys/dev/msk/if_msk.c +++ b/sys/dev/msk/if_msk.c @@ -529,11 +529,11 @@ msk_miibus_statchg(device_t dev) break; } - /* Disable Rx flow control. */ - if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) == 0) + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) == 0) gmac |= GM_GPCR_FC_RX_DIS; - /* Disable Tx flow control. */ - if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG1) == 0) + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_TXPAUSE) == 0) gmac |= GM_GPCR_FC_TX_DIS; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) gmac |= GM_GPCR_DUP_FULL; @@ -545,7 +545,8 @@ msk_miibus_statchg(device_t dev) GMAC_READ_2(sc, sc_if->msk_port, GM_GP_CTRL); gmac = GMC_PAUSE_OFF; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { - if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) != 0) + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) gmac = GMC_PAUSE_ON; } CSR_WRITE_4(sc, MR_ADDR(sc_if->msk_port, GMAC_CTRL), gmac); @@ -1886,6 +1887,7 @@ mskc_attach(device_t dev) } mmd->port = MSK_PORT_A; mmd->pmd = sc->msk_pmd; + mmd->mii_flags |= MIIF_DOPAUSE; if (sc->msk_pmd == 'L' || sc->msk_pmd == 'S') mmd->mii_flags |= MIIF_HAVEFIBER; if (sc->msk_pmd == 'P') diff --git a/sys/dev/nfe/if_nfe.c b/sys/dev/nfe/if_nfe.c index 347cf2b0ce44..fcc11c21f64b 100644 --- a/sys/dev/nfe/if_nfe.c +++ b/sys/dev/nfe/if_nfe.c @@ -605,7 +605,8 @@ nfe_attach(device_t dev) /* Do MII setup */ error = mii_attach(dev, &sc->nfe_miibus, ifp, nfe_ifmedia_upd, - nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, 0); + nfe_ifmedia_sts, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -906,7 +907,8 @@ nfe_mac_config(struct nfe_softc *sc, struct mii_data *mii) if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { /* It seems all hardwares supports Rx pause frames. */ val = NFE_READ(sc, NFE_RXFILTER); - if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FLAG0) != 0) + if ((IFM_OPTIONS(mii->mii_media_active) & + IFM_ETH_RXPAUSE) != 0) val |= NFE_PFF_RX_PAUSE; else val &= ~NFE_PFF_RX_PAUSE; @@ -914,7 +916,7 @@ nfe_mac_config(struct nfe_softc *sc, struct mii_data *mii) if ((sc->nfe_flags & NFE_TX_FLOW_CTRL) != 0) { val = NFE_READ(sc, NFE_MISC1); if ((IFM_OPTIONS(mii->mii_media_active) & - IFM_FLAG1) != 0) { + IFM_ETH_TXPAUSE) != 0) { NFE_WRITE(sc, NFE_TX_PAUSE_FRAME, NFE_TX_PAUSE_FRAME_ENABLE); val |= NFE_MISC1_TX_PAUSE; diff --git a/sys/dev/stge/if_stge.c b/sys/dev/stge/if_stge.c index 9e8577194027..34051b02ba47 100644 --- a/sys/dev/stge/if_stge.c +++ b/sys/dev/stge/if_stge.c @@ -738,7 +738,7 @@ stge_attach(device_t dev) (PC_PhyDuplexPolarity | PC_PhyLnkPolarity); /* Set up MII bus. */ - flags = 0; + flags = MIIF_DOPAUSE; if (sc->sc_rev >= 0x40 && sc->sc_rev <= 0x4e) flags |= MIIF_MACPRIV0; error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, stge_mediachange, @@ -1524,9 +1524,9 @@ stge_link_task(void *arg, int pending) sc->sc_MACCtrl = 0; if (((mii->mii_media_active & IFM_GMASK) & IFM_FDX) != 0) sc->sc_MACCtrl |= MC_DuplexSelect; - if (((mii->mii_media_active & IFM_GMASK) & IFM_FLAG0) != 0) + if (((mii->mii_media_active & IFM_GMASK) & IFM_ETH_RXPAUSE) != 0) sc->sc_MACCtrl |= MC_RxFlowControlEnable; - if (((mii->mii_media_active & IFM_GMASK) & IFM_FLAG1) != 0) + if (((mii->mii_media_active & IFM_GMASK) & IFM_ETH_TXPAUSE) != 0) sc->sc_MACCtrl |= MC_TxFlowControlEnable; /* * Update STGE_MACCtrl register depending on link status. diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index deffeb717a82..8834b866b75c 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -64,11 +64,11 @@ static u_int g_eli_tries = 3; TUNABLE_INT("kern.geom.eli.tries", &g_eli_tries); SYSCTL_UINT(_kern_geom_eli, OID_AUTO, tries, CTLFLAG_RW, &g_eli_tries, 0, "Number of tries for entering the passphrase"); -static u_int g_eli_visible_passphrase = 0; +static u_int g_eli_visible_passphrase = GETS_NOECHO; TUNABLE_INT("kern.geom.eli.visible_passphrase", &g_eli_visible_passphrase); SYSCTL_UINT(_kern_geom_eli, OID_AUTO, visible_passphrase, CTLFLAG_RW, &g_eli_visible_passphrase, 0, - "Turn on echo when entering the passphrase (for debug purposes only!!)"); + "Visibility of passphrase prompt (0 = invisible, 1 = visible, 2 = asterisk)"); u_int g_eli_overwrites = G_ELI_OVERWRITES; TUNABLE_INT("kern.geom.eli.overwrites", &g_eli_overwrites); SYSCTL_UINT(_kern_geom_eli, OID_AUTO, overwrites, CTLFLAG_RW, &g_eli_overwrites, diff --git a/sys/i386/i386/trap.c b/sys/i386/i386/trap.c index dc105594b35c..b6f843aef076 100644 --- a/sys/i386/i386/trap.c +++ b/sys/i386/i386/trap.c @@ -461,9 +461,9 @@ trap(struct trapframe *frame) * This check also covers the images * without the ABI-tag ELF note. */ - if (SV_CURPROC_ABI() == - SV_ABI_FREEBSD && - p->p_osrel >= 700004) { + if (SV_CURPROC_ABI() == SV_ABI_FREEBSD + && p->p_osrel >= + __FreeBSD_version_SIGSEGV) { i = SIGSEGV; ucode = SEGV_ACCERR; } else { diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 1754f7bab0e0..feef911dd8a4 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -373,7 +373,7 @@ int profprocs; int ticks; int psratio; -static DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ +STATIC_DPCPU_DEFINE(int, pcputicks); /* Per-CPU version of ticks. */ static int global_hardclock_run = 0; /* diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c index ded6d642c1b6..dad07d2ec7e4 100644 --- a/sys/kern/kern_clocksource.c +++ b/sys/kern/kern_clocksource.c @@ -135,7 +135,7 @@ struct pcpu_state { int idle; /* This CPU is in idle mode. */ }; -static DPCPU_DEFINE(struct pcpu_state, timerstate); +STATIC_DPCPU_DEFINE(struct pcpu_state, timerstate); #define FREQ2BT(freq, bt) \ { \ diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 9cfbc2011ca8..ccdbf0eb249a 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -144,7 +144,8 @@ struct mtx ppeers_lock; uma_zone_t proc_zone; int kstack_pages = KSTACK_PAGES; -SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, ""); +SYSCTL_INT(_kern, OID_AUTO, kstack_pages, CTLFLAG_RD, &kstack_pages, 0, + "Kernel stack size in pages"); CTASSERT(sizeof(struct kinfo_proc) == KINFO_PROC_SIZE); #ifdef COMPAT_FREEBSD32 diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index cdca3a3e6afe..3e8d47067942 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -103,7 +103,7 @@ SYSCTL_NODE(_kern_timecounter, OID_AUTO, tc, CTLFLAG_RW, 0, ""); static int timestepwarnings; SYSCTL_INT(_kern_timecounter, OID_AUTO, stepwarnings, CTLFLAG_RW, - ×tepwarnings, 0, ""); + ×tepwarnings, 0, "Log time steps"); static void tc_windup(void); static void cpu_tick_calibrate(int); @@ -560,7 +560,8 @@ sysctl_kern_timecounter_hardware(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_timecounter, OID_AUTO, hardware, CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, sysctl_kern_timecounter_hardware, "A", ""); + 0, 0, sysctl_kern_timecounter_hardware, "A", + "Timecounter hardware selected"); /* Report or change the active timecounter hardware. */ @@ -583,7 +584,7 @@ sysctl_kern_timecounter_choice(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern_timecounter, OID_AUTO, choice, CTLTYPE_STRING | CTLFLAG_RD, - 0, 0, sysctl_kern_timecounter_choice, "A", ""); + 0, 0, sysctl_kern_timecounter_choice, "A", "Timecounter hardware detected"); /* * RFC 2783 PPS-API implementation. @@ -768,7 +769,8 @@ pps_event(struct pps_state *pps, int event) */ static int tc_tick; -SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, ""); +SYSCTL_INT(_kern_timecounter, OID_AUTO, tick, CTLFLAG_RD, &tc_tick, 0, + "Approximate number of hardclock ticks in a millisecond"); void tc_ticktock(int cnt) diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c index c18885218691..e8e32a201dbc 100644 --- a/sys/kern/link_elf_obj.c +++ b/sys/kern/link_elf_obj.c @@ -336,7 +336,7 @@ link_elf_link_preload(linker_class_t cls, const char *filename, ef->progtab[pb].name = ef->shstrtab + shdr[i].sh_name; if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, "set_pcpu")) { + !strcmp(ef->progtab[pb].name, DPCPU_SETNAME)) { void *dpcpu; dpcpu = dpcpu_alloc(shdr[i].sh_size); @@ -757,7 +757,7 @@ link_elf_load_file(linker_class_t cls, const char *filename, else ef->progtab[pb].name = "<>"; if (ef->progtab[pb].name != NULL && - !strcmp(ef->progtab[pb].name, "set_pcpu")) + !strcmp(ef->progtab[pb].name, DPCPU_SETNAME)) ef->progtab[pb].addr = dpcpu_alloc(shdr[i].sh_size); #ifdef VIMAGE @@ -789,7 +789,7 @@ link_elf_load_file(linker_class_t cls, const char *filename, } /* Initialize the per-cpu or vnet area. */ if (ef->progtab[pb].addr != (void *)mapbase && - !strcmp(ef->progtab[pb].name, "set_pcpu")) + !strcmp(ef->progtab[pb].name, DPCPU_SETNAME)) dpcpu_copy(ef->progtab[pb].addr, shdr[i].sh_size); #ifdef VIMAGE @@ -911,7 +911,7 @@ link_elf_unload_file(linker_file_t file) continue; if (ef->progtab[i].name == NULL) continue; - if (!strcmp(ef->progtab[i].name, "set_pcpu")) + if (!strcmp(ef->progtab[i].name, DPCPU_SETNAME)) dpcpu_free(ef->progtab[i].addr, ef->progtab[i].size); #ifdef VIMAGE diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c index 9face648de93..6a403921d14e 100644 --- a/sys/kern/sched_4bsd.c +++ b/sys/kern/sched_4bsd.c @@ -161,7 +161,7 @@ struct pcpuidlestat { u_int idlecalls; u_int oldidlecalls; }; -static DPCPU_DEFINE(struct pcpuidlestat, idlestat); +STATIC_DPCPU_DEFINE(struct pcpuidlestat, idlestat); static void setup_runqs(void) diff --git a/sys/kern/subr_clock.c b/sys/kern/subr_clock.c index 28e0dad4d53c..4e7bcd0347e9 100644 --- a/sys/kern/subr_clock.c +++ b/sys/kern/subr_clock.c @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #include #define ct_debug bootverbose -static int adjkerntz; /* local offset from GMT in seconds */ +static int adjkerntz; /* local offset from UTC in seconds */ static int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */ int tz_minuteswest; @@ -61,7 +61,7 @@ int tz_dsttime; * kern. */ SYSCTL_INT(_machdep, OID_AUTO, wall_cmos_clock, - CTLFLAG_RW, &wall_cmos_clock, 0, ""); + CTLFLAG_RW, &wall_cmos_clock, 0, "CMOS clock keeps wall time"); static int sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS) @@ -74,7 +74,8 @@ sysctl_machdep_adjkerntz(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_machdep, OID_AUTO, adjkerntz, CTLTYPE_INT|CTLFLAG_RW, - &adjkerntz, 0, sysctl_machdep_adjkerntz, "I", ""); + &adjkerntz, 0, sysctl_machdep_adjkerntz, "I", + "Local offset from UTC in seconds"); /*--------------------------------------------------------------------* * Generic routines to convert between a POSIX date diff --git a/sys/kern/subr_pcpu.c b/sys/kern/subr_pcpu.c index 24a12ea67159..4108441372c7 100644 --- a/sys/kern/subr_pcpu.c +++ b/sys/kern/subr_pcpu.c @@ -70,7 +70,7 @@ struct dpcpu_free { TAILQ_ENTRY(dpcpu_free) df_link; }; -static DPCPU_DEFINE(char, modspace[DPCPU_MODMIN]); +STATIC_DPCPU_DEFINE(char, modspace[DPCPU_MODMIN]); static TAILQ_HEAD(, dpcpu_free) dpcpu_head = TAILQ_HEAD_INITIALIZER(dpcpu_head); static struct sx dpcpu_lock; uintptr_t dpcpu_off[MAXCPU]; diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c index cdf8d7b23a3a..cef21c06cf41 100644 --- a/sys/kern/sysv_sem.c +++ b/sys/kern/sysv_sem.c @@ -212,7 +212,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, CTLFLAG_RW, &seminfo.semvmx, 0, SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RW, &seminfo.semaem, 0, "Adjust on exit max value"); SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLFLAG_RD, - NULL, 0, sysctl_sema, "", ""); + NULL, 0, sysctl_sema, "", "Semaphore id pool"); static struct syscall_helper_data sem_syscalls[] = { SYSCALL_INIT_HELPER(__semctl), diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 0efdbc1d9604..30fb28bd76a5 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -184,30 +184,43 @@ SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, /* Export size information to userland */ SYSCTL_INT(_debug_sizeof, OID_AUTO, namecache, CTLFLAG_RD, 0, - sizeof(struct namecache), ""); + sizeof(struct namecache), "sizeof(struct namecache)"); /* * The new name cache statistics */ -static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, "Name cache statistics"); -#define STATNODE(mode, name, var) \ - SYSCTL_ULONG(_vfs_cache, OID_AUTO, name, mode, var, 0, ""); -STATNODE(CTLFLAG_RD, numneg, &numneg); -STATNODE(CTLFLAG_RD, numcache, &numcache); -static u_long numcalls; STATNODE(CTLFLAG_RD, numcalls, &numcalls); -static u_long dothits; STATNODE(CTLFLAG_RD, dothits, &dothits); -static u_long dotdothits; STATNODE(CTLFLAG_RD, dotdothits, &dotdothits); -static u_long numchecks; STATNODE(CTLFLAG_RD, numchecks, &numchecks); -static u_long nummiss; STATNODE(CTLFLAG_RD, nummiss, &nummiss); -static u_long nummisszap; STATNODE(CTLFLAG_RD, nummisszap, &nummisszap); -static u_long numposzaps; STATNODE(CTLFLAG_RD, numposzaps, &numposzaps); -static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits); -static u_long numnegzaps; STATNODE(CTLFLAG_RD, numnegzaps, &numnegzaps); -static u_long numneghits; STATNODE(CTLFLAG_RD, numneghits, &numneghits); -static u_long numupgrades; STATNODE(CTLFLAG_RD, numupgrades, &numupgrades); +static SYSCTL_NODE(_vfs, OID_AUTO, cache, CTLFLAG_RW, 0, + "Name cache statistics"); +#define STATNODE(mode, name, var, descr) \ + SYSCTL_ULONG(_vfs_cache, OID_AUTO, name, mode, var, 0, descr); +STATNODE(CTLFLAG_RD, numneg, &numneg, "Number of negative cache entries"); +STATNODE(CTLFLAG_RD, numcache, &numcache, "Number of cache entries"); +static u_long numcalls; STATNODE(CTLFLAG_RD, numcalls, &numcalls, + "Number of cache lookups"); +static u_long dothits; STATNODE(CTLFLAG_RD, dothits, &dothits, + "Number of '.' hits"); +static u_long dotdothits; STATNODE(CTLFLAG_RD, dotdothits, &dotdothits, + "Number of '..' hits"); +static u_long numchecks; STATNODE(CTLFLAG_RD, numchecks, &numchecks, + "Number of checks in lookup"); +static u_long nummiss; STATNODE(CTLFLAG_RD, nummiss, &nummiss, + "Number of cache misses"); +static u_long nummisszap; STATNODE(CTLFLAG_RD, nummisszap, &nummisszap, + "Number of cache misses we do not want to cache"); +static u_long numposzaps; STATNODE(CTLFLAG_RD, numposzaps, &numposzaps, + "Number of cache hits (positive) we do not want to cache"); +static u_long numposhits; STATNODE(CTLFLAG_RD, numposhits, &numposhits, + "Number of cache hits (positive)"); +static u_long numnegzaps; STATNODE(CTLFLAG_RD, numnegzaps, &numnegzaps, + "Number of cache hits (negative) we do not want to cache"); +static u_long numneghits; STATNODE(CTLFLAG_RD, numneghits, &numneghits, + "Number of cache hits (negative)"); +static u_long numupgrades; STATNODE(CTLFLAG_RD, numupgrades, &numupgrades, + "Number of updates of the cache after lookup (write lock + retry)"); SYSCTL_OPAQUE(_vfs_cache, OID_AUTO, nchstats, CTLFLAG_RD | CTLFLAG_MPSAFE, - &nchstats, sizeof(nchstats), "LU", "VFS cache effectiveness statistics"); + &nchstats, sizeof(nchstats), "LU", + "VFS cache effectiveness statistics"); @@ -259,8 +272,8 @@ sysctl_debug_hashstat_rawnchash(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug_hashstat, OID_AUTO, rawnchash, CTLTYPE_INT|CTLFLAG_RD| - CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_rawnchash, "S,int", - "nchash chain lengths"); + CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_rawnchash, "S,int", + "nchash chain lengths"); static int sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS) @@ -308,8 +321,8 @@ sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS) return (0); } SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD| - CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I", - "nchash chain lengths"); + CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I", + "nchash chain lengths"); #endif /* @@ -970,20 +983,21 @@ kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen) */ #undef STATNODE -#define STATNODE(name) \ +#define STATNODE(name, descr) \ static u_int name; \ - SYSCTL_UINT(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, "") + SYSCTL_UINT(_vfs_cache, OID_AUTO, name, CTLFLAG_RD, &name, 0, descr) static int disablefullpath; SYSCTL_INT(_debug, OID_AUTO, disablefullpath, CTLFLAG_RW, &disablefullpath, 0, - "Disable the vn_fullpath function"); + "Disable the vn_fullpath function"); /* These count for kern___getcwd(), too. */ -STATNODE(numfullpathcalls); -STATNODE(numfullpathfail1); -STATNODE(numfullpathfail2); -STATNODE(numfullpathfail4); -STATNODE(numfullpathfound); +STATNODE(numfullpathcalls, "Number of fullpath search calls"); +STATNODE(numfullpathfail1, "Number of fullpath search errors (ENOTDIR)"); +STATNODE(numfullpathfail2, + "Number of fullpath search errors (VOP_VPTOCNP failures)"); +STATNODE(numfullpathfail4, "Number of fullpath search errors (ENOMEM)"); +STATNODE(numfullpathfound, "Number of successful fullpath calls"); /* * Retrieve the full filesystem path that correspond to a vnode from the name diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 07c29882c5b3..48a632ee7e2c 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -484,7 +484,7 @@ parse_dir_ask(char **conf) again: printf("\nmountroot> "); - gets(name, sizeof(name), 1); + gets(name, sizeof(name), GETS_ECHO); if (name[0] == '\0') return (0); if (name[0] == '?') { diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 6b90888a7b2a..4a4cef1f1fe0 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -121,7 +121,8 @@ static void destroy_vpollinfo(struct vpollinfo *vi); */ static unsigned long numvnodes; -SYSCTL_LONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, ""); +SYSCTL_LONG(_vfs, OID_AUTO, numvnodes, CTLFLAG_RD, &numvnodes, 0, + "Number of vnodes in existence"); /* * Conversion tables for conversion from vnode types to inode formats @@ -150,7 +151,8 @@ static u_long wantfreevnodes; SYSCTL_LONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW, &wantfreevnodes, 0, ""); /* Number of vnodes in the free list. */ static u_long freevnodes; -SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, ""); +SYSCTL_LONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0, + "Number of vnodes in the free list"); static int vlru_allow_cache_src; SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW, @@ -162,7 +164,8 @@ SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW, * XXX these are probably of (very) limited utility now. */ static int reassignbufcalls; -SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW, &reassignbufcalls, 0, ""); +SYSCTL_INT(_vfs, OID_AUTO, reassignbufcalls, CTLFLAG_RW, &reassignbufcalls, 0, + "Number of calls to reassignbuf"); /* * Cache for the mount type id assigned to NFS. This is used for @@ -237,14 +240,18 @@ static struct cv sync_wakeup; static int syncer_maxdelay = SYNCER_MAXDELAY; /* maximum delay time */ static int syncdelay = 30; /* max time to delay syncing data */ static int filedelay = 30; /* time to delay syncing files */ -SYSCTL_INT(_kern, OID_AUTO, filedelay, CTLFLAG_RW, &filedelay, 0, ""); +SYSCTL_INT(_kern, OID_AUTO, filedelay, CTLFLAG_RW, &filedelay, 0, + "Time to delay syncing files (in seconds)"); static int dirdelay = 29; /* time to delay syncing directories */ -SYSCTL_INT(_kern, OID_AUTO, dirdelay, CTLFLAG_RW, &dirdelay, 0, ""); +SYSCTL_INT(_kern, OID_AUTO, dirdelay, CTLFLAG_RW, &dirdelay, 0, + "Time to delay syncing directories (in seconds)"); static int metadelay = 28; /* time to delay syncing metadata */ -SYSCTL_INT(_kern, OID_AUTO, metadelay, CTLFLAG_RW, &metadelay, 0, ""); +SYSCTL_INT(_kern, OID_AUTO, metadelay, CTLFLAG_RW, &metadelay, 0, + "Time to delay syncing metadata (in seconds)"); static int rushjob; /* number of slots to run ASAP */ static int stat_rush_requests; /* number of times I/O speeded up */ -SYSCTL_INT(_debug, OID_AUTO, rush_requests, CTLFLAG_RW, &stat_rush_requests, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, rush_requests, CTLFLAG_RW, &stat_rush_requests, 0, + "Number of times I/O speeded up (rush requests)"); /* * When shutting down the syncer, run it at four times normal speed. @@ -544,7 +551,9 @@ enum { TSP_SEC, TSP_HZ, TSP_USEC, TSP_NSEC }; static int timestamp_precision = TSP_SEC; SYSCTL_INT(_vfs, OID_AUTO, timestamp_precision, CTLFLAG_RW, - ×tamp_precision, 0, ""); + ×tamp_precision, 0, "File timestamp precision (0: seconds, " + "1: sec + ns accurate to 1/HZ, 2: sec + ns truncated to ms, " + "3+: sec + ns (max. precision))"); /* * Get a current timestamp. @@ -2376,7 +2385,7 @@ vinactive(struct vnode *vp, struct thread *td) */ #ifdef DIAGNOSTIC static int busyprt = 0; /* print out busy vnodes */ -SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, busyprt, CTLFLAG_RW, &busyprt, 0, "Print out busy vnodes"); #endif int @@ -3018,7 +3027,7 @@ vfs_sysctl(SYSCTL_HANDLER_ARGS) } static SYSCTL_NODE(_vfs, VFS_GENERIC, generic, CTLFLAG_RD | CTLFLAG_SKIP, - vfs_sysctl, "Generic filesystem"); + vfs_sysctl, "Generic filesystem"); #if 1 || defined(COMPAT_PRELITE2) @@ -3139,7 +3148,7 @@ sysctl_vnode(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, KERN_VNODE, vnode, CTLTYPE_OPAQUE|CTLFLAG_RD, - 0, 0, sysctl_vnode, "S,xvnode", ""); + 0, 0, sysctl_vnode, "S,xvnode", ""); #endif /* @@ -3712,17 +3721,21 @@ extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, (vp)->v_type == VCHR || (vp)->v_type == VBAD) int vfs_badlock_ddb = 1; /* Drop into debugger on violation. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_ddb, CTLFLAG_RW, &vfs_badlock_ddb, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_ddb, CTLFLAG_RW, &vfs_badlock_ddb, 0, + "Drop into debugger on lock violation"); int vfs_badlock_mutex = 1; /* Check for interlock across VOPs. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_mutex, CTLFLAG_RW, &vfs_badlock_mutex, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_mutex, CTLFLAG_RW, &vfs_badlock_mutex, + 0, "Check for interlock across VOPs"); int vfs_badlock_print = 1; /* Print lock violations. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_print, CTLFLAG_RW, &vfs_badlock_print, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_print, CTLFLAG_RW, &vfs_badlock_print, + 0, "Print lock violations"); #ifdef KDB int vfs_badlock_backtrace = 1; /* Print backtrace at lock violations. */ -SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_backtrace, CTLFLAG_RW, &vfs_badlock_backtrace, 0, ""); +SYSCTL_INT(_debug, OID_AUTO, vfs_badlock_backtrace, CTLFLAG_RW, + &vfs_badlock_backtrace, 0, "Print backtrace at lock violations"); #endif static void diff --git a/sys/libkern/gets.c b/sys/libkern/gets.c index 4834da0f5b76..64452f328cfb 100644 --- a/sys/libkern/gets.c +++ b/sys/libkern/gets.c @@ -60,8 +60,16 @@ gets(char *cp, size_t size, int visible) continue; default: if (lp < end) { - if (visible) + switch (visible) { + case GETS_NOECHO: + break; + case GETS_ECHOPASS: + printf("*"); + break; + default: printf("%c", c); + break; + } *lp++ = c; } } diff --git a/sys/mips/mips/tick.c b/sys/mips/mips/tick.c index 125fe336c791..d0c3eaf743ac 100644 --- a/sys/mips/mips/tick.c +++ b/sys/mips/mips/tick.c @@ -57,13 +57,13 @@ uint64_t counter_freq; struct timecounter *platform_timecounter; -static DPCPU_DEFINE(uint32_t, cycles_per_tick); +STATIC_DPCPU_DEFINE(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(volatile uint32_t, counter_upper); -static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); -static DPCPU_DEFINE(uint32_t, compare_ticks); -static DPCPU_DEFINE(uint32_t, lost_ticks); +STATIC_DPCPU_DEFINE(volatile uint32_t, counter_upper); +STATIC_DPCPU_DEFINE(volatile uint32_t, counter_lower_last); +STATIC_DPCPU_DEFINE(uint32_t, compare_ticks); +STATIC_DPCPU_DEFINE(uint32_t, lost_ticks); struct clock_softc { int intr_rid; diff --git a/sys/mips/rmi/tick.c b/sys/mips/rmi/tick.c index 3b83a5c78d63..83ef30b7a818 100644 --- a/sys/mips/rmi/tick.c +++ b/sys/mips/rmi/tick.c @@ -59,13 +59,13 @@ uint64_t counter_freq; struct timecounter *platform_timecounter; -static DPCPU_DEFINE(uint32_t, cycles_per_tick); +STATIC_DPCPU_DEFINE(uint32_t, cycles_per_tick); static uint32_t cycles_per_usec; -static DPCPU_DEFINE(volatile uint32_t, counter_upper); -static DPCPU_DEFINE(volatile uint32_t, counter_lower_last); -static DPCPU_DEFINE(uint32_t, compare_ticks); -static DPCPU_DEFINE(uint32_t, lost_ticks); +STATIC_DPCPU_DEFINE(volatile uint32_t, counter_upper); +STATIC_DPCPU_DEFINE(volatile uint32_t, counter_lower_last); +STATIC_DPCPU_DEFINE(uint32_t, compare_ticks); +STATIC_DPCPU_DEFINE(uint32_t, lost_ticks); struct clock_softc { int intr_rid; diff --git a/sys/net/flowtable.c b/sys/net/flowtable.c index 49886709efb3..8728cf3339da 100644 --- a/sys/net/flowtable.c +++ b/sys/net/flowtable.c @@ -184,10 +184,10 @@ struct flowtable { } __aligned(CACHE_LINE_SIZE); static struct proc *flowcleanerproc; -static VNET_DEFINE(struct flowtable *, flow_list_head); -static VNET_DEFINE(uint32_t, flow_hashjitter); -static VNET_DEFINE(uma_zone_t, flow_ipv4_zone); -static VNET_DEFINE(uma_zone_t, flow_ipv6_zone); +STATIC_VNET_DEFINE(struct flowtable *, flow_list_head); +STATIC_VNET_DEFINE(uint32_t, flow_hashjitter); +STATIC_VNET_DEFINE(uma_zone_t, flow_ipv4_zone); +STATIC_VNET_DEFINE(uma_zone_t, flow_ipv6_zone); #define V_flow_list_head VNET(flow_list_head) #define V_flow_hashjitter VNET(flow_hashjitter) @@ -230,13 +230,13 @@ do { \ * - idetach() cleanup for options VIMAGE builds. */ VNET_DEFINE(int, flowtable_enable) = 1; -static VNET_DEFINE(int, flowtable_debug); -static VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; -static VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; -static VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; -static VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; -static VNET_DEFINE(int, flowtable_nmbflows); -static VNET_DEFINE(int, flowtable_ready) = 0; +STATIC_VNET_DEFINE(int, flowtable_debug); +STATIC_VNET_DEFINE(int, flowtable_syn_expire) = SYN_IDLE; +STATIC_VNET_DEFINE(int, flowtable_udp_expire) = UDP_IDLE; +STATIC_VNET_DEFINE(int, flowtable_fin_wait_expire) = FIN_WAIT_IDLE; +STATIC_VNET_DEFINE(int, flowtable_tcp_expire) = TCP_IDLE; +STATIC_VNET_DEFINE(int, flowtable_nmbflows); +STATIC_VNET_DEFINE(int, flowtable_ready) = 0; #define V_flowtable_enable VNET(flowtable_enable) #define V_flowtable_debug VNET(flowtable_debug) diff --git a/sys/net/if.c b/sys/net/if.c index 17f01e94bf9b..5720294acb6d 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -183,7 +183,7 @@ int ifqmaxlen = IFQ_MAXLEN; VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */ VNET_DEFINE(struct ifgrouphead, ifg_head); -static VNET_DEFINE(int, if_indexlim) = 8; +STATIC_VNET_DEFINE(int, if_indexlim) = 8; /* Table of ifnet by index. */ VNET_DEFINE(struct ifindex_entry *, ifindex_table); diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index c02737bd4637..d07f517142e6 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -56,7 +56,7 @@ static int if_clone_createif(struct if_clone *ifc, char *name, size_t len, caddr_t params); static struct mtx if_cloners_mtx; -static VNET_DEFINE(int, if_cloners_count); +STATIC_VNET_DEFINE(int, if_cloners_count); VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); #define V_if_cloners_count VNET(if_cloners_count) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 5e5a548fb6d6..0c48ff158463 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -144,7 +144,7 @@ MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* interface internals"); #if defined(INET) || defined(INET6) int ether_ipfw_chk(struct mbuf **m0, struct ifnet *dst, int shared); -static VNET_DEFINE(int, ether_ipfw); +STATIC_VNET_DEFINE(int, ether_ipfw); #define V_ether_ipfw VNET(ether_ipfw) #endif diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index 76838396bc44..be71d600aef6 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -94,7 +94,7 @@ */ static struct mtx gif_mtx; static MALLOC_DEFINE(M_GIF, "gif", "Generic Tunnel Interface"); -static VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); +STATIC_VNET_DEFINE(LIST_HEAD(, gif_softc), gif_softc_list); #define V_gif_softc_list VNET(gif_softc_list) void (*ng_gif_input_p)(struct ifnet *ifp, struct mbuf **mp, int af); @@ -124,7 +124,7 @@ SYSCTL_NODE(_net_link, IFT_GIF, gif, CTLFLAG_RW, 0, */ #define MAX_GIF_NEST 1 #endif -static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; +STATIC_VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; #define V_max_gif_nesting VNET(max_gif_nesting) SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); @@ -135,9 +135,9 @@ SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, * we allow control over this check here. */ #ifdef XBONEHACK -static VNET_DEFINE(int, parallel_tunnels) = 1; +STATIC_VNET_DEFINE(int, parallel_tunnels) = 1; #else -static VNET_DEFINE(int, parallel_tunnels) = 0; +STATIC_VNET_DEFINE(int, parallel_tunnels) = 0; #endif #define V_parallel_tunnels VNET(parallel_tunnels) SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, diff --git a/sys/net/if_llatbl.c b/sys/net/if_llatbl.c index 910d366059dc..7ccd81fd32c3 100644 --- a/sys/net/if_llatbl.c +++ b/sys/net/if_llatbl.c @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_LLTABLE, "lltable", "link level address tables"); -static VNET_DEFINE(SLIST_HEAD(, lltable), lltables); +STATIC_VNET_DEFINE(SLIST_HEAD(, lltable), lltables); #define V_lltables VNET(lltables) extern void arprequest(struct ifnet *, struct in_addr *, struct in_addr *, diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 78d2de21e523..94d51c06942d 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -106,8 +106,8 @@ static void lo_clone_destroy(struct ifnet *); VNET_DEFINE(struct ifnet *, loif); /* Used externally */ #ifdef VIMAGE -static VNET_DEFINE(struct ifc_simple_data, lo_cloner_data); -static VNET_DEFINE(struct if_clone, lo_cloner); +STATIC_VNET_DEFINE(struct ifc_simple_data, lo_cloner_data); +STATIC_VNET_DEFINE(struct if_clone, lo_cloner); #define V_lo_cloner_data VNET(lo_cloner_data) #define V_lo_cloner VNET(lo_cloner) #endif diff --git a/sys/net/if_media.h b/sys/net/if_media.h index c93739276d26..dd6cfa921e73 100644 --- a/sys/net/if_media.h +++ b/sys/net/if_media.h @@ -155,6 +155,8 @@ uint64_t ifmedia_baudrate(int); /* note 31 is the max! */ #define IFM_ETH_MASTER 0x00000100 /* master mode (1000baseT) */ +#define IFM_ETH_RXPAUSE 0x00000200 /* receive PAUSE frames */ +#define IFM_ETH_TXPAUSE 0x00000400 /* transmit PAUSE frames */ /* * Token ring @@ -262,6 +264,7 @@ uint64_t ifmedia_baudrate(int); */ #define IFM_FDX 0x00100000 /* Force full duplex */ #define IFM_HDX 0x00200000 /* Force half duplex */ +#define IFM_FLOW 0x00400000 /* enable hardware flow control */ #define IFM_FLAG0 0x01000000 /* Driver defined flag */ #define IFM_FLAG1 0x02000000 /* Driver defined flag */ #define IFM_FLAG2 0x04000000 /* Driver defined flag */ @@ -279,6 +282,9 @@ uint64_t ifmedia_baudrate(int); #define IFM_MSHIFT 16 /* Mode shift */ #define IFM_GMASK 0x0ff00000 /* Global options */ +/* Ethernet flow control mask */ +#define IFM_ETH_FMASK (IFM_FLOW | IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE) + /* * Status bits */ @@ -388,6 +394,9 @@ struct ifmedia_description { } #define IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS { \ + { IFM_ETH_MASTER, "master" }, \ + { IFM_ETH_RXPAUSE, "rxpause" }, \ + { IFM_ETH_TXPAUSE, "txpause" }, \ { 0, NULL }, \ } @@ -583,6 +592,7 @@ struct ifmedia_description { #define IFM_SHARED_OPTION_DESCRIPTIONS { \ { IFM_FDX, "full-duplex" }, \ { IFM_HDX, "half-duplex" }, \ + { IFM_FLOW, "flowcontrol" }, \ { IFM_FLAG0, "flag0" }, \ { IFM_FLAG1, "flag1" }, \ { IFM_FLAG2, "flag2" }, \ diff --git a/sys/net/route.c b/sys/net/route.c index 5cb06e681b39..ae4b2ca2a741 100644 --- a/sys/net/route.c +++ b/sys/net/route.c @@ -113,7 +113,7 @@ VNET_DEFINE(int, rttrash); /* routes not in table but not freed */ */ #define RNTORT(p) ((struct rtentry *)(p)) -static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ +STATIC_VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */ #define V_rtzone VNET(rtzone) #if 0 diff --git a/sys/net/vnet.c b/sys/net/vnet.c index 8fc52b227983..3608fce72630 100644 --- a/sys/net/vnet.c +++ b/sys/net/vnet.c @@ -177,7 +177,7 @@ MALLOC_DEFINE(M_VNET_DATA, "vnet_data", "VNET data"); * Space to store virtualized global variables from loadable kernel modules, * and the free list to manage it. */ -static VNET_DEFINE(char, modspace[VNET_MODMIN]); +STATIC_VNET_DEFINE(char, modspace[VNET_MODMIN]); /* * Global lists of subsystem constructor and destructors for vnets. They are diff --git a/sys/net/vnet.h b/sys/net/vnet.h index 76123c7e4b88..beecd436d037 100644 --- a/sys/net/vnet.h +++ b/sys/net/vnet.h @@ -95,9 +95,7 @@ struct vnet { * Location of the kernel's 'set_vnet' linker set. */ extern uintptr_t *__start_set_vnet; -__GLOBL(__start_set_vnet); extern uintptr_t *__stop_set_vnet; -__GLOBL(__stop_set_vnet); #define VNET_START (uintptr_t)&__start_set_vnet #define VNET_STOP (uintptr_t)&__stop_set_vnet @@ -195,9 +193,14 @@ extern struct sx vnet_sxlock; */ #define VNET_NAME(n) vnet_entry_##n #define VNET_DECLARE(t, n) extern t VNET_NAME(n) -#define VNET_DEFINE(t, n) t VNET_NAME(n) __section(VNET_SETNAME) __used -#define _VNET_PTR(b, n) (__typeof(VNET_NAME(n))*) \ - ((b) + (uintptr_t)&VNET_NAME(n)) +#define VNET_DEFINE(t, n) \ + __GLOBL("__start_" VNET_SETNAME); \ + __GLOBL("__stop_" VNET_SETNAME); \ + t VNET_NAME(n) __section(VNET_SETNAME) __used +#define STATIC_VNET_DEFINE(t, n) \ + VNET_DEFINE(static t, n) +#define _VNET_PTR(b, n) \ + (__typeof(VNET_NAME(n))*)((b) + (uintptr_t)&VNET_NAME(n)) #define _VNET(b, n) (*_VNET_PTR(b, n)) @@ -371,10 +374,11 @@ do { \ * Versions of the VNET macros that compile to normal global variables and * standard sysctl definitions. */ -#define VNET_NAME(n) n -#define VNET_DECLARE(t, n) extern t n -#define VNET_DEFINE(t, n) t n -#define _VNET_PTR(b, n) &VNET_NAME(n) +#define VNET_NAME(n) n +#define VNET_DECLARE(t, n) extern t n +#define VNET_DEFINE(t, n) t n +#define STATIC_VNET_DEFINE(t, n) static t n +#define _VNET_PTR(b, n) &VNET_NAME(n) /* * Virtualized global variable accessor macros. diff --git a/sys/net80211/ieee80211_ratectl.h b/sys/net80211/ieee80211_ratectl.h index 592405c82ae5..be81781c519f 100644 --- a/sys/net80211/ieee80211_ratectl.h +++ b/sys/net80211/ieee80211_ratectl.h @@ -81,8 +81,6 @@ ieee80211_ratectl_node_deinit(struct ieee80211_node *ni) { const struct ieee80211vap *vap = ni->ni_vap; - if (ni->ni_rctls == NULL) /* ratectl not setup */ - return; vap->iv_rate->ir_node_deinit(ni); } @@ -91,8 +89,6 @@ ieee80211_ratectl_rate(struct ieee80211_node *ni, void *arg, uint32_t iarg) { const struct ieee80211vap *vap = ni->ni_vap; - if (ni->ni_rctls == NULL) /* ratectl not setup */ - return 0; return vap->iv_rate->ir_rate(ni, arg, iarg); } @@ -100,8 +96,6 @@ static void __inline ieee80211_ratectl_tx_complete(const struct ieee80211vap *vap, const struct ieee80211_node *ni, int status, void *arg1, void *arg2) { - if (ni->ni_rctls == NULL) /* ratectl not setup */ - return; vap->iv_rate->ir_tx_complete(vap, ni, status, arg1, arg2); } @@ -111,8 +105,6 @@ ieee80211_ratectl_tx_update(const struct ieee80211vap *vap, { if (vap->iv_rate->ir_tx_update == NULL) return; - if (ni->ni_rctls == NULL) /* ratectl not setup */ - return; vap->iv_rate->ir_tx_update(vap, ni, arg1, arg2, arg3); } diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index dba6e75aa737..a334ccc84b2b 100644 --- a/sys/netgraph/ng_base.c +++ b/sys/netgraph/ng_base.c @@ -171,7 +171,7 @@ static struct mtx ng_typelist_mtx; /* Hash related definitions */ /* XXX Don't need to initialise them because it's a LIST */ -static VNET_DEFINE(LIST_HEAD(, ng_node), ng_ID_hash[NG_ID_HASH_SIZE]); +STATIC_VNET_DEFINE(LIST_HEAD(, ng_node), ng_ID_hash[NG_ID_HASH_SIZE]); #define V_ng_ID_hash VNET(ng_ID_hash) static struct mtx ng_idhash_mtx; @@ -189,7 +189,7 @@ static struct mtx ng_idhash_mtx; } \ } while (0) -static VNET_DEFINE(LIST_HEAD(, ng_node), ng_name_hash[NG_NAME_HASH_SIZE]); +STATIC_VNET_DEFINE(LIST_HEAD(, ng_node), ng_name_hash[NG_NAME_HASH_SIZE]); #define V_ng_name_hash VNET(ng_name_hash) static struct mtx ng_namehash_mtx; @@ -359,7 +359,7 @@ ng_alloc_node(void) #define TRAP_ERROR() #endif -static VNET_DEFINE(ng_ID_t, nextID) = 1; +STATIC_VNET_DEFINE(ng_ID_t, nextID) = 1; #define V_nextID VNET(nextID) #ifdef INVARIANTS diff --git a/sys/netgraph/ng_eiface.c b/sys/netgraph/ng_eiface.c index 4239328967ef..348e5f247b6d 100644 --- a/sys/netgraph/ng_eiface.c +++ b/sys/netgraph/ng_eiface.c @@ -114,7 +114,7 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(eiface, &typestruct); -static VNET_DEFINE(struct unrhdr *, ng_eiface_unit); +STATIC_VNET_DEFINE(struct unrhdr *, ng_eiface_unit); #define V_ng_eiface_unit VNET(ng_eiface_unit) /************************************************************************ diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c index 03ad016c2ab2..9ea8e1323087 100644 --- a/sys/netgraph/ng_iface.c +++ b/sys/netgraph/ng_iface.c @@ -210,7 +210,7 @@ static struct ng_type typestruct = { }; NETGRAPH_INIT(iface, &typestruct); -static VNET_DEFINE(struct unrhdr *, ng_iface_unit); +STATIC_VNET_DEFINE(struct unrhdr *, ng_iface_unit); #define V_ng_iface_unit VNET(ng_iface_unit) /************************************************************************ diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index ef59cdb30ae5..a6cc4e4543ae 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -81,17 +81,17 @@ SYSCTL_NODE(_net_link_ether, PF_INET, inet, CTLFLAG_RW, 0, ""); SYSCTL_NODE(_net_link_ether, PF_ARP, arp, CTLFLAG_RW, 0, ""); /* timer values */ -static VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20 +STATIC_VNET_DEFINE(int, arpt_keep) = (20*60); /* once resolved, good for 20 * minutes */ -static VNET_DEFINE(int, arp_maxtries) = 5; +STATIC_VNET_DEFINE(int, arp_maxtries) = 5; VNET_DEFINE(int, useloopback) = 1; /* use loopback interface for * local traffic */ -static VNET_DEFINE(int, arp_proxyall) = 0; -static VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for +STATIC_VNET_DEFINE(int, arp_proxyall) = 0; +STATIC_VNET_DEFINE(int, arpt_down) = 20; /* keep incomplete entries for * 20 seconds */ VNET_DEFINE(struct arpstat, arpstat); /* ARP statistics, see if_arp.h */ -static VNET_DEFINE(int, arp_maxhold) = 1; +STATIC_VNET_DEFINE(int, arp_maxhold) = 1; #define V_arpt_keep VNET(arpt_keep) #define V_arpt_down VNET(arpt_down) diff --git a/sys/netinet/igmp.c b/sys/netinet/igmp.c index b02d30beb638..fe4f160cac55 100644 --- a/sys/netinet/igmp.c +++ b/sys/netinet/igmp.c @@ -206,11 +206,11 @@ MALLOC_DEFINE(M_IGMP, "igmp", "igmp state"); * FUTURE: Stop using IFP_TO_IA/INADDR_ANY, and use source address selection * policy to control the address used by IGMP on the link. */ -static VNET_DEFINE(int, interface_timers_running); /* IGMPv3 general +STATIC_VNET_DEFINE(int, interface_timers_running); /* IGMPv3 general * query response */ -static VNET_DEFINE(int, state_change_timers_running); /* IGMPv3 state-change +STATIC_VNET_DEFINE(int, state_change_timers_running); /* IGMPv3 state-change * retransmit */ -static VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host +STATIC_VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host * report; IGMPv3 g/sg * query response */ @@ -218,24 +218,24 @@ static VNET_DEFINE(int, current_state_timers_running); /* IGMPv1/v2 host #define V_state_change_timers_running VNET(state_change_timers_running) #define V_current_state_timers_running VNET(current_state_timers_running) -static VNET_DEFINE(LIST_HEAD(, igmp_ifinfo), igi_head); -static VNET_DEFINE(struct igmpstat, igmpstat) = { +STATIC_VNET_DEFINE(LIST_HEAD(, igmp_ifinfo), igi_head); +STATIC_VNET_DEFINE(struct igmpstat, igmpstat) = { .igps_version = IGPS_VERSION_3, .igps_len = sizeof(struct igmpstat), }; -static VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0}; +STATIC_VNET_DEFINE(struct timeval, igmp_gsrdelay) = {10, 0}; #define V_igi_head VNET(igi_head) #define V_igmpstat VNET(igmpstat) #define V_igmp_gsrdelay VNET(igmp_gsrdelay) -static VNET_DEFINE(int, igmp_recvifkludge) = 1; -static VNET_DEFINE(int, igmp_sendra) = 1; -static VNET_DEFINE(int, igmp_sendlocal) = 1; -static VNET_DEFINE(int, igmp_v1enable) = 1; -static VNET_DEFINE(int, igmp_v2enable) = 1; -static VNET_DEFINE(int, igmp_legacysupp); -static VNET_DEFINE(int, igmp_default_version) = IGMP_VERSION_3; +STATIC_VNET_DEFINE(int, igmp_recvifkludge) = 1; +STATIC_VNET_DEFINE(int, igmp_sendra) = 1; +STATIC_VNET_DEFINE(int, igmp_sendlocal) = 1; +STATIC_VNET_DEFINE(int, igmp_v1enable) = 1; +STATIC_VNET_DEFINE(int, igmp_v2enable) = 1; +STATIC_VNET_DEFINE(int, igmp_legacysupp); +STATIC_VNET_DEFINE(int, igmp_default_version) = IGMP_VERSION_3; #define V_igmp_recvifkludge VNET(igmp_recvifkludge) #define V_igmp_sendra VNET(igmp_sendra) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index 2ec54e29ede2..a7dcb86b7263 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -76,12 +76,12 @@ static int in_ifinit(struct ifnet *, struct in_ifaddr *, struct sockaddr_in *, int); static void in_purgemaddrs(struct ifnet *); -static VNET_DEFINE(int, subnetsarelocal); +STATIC_VNET_DEFINE(int, subnetsarelocal); #define V_subnetsarelocal VNET(subnetsarelocal) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, subnets_are_local, CTLFLAG_RW, &VNET_NAME(subnetsarelocal), 0, "Treat all subnets as directly connected"); -static VNET_DEFINE(int, sameprefixcarponly); +STATIC_VNET_DEFINE(int, sameprefixcarponly); #define V_sameprefixcarponly VNET(sameprefixcarponly) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, same_prefix_carp_only, CTLFLAG_RW, &VNET_NAME(sameprefixcarponly), 0, diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index be85af4b8c7d..5153ae0e3bd7 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -108,7 +108,7 @@ VNET_DEFINE(int, ipport_randomcps) = 10; /* user controlled via sysctl */ VNET_DEFINE(int, ipport_randomtime) = 45; /* user controlled via sysctl */ VNET_DEFINE(int, ipport_stoprandom); /* toggled by ipport_tick */ VNET_DEFINE(int, ipport_tcpallocs); -static VNET_DEFINE(int, ipport_tcplastcount); +STATIC_VNET_DEFINE(int, ipport_tcplastcount); #define V_ipport_tcplastcount VNET(ipport_tcplastcount) diff --git a/sys/netinet/in_rmx.c b/sys/netinet/in_rmx.c index 1389873eb802..736a2ead8283 100644 --- a/sys/netinet/in_rmx.c +++ b/sys/netinet/in_rmx.c @@ -132,21 +132,21 @@ in_matroute(void *v_arg, struct radix_node_head *head) return rn; } -static VNET_DEFINE(int, rtq_reallyold) = 60*60; /* one hour is "really old" */ +STATIC_VNET_DEFINE(int, rtq_reallyold) = 60*60; /* one hour is "really old" */ #define V_rtq_reallyold VNET(rtq_reallyold) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_RW, &VNET_NAME(rtq_reallyold), 0, "Default expiration time on dynamically learned routes"); /* never automatically crank down to less */ -static VNET_DEFINE(int, rtq_minreallyold) = 10; +STATIC_VNET_DEFINE(int, rtq_minreallyold) = 10; #define V_rtq_minreallyold VNET(rtq_minreallyold) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, &VNET_NAME(rtq_minreallyold), 0, "Minimum time to attempt to hold onto dynamically learned routes"); /* 128 cached routes is "too many" */ -static VNET_DEFINE(int, rtq_toomany) = 128; +STATIC_VNET_DEFINE(int, rtq_toomany) = 128; #define V_rtq_toomany VNET(rtq_toomany) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, &VNET_NAME(rtq_toomany), 0, @@ -240,8 +240,8 @@ in_rtqkill(struct radix_node *rn, void *rock) } #define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout) = RTQ_TIMEOUT; -static VNET_DEFINE(struct callout, rtq_timer); +STATIC_VNET_DEFINE(int, rtq_timeout) = RTQ_TIMEOUT; +STATIC_VNET_DEFINE(struct callout, rtq_timer); #define V_rtq_timeout VNET(rtq_timeout) #define V_rtq_timer VNET(rtq_timer) diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c index 0837d2e25299..6d01f4fd408b 100644 --- a/sys/netinet/ip_divert.c +++ b/sys/netinet/ip_divert.c @@ -105,8 +105,8 @@ __FBSDID("$FreeBSD$"); */ /* Internal variables. */ -static VNET_DEFINE(struct inpcbhead, divcb); -static VNET_DEFINE(struct inpcbinfo, divcbinfo); +STATIC_VNET_DEFINE(struct inpcbhead, divcb); +STATIC_VNET_DEFINE(struct inpcbinfo, divcbinfo); #define V_divcb VNET(divcb) #define V_divcbinfo VNET(divcbinfo) diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 03993930f033..bf98537e6c95 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -106,7 +106,7 @@ __FBSDID("$FreeBSD$"); #include -static VNET_DEFINE(int, ipfastforward_active); +STATIC_VNET_DEFINE(int, ipfastforward_active); #define V_ipfastforward_active VNET(ipfastforward_active) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_RW, diff --git a/sys/netinet/ip_icmp.c b/sys/netinet/ip_icmp.c index 480a2c80db55..575010f3dde5 100644 --- a/sys/netinet/ip_icmp.c +++ b/sys/netinet/ip_icmp.c @@ -80,55 +80,55 @@ VNET_DEFINE(struct icmpstat, icmpstat); SYSCTL_VNET_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(icmpstat), icmpstat, ""); -static VNET_DEFINE(int, icmpmaskrepl) = 0; +STATIC_VNET_DEFINE(int, icmpmaskrepl) = 0; #define V_icmpmaskrepl VNET(icmpmaskrepl) SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_MASKREPL, maskrepl, CTLFLAG_RW, &VNET_NAME(icmpmaskrepl), 0, "Reply to ICMP Address Mask Request packets."); -static VNET_DEFINE(u_int, icmpmaskfake) = 0; +STATIC_VNET_DEFINE(u_int, icmpmaskfake) = 0; #define V_icmpmaskfake VNET(icmpmaskfake) SYSCTL_VNET_UINT(_net_inet_icmp, OID_AUTO, maskfake, CTLFLAG_RW, &VNET_NAME(icmpmaskfake), 0, "Fake reply to ICMP Address Mask Request packets."); -static VNET_DEFINE(int, drop_redirect) = 0; +STATIC_VNET_DEFINE(int, drop_redirect) = 0; #define V_drop_redirect VNET(drop_redirect) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, drop_redirect, CTLFLAG_RW, &VNET_NAME(drop_redirect), 0, "Ignore ICMP redirects"); -static VNET_DEFINE(int, log_redirect) = 0; +STATIC_VNET_DEFINE(int, log_redirect) = 0; #define V_log_redirect VNET(log_redirect) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, log_redirect, CTLFLAG_RW, &VNET_NAME(log_redirect), 0, "Log ICMP redirects to the console"); -static VNET_DEFINE(int, icmplim) = 200; +STATIC_VNET_DEFINE(int, icmplim) = 200; #define V_icmplim VNET(icmplim) SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, &VNET_NAME(icmplim), 0, "Maximum number of ICMP responses per second"); -static VNET_DEFINE(int, icmplim_output) = 1; +STATIC_VNET_DEFINE(int, icmplim_output) = 1; #define V_icmplim_output VNET(icmplim_output) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, "Enable rate limiting of ICMP responses"); -static VNET_DEFINE(char, reply_src[IFNAMSIZ]); +STATIC_VNET_DEFINE(char, reply_src[IFNAMSIZ]); #define V_reply_src VNET(reply_src) SYSCTL_VNET_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW, &VNET_NAME(reply_src), IFNAMSIZ, "icmp reply source for non-local packets."); -static VNET_DEFINE(int, icmp_rfi) = 0; +STATIC_VNET_DEFINE(int, icmp_rfi) = 0; #define V_icmp_rfi VNET(icmp_rfi) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, reply_from_interface, CTLFLAG_RW, &VNET_NAME(icmp_rfi), 0, "ICMP reply from incoming interface for non-local packets"); -static VNET_DEFINE(int, icmp_quotelen) = 8; +STATIC_VNET_DEFINE(int, icmp_quotelen) = 8; #define V_icmp_quotelen VNET(icmp_quotelen) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_RW, &VNET_NAME(icmp_quotelen), 0, @@ -137,7 +137,7 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, quotelen, CTLFLAG_RW, /* * ICMP broadcast echo sysctl */ -static VNET_DEFINE(int, icmpbmcastecho) = 0; +STATIC_VNET_DEFINE(int, icmpbmcastecho) = 0; #define V_icmpbmcastecho VNET(icmpbmcastecho) SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, bmcastecho, CTLFLAG_RW, &VNET_NAME(icmpbmcastecho), 0, diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 6e1153d0b739..109d3e3a6e35 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -96,7 +96,7 @@ SYSCTL_VNET_INT(_net_inet_ip, IPCTL_FORWARDING, forwarding, CTLFLAG_RW, &VNET_NAME(ipforwarding), 0, "Enable IP forwarding between interfaces"); -static VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ +STATIC_VNET_DEFINE(int, ipsendredirects) = 1; /* XXX */ #define V_ipsendredirects VNET(ipsendredirects) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SENDREDIRECTS, redirect, CTLFLAG_RW, &VNET_NAME(ipsendredirects), 0, @@ -107,13 +107,13 @@ SYSCTL_VNET_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW, &VNET_NAME(ip_defttl), 0, "Maximum TTL on IP packets"); -static VNET_DEFINE(int, ip_keepfaith); +STATIC_VNET_DEFINE(int, ip_keepfaith); #define V_ip_keepfaith VNET(ip_keepfaith) SYSCTL_VNET_INT(_net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_RW, &VNET_NAME(ip_keepfaith), 0, "Enable packet capture for FAITH IPv4->IPv6 translater daemon"); -static VNET_DEFINE(int, ip_sendsourcequench); +STATIC_VNET_DEFINE(int, ip_sendsourcequench); #define V_ip_sendsourcequench VNET(ip_sendsourcequench) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, sendsourcequench, CTLFLAG_RW, &VNET_NAME(ip_sendsourcequench), 0, @@ -137,7 +137,7 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, random_id, CTLFLAG_RW, * to the loopback interface instead of the interface where the * packets for those addresses are received. */ -static VNET_DEFINE(int, ip_checkinterface); +STATIC_VNET_DEFINE(int, ip_checkinterface); #define V_ip_checkinterface VNET(ip_checkinterface) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, check_interface, CTLFLAG_RW, &VNET_NAME(ip_checkinterface), 0, @@ -164,8 +164,8 @@ SYSCTL_VNET_STRUCT(_net_inet_ip, IPCTL_STATS, stats, CTLFLAG_RW, &VNET_NAME(ipstat), ipstat, "IP statistics (struct ipstat, netinet/ip_var.h)"); -static VNET_DEFINE(uma_zone_t, ipq_zone); -static VNET_DEFINE(TAILQ_HEAD(ipqhead, ipq), ipq[IPREASS_NHASH]); +STATIC_VNET_DEFINE(uma_zone_t, ipq_zone); +STATIC_VNET_DEFINE(TAILQ_HEAD(ipqhead, ipq), ipq[IPREASS_NHASH]); static struct mtx ipqlock; #define V_ipq_zone VNET(ipq_zone) @@ -180,15 +180,15 @@ static void maxnipq_update(void); static void ipq_zone_change(void *); static void ip_drain_locked(void); -static VNET_DEFINE(int, maxnipq); /* Administrative limit on # reass queues. */ -static VNET_DEFINE(int, nipq); /* Total # of reass queues */ +STATIC_VNET_DEFINE(int, maxnipq); /* Administrative limit on # reass queues. */ +STATIC_VNET_DEFINE(int, nipq); /* Total # of reass queues */ #define V_maxnipq VNET(maxnipq) #define V_nipq VNET(nipq) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fragpackets, CTLFLAG_RD, &VNET_NAME(nipq), 0, "Current number of IPv4 fragment reassembly queue entries"); -static VNET_DEFINE(int, maxfragsperpacket); +STATIC_VNET_DEFINE(int, maxfragsperpacket); #define V_maxfragsperpacket VNET(maxfragsperpacket) SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, maxfragsperpacket, CTLFLAG_RW, &VNET_NAME(maxfragsperpacket), 0, @@ -209,7 +209,7 @@ SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, stealth, CTLFLAG_RW, #endif #ifdef FLOWTABLE -static VNET_DEFINE(int, ip_output_flowtable_size) = 2048; +STATIC_VNET_DEFINE(int, ip_output_flowtable_size) = 2048; VNET_DEFINE(struct flowtable *, ip_ft); #define V_ip_output_flowtable_size VNET(ip_output_flowtable_size) @@ -1719,7 +1719,7 @@ ip_savecontrol(struct inpcb *inp, struct mbuf **mp, struct ip *ip, * locking. This code remains in ip_input.c as ip_mroute.c is optionally * compiled. */ -static VNET_DEFINE(int, ip_rsvp_on); +STATIC_VNET_DEFINE(int, ip_rsvp_on); VNET_DEFINE(struct socket *, ip_rsvpd); #define V_ip_rsvp_on VNET(ip_rsvp_on) diff --git a/sys/netinet/ip_ipsec.c b/sys/netinet/ip_ipsec.c index 50a6ce44a490..bdc55de185ff 100644 --- a/sys/netinet/ip_ipsec.c +++ b/sys/netinet/ip_ipsec.c @@ -72,9 +72,9 @@ extern struct protosw inetsw[]; #ifdef IPSEC #ifdef IPSEC_FILTERTUNNEL -static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 1; +STATIC_VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 1; #else -static VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 0; +STATIC_VNET_DEFINE(int, ip4_ipsec_filtertunnel) = 0; #endif #define V_ip4_ipsec_filtertunnel VNET(ip4_ipsec_filtertunnel) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 8736caff811b..f6fd276c4eb1 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -121,7 +121,7 @@ __FBSDID("$FreeBSD$"); #define VIFI_INVALID ((vifi_t) -1) #define M_HASCL(m) ((m)->m_flags & M_EXT) -static VNET_DEFINE(uint32_t, last_tv_sec); /* last time we processed this */ +STATIC_VNET_DEFINE(uint32_t, last_tv_sec); /* last time we processed this */ #define V_last_tv_sec VNET(last_tv_sec) static MALLOC_DEFINE(M_MRTABLE, "mroutetbl", "multicast forwarding cache"); @@ -145,14 +145,14 @@ static struct mtx mrouter_mtx; static int ip_mrouter_cnt; /* # of vnets with active mrouters */ static int ip_mrouter_unloading; /* Allow no more V_ip_mrouter sockets */ -static VNET_DEFINE(struct mrtstat, mrtstat); +STATIC_VNET_DEFINE(struct mrtstat, mrtstat); #define V_mrtstat VNET(mrtstat) SYSCTL_VNET_STRUCT(_net_inet_ip, OID_AUTO, mrtstat, CTLFLAG_RW, &VNET_NAME(mrtstat), mrtstat, "IPv4 Multicast Forwarding Statistics (struct mrtstat, " "netinet/ip_mroute.h)"); -static VNET_DEFINE(u_long, mfchash); +STATIC_VNET_DEFINE(u_long, mfchash); #define V_mfchash VNET(mfchash) #define MFCHASH(a, g) \ ((((a).s_addr >> 20) ^ ((a).s_addr >> 10) ^ (a).s_addr ^ \ @@ -160,9 +160,9 @@ static VNET_DEFINE(u_long, mfchash); #define MFCHASHSIZE 256 static u_long mfchashsize; /* Hash size */ -static VNET_DEFINE(u_char *, nexpire); /* 0..mfchashsize-1 */ +STATIC_VNET_DEFINE(u_char *, nexpire); /* 0..mfchashsize-1 */ #define V_nexpire VNET(nexpire) -static VNET_DEFINE(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl); +STATIC_VNET_DEFINE(LIST_HEAD(mfchashhdr, mfc)*, mfchashtbl); #define V_mfchashtbl VNET(mfchashtbl) static struct mtx mfc_mtx; @@ -173,9 +173,9 @@ static struct mtx mfc_mtx; mtx_init(&mfc_mtx, "IPv4 multicast forwarding cache", NULL, MTX_DEF) #define MFC_LOCK_DESTROY() mtx_destroy(&mfc_mtx) -static VNET_DEFINE(vifi_t, numvifs); +STATIC_VNET_DEFINE(vifi_t, numvifs); #define V_numvifs VNET(numvifs) -static VNET_DEFINE(struct vif, viftable[MAXVIFS]); +STATIC_VNET_DEFINE(struct vif, viftable[MAXVIFS]); #define V_viftable VNET(viftable) SYSCTL_VNET_OPAQUE(_net_inet_ip, OID_AUTO, viftable, CTLFLAG_RD, &VNET_NAME(viftable), sizeof(V_viftable), "S,vif[MAXVIFS]", @@ -191,7 +191,7 @@ static struct mtx vif_mtx; static eventhandler_tag if_detach_event_tag = NULL; -static VNET_DEFINE(struct callout, expire_upcalls_ch); +STATIC_VNET_DEFINE(struct callout, expire_upcalls_ch); #define V_expire_upcalls_ch VNET(expire_upcalls_ch) #define EXPIRE_TIMEOUT (hz / 4) /* 4x / second */ @@ -206,9 +206,9 @@ static MALLOC_DEFINE(M_BWMETER, "bwmeter", "multicast upcall bw meters"); * expiration time. Periodically, the entries are analysed and processed. */ #define BW_METER_BUCKETS 1024 -static VNET_DEFINE(struct bw_meter*, bw_meter_timers[BW_METER_BUCKETS]); +STATIC_VNET_DEFINE(struct bw_meter*, bw_meter_timers[BW_METER_BUCKETS]); #define V_bw_meter_timers VNET(bw_meter_timers) -static VNET_DEFINE(struct callout, bw_meter_ch); +STATIC_VNET_DEFINE(struct callout, bw_meter_ch); #define V_bw_meter_ch VNET(bw_meter_ch) #define BW_METER_PERIOD (hz) /* periodical handling of bw meters */ @@ -216,16 +216,16 @@ static VNET_DEFINE(struct callout, bw_meter_ch); * Pending upcalls are stored in a vector which is flushed when * full, or periodically */ -static VNET_DEFINE(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]); +STATIC_VNET_DEFINE(struct bw_upcall, bw_upcalls[BW_UPCALLS_MAX]); #define V_bw_upcalls VNET(bw_upcalls) -static VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */ +STATIC_VNET_DEFINE(u_int, bw_upcalls_n); /* # of pending upcalls */ #define V_bw_upcalls_n VNET(bw_upcalls_n) -static VNET_DEFINE(struct callout, bw_upcalls_ch); +STATIC_VNET_DEFINE(struct callout, bw_upcalls_ch); #define V_bw_upcalls_ch VNET(bw_upcalls_ch) #define BW_UPCALLS_PERIOD (hz) /* periodical flush of bw upcalls */ -static VNET_DEFINE(struct pimstat, pimstat); +STATIC_VNET_DEFINE(struct pimstat, pimstat); #define V_pimstat VNET(pimstat) SYSCTL_NODE(_net_inet, IPPROTO_PIM, pim, CTLFLAG_RW, 0, "PIM"); @@ -296,9 +296,9 @@ static struct pim_encap_pimhdr pim_encap_pimhdr = { 0 /* flags */ }; -static VNET_DEFINE(vifi_t, reg_vif_num) = VIFI_INVALID; +STATIC_VNET_DEFINE(vifi_t, reg_vif_num) = VIFI_INVALID; #define V_reg_vif_num VNET(reg_vif_num) -static VNET_DEFINE(struct ifnet, multicast_register_if); +STATIC_VNET_DEFINE(struct ifnet, multicast_register_if); #define V_multicast_register_if VNET(multicast_register_if) /* @@ -367,9 +367,9 @@ static const uint32_t mrt_api_support = (MRT_MFC_FLAGS_DISABLE_WRONGVIF | MRT_MFC_FLAGS_BORDER_VIF | MRT_MFC_RP | MRT_MFC_BW_UPCALL); -static VNET_DEFINE(uint32_t, mrt_api_config); +STATIC_VNET_DEFINE(uint32_t, mrt_api_config); #define V_mrt_api_config VNET(mrt_api_config) -static VNET_DEFINE(int, pim_assert_enabled); +STATIC_VNET_DEFINE(int, pim_assert_enabled); #define V_pim_assert_enabled VNET(pim_assert_enabled) static struct timeval pim_assert_interval = { 3, 0 }; /* Rate limit */ diff --git a/sys/netinet/ipfw/ip_fw2.c b/sys/netinet/ipfw/ip_fw2.c index 43b2d1114295..53aa5d015d39 100644 --- a/sys/netinet/ipfw/ip_fw2.c +++ b/sys/netinet/ipfw/ip_fw2.c @@ -100,10 +100,10 @@ __FBSDID("$FreeBSD$"); */ /* ipfw_vnet_ready controls when we are open for business */ -static VNET_DEFINE(int, ipfw_vnet_ready) = 0; +STATIC_VNET_DEFINE(int, ipfw_vnet_ready) = 0; #define V_ipfw_vnet_ready VNET(ipfw_vnet_ready) -static VNET_DEFINE(int, fw_deny_unknown_exthdrs); +STATIC_VNET_DEFINE(int, fw_deny_unknown_exthdrs); #define V_fw_deny_unknown_exthdrs VNET(fw_deny_unknown_exthdrs) #ifdef IPFIREWALL_DEFAULT_TO_ACCEPT diff --git a/sys/netinet/ipfw/ip_fw_dynamic.c b/sys/netinet/ipfw/ip_fw_dynamic.c index c8ea4b756cf5..33ff5b28807f 100644 --- a/sys/netinet/ipfw/ip_fw_dynamic.c +++ b/sys/netinet/ipfw/ip_fw_dynamic.c @@ -118,10 +118,10 @@ __FBSDID("$FreeBSD$"); /* * Static variables followed by global ones */ -static VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); -static VNET_DEFINE(struct callout, ipfw_timeout); +STATIC_VNET_DEFINE(ipfw_dyn_rule **, ipfw_dyn_v); +STATIC_VNET_DEFINE(u_int32_t, dyn_buckets); +STATIC_VNET_DEFINE(u_int32_t, curr_dyn_buckets); +STATIC_VNET_DEFINE(struct callout, ipfw_timeout); #define V_ipfw_dyn_v VNET(ipfw_dyn_v) #define V_dyn_buckets VNET(dyn_buckets) #define V_curr_dyn_buckets VNET(curr_dyn_buckets) @@ -150,12 +150,12 @@ ipfw_dyn_unlock(void) /* * Timeouts for various events in handing dynamic rules. */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); +STATIC_VNET_DEFINE(u_int32_t, dyn_ack_lifetime); +STATIC_VNET_DEFINE(u_int32_t, dyn_syn_lifetime); +STATIC_VNET_DEFINE(u_int32_t, dyn_fin_lifetime); +STATIC_VNET_DEFINE(u_int32_t, dyn_rst_lifetime); +STATIC_VNET_DEFINE(u_int32_t, dyn_udp_lifetime); +STATIC_VNET_DEFINE(u_int32_t, dyn_short_lifetime); #define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) #define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) @@ -172,16 +172,16 @@ static VNET_DEFINE(u_int32_t, dyn_short_lifetime); * than dyn_keepalive_period. */ -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); +STATIC_VNET_DEFINE(u_int32_t, dyn_keepalive_interval); +STATIC_VNET_DEFINE(u_int32_t, dyn_keepalive_period); +STATIC_VNET_DEFINE(u_int32_t, dyn_keepalive); #define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) #define V_dyn_keepalive_period VNET(dyn_keepalive_period) #define V_dyn_keepalive VNET(dyn_keepalive) -static VNET_DEFINE(u_int32_t, dyn_count); /* # of dynamic rules */ -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ +STATIC_VNET_DEFINE(u_int32_t, dyn_count); /* # of dynamic rules */ +STATIC_VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ #define V_dyn_count VNET(dyn_count) #define V_dyn_max VNET(dyn_max) diff --git a/sys/netinet/ipfw/ip_fw_nat.c b/sys/netinet/ipfw/ip_fw_nat.c index 6f223ed0de6f..9fa860253ab1 100644 --- a/sys/netinet/ipfw/ip_fw_nat.c +++ b/sys/netinet/ipfw/ip_fw_nat.c @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include /* XXX for in_cksum */ -static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); +STATIC_VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); #define V_ifaddr_event_tag VNET(ifaddr_event_tag) static void diff --git a/sys/netinet/ipfw/ip_fw_pfil.c b/sys/netinet/ipfw/ip_fw_pfil.c index 248e4dd8a754..f15a9699a808 100644 --- a/sys/netinet/ipfw/ip_fw_pfil.c +++ b/sys/netinet/ipfw/ip_fw_pfil.c @@ -63,11 +63,11 @@ __FBSDID("$FreeBSD$"); #include -static VNET_DEFINE(int, fw_enable) = 1; +STATIC_VNET_DEFINE(int, fw_enable) = 1; #define V_fw_enable VNET(fw_enable) #ifdef INET6 -static VNET_DEFINE(int, fw6_enable) = 1; +STATIC_VNET_DEFINE(int, fw6_enable) = 1; #define V_fw6_enable VNET(fw6_enable) #endif diff --git a/sys/netinet/sctp_crc32.c b/sys/netinet/sctp_crc32.c index 0ab8039ac064..b727ef9d4b93 100644 --- a/sys/netinet/sctp_crc32.c +++ b/sys/netinet/sctp_crc32.c @@ -124,18 +124,16 @@ sctp_delayed_cksum(struct mbuf *m, uint32_t offset) #if defined(SCTP_WITH_NO_CSUM) panic("sctp_delayed_cksum() called when using no SCTP CRC."); #else - struct ip *ip; uint32_t checksum; - ip = mtod(m, struct ip *); checksum = sctp_calculate_cksum(m, offset); SCTP_STAT_DECR(sctps_sendhwcrc); SCTP_STAT_INCR(sctps_sendswcrc); offset += offsetof(struct sctphdr, checksum); if (offset + sizeof(uint32_t) > (uint32_t) (m->m_len)) { - printf("delayed m_pullup, m->len: %d off: %d p: %d\n", - (uint32_t) m->m_len, offset, ip->ip_p); + printf("sctp_delayed_cksum(): m->len: %d, off: %d.\n", + (uint32_t) m->m_len, offset); /* * XXX this shouldn't happen, but if it does, the correct * behavior may be to insert the checksum in the appropriate diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 06d4e61a30c3..d8bc9aa50596 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -4069,15 +4069,9 @@ sctp_lowlevel_chunk_output(struct sctp_inpcb *inp, #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); #else - if (!(SCTP_BASE_SYSCTL(sctp_no_csum_on_loopback) && - (stcb) && - (stcb->asoc.loopback_scope))) { - m->m_pkthdr.csum_flags = CSUM_SCTP; - m->m_pkthdr.csum_data = 0; - SCTP_STAT_INCR(sctps_sendhwcrc); - } else { - SCTP_STAT_INCR(sctps_sendnocrc); - } + m->m_pkthdr.csum_flags = CSUM_SCTP; + m->m_pkthdr.csum_data = 0; + SCTP_STAT_INCR(sctps_sendhwcrc); #endif } /* send it out. table id is taken from stcb */ diff --git a/sys/netinet/siftr.c b/sys/netinet/siftr.c index 5f2a6927b2fa..af77fec5678b 100644 --- a/sys/netinet/siftr.c +++ b/sys/netinet/siftr.c @@ -260,7 +260,7 @@ struct siftr_stats uint32_t nskip_out_dejavu; }; -static DPCPU_DEFINE(struct siftr_stats, ss); +STATIC_DPCPU_DEFINE(struct siftr_stats, ss); static volatile unsigned int siftr_exit_pkt_manager_thread = 0; static unsigned int siftr_enabled = 0; diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c index d20adb7567d2..3ba295e2b62b 100644 --- a/sys/netinet/tcp_hostcache.c +++ b/sys/netinet/tcp_hostcache.c @@ -106,10 +106,10 @@ __FBSDID("$FreeBSD$"); #define TCP_HOSTCACHE_EXPIRE 60*60 /* one hour */ #define TCP_HOSTCACHE_PRUNE 5*60 /* every 5 minutes */ -static VNET_DEFINE(struct tcp_hostcache, tcp_hostcache); +STATIC_VNET_DEFINE(struct tcp_hostcache, tcp_hostcache); #define V_tcp_hostcache VNET(tcp_hostcache) -static VNET_DEFINE(struct callout, tcp_hc_callout); +STATIC_VNET_DEFINE(struct callout, tcp_hc_callout); #define V_tcp_hc_callout VNET(tcp_hc_callout) static struct hc_metrics *tcp_hc_lookup(struct in_conninfo *); diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 9efacdcdbbce..1d840cd4175a 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -80,25 +80,25 @@ static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, "TCP Segment Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_maxseg) = 0; +STATIC_VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", "Global maximum number of TCP Segments in Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_qsize) = 0; +STATIC_VNET_DEFINE(int, tcp_reass_qsize) = 0; #define V_tcp_reass_qsize VNET(tcp_reass_qsize) SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_RD, &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_overflows) = 0; +STATIC_VNET_DEFINE(int, tcp_reass_overflows) = 0; #define V_tcp_reass_overflows VNET(tcp_reass_overflows) SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows, CTLFLAG_RD, &VNET_NAME(tcp_reass_overflows), 0, "Global number of TCP Segment Reassembly Queue Overflows"); -static VNET_DEFINE(uma_zone_t, tcp_reass_zone); +STATIC_VNET_DEFINE(uma_zone_t, tcp_reass_zone); #define V_tcp_reass_zone VNET(tcp_reass_zone) /* Initialize TCP reassembly queue */ diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 8596e234f807..e6e7ca41112e 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -193,13 +193,13 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, do_tcpdrain, CTLFLAG_RW, &do_tcpdrain, 0, SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, pcbcount, CTLFLAG_RD, &VNET_NAME(tcbinfo.ipi_count), 0, "Number of active PCBs"); -static VNET_DEFINE(int, icmp_may_rst) = 1; +STATIC_VNET_DEFINE(int, icmp_may_rst) = 1; #define V_icmp_may_rst VNET(icmp_may_rst) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, icmp_may_rst, CTLFLAG_RW, &VNET_NAME(icmp_may_rst), 0, "Certain ICMP unreachable messages may abort connections in SYN_SENT"); -static VNET_DEFINE(int, tcp_isn_reseed_interval) = 0; +STATIC_VNET_DEFINE(int, tcp_isn_reseed_interval) = 0; #define V_tcp_isn_reseed_interval VNET(tcp_isn_reseed_interval) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, isn_reseed_interval, CTLFLAG_RW, &VNET_NAME(tcp_isn_reseed_interval), 0, @@ -241,7 +241,7 @@ struct tcpcb_mem { struct cc_var ccv; }; -static VNET_DEFINE(uma_zone_t, tcpcb_zone); +STATIC_VNET_DEFINE(uma_zone_t, tcpcb_zone); #define V_tcpcb_zone VNET(tcpcb_zone) MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); @@ -1453,10 +1453,10 @@ tcp6_ctlinput(int cmd, struct sockaddr *sa, void *d) #define ISN_STATIC_INCREMENT 4096 #define ISN_RANDOM_INCREMENT (4096 - 1) -static VNET_DEFINE(u_char, isn_secret[32]); -static VNET_DEFINE(int, isn_last_reseed); -static VNET_DEFINE(u_int32_t, isn_offset); -static VNET_DEFINE(u_int32_t, isn_offset_old); +STATIC_VNET_DEFINE(u_char, isn_secret[32]); +STATIC_VNET_DEFINE(int, isn_last_reseed); +STATIC_VNET_DEFINE(u_int32_t, isn_offset); +STATIC_VNET_DEFINE(u_int32_t, isn_offset_old); #define V_isn_secret VNET(isn_secret) #define V_isn_last_reseed VNET(isn_last_reseed) diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index bf0fd18acba6..6d2cf2b25312 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -97,13 +97,13 @@ __FBSDID("$FreeBSD$"); #include -static VNET_DEFINE(int, tcp_syncookies) = 1; +STATIC_VNET_DEFINE(int, tcp_syncookies) = 1; #define V_tcp_syncookies VNET(tcp_syncookies) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, syncookies, CTLFLAG_RW, &VNET_NAME(tcp_syncookies), 0, "Use TCP SYN cookies if the syncache overflows"); -static VNET_DEFINE(int, tcp_syncookiesonly) = 0; +STATIC_VNET_DEFINE(int, tcp_syncookiesonly) = 0; #define V_tcp_syncookiesonly VNET(tcp_syncookiesonly) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, syncookies_only, CTLFLAG_RW, &VNET_NAME(tcp_syncookiesonly), 0, @@ -143,7 +143,7 @@ static struct syncache #define TCP_SYNCACHE_HASHSIZE 512 #define TCP_SYNCACHE_BUCKETLIMIT 30 -static VNET_DEFINE(struct tcp_syncache, tcp_syncache); +STATIC_VNET_DEFINE(struct tcp_syncache, tcp_syncache); #define V_tcp_syncache VNET(tcp_syncache) SYSCTL_NODE(_net_inet_tcp, OID_AUTO, syncache, CTLFLAG_RW, 0, "TCP SYN cache"); diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 42df4fe94634..8a712d324cba 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); #include -static VNET_DEFINE(uma_zone_t, tcptw_zone); +STATIC_VNET_DEFINE(uma_zone_t, tcptw_zone); #define V_tcptw_zone VNET(tcptw_zone) static int maxtcptw; @@ -102,7 +102,7 @@ static int maxtcptw; * queue pointers in each tcptw structure, are protected using the global * tcbinfo lock, which must be held over queue iteration and modification. */ -static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); +STATIC_VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); #define V_twq_2msl VNET(twq_2msl) static void tcp_tw_2msl_reset(struct tcptw *, int); diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index adb11c4ea804..511e0a36f025 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -131,7 +131,7 @@ SYSCTL_ULONG(_net_inet_udp, UDPCTL_RECVSPACE, recvspace, CTLFLAG_RW, VNET_DEFINE(struct inpcbhead, udb); /* from udp_var.h */ VNET_DEFINE(struct inpcbinfo, udbinfo); -static VNET_DEFINE(uma_zone_t, udpcb_zone); +STATIC_VNET_DEFINE(uma_zone_t, udpcb_zone); #define V_udpcb_zone VNET(udpcb_zone) #ifndef UDBHASHSIZE diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index 1523133d3db7..59b5d44af1e8 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -75,9 +75,9 @@ static struct mtx ip6qlock; /* * These fields all protected by ip6qlock. */ -static VNET_DEFINE(u_int, frag6_nfragpackets); -static VNET_DEFINE(u_int, frag6_nfrags); -static VNET_DEFINE(struct ip6q, ip6q); /* ip6 reassemble queue */ +STATIC_VNET_DEFINE(u_int, frag6_nfragpackets); +STATIC_VNET_DEFINE(u_int, frag6_nfrags); +STATIC_VNET_DEFINE(struct ip6q, ip6q); /* ip6 reassemble queue */ #define V_frag6_nfragpackets VNET(frag6_nfragpackets) #define V_frag6_nfrags VNET(frag6_nfrags) diff --git a/sys/netinet6/icmp6.c b/sys/netinet6/icmp6.c index 952b38acf856..85b88aa824a2 100644 --- a/sys/netinet6/icmp6.c +++ b/sys/netinet6/icmp6.c @@ -119,8 +119,8 @@ VNET_DEFINE(struct icmp6stat, icmp6stat); VNET_DECLARE(struct inpcbinfo, ripcbinfo); VNET_DECLARE(struct inpcbhead, ripcb); VNET_DECLARE(int, icmp6errppslim); -static VNET_DEFINE(int, icmp6errpps_count) = 0; -static VNET_DEFINE(struct timeval, icmp6errppslim_last); +STATIC_VNET_DEFINE(int, icmp6errpps_count) = 0; +STATIC_VNET_DEFINE(struct timeval, icmp6errppslim_last); VNET_DECLARE(int, icmp6_nodeinfo); #define V_ripcbinfo VNET(ripcbinfo) diff --git a/sys/netinet6/in6_rmx.c b/sys/netinet6/in6_rmx.c index 2a1364673b31..4ae0d475dc24 100644 --- a/sys/netinet6/in6_rmx.c +++ b/sys/netinet6/in6_rmx.c @@ -206,19 +206,19 @@ in6_matroute(void *v_arg, struct radix_node_head *head) SYSCTL_DECL(_net_inet6_ip6); -static VNET_DEFINE(int, rtq_reallyold6) = 60*60; +STATIC_VNET_DEFINE(int, rtq_reallyold6) = 60*60; /* one hour is ``really old'' */ #define V_rtq_reallyold6 VNET(rtq_reallyold6) SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTEXPIRE, rtexpire, CTLFLAG_RW, &VNET_NAME(rtq_reallyold6) , 0, ""); -static VNET_DEFINE(int, rtq_minreallyold6) = 10; +STATIC_VNET_DEFINE(int, rtq_minreallyold6) = 10; /* never automatically crank down to less */ #define V_rtq_minreallyold6 VNET(rtq_minreallyold6) SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, &VNET_NAME(rtq_minreallyold6) , 0, ""); -static VNET_DEFINE(int, rtq_toomany6) = 128; +STATIC_VNET_DEFINE(int, rtq_toomany6) = 128; /* 128 cached routes is ``too many'' */ #define V_rtq_toomany6 VNET(rtq_toomany6) SYSCTL_VNET_INT(_net_inet6_ip6, IPV6CTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, @@ -280,8 +280,8 @@ in6_rtqkill(struct radix_node *rn, void *rock) } #define RTQ_TIMEOUT 60*10 /* run no less than once every ten minutes */ -static VNET_DEFINE(int, rtq_timeout6) = RTQ_TIMEOUT; -static VNET_DEFINE(struct callout, rtq_timer6); +STATIC_VNET_DEFINE(int, rtq_timeout6) = RTQ_TIMEOUT; +STATIC_VNET_DEFINE(struct callout, rtq_timer6); #define V_rtq_timeout6 VNET(rtq_timeout6) #define V_rtq_timer6 VNET(rtq_timer6) @@ -349,7 +349,7 @@ struct mtuex_arg { struct radix_node_head *rnh; time_t nextstop; }; -static VNET_DEFINE(struct callout, rtq_mtutimer); +STATIC_VNET_DEFINE(struct callout, rtq_mtutimer); #define V_rtq_mtutimer VNET(rtq_mtutimer) static int diff --git a/sys/netinet6/in6_src.c b/sys/netinet6/in6_src.c index 49bc715452a9..8b1a3fdc3d4e 100644 --- a/sys/netinet6/in6_src.c +++ b/sys/netinet6/in6_src.c @@ -122,7 +122,7 @@ static struct sx addrsel_sxlock; #define ADDRSEL_XUNLOCK() sx_xunlock(&addrsel_sxlock) #define ADDR_LABEL_NOTAPP (-1) -static VNET_DEFINE(struct in6_addrpolicy, defaultaddrpolicy); +STATIC_VNET_DEFINE(struct in6_addrpolicy, defaultaddrpolicy); #define V_defaultaddrpolicy VNET(defaultaddrpolicy) VNET_DEFINE(int, ip6_prefer_tempaddr) = 0; @@ -1053,7 +1053,7 @@ struct addrsel_policyent { TAILQ_HEAD(addrsel_policyhead, addrsel_policyent); -static VNET_DEFINE(struct addrsel_policyhead, addrsel_policytab); +STATIC_VNET_DEFINE(struct addrsel_policyhead, addrsel_policytab); #define V_addrsel_policytab VNET(addrsel_policytab) static void diff --git a/sys/netinet6/ip6_ipsec.c b/sys/netinet6/ip6_ipsec.c index 96b09ef8b4c9..63e46fe34494 100644 --- a/sys/netinet6/ip6_ipsec.c +++ b/sys/netinet6/ip6_ipsec.c @@ -80,9 +80,9 @@ extern struct protosw inet6sw[]; #ifdef INET6 #ifdef IPSEC #ifdef IPSEC_FILTERTUNNEL -static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; +STATIC_VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 1; #else -static VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 0; +STATIC_VNET_DEFINE(int, ip6_ipsec6_filtertunnel) = 0; #endif #define V_ip6_ipsec6_filtertunnel VNET(ip6_ipsec6_filtertunnel) diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 0c1ff78bbdaf..23d3a281fc22 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -151,7 +151,7 @@ static const struct ip6protosw in6_pim_protosw = { }; static int pim6_encapcheck(const struct mbuf *, int, int, void *); -static VNET_DEFINE(int, ip6_mrouter_ver) = 0; +STATIC_VNET_DEFINE(int, ip6_mrouter_ver) = 0; #define V_ip6_mrouter_ver VNET(ip6_mrouter_ver) SYSCTL_DECL(_net_inet6); @@ -210,7 +210,7 @@ static struct mtx mif6_mtx; #define MIF6_LOCK_DESTROY() mtx_destroy(&mif6_mtx) #ifdef MRT6DEBUG -static VNET_DEFINE(u_int, mrt6debug) = 0; /* debug level */ +STATIC_VNET_DEFINE(u_int, mrt6debug) = 0; /* debug level */ #define V_mrt6debug VNET(mrt6debug) #define DEBUG_MFC 0x02 #define DEBUG_FORWARD 0x04 @@ -254,7 +254,7 @@ SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RD, &pim6stat, pim6stat, "PIM Statistics (struct pim6stat, netinet6/pim_var.h)"); -static VNET_DEFINE(int, pim6); +STATIC_VNET_DEFINE(int, pim6); #define V_pim6 VNET(pim6) /* diff --git a/sys/netinet6/mld6.c b/sys/netinet6/mld6.c index 21d9eabe363b..ce5d6118749f 100644 --- a/sys/netinet6/mld6.c +++ b/sys/netinet6/mld6.c @@ -203,11 +203,11 @@ MALLOC_DEFINE(M_MLD, "mld", "mld state"); /* * VIMAGE-wide globals. */ -static VNET_DEFINE(struct timeval, mld_gsrdelay) = {10, 0}; -static VNET_DEFINE(LIST_HEAD(, mld_ifinfo), mli_head); -static VNET_DEFINE(int, interface_timers_running6); -static VNET_DEFINE(int, state_change_timers_running6); -static VNET_DEFINE(int, current_state_timers_running6); +STATIC_VNET_DEFINE(struct timeval, mld_gsrdelay) = {10, 0}; +STATIC_VNET_DEFINE(LIST_HEAD(, mld_ifinfo), mli_head); +STATIC_VNET_DEFINE(int, interface_timers_running6); +STATIC_VNET_DEFINE(int, state_change_timers_running6); +STATIC_VNET_DEFINE(int, current_state_timers_running6); #define V_mld_gsrdelay VNET(mld_gsrdelay) #define V_mli_head VNET(mli_head) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index c9d9be058696..10fae8247868 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -94,11 +94,11 @@ VNET_DEFINE(int, nd6_gctimer) = (60 * 60 * 24); /* 1 day: garbage * collection timer */ /* preventing too many loops in ND option parsing */ -static VNET_DEFINE(int, nd6_maxndopt) = 10; /* max # of ND options allowed */ +STATIC_VNET_DEFINE(int, nd6_maxndopt) = 10; /* max # of ND options allowed */ VNET_DEFINE(int, nd6_maxnudhint) = 0; /* max # of subsequent upper * layer hints */ -static VNET_DEFINE(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved +STATIC_VNET_DEFINE(int, nd6_maxqueuelen) = 1; /* max pkts cached in unresolved * ND entries */ #define V_nd6_maxndopt VNET(nd6_maxndopt) #define V_nd6_maxqueuelen VNET(nd6_maxqueuelen) @@ -133,7 +133,7 @@ static struct llentry *nd6_free(struct llentry *, int); static void nd6_llinfo_timer(void *); static void clear_llinfo_pqueue(struct llentry *); -static VNET_DEFINE(struct callout, nd6_slowtimo_ch); +STATIC_VNET_DEFINE(struct callout, nd6_slowtimo_ch); #define V_nd6_slowtimo_ch VNET(nd6_slowtimo_ch) VNET_DEFINE(struct callout, nd6_timer_ch); diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c index 957e9652843f..8465682aa4fd 100644 --- a/sys/netinet6/nd6_nbr.c +++ b/sys/netinet6/nd6_nbr.c @@ -1141,7 +1141,7 @@ struct dadq { struct vnet *dad_vnet; }; -static VNET_DEFINE(TAILQ_HEAD(, dadq), dadq); +STATIC_VNET_DEFINE(TAILQ_HEAD(, dadq), dadq); VNET_DEFINE(int, dad_init) = 0; #define V_dadq VNET(dadq) #define V_dad_init VNET(dad_init) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 19ec989fb22d..f19ef927291f 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -89,7 +89,7 @@ static int rt6_deleteroute(struct radix_node *, void *); VNET_DECLARE(int, nd6_recalc_reachtm_interval); #define V_nd6_recalc_reachtm_interval VNET(nd6_recalc_reachtm_interval) -static VNET_DEFINE(struct ifnet *, nd6_defifp); +STATIC_VNET_DEFINE(struct ifnet *, nd6_defifp); VNET_DEFINE(int, nd6_defifindex); #define V_nd6_defifp VNET(nd6_defifp) diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c index 8189d87c5bcd..0f0cf29174b9 100644 --- a/sys/netinet6/scope6.c +++ b/sys/netinet6/scope6.c @@ -66,7 +66,7 @@ static struct mtx scope6_lock; #define SCOPE6_UNLOCK() mtx_unlock(&scope6_lock) #define SCOPE6_LOCK_ASSERT() mtx_assert(&scope6_lock, MA_OWNED) -static VNET_DEFINE(struct scope6_id, sid_default); +STATIC_VNET_DEFINE(struct scope6_id, sid_default); #define V_sid_default VNET(sid_default) #define SID(ifp) \ diff --git a/sys/netinet6/send.c b/sys/netinet6/send.c index 71d88d07a8a8..baf7f4c54c26 100644 --- a/sys/netinet6/send.c +++ b/sys/netinet6/send.c @@ -60,7 +60,7 @@ MALLOC_DEFINE(M_SEND, "send", "Secure Neighbour Discovery"); /* * The socket used to communicate with the SeND daemon. */ -static VNET_DEFINE(struct socket *, send_so); +STATIC_VNET_DEFINE(struct socket *, send_so); #define V_send_so VNET(send_so) u_long send_sendspace = 8 * (1024 + sizeof(struct sockaddr_send)); diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index e57eb4432bbc..869ad7444ad2 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -113,20 +113,20 @@ */ VNET_DEFINE(u_int32_t, key_debug_level) = 0; -static VNET_DEFINE(u_int, key_spi_trycnt) = 1000; -static VNET_DEFINE(u_int32_t, key_spi_minval) = 0x100; -static VNET_DEFINE(u_int32_t, key_spi_maxval) = 0x0fffffff; /* XXX */ -static VNET_DEFINE(u_int32_t, policy_id) = 0; +STATIC_VNET_DEFINE(u_int, key_spi_trycnt) = 1000; +STATIC_VNET_DEFINE(u_int32_t, key_spi_minval) = 0x100; +STATIC_VNET_DEFINE(u_int32_t, key_spi_maxval) = 0x0fffffff; /* XXX */ +STATIC_VNET_DEFINE(u_int32_t, policy_id) = 0; /*interval to initialize randseed,1(m)*/ -static VNET_DEFINE(u_int, key_int_random) = 60; +STATIC_VNET_DEFINE(u_int, key_int_random) = 60; /* interval to expire acquiring, 30(s)*/ -static VNET_DEFINE(u_int, key_larval_lifetime) = 30; +STATIC_VNET_DEFINE(u_int, key_larval_lifetime) = 30; /* counter for blocking SADB_ACQUIRE.*/ -static VNET_DEFINE(int, key_blockacq_count) = 10; +STATIC_VNET_DEFINE(int, key_blockacq_count) = 10; /* lifetime for blocking SADB_ACQUIRE.*/ -static VNET_DEFINE(int, key_blockacq_lifetime) = 20; +STATIC_VNET_DEFINE(int, key_blockacq_lifetime) = 20; /* preferred old sa rather than new sa.*/ -static VNET_DEFINE(int, key_preferred_oldsa) = 1; +STATIC_VNET_DEFINE(int, key_preferred_oldsa) = 1; #define V_key_spi_trycnt VNET(key_spi_trycnt) #define V_key_spi_minval VNET(key_spi_minval) #define V_key_spi_maxval VNET(key_spi_maxval) @@ -137,11 +137,11 @@ static VNET_DEFINE(int, key_preferred_oldsa) = 1; #define V_key_blockacq_lifetime VNET(key_blockacq_lifetime) #define V_key_preferred_oldsa VNET(key_preferred_oldsa) -static VNET_DEFINE(u_int32_t, acq_seq) = 0; +STATIC_VNET_DEFINE(u_int32_t, acq_seq) = 0; #define V_acq_seq VNET(acq_seq) /* SPD */ -static VNET_DEFINE(LIST_HEAD(_sptree, secpolicy), sptree[IPSEC_DIR_MAX]); +STATIC_VNET_DEFINE(LIST_HEAD(_sptree, secpolicy), sptree[IPSEC_DIR_MAX]); #define V_sptree VNET(sptree) static struct mtx sptree_lock; #define SPTREE_LOCK_INIT() \ @@ -152,7 +152,7 @@ static struct mtx sptree_lock; #define SPTREE_UNLOCK() mtx_unlock(&sptree_lock) #define SPTREE_LOCK_ASSERT() mtx_assert(&sptree_lock, MA_OWNED) -static VNET_DEFINE(LIST_HEAD(_sahtree, secashead), sahtree); /* SAD */ +STATIC_VNET_DEFINE(LIST_HEAD(_sahtree, secashead), sahtree); /* SAD */ #define V_sahtree VNET(sahtree) static struct mtx sahtree_lock; #define SAHTREE_LOCK_INIT() \ @@ -164,7 +164,7 @@ static struct mtx sahtree_lock; #define SAHTREE_LOCK_ASSERT() mtx_assert(&sahtree_lock, MA_OWNED) /* registed list */ -static VNET_DEFINE(LIST_HEAD(_regtree, secreg), regtree[SADB_SATYPE_MAX + 1]); +STATIC_VNET_DEFINE(LIST_HEAD(_regtree, secreg), regtree[SADB_SATYPE_MAX + 1]); #define V_regtree VNET(regtree) static struct mtx regtree_lock; #define REGTREE_LOCK_INIT() \ @@ -174,7 +174,7 @@ static struct mtx regtree_lock; #define REGTREE_UNLOCK() mtx_unlock(®tree_lock) #define REGTREE_LOCK_ASSERT() mtx_assert(®tree_lock, MA_OWNED) -static VNET_DEFINE(LIST_HEAD(_acqtree, secacq), acqtree); /* acquiring list */ +STATIC_VNET_DEFINE(LIST_HEAD(_acqtree, secacq), acqtree); /* acquiring list */ #define V_acqtree VNET(acqtree) static struct mtx acq_lock; #define ACQ_LOCK_INIT() \ @@ -185,7 +185,7 @@ static struct mtx acq_lock; #define ACQ_LOCK_ASSERT() mtx_assert(&acq_lock, MA_OWNED) /* SP acquiring list */ -static VNET_DEFINE(LIST_HEAD(_spacqtree, secspacq), spacqtree); +STATIC_VNET_DEFINE(LIST_HEAD(_spacqtree, secspacq), spacqtree); #define V_spacqtree VNET(spacqtree) static struct mtx spacq_lock; #define SPACQ_LOCK_INIT() \ @@ -269,9 +269,9 @@ static const int maxsize[] = { sizeof(struct sadb_x_nat_t_frag),/* SADB_X_EXT_NAT_T_FRAG */ }; -static VNET_DEFINE(int, ipsec_esp_keymin) = 256; -static VNET_DEFINE(int, ipsec_esp_auth) = 0; -static VNET_DEFINE(int, ipsec_ah_keymin) = 128; +STATIC_VNET_DEFINE(int, ipsec_esp_keymin) = 256; +STATIC_VNET_DEFINE(int, ipsec_esp_auth) = 0; +STATIC_VNET_DEFINE(int, ipsec_ah_keymin) = 128; #define V_ipsec_esp_keymin VNET(ipsec_esp_keymin) #define V_ipsec_esp_auth VNET(ipsec_esp_auth) diff --git a/sys/netipsec/keysock.c b/sys/netipsec/keysock.c index 143b600bb4f7..2fb1c1fe150f 100644 --- a/sys/netipsec/keysock.c +++ b/sys/netipsec/keysock.c @@ -70,7 +70,7 @@ struct key_cb { int key_count; int any_count; }; -static VNET_DEFINE(struct key_cb, key_cb); +STATIC_VNET_DEFINE(struct key_cb, key_cb); #define V_key_cb VNET(key_cb) static struct sockaddr key_src = { 2, PF_KEY, }; diff --git a/sys/netipsec/xform_esp.c b/sys/netipsec/xform_esp.c index 6186b5961a5d..2ccdb1005d28 100644 --- a/sys/netipsec/xform_esp.c +++ b/sys/netipsec/xform_esp.c @@ -85,7 +85,7 @@ SYSCTL_VNET_INT(_net_inet_esp, OID_AUTO, SYSCTL_VNET_STRUCT(_net_inet_esp, IPSECCTL_STATS, stats, CTLFLAG_RD, &VNET_NAME(espstat), espstat, ""); -static VNET_DEFINE(int, esp_max_ivlen); /* max iv length over all algorithms */ +STATIC_VNET_DEFINE(int, esp_max_ivlen); /* max iv length over all algorithms */ #define V_esp_max_ivlen VNET(esp_max_ivlen) static int esp_input_cb(struct cryptop *op); diff --git a/sys/opencrypto/cryptosoft.c b/sys/opencrypto/cryptosoft.c index e05b015c2187..d73f462db696 100644 --- a/sys/opencrypto/cryptosoft.c +++ b/sys/opencrypto/cryptosoft.c @@ -1060,7 +1060,7 @@ swcr_identify(driver_t *drv, device_t parent) { /* NB: order 10 is so we get attached after h/w devices */ if (device_find_child(parent, "cryptosoft", -1) == NULL && - BUS_ADD_CHILD(parent, 10, "cryptosoft", -1) == 0) + BUS_ADD_CHILD(parent, 10, "cryptosoft", 0) == 0) panic("cryptosoft: could not attach"); } @@ -1068,7 +1068,7 @@ static int swcr_probe(device_t dev) { device_set_desc(dev, "software crypto"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int diff --git a/sys/powerpc/aim/clock.c b/sys/powerpc/aim/clock.c index 0bf7cfa11698..fea9ea88480c 100644 --- a/sys/powerpc/aim/clock.c +++ b/sys/powerpc/aim/clock.c @@ -93,7 +93,7 @@ struct decr_state { int mode; /* 0 - off, 1 - periodic, 2 - one-shot. */ int32_t div; /* Periodic divisor. */ }; -static DPCPU_DEFINE(struct decr_state, decr_state); +STATIC_DPCPU_DEFINE(struct decr_state, decr_state); static struct eventtimer decr_et; static struct timecounter decr_tc = { diff --git a/sys/powerpc/booke/clock.c b/sys/powerpc/booke/clock.c index 9958160a1af4..3df22f15dc9f 100644 --- a/sys/powerpc/booke/clock.c +++ b/sys/powerpc/booke/clock.c @@ -96,7 +96,7 @@ struct decr_state { int mode; /* 0 - off, 1 - periodic, 2 - one-shot. */ int32_t div; /* Periodic divisor. */ }; -static DPCPU_DEFINE(struct decr_state, decr_state); +STATIC_DPCPU_DEFINE(struct decr_state, decr_state); static struct eventtimer decr_et; static struct timecounter decr_timecounter = { diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 958c74d5ff6a..b5803a05dab2 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -401,8 +401,7 @@ #endif /* __STDC__ */ #endif /* __GNUC__ || __INTEL_COMPILER */ -#define __GLOBL1(sym) __asm__(".globl " #sym) -#define __GLOBL(sym) __GLOBL1(sym) +#define __GLOBL(sym) __asm__(".globl " sym) #if defined(__GNUC__) || defined(__INTEL_COMPILER) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index ebba37431e95..a6e2acda67e3 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -187,4 +187,9 @@ strrchr(const char *p, int ch) #define FNM_IGNORECASE FNM_CASEFOLD #define FNM_FILE_NAME FNM_PATHNAME +/* Visibility of characters in gets() */ +#define GETS_NOECHO 0 /* Disable echoing of characters. */ +#define GETS_ECHO 1 /* Enable echoing of characters. */ +#define GETS_ECHOPASS 2 /* Print a * for every character. */ + #endif /* !_SYS_LIBKERN_H_ */ diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index 2edb55b24f8f..11c6b1dc63af 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -45,8 +45,8 @@ */ #ifdef __GNUCLIKE___SECTION #define __MAKE_SET(set, sym) \ - __GLOBL(__CONCAT(__start_set_,set)); \ - __GLOBL(__CONCAT(__stop_set_,set)); \ + __GLOBL("__start_set_" #set); \ + __GLOBL("__stop_set_" #set); \ static void const * const __set_##set##_sym_##sym \ __section("set_" #set) __used = &sym #else /* !__GNUCLIKE___SECTION */ diff --git a/sys/sys/param.h b/sys/sys/param.h index acd1f519e383..3e4cdf640659 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,6 +60,11 @@ #undef __FreeBSD_version #define __FreeBSD_version 900025 /* Master, propagated to newvers */ +#ifdef _KERNEL +#define __FreeBSD_version_SIGSEGV 700004 +#define __FreeBSD_version_MAP_ANON 800104 +#endif + #ifndef LOCORE #include #endif diff --git a/sys/sys/pcpu.h b/sys/sys/pcpu.h index b029e1213d45..81fd7833a5b3 100644 --- a/sys/sys/pcpu.h +++ b/sys/sys/pcpu.h @@ -42,15 +42,16 @@ #include #include +#define DPCPU_SETNAME "set_pcpu" +#define DPCPU_SYMPREFIX "pcpu_entry_" + #ifdef _KERNEL /* * Define a set for pcpu data. */ extern uintptr_t *__start_set_pcpu; -__GLOBL(__start_set_pcpu); extern uintptr_t *__stop_set_pcpu; -__GLOBL(__stop_set_pcpu); /* * Array of dynamic pcpu base offsets. Indexed by id. @@ -72,7 +73,12 @@ extern uintptr_t dpcpu_off[]; */ #define DPCPU_NAME(n) pcpu_entry_##n #define DPCPU_DECLARE(t, n) extern t DPCPU_NAME(n) -#define DPCPU_DEFINE(t, n) t DPCPU_NAME(n) __section("set_pcpu") __used +#define DPCPU_DEFINE(t, n) \ + __GLOBL("__start_" DPCPU_SETNAME); \ + __GLOBL("__stop_" DPCPU_SETNAME); \ + t DPCPU_NAME(n) __section(DPCPU_SETNAME) __used +#define STATIC_DPCPU_DEFINE(t, n) \ + DPCPU_DEFINE(static t, n) /* * Accessors with a given base. diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index b35ae100b5ce..ad713234b6da 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -76,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -3216,6 +3218,12 @@ vm_map_stack(vm_map_t map, vm_offset_t addrbos, vm_size_t max_ssize, return (rv); } +static int stack_guard_page = 0; +TUNABLE_INT("security.bsd.stack_guard_page", &stack_guard_page); +SYSCTL_INT(_security_bsd, OID_AUTO, stack_guard_page, CTLFLAG_RW, + &stack_guard_page, 0, + "Insert stack guard page ahead of the growable segments."); + /* Attempts to grow a vm stack entry. Returns KERN_SUCCESS if the * desired address is already mapped, or if we successfully grow * the stack. Also returns KERN_SUCCESS if addr is outside the @@ -3312,7 +3320,7 @@ vm_map_growstack(struct proc *p, vm_offset_t addr) * This also effectively destroys any guard page the user might have * intended by limiting the stack size. */ - if (grow_amount > max_grow) { + if (grow_amount + (stack_guard_page ? PAGE_SIZE : 0) > max_grow) { if (vm_map_lock_upgrade(map)) goto Retry; @@ -3365,6 +3373,8 @@ vm_map_growstack(struct proc *p, vm_offset_t addr) if (addr < end) { stack_entry->avail_ssize = max_grow; addr = end; + if (stack_guard_page) + addr += PAGE_SIZE; } rv = vm_map_insert(map, NULL, 0, addr, stack_entry->start, @@ -3397,6 +3407,8 @@ vm_map_growstack(struct proc *p, vm_offset_t addr) if (addr > end) { stack_entry->avail_ssize = end - stack_entry->end; addr = end; + if (stack_guard_page) + addr -= PAGE_SIZE; } grow_amount = addr - stack_entry->end; diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 80a2d0acf7a7..5c6f17324206 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -232,7 +232,7 @@ mmap(td, uap) /* Make sure mapping fits into numeric range, etc. */ if ((uap->len == 0 && !SV_CURPROC_FLAG(SV_AOUT) && - curproc->p_osrel >= 800104) || + curproc->p_osrel >= __FreeBSD_version_MAP_ANON) || ((flags & MAP_ANON) && (uap->fd != -1 || pos != 0))) return (EINVAL); diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 4ce996824a5a..b80e18120338 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -101,7 +101,7 @@ OLD_LIBS+=usr/lib/libngatm.so.4 OLD_FILES+=usr/lib/libngatm_p.a OLD_FILES+=usr/lib/snmp_atm.so OLD_LIBS+=usr/lib/snmp_atm.so.6 -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libngatm.a OLD_FILES+=usr/lib32/libngatm.so OLD_LIBS+=usr/lib32/libngatm.so.4 @@ -162,7 +162,7 @@ OLD_FILES+=usr/include/lwres/platform.h OLD_DIRS+=usr/include/lwres OLD_FILES+=usr/lib/liblwres.a OLD_FILES+=usr/lib/liblwres_p.a -OLD_LIBS+=usr/lib/liblwres.so.10 +OLD_LIBS+=usr/lib/liblwres.so.50 OLD_FILES+=usr/lib/liblwres.so OLD_FILES+=usr/sbin/named OLD_FILES+=usr/sbin/lwresd @@ -288,7 +288,7 @@ OLD_FILES+=usr/share/man/man3/lwres_getnamebyaddr.3.gz OLD_FILES+=usr/share/man/man3/lwres_string_parse.3.gz OLD_FILES+=usr/share/man/man5/named.conf.5.gz OLD_FILES+=usr/share/man/man5/rndc.conf.5.gz -OLD_FILES+=usr/share/man/man8/nsupdate.8.gz +OLD_FILES+=usr/share/man/man1/nsupdate.1.gz OLD_FILES+=usr/share/man/man8/dnssec-keygen.8.gz OLD_FILES+=usr/share/man/man8/dnssec-signzone.8.gz OLD_FILES+=usr/share/man/man8/named.8.gz @@ -368,7 +368,7 @@ OLD_FILES+=usr/lib/libsdp.a OLD_FILES+=usr/lib/libsdp.so OLD_LIBS+=usr/lib/libsdp.so.4 OLD_FILES+=usr/lib/libsdp_p.a -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libbluetooth.a OLD_FILES+=usr/lib32/libbluetooth.so OLD_LIBS+=usr/lib32/libbluetooth.so.4 @@ -561,7 +561,7 @@ OLD_FILES+=usr/lib/libumem_p.a OLD_FILES+=usr/lib/libuutil.a OLD_FILES+=usr/lib/libuutil.so OLD_FILES+=usr/lib/libuutil_p.a -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/dtrace/drti.o OLD_FILES+=usr/lib32/libavl.a OLD_FILES+=usr/lib32/libavl.so @@ -612,7 +612,7 @@ OLD_FILES+=usr/lib/libzfs.so OLD_FILES+=usr/lib/libzfs_p.a OLD_FILES+=usr/lib/libzpool.a OLD_FILES+=usr/lib/libzpool.so -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libzfs.a OLD_FILES+=usr/lib32/libzfs.so OLD_LIBS+=usr/lib32/libzfs.so.2 @@ -800,7 +800,7 @@ OLD_FILES+=usr/lib/libgpib.a OLD_FILES+=usr/lib/libgpib.so OLD_LIBS+=usr/lib/libgpib.so.3 OLD_FILES+=usr/lib/libgpib_p.a -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libgpib.a OLD_FILES+=usr/lib32/libgpib.so OLD_LIBS+=usr/lib32/libgpib.so.3 @@ -816,7 +816,7 @@ OLD_FILES+=usr/lib/libgssapi_p.a OLD_FILES+=usr/lib/librpcsec_gss.a OLD_FILES+=usr/lib/librpcsec_gss.so OLD_LIBS+=usr/lib/librpcsec_gss.so.1 -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libgssapi.a OLD_FILES+=usr/lib32/libgssapi.so OLD_LIBS+=usr/lib32/libgssapi.so.10 @@ -1039,7 +1039,7 @@ OLD_LIBS+=lib/libipx.so.5 OLD_FILES+=usr/lib/libipx.a OLD_FILES+=usr/lib/libipx.so OLD_FILES+=usr/lib/libipx_p.a -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libipx.a OLD_FILES+=usr/lib32/libipx.so OLD_LIBS+=usr/lib32/libipx.so.5 @@ -1164,7 +1164,7 @@ OLD_FILES+=usr/lib/pam_krb5.so OLD_LIBS+=usr/lib/pam_krb5.so.5 OLD_FILES+=usr/lib/pam_ksu.so OLD_LIBS+=usr/lib/pam_ksu.so.5 -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libasn1.a OLD_FILES+=usr/lib32/libasn1.so OLD_LIBS+=usr/lib32/libasn1.so.10 @@ -1626,7 +1626,7 @@ OLD_FILES+=usr/lib/libncp.a OLD_FILES+=usr/lib/libncp.so OLD_LIBS+=usr/lib/libncp.so.4 OLD_FILES+=usr/lib/libncp_p.a -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libncp.a OLD_FILES+=usr/lib32/libncp.so OLD_LIBS+=usr/lib32/libncp.so.4 @@ -1839,7 +1839,6 @@ OLD_FILES+=usr/lib/libalias_skinny_p.a OLD_FILES+=usr/lib/libalias_smedia_p.a OLD_FILES+=usr/lib/libarchive_p.a OLD_FILES+=usr/lib/libasn1_p.a -OLD_FILES+=usr/lib/libatm_p.a OLD_FILES+=usr/lib/libbegemot_p.a OLD_FILES+=usr/lib/libbluetooth_p.a OLD_FILES+=usr/lib/libbsdxml_p.a @@ -1880,7 +1879,6 @@ OLD_FILES+=usr/lib/libjail_p.a OLD_FILES+=usr/lib/libkadm5clnt_p.a OLD_FILES+=usr/lib/libkadm5srv_p.a OLD_FILES+=usr/lib/libkafs5_p.a -OLD_FILES+=usr/lib/libkeycap_p.a OLD_FILES+=usr/lib/libkiconv_p.a OLD_FILES+=usr/lib/libkrb5_p.a OLD_FILES+=usr/lib/libkvm_p.a @@ -1895,7 +1893,6 @@ OLD_FILES+=usr/lib/libmenu_p.a OLD_FILES+=usr/lib/libmenuw_p.a OLD_FILES+=usr/lib/libmilter_p.a OLD_FILES+=usr/lib/libmp_p.a -OLD_FILES+=usr/lib/libmytinfo_p.a OLD_FILES+=usr/lib/libncp_p.a OLD_FILES+=usr/lib/libncurses_p.a OLD_FILES+=usr/lib/libncursesw_p.a @@ -2013,7 +2010,7 @@ OLD_FILES+=usr/include/libmilter/mfdef.h OLD_FILES+=usr/lib/libmilter.a OLD_LIBS+=usr/lib/libmilter.so.5 OLD_FILES+=usr/lib/libmilter_p.a -.if ${TARGET_ARCH} == "amd64" +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_FILES+=usr/lib32/libmilter.a OLD_LIBS+=usr/lib32/libmilter.so.5 OLD_FILES+=usr/lib32/libmilter_p.a diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c index 6bc72d863ef9..42ba1a01a260 100644 --- a/usr.sbin/sysinstall/cdrom.c +++ b/usr.sbin/sysinstall/cdrom.c @@ -145,7 +145,7 @@ mediaInitCDROM(Device *dev) else { if (variable_cmp(VAR_RELNAME, cp) && variable_cmp(VAR_RELNAME, "any") && - variable_cmp(cp, "any") && + strcmp(cp, "any") && !bogusCDOK) { msgConfirm("Warning: The version of the FreeBSD disc currently in the drive\n" "(%s) does not match the version of the boot floppy\n" diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 6e176d7b44c4..de838fe1ab22 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -495,14 +495,14 @@ configNTP(dialogMenuItem *self) { int status; - status = variable_get_value(VAR_NTPDATE_FLAGS, + status = variable_get_value(VAR_NTPDATE_HOSTS, "Enter the name of an NTP server", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (status == DITEM_SUCCESS) { static char tmp[255]; - snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s", - variable_get(VAR_NTPDATE_FLAGS)); + snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_hosts=%s", + variable_get(VAR_NTPDATE_HOSTS)); self->data = tmp; dmenuSetVariables(self); } diff --git a/usr.sbin/sysinstall/help/shortcuts.hlp b/usr.sbin/sysinstall/help/shortcuts.hlp index 553e96fc211b..9ec03d0e1ef5 100644 --- a/usr.sbin/sysinstall/help/shortcuts.hlp +++ b/usr.sbin/sysinstall/help/shortcuts.hlp @@ -13,7 +13,7 @@ blanktime Screen blank time setting in seconds bootManager Select boot manager: booteasy, standard or none browserBinary Which doc browser to use (default: links) browserPackage Which package to get browser from (default: links) -cpioVerbose How verbose to be with cpio: high, medium or low +cpioVerbose How verbose to be with cpio: high or low debug Extra debugging? defaultrouter IP address of default route disk Which disk to operate on (ad0, da0, etc). diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 273f221297e3..db347e2a6053 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -756,7 +756,7 @@ installStandard(dialogMenuItem *self) dialog_clear_norefresh(); if (!msgYesNo("The FreeBSD package collection is a collection of thousands of ready-to-run\n" - "applications, from text editors to games to WEB servers and more. Would you\n" + "applications, from text editors to games to Web servers and more. Would you\n" "like to browse the collection now?")) { (void)configPackages(self); } diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index fe89d705cefb..e2f6c41f64a0 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -117,8 +117,6 @@ cpioVerbosity() if (cp && !strcmp(cp, "high")) return "-v"; - else if (cp && !strcmp(cp, "medium")) - return "-V"; return ""; } @@ -848,8 +846,6 @@ mediaSetCPIOVerbosity(dialogMenuItem *self) } else { if (!strcmp(cp, "low")) - variable_set2(VAR_CPIO_VERBOSITY, "medium", 0); - else if (!strcmp(cp, "medium")) variable_set2(VAR_CPIO_VERBOSITY, "high", 0); else /* must be "high" - wrap around */ variable_set2(VAR_CPIO_VERBOSITY, "low", 0); diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index e2c8f5ef1dd5..43c57ac4e856 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -819,7 +819,7 @@ DMenu MenuMediaFTP = { { "Turkey", "ftp.tr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tr.freebsd.org" }, { " Turkey #2", "ftp2.tr.freebsd.org", NULL, dmenuSetVariable, NULL, - VAR_FTP_PATH "=ftp://ftp.tr.freebsd.org" }, + VAR_FTP_PATH "=ftp://ftp2.tr.freebsd.org" }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org" }, @@ -1317,7 +1317,7 @@ DMenu MenuNetworking = { dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS server", "This machine will be an NFS server", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, - { " Ntpdate", "Select a clock-synchronization server", + { " Ntpdate", "Select a clock synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', (uintptr_t)"ntpdate_enable=YES" }, { " PCNFSD", "Run authentication server for clients with PC-NFS.", @@ -1376,456 +1376,456 @@ DMenu MenuNTP = { NULL, { { "None", "No NTP server", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=NO,ntpdate_flags=none" }, + "ntpdate_enable=NO,ntpdate_hosts=none" }, { "Other", "Select a site not on this list", dmenuVarsCheck, configNTP, NULL, NULL }, { "Worldwide", "pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=pool.ntp.org" }, { "Asia", "asia.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=asia.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=asia.pool.ntp.org" }, { "Europe", "europe.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=europe.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=europe.pool.ntp.org" }, { "Oceania", "oceania.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=oceania.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=oceania.pool.ntp.org" }, { "North America", "north-america.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=north-america.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=north-america.pool.ntp.org" }, { "Argentina", "tick.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tick.nap.com.ar" }, + "ntpdate_enable=YES,ntpdate_hosts=tick.nap.com.ar" }, { "Argentina #2", "time.sinectis.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.sinectis.com.ar" }, + "ntpdate_enable=YES,ntpdate_hosts=time.sinectis.com.ar" }, { "Argentina #3", "tock.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tock.nap.com.ar" }, + "ntpdate_enable=YES,ntpdate_hosts=tock.nap.com.ar" }, { "Australia", "au.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=au.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=au.pool.ntp.org" }, { "Australia #2", "augean.eleceng.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=augean.eleceng.adelaide.edu.au" }, + "ntpdate_enable=YES,ntpdate_hosts=augean.eleceng.adelaide.edu.au" }, { "Australia #3", "ntp.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.adelaide.edu.au" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.adelaide.edu.au" }, { "Australia #4", "ntp.saard.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.saard.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.saard.net" }, { "Australia #5", "time.deakin.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.deakin.edu.au" }, + "ntpdate_enable=YES,ntpdate_hosts=time.deakin.edu.au" }, { "Belgium", "ntp1.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.belbone.be" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.belbone.be" }, { "Belgium #2", "ntp2.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.belbone.be" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.belbone.be" }, { "Brazil", "a.ntp.br", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=a.ntp.br" }, + "ntpdate_enable=YES,ntpdate_hosts=a.ntp.br" }, { "Brazil #2", "b.ntp.br", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=b.ntp.br" }, + "ntpdate_enable=YES,ntpdate_hosts=b.ntp.br" }, { "Brazil #3", "c.ntp.br", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=c.ntp.br" }, + "ntpdate_enable=YES,ntpdate_hosts=c.ntp.br" }, { "Brazil #4", "ntp.cais.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.cais.rnp.br" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.cais.rnp.br" }, { "Brazil #5", "ntp1.pucpr.br", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.pucpr.br" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.pucpr.br" }, { "Canada", "ca.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ca.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=ca.pool.ntp.org" }, { "Canada #2", "ntp.cpsc.ucalgary.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.cpsc.ucalgary.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.cpsc.ucalgary.ca" }, { "Canada #3", "ntp1.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.cmc.ec.gc.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.cmc.ec.gc.ca" }, { "Canada #4", "ntp2.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.cmc.ec.gc.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.cmc.ec.gc.ca" }, { "Canada #5", "tick.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tick.utoronto.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=tick.utoronto.ca" }, { "Canada #6", "time.chu.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.chu.nrc.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=time.chu.nrc.ca" }, { "Canada #7", "time.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.nrc.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=time.nrc.ca" }, { "Canada #8", "timelord.uregina.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=timelord.uregina.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=timelord.uregina.ca" }, { "Canada #9", "tock.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tock.utoronto.ca" }, + "ntpdate_enable=YES,ntpdate_hosts=tock.utoronto.ca" }, { "Czech", "ntp.karpo.cz", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.karpo.cz" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.karpo.cz" }, { "Czech #2", "ntp.cgi.cz", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.cgi.cz" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.cgi.cz" }, { "Denmark", "clock.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock.netcetera.dk" }, + "ntpdate_enable=YES,ntpdate_hosts=clock.netcetera.dk" }, { "Denmark", "clock2.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock2.netcetera.dk" }, + "ntpdate_enable=YES,ntpdate_hosts=clock2.netcetera.dk" }, { "Spain", "slug.ctv.es", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=slug.ctv.es" }, + "ntpdate_enable=YES,ntpdate_hosts=slug.ctv.es" }, { "Finland", "tick.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tick.keso.fi" }, + "ntpdate_enable=YES,ntpdate_hosts=tick.keso.fi" }, { "Finland #2", "tock.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tock.keso.fi" }, + "ntpdate_enable=YES,ntpdate_hosts=tock.keso.fi" }, { "France", "ntp.obspm.fr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.obspm.fr" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.obspm.fr" }, { "France #2", "ntp.univ-lyon1.fr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.univ-lyon1.fr" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.univ-lyon1.fr" }, { "France #3", "ntp.via.ecp.fr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.via.ecp.fr" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.via.ecp.fr" }, { "Croatia", "zg1.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=zg1.ntp.carnet.hr" }, + "ntpdate_enable=YES,ntpdate_hosts=zg1.ntp.carnet.hr" }, { "Croatia #2", "zg2.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=zg2.ntp.carnet.hr" }, + "ntpdate_enable=YES,ntpdate_hosts=zg2.ntp.carnet.hr" }, { "Croatia #3", "st.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=st.ntp.carnet.hr" }, + "ntpdate_enable=YES,ntpdate_hosts=st.ntp.carnet.hr" }, { "Croatia #4", "ri.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ri.ntp.carnet.hr" }, + "ntpdate_enable=YES,ntpdate_hosts=ri.ntp.carnet.hr" }, { "Croatia #5", "os.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=os.ntp.carnet.hr" }, + "ntpdate_enable=YES,ntpdate_hosts=os.ntp.carnet.hr" }, { "Hungary", "time.kfki.hu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.kfki.hu" }, + "ntpdate_enable=YES,ntpdate_hosts=time.kfki.hu" }, { "Indonesia", "ntp.kim.lipi.go.id", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.kim.lipi.go.id" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.kim.lipi.go.id" }, { "Ireland", "ntp.maths.tcd.ie", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.maths.tcd.ie" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.maths.tcd.ie" }, { "Italy", "it.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=it.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=it.pool.ntp.org" }, { "Japan", "ntp.jst.mfeed.ad.jp", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.jst.mfeed.ad.jp" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.jst.mfeed.ad.jp" }, { "Japan IPv6", "ntp1.v6.mfeed.ad.jp", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.v6.mfeed.ad.jp" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.v6.mfeed.ad.jp" }, { "Korea", "time.nuri.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.nuri.net" }, + "ntpdate_enable=YES,ntpdate_hosts=time.nuri.net" }, { "Mexico", "mx.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=mx.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=mx.pool.ntp.org" }, { "Netherlands", "ntp0.nl.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp0.nl.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp0.nl.net" }, { "Netherlands #2", "ntp1.nl.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.nl.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.nl.net" }, { "Netherlands #3", "ntp2.nl.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.nl.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.nl.net" }, { "Norway", "fartein.ifi.uio.no", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=fartein.ifi.uio.no" }, + "ntpdate_enable=YES,ntpdate_hosts=fartein.ifi.uio.no" }, { "Norway #2", "time.alcanet.no", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.alcanet.no" }, + "ntpdate_enable=YES,ntpdate_hosts=time.alcanet.no" }, { "New Zealand", "ntp.massey.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.massey.ac.nz" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.massey.ac.nz" }, { "New Zealand #2", "ntp.public.otago.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.public.otago.ac.nz" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.public.otago.ac.nz" }, { "New Zealand #3", "tk1.ihug.co.nz", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tk1.ihug.co.nz" }, + "ntpdate_enable=YES,ntpdate_hosts=tk1.ihug.co.nz" }, { "New Zealand #4", "ntp.waikato.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.waikato.ac.nz" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.waikato.ac.nz" }, { "Poland", "info.cyf-kr.edu.pl", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=info.cyf-kr.edu.pl" }, + "ntpdate_enable=YES,ntpdate_hosts=info.cyf-kr.edu.pl" }, { "Romania", "ticks.roedu.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ticks.roedu.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ticks.roedu.net" }, { "Russia", "ru.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ru.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=ru.pool.ntp.org" }, { "Russia #2", "ntp.psn.ru", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.psn.ru" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.psn.ru" }, { "Sweden", "se.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=se.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=se.pool.ntp.org" }, { "Sweden #2", "ntp.lth.se", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.lth.se" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.lth.se" }, { "Sweden #3", "ntp1.sp.se", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.sp.se" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.sp.se" }, { "Sweden #4", "ntp2.sp.se", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.sp.se" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.sp.se" }, { "Sweden #5", "ntp.kth.se", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.kth.se" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.kth.se" }, { "Singapore", "sg.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=sg.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=sg.pool.ntp.org" }, { "Slovenia", "si.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=si.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=si.pool.ntp.org" }, { "Slovenia #2", "sizif.mf.uni-lj.si", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=sizif.mf.uni-lj.si" }, + "ntpdate_enable=YES,ntpdate_hosts=sizif.mf.uni-lj.si" }, { "Slovenia #3", "ntp1.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.arnes.si" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.arnes.si" }, { "Slovenia #4", "ntp2.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.arnes.si" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.arnes.si" }, { "Slovenia #5", "time.ijs.si", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.ijs.si" }, + "ntpdate_enable=YES,ntpdate_hosts=time.ijs.si" }, { "Scotland", "ntp.cs.strath.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.cs.strath.ac.uk" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.cs.strath.ac.uk" }, { "Taiwan", "time.stdtime.gov.tw", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.stdtime.gov.tw" }, + "ntpdate_enable=YES,ntpdate_hosts=time.stdtime.gov.tw" }, { "Taiwan #2", "clock.stdtime.gov.tw", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock.stdtime.gov.tw" }, + "ntpdate_enable=YES,ntpdate_hosts=clock.stdtime.gov.tw" }, { "Taiwan #3", "tick.stdtime.gov.tw", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tick.stdtime.gov.tw" }, + "ntpdate_enable=YES,ntpdate_hosts=tick.stdtime.gov.tw" }, { "Taiwan #4", "tock.stdtime.gov.tw", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tock.stdtime.gov.tw" }, + "ntpdate_enable=YES,ntpdate_hosts=tock.stdtime.gov.tw" }, { "Taiwan #5", "watch.stdtime.gov.tw", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=watch.stdtime.gov.tw" }, + "ntpdate_enable=YES,ntpdate_hosts=watch.stdtime.gov.tw" }, { "United Kingdom", "uk.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=uk.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=uk.pool.ntp.org" }, { "United Kingdom #2", "ntp.exnet.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.exnet.com" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.exnet.com" }, { "United Kingdom #3", "ntp0.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp0.uk.uu.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp0.uk.uu.net" }, { "United Kingdom #4", "ntp1.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.uk.uu.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.uk.uu.net" }, { "United Kingdom #5", "ntp2.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.uk.uu.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.uk.uu.net" }, { "United Kingdom #6", "ntp2a.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2a.mcc.ac.uk" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2a.mcc.ac.uk" }, { "United Kingdom #7", "ntp2b.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2b.mcc.ac.uk" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2b.mcc.ac.uk" }, { "United Kingdom #8", "ntp2c.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2c.mcc.ac.uk" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2c.mcc.ac.uk" }, { "United Kingdom #9", "ntp2d.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2d.mcc.ac.uk" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2d.mcc.ac.uk" }, { "U.S.", "us.pool.ntp.org", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=us.pool.ntp.org" }, + "ntpdate_enable=YES,ntpdate_hosts=us.pool.ntp.org" }, { "U.S. AR", "sushi.lyon.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=sushi.compsci.lyon.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=sushi.compsci.lyon.edu" }, { "U.S. AZ", "ntp.drydog.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.drydog.com" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.drydog.com" }, { "U.S. CA", "ntp.ucsd.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.ucsd.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.ucsd.edu" }, { "U.S. CA #2", "ntp1.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.mainecoon.com" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.mainecoon.com" }, { "U.S. CA #3", "ntp2.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.mainecoon.com" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.mainecoon.com" }, { "U.S. CA #4", "reloj.kjsl.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=reloj.kjsl.com" }, + "ntpdate_enable=YES,ntpdate_hosts=reloj.kjsl.com" }, { "U.S. CA #5", "time.five-ten-sg.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time.five-ten-sg.com" }, + "ntpdate_enable=YES,ntpdate_hosts=time.five-ten-sg.com" }, { "U.S. DE", "louie.udel.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=louie.udel.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=louie.udel.edu" }, { "U.S. GA", "ntp.shorty.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.shorty.com" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.shorty.com" }, { "U.S. GA #2", "rolex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=rolex.usg.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=rolex.usg.edu" }, { "U.S. GA #3", "timex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=timex.usg.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=timex.usg.edu" }, { "U.S. IL", "ntp-0.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-0.cso.uiuc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-0.cso.uiuc.edu" }, { "U.S. IL #2", "ntp-1.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-1.cso.uiuc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-1.cso.uiuc.edu" }, { "U.S. IL #3", "ntp-1.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-1.mcs.anl.gov" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-1.mcs.anl.gov" }, { "U.S. IL #4", "ntp-2.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-2.cso.uiuc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-2.cso.uiuc.edu" }, { "U.S. IL #5", "ntp-2.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-2.mcs.anl.gov" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-2.mcs.anl.gov" }, { "U.S. IN", "gilbreth.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=gilbreth.ecn.purdue.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=gilbreth.ecn.purdue.edu" }, { "U.S. IN #2", "harbor.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=harbor.ecn.purdue.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=harbor.ecn.purdue.edu" }, { "U.S. IN #3", "molecule.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=molecule.ecn.purdue.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=molecule.ecn.purdue.edu" }, { "U.S. KS", "ntp1.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.kansas.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.kansas.net" }, { "U.S. KS #2", "ntp2.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.kansas.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.kansas.net" }, { "U.S. MA", "ntp.ourconcord.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.ourconcord.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.ourconcord.net" }, { "U.S. MA #2", "timeserver.cs.umb.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=timeserver.cs.umb.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=timeserver.cs.umb.edu" }, { "U.S. MN", "ns.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ns.nts.umn.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ns.nts.umn.edu" }, { "U.S. MN #2", "nss.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=nss.nts.umn.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=nss.nts.umn.edu" }, { "U.S. MO", "time-ext.missouri.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=time-ext.missouri.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=time-ext.missouri.edu" }, { "U.S. MT", "chronos1.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=chronos1.umt.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=chronos1.umt.edu" }, { "U.S. MT #2", "chronos2.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=chronos2.umt.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=chronos2.umt.edu" }, { "U.S. MT #3", "chronos3.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=chronos3.umt.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=chronos3.umt.edu" }, { "U.S. NC", "clock1.unc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock1.unc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=clock1.unc.edu" }, { "U.S. NV", "cuckoo.nevada.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=cuckoo.nevada.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=cuckoo.nevada.edu" }, { "U.S. NV #2", "tick.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tick.cs.unlv.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=tick.cs.unlv.edu" }, { "U.S. NV #3", "tock.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tock.cs.unlv.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=tock.cs.unlv.edu" }, { "U.S. NY", "ntp0.cornell.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp0.cornell.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp0.cornell.edu" }, { "U.S. NY #2", "sundial.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=sundial.columbia.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=sundial.columbia.edu" }, { "U.S. NY #3", "timex.cs.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=timex.cs.columbia.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=timex.cs.columbia.edu" }, { "U.S. PA", "clock-1.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock-1.cs.cmu.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=clock-1.cs.cmu.edu" }, { "U.S. PA #2", "clock-2.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock-2.cs.cmu.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=clock-2.cs.cmu.edu" }, { "U.S. PA #3", "clock.psu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=clock.psu.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=clock.psu.edu" }, { "U.S. PA #4", "fuzz.psc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=fuzz.psc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=fuzz.psc.edu" }, { "U.S. PA #5", "ntp-1.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-1.ece.cmu.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-1.ece.cmu.edu" }, { "U.S. PA #6", "ntp-2.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-2.ece.cmu.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-2.ece.cmu.edu" }, { "U.S. TX", "ntp.fnbhs.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.fnbhs.com" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.fnbhs.com" }, { "U.S. TX #2", "ntp.tmc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.tmc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.tmc.edu" }, { "U.S. TX #3", "ntp5.tamu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp5.tamu.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp5.tamu.edu" }, { "U.S. TX #4", "tick.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tick.greyware.com" }, + "ntpdate_enable=YES,ntpdate_hosts=tick.greyware.com" }, { "U.S. TX #5", "tock.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=tock.greyware.com" }, + "ntpdate_enable=YES,ntpdate_hosts=tock.greyware.com" }, { "U.S. VA", "ntp-1.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-1.vt.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-1.vt.edu" }, { "U.S. VA #2", "ntp-2.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp-2.vt.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp-2.vt.edu" }, { "U.S. VA #3", "ntp.cmr.gov", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.cmr.gov" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.cmr.gov" }, { "U.S. VT", "ntp0.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp0.state.vt.us" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp0.state.vt.us" }, { "U.S. VT #2", "ntp1.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.state.vt.us" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.state.vt.us" }, { "U.S. VT #3", "ntp2.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp2.state.vt.us" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp2.state.vt.us" }, { "U.S. WA", "ntp.tcp-udp.net", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.tcp-udp.net" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.tcp-udp.net" }, { "U.S. WI", "ntp1.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp1.cs.wisc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp1.cs.wisc.edu" }, { "U.S. WI #2", "ntp3.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp3.cs.wisc.edu" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp3.cs.wisc.edu" }, { "South Africa", "ntp.cs.unp.ac.za", dmenuVarsCheck, dmenuSetVariables, NULL, - "ntpdate_enable=YES,ntpdate_flags=ntp.cs.unp.ac.za" }, + "ntpdate_enable=YES,ntpdate_hosts=ntp.cs.unp.ac.za" }, { NULL } }, }; diff --git a/usr.sbin/sysinstall/sysinstall.8 b/usr.sbin/sysinstall/sysinstall.8 index eccb1823cd8b..ad6760c75ba0 100644 --- a/usr.sbin/sysinstall/sysinstall.8 +++ b/usr.sbin/sysinstall/sysinstall.8 @@ -217,10 +217,10 @@ Configure host as a user of the Network Time Protocol. .Pp .Sy Variables : .Bl -tag -width indent -.It ntpdate_flags -The flags to -.Xr ntpdate 8 , -that is to say the name of the server to sync from. +.It ntpdate_hosts +Whitespace-separated list of +.Xr ntpdate 8 +servers to sync from. .El .It configPCNFSD Configure host to support PC NFS. @@ -744,8 +744,7 @@ Default: user@host .Sy Variables : .Bl -tag -width indent .It cpioVerbose -Can be used to set the verbosity of cpio extractions to low, medium or -high. +Can be used to set the verbosity of cpio extractions to low or high. .El .It mediaGetType Interactively get the user to specify some type of media. diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 767bb32bcd87..d5f4b3288f47 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -130,7 +130,7 @@ #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" -#define VAR_IPV6_ENABLE "ipv6_enable" +#define VAR_IPV6_ENABLE "ipv6_activate_all_interfaces" #define VAR_IPV6ADDR "ipv6addr" #define VAR_KERN_SECURELEVEL "kern_securelevel" #define VAR_KEYMAP "keymap" @@ -166,7 +166,7 @@ #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_RPCBIND_ENABLE "rpcbind_enable" -#define VAR_NTPDATE_FLAGS "ntpdate_flags" +#define VAR_NTPDATE_HOSTS "ntpdate_hosts" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" #define VAR_PCNFSD "pcnfsd"