From owner-svn-src-stable-7@FreeBSD.ORG Wed Apr 11 07:12:20 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFF1F1065672; Wed, 11 Apr 2012 07:12:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8CFD8FC17; Wed, 11 Apr 2012 07:12:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B7CKHg059985; Wed, 11 Apr 2012 07:12:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B7CKlM059981; Wed, 11 Apr 2012 07:12:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201204110712.q3B7CKlM059981@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 11 Apr 2012 07:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234125 - stable/7/sys/dev/fxp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 07:12:21 -0000 Author: yongari Date: Wed Apr 11 07:12:20 2012 New Revision: 234125 URL: http://svn.freebsd.org/changeset/base/234125 Log: MFC r233585-233587: r233585: Partially revert r223608 and selectively allow microcode loading for 82550C. For 82550 controllers this change restores CPUSaver microcode loading. Due to silicon bug on 82550 and 82550C with server extension, these controllers seem to require CPUSaver microcode to receive fragmented UDP datagrams. However the microcode shouldn't be used on client featured 82550C as it locks up the controller. In addition, client featured 82550C does not have the silicon bug. Also clear temporary memory used for microcode loading since the same memory area is used for other commands. While I'm here use 82550C in probe message instead of generic 82550. Reported by: Andreas Longwitz incore de> Tested by: Andreas Longwitz incore de> r233586: Load entire EEPROM contents in device attach time and verify whether the checksum of EEPROM is valid or not. Because driver heavily relies on EEPROM information when it selectively enables features/workarounds, it would be helpful to know whether driver sees valid EEPROM. While I'm here remove all other EEPROM accesses since the entire EEPROM is loaded at device attach time. r233587: Remove unnecessary #if as the software workaround for PCI protocol violation should be activated unless the system is cold-booted after updating EEPROM. The PCI protocol violation happens only when established link is 10Mbps so the workaround should be updated whenever link state change is detected. Previously the workaround was activated only when user checks current media status with ifconfig(8). Modified: stable/7/sys/dev/fxp/if_fxp.c stable/7/sys/dev/fxp/if_fxpreg.h stable/7/sys/dev/fxp/if_fxpvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/7/sys/dev/fxp/if_fxp.c Wed Apr 11 07:10:58 2012 (r234124) +++ stable/7/sys/dev/fxp/if_fxp.c Wed Apr 11 07:12:20 2012 (r234125) @@ -194,7 +194,7 @@ static const struct fxp_ident const fxp_ { 0x1229, 0x08, 0, "Intel 82559 Pro/100 Ethernet" }, { 0x1229, 0x09, 0, "Intel 82559ER Pro/100 Ethernet" }, { 0x1229, 0x0c, 0, "Intel 82550 Pro/100 Ethernet" }, - { 0x1229, 0x0d, 0, "Intel 82550 Pro/100 Ethernet" }, + { 0x1229, 0x0d, 0, "Intel 82550C Pro/100 Ethernet" }, { 0x1229, 0x0e, 0, "Intel 82550 Pro/100 Ethernet" }, { 0x1229, 0x0f, 0, "Intel 82551 Pro/100 Ethernet" }, { 0x1229, 0x10, 0, "Intel 82551 Pro/100 Ethernet" }, @@ -248,6 +248,7 @@ static uint16_t fxp_eeprom_getword(stru static void fxp_eeprom_putword(struct fxp_softc *sc, int offset, uint16_t data); static void fxp_autosize_eeprom(struct fxp_softc *sc); +static void fxp_load_eeprom(struct fxp_softc *sc); static void fxp_read_eeprom(struct fxp_softc *sc, u_short *data, int offset, int words); static void fxp_write_eeprom(struct fxp_softc *sc, u_short *data, @@ -427,7 +428,7 @@ fxp_attach(device_t dev) struct fxp_rx *rxp; struct ifnet *ifp; uint32_t val; - uint16_t data, myea[ETHER_ADDR_LEN / 2]; + uint16_t data; u_char eaddr[ETHER_ADDR_LEN]; int error, flags, i, pmc, prefer_iomap; @@ -499,6 +500,7 @@ fxp_attach(device_t dev) * Find out how large of an SEEPROM we have. */ fxp_autosize_eeprom(sc); + fxp_load_eeprom(sc); /* * Find out the chip revision; lump all 82557 revs together. @@ -508,7 +510,7 @@ fxp_attach(device_t dev) /* Assume ICH controllers are 82559. */ sc->revision = FXP_REV_82559_A0; } else { - fxp_read_eeprom(sc, &data, 5, 1); + data = sc->eeprom[FXP_EEPROM_MAP_CNTR]; if ((data >> 8) == 1) sc->revision = FXP_REV_82557; else @@ -520,15 +522,27 @@ fxp_attach(device_t dev) */ if (sc->revision >= FXP_REV_82558_A4 && sc->revision != FXP_REV_82559S_A) { - fxp_read_eeprom(sc, &data, 10, 1); + data = sc->eeprom[FXP_EEPROM_MAP_ID]; if ((data & 0x20) != 0 && pci_find_extcap(sc->dev, PCIY_PMG, &pmc) == 0) sc->flags |= FXP_FLAG_WOLCAP; } + if (sc->revision == FXP_REV_82550_C) { + /* + * 82550C with server extension requires microcode to + * receive fragmented UDP datagrams. However if the + * microcode is used for client-only featured 82550C + * it locks up controller. + */ + data = sc->eeprom[FXP_EEPROM_MAP_COMPAT]; + if ((data & 0x0400) == 0) + sc->flags |= FXP_FLAG_NO_UCODE; + } + /* Receiver lock-up workaround detection. */ if (sc->revision < FXP_REV_82558_A4) { - fxp_read_eeprom(sc, &data, 3, 1); + data = sc->eeprom[FXP_EEPROM_MAP_COMPAT]; if ((data & 0x03) != 0x03) { sc->flags |= FXP_FLAG_RXBUG; device_printf(dev, "Enabling Rx lock-up workaround\n"); @@ -538,7 +552,7 @@ fxp_attach(device_t dev) /* * Determine whether we must use the 503 serial interface. */ - fxp_read_eeprom(sc, &data, 6, 1); + data = sc->eeprom[FXP_EEPROM_MAP_PRI_PHY]; if (sc->revision == FXP_REV_82557 && (data & FXP_PHY_DEVICE_MASK) != 0 && (data & FXP_PHY_SERIAL_ONLY)) sc->flags |= FXP_FLAG_SERIAL_MEDIA; @@ -558,7 +572,7 @@ fxp_attach(device_t dev) */ if ((sc->ident->ich >= 2 && sc->ident->ich <= 3) || (sc->ident->ich == 0 && sc->revision >= FXP_REV_82559_A0)) { - fxp_read_eeprom(sc, &data, 10, 1); + data = sc->eeprom[FXP_EEPROM_MAP_ID]; if (data & 0x02) { /* STB enable */ uint16_t cksum; int i; @@ -566,27 +580,24 @@ fxp_attach(device_t dev) device_printf(dev, "Disabling dynamic standby mode in EEPROM\n"); data &= ~0x02; - fxp_write_eeprom(sc, &data, 10, 1); + sc->eeprom[FXP_EEPROM_MAP_ID] = data; + fxp_write_eeprom(sc, &data, FXP_EEPROM_MAP_ID, 1); device_printf(dev, "New EEPROM ID: 0x%x\n", data); cksum = 0; - for (i = 0; i < (1 << sc->eeprom_size) - 1; i++) { - fxp_read_eeprom(sc, &data, i, 1); - cksum += data; - } + for (i = 0; i < (1 << sc->eeprom_size) - 1; i++) + cksum += sc->eeprom[i]; i = (1 << sc->eeprom_size) - 1; cksum = 0xBABA - cksum; - fxp_read_eeprom(sc, &data, i, 1); fxp_write_eeprom(sc, &cksum, i, 1); device_printf(dev, "EEPROM checksum @ 0x%x: 0x%x -> 0x%x\n", - i, data, cksum); -#if 1 + i, sc->eeprom[i], cksum); + sc->eeprom[i] = cksum; /* * If the user elects to continue, try the software * workaround, as it is better than nothing. */ sc->flags |= FXP_FLAG_CU_RESUME_BUG; -#endif } } @@ -780,21 +791,20 @@ fxp_attach(device_t dev) /* * Read MAC address. */ - fxp_read_eeprom(sc, myea, 0, 3); - eaddr[0] = myea[0] & 0xff; - eaddr[1] = myea[0] >> 8; - eaddr[2] = myea[1] & 0xff; - eaddr[3] = myea[1] >> 8; - eaddr[4] = myea[2] & 0xff; - eaddr[5] = myea[2] >> 8; + eaddr[0] = sc->eeprom[FXP_EEPROM_MAP_IA0] & 0xff; + eaddr[1] = sc->eeprom[FXP_EEPROM_MAP_IA0] >> 8; + eaddr[2] = sc->eeprom[FXP_EEPROM_MAP_IA1] & 0xff; + eaddr[3] = sc->eeprom[FXP_EEPROM_MAP_IA1] >> 8; + eaddr[4] = sc->eeprom[FXP_EEPROM_MAP_IA2] & 0xff; + eaddr[5] = sc->eeprom[FXP_EEPROM_MAP_IA2] >> 8; if (bootverbose) { device_printf(dev, "PCI IDs: %04x %04x %04x %04x %04x\n", pci_get_vendor(dev), pci_get_device(dev), pci_get_subvendor(dev), pci_get_subdevice(dev), pci_get_revid(dev)); - fxp_read_eeprom(sc, &data, 10, 1); device_printf(dev, "Dynamic Standby mode is %s\n", - data & 0x02 ? "enabled" : "disabled"); + sc->eeprom[FXP_EEPROM_MAP_ID] & 0x02 ? "enabled" : + "disabled"); } /* @@ -1290,6 +1300,23 @@ fxp_write_eeprom(struct fxp_softc *sc, u fxp_eeprom_putword(sc, offset + i, data[i]); } +static void +fxp_load_eeprom(struct fxp_softc *sc) +{ + int i; + uint16_t cksum; + + fxp_read_eeprom(sc, sc->eeprom, 0, 1 << sc->eeprom_size); + cksum = 0; + for (i = 0; i < (1 << sc->eeprom_size) - 1; i++) + cksum += sc->eeprom[i]; + cksum = 0xBABA - cksum; + if (cksum != sc->eeprom[(1 << sc->eeprom_size) - 1]) + device_printf(sc->dev, + "EEPROM checksum mismatch! (0x%04x -> 0x%04x)\n", + cksum, sc->eeprom[(1 << sc->eeprom_size) - 1]); +} + /* * Grab the softc lock and call the real fxp_start_body() routine */ @@ -2576,12 +2603,6 @@ fxp_ifmedia_sts(struct ifnet *ifp, struc mii_pollstat(mii); ifmr->ifm_active = mii->mii_media_active; ifmr->ifm_status = mii->mii_media_status; - - if (IFM_SUBTYPE(ifmr->ifm_active) == IFM_10_T && - sc->flags & FXP_FLAG_CU_RESUME_BUG) - sc->cu_resume_bug = 1; - else - sc->cu_resume_bug = 0; FXP_UNLOCK(sc); } @@ -2773,6 +2794,11 @@ fxp_miibus_statchg(device_t dev) (IFM_AVALID | IFM_ACTIVE)) return; + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_10_T && + sc->flags & FXP_FLAG_CU_RESUME_BUG) + sc->cu_resume_bug = 1; + else + sc->cu_resume_bug = 0; /* * Call fxp_init_body in order to adjust the flow control settings. * Note that the 82557 doesn't support hardware flow control. @@ -3007,10 +3033,8 @@ static uint32_t fxp_ucode_d101a[] = D101 static uint32_t fxp_ucode_d101b0[] = D101_B0_RCVBUNDLE_UCODE; static uint32_t fxp_ucode_d101ma[] = D101M_B_RCVBUNDLE_UCODE; static uint32_t fxp_ucode_d101s[] = D101S_RCVBUNDLE_UCODE; -#ifdef notyet static uint32_t fxp_ucode_d102[] = D102_B_RCVBUNDLE_UCODE; static uint32_t fxp_ucode_d102c[] = D102_C_RCVBUNDLE_UCODE; -#endif static uint32_t fxp_ucode_d102e[] = D102_E_RCVBUNDLE_UCODE; #define UCODE(x) x, sizeof(x)/sizeof(uint32_t) @@ -3028,12 +3052,10 @@ static const struct ucode { D101M_CPUSAVER_DWORD, D101M_CPUSAVER_BUNDLE_MAX_DWORD }, { FXP_REV_82559S_A, UCODE(fxp_ucode_d101s), D101S_CPUSAVER_DWORD, D101S_CPUSAVER_BUNDLE_MAX_DWORD }, -#ifdef notyet { FXP_REV_82550, UCODE(fxp_ucode_d102), D102_B_CPUSAVER_DWORD, D102_B_CPUSAVER_BUNDLE_MAX_DWORD }, { FXP_REV_82550_C, UCODE(fxp_ucode_d102c), D102_C_CPUSAVER_DWORD, D102_C_CPUSAVER_BUNDLE_MAX_DWORD }, -#endif { FXP_REV_82551_F, UCODE(fxp_ucode_d102e), D102_E_CPUSAVER_DWORD, D102_E_CPUSAVER_BUNDLE_MAX_DWORD }, { FXP_REV_82551_10, UCODE(fxp_ucode_d102e), @@ -3048,6 +3070,9 @@ fxp_load_ucode(struct fxp_softc *sc) struct fxp_cb_ucode *cbp; int i; + if (sc->flags & FXP_FLAG_NO_UCODE) + return; + for (uc = ucode_table; uc->ucode != NULL; uc++) if (sc->revision == uc->revision) break; @@ -3080,6 +3105,7 @@ fxp_load_ucode(struct fxp_softc *sc) sc->tunable_int_delay, uc->bundle_max_offset == 0 ? 0 : sc->tunable_bundle_max); sc->flags |= FXP_FLAG_UCODE; + bzero(cbp, FXP_TXCB_SZ); } #define FXP_SYSCTL_STAT_ADD(c, h, n, p, d) \ Modified: stable/7/sys/dev/fxp/if_fxpreg.h ============================================================================== --- stable/7/sys/dev/fxp/if_fxpreg.h Wed Apr 11 07:10:58 2012 (r234124) +++ stable/7/sys/dev/fxp/if_fxpreg.h Wed Apr 11 07:12:20 2012 (r234125) @@ -448,6 +448,24 @@ struct fxp_stats { #define FXP_EEPROM_OPC_READ 0x6 /* + * EEPROM map + */ +#define FXP_EEPROM_MAP_IA0 0x00 /* Station address */ +#define FXP_EEPROM_MAP_IA1 0x01 +#define FXP_EEPROM_MAP_IA2 0x02 +#define FXP_EEPROM_MAP_COMPAT 0x03 /* Compatibility */ +#define FXP_EEPROM_MAP_CNTR 0x05 /* Controller/connector type */ +#define FXP_EEPROM_MAP_PRI_PHY 0x06 /* Primary PHY record */ +#define FXP_EEPROM_MAP_SEC_PHY 0x07 /* Secondary PHY record */ +#define FXP_EEPROM_MAP_PWA0 0x08 /* Printed wire assembly num. */ +#define FXP_EEPROM_MAP_PWA1 0x09 /* Printed wire assembly num. */ +#define FXP_EEPROM_MAP_ID 0x0A /* EEPROM ID */ +#define FXP_EEPROM_MAP_SUBSYS 0x0B /* Subsystem ID */ +#define FXP_EEPROM_MAP_SUBVEN 0x0C /* Subsystem vendor ID */ +#define FXP_EEPROM_MAP_CKSUM64 0x3F /* 64-word EEPROM checksum */ +#define FXP_EEPROM_MAP_CKSUM256 0xFF /* 256-word EEPROM checksum */ + +/* * Management Data Interface opcodes */ #define FXP_MDI_WRITE 0x1 Modified: stable/7/sys/dev/fxp/if_fxpvar.h ============================================================================== --- stable/7/sys/dev/fxp/if_fxpvar.h Wed Apr 11 07:10:58 2012 (r234124) +++ stable/7/sys/dev/fxp/if_fxpvar.h Wed Apr 11 07:12:20 2012 (r234125) @@ -219,6 +219,7 @@ struct fxp_softc { int if_flags; uint8_t rfa_size; uint32_t tx_cmd; + uint16_t eeprom[256]; }; #define FXP_FLAG_MWI_ENABLE 0x0001 /* MWI enable */ @@ -236,6 +237,7 @@ struct fxp_softc { #define FXP_FLAG_WOLCAP 0x2000 /* WOL capability */ #define FXP_FLAG_WOL 0x4000 /* WOL active */ #define FXP_FLAG_RXBUG 0x8000 /* Rx lock-up bug */ +#define FXP_FLAG_NO_UCODE 0x10000 /* ucode is not applicable */ /* Macros to ease CSR access. */ #define CSR_READ_1(sc, reg) bus_read_1(sc->fxp_res[0], reg) From owner-svn-src-stable-7@FreeBSD.ORG Wed Apr 11 07:21:52 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6DD2B1065670; Wed, 11 Apr 2012 07:21:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577F58FC0A; Wed, 11 Apr 2012 07:21:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3B7Lqjs060459; Wed, 11 Apr 2012 07:21:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3B7LqUr060456; Wed, 11 Apr 2012 07:21:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201204110721.q3B7LqUr060456@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 11 Apr 2012 07:21:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234128 - stable/7/sys/dev/ale X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Apr 2012 07:21:52 -0000 Author: yongari Date: Wed Apr 11 07:21:51 2012 New Revision: 234128 URL: http://svn.freebsd.org/changeset/base/234128 Log: MFC r233688-233689: r233688: Remove task queue based link state change handler. Driver no longer needs to defer link state handling. While I'm here, mark IFF_DRV_RUNNING before changing media. If link is established without any delay, that link state change handling could be lost. r233689: Do not report current link status if driver is not running. This change also workarounds dhclient's link state handling bug by not giving current link status. Unlike other controllers, ale(4)'s PHY hibernation perfectly works such that driver does not see a valid link if the controller is not brought up. If dhclient(8) runs on ale(4) it will blindly waits until link UP and then gives up after 10 seconds. Because dhclient(8) still thinks interface got a valid link when IFM_AVALID is not set for selected media, this change makes dhclient initiate DHCP without waiting for link UP. Modified: stable/7/sys/dev/ale/if_ale.c stable/7/sys/dev/ale/if_alevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Wed Apr 11 07:19:46 2012 (r234127) +++ stable/7/sys/dev/ale/if_ale.c Wed Apr 11 07:21:51 2012 (r234128) @@ -115,7 +115,6 @@ static void ale_init_tx_ring(struct ale_ static void ale_int_task(void *, int); static int ale_intr(void *); static int ale_ioctl(struct ifnet *, u_long, caddr_t); -static void ale_link_task(void *, int); static void ale_mac_config(struct ale_softc *); static int ale_miibus_readreg(device_t, int, int); static void ale_miibus_statchg(device_t); @@ -253,10 +252,45 @@ static void ale_miibus_statchg(device_t dev) { struct ale_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint32_t reg; sc = device_get_softc(dev); + mii = device_get_softc(sc->ale_miibus); + ifp = sc->ale_ifp; + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + + sc->ale_flags &= ~ALE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + sc->ale_flags |= ALE_FLAG_LINK; + break; + case IFM_1000_T: + if ((sc->ale_flags & ALE_FLAG_FASTETHER) == 0) + sc->ale_flags |= ALE_FLAG_LINK; + break; + default: + break; + } + } - taskqueue_enqueue(taskqueue_swi, &sc->ale_link_task); + /* Stop Rx/Tx MACs. */ + ale_stop_mac(sc); + + /* Program MACs with resolved speed/duplex/flow-control. */ + if ((sc->ale_flags & ALE_FLAG_LINK) != 0) { + ale_mac_config(sc); + /* Reenable Tx/Rx MACs. */ + reg = CSR_READ_4(sc, ALE_MAC_CFG); + reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; + CSR_WRITE_4(sc, ALE_MAC_CFG, reg); + } } static void @@ -267,6 +301,10 @@ ale_mediastatus(struct ifnet *ifp, struc sc = ifp->if_softc; ALE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + ALE_UNLOCK(sc); + return; + } mii = device_get_softc(sc->ale_miibus); mii_pollstat(mii); @@ -425,7 +463,6 @@ ale_attach(device_t dev) MTX_DEF); callout_init_mtx(&sc->ale_tick_ch, &sc->ale_mtx, 0); TASK_INIT(&sc->ale_int_task, 0, ale_int_task, sc); - TASK_INIT(&sc->ale_link_task, 0, ale_link_task, sc); /* Map the device. */ pci_enable_busmaster(dev); @@ -679,7 +716,6 @@ ale_detach(device_t dev) ALE_UNLOCK(sc); callout_drain(&sc->ale_tick_ch); taskqueue_drain(sc->ale_tq, &sc->ale_int_task); - taskqueue_drain(taskqueue_swi, &sc->ale_link_task); } if (sc->ale_tq != NULL) { @@ -2073,57 +2109,6 @@ ale_mac_config(struct ale_softc *sc) } static void -ale_link_task(void *arg, int pending) -{ - struct ale_softc *sc; - struct mii_data *mii; - struct ifnet *ifp; - uint32_t reg; - - sc = (struct ale_softc *)arg; - - ALE_LOCK(sc); - mii = device_get_softc(sc->ale_miibus); - ifp = sc->ale_ifp; - if (mii == NULL || ifp == NULL || - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { - ALE_UNLOCK(sc); - return; - } - - sc->ale_flags &= ~ALE_FLAG_LINK; - if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == - (IFM_ACTIVE | IFM_AVALID)) { - switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_10_T: - case IFM_100_TX: - sc->ale_flags |= ALE_FLAG_LINK; - break; - case IFM_1000_T: - if ((sc->ale_flags & ALE_FLAG_FASTETHER) == 0) - sc->ale_flags |= ALE_FLAG_LINK; - break; - default: - break; - } - } - - /* Stop Rx/Tx MACs. */ - ale_stop_mac(sc); - - /* Program MACs with resolved speed/duplex/flow-control. */ - if ((sc->ale_flags & ALE_FLAG_LINK) != 0) { - ale_mac_config(sc); - /* Reenable Tx/Rx MACs. */ - reg = CSR_READ_4(sc, ALE_MAC_CFG); - reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; - CSR_WRITE_4(sc, ALE_MAC_CFG, reg); - } - - ALE_UNLOCK(sc); -} - -static void ale_stats_clear(struct ale_softc *sc) { struct smb sb; @@ -2873,14 +2858,14 @@ ale_init_locked(struct ale_softc *sc) CSR_WRITE_4(sc, ALE_INTR_STATUS, 0xFFFFFFFF); CSR_WRITE_4(sc, ALE_INTR_STATUS, 0); + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + sc->ale_flags &= ~ALE_FLAG_LINK; /* Switch to the current media. */ mii_mediachg(mii); callout_reset(&sc->ale_tick_ch, hz, ale_tick, sc); - - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void Modified: stable/7/sys/dev/ale/if_alevar.h ============================================================================== --- stable/7/sys/dev/ale/if_alevar.h Wed Apr 11 07:19:46 2012 (r234127) +++ stable/7/sys/dev/ale/if_alevar.h Wed Apr 11 07:21:51 2012 (r234128) @@ -221,7 +221,6 @@ struct ale_softc { int ale_pagesize; struct task ale_int_task; - struct task ale_link_task; struct taskqueue *ale_tq; struct mtx ale_mtx; }; From owner-svn-src-stable-7@FreeBSD.ORG Fri Apr 13 11:12:19 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5323106566B; Fri, 13 Apr 2012 11:12:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD208FC0A; Fri, 13 Apr 2012 11:12:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3DBCJBJ076911; Fri, 13 Apr 2012 11:12:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3DBCJbX076909; Fri, 13 Apr 2012 11:12:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201204131112.q3DBCJbX076909@svn.freebsd.org> From: Andriy Gapon Date: Fri, 13 Apr 2012 11:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234222 - stable/7/sys/conf X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2012 11:12:19 -0000 Author: avg Date: Fri Apr 13 11:12:18 2012 New Revision: 234222 URL: http://svn.freebsd.org/changeset/base/234222 Log: MFC r231558: newvers.sh: unbreak git/git-svn support Modified: stable/7/sys/conf/newvers.sh Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Fri Apr 13 09:54:36 2012 (r234221) +++ stable/7/sys/conf/newvers.sh Fri Apr 13 11:12:18 2012 (r234222) @@ -92,11 +92,15 @@ for dir in /bin /usr/bin /usr/local/bin; svnversion=${dir}/svnversion break fi - if [ -d "${SYSDIR}/../.git" -a -x "${dir}/git" ] ; then - git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" - break - fi done +if [ -d "${SYSDIR}/../.git" ] ; then + for dir in /bin /usr/bin /usr/local/bin; do + if [ -x "${dir}/git" ] ; then + git_cmd="${dir}/git --git-dir=${SYSDIR}/../.git" + break + fi + done +fi if [ -n "$svnversion" ] ; then echo "$svnversion" From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 14 02:07:38 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4BC1065678; Sat, 14 Apr 2012 02:07:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7AD858FC15; Sat, 14 Apr 2012 02:07:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3E27ceA008105; Sat, 14 Apr 2012 02:07:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3E27cLX008103; Sat, 14 Apr 2012 02:07:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204140207.q3E27cLX008103@svn.freebsd.org> From: Eitan Adler Date: Sat, 14 Apr 2012 02:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234262 - stable/7/sbin/sysctl X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 02:07:38 -0000 Author: eadler Date: Sat Apr 14 02:07:37 2012 New Revision: 234262 URL: http://svn.freebsd.org/changeset/base/234262 Log: MFC r234134: s/Free Memory Pages/Free Memory/ to avoid confusion, since we're reporting a number of bytes rather than a number of pages Approved by: cperciva (implicit) Modified: stable/7/sbin/sysctl/sysctl.c Directory Properties: stable/7/sbin/sysctl/ (props changed) Modified: stable/7/sbin/sysctl/sysctl.c ============================================================================== --- stable/7/sbin/sysctl/sysctl.c Sat Apr 14 02:07:18 2012 (r234261) +++ stable/7/sbin/sysctl/sysctl.c Sat Apr 14 02:07:37 2012 (r234262) @@ -408,7 +408,7 @@ S_vmtotal(int l2, void *p) v->t_vmshr * pageKilo, v->t_avmshr * pageKilo); printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n", v->t_rmshr * pageKilo, v->t_armshr * pageKilo); - printf("Free Memory Pages:\t%dK\n", v->t_free * pageKilo); + printf("Free Memory:\t%dK\n", v->t_free * pageKilo); return (0); } From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 14 02:11:27 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 17DD210656D7; Sat, 14 Apr 2012 02:11:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D2D8FC20; Sat, 14 Apr 2012 02:11:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3E2BQkG008362; Sat, 14 Apr 2012 02:11:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3E2BQit008360; Sat, 14 Apr 2012 02:11:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204140211.q3E2BQit008360@svn.freebsd.org> From: Eitan Adler Date: Sat, 14 Apr 2012 02:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234265 - stable/7/usr.sbin/ppp X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 02:11:27 -0000 Author: eadler Date: Sat Apr 14 02:11:26 2012 New Revision: 234265 URL: http://svn.freebsd.org/changeset/base/234265 Log: MFC r230347: Fix warning when compiling with gcc46: error: variable 'addrs' set but not used Approved by: cperciva (implicit) Modified: stable/7/usr.sbin/ppp/iface.c Directory Properties: stable/7/usr.sbin/ppp/ (props changed) Modified: stable/7/usr.sbin/ppp/iface.c ============================================================================== --- stable/7/usr.sbin/ppp/iface.c Sat Apr 14 02:11:08 2012 (r234264) +++ stable/7/usr.sbin/ppp/iface.c Sat Apr 14 02:11:26 2012 (r234265) @@ -373,12 +373,11 @@ iface_addr_Add(const char *name, struct void iface_Clear(struct iface *iface, struct ncp *ncp, int family, int how) { - int addrs, af, inskip, in6skip, s4 = -1, s6 = -1, *s; + int af, inskip, in6skip, s4 = -1, s6 = -1, *s; unsigned n; if (iface->addrs) { inskip = in6skip = how == IFACE_CLEAR_ALL ? 0 : 1; - addrs = 0; for (n = 0; n < iface->addrs; n++) { af = ncprange_family(&iface->addr[n].ifa); From owner-svn-src-stable-7@FreeBSD.ORG Sat Apr 14 02:49:02 2012 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2626E106566B; Sat, 14 Apr 2012 02:49:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1071D8FC18; Sat, 14 Apr 2012 02:49:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q3E2n1J0009652; Sat, 14 Apr 2012 02:49:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q3E2n1CZ009650; Sat, 14 Apr 2012 02:49:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201204140249.q3E2n1CZ009650@svn.freebsd.org> From: Eitan Adler Date: Sat, 14 Apr 2012 02:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r234268 - stable/7/lib/libc/string X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2012 02:49:02 -0000 Author: eadler Date: Sat Apr 14 02:49:01 2012 New Revision: 234268 URL: http://svn.freebsd.org/changeset/base/234268 Log: MFC r231813: Add err(3) to strerror(3) SEE ALSO section Approved by: cperciva (implicit) Modified: stable/7/lib/libc/string/strerror.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/string/strerror.3 ============================================================================== --- stable/7/lib/libc/string/strerror.3 Sat Apr 14 02:48:19 2012 (r234267) +++ stable/7/lib/libc/string/strerror.3 Sat Apr 14 02:49:01 2012 (r234268) @@ -147,6 +147,7 @@ or should be used instead. .Sh SEE ALSO .Xr intro 2 , +.Xr err 3 , .Xr psignal 3 .Sh STANDARDS The