From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 00:45:25 2010 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 F2C371065739; Sun, 21 Nov 2010 00:45:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C6EC08FC16; Sun, 21 Nov 2010 00:45:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0jO3g031342; Sun, 21 Nov 2010 00:45:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0jOMw031339; Sun, 21 Nov 2010 00:45:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210045.oAL0jOMw031339@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:45:24 +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: r215599 - in stable/7/sys: sparc64/include vm 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: Sun, 21 Nov 2010 00:45:25 -0000 Author: marius Date: Sun Nov 21 00:45:24 2010 New Revision: 215599 URL: http://svn.freebsd.org/changeset/base/215599 Log: MFC: r215093 Enable reservation-based physical memory allocation. Even without the creation of large page mappings in the pmap, it can provide modest performance benefits. In particular, for a "buildworld" on a 2x 1GHz Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system time by 12.6%. Tested by: marius@ Modified: stable/7/sys/sparc64/include/vmparam.h stable/7/sys/vm/vm_reserv.c 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/sparc64/include/vmparam.h ============================================================================== --- stable/7/sys/sparc64/include/vmparam.h Sun Nov 21 00:45:18 2010 (r215598) +++ stable/7/sys/sparc64/include/vmparam.h Sun Nov 21 00:45:24 2010 (r215599) @@ -121,10 +121,17 @@ #define VM_NFREEORDER 12 /* - * Disable superpage reservations. + * Enable superpage reservations: 1 level. */ #ifndef VM_NRESERVLEVEL -#define VM_NRESERVLEVEL 0 +#define VM_NRESERVLEVEL 1 +#endif + +/* + * Level 0 reservations consist of 512 pages. + */ +#ifndef VM_LEVEL_0_ORDER +#define VM_LEVEL_0_ORDER 9 #endif /* Modified: stable/7/sys/vm/vm_reserv.c ============================================================================== --- stable/7/sys/vm/vm_reserv.c Sun Nov 21 00:45:18 2010 (r215598) +++ stable/7/sys/vm/vm_reserv.c Sun Nov 21 00:45:24 2010 (r215599) @@ -197,7 +197,7 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER } mtx_unlock(&vm_page_queue_free_mtx); sbuf_printf(&sbuf, "%5d: %6dK, %6d\n", level, - unused_pages * (PAGE_SIZE / 1024), counter); + unused_pages * ((int)PAGE_SIZE / 1024), counter); } sbuf_finish(&sbuf); error = SYSCTL_OUT(req, sbuf_data(&sbuf), sbuf_len(&sbuf)); From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 00:50:31 2010 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 8CB991065769; Sun, 21 Nov 2010 00:50:31 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78FFC8FC13; Sun, 21 Nov 2010 00:50:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0oVax031538; Sun, 21 Nov 2010 00:50:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0oVwq031536; Sun, 21 Nov 2010 00:50:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210050.oAL0oVwq031536@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:50:31 +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: r215601 - stable/7/sys/opencrypto 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: Sun, 21 Nov 2010 00:50:31 -0000 Author: marius Date: Sun Nov 21 00:50:31 2010 New Revision: 215601 URL: http://svn.freebsd.org/changeset/base/215601 Log: MFC: r215295 Let cryptosoft(4) add its pseudo-device with a specific unit number and its probe method return BUS_PROBE_NOWILDCARD so it doesn't get attached to real devices hanging off of nexus(4) with no specific devclass set. Actually, the more desirable fix for this would be to get rid of the newbus interface of cryptosoft(4) altogether but apparently crypto(9) was written with support for cryptographic hardware in mind so that approach would require some KPI breaking changes which don't seem worth it. Modified: stable/7/sys/opencrypto/cryptosoft.c 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/opencrypto/cryptosoft.c ============================================================================== --- stable/7/sys/opencrypto/cryptosoft.c Sun Nov 21 00:50:29 2010 (r215600) +++ stable/7/sys/opencrypto/cryptosoft.c Sun Nov 21 00:50:31 2010 (r215601) @@ -1003,7 +1003,7 @@ swcr_identify(device_t *dev, device_t pa { /* 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"); } @@ -1011,7 +1011,7 @@ static int swcr_probe(device_t dev) { device_set_desc(dev, "software crypto"); - return (0); + return (BUS_PROBE_NOWILDCARD); } static int From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 00:53:27 2010 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 661F2106564A; Sun, 21 Nov 2010 00:53:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54BE58FC0C; Sun, 21 Nov 2010 00:53:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAL0rRFU031689; Sun, 21 Nov 2010 00:53:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAL0rRD6031687; Sun, 21 Nov 2010 00:53:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011210053.oAL0rRD6031687@svn.freebsd.org> From: Marius Strobl Date: Sun, 21 Nov 2010 00:53:27 +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: r215603 - stable/7/sys/dev/mpt 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: Sun, 21 Nov 2010 00:53:27 -0000 Author: marius Date: Sun Nov 21 00:53:27 2010 New Revision: 215603 URL: http://svn.freebsd.org/changeset/base/215603 Log: MFC: r215325 Use the correct variable for determining the verbosity level in mpt_lprtc(). While at it, fix the whitespace of that macro. PR: 149502 Submitted by: Andrew Boyer Modified: stable/7/sys/dev/mpt/mpt.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/mpt/mpt.h ============================================================================== --- stable/7/sys/dev/mpt/mpt.h Sun Nov 21 00:53:19 2010 (r215602) +++ stable/7/sys/dev/mpt/mpt.h Sun Nov 21 00:53:27 2010 (r215603) @@ -1110,10 +1110,10 @@ do { \ mpt_prt(mpt, __VA_ARGS__); \ } while (0) -#define mpt_lprtc(mpt, level, ...) \ -do { \ - if (level <= (mpt)->debug_level) \ - mpt_prtc(mpt, __VA_ARGS__); \ +#define mpt_lprtc(mpt, level, ...) \ +do { \ + if (level <= (mpt)->verbose) \ + mpt_prtc(mpt, __VA_ARGS__); \ } while (0) #else void mpt_lprt(struct mpt_softc *, int, const char *, ...) From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 10:52:47 2010 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 EE7811065670; Sun, 21 Nov 2010 10:52:47 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCFEA8FC20; Sun, 21 Nov 2010 10:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAqlgv052176; Sun, 21 Nov 2010 10:52:47 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAqlen052174; Sun, 21 Nov 2010 10:52:47 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211052.oALAqlen052174@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:52:47 +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: r215614 - stable/7/sys/net80211 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: Sun, 21 Nov 2010 10:52:48 -0000 Author: bschmidt Date: Sun Nov 21 10:52:47 2010 New Revision: 215614 URL: http://svn.freebsd.org/changeset/base/215614 Log: MFC r207322: Fix typo. No functional change. Obtained from: DragonFlyBSD Committed by: rpaulo Modified: stable/7/sys/net80211/ieee80211_node.c 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/net80211/ieee80211_node.c ============================================================================== --- stable/7/sys/net80211/ieee80211_node.c Sun Nov 21 10:52:18 2010 (r215613) +++ stable/7/sys/net80211/ieee80211_node.c Sun Nov 21 10:52:47 2010 (r215614) @@ -373,7 +373,7 @@ ieee80211_reset_bss(struct ieee80211com ieee80211_reset_erp(ic); ni = ieee80211_alloc_node(&ic->ic_sta, ic->ic_myaddr); - KASSERT(ni != NULL, ("unable to setup inital BSS node")); + KASSERT(ni != NULL, ("unable to setup initial BSS node")); obss = ic->ic_bss; ic->ic_bss = ieee80211_ref_node(ni); if (obss != NULL) { From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 10:56:05 2010 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 22A161065674; Sun, 21 Nov 2010 10:56:05 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 112838FC16; Sun, 21 Nov 2010 10:56:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAu4Zu052409; Sun, 21 Nov 2010 10:56:04 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAu4ne052407; Sun, 21 Nov 2010 10:56:04 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211056.oALAu4ne052407@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:56:04 +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: r215617 - stable/7/sys/net80211 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: Sun, 21 Nov 2010 10:56:05 -0000 Author: bschmidt Date: Sun Nov 21 10:56:04 2010 New Revision: 215617 URL: http://svn.freebsd.org/changeset/base/215617 Log: MFC r200242: Fix typo in comment Submitted by: Paul B Mahol Committed by: rpaulo Modified: stable/7/sys/net80211/ieee80211_input.c 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/net80211/ieee80211_input.c ============================================================================== --- stable/7/sys/net80211/ieee80211_input.c Sun Nov 21 10:55:43 2010 (r215616) +++ stable/7/sys/net80211/ieee80211_input.c Sun Nov 21 10:56:04 2010 (r215617) @@ -1464,7 +1464,7 @@ ieee80211_parse_wpa(struct ieee80211com return IEEE80211_REASON_IE_INVALID; } frm += 6, len -= 4; /* NB: len is payload only */ - /* NB: iswapoui already validated the OUI and type */ + /* NB: iswpaoui already validated the OUI and type */ w = LE_READ_2(frm); if (w != WPA_VERSION) { IEEE80211_DISCARD_IE(ic, From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 10:58:38 2010 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 25424106566B; Sun, 21 Nov 2010 10:58:38 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13B498FC12; Sun, 21 Nov 2010 10:58:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALAwbxW052569; Sun, 21 Nov 2010 10:58:37 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALAwbrl052567; Sun, 21 Nov 2010 10:58:37 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211058.oALAwbrl052567@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 10:58:37 +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: r215619 - stable/7/sys/net80211 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: Sun, 21 Nov 2010 10:58:38 -0000 Author: bschmidt Date: Sun Nov 21 10:58:37 2010 New Revision: 215619 URL: http://svn.freebsd.org/changeset/base/215619 Log: MFC r199076: The isr_intval in ieee80211req_scan_result structure should be 16 bit. This makes ifconfig list scan display the correct beacon interval (previously it would int overflow). As a side effect, this makes the ieee80211req_scan_result word aligned. Submitted by: Paul B Mahol Committed by: rpaulo Modified: stable/7/sys/net80211/ieee80211_ioctl.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/net80211/ieee80211_ioctl.h ============================================================================== --- stable/7/sys/net80211/ieee80211_ioctl.h Sun Nov 21 10:58:18 2010 (r215618) +++ stable/7/sys/net80211/ieee80211_ioctl.h Sun Nov 21 10:58:37 2010 (r215619) @@ -530,7 +530,7 @@ struct ieee80211req_scan_result { uint16_t isr_flags; /* channel flags */ int8_t isr_noise; int8_t isr_rssi; - uint8_t isr_intval; /* beacon interval */ + uint16_t isr_intval; /* beacon interval */ uint8_t isr_capinfo; /* capabilities */ uint8_t isr_erp; /* ERP element */ uint8_t isr_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 12:33:11 2010 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 8F7731065672; Sun, 21 Nov 2010 12:33:11 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD4B8FC13; Sun, 21 Nov 2010 12:33:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALCXBHr056514; Sun, 21 Nov 2010 12:33:11 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALCXBqU056512; Sun, 21 Nov 2010 12:33:11 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201011211233.oALCXBqU056512@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 21 Nov 2010 12:33:11 +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: r215627 - stable/7/sys/net80211 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: Sun, 21 Nov 2010 12:33:11 -0000 Author: bschmidt Date: Sun Nov 21 12:33:11 2010 New Revision: 215627 URL: http://svn.freebsd.org/changeset/base/215627 Log: Revert r215619, ABI breakage ahead. Pointy hat to: me Modified: stable/7/sys/net80211/ieee80211_ioctl.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/net80211/ieee80211_ioctl.h ============================================================================== --- stable/7/sys/net80211/ieee80211_ioctl.h Sun Nov 21 12:32:35 2010 (r215626) +++ stable/7/sys/net80211/ieee80211_ioctl.h Sun Nov 21 12:33:11 2010 (r215627) @@ -530,7 +530,7 @@ struct ieee80211req_scan_result { uint16_t isr_flags; /* channel flags */ int8_t isr_noise; int8_t isr_rssi; - uint16_t isr_intval; /* beacon interval */ + uint8_t isr_intval; /* beacon interval */ uint8_t isr_capinfo; /* capabilities */ uint8_t isr_erp; /* ERP element */ uint8_t isr_bssid[IEEE80211_ADDR_LEN]; From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 13:11:51 2010 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 2FC25106566C; Sun, 21 Nov 2010 13:11:51 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E0CF8FC14; Sun, 21 Nov 2010 13:11:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALDBpfP057714; Sun, 21 Nov 2010 13:11:51 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALDBpsf057712; Sun, 21 Nov 2010 13:11:51 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011211311.oALDBpsf057712@svn.freebsd.org> From: Bruce Cran Date: Sun, 21 Nov 2010 13:11:50 +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: r215632 - stable/7/sys/boot/i386/boot2 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: Sun, 21 Nov 2010 13:11:51 -0000 Author: brucec Date: Sun Nov 21 13:11:50 2010 New Revision: 215632 URL: http://svn.freebsd.org/changeset/base/215632 Log: MFC r215284, r215285: When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0. This is the same change that was made in rev 1.33 of boot/i386/btx/btx.S. PR: i386/91871 Submitted by: Bjorn Konig Modified: stable/7/sys/boot/i386/boot2/boot1.S 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/boot/i386/boot2/boot1.S ============================================================================== --- stable/7/sys/boot/i386/boot2/boot1.S Sun Nov 21 13:04:53 2010 (r215631) +++ stable/7/sys/boot/i386/boot2/boot1.S Sun Nov 21 13:11:50 2010 (r215632) @@ -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. */ From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 13:22:06 2010 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 0334D106566B; Sun, 21 Nov 2010 13:22:06 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3B788FC14; Sun, 21 Nov 2010 13:22:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALDM59w058125; Sun, 21 Nov 2010 13:22:05 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALDM5TJ058118; Sun, 21 Nov 2010 13:22:05 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011211322.oALDM5TJ058118@svn.freebsd.org> From: Bruce Cran Date: Sun, 21 Nov 2010 13:22:05 +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: r215634 - stable/7/usr.sbin/sysinstall 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: Sun, 21 Nov 2010 13:22:06 -0000 Author: brucec Date: Sun Nov 21 13:22:05 2010 New Revision: 215634 URL: http://svn.freebsd.org/changeset/base/215634 Log: MFC r215286: Connect to ftp2.tr.freebsd.org when the Turkey #2 mirror is selected. PR: bin/128587 Submitted by: Mehmet Kose MFC r215287: "Web" should not be all upper-case because it's not an acronym. PR: bin/130366 Submitted by: Royce Williams MFC r215290: ntpdate(8) hosts are now configured in rc.conf via ntpdate_hosts. PR: bin/148350 Submitted by: Joel FAEDI MFC r215296: Fix use of CD_VERSION=any in cdrom.inf by calling strcmp instead of variable_cmp. PR: bin/142960 Submitted by: G. Paul Ziemba Modified: stable/7/usr.sbin/sysinstall/cdrom.c stable/7/usr.sbin/sysinstall/config.c stable/7/usr.sbin/sysinstall/install.c stable/7/usr.sbin/sysinstall/menus.c stable/7/usr.sbin/sysinstall/sysinstall.8 stable/7/usr.sbin/sysinstall/sysinstall.h Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/cdrom.c ============================================================================== --- stable/7/usr.sbin/sysinstall/cdrom.c Sun Nov 21 13:20:14 2010 (r215633) +++ stable/7/usr.sbin/sysinstall/cdrom.c Sun Nov 21 13:22:05 2010 (r215634) @@ -142,7 +142,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" Modified: stable/7/usr.sbin/sysinstall/config.c ============================================================================== --- stable/7/usr.sbin/sysinstall/config.c Sun Nov 21 13:20:14 2010 (r215633) +++ stable/7/usr.sbin/sysinstall/config.c Sun Nov 21 13:22:05 2010 (r215634) @@ -491,14 +491,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); } Modified: stable/7/usr.sbin/sysinstall/install.c ============================================================================== --- stable/7/usr.sbin/sysinstall/install.c Sun Nov 21 13:20:14 2010 (r215633) +++ stable/7/usr.sbin/sysinstall/install.c Sun Nov 21 13:22:05 2010 (r215634) @@ -718,7 +718,7 @@ nodisks: 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); } Modified: stable/7/usr.sbin/sysinstall/menus.c ============================================================================== --- stable/7/usr.sbin/sysinstall/menus.c Sun Nov 21 13:20:14 2010 (r215633) +++ stable/7/usr.sbin/sysinstall/menus.c Sun Nov 21 13:22:05 2010 (r215634) @@ -766,7 +766,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" }, @@ -1297,7 +1297,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.", @@ -1356,456 +1356,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 } }, }; Modified: stable/7/usr.sbin/sysinstall/sysinstall.8 ============================================================================== --- stable/7/usr.sbin/sysinstall/sysinstall.8 Sun Nov 21 13:20:14 2010 (r215633) +++ stable/7/usr.sbin/sysinstall/sysinstall.8 Sun Nov 21 13:22:05 2010 (r215634) @@ -218,10 +218,10 @@ Configure host as a user of the Network .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. Modified: stable/7/usr.sbin/sysinstall/sysinstall.h ============================================================================== --- stable/7/usr.sbin/sysinstall/sysinstall.h Sun Nov 21 13:20:14 2010 (r215633) +++ stable/7/usr.sbin/sysinstall/sysinstall.h Sun Nov 21 13:22:05 2010 (r215634) @@ -171,7 +171,7 @@ #define VAR_NOVELL "novell" #define VAR_OSF1_ENABLE "osf1_enable" #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" From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 17:12:27 2010 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 864A3106566C; Sun, 21 Nov 2010 17:12:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2468FC1A; Sun, 21 Nov 2010 17:12:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALHCRsN063156; Sun, 21 Nov 2010 17:12:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALHCREr063155; Sun, 21 Nov 2010 17:12:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011211712.oALHCREr063155@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 21 Nov 2010 17:12:27 +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: r215638 - stable/7/bin/sh/bltin 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: Sun, 21 Nov 2010 17:12:27 -0000 Author: jilles Date: Sun Nov 21 17:12:27 2010 New Revision: 215638 URL: http://svn.freebsd.org/changeset/base/215638 Log: MFC r215184: sh: Remove unused man page for echo builtin. The information in sh(1) about the echo builtin is equivalent, though less extensive. The echo(1) man page (bin/echo/echo.1) is different. Unfortunately, sh's echo builtin and /bin/echo have gone out of sync and this probably cannot be fixed any more. Deleted: stable/7/bin/sh/bltin/echo.1 Modified: Directory Properties: stable/7/bin/sh/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Sun Nov 21 17:14:23 2010 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 2992D10656A6; Sun, 21 Nov 2010 17:14:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1805F8FC13; Sun, 21 Nov 2010 17:14:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oALHEMsw063239; Sun, 21 Nov 2010 17:14:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oALHEMI8063237; Sun, 21 Nov 2010 17:14:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201011211714.oALHEMI8063237@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 21 Nov 2010 17:14:22 +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: r215639 - stable/7/bin/echo 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: Sun, 21 Nov 2010 17:14:23 -0000 Author: jilles Date: Sun Nov 21 17:14:22 2010 New Revision: 215639 URL: http://svn.freebsd.org/changeset/base/215639 Log: MFC r215211: echo(1): Clarify portability and mention literal "--" handling. Modified: stable/7/bin/echo/echo.1 Directory Properties: stable/7/bin/echo/ (props changed) Modified: stable/7/bin/echo/echo.1 ============================================================================== --- stable/7/bin/echo/echo.1 Sun Nov 21 17:12:27 2010 (r215638) +++ stable/7/bin/echo/echo.1 Sun Nov 21 17:14:22 2010 (r215639) @@ -32,7 +32,7 @@ .\" @(#)echo.1 8.1 (Berkeley) 7/22/93 .\" $FreeBSD$ .\" -.Dd April 12, 2003 +.Dd November 12, 2010 .Dt ECHO 1 .Os .Sh NAME @@ -56,24 +56,37 @@ The following option is available: .Bl -tag -width flag .It Fl n Do not print the trailing newline character. -This may also be achieved by appending +.El +.Pp +The end-of-options marker +.Fl Fl +is not recognized and written literally. +.Pp +The newline may also be suppressed by appending .Ql \ec to the end of the string, as is done by iBCS2 compatible systems. -Note that this option as well as the effect of +Note that the +.Fl n +option as well as the effect of .Ql \ec are implementation-defined in .St -p1003.1-2001 as amended by Cor.\& 1-2002. -Applications aiming for maximum -portability are strongly encouraged to use +For portability, +.Nm +should only be used if the first argument does not start with a hyphen +.Pq Ql "-" +and does not contain any backslashes +.Pq Ql "\e" . +If this is not sufficient, .Xr printf 1 -to suppress the newline character. -.El +should be used. .Pp -Some shells may provide a builtin +Most shells provide a builtin .Nm -command which is similar or identical to this utility. +command which tends to differ from this utility +in the treatment of options and backslashes. Consult the .Xr builtin 1 manual page. From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 22 00:12:24 2010 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 9C98D106566B; Mon, 22 Nov 2010 00:12:24 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 706148FC18; Mon, 22 Nov 2010 00:12:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAM0COIZ072038; Mon, 22 Nov 2010 00:12:24 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAM0CO4F072036; Mon, 22 Nov 2010 00:12:24 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201011220012.oAM0CO4F072036@svn.freebsd.org> From: Doug Barton Date: Mon, 22 Nov 2010 00:12:24 +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: r215646 - stable/7/share/man/man5 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: Mon, 22 Nov 2010 00:12:24 -0000 Author: dougb Date: Mon Nov 22 00:12:24 2010 New Revision: 215646 URL: http://svn.freebsd.org/changeset/base/215646 Log: MFC 215250: Remove references to the long-gone ramdisk Submitted by: Garrett Cooper Modified: stable/7/share/man/man5/rc.conf.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Mon Nov 22 00:10:14 2010 (r215645) +++ stable/7/share/man/man5/rc.conf.5 Mon Nov 22 00:12:24 2010 (r215646) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 4, 2010 +.Dd November 13, 2010 .Dt RC.CONF 5 .Os .Sh NAME @@ -3996,65 +3996,6 @@ one could set the following: .Bd -literal mdconfig_md0_cmd="tar xfzC /var/file.tgz \e${_mp}" .Ed -.It Va ramdisk_units -.Pq Vt str -A list of one or more ramdisk units to configure with -.Xr mdconfig 8 -and -.Xr newfs 8 -in time to be mounted from -.Xr fstab 5 . -Each listed unit -.Ar X -must specify at least a -.Ar type -in a -.Va ramdisk_ Ns Ao Ar X Ac Ns Va _config -variable. -Note that this way to configure ramdisks has been deprecated -in favor of new -.Va mdconfig_md* -variables (see above). -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _config -.Pq Vt str -Arguments to -.Xr mdconfig 8 -for ramdisk -.Ar X . -At minimum a -.Fl t Ar type -must be specified, where -.Ar type -must be one of -.Cm malloc -or -.Cm swap . -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _newfs -.Pq Vt str -Optional arguments passed to -.Xr newfs 8 -to initialize ramdisk -.Ar X . -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _owner -.Pq Vt str -An ownership specification passed to -.Xr chown 8 -after the specified ramdisk unit -.Ar X -has been mounted. -Both the -.Xr md 4 -device and the mount point will be changed. -.It Va ramdisk_ Ns Ao Ar X Ac Ns Va _perms -.Pq Vt str -A mode string passed to -.Xr chmod 1 -after the specified ramdisk unit -.Ar X -has been mounted. -Both the -.Xr md 4 -device and the mount point will be changed. .It Va autobridge_interfaces .Pq Vt str Set to the list of bridge interfaces that will have newly arriving interfaces From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 22 00:44:44 2010 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 F2EEC1065670; Mon, 22 Nov 2010 00:44:43 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE4148FC0C; Mon, 22 Nov 2010 00:44:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAM0ihri073066; Mon, 22 Nov 2010 00:44:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAM0ihDw073055; Mon, 22 Nov 2010 00:44:43 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201011220044.oAM0ihDw073055@svn.freebsd.org> From: Doug Barton Date: Mon, 22 Nov 2010 00:44:43 +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: r215648 - in stable/7: share/doc/papers/jail share/doc/smm/01.setup share/man/man8 sys/dev/firewire sys/dev/tdfx usr.sbin/config/SMM.doc 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: Mon, 22 Nov 2010 00:44:44 -0000 Author: dougb Date: Mon Nov 22 00:44:43 2010 New Revision: 215648 URL: http://svn.freebsd.org/changeset/base/215648 Log: MFC 215334: Remove references to MAKEDEV(8) Deleted: stable/7/share/man/man8/MAKEDEV.8 Modified: stable/7/share/doc/papers/jail/mgt.ms stable/7/share/doc/smm/01.setup/2.t stable/7/share/doc/smm/01.setup/4.t stable/7/share/doc/smm/01.setup/5.t stable/7/share/doc/smm/01.setup/spell.ok stable/7/share/man/man8/Makefile stable/7/sys/dev/firewire/00README stable/7/sys/dev/tdfx/tdfx_pci.c stable/7/usr.sbin/config/SMM.doc/6.t stable/7/usr.sbin/config/SMM.doc/spell.ok Directory Properties: stable/7/share/doc/papers/jail/ (props changed) stable/7/share/doc/smm/01.setup/ (props changed) stable/7/share/man/man8/ (props changed) 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) stable/7/usr.sbin/config/SMM.doc/ (props changed) Modified: stable/7/share/doc/papers/jail/mgt.ms ============================================================================== --- stable/7/share/doc/papers/jail/mgt.ms Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/share/doc/papers/jail/mgt.ms Mon Nov 22 00:44:43 2010 (r215648) @@ -56,8 +56,6 @@ FreeBSD build environment. .PP One notable difference from the default FreeBSD install is that only a limited set of device nodes should be created. -MAKEDEV(8) has been modified to accept a ``jail'' argument that creates -the correct set of nodes. .PP To improve storage efficiency, a fair number of the binaries in the system tree may be deleted, as they are not relevant in a jail environment. Modified: stable/7/share/doc/smm/01.setup/2.t ============================================================================== --- stable/7/share/doc/smm/01.setup/2.t Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/share/doc/smm/01.setup/2.t Mon Nov 22 00:44:43 2010 (r215648) @@ -482,13 +482,7 @@ lw(2i) l. \fB#\fP \fImount_mfs -s 1000 -T type /dev/null /tmp\fP (create a writable filesystem) (\fItype\fP is the disk type as determined from /etc/disktab) \fB#\fP \fIcd /tmp\fP (connect to that directory) -\fB#\fP \fI../dev/MAKEDEV \*(Dk#\fP (create special files for root disk) -(\fI\*(Dk\fP is the disk type, \fI#\fP is the unit number) -(ignore warning from ``sh'') \fB#\fP \fImount \-uw /tmp/\*(Dk#a /\fP (read-write mount root filesystem) -\fB#\fP \fIcd /dev\fP (go to device directory) -\fB#\fP \fI./MAKEDEV \*(Dk#\fP (create permanent special files for root disk) -(again, ignore warning from ``sh'') .TE .DE .Sh 4 "Step 4: (optional) restoring the root filesystem" @@ -513,8 +507,6 @@ To really create the root filesystem on you should first label the disk as described in step 5 below. Then run the following commands: .DS -\fB#\fP \fIcd /dev\fP -\fB#\fP \fI./MAKEDEV \*(Dk1a\fP \fB#\fP\|\fInewfs /dev/r\*(Dk1a\fP \fB#\fP\|\fImount /dev/\*(Dk1a /mnt\fP \fB#\fP\|\fIcd /mnt\fP @@ -1393,8 +1385,6 @@ To make the .Pn /var filesystem we would do: .DS -\fB#\fP \fIcd /dev\fP -\fB#\fP \fIMAKEDEV \*(Dk1\fP \fB#\fP \fIdisklabel -wr \*(Dk1 "disk type" "disk name"\fP \fB#\fP \fInewfs \*(Dk1f\fP (information about filesystem prints out) Modified: stable/7/share/doc/smm/01.setup/4.t ============================================================================== --- stable/7/share/doc/smm/01.setup/4.t Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/share/doc/smm/01.setup/4.t Mon Nov 22 00:44:43 2010 (r215648) @@ -30,6 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)4.t 8.1 (Berkeley) 7/29/93 +.\" $FreeBSD$ .\" .ds LH "Installing/Operating \*(4B .ds CF \*(Dy @@ -152,38 +153,11 @@ directory. For all the devices supported by the distribution system, the files in .Pn /dev -are created by the -.Pn /dev/MAKEDEV -shell script. +are created by devfs. .PP Determine the set of devices that you have and create a new .Pn /dev -directory by running the MAKEDEV script. -First create a new directory -.Pn /newdev , -copy MAKEDEV into it, edit the file MAKEDEV.local -to provide an entry for local needs, -and run it to generate a -.Pn /newdev directory. -For instance, -.DS -\fB#\fP \fIcd /\fP -\fB#\fP \fImkdir newdev\fP -\fB#\fP \fIcp dev/MAKEDEV newdev/MAKEDEV\fP -\fB#\fP \fIcd newdev\fP -\fB#\fP \fIMAKEDEV \*(Dk0 pt0 std LOCAL\fP -.DE -Note the ``std'' argument causes standard devices such as -.Pn /dev/console , -the machine console, to be created. -.PP -You can then do -.DS -\fB#\fP \fIcd /\fP -\fB#\fP \fImv dev olddev ; mv newdev dev\fP -\fB#\fP \fIsync\fP -.DE -to install the new device directory. +directory by mounting devfs. .Sh 3 "Building new system images" .PP The kernel configuration of each UNIX system is described by @@ -232,8 +206,8 @@ the file must be edited. .PP To add a new terminal device, be sure the device is configured into the system -and that the special files for the device have been made by -.Pn /dev/MAKEDEV . +and that the special files for the device exist in +.Pn /dev . Then, enable the appropriate lines of .Pn /etc/ttys by setting the ``status'' @@ -335,9 +309,6 @@ Finally note that you should change the terminals to ttyd? where ? is in [0-9a-zA-Z], as some programs use this property of the names to determine if a terminal is a dialup. -Shell commands to do this should be put in the -.Pn /dev/MAKEDEV.local -script. .PP While it is possible to use truly arbitrary strings for terminal names, the accounting and noticeably the Modified: stable/7/share/doc/smm/01.setup/5.t ============================================================================== --- stable/7/share/doc/smm/01.setup/5.t Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/share/doc/smm/01.setup/5.t Mon Nov 22 00:44:43 2010 (r215648) @@ -30,6 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)5.t 8.1 (Berkeley) 7/27/93 +.\" $FreeBSD$ .\" .ds lq `` .ds rq '' @@ -111,35 +112,6 @@ translations for machines that do not pa command. Additional information is provided in the manual page describing .Xr ESIS (4). -.PP -To use the pseudo terminals just configured, device -entries must be created in the -.Pn /dev -directory. To create 32 -pseudo terminals (plenty, unless you have a heavy network load) -execute the following commands. -.DS -\fB#\fP \fIcd /dev\fP -\fB#\fP \fIMAKEDEV pty0 pty1\fP -.DE -More pseudo terminals may be made by specifying -.Pn pty2 , -.Pn pty3 , -etc. The kernel normally includes support for 32 pseudo terminals -unless the configuration file specifies a different number. -Each pseudo terminal really consists of two files in -.Pn /dev : -a master and a slave. The master pseudo terminal file is named -.Pn /dev/ptyp? , -while the slave side is -.Pn /dev/ttyp? . -Pseudo terminals are also used by several programs not related to the network. -In addition to creating the pseudo terminals, -be sure to install them in the -.Pn /etc/ttys -file (with a `none' in the second column so no -.Xr getty -is started). .Sh 2 "Local subnets" .PP In \*(4B the Internet support Modified: stable/7/share/doc/smm/01.setup/spell.ok ============================================================================== --- stable/7/share/doc/smm/01.setup/spell.ok Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/share/doc/smm/01.setup/spell.ok Mon Nov 22 00:44:43 2010 (r215648) @@ -1,3 +1,4 @@ +# $FreeBSD$ A1096A AA ACU @@ -91,7 +92,6 @@ LK201 LOGFILE Leffler Luna -MAKEDEV.local MB MC68040 MFS Modified: stable/7/share/man/man8/Makefile ============================================================================== --- stable/7/share/man/man8/Makefile Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/share/man/man8/Makefile Mon Nov 22 00:44:43 2010 (r215648) @@ -4,7 +4,6 @@ MAN= crash.8 \ diskless.8 \ intro.8 \ - MAKEDEV.8 \ nanobsd.8 \ picobsd.8 \ rc.8 \ Modified: stable/7/sys/dev/firewire/00README ============================================================================== --- stable/7/sys/dev/firewire/00README Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/sys/dev/firewire/00README Mon Nov 22 00:44:43 2010 (r215648) @@ -44,10 +44,6 @@ IEEE 1394 support for FreeBSD-5.X and 4. - make install - make load - For FreeBSD-4 user: - - - ./MAKEDEV - 3. SBP-II support (sbp) - You need CAM(SCSI) support in your kernel. Modified: stable/7/sys/dev/tdfx/tdfx_pci.c ============================================================================== --- stable/7/sys/dev/tdfx/tdfx_pci.c Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/sys/dev/tdfx/tdfx_pci.c Mon Nov 22 00:44:43 2010 (r215648) @@ -250,7 +250,7 @@ tdfx_attach(device_t dev) { /* * make_dev registers the cdev to access the 3dfx card from /dev * use hex here for the dev num, simply to provide better support if > 10 - * voodoo cards, for the mad. The user must set the link, or use MAKEDEV. + * voodoo cards, for the mad. The user must set the link. * Why would we want that many voodoo cards anyhow? */ tdfx_info->devt = make_dev(&tdfx_cdev, device_get_unit(dev), Modified: stable/7/usr.sbin/config/SMM.doc/6.t ============================================================================== --- stable/7/usr.sbin/config/SMM.doc/6.t Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/usr.sbin/config/SMM.doc/6.t Mon Nov 22 00:44:43 2010 (r215648) @@ -30,6 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)6.t 8.1 (Berkeley) 6/8/93 +.\" $FreeBSD$ .\" .\".ds RH "Adding New Devices .ne 2i @@ -230,10 +231,3 @@ Remember that the position in the device table specifies the major device number. The block major number is needed in the ``devices.machine'' file if the device is a disk. -.PP -With the configuration information in place, your configuration -file appropriately modified, and a system reconfigured and rebooted -you should incorporate the shell commands needed to install the special -files in the file system to the file ``/dev/MAKEDEV'' or -``/dev/MAKEDEV.local''. This is discussed in the document ``Installing -and Operating 4.4BSD''. Modified: stable/7/usr.sbin/config/SMM.doc/spell.ok ============================================================================== --- stable/7/usr.sbin/config/SMM.doc/spell.ok Mon Nov 22 00:31:52 2010 (r215647) +++ stable/7/usr.sbin/config/SMM.doc/spell.ok Mon Nov 22 00:44:43 2010 (r215648) @@ -1,3 +1,4 @@ +# $FreeBSD$ ACC ANSEL ARP @@ -38,8 +39,6 @@ Info Karels LH Leffler -MAKEDEV -MAKEDEV.local MASSBUS MAXDSIZ MAXTSIZ From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 22 07:17:27 2010 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 90336106566B; Mon, 22 Nov 2010 07:17:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8FB8FC19; Mon, 22 Nov 2010 07:17:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAM7HRra081745; Mon, 22 Nov 2010 07:17:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAM7HRf4081742; Mon, 22 Nov 2010 07:17:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201011220717.oAM7HRf4081742@svn.freebsd.org> From: Alan Cox Date: Mon, 22 Nov 2010 07:17:27 +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: r215659 - in stable/7: share/man/man9 sys/vm 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: Mon, 22 Nov 2010 07:17:27 -0000 Author: alc Date: Mon Nov 22 07:17:27 2010 New Revision: 215659 URL: http://svn.freebsd.org/changeset/base/215659 Log: MFC r204415, r204416, r209669 Improve the comment and man page for vm_page_alloc(). Modified: stable/7/share/man/man9/vm_page_alloc.9 stable/7/sys/vm/vm_page.c Directory Properties: stable/7/share/man/man9/ (props changed) 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/share/man/man9/vm_page_alloc.9 ============================================================================== --- stable/7/share/man/man9/vm_page_alloc.9 Mon Nov 22 07:00:47 2010 (r215658) +++ stable/7/share/man/man9/vm_page_alloc.9 Mon Nov 22 07:17:27 2010 (r215659) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 13, 2001 +.Dd July 3, 2010 .Dt VM_PAGE_ALLOC 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .In vm/vm.h .In vm/vm_page.h .Ft vm_page_t -.Fn vm_page_alloc "vm_object_t object" "vm_pindex_t pindex" "int page_req" +.Fn vm_page_alloc "vm_object_t object" "vm_pindex_t pindex" "int req" .Sh DESCRIPTION The .Fn vm_page_alloc @@ -48,46 +48,75 @@ within .Fa object . It is assumed that a page has not already been allocated at .Fa pindex . -The page returned is inserted into the object, but is not inserted -into the pmap. +The page returned is inserted into the object, unless +.Dv VM_ALLOC_NOOBJ +is specified in the +.Fa req . +The page may exist in the vm object cache, in which case it will +be reactivated instead, moving from the cache into the object page list. .Pp .Fn vm_page_alloc -will not block. +will not sleep. .Pp Its arguments are: -.Bl -tag -width ".Fa page_req" +.Bl -tag -width ".Fa object" .It Fa object The VM object to allocate the page for. +The +.Fa object +must be locked if +.Dv VM_ALLOC_NOOBJ +is not specified. .It Fa pindex The index into the object at which the page should be inserted. -.It Fa page_req -A flag indicating how the page should be allocated. +.It Fa req +The bitwise-inclusive OR of a class and any optional flags indicating +how the page should be allocated. +.Pp +Exactly one of the following classes must be specified: .Bl -tag -width ".Dv VM_ALLOC_INTERRUPT" .It Dv VM_ALLOC_NORMAL The page should be allocated with no special treatment. .It Dv VM_ALLOC_SYSTEM -The page can be allocated if the cache queue is empty and the free +The page can be allocated if the cache is empty and the free page count is above the interrupt reserved water mark. -If -.Dv VM_ALLOC_INTERRUPT -is set, the page can be allocated as long as the free page count is -greater than zero. This flag should be used only when the system really needs the page. .It Dv VM_ALLOC_INTERRUPT .Fn vm_page_alloc -is being called during an interrupt and therefore the cache cannot -be accessed. -The page will only be returned successfully if the free count is greater +is being called during an interrupt. +A page will be returned successfully if the free page count is greater than zero. +.El +.Pp +The optional flags are: +.Bl -tag -width ".Dv VM_ALLOC_IFNOTCACHED" .It Dv VM_ALLOC_ZERO Indicate a preference for a pre-zeroed page. -There is no guarantee that the page thus returned will be zeroed, but -it will be marked as such. +There is no guarantee that the returned page will be zeroed, but it +will have the +.Dv PG_ZERO +flag set if it is zeroed. .It Dv VM_ALLOC_NOOBJ -The page is associated with an unmanaged memory region, that is, there -is no backing VM object. -This is typically used to allocate pages within the kernel virtual -address space. +Do not associate the allocated page with a vm object. +The +.Fa object +argument is ignored. +.It Dv VM_ALLOC_NOBUSY +The returned page will not have the +.Dv VPO_BUSY +flag set. +.It Dv VM_ALLOC_WIRED +The returned page will be wired. +.It Dv VM_ALLOC_IFCACHED +Allocate the page only if it is cached. +Otherwise, return +.Dv NULL . +.It Dv VM_ALLOC_IFNOTCACHED +Only allocate the page if it is not cached in the +.Fa object . +If the page at the specified +.Fa pindex +is cached, NULL is returned instead. .El .El .Sh RETURN VALUES Modified: stable/7/sys/vm/vm_page.c ============================================================================== --- stable/7/sys/vm/vm_page.c Mon Nov 22 07:00:47 2010 (r215658) +++ stable/7/sys/vm/vm_page.c Mon Nov 22 07:17:27 2010 (r215659) @@ -1037,13 +1037,23 @@ vm_page_cache_transfer(vm_object_t orig_ * Allocate and return a memory cell associated * with this VM object/offset pair. * - * page_req classes: + * The caller must always specify an allocation class. + * + * allocation classes: * VM_ALLOC_NORMAL normal process request * VM_ALLOC_SYSTEM system *really* needs a page * VM_ALLOC_INTERRUPT interrupt time request - * VM_ALLOC_ZERO zero page * - * This routine may not block. + * optional allocation flags: + * VM_ALLOC_ZERO prefer a zeroed page + * VM_ALLOC_WIRED wire the allocated page + * VM_ALLOC_NOOBJ page is not associated with a vm object + * VM_ALLOC_NOBUSY do not set the page busy + * VM_ALLOC_IFCACHED return page only if it is cached + * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page + * is cached + * + * This routine may not sleep. */ vm_page_t vm_page_alloc(vm_object_t object, vm_pindex_t pindex, int req) From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 22 09:34:38 2010 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 9792C106564A; Mon, 22 Nov 2010 09:34:38 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 856DC8FC14; Mon, 22 Nov 2010 09:34:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAM9YcYM085150; Mon, 22 Nov 2010 09:34:38 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAM9YcFU085148; Mon, 22 Nov 2010 09:34:38 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011220934.oAM9YcFU085148@svn.freebsd.org> From: Brian Somers Date: Mon, 22 Nov 2010 09:34: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: r215668 - stable/7/sbin/fdisk 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: Mon, 22 Nov 2010 09:34:38 -0000 Author: brian Date: Mon Nov 22 09:34:38 2010 New Revision: 215668 URL: http://svn.freebsd.org/changeset/base/215668 Log: MFC r212247 & r212724 from head: Handle geli-encrypted root disk devices. Add support for identifying a journaled root filesystem. Fix support for identifying the given /dev/vinum/root example. Modified: stable/7/sbin/fdisk/fdisk.c Directory Properties: stable/7/sbin/fdisk/ (props changed) Modified: stable/7/sbin/fdisk/fdisk.c ============================================================================== --- stable/7/sbin/fdisk/fdisk.c Mon Nov 22 09:32:54 2010 (r215667) +++ stable/7/sbin/fdisk/fdisk.c Mon Nov 22 09:34:38 2010 (r215668) @@ -1492,6 +1492,8 @@ sanitize_partition(struct dos_partition * /dev/ad0s1a => /dev/ad0 * /dev/da0a => /dev/da0 * /dev/vinum/root => /dev/vinum/root + * A ".eli" part is removed if it exists (see geli(8)). + * A ".journal" ending is removed if it exists (see gjournal(8)). */ static char * get_rootdisk(void) @@ -1500,16 +1502,20 @@ get_rootdisk(void) regex_t re; #define NMATCHES 2 regmatch_t rm[NMATCHES]; - char *s; + char dev[PATH_MAX], *s; int rv; if (statfs("/", &rootfs) == -1) err(1, "statfs(\"/\")"); - if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]+)([sp][0-9]+)?[a-h]?$", + if ((rv = regcomp(&re, "^(/dev/[a-z/]+[0-9]*)([sp][0-9]+)?[a-h]?(\\.journal)?$", REG_EXTENDED)) != 0) errx(1, "regcomp() failed (%d)", rv); - if ((rv = regexec(&re, rootfs.f_mntfromname, NMATCHES, rm, 0)) != 0) + strlcpy(dev, rootfs.f_mntfromname, sizeof (dev)); + if ((s = strstr(dev, ".eli")) != NULL) + memmove(s, s+4, strlen(s + 4) + 1); + + if ((rv = regexec(&re, dev, NMATCHES, rm, 0)) != 0) errx(1, "mounted root fs resource doesn't match expectations (regexec returned %d)", rv); From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 22 16:10:54 2010 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 C7D81106566B; Mon, 22 Nov 2010 16:10:54 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B62A78FC08; Mon, 22 Nov 2010 16:10:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAMGAscu097136; Mon, 22 Nov 2010 16:10:54 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAMGAsf0097134; Mon, 22 Nov 2010 16:10:54 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201011221610.oAMGAsf0097134@svn.freebsd.org> From: Ken Smith Date: Mon, 22 Nov 2010 16:10:54 +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: r215685 - 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: Mon, 22 Nov 2010 16:10:54 -0000 Author: kensmith Date: Mon Nov 22 16:10:54 2010 New Revision: 215685 URL: http://svn.freebsd.org/changeset/base/215685 Log: We're a bit under a week from Code Freeze for the upcoming 7.4-RELEASE cycle. Warn people tracking stable/7 that the branch may be more active than usual. Modified: stable/7/sys/conf/newvers.sh Modified: stable/7/sys/conf/newvers.sh ============================================================================== --- stable/7/sys/conf/newvers.sh Mon Nov 22 16:09:57 2010 (r215684) +++ stable/7/sys/conf/newvers.sh Mon Nov 22 16:10:54 2010 (r215685) @@ -31,8 +31,8 @@ # $FreeBSD$ TYPE="FreeBSD" -REVISION="7.3" -BRANCH="STABLE" +REVISION="7.4" +BRANCH="PRERELEASE" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-stable-7@FreeBSD.ORG Mon Nov 22 21:22:08 2010 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 C4BF5106564A; Mon, 22 Nov 2010 21:22:08 +0000 (UTC) (envelope-from mlaier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2E598FC0A; Mon, 22 Nov 2010 21:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAMLM8x7006394; Mon, 22 Nov 2010 21:22:08 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAMLM8HS006392; Mon, 22 Nov 2010 21:22:08 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <201011222122.oAMLM8HS006392@svn.freebsd.org> From: Max Laier Date: Mon, 22 Nov 2010 21:22:08 +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: r215715 - stable/7/sys/vm 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: Mon, 22 Nov 2010 21:22:08 -0000 Author: mlaier Date: Mon Nov 22 21:22:08 2010 New Revision: 215715 URL: http://svn.freebsd.org/changeset/base/215715 Log: MFH r215508: Off by one page in vm_reserv_reclaim_contig(): reclaim reservations with only a single free page as well. Reviewed by: alc Modified: stable/7/sys/vm/vm_reserv.c 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/vm/vm_reserv.c ============================================================================== --- stable/7/sys/vm/vm_reserv.c Mon Nov 22 21:20:11 2010 (r215714) +++ stable/7/sys/vm/vm_reserv.c Mon Nov 22 21:22:08 2010 (r215715) @@ -659,7 +659,8 @@ vm_reserv_reclaim_contig(vm_paddr_t size ((pa ^ (pa + size - 1)) & ~(boundary - 1)) != 0) pa_length = 0; - } else if (pa_length >= size) { + } + if (pa_length >= size) { vm_reserv_reclaim(rv); return (TRUE); } From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 01:32:45 2010 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 9ED3A106566B; Tue, 23 Nov 2010 01:32:45 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F59C8FC0C; Tue, 23 Nov 2010 01:32:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAN1WjSC012688; Tue, 23 Nov 2010 01:32:45 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAN1Wjfo012686; Tue, 23 Nov 2010 01:32:45 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201011230132.oAN1Wjfo012686@svn.freebsd.org> From: Kirk McKusick Date: Tue, 23 Nov 2010 01:32:45 +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: r215729 - stable/7/sbin/newfs 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: Tue, 23 Nov 2010 01:32:45 -0000 Author: mckusick Date: Tue Nov 23 01:32:44 2010 New Revision: 215729 URL: http://svn.freebsd.org/changeset/base/215729 Log: MFC of 213119 Reported problem: Large (60GB) filesystems created using "newfs -U -O 1 -b 65536 -f 8192" show incorrect results from "df" for free and used space when mounted immediately after creation. fsck on the new filesystem (before ever mounting it once) gives a "SUMMARY INFORMATION BAD" error in phase 5. This error hasn't occurred in any runs of fsck immediately after "newfs -U -b 65536 -f 8192" (leaving out the "-O 1" option). Solution: The default UFS1 superblock is located at offset 8K in the filesystem partition; the default UFS2 superblock is located at offset 64K in the filesystem partition. For UFS1 filesystems with a blocksize of 64K, the first alternate superblock resides at 64K which is the the location used for the default UFS2 superblock. By default, the system first checks for a valid superblock at the default location for a UFS2 filoesystem. For a UFS1 filesystem with a blocksize of 64K, there is a valid UFS1 superblock at this location. Thus, even though it is expected to be a backup superblock, the system will use it as its default superblock. So, we have to ensure that all the statistcs on usage are correct in this first alternate superblock as it is the superblock that will actually be used. While tracking down this problem, another limitation of UFS1 became evident. For UFS1, the number of inodes per cylinder group is stored in an int16_t. Thus the maximum number of inodes per cylinder group is limited to 2^15 - 1. This limit can easily be exceeded for block sizes of 32K and above. Thus when building UFS1 filesystems, newfs must limit the number of inodes per cylinder group to 2^15 - 1. Reported by: Guy Helmer Followup by: Bruce Cran PR: 107692 Modified: stable/7/sbin/newfs/mkfs.c Directory Properties: stable/7/sbin/newfs/ (props changed) Modified: stable/7/sbin/newfs/mkfs.c ============================================================================== --- stable/7/sbin/newfs/mkfs.c Tue Nov 23 01:24:27 2010 (r215728) +++ stable/7/sbin/newfs/mkfs.c Tue Nov 23 01:32:44 2010 (r215729) @@ -367,16 +367,20 @@ restart: * Start packing more blocks into the cylinder group until * it cannot grow any larger, the number of cylinder groups * drops below MINCYLGRPS, or we reach the size requested. + * For UFS1 inodes per cylinder group are stored in an int16_t + * so fs_ipg is limited to 2^15 - 1. */ for ( ; sblock.fs_fpg < maxblkspercg; sblock.fs_fpg += sblock.fs_frag) { sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); - if (sblock.fs_size / sblock.fs_fpg < MINCYLGRPS) - break; - if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) - continue; - if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) - break; + if (Oflag > 1 || (Oflag == 1 && sblock.fs_ipg <= 0x7fff)) { + if (sblock.fs_size / sblock.fs_fpg < MINCYLGRPS) + break; + if (CGSIZE(&sblock) < (unsigned long)sblock.fs_bsize) + continue; + if (CGSIZE(&sblock) == (unsigned long)sblock.fs_bsize) + break; + } sblock.fs_fpg -= sblock.fs_frag; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); @@ -568,8 +572,20 @@ restart: printf("** Exiting on Eflag 3\n"); exit(0); } - if (!Nflag) + if (!Nflag) { sbwrite(&disk, 0); + /* + * For UFS1 filesystems with a blocksize of 64K, the first + * alternate superblock resides at the location used for + * the default UFS2 superblock. As there is a valid + * superblock at this location, the boot code will use + * it as its first choice. Thus we have to ensure that + * all of its statistcs on usage are correct. + */ + if (Oflag == 1 && sblock.fs_bsize == 65536) + wtfs(fsbtodb(&sblock, cgsblock(&sblock, 0)), + sblock.fs_bsize, (char *)&sblock); + } for (i = 0; i < sblock.fs_cssize; i += sblock.fs_bsize) wtfs(fsbtodb(&sblock, sblock.fs_csaddr + numfrags(&sblock, i)), sblock.fs_cssize - i < sblock.fs_bsize ? From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 09:17:01 2010 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 E131E1065673; Tue, 23 Nov 2010 09:17:00 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CDBBF8FC25; Tue, 23 Nov 2010 09:17:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAN9H0Zp022757; Tue, 23 Nov 2010 09:17:00 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAN9H0l4022755; Tue, 23 Nov 2010 09:17:00 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201011230917.oAN9H0l4022755@svn.freebsd.org> From: Fabien Thomas Date: Tue, 23 Nov 2010 09:17:00 +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: r215736 - stable/7/sys/dev/hwpmc 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: Tue, 23 Nov 2010 09:17:01 -0000 Author: fabient Date: Tue Nov 23 09:17:00 2010 New Revision: 215736 URL: http://svn.freebsd.org/changeset/base/215736 Log: MFC 200669: Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F. Modified: stable/7/sys/dev/hwpmc/hwpmc_intel.c 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/hwpmc/hwpmc_intel.c ============================================================================== --- stable/7/sys/dev/hwpmc/hwpmc_intel.c Tue Nov 23 09:12:43 2010 (r215735) +++ stable/7/sys/dev/hwpmc/hwpmc_intel.c Tue Nov 23 09:17:00 2010 (r215736) @@ -131,6 +131,8 @@ pmc_intel_initialize(void) nclasses = 3; break; case 0x1A: + case 0x1E: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ + case 0x1F: /* Per Intel document 253669-032 9/2009, pages A-2 and A-57 */ case 0x2E: cputype = PMC_CPU_INTEL_COREI7; nclasses = 5; From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 11:41:41 2010 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 EB20B106564A; Tue, 23 Nov 2010 11:41:40 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D87A08FC0A; Tue, 23 Nov 2010 11:41:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANBfec1029050; Tue, 23 Nov 2010 11:41:40 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANBfeUj029045; Tue, 23 Nov 2010 11:41:40 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201011231141.oANBfeUj029045@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 23 Nov 2010 11:41:40 +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: r215740 - in stable/7: . share/man/man9 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: Tue, 23 Nov 2010 11:41:41 -0000 Author: pluknet Date: Tue Nov 23 11:41:40 2010 New Revision: 215740 URL: http://svn.freebsd.org/changeset/base/215740 Log: MFC r215176: Stop documenting vgonel() after its converting to the static function: svn r147332 (by jeff): "Don't make vgonel() globally visible". While here, specify the vnode locking scheme for vgone(). MFC r176604 (by davidc): Minor grammar fixup. Approved by: avg (mentor), kib (mentor) Modified: stable/7/ObsoleteFiles.inc (contents, props changed) stable/7/share/man/man9/Makefile stable/7/share/man/man9/vflush.9 stable/7/share/man/man9/vgone.9 Directory Properties: stable/7/share/man/man9/ (props changed) Modified: stable/7/ObsoleteFiles.inc ============================================================================== --- stable/7/ObsoleteFiles.inc Tue Nov 23 11:39:11 2010 (r215739) +++ stable/7/ObsoleteFiles.inc Tue Nov 23 11:41:40 2010 (r215740) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20101112: vgonel(9) has gone to private API a while ago +OLD_FILES+=usr/share/man/man9/vgonel.9.gz # 20101025: catch up with vm_page_sleep_if_busy rename OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz # 20091129: pecoff image activator removed Modified: stable/7/share/man/man9/Makefile ============================================================================== --- stable/7/share/man/man9/Makefile Tue Nov 23 11:39:11 2010 (r215739) +++ stable/7/share/man/man9/Makefile Tue Nov 23 11:41:40 2010 (r215740) @@ -1233,7 +1233,6 @@ MLINKS+=vfs_getopt.9 vfs_getopts.9 \ vfs_getopt.9 vfs_copyopt.9 \ vfs_getopt.9 vfs_filteropt.9 MLINKS+=VFS_LOCK_GIANT.9 VFS_UNLOCK_GIANT.9 -MLINKS+=vgone.9 vgonel.9 MLINKS+=vhold.9 vdrop.9 \ vhold.9 vdropl.9 MLINKS+=vm_map_lock.9 vm_map_lock_downgrade.9 \ Modified: stable/7/share/man/man9/vflush.9 ============================================================================== --- stable/7/share/man/man9/vflush.9 Tue Nov 23 11:39:11 2010 (r215739) +++ stable/7/share/man/man9/vflush.9 Tue Nov 23 11:41:40 2010 (r215740) @@ -75,7 +75,6 @@ A value of 0 is returned if the flush is will be returned. .Sh SEE ALSO .Xr vgone 9 , -.Xr vgonel 9 , .Xr vrele 9 .Sh AUTHORS This manual page was written by Modified: stable/7/share/man/man9/vgone.9 ============================================================================== --- stable/7/share/man/man9/vgone.9 Tue Nov 23 11:39:11 2010 (r215739) +++ stable/7/share/man/man9/vgone.9 Tue Nov 23 11:41:40 2010 (r215740) @@ -26,24 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2001 +.Dd November 12, 2010 .Dt VGONE 9 .Os .Sh NAME -.Nm vgone , vgonel +.Nm vgone .Nd "prepare a vnode for reuse" .Sh SYNOPSIS .In sys/param.h .In sys/vnode.h .Ft void .Fn vgone "struct vnode *vp" -.Ft void -.Fn vgonel "struct vnode *vp" "struct thread *td" .Sh DESCRIPTION +The .Fn vgone -and -.Fn vgonel -prepare a vnode for reuse by another file system. +function prepares the vnode to be destroyed. The preparation includes the cleaning of all file system specific data and the removal from its mount point vnode list. .Pp @@ -53,19 +50,14 @@ of zero, and its .Dv VI_DOOMED flag is not set, it is moved to the head of the free list as in most cases the vnode -is about to be reused, or its file system being unmounted. +is about to be reused, or its file system is being unmounted. .Pp -The difference between -.Fn vgone -and -.Fn vgonel -is that +The .Fn vgone -locks the vnode interlock and then calls -.Fn vgonel -while -.Fn vgonel -expects the interlock to already be locked. +function takes an exclusively locked vnode, and returns with the vnode +exclusively locked. +.Sh SEE ALSO +.Xr vnode 9 .Sh AUTHORS This manual page was written by .An Chad David Aq davidc@acns.ab.ca . From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 18:48:57 2010 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 BE77E1065673; Tue, 23 Nov 2010 18:48:57 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABEAA8FC1D; Tue, 23 Nov 2010 18:48:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANImvrU039489; Tue, 23 Nov 2010 18:48:57 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANImvEw039486; Tue, 23 Nov 2010 18:48:57 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011231848.oANImvEw039486@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 23 Nov 2010 18:48:57 +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: r215757 - in stable: 7/lib/msun/src 8/lib/msun/src 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: Tue, 23 Nov 2010 18:48:57 -0000 Author: uqs Date: Tue Nov 23 18:48:57 2010 New Revision: 215757 URL: http://svn.freebsd.org/changeset/base/215757 Log: MFC r215237: Fix bug in jn(3) and jnf(3) that led to -inf results Modified: stable/7/lib/msun/src/e_jn.c stable/7/lib/msun/src/e_jnf.c Directory Properties: stable/7/lib/msun/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/msun/src/e_jn.c stable/8/lib/msun/src/e_jnf.c Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/7/lib/msun/src/e_jn.c ============================================================================== --- stable/7/lib/msun/src/e_jn.c Tue Nov 23 18:47:43 2010 (r215756) +++ stable/7/lib/msun/src/e_jn.c Tue Nov 23 18:48:57 2010 (r215757) @@ -201,7 +201,12 @@ __ieee754_jn(int n, double x) } } } - b = (t*__ieee754_j0(x)/b); + z = __ieee754_j0(x); + w = __ieee754_j1(x); + if (fabs(z) >= fabs(w)) + b = (t*z/b); + else + b = (t*w/a); } } if(sgn==1) return -b; else return b; Modified: stable/7/lib/msun/src/e_jnf.c ============================================================================== --- stable/7/lib/msun/src/e_jnf.c Tue Nov 23 18:47:43 2010 (r215756) +++ stable/7/lib/msun/src/e_jnf.c Tue Nov 23 18:48:57 2010 (r215757) @@ -154,7 +154,12 @@ __ieee754_jnf(int n, float x) } } } - b = (t*__ieee754_j0f(x)/b); + z = __ieee754_j0f(x); + w = __ieee754_j1f(x); + if (fabsf(z) >= fabsf(w)) + b = (t*z/b); + else + b = (t*w/a); } } if(sgn==1) return -b; else return b; From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 19:14:18 2010 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 0F293106567A; Tue, 23 Nov 2010 19:14:18 +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 F08258FC17; Tue, 23 Nov 2010 19:14:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANJEHJY040282; Tue, 23 Nov 2010 19:14:17 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANJEHIe040280; Tue, 23 Nov 2010 19:14:17 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011231914.oANJEHIe040280@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Nov 2010 19:14:17 +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: r215760 - stable/7/sys/dev/nfe 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: Tue, 23 Nov 2010 19:14:18 -0000 Author: yongari Date: Tue Nov 23 19:14:17 2010 New Revision: 215760 URL: http://svn.freebsd.org/changeset/base/215760 Log: MFC r215327,215350: r215327: P5N32-SLI PREMIUM from ASUSTeK is known to have MSI/MSI-X issue such that nfe(4) does not work with MSI-X. When MSI-X support was introduced, I remember MCP55 controller worked without problems so the issue could be either PCI bridge or BIOS issue. But I also noticed snd_hda(4) disabled MSI on all MCP55 chipset so I'm still not sure this is generic issue of MCP55 chipset. If this was PCI bridge issue we would have added it to a system wide black-list table but it's not clear to me at this moment whether it was caused by either broken BIOS or silicon bug of MCP55 chipset. To workaround the issue, maintain a MSI/MSI-X black-list table in driver and lookup base board manufacturer and product name from the table before attempting to use MSI-X. If driver find an matching entry, nfe(4) will not use MSI/MSI-X and fall back on traditional INTx mode. This approach should be the last resort since it relies on smbios and if another instance of MSI/MSI-X breakage is reported with different maker/product, we may have to get the PCI bridge black-listed instead of adding an new entry. PR: kern/152150 r215350: Plug memory leakage introduced in r215327. Submitted by: jkim Modified: stable/7/sys/dev/nfe/if_nfe.c 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/nfe/if_nfe.c ============================================================================== --- stable/7/sys/dev/nfe/if_nfe.c Tue Nov 23 19:11:27 2010 (r215759) +++ stable/7/sys/dev/nfe/if_nfe.c Tue Nov 23 19:14:17 2010 (r215760) @@ -77,6 +77,7 @@ static int nfe_detach(device_t); static int nfe_suspend(device_t); static int nfe_resume(device_t); static int nfe_shutdown(device_t); +static int nfe_can_use_msix(struct nfe_softc *); static void nfe_power(struct nfe_softc *); static int nfe_miibus_readreg(device_t, int, int); static int nfe_miibus_writereg(device_t, int, int, int); @@ -383,6 +384,13 @@ nfe_attach(device_t dev) "max. width of link(x%d)\n", width, v); } + if (nfe_can_use_msix(sc) == 0) { + device_printf(sc->nfe_dev, + "MSI/MSI-X capability black-listed, will use INTx\n"); + msix_disable = 1; + msi_disable = 1; + } + /* Allocate interrupt */ if (msix_disable == 0 || msi_disable == 0) { if (msix_disable == 0 && @@ -784,6 +792,48 @@ nfe_resume(device_t dev) } +static int +nfe_can_use_msix(struct nfe_softc *sc) +{ + static struct msix_blacklist { + char *maker; + char *product; + } msix_blacklists[] = { + { "ASUSTeK Computer INC.", "P5N32-SLI PREMIUM" } + }; + + struct msix_blacklist *mblp; + char *maker, *product; + int count, n, use_msix; + + /* + * Search base board manufacturer and product name table + * to see this system has a known MSI/MSI-X issue. + */ + maker = getenv("smbios.planar.maker"); + product = getenv("smbios.planar.product"); + use_msix = 1; + if (maker != NULL && product != NULL) { + count = sizeof(msix_blacklists) / sizeof(msix_blacklists[0]); + mblp = msix_blacklists; + for (n = 0; n < count; n++) { + if (strcmp(maker, mblp->maker) == 0 && + strcmp(product, mblp->product) == 0) { + use_msix = 0; + break; + } + mblp++; + } + } + if (maker != NULL) + freeenv(maker); + if (product != NULL) + freeenv(product); + + return (use_msix); +} + + /* Take PHY/NIC out of powerdown, from Linux */ static void nfe_power(struct nfe_softc *sc) From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 19:23:47 2010 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 6F33F1065670; Tue, 23 Nov 2010 19:23:47 +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 5CCAB8FC14; Tue, 23 Nov 2010 19:23:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANJNltP040674; Tue, 23 Nov 2010 19:23:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANJNl2T040672; Tue, 23 Nov 2010 19:23:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201011231923.oANJNl2T040672@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 23 Nov 2010 19:23:47 +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: r215763 - stable/7/sys/dev/mii 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: Tue, 23 Nov 2010 19:23:47 -0000 Author: yongari Date: Tue Nov 23 19:23:47 2010 New Revision: 215763 URL: http://svn.freebsd.org/changeset/base/215763 Log: MFC r215353,215355: r215353: Plug memory leakage introduced in r204989. Reported by: yongari r215355: Restore the previous behaviour of substring match. Modified: stable/7/sys/dev/mii/brgphy.c 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/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Tue Nov 23 19:22:44 2010 (r215762) +++ stable/7/sys/dev/mii/brgphy.c Tue Nov 23 19:23:47 2010 (r215763) @@ -153,15 +153,19 @@ static int detect_hs21(struct bce_softc *bce_sc) { char *sysenv; + int found; - if (bce_sc->bce_chipid != HS21_BCM_CHIPID) - return (0); - sysenv = getenv("smbios.system.product"); - if (sysenv == NULL) - return (0); - if (strncmp(sysenv, HS21_PRODUCT_ID, strlen(HS21_PRODUCT_ID)) != 0) - return (0); - return (1); + found = 0; + if (bce_sc->bce_chipid == HS21_BCM_CHIPID) { + sysenv = getenv("smbios.system.product"); + if (sysenv != NULL) { + if (strncmp(sysenv, HS21_PRODUCT_ID, + strlen(HS21_PRODUCT_ID)) == 0) + found = 1; + freeenv(sysenv); + } + } + return (found); } /* Search for our PHY in the list of known PHYs */ From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 21:36:54 2010 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 02315106573F; Tue, 23 Nov 2010 21:36:54 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E153A8FC14; Tue, 23 Nov 2010 21:36:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANLargl044829; Tue, 23 Nov 2010 21:36:53 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANLarkV044826; Tue, 23 Nov 2010 21:36:53 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201011232136.oANLarkV044826@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 23 Nov 2010 21:36:53 +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: r215774 - in stable: 7/contrib/bsnmp/snmpd 7/usr.sbin/bsnmpd/modules/snmp_hostres 8/contrib/bsnmp/snmpd 8/usr.sbin/bsnmpd/modules/snmp_hostres 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: Tue, 23 Nov 2010 21:36:54 -0000 Author: uqs Date: Tue Nov 23 21:36:53 2010 New Revision: 215774 URL: http://svn.freebsd.org/changeset/base/215774 Log: MFC r214237,214489: Remove mention of non-existant -o flag for debugging options. Fix CPU load reporting independent of scheduler used. - Sample CPU usage data from kern.cp_times, this makes for a far more accurate and scheduler independent algorithm. - Rip out the process list scraping that is no longer required. - Don't update CPU usage sampling on every request, but every 15s instead. This makes it impossible for an attacker to hide the CPU load by triggering 4 samplings in short succession when the system is idle. - After reaching the steady-state, the system will always report the average CPU load of the last 60 sampled seconds. - Untangling of call graph. Modified: stable/7/contrib/bsnmp/snmpd/bsnmpd.1 (contents, props changed) stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (contents, props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/bsnmp/snmpd/bsnmpd.1 (contents, props changed) stable/8/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c (contents, props changed) Modified: stable/7/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- stable/7/contrib/bsnmp/snmpd/bsnmpd.1 Tue Nov 23 21:35:13 2010 (r215773) +++ stable/7/contrib/bsnmp/snmpd/bsnmpd.1 Tue Nov 23 21:36:53 2010 (r215774) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd August 16, 2010 +.Dd October 23, 2010 .Dt BSNMPD 1 .Os .Sh NAME @@ -68,11 +68,9 @@ Use .Ar file as configuration file instead of the standard one. .It Fl D Ar options -Debugging options are specified with a -.Fl o -flag followed by a comma separated string of options. +Debugging options are specified as a comma separated string. The following options are available. -.Bl -tag -width ".It Cm trace Ns Cm = Ns Cm level" +.Bl -tag -width "trace=level" .It Cm dump Dump all sent and received PDUs to the terminal. .It Cm events Modified: stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c ============================================================================== --- stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c Tue Nov 23 21:35:13 2010 (r215773) +++ stable/7/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c Tue Nov 23 21:36:53 2010 (r215774) @@ -56,19 +56,15 @@ struct processor_entry { int32_t index; const struct asn_oid *frwId; - int32_t load; + int32_t load; /* average cpu usage */ + int32_t sample_cnt; /* number of usage samples */ + int32_t cur_sample_idx; /* current valid sample */ TAILQ_ENTRY(processor_entry) link; u_char cpu_no; /* which cpu, counted from 0 */ - pid_t idle_pid; /* PID of idle process for this CPU */ /* the samples from the last minute, as required by MIB */ double samples[MAX_CPU_SAMPLES]; - - /* current sample to fill in next time, must be < MAX_CPU_SAMPLES */ - uint32_t cur_sample_idx; - - /* number of useful samples */ - uint32_t sample_cnt; + long states[MAX_CPU_SAMPLES][CPUSTATES]; }; TAILQ_HEAD(processor_tbl, processor_entry); @@ -82,65 +78,78 @@ static int32_t detected_processor_count; /* sysctlbyname(hw.ncpu) */ static int hw_ncpu; -/* sysctlbyname(kern.{ccpu,fscale}) */ -static fixpt_t ccpu; -static int fscale; - -/* tick of PDU where we have refreshed the processor table last */ -static uint64_t proctbl_tick; +/* sysctlbyname(kern.cp_times) */ +static int cpmib[2]; +static size_t cplen; /* periodic timer used to get cpu load stats */ static void *cpus_load_timer; -/* - * Average the samples. The entire algorithm seems to be wrong XXX. +/** + * Returns the CPU usage of a given processor entry. + * + * It needs at least two cp_times "tick" samples to calculate a delta and + * thus, the usage over the sampling period. */ static int get_avg_load(struct processor_entry *e) { - u_int i; - double sum = 0.0; + u_int i, oldest; + long delta = 0; + double usage = 0.0; assert(e != NULL); - if (e->sample_cnt == 0) + /* Need two samples to perform delta calculation. */ + if (e->sample_cnt <= 1) return (0); - for (i = 0; i < e->sample_cnt; i++) - sum += e->samples[i]; - - return ((int)floor((double)sum/(double)e->sample_cnt)); -} - -/* - * Stolen from /usr/src/bin/ps/print.c. The idle process should never - * be swapped out :-) - */ -static double -processor_getpcpu(struct kinfo_proc *ki_p) -{ - - if (ccpu == 0 || fscale == 0) - return (0.0); - -#define fxtofl(fixpt) ((double)(fixpt) / fscale) - return (100.0 * fxtofl(ki_p->ki_pctcpu) / - (1.0 - exp(ki_p->ki_swtime * log(fxtofl(ccpu))))); + /* Oldest usable index, we wrap around. */ + if (e->sample_cnt == MAX_CPU_SAMPLES) + oldest = (e->cur_sample_idx + 1) % MAX_CPU_SAMPLES; + else + oldest = 0; + + /* Sum delta for all states. */ + for (i = 0; i < CPUSTATES; i++) { + delta += e->states[e->cur_sample_idx][i]; + delta -= e->states[oldest][i]; + } + if (delta == 0) + return 0; + + /* Take idle time from the last element and convert to + * percent usage by contrasting with total ticks delta. */ + usage = (double)(e->states[e->cur_sample_idx][CPUSTATES-1] - + e->states[oldest][CPUSTATES-1]) / delta; + usage = 100 - (usage * 100); + HRDBG("CPU no. %d, delta ticks %ld, pct usage %.2f", e->cpu_no, + delta, usage); + + return ((int)(usage)); } /** - * Save a new sample + * Save a new sample to proc entry and get the average usage. + * + * Samples are stored in a ringbuffer from 0..(MAX_CPU_SAMPLES-1) */ static void -save_sample(struct processor_entry *e, struct kinfo_proc *kp) +save_sample(struct processor_entry *e, long *cp_times) { + int i; - e->samples[e->cur_sample_idx] = 100.0 - processor_getpcpu(kp); - e->load = get_avg_load(e); e->cur_sample_idx = (e->cur_sample_idx + 1) % MAX_CPU_SAMPLES; + for (i = 0; cp_times != NULL && i < CPUSTATES; i++) + e->states[e->cur_sample_idx][i] = cp_times[i]; - if (++e->sample_cnt > MAX_CPU_SAMPLES) + e->sample_cnt++; + if (e->sample_cnt > MAX_CPU_SAMPLES) e->sample_cnt = MAX_CPU_SAMPLES; + + HRDBG("sample count for CPU no. %d went to %d", e->cpu_no, e->sample_cnt); + e->load = get_avg_load(e); + } /** @@ -178,8 +187,9 @@ proc_create_entry(u_int cpu_no, struct d entry->index = map->hrIndex; entry->load = 0; + entry->sample_cnt = 0; + entry->cur_sample_idx = -1; entry->cpu_no = (u_char)cpu_no; - entry->idle_pid = 0; entry->frwId = &oid_zeroDotZero; /* unknown id FIXME */ INSERT_OBJECT_INT(entry, &processor_tbl); @@ -191,64 +201,11 @@ proc_create_entry(u_int cpu_no, struct d } /** - * Get the PIDs for the idle processes of the CPUs. - */ -static void -processor_get_pids(void) -{ - struct kinfo_proc *plist, *kp; - int i; - int nproc; - int cpu; - int nchars; - struct processor_entry *entry; - - plist = kvm_getprocs(hr_kd, KERN_PROC_ALL, 0, &nproc); - if (plist == NULL || nproc < 0) { - syslog(LOG_ERR, "hrProcessor: kvm_getprocs() failed: %m"); - return; - } - - for (i = 0, kp = plist; i < nproc; i++, kp++) { - if (!IS_KERNPROC(kp)) - continue; - - if (strcmp(kp->ki_comm, "idle") == 0) { - /* single processor system */ - cpu = 0; - } else if (sscanf(kp->ki_comm, "idle: cpu%d%n", &cpu, &nchars) - == 1 && (u_int)nchars == strlen(kp->ki_comm)) { - /* MP system */ - } else - /* not an idle process */ - continue; - - HRDBG("'%s' proc with pid %d is on CPU #%d (last on #%d)", - kp->ki_comm, kp->ki_pid, kp->ki_oncpu, kp->ki_lastcpu); - - TAILQ_FOREACH(entry, &processor_tbl, link) - if (entry->cpu_no == kp->ki_lastcpu) - break; - - if (entry == NULL) { - /* create entry on non-ACPI systems */ - if ((entry = proc_create_entry(cpu, NULL)) == NULL) - continue; - - detected_processor_count++; - } - - entry->idle_pid = kp->ki_pid; - HRDBG("CPU no. %d with SNMP index=%d has idle PID %d", - entry->cpu_no, entry->index, entry->idle_pid); - - save_sample(entry, kp); - } -} - -/** * Scan the device map table for CPUs and create an entry into the - * processor table for each CPU. Then fetch the idle PIDs for all CPUs. + * processor table for each CPU. + * + * Make sure that the number of processors announced by the kernel hw.ncpu + * is equal to the number of processors we have found in the device table. */ static void create_proc_table(void) @@ -256,6 +213,7 @@ create_proc_table(void) struct device_map_entry *map; struct processor_entry *entry; int cpu_no; + size_t len; detected_processor_count = 0; @@ -265,7 +223,7 @@ create_proc_table(void) * If not, no entries will be present in the hrProcessor Table. * * For non-ACPI system the processors are not in the device table, - * therefor insert them when getting the idle pids. XXX + * therefore insert them after checking hw.ncpu. */ STAILQ_FOREACH(map, &device_map, link) if (strncmp(map->name_key, "cpu", strlen("cpu")) == 0 && @@ -283,9 +241,34 @@ create_proc_table(void) detected_processor_count++; } - HRDBG("%d CPUs detected", detected_processor_count); + len = sizeof(hw_ncpu); + if (sysctlbyname("hw.ncpu", &hw_ncpu, &len, NULL, 0) == -1 || + len != sizeof(hw_ncpu)) { + syslog(LOG_ERR, "hrProcessorTable: sysctl(hw.ncpu) failed"); + hw_ncpu = 0; + } + + HRDBG("%d CPUs detected via device table; hw.ncpu is %d", + detected_processor_count, hw_ncpu); + + /* XXX Can happen on non-ACPI systems? Create entries by hand. */ + for (; detected_processor_count < hw_ncpu; detected_processor_count++) + proc_create_entry(detected_processor_count, NULL); + + len = 2; + if (sysctlnametomib("kern.cp_times", cpmib, &len)) { + syslog(LOG_ERR, "hrProcessorTable: sysctlnametomib(kern.cp_times) failed"); + cpmib[0] = 0; + cpmib[1] = 0; + cplen = 0; + } else if (sysctl(cpmib, 2, NULL, &len, NULL, 0)) { + syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.cp_times) length query failed"); + cplen = 0; + } else { + cplen = len / sizeof(long); + } + HRDBG("%zu entries for kern.cp_times", cplen); - processor_get_pids(); } /** @@ -307,78 +290,6 @@ free_proc_table(void) } /** - * Init the things for hrProcessorTable. - * Scan the device table for processor entries. - */ -void -init_processor_tbl(void) -{ - size_t len; - - /* get various parameters from the kernel */ - len = sizeof(ccpu); - if (sysctlbyname("kern.ccpu", &ccpu, &len, NULL, 0) == -1) { - syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.ccpu) failed"); - ccpu = 0; - } - - len = sizeof(fscale); - if (sysctlbyname("kern.fscale", &fscale, &len, NULL, 0) == -1) { - syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.fscale) failed"); - fscale = 0; - } - - /* create the initial processor table */ - create_proc_table(); -} - -/** - * Finalization routine for hrProcessorTable. - * It destroys the lists and frees any allocated heap memory. - */ -void -fini_processor_tbl(void) -{ - - if (cpus_load_timer != NULL) { - timer_stop(cpus_load_timer); - cpus_load_timer = NULL; - } - - free_proc_table(); -} - -/** - * Make sure that the number of processors announced by the kernel hw.ncpu - * is equal to the number of processors we have found in the device table. - * If they differ rescan the device table. - */ -static void -processor_refill_tbl(void) -{ - - HRDBG("hw_ncpu=%d detected_processor_count=%d", hw_ncpu, - detected_processor_count); - - if (hw_ncpu <= 0) { - size_t size = sizeof(hw_ncpu); - - if (sysctlbyname("hw.ncpu", &hw_ncpu, &size, NULL, 0) == -1 || - size != sizeof(hw_ncpu)) { - syslog(LOG_ERR, "hrProcessorTable: " - "sysctl(hw.ncpu) failed: %m"); - hw_ncpu = 0; - return; - } - } - - if (hw_ncpu != detected_processor_count) { - free_proc_table(); - create_proc_table(); - } -} - -/** * Refresh all values in the processor table. We call this once for * every PDU that accesses the table. */ @@ -386,37 +297,23 @@ static void refresh_processor_tbl(void) { struct processor_entry *entry; - int need_pids; - struct kinfo_proc *plist; - int nproc; + size_t size; - processor_refill_tbl(); + long pcpu_cp_times[cplen]; + memset(pcpu_cp_times, 0, sizeof(pcpu_cp_times)); - need_pids = 0; - TAILQ_FOREACH(entry, &processor_tbl, link) { - if (entry->idle_pid <= 0) { - need_pids = 1; - continue; - } + size = cplen * sizeof(long); + if (sysctl(cpmib, 2, pcpu_cp_times, &size, NULL, 0) == -1 && + !(errno == ENOMEM && size >= cplen * sizeof(long))) { + syslog(LOG_ERR, "hrProcessorTable: sysctl(kern.cp_times) failed"); + return; + } + TAILQ_FOREACH(entry, &processor_tbl, link) { assert(hr_kd != NULL); - - plist = kvm_getprocs(hr_kd, KERN_PROC_PID, - entry->idle_pid, &nproc); - if (plist == NULL || nproc != 1) { - syslog(LOG_ERR, "%s: missing item with " - "PID = %d for CPU #%d\n ", __func__, - entry->idle_pid, entry->cpu_no); - need_pids = 1; - continue; - } - save_sample(entry, plist); + save_sample(entry, &pcpu_cp_times[entry->cpu_no * CPUSTATES]); } - if (need_pids == 1) - processor_get_pids(); - - proctbl_tick = this_tick; } /** @@ -451,6 +348,36 @@ start_processor_tbl(struct lmodule *mod) } /** + * Init the things for hrProcessorTable. + * Scan the device table for processor entries. + */ +void +init_processor_tbl(void) +{ + + /* create the initial processor table */ + create_proc_table(); + /* and get first samples */ + refresh_processor_tbl(); +} + +/** + * Finalization routine for hrProcessorTable. + * It destroys the lists and frees any allocated heap memory. + */ +void +fini_processor_tbl(void) +{ + + if (cpus_load_timer != NULL) { + timer_stop(cpus_load_timer); + cpus_load_timer = NULL; + } + + free_proc_table(); +} + +/** * Access routine for the processor table. */ int @@ -460,9 +387,6 @@ op_hrProcessorTable(struct snmp_context { struct processor_entry *entry; - if (this_tick != proctbl_tick) - refresh_processor_tbl(); - switch (curr_op) { case SNMP_OP_GETNEXT: From owner-svn-src-stable-7@FreeBSD.ORG Tue Nov 23 21:45:15 2010 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 316C81065674; Tue, 23 Nov 2010 21:45:15 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15E528FC1F; Tue, 23 Nov 2010 21:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oANLjEhk045200; Tue, 23 Nov 2010 21:45:14 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oANLjEbF045197; Tue, 23 Nov 2010 21:45:14 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011232145.oANLjEbF045197@svn.freebsd.org> From: Brian Somers Date: Tue, 23 Nov 2010 21:45:14 +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: r215778 - stable/7/sbin/growfs 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: Tue, 23 Nov 2010 21:45:15 -0000 Author: brian Date: Tue Nov 23 21:45:14 2010 New Revision: 215778 URL: http://svn.freebsd.org/changeset/base/215778 Log: MFC r197763, r198236, r212839 and r212886: Handle extending a filesystem into unzeroed storage. Modified: stable/7/sbin/growfs/Makefile stable/7/sbin/growfs/growfs.c Directory Properties: stable/7/sbin/growfs/ (props changed) Modified: stable/7/sbin/growfs/Makefile ============================================================================== --- stable/7/sbin/growfs/Makefile Tue Nov 23 21:42:26 2010 (r215777) +++ stable/7/sbin/growfs/Makefile Tue Nov 23 21:45:14 2010 (r215778) @@ -10,8 +10,6 @@ PROG= growfs SRCS= growfs.c MAN= growfs.8 -WARNS?= 6 - .if defined(GFSDBG) SRCS+= debug.c .endif Modified: stable/7/sbin/growfs/growfs.c ============================================================================== --- stable/7/sbin/growfs/growfs.c Tue Nov 23 21:42:26 2010 (r215777) +++ stable/7/sbin/growfs/growfs.c Tue Nov 23 21:45:14 2010 (r215778) @@ -371,16 +371,16 @@ static void initcg(int cylno, time_t utime, int fso, unsigned int Nflag) { DBG_FUNC("initcg") - static void *iobuf; + static caddr_t iobuf; long blkno, start; ufs2_daddr_t i, cbase, dmax; struct ufs1_dinode *dp1; struct csum *cs; uint d, dupper, dlower; - if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize)) == NULL) { + if (iobuf == NULL && (iobuf = malloc(sblock.fs_bsize * 3)) == NULL) errx(37, "panic: cannot allocate I/O buffer"); - } + /* * Determine block bounds for cylinder group. * Allow space for super block summary information in first @@ -400,7 +400,8 @@ initcg(int cylno, time_t utime, int fso, acg.cg_magic = CG_MAGIC; acg.cg_cgx = cylno; acg.cg_niblk = sblock.fs_ipg; - acg.cg_initediblk = sblock.fs_ipg; + acg.cg_initediblk = sblock.fs_ipg < 2 * INOPB(&sblock) ? + sblock.fs_ipg : 2 * INOPB(&sblock); acg.cg_ndblk = dmax - cbase; if (sblock.fs_contigsumsize > 0) acg.cg_nclusterblks = acg.cg_ndblk / sblock.fs_frag; @@ -451,7 +452,7 @@ initcg(int cylno, time_t utime, int fso, bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)iobuf; + dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random(); @@ -533,11 +534,14 @@ initcg(int cylno, time_t utime, int fso, sblock.fs_cstotal.cs_nbfree += acg.cg_cs.cs_nbfree; sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + + memcpy(iobuf, &acg, sblock.fs_cgsize); + memset(iobuf + sblock.fs_cgsize, '\0', + sblock.fs_bsize * 3 - sblock.fs_cgsize); + wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), - sblock.fs_bsize, (char *)&acg, fso, Nflag); - DBG_DUMP_CG(&sblock, - "new cg", - &acg); + sblock.fs_bsize * 3, iobuf, fso, Nflag); + DBG_DUMP_CG(&sblock, "new cg", &acg); DBG_LEAVE; return; @@ -2209,6 +2213,7 @@ main(int argc, char **argv) printf("Warning: %jd sector(s) cannot be allocated.\n", (intmax_t)fsbtodb(&sblock, sblock.fs_size % sblock.fs_fpg)); sblock.fs_size = sblock.fs_ncg * sblock.fs_fpg; + maxino -= sblock.fs_ipg; } /* From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 24 00:00:32 2010 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 7039E106564A; Wed, 24 Nov 2010 00:00:32 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD498FC15; Wed, 24 Nov 2010 00:00:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAO00Wrr048385; Wed, 24 Nov 2010 00:00:32 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAO00W9O048383; Wed, 24 Nov 2010 00:00:32 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201011240000.oAO00W9O048383@svn.freebsd.org> From: Kirk McKusick Date: Wed, 24 Nov 2010 00:00:32 +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: r215785 - in stable/7: sbin/mount sys/ufs/ffs 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, 24 Nov 2010 00:00:32 -0000 Author: mckusick Date: Wed Nov 24 00:00:32 2010 New Revision: 215785 URL: http://svn.freebsd.org/changeset/base/215785 Log: MFC of 215576 Delete /sys/ufs/ffs/README.snapshot as it is no longer relevant. Drop reference to it in mount(8). Reported by: Bruce Cran PR: docs/128325 Deleted: stable/7/sys/ufs/ffs/README.snapshot Modified: stable/7/sbin/mount/mount.8 Directory Properties: stable/7/sbin/mount/ (props changed) 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/sbin/mount/mount.8 ============================================================================== --- stable/7/sbin/mount/mount.8 Tue Nov 23 23:13:58 2010 (r215784) +++ stable/7/sbin/mount/mount.8 Wed Nov 24 00:00:32 2010 (r215785) @@ -293,9 +293,6 @@ When you are done with the mounted snaps umount /mnt mdconfig -d -u 4 .Ed -.Pp -Further details can be found in the file at -.Pa /usr/src/sys/ufs/ffs/README.snapshot . .El .It Cm suiddir A directory on the mounted file system will respond to the SUID bit From owner-svn-src-stable-7@FreeBSD.ORG Wed Nov 24 21:58:15 2010 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 785EE1065740; Wed, 24 Nov 2010 21:58:15 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CD9A8FC13; Wed, 24 Nov 2010 21:58:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAOLwFH3084348; Wed, 24 Nov 2010 21:58:15 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAOLwFse084346; Wed, 24 Nov 2010 21:58:15 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201011242158.oAOLwFse084346@svn.freebsd.org> From: Bruce Cran Date: Wed, 24 Nov 2010 21:58:15 +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: r215807 - stable/7/usr.sbin/sysinstall 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, 24 Nov 2010 21:58:15 -0000 Author: brucec Date: Wed Nov 24 21:58:15 2010 New Revision: 215807 URL: http://svn.freebsd.org/changeset/base/215807 Log: MFC r215637: dispatch_add_command: Modify the logic so there's only one exit point instead of two. Only insert valid (non-NULL) values into the queue. dispatch_free_command: Ensure that item is not NULL before removing it from the queue and dereferencing the pointer. NULL out free'd pointers to catch any use-after-free bugs. PR: bin/146855 Submitted by: gcooper Modified: stable/7/usr.sbin/sysinstall/dispatch.c Directory Properties: stable/7/usr.sbin/sysinstall/ (props changed) Modified: stable/7/usr.sbin/sysinstall/dispatch.c ============================================================================== --- stable/7/usr.sbin/sysinstall/dispatch.c Wed Nov 24 21:57:45 2010 (r215806) +++ stable/7/usr.sbin/sysinstall/dispatch.c Wed Nov 24 21:58:15 2010 (r215807) @@ -135,8 +135,12 @@ typedef struct command_buffer_ { static void dispatch_free_command(command_buffer *item) { - REMQUE(item); - free(item->string); + if (item != NULL) { + REMQUE(item); + free(item->string); + item->string = NULL; + } + free(item); } @@ -154,19 +158,29 @@ dispatch_free_all(qelement *head) static command_buffer * dispatch_add_command(qelement *head, char *string) { - command_buffer *new; + command_buffer *new = NULL; new = malloc(sizeof(command_buffer)); - if (!new) - return NULL; + if (new != NULL) { - new->string = strdup(string); - INSQUEUE(new, head->q_back); + new->string = strdup(string); + + /* + * We failed to copy `string'; clean up the allocated + * resources. + */ + if (new->string == NULL) { + free(new); + new = NULL; + } else { + INSQUEUE(new, head->q_back); + } + } return new; } - + /* * Command processing */ @@ -278,7 +292,7 @@ dispatchCommand(char *str) return i; } - + /* * File processing */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 25 18:33:44 2010 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 BEEFD106564A; Thu, 25 Nov 2010 18:33:44 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC04C8FC18; Thu, 25 Nov 2010 18:33:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAPIXi7S013797; Thu, 25 Nov 2010 18:33:44 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAPIXiHN013795; Thu, 25 Nov 2010 18:33:44 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011251833.oAPIXiHN013795@svn.freebsd.org> From: Marius Strobl Date: Thu, 25 Nov 2010 18:33:44 +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: r215828 - stable/7/sbin/ifconfig 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: Thu, 25 Nov 2010 18:33:44 -0000 Author: marius Date: Thu Nov 25 18:33:44 2010 New Revision: 215828 URL: http://svn.freebsd.org/changeset/base/215828 Log: MFC: r215259, r215272 - When printing media with more than one media option set aggregate these in a comma delimited list instead of repeating "mediaopt" for each one. This matches how the options of the active media are printed with print_media_word() and brings us in line what NetBSD does. - When setting a media with no sub-type specified also reset the type specific options along with the global ones so these options don't stick when f.e. switching to IFM_AUTO. Modified: stable/7/sbin/ifconfig/ifmedia.c Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifmedia.c ============================================================================== --- stable/7/sbin/ifconfig/ifmedia.c Thu Nov 25 18:32:02 2010 (r215827) +++ stable/7/sbin/ifconfig/ifmedia.c Thu Nov 25 18:33:44 2010 (r215828) @@ -267,7 +267,7 @@ setmedia(const char *val, int d, int s, IFM_TYPE(ifmr->ifm_ulist[0]) | subtype; if ((ifr.ifr_media & IFM_TMASK) == 0) { - ifr.ifr_media &= ~IFM_GMASK; + ifr.ifr_media &= ~(IFM_GMASK | IFM_OMASK); } ifmr->ifm_current = ifr.ifr_media; @@ -748,7 +748,7 @@ print_media_word_ifconfig(int ifmw) { struct ifmedia_description *desc; struct ifmedia_type_to_subtype *ttos; - int i; + int seen_option = 0, i; /* Find the top-level interface type. */ desc = get_toptype_desc(ifmw); @@ -783,7 +783,10 @@ print_media_word_ifconfig(int ifmw) for (desc = ttos->options[i].desc; desc->ifmt_string != NULL; desc++) { if (ifmw & desc->ifmt_word) { - printf(" mediaopt %s", desc->ifmt_string); + if (seen_option == 0) + printf(" mediaopt "); + printf("%s%s", seen_option++ ? "," : "", + desc->ifmt_string); } } } From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 25 20:09:56 2010 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 A0E271065670; Thu, 25 Nov 2010 20:09:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5768FC19; Thu, 25 Nov 2010 20:09:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAPK9ubJ016261; Thu, 25 Nov 2010 20:09:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAPK9uwQ016258; Thu, 25 Nov 2010 20:09:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011252009.oAPK9uwQ016258@svn.freebsd.org> From: Xin LI Date: Thu, 25 Nov 2010 20:09:56 +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: r215839 - stable/7/sys/dev/arcmsr 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: Thu, 25 Nov 2010 20:09:56 -0000 Author: delphij Date: Thu Nov 25 20:09:56 2010 New Revision: 215839 URL: http://svn.freebsd.org/changeset/base/215839 Log: MFC r215234: Update to vendor release 1.20.00.19. Bug fixes: * Fixed "inquiry data fails comparion at DV1 step" * Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B * Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 Many thanks to Areca for continuing to support FreeBSD. MFC r215280: Workaround build for PAE case for now - revert the PHYS case to previous panic behavior. Modified: stable/7/sys/dev/arcmsr/arcmsr.c stable/7/sys/dev/arcmsr/arcmsr.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/arcmsr/arcmsr.c ============================================================================== --- stable/7/sys/dev/arcmsr/arcmsr.c Thu Nov 25 20:05:11 2010 (r215838) +++ stable/7/sys/dev/arcmsr/arcmsr.c Thu Nov 25 20:09:56 2010 (r215839) @@ -38,29 +38,32 @@ ** History ** ** REV# DATE NAME DESCRIPTION -** 1.00.00.00 3/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 4/19/2005 Erich Chen add SATA 24 Ports adapter type support +** 1.00.00.00 3/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 4/19/2005 Erich Chen add SATA 24 Ports adapter type support ** clean unused function -** 1.20.00.12 9/12/2005 Erich Chen bug fix with abort command handling, +** 1.20.00.12 9/12/2005 Erich Chen bug fix with abort command handling, ** firmware version check ** and firmware update notify for hardware bug fix ** handling if none zero high part physical address ** of srb resource -** 1.20.00.13 8/18/2006 Erich Chen remove pending srb and report busy +** 1.20.00.13 8/18/2006 Erich Chen remove pending srb and report busy ** add iop message xfer ** with scsi pass-through command ** add new device id of sas raid adapters ** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report ** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x ** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 ****************************************************************************************** * $FreeBSD$ */ @@ -116,7 +119,7 @@ #define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l) #define ARCMSR_LOCK_TRY(l) mtx_trylock(l) #define arcmsr_htole32(x) htole32(x) - typedef struct mtx arcmsr_lock_t; + typedef struct mtx arcmsr_lock_t; #else #include #include @@ -134,13 +137,14 @@ #define CAM_NEW_TRAN_CODE 1 #endif +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.19 2010-11-11" #include #define ARCMSR_SRBS_POOL_SIZE ((sizeof(struct CommandControlBlock) * ARCMSR_MAX_FREESRB_NUM)) /* ************************************************************************** ************************************************************************** */ -#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) +#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) #define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d) /* ************************************************************************** @@ -182,8 +186,8 @@ static void UDELAY(u_int32_t us) { DELAY ************************************************************************** ************************************************************************** */ -static bus_dmamap_callback_t arcmsr_map_freesrb; -static bus_dmamap_callback_t arcmsr_executesrb; +static bus_dmamap_callback_t arcmsr_map_free_srb; +static bus_dmamap_callback_t arcmsr_execute_srb; /* ************************************************************************** ************************************************************************** @@ -200,7 +204,7 @@ static device_method_t arcmsr_methods[]= DEVMETHOD(device_suspend, arcmsr_suspend), DEVMETHOD(device_resume, arcmsr_resume), DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), + DEVMETHOD(bus_driver_added, bus_generic_driver_added), { 0, 0 } }; @@ -226,29 +230,29 @@ static struct cdevsw arcmsr_cdevsw={ #if __FreeBSD_version > 502010 .d_version = D_VERSION, #endif - .d_flags = D_NEEDGIANT, - .d_open = arcmsr_open, /* open */ - .d_close = arcmsr_close, /* close */ - .d_ioctl = arcmsr_ioctl, /* ioctl */ - .d_name = "arcmsr", /* name */ + .d_flags = D_NEEDGIANT, + .d_open = arcmsr_open, /* open */ + .d_close = arcmsr_close, /* close */ + .d_ioctl = arcmsr_ioctl, /* ioctl */ + .d_name = "arcmsr", /* name */ }; #else #define ARCMSR_CDEV_MAJOR 180 static struct cdevsw arcmsr_cdevsw = { - arcmsr_open, /* open */ - arcmsr_close, /* close */ - noread, /* read */ - nowrite, /* write */ - arcmsr_ioctl, /* ioctl */ - nopoll, /* poll */ - nommap, /* mmap */ - nostrategy, /* strategy */ - "arcmsr", /* name */ - ARCMSR_CDEV_MAJOR, /* major */ - nodump, /* dump */ - nopsize, /* psize */ - 0 /* flags */ + arcmsr_open, /* open */ + arcmsr_close, /* close */ + noread, /* read */ + nowrite, /* write */ + arcmsr_ioctl, /* ioctl */ + nopoll, /* poll */ + nommap, /* mmap */ + nostrategy, /* strategy */ + "arcmsr", /* name */ + ARCMSR_CDEV_MAJOR, /* major */ + nodump, /* dump */ + nopsize, /* psize */ + 0 /* flags */ }; #endif /* @@ -259,9 +263,9 @@ static struct cdevsw arcmsr_cdevsw = { static int arcmsr_open(dev_t dev, int flags, int fmt, struct proc *proc) #else #if __FreeBSD_version < 503000 - static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) + static int arcmsr_open(dev_t dev, int flags, int fmt, struct thread *proc) #else - static int arcmsr_open(struct cdev *dev, int flags, int fmt, d_thread_t *proc) + static int arcmsr_open(struct cdev *dev, int flags, int fmt, d_thread_t *proc) #endif #endif { @@ -284,9 +288,9 @@ static struct cdevsw arcmsr_cdevsw = { static int arcmsr_close(dev_t dev, int flags, int fmt, struct proc *proc) #else #if __FreeBSD_version < 503000 - static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) + static int arcmsr_close(dev_t dev, int flags, int fmt, struct thread *proc) #else - static int arcmsr_close(struct cdev *dev, int flags, int fmt, d_thread_t *proc) + static int arcmsr_close(struct cdev *dev, int flags, int fmt, d_thread_t *proc) #endif #endif { @@ -309,9 +313,9 @@ static struct cdevsw arcmsr_cdevsw = { static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct proc *proc) #else #if __FreeBSD_version < 503000 - static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) + static int arcmsr_ioctl(dev_t dev, u_long ioctl_cmd, caddr_t arg, int flags, struct thread *proc) #else - static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, d_thread_t *proc) + static int arcmsr_ioctl(struct cdev *dev, u_long ioctl_cmd, caddr_t arg, int flags, d_thread_t *proc) #endif #endif { @@ -345,7 +349,7 @@ static u_int32_t arcmsr_disable_allintr( case ACB_ADAPTER_TYPE_B: { /* disable all outbound interrupt */ intmask_org=CHIP_REG_READ32(HBB_DOORBELL, - 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ + 0, iop2drv_doorbell_mask) & (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); /* disable outbound message0 int */ CHIP_REG_WRITE32(HBB_DOORBELL, 0, iop2drv_doorbell_mask, 0); /* disable all interrupt */ } break; @@ -584,42 +588,6 @@ static void arcmsr_async(void *cb_arg, u ********************************************************************** ********************************************************************** */ -static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag) -{ - struct AdapterControlBlock *acb=srb->acb; - union ccb * pccb=srb->pccb; - - if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - bus_dmasync_op_t op; - - if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - op = BUS_DMASYNC_POSTREAD; - } else { - op = BUS_DMASYNC_POSTWRITE; - } - bus_dmamap_sync(acb->dm_segs_dmat, srb->dm_segs_dmamap, op); - bus_dmamap_unload(acb->dm_segs_dmat, srb->dm_segs_dmamap); - } - if(stand_flag==1) { - atomic_subtract_int(&acb->srboutstandingcount, 1); - if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( - acb->srboutstandingcount < ARCMSR_RELEASE_SIMQ_LEVEL)) { - acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; - pccb->ccb_h.status |= CAM_RELEASE_SIMQ; - } - } - srb->startdone=ARCMSR_SRB_DONE; - srb->srb_flags=0; - acb->srbworkingQ[acb->workingsrb_doneindex]=srb; - acb->workingsrb_doneindex++; - acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; - xpt_done(pccb); - return; -} -/* -********************************************************************** -********************************************************************** -*/ static void arcmsr_report_sense_info(struct CommandControlBlock *srb) { union ccb * pccb=srb->pccb; @@ -695,6 +663,42 @@ static void arcmsr_abort_allcmd(struct A return; } /* +********************************************************************** +********************************************************************** +*/ +static void arcmsr_srb_complete(struct CommandControlBlock *srb, int stand_flag) +{ + struct AdapterControlBlock *acb=srb->acb; + union ccb * pccb=srb->pccb; + + if((pccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { + bus_dmasync_op_t op; + + if((pccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { + op = BUS_DMASYNC_POSTREAD; + } else { + op = BUS_DMASYNC_POSTWRITE; + } + bus_dmamap_sync(acb->dm_segs_dmat, srb->dm_segs_dmamap, op); + bus_dmamap_unload(acb->dm_segs_dmat, srb->dm_segs_dmamap); + } + if(stand_flag==1) { + atomic_subtract_int(&acb->srboutstandingcount, 1); + if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( + acb->srboutstandingcount < ARCMSR_RELEASE_SIMQ_LEVEL)) { + acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; + pccb->ccb_h.status |= CAM_RELEASE_SIMQ; + } + } + srb->startdone=ARCMSR_SRB_DONE; + srb->srb_flags=0; + acb->srbworkingQ[acb->workingsrb_doneindex]=srb; + acb->workingsrb_doneindex++; + acb->workingsrb_doneindex %= ARCMSR_MAX_FREESRB_NUM; + xpt_done(pccb); + return; +} +/* ************************************************************************** ************************************************************************** */ @@ -1009,8 +1013,8 @@ static void arcmsr_post_srb(struct Adapt { CHIP_REG_WRITE32(HBC_MessageUnit,0,inbound_queueport_low, ccb_post_stamp); } - } - break; + } + break; } return; } @@ -1595,7 +1599,7 @@ static void arcmsr_hbb_postqueue_isr(str u_int32_t flag_srb; int index; u_int16_t error; - + /* ***************************************************************************** ** areca cdb command done @@ -2236,7 +2240,7 @@ message_out: ********************************************************************* ********************************************************************* */ -static void arcmsr_executesrb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) +static void arcmsr_execute_srb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error) { struct CommandControlBlock *srb=(struct CommandControlBlock *)arg; struct AdapterControlBlock *acb=(struct AdapterControlBlock *)srb->acb; @@ -2386,18 +2390,16 @@ static void arcmsr_handle_virtual_comman xpt_done(pccb); return; } - inqdata[0] = T_PROCESSOR; - /* Periph Qualifier & Periph Dev Type */ - inqdata[1] = 0; - /* rem media bit & Dev Type Modifier */ - inqdata[2] = 0; - /* ISO, ECMA, & ANSI versions */ - inqdata[4] = 31; - /* length of additional data */ - strncpy(&inqdata[8], "Areca ", 8); - /* Vendor Identification */ - strncpy(&inqdata[16], "RAID controller ", 16); - /* Product Identification */ + inqdata[0] = T_PROCESSOR; /* Periph Qualifier & Periph Dev Type */ + inqdata[1] = 0; /* rem media bit & Dev Type Modifier */ + inqdata[2] = 0; /* ISO, ECMA, & ANSI versions */ + inqdata[3] = 0; + inqdata[4] = 31; /* length of additional data */ + inqdata[5] = 0; + inqdata[6] = 0; + inqdata[7] = 0; + strncpy(&inqdata[8], "Areca ", 8); /* Vendor Identification */ + strncpy(&inqdata[16], "RAID controller ", 16); /* Product Identification */ strncpy(&inqdata[32], "R001", 4); /* Product Revision */ memcpy(buffer, inqdata, sizeof(inqdata)); xpt_done(pccb); @@ -2460,15 +2462,23 @@ static void arcmsr_action(struct cam_sim , srb->dm_segs_dmamap , pccb->csio.data_ptr , pccb->csio.dxfer_len - , arcmsr_executesrb, srb, /*flags*/0); + , arcmsr_execute_srb, srb, /*flags*/0); if(error == EINPROGRESS) { xpt_freeze_simq(acb->psim, 1); pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } splx(s); - } else { - /* Buffer is physical */ + } + 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 */ @@ -2482,10 +2492,10 @@ static void arcmsr_action(struct cam_sim return; } segs=(struct bus_dma_segment *)pccb->csio.data_ptr; - arcmsr_executesrb(srb, segs, pccb->csio.sglist_cnt, 0); + arcmsr_execute_srb(srb, segs, pccb->csio.sglist_cnt, 0); } } else { - arcmsr_executesrb(srb, NULL, 0, 0); + arcmsr_execute_srb(srb, NULL, 0, 0); } break; } @@ -3204,7 +3214,7 @@ static u_int32_t arcmsr_iop_confirm(stru return FALSE; } post_queue_phyaddr = srb_phyaddr + ARCMSR_MAX_FREESRB_NUM*sizeof(struct CommandControlBlock) - + offsetof(struct HBB_MessageUnit, post_qbuffer); + + offsetof(struct HBB_MessageUnit, post_qbuffer); CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[0], ARCMSR_SIGNATURE_SET_CONFIG); /* driver "set config" signature */ CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[1], srb_phyaddr_hi32); /* normal should be zero */ CHIP_REG_WRITE32(HBB_RWBUFFER, 1, msgcode_rwbuffer[2], post_queue_phyaddr); /* postQ size (256+8)*4 */ @@ -3288,7 +3298,7 @@ static void arcmsr_iop_init(struct Adapt ********************************************************************** ********************************************************************** */ -static void arcmsr_map_freesrb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +static void arcmsr_map_free_srb(void *arg, bus_dma_segment_t *segs, int nseg, int error) { struct AdapterControlBlock *acb=arg; struct CommandControlBlock *srb_tmp; @@ -3351,6 +3361,7 @@ static u_int32_t arcmsr_initialize(devic max_coherent_size=ARCMSR_SRBS_POOL_SIZE; } break; + case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: { acb->adapter_type=ACB_ADAPTER_TYPE_B; max_coherent_size=ARCMSR_SRBS_POOL_SIZE+(sizeof(struct HBB_MessageUnit)); @@ -3364,7 +3375,9 @@ static u_int32_t arcmsr_initialize(devic case PCIDevVenIDARC1210: case PCIDevVenIDARC1220: case PCIDevVenIDARC1230: + case PCIDevVenIDARC1231: case PCIDevVenIDARC1260: + case PCIDevVenIDARC1261: case PCIDevVenIDARC1270: case PCIDevVenIDARC1280: case PCIDevVenIDARC1212: @@ -3383,108 +3396,71 @@ static u_int32_t arcmsr_initialize(devic return ENOMEM; } } + if(bus_dma_tag_create( /*parent*/ NULL, + /*alignemnt*/ 1, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, + /*nsegments*/ BUS_SPACE_UNRESTRICTED, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, #if __FreeBSD_version >= 502010 - if(bus_dma_tag_create( /*parent*/ NULL, - /*alignemnt*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, - /*nsegments*/ BUS_SPACE_UNRESTRICTED, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - /*lockfunc*/ NULL, - /*lockarg*/ NULL, - &acb->parent_dmat) != 0) -#else - if(bus_dma_tag_create( /*parent*/ NULL, - /*alignemnt*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ BUS_SPACE_MAXSIZE_32BIT, - /*nsegments*/ BUS_SPACE_UNRESTRICTED, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - &acb->parent_dmat) != 0) + /*lockfunc*/ NULL, + /*lockarg*/ NULL, #endif + &acb->parent_dmat) != 0) { printf("arcmsr%d: parent_dmat bus_dma_tag_create failure!\n", device_get_unit(dev)); return ENOMEM; } + /* Create a single tag describing a region large enough to hold all of the s/g lists we will need. */ -#if __FreeBSD_version >= 502010 if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ MAXBSIZE, - /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - /*lockfunc*/ busdma_lock_mutex, + /*alignment*/ 1, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ ARCMSR_MAX_SG_ENTRIES * PAGE_SIZE * ARCMSR_MAX_FREESRB_NUM, + /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, +#if __FreeBSD_version >= 502010 + /*lockfunc*/ busdma_lock_mutex, #if __FreeBSD_version >= 700025 - /*lockarg*/ &acb->qbuffer_lock, + /*lockarg*/ &acb->qbuffer_lock, #else - /*lockarg*/ &Giant, + /*lockarg*/ &Giant, #endif - &acb->dm_segs_dmat) != 0) -#else - if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 1, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ MAXBSIZE, - /*nsegments*/ ARCMSR_MAX_SG_ENTRIES, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - &acb->dm_segs_dmat) != 0) #endif + &acb->dm_segs_dmat) != 0) { bus_dma_tag_destroy(acb->parent_dmat); printf("arcmsr%d: dm_segs_dmat bus_dma_tag_create failure!\n", device_get_unit(dev)); return ENOMEM; } + /* DMA tag for our srb structures.... Allocate the freesrb memory */ -#if __FreeBSD_version >= 502010 if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 0x20, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ max_coherent_size, - /*nsegments*/ 1, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - /*lockfunc*/ NULL, - /*lockarg*/ NULL, - &acb->srb_dmat) != 0) -#else - if(bus_dma_tag_create( /*parent_dmat*/ acb->parent_dmat, - /*alignment*/ 0x20, - /*boundary*/ 0, - /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, - /*highaddr*/ BUS_SPACE_MAXADDR, - /*filter*/ NULL, - /*filterarg*/ NULL, - /*maxsize*/ max_coherent_size, - /*nsegments*/ 1, - /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, - /*flags*/ 0, - &acb->srb_dmat) != 0) + /*alignment*/ 0x20, + /*boundary*/ 0, + /*lowaddr*/ BUS_SPACE_MAXADDR_32BIT, + /*highaddr*/ BUS_SPACE_MAXADDR, + /*filter*/ NULL, + /*filterarg*/ NULL, + /*maxsize*/ max_coherent_size, + /*nsegments*/ 1, + /*maxsegsz*/ BUS_SPACE_MAXSIZE_32BIT, + /*flags*/ 0, +#if __FreeBSD_version >= 502010 + /*lockfunc*/ NULL, + /*lockarg*/ NULL, #endif + &acb->srb_dmat) != 0) { bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); @@ -3500,7 +3476,7 @@ static u_int32_t arcmsr_initialize(devic return ENXIO; } /* And permanently map them */ - if(bus_dmamap_load(acb->srb_dmat, acb->srb_dmamap, acb->uncacheptr, max_coherent_size, arcmsr_map_freesrb, acb, /*flags*/0)) { + if(bus_dmamap_load(acb->srb_dmat, acb->srb_dmamap, acb->uncacheptr, max_coherent_size, arcmsr_map_free_srb, acb, /*flags*/0)) { bus_dma_tag_destroy(acb->srb_dmat); bus_dma_tag_destroy(acb->dm_segs_dmat); bus_dma_tag_destroy(acb->parent_dmat); @@ -3518,7 +3494,7 @@ static u_int32_t arcmsr_initialize(devic case ACB_ADAPTER_TYPE_A: { u_int32_t rid0=PCIR_BAR(0); vm_offset_t mem_base0; - + acb->sys_res_arcmsr[0]=bus_alloc_resource(dev,SYS_RES_MEMORY, &rid0, 0ul, ~0ul, 0x1000, RF_ACTIVE); if(acb->sys_res_arcmsr[0] == NULL) { arcmsr_free_resource(acb); @@ -3549,10 +3525,10 @@ static u_int32_t arcmsr_initialize(devic for(i=0; i<2; i++) { if(i==0) { acb->sys_res_arcmsr[i]=bus_alloc_resource(dev,SYS_RES_MEMORY, &rid[i], - 0x20400, 0x20400+sizeof(struct HBB_DOORBELL), sizeof(struct HBB_DOORBELL), RF_ACTIVE); + 0ul, ~0ul, sizeof(struct HBB_DOORBELL), RF_ACTIVE); } else { acb->sys_res_arcmsr[i]=bus_alloc_resource(dev, SYS_RES_MEMORY, &rid[i], - 0x0fa00, 0x0fa00+sizeof(struct HBB_RWBUFFER), sizeof(struct HBB_RWBUFFER), RF_ACTIVE); + 0ul, ~0ul, sizeof(struct HBB_RWBUFFER), RF_ACTIVE); } if(acb->sys_res_arcmsr[i] == NULL) { arcmsr_free_resource(acb); @@ -3751,6 +3727,7 @@ static u_int32_t arcmsr_probe(device_t d { u_int32_t id; static char buf[256]; + char x_type[]={"X-TYPE"}; char *type; int raid6 = 1; @@ -3759,8 +3736,9 @@ static u_int32_t arcmsr_probe(device_t d } switch(id=pci_get_devid(dev)) { case PCIDevVenIDARC1110: - case PCIDevVenIDARC1210: + case PCIDevVenIDARC1200: case PCIDevVenIDARC1201: + case PCIDevVenIDARC1210: raid6 = 0; /*FALLTHRU*/ case PCIDevVenIDARC1120: @@ -3769,7 +3747,9 @@ static u_int32_t arcmsr_probe(device_t d case PCIDevVenIDARC1170: case PCIDevVenIDARC1220: case PCIDevVenIDARC1230: + case PCIDevVenIDARC1231: case PCIDevVenIDARC1260: + case PCIDevVenIDARC1261: case PCIDevVenIDARC1270: case PCIDevVenIDARC1280: type = "SATA"; @@ -3786,9 +3766,11 @@ static u_int32_t arcmsr_probe(device_t d type = "SAS 6G"; break; default: - type = "X-TYPE"; + type = x_type; break; } + if(type == x_type) + return(ENXIO); sprintf(buf, "Areca %s Host Adapter RAID Controller %s\n", type, raid6 ? "(RAID6 capable)" : ""); device_set_desc_copy(dev, buf); return 0; Modified: stable/7/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/7/sys/dev/arcmsr/arcmsr.h Thu Nov 25 20:05:11 2010 (r215838) +++ stable/7/sys/dev/arcmsr/arcmsr.h Thu Nov 25 20:09:56 2010 (r215839) @@ -37,22 +37,21 @@ ************************************************************************** * $FreeBSD$ */ -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.17 2010-07-15" -#define ARCMSR_SCSI_INITIATOR_ID 255 -#define ARCMSR_DEV_SECTOR_SIZE 512 -#define ARCMSR_MAX_XFER_SECTORS 4096 -#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ -#define ARCMSR_MAX_TARGETLUN 8 /*8*/ -#define ARCMSR_MAX_CHIPTYPE_NUM 4 -#define ARCMSR_MAX_OUTSTANDING_CMD 256 -#define ARCMSR_MAX_START_JOB 257 -#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD -#define ARCMSR_MAX_FREESRB_NUM 320 -#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ -#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ -#define ARCMSR_MAX_ADAPTER 4 -#define ARCMSR_RELEASE_SIMQ_LEVEL 230 -#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ +#define ARCMSR_SCSI_INITIATOR_ID 255 +#define ARCMSR_DEV_SECTOR_SIZE 512 +#define ARCMSR_MAX_XFER_SECTORS 4096 +#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ +#define ARCMSR_MAX_TARGETLUN 8 /*8*/ +#define ARCMSR_MAX_CHIPTYPE_NUM 4 +#define ARCMSR_MAX_OUTSTANDING_CMD 256 +#define ARCMSR_MAX_START_JOB 257 +#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD +#define ARCMSR_MAX_FREESRB_NUM 320 +#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ +#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ +#define ARCMSR_MAX_ADAPTER 4 +#define ARCMSR_RELEASE_SIMQ_LEVEL 230 +#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ /* ********************************************************************* */ @@ -74,45 +73,51 @@ ** ********************************************************************************** */ -#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ -#define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1160 0x1160 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1170 0x1170 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1210 0x1210 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1220 0x1220 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1230 0x1230 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1260 0x1260 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1270 0x1270 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1280 0x1280 /* Device ID */ +#define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ +#define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1160 0x1160 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1170 0x1170 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1200 0x1200 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1210 0x1210 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1212 0x1212 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1220 0x1220 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1222 0x1222 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1380 0x1380 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1381 0x1381 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1680 0x1680 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ -#define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1230 0x1230 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1231 0x1231 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1260 0x1260 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1261 0x1261 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1270 0x1270 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1280 0x1280 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1380 0x1380 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1381 0x1381 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1680 0x1680 /* Device ID */ +#define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ -#define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1160 0x116017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1270 0x127017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1280 0x128017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1160 0x116017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1200 0x120017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1380 0x138017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1381 0x138117D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ -#define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1261 0x126117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1270 0x127017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1280 0x128017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1380 0x138017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1381 0x138117D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ +#define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ #ifndef PCIR_BARS @@ -120,30 +125,30 @@ #define PCIR_BAR(x) (PCIR_BARS + (x) * 4) #endif -#define PCI_BASE_ADDR0 0x10 -#define PCI_BASE_ADDR1 0x14 -#define PCI_BASE_ADDR2 0x18 -#define PCI_BASE_ADDR3 0x1C -#define PCI_BASE_ADDR4 0x20 -#define PCI_BASE_ADDR5 0x24 +#define PCI_BASE_ADDR0 0x10 +#define PCI_BASE_ADDR1 0x14 +#define PCI_BASE_ADDR2 0x18 +#define PCI_BASE_ADDR3 0x1C +#define PCI_BASE_ADDR4 0x20 +#define PCI_BASE_ADDR5 0x24 /* ********************************************************************************** ** ********************************************************************************** */ -#define ARCMSR_SCSICMD_IOCTL 0x77 -#define ARCMSR_CDEVSW_IOCTL 0x88 -#define ARCMSR_MESSAGE_FAIL 0x0001 -#define ARCMSR_MESSAGE_SUCCESS 0x0000 +#define ARCMSR_SCSICMD_IOCTL 0x77 +#define ARCMSR_CDEVSW_IOCTL 0x88 +#define ARCMSR_MESSAGE_FAIL 0x0001 +#define ARCMSR_MESSAGE_SUCCESS 0x0000 /* ********************************************************************************** ** ********************************************************************************** */ -#define arcmsr_ccbsrb_ptr spriv_ptr0 -#define arcmsr_ccbacb_ptr spriv_ptr1 -#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) -#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) +#define arcmsr_ccbsrb_ptr spriv_ptr0 +#define arcmsr_ccbacb_ptr spriv_ptr1 +#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) +#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) #define get_min(x,y) ((x) < (y) ? (x) : (y)) #define get_max(x,y) ((x) < (y) ? (y) : (x)) /* @@ -210,9 +215,9 @@ struct CMD_MESSAGE_FIELD { #define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD) /* ARECA IOCTL ReturnCode */ -#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 -#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 -#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F +#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 +#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 +#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F #define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 /* ************************************************************************ @@ -533,32 +538,32 @@ struct CMD_MESSAGE_FIELD { ************************************************************************************************ */ /* signature of set and get firmware config */ -#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 -#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 +#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 +#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 /* message code of inbound message register */ -#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 -#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 -#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 -#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 -#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 -#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 -#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 -#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 -#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 +#define ARCMSR_INBOUND_MESG0_NOP 0x00000000 +#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 +#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 +#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 +#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 +#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 +#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 +#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 +#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 /* doorbell interrupt generator */ -#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 -#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 -#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 -#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 +#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 +#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 +#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 +#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 /* srb areca cdb flag */ -#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 -#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 -#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 +#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 +#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 +#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 #define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 #define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 /* outbound firmware ok */ -#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 +#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 /* ********************************** ** @@ -603,15 +608,15 @@ struct QBUFFER { #define ARCMSR_FW_CFGVER_OFFSET 25 struct FIRMWARE_INFO { - u_int32_t signature; /*0,00-03*/ - u_int32_t request_len; /*1,04-07*/ - u_int32_t numbers_queue; /*2,08-11*/ - u_int32_t sdram_size; /*3,12-15*/ - u_int32_t ide_channels; /*4,16-19*/ - char vendor[40]; /*5,20-59*/ - char model[8]; /*15,60-67*/ - char firmware_ver[16]; /*17,68-83*/ - char device_map[16]; /*21,84-99*/ + u_int32_t signature; /*0,00-03*/ + u_int32_t request_len; /*1,04-07*/ + u_int32_t numbers_queue; /*2,08-11*/ + u_int32_t sdram_size; /*3,12-15*/ + u_int32_t ide_channels; /*4,16-19*/ + char vendor[40]; /*5,20-59*/ + char model[8]; /*15,60-67*/ + char firmware_ver[16]; /*17,68-83*/ + char device_map[16]; /*21,84-99*/ u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ char cfgSerial[16]; /*26,104-119*/ u_int32_t cfgPicStatus; /*30,120-123*/ @@ -649,33 +654,33 @@ struct FIRMWARE_INFO { ************************************************************************************************ */ struct ARCMSR_CDB { - u_int8_t Bus; /* 00h should be 0 */ - u_int8_t TargetID; /* 01h should be 0--15 */ - u_int8_t LUN; /* 02h should be 0--7 */ - u_int8_t Function; /* 03h should be 1 */ + u_int8_t Bus; /* 00h should be 0 */ + u_int8_t TargetID; /* 01h should be 0--15 */ + u_int8_t LUN; /* 02h should be 0--7 */ + u_int8_t Function; /* 03h should be 1 */ - u_int8_t CdbLength; /* 04h not used now */ - u_int8_t sgcount; /* 05h */ - u_int8_t Flags; /* 06h */ -#define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01 /* bit 0: 0(256) / 1(512) bytes */ -#define ARCMSR_CDB_FLAG_BIOS 0x02 /* bit 1: 0(from driver) / 1(from BIOS) */ -#define ARCMSR_CDB_FLAG_WRITE 0x04 /* bit 2: 0(Data in) / 1(Data out) */ -#define ARCMSR_CDB_FLAG_SIMPLEQ 0x00 /* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */ -#define ARCMSR_CDB_FLAG_HEADQ 0x08 -#define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 + u_int8_t CdbLength; /* 04h not used now */ + u_int8_t sgcount; /* 05h */ + u_int8_t Flags; /* 06h */ +#define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01 /* bit 0: 0(256) / 1(512) bytes */ +#define ARCMSR_CDB_FLAG_BIOS 0x02 /* bit 1: 0(from driver) / 1(from BIOS) */ +#define ARCMSR_CDB_FLAG_WRITE 0x04 /* bit 2: 0(Data in) / 1(Data out) */ +#define ARCMSR_CDB_FLAG_SIMPLEQ 0x00 /* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */ +#define ARCMSR_CDB_FLAG_HEADQ 0x08 +#define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 u_int8_t msgPages; /* 07h */ - u_int32_t Context; /* 08h Address of this request */ - u_int32_t DataLength; /* 0ch not used now */ + u_int32_t Context; /* 08h Address of this request */ + u_int32_t DataLength; /* 0ch not used now */ - u_int8_t Cdb[16]; /* 10h SCSI CDB */ + u_int8_t Cdb[16]; /* 10h SCSI CDB */ /* ******************************************************** **Device Status : the same from SCSI bus if error occur ** SCSI bus status codes. ******************************************************** */ - u_int8_t DeviceStatus; /* 20h if error */ + u_int8_t DeviceStatus; /* 20h if error */ #define SCSISTAT_GOOD 0x00 #define SCSISTAT_CHECK_CONDITION 0x02 #define SCSISTAT_CONDITION_MET 0x04 @@ -685,15 +690,15 @@ struct ARCMSR_CDB { #define SCSISTAT_RESERVATION_CONFLICT 0x18 #define SCSISTAT_COMMAND_TERMINATED 0x22 #define SCSISTAT_QUEUE_FULL 0x28 -#define ARCMSR_DEV_SELECT_TIMEOUT 0xF0 -#define ARCMSR_DEV_ABORTED 0xF1 -#define ARCMSR_DEV_INIT_FAIL 0xF2 +#define ARCMSR_DEV_SELECT_TIMEOUT 0xF0 +#define ARCMSR_DEV_ABORTED 0xF1 +#define ARCMSR_DEV_INIT_FAIL 0xF2 - u_int8_t SenseData[15]; /* 21h output */ + u_int8_t SenseData[15]; /* 21h output */ union { - struct SG32ENTRY sg32entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h Scatter gather address */ - struct SG64ENTRY sg64entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h */ + struct SG32ENTRY sg32entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h Scatter gather address */ + struct SG64ENTRY sg64entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h */ } u; }; /* @@ -706,23 +711,23 @@ struct ARCMSR_CDB { */ struct CommandControlBlock { struct ARCMSR_CDB arcmsr_cdb; /* 0 -503 (size of CDB=504): arcmsr messenger scsi command descriptor size 504 bytes */ - u_int32_t cdb_shifted_phyaddr; /* 504-507 */ + u_int32_t cdb_shifted_phyaddr; /* 504-507 */ u_int32_t arc_cdb_size; /* 508-511 */ /* ======================512+32 bytes============================ */ #if defined(__x86_64__) || defined(__amd64__) || defined(__ia64__) || defined(__sparc64__) || defined(__powerpc__) union ccb *pccb; /* 512-515 516-519 pointer of freebsd scsi command */ struct AdapterControlBlock *acb; /* 520-523 524-527 */ - bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ - u_int16_t srb_flags; /* 536-537 */ - u_int16_t startdone; /* 538-539 */ - u_int32_t reserved2; /* 540-543 */ + bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ + u_int16_t srb_flags; /* 536-537 */ + u_int16_t startdone; /* 538-539 */ + u_int32_t reserved2; /* 540-543 */ #else union ccb *pccb; /* 512-515 pointer of freebsd scsi command */ struct AdapterControlBlock *acb; /* 516-519 */ - bus_dmamap_t dm_segs_dmamap; /* 520-523 */ - u_int16_t srb_flags; /* 524-525 */ - u_int16_t startdone; /* 526-527 */ - u_int32_t reserved2[4]; /* 528-531 532-535 536-539 540-543 */ + bus_dmamap_t dm_segs_dmamap; /* 520-523 */ + u_int16_t srb_flags; /* 524-525 */ + u_int16_t startdone; /* 526-527 */ + u_int32_t reserved2[4]; /* 528-531 532-535 536-539 540-543 */ #endif /* ========================================================== */ /* struct callout ccb_callout; */ @@ -752,37 +757,37 @@ struct CommandControlBlock { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Thu Nov 25 21:42:37 2010 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 0ABCE1065696; Thu, 25 Nov 2010 21:42:37 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC0B48FC15; Thu, 25 Nov 2010 21:42:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAPLgaU5018360; Thu, 25 Nov 2010 21:42:36 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAPLgaTS018358; Thu, 25 Nov 2010 21:42:36 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011252142.oAPLgaTS018358@svn.freebsd.org> From: Brian Somers Date: Thu, 25 Nov 2010 21:42:36 +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: r215842 - stable/7/sbin/natd 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: Thu, 25 Nov 2010 21:42:37 -0000 Author: brian Date: Thu Nov 25 21:42:36 2010 New Revision: 215842 URL: http://svn.freebsd.org/changeset/base/215842 Log: MF8: Don't abend if we get ENOMEM from sysctl(3). The data returned is sufficient Modified: stable/7/sbin/natd/natd.c Directory Properties: stable/7/sbin/natd/ (props changed) Modified: stable/7/sbin/natd/natd.c ============================================================================== --- stable/7/sbin/natd/natd.c Thu Nov 25 20:35:49 2010 (r215841) +++ stable/7/sbin/natd/natd.c Thu Nov 25 21:42:36 2010 (r215842) @@ -885,7 +885,7 @@ SetAliasAddressFromIfName(const char *if err(1, "iflist-sysctl-estimate"); if ((buf = malloc(needed)) == NULL) errx(1, "malloc failed"); - if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1) + if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1 && errno != ENOMEM) err(1, "iflist-sysctl-get"); lim = buf + needed; /* From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 02:18:52 2010 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 7BAA9106564A; Fri, 26 Nov 2010 02:18:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69F1D8FC0C; Fri, 26 Nov 2010 02:18:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQ2Iqvv024411; Fri, 26 Nov 2010 02:18:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQ2Iqan024409; Fri, 26 Nov 2010 02:18:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011260218.oAQ2Iqan024409@svn.freebsd.org> From: Xin LI Date: Fri, 26 Nov 2010 02:18: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: r215852 - stable/7/release 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, 26 Nov 2010 02:18:52 -0000 Author: delphij Date: Fri Nov 26 02:18:52 2010 New Revision: 215852 URL: http://svn.freebsd.org/changeset/base/215852 Log: MFC r214426: Add a short note about kernel modules in FIXIT mode. Modified: stable/7/release/fixit.profile Directory Properties: stable/7/release/ (props changed) stable/7/release/doc/ (props changed) stable/7/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/7/release/picobsd/tinyware/login/ (props changed) Modified: stable/7/release/fixit.profile ============================================================================== --- stable/7/release/fixit.profile Fri Nov 26 02:15:39 2010 (r215851) +++ stable/7/release/fixit.profile Fri Nov 26 02:18:52 2010 (r215852) @@ -25,6 +25,10 @@ echo '| You might want to symlink /mnt/e echo '| to /etc after mounting a root filesystem from your disk. |' echo '| tar(1) will not restore all permissions correctly otherwise! |' echo '| |' +echo '| In order to load kernel modules you might want to add the |' +echo '| fixit media to the kern.module_path sysctl variable so that |' +echo '| the kernel knows where to find them. |' +echo '| |' echo '| Note: you can use the arrow keys to browse through the |' echo '| command history of this shell. |' echo '+---------------------------------------------------------------+' From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 16:24:56 2010 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 0778C1065675; Fri, 26 Nov 2010 16:24:56 +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 E7C7E8FC17; Fri, 26 Nov 2010 16:24:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQGOtRh054563; Fri, 26 Nov 2010 16:24:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQGOtfF054559; Fri, 26 Nov 2010 16:24:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011261624.oAQGOtfF054559@svn.freebsd.org> From: Andriy Gapon Date: Fri, 26 Nov 2010 16:24:55 +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: r215874 - in stable/7: lib/libkvm sys/amd64/amd64 sys/amd64/include 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, 26 Nov 2010 16:24:56 -0000 Author: avg Date: Fri Nov 26 16:24:55 2010 New Revision: 215874 URL: http://svn.freebsd.org/changeset/base/215874 Log: MFC r215133: amd64: introduce minidump version 2 This should reduce size of the minidump. Compatibility with version 1 should be preserved in libkvm. Modified: stable/7/lib/libkvm/kvm_minidump_amd64.c stable/7/sys/amd64/amd64/minidump_machdep.c stable/7/sys/amd64/include/minidump.h Directory Properties: stable/7/lib/libkvm/ (props changed) 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/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- stable/7/lib/libkvm/kvm_minidump_amd64.c Fri Nov 26 16:21:44 2010 (r215873) +++ stable/7/lib/libkvm/kvm_minidump_amd64.c Fri Nov 26 16:24:55 2010 (r215874) @@ -67,7 +67,7 @@ struct vmstate { struct minidumphdr hdr; void *hpt_head[HPT_SIZE]; uint64_t *bitmap; - uint64_t *ptemap; + uint64_t *page_map; }; static void @@ -127,8 +127,8 @@ _kvm_minidump_freevtop(kvm_t *kd) if (vm->bitmap) free(vm->bitmap); - if (vm->ptemap) - free(vm->ptemap); + if (vm->page_map) + free(vm->page_map); free(vm); kd->vmst = NULL; } @@ -157,7 +157,12 @@ _kvm_minidump_initvtop(kvm_t *kd) _kvm_err(kd, kd->program, "not a minidump for this platform"); return (-1); } - if (vmst->hdr.version != MINIDUMP_VERSION) { + + /* + * NB: amd64 minidump header is binary compatible between version 1 + * and version 2; this may not be the case for the future versions. + */ + if (vmst->hdr.version != MINIDUMP_VERSION && vmst->hdr.version != 1) { _kvm_err(kd, kd->program, "wrong minidump version. expected %d got %d", MINIDUMP_VERSION, vmst->hdr.version); return (-1); @@ -178,17 +183,17 @@ _kvm_minidump_initvtop(kvm_t *kd) } off += round_page(vmst->hdr.bitmapsize); - vmst->ptemap = _kvm_malloc(kd, vmst->hdr.ptesize); - if (vmst->ptemap == NULL) { - _kvm_err(kd, kd->program, "cannot allocate %d bytes for ptemap", vmst->hdr.ptesize); + vmst->page_map = _kvm_malloc(kd, vmst->hdr.pmapsize); + if (vmst->page_map == NULL) { + _kvm_err(kd, kd->program, "cannot allocate %d bytes for page_map", vmst->hdr.pmapsize); return (-1); } - if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { - _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); + if (pread(kd->pmfd, vmst->page_map, vmst->hdr.pmapsize, off) != + vmst->hdr.pmapsize) { + _kvm_err(kd, kd->program, "cannot read %d bytes for page_map", vmst->hdr.pmapsize); return (-1); } - off += vmst->hdr.ptesize; + off += vmst->hdr.pmapsize; /* build physical address hash table for sparse pages */ inithash(kd, vmst->bitmap, vmst->hdr.bitmapsize, off); @@ -197,7 +202,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } static int -_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa) +_kvm_minidump_vatop_v1(kvm_t *kd, u_long va, off_t *pa) { struct vmstate *vm; u_long offset; @@ -212,7 +217,7 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT; - pte = vm->ptemap[pteindex]; + pte = vm->page_map[pteindex]; if (((u_long)pte & PG_V) == 0) { _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); goto invalid; @@ -244,6 +249,78 @@ invalid: return (0); } +static int +_kvm_minidump_vatop(kvm_t *kd, u_long va, off_t *pa) +{ + pt_entry_t pt[NPTEPG]; + struct vmstate *vm; + u_long offset; + pd_entry_t pde; + pd_entry_t pte; + u_long pteindex; + u_long pdeindex; + int i; + u_long a; + off_t ofs; + + vm = kd->vmst; + offset = va & PAGE_MASK; + + if (va >= vm->hdr.kernbase) { + pdeindex = (va - vm->hdr.kernbase) >> PDRSHIFT; + pde = vm->page_map[pdeindex]; + if (((u_long)pde & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_vatop: pde not valid"); + goto invalid; + } + if ((pde & PG_PS) == 0) { + a = pde & PG_FRAME; + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: pt physical address 0x%lx not in minidump", a); + goto invalid; + } + if (pread(kd->pmfd, &pt, PAGE_SIZE, ofs) != PAGE_SIZE) { + _kvm_err(kd, kd->program, "cannot read %d bytes for pt", PAGE_SIZE); + return (-1); + } + pteindex = (va >> PAGE_SHIFT) & ((1ul << NPTEPGSHIFT) - 1); + pte = pt[pteindex]; + if (((u_long)pte & PG_V) == 0) { + _kvm_err(kd, kd->program, "_kvm_vatop: pte not valid"); + goto invalid; + } + a = pte & PG_FRAME; + } else { + a = pde & PG_PS_FRAME; + a += (va & PDRMASK) ^ offset; + } + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: physical address 0x%lx not in minidump", a); + goto invalid; + } + *pa = ofs + offset; + return (PAGE_SIZE - offset); + } else if (va >= vm->hdr.dmapbase && va < vm->hdr.dmapend) { + a = (va - vm->hdr.dmapbase) & ~PAGE_MASK; + ofs = hpt_find(kd, a); + if (ofs == -1) { + _kvm_err(kd, kd->program, "_kvm_vatop: direct map address 0x%lx not in minidump", va); + goto invalid; + } + *pa = ofs + offset; + return (PAGE_SIZE - offset); + } else { + _kvm_err(kd, kd->program, "_kvm_vatop: virtual address 0x%lx not minidumped", va); + goto invalid; + } + +invalid: + _kvm_err(kd, 0, "invalid address (0x%lx)", va); + return (0); +} + int _kvm_minidump_kvatop(kvm_t *kd, u_long va, off_t *pa) { @@ -252,5 +329,8 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long v _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); return (0); } - return (_kvm_minidump_vatop(kd, va, pa)); + if (((struct vmstate *)kd->vmst)->hdr.version == 1) + return (_kvm_minidump_vatop_v1(kd, va, pa)); + else + return (_kvm_minidump_vatop(kd, va, pa)); } Modified: stable/7/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/minidump_machdep.c Fri Nov 26 16:21:44 2010 (r215873) +++ stable/7/sys/amd64/amd64/minidump_machdep.c Fri Nov 26 16:24:55 2010 (r215874) @@ -184,63 +184,91 @@ blk_write(struct dumperinfo *di, char *p } /* A fake page table page, to avoid having to handle both 4K and 2M pages */ -static pt_entry_t fakept[NPTEPG]; +static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { uint64_t dumpsize; - uint32_t ptesize; + uint32_t pmapsize; vm_offset_t va; int error; uint64_t bits; uint64_t *pdp, *pd, *pt, pa; - int i, j, k, bit; + int i, j, k, n, bit; + int retry_count; struct minidumphdr mdhdr; + retry_count = 0; + retry: + retry_count++; counter = 0; /* Walk page table pages, set bits in vm_page_dump */ - ptesize = 0; + pmapsize = 0; pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, - kernel_vm_end); va += NBPDR) { - i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); + kernel_vm_end); ) { /* * We always write a page, even if it is zero. Each - * page written corresponds to 2MB of space + * page written corresponds to 1GB of space */ - ptesize += PAGE_SIZE; - if ((pdp[i] & PG_V) == 0) + pmapsize += PAGE_SIZE; + i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); + if ((pdp[i] & PG_V) == 0) { + va += NBPDP; continue; - pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); - j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1)); - if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - /* This is an entire 2M page. */ - pa = pd[j] & PG_PS_FRAME; - for (k = 0; k < NPTEPG; k++) { + } + + /* + * 1GB page is represented as 512 2MB pages in a dump. + */ + if ((pdp[i] & PG_PS) != 0) { + va += NBPDP; + pa = pdp[i] & PG_PS_FRAME; + for (n = 0; n < NPDEPG * NPTEPG; n++) { if (is_dumpable(pa)) dump_add_page(pa); pa += PAGE_SIZE; } continue; } - if ((pd[j] & PG_V) == PG_V) { - /* set bit for each valid page in this 2MB block */ - pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); - for (k = 0; k < NPTEPG; k++) { - if ((pt[k] & PG_V) == PG_V) { - pa = pt[k] & PG_FRAME; + + pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); + for (n = 0; n < NPDEPG; n++, va += NBPDR) { + j = (va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1); + + if ((pd[j] & PG_V) == 0) + continue; + + if ((pd[j] & PG_PS) != 0) { + /* This is an entire 2M page. */ + pa = pd[j] & PG_PS_FRAME; + for (k = 0; k < NPTEPG; k++) { if (is_dumpable(pa)) dump_add_page(pa); + pa += PAGE_SIZE; } + continue; + } + + pa = pd[j] & PG_FRAME; + /* set bit for this PTE page */ + if (is_dumpable(pa)) + dump_add_page(pa); + /* and for each valid page in this 2MB block */ + pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); + for (k = 0; k < NPTEPG; k++) { + if ((pt[k] & PG_V) == 0) + continue; + pa = pt[k] & PG_FRAME; + if (is_dumpable(pa)) + dump_add_page(pa); } - } else { - /* nothing, we're going to dump a null page */ } } /* Calculate dump size. */ - dumpsize = ptesize; + dumpsize = pmapsize; dumpsize += round_page(msgbufp->msg_size); dumpsize += round_page(vm_page_dump_size); for (i = 0; i < vm_page_dump_size / sizeof(*vm_page_dump); i++) { @@ -261,7 +289,7 @@ minidumpsys(struct dumperinfo *di) /* Determine dump offset on device. */ if (di->mediasize < SIZEOF_METADATA + dumpsize + sizeof(kdh) * 2) { - error = ENOSPC; + error = E2BIG; goto fail; } dumplo = di->mediaoffset + di->mediasize - dumpsize; @@ -274,7 +302,7 @@ minidumpsys(struct dumperinfo *di) mdhdr.version = MINIDUMP_VERSION; mdhdr.msgbufsize = msgbufp->msg_size; mdhdr.bitmapsize = vm_page_dump_size; - mdhdr.ptesize = ptesize; + mdhdr.pmapsize = pmapsize; mdhdr.kernbase = VM_MIN_KERNEL_ADDRESS; mdhdr.dmapbase = DMAP_MIN_ADDRESS; mdhdr.dmapend = DMAP_MAX_ADDRESS; @@ -291,9 +319,9 @@ minidumpsys(struct dumperinfo *di) dumplo += sizeof(kdh); /* Dump my header */ - bzero(&fakept, sizeof(fakept)); - bcopy(&mdhdr, &fakept, sizeof(mdhdr)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + bzero(&fakepd, sizeof(fakepd)); + bcopy(&mdhdr, &fakepd, sizeof(mdhdr)); + error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE); if (error) goto fail; @@ -307,55 +335,49 @@ minidumpsys(struct dumperinfo *di) if (error) goto fail; - /* Dump kernel page table pages */ + /* Dump kernel page directory pages */ + bzero(fakepd, sizeof(fakepd)); pdp = (uint64_t *)PHYS_TO_DMAP(KPDPphys); for (va = VM_MIN_KERNEL_ADDRESS; va < MAX(KERNBASE + NKPT * NBPDR, - kernel_vm_end); va += NBPDR) { + kernel_vm_end); va += NBPDP) { i = (va >> PDPSHIFT) & ((1ul << NPDPEPGSHIFT) - 1); + /* We always write a page, even if it is zero */ if ((pdp[i] & PG_V) == 0) { - bzero(fakept, sizeof(fakept)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE); if (error) goto fail; - /* flush, in case we reuse fakept in the same block */ + /* flush, in case we reuse fakepd in the same block */ error = blk_flush(di); if (error) goto fail; continue; } - pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); - j = ((va >> PDRSHIFT) & ((1ul << NPDEPGSHIFT) - 1)); - if ((pd[j] & (PG_PS | PG_V)) == (PG_PS | PG_V)) { - /* This is a single 2M block. Generate a fake PTP */ - pa = pd[j] & PG_PS_FRAME; - for (k = 0; k < NPTEPG; k++) { - fakept[k] = (pa + (k * PAGE_SIZE)) | PG_V | PG_RW | PG_A | PG_M; - } - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); + + /* 1GB page is represented as 512 2MB pages in a dump */ + if ((pdp[i] & PG_PS) != 0) { + /* PDPE and PDP have identical layout in this case */ + fakepd[0] = pdp[i]; + for (j = 1; j < NPDEPG; j++) + fakepd[j] = fakepd[j - 1] + NBPDR; + error = blk_write(di, (char *)&fakepd, 0, PAGE_SIZE); if (error) goto fail; - /* flush, in case we reuse fakept in the same block */ + /* flush, in case we reuse fakepd in the same block */ error = blk_flush(di); if (error) goto fail; + bzero(fakepd, sizeof(fakepd)); continue; } - if ((pd[j] & PG_V) == PG_V) { - pt = (uint64_t *)PHYS_TO_DMAP(pd[j] & PG_FRAME); - error = blk_write(di, (char *)pt, 0, PAGE_SIZE); - if (error) - goto fail; - } else { - bzero(fakept, sizeof(fakept)); - error = blk_write(di, (char *)&fakept, 0, PAGE_SIZE); - if (error) - goto fail; - /* flush, in case we reuse fakept in the same block */ - error = blk_flush(di); - if (error) - goto fail; - } + + pd = (uint64_t *)PHYS_TO_DMAP(pdp[i] & PG_FRAME); + error = blk_write(di, (char *)pd, 0, PAGE_SIZE); + if (error) + goto fail; + error = blk_flush(di); + if (error) + goto fail; } /* Dump memory chunks */ @@ -391,12 +413,21 @@ minidumpsys(struct dumperinfo *di) if (error < 0) error = -error; - if (error == ECANCELED) - printf("\nDump aborted\n"); - else if (error == ENOSPC) - printf("\nDump failed. Partition too small.\n"); + printf("\n"); + if (error == ENOSPC) { + printf("Dump map grown while dumping. "); + if (retry_count < 5) { + printf("Retrying...\n"); + goto retry; + } + printf("Dump failed.\n"); + } + else if (error == ECANCELED) + printf("Dump aborted\n"); + else if (error == E2BIG) + printf("Dump failed. Partition too small.\n"); else - printf("\n** DUMP FAILED (ERROR %d) **\n", error); + printf("** DUMP FAILED (ERROR %d) **\n", error); } void Modified: stable/7/sys/amd64/include/minidump.h ============================================================================== --- stable/7/sys/amd64/include/minidump.h Fri Nov 26 16:21:44 2010 (r215873) +++ stable/7/sys/amd64/include/minidump.h Fri Nov 26 16:24:55 2010 (r215874) @@ -30,14 +30,14 @@ #define _MACHINE_MINIDUMP_H_ 1 #define MINIDUMP_MAGIC "minidump FreeBSD/amd64" -#define MINIDUMP_VERSION 1 +#define MINIDUMP_VERSION 2 struct minidumphdr { char magic[24]; uint32_t version; uint32_t msgbufsize; uint32_t bitmapsize; - uint32_t ptesize; + uint32_t pmapsize; uint64_t kernbase; uint64_t dmapbase; uint64_t dmapend; From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 17:14:38 2010 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 9F77C10656A3; Fri, 26 Nov 2010 17:14:38 +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 8DBEB8FC17; Fri, 26 Nov 2010 17:14:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQHEcn7059702; Fri, 26 Nov 2010 17:14:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQHEce1059700; Fri, 26 Nov 2010 17:14:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011261714.oAQHEce1059700@svn.freebsd.org> From: Andriy Gapon Date: Fri, 26 Nov 2010 17:14: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: r215875 - stable/7/sys/i386/cpufreq 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, 26 Nov 2010 17:14:38 -0000 Author: avg Date: Fri Nov 26 17:14:38 2010 New Revision: 215875 URL: http://svn.freebsd.org/changeset/base/215875 Log: MFC r215131: make it possible to actually enable hwpstate_verbose Modified: stable/7/sys/i386/cpufreq/hwpstate.c 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/i386/cpufreq/hwpstate.c ============================================================================== --- stable/7/sys/i386/cpufreq/hwpstate.c Fri Nov 26 16:24:55 2010 (r215874) +++ stable/7/sys/i386/cpufreq/hwpstate.c Fri Nov 26 17:14:38 2010 (r215875) @@ -117,8 +117,9 @@ static int hwpstate_get_info_from_msr(de static int hwpstate_goto_pstate(device_t dev, int pstate_id); static int hwpstate_verbose = 0; -SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RDTUN, +SYSCTL_INT(_debug, OID_AUTO, hwpstate_verbose, CTLFLAG_RW | CTLFLAG_TUN, &hwpstate_verbose, 0, "Debug hwpstate"); +TUNABLE_INT("debug.hwpstate_verbose", &hwpstate_verbose); static device_method_t hwpstate_methods[] = { /* Device interface */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 19:48:27 2010 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 D3C1A1065672; Fri, 26 Nov 2010 19:48:27 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF7038FC14; Fri, 26 Nov 2010 19:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQJmRSp071620; Fri, 26 Nov 2010 19:48:27 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQJmRKN071610; Fri, 26 Nov 2010 19:48:27 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011261948.oAQJmRKN071610@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 19:48:27 +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: r215879 - in stable/7/sys: dev/bce dev/bge dev/mii dev/msk dev/nfe dev/stge net 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, 26 Nov 2010 19:48:27 -0000 Author: marius Date: Fri Nov 26 19:48:27 2010 New Revision: 215879 URL: http://svn.freebsd.org/changeset/base/215879 Log: MFC: r214608, r215297(partial), r215713 o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control support in mii(4): - Merge generic flow control advertisement (which can be enabled by passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD, IFM_FLOW isn't implemented as a global option via the "don't care mask" but instead as a media specific option this. This has the following advantages: o allows flow control advertisement with autonegotiation to be turned on and off via ifconfig(8) with the default typically being off (though MIIF_FORCEPAUSE has been added causing flow control to be always advertised, allowing to easily MFC this changes for drivers that previously used home-grown support for flow control that behaved that way without breaking POLA) o allows to deal with PHY drivers where flow control advertisement with manual selection doesn't work or at least isn't implemented, like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4), by setting MIIF_NOMANPAUSE o the available combinations of media options are readily available from the `ifconfig -m` output - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so these are understood by ifconfig(8). o Make the master/slave support in mii(4) actually usable: - Change IFM_ETH_MASTER from being implemented as a global option via the "don't care mask" to a media specific one as it actually is only applicable to IFM_1000_T to date. - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to actually configure manually selected slave mode (like we also do in the PHY specific implementations). - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it is understood by ifconfig(8). o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4), e1000phy(4) and ip1000phy(4) to use the generic flow control support instead of home-grown solutions via IFM_FLAGs. This includes changing these PHY drivers and smcphy(4) to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set) and implemented for these media variants, i.e. typically only for copper. o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0 and some IFM_FLAGn. o Switch brgphy(4) to add at least the the supported copper media based on the contents of the BMSR via mii_phy_add_media() instead of hardcoding them. The latter approach seems to have developed historically, besides causing unnecessary code duplication it was also undesirable because brgphy_mii_phy_auto() already based the capability advertisement on the contents of the BMSR though. o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not just BCM5701. Apparently this was a misinterpretation of a workaround in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but this doesn't mean we can't set these as well on other PHYs for manual media selection. o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so IFM_1000_T master mode support now is generally available with all PHY drivers. o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's not applicable there. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed to set MIIF_FORCEPAUSE in stable/7 so they continue to always advertise support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to the master media option for setting master mode, both in order to not violate POLA. Modified: stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/mii/brgphy.c stable/7/sys/dev/mii/ciphy.c stable/7/sys/dev/mii/e1000phy.c stable/7/sys/dev/mii/ip1000phy.c stable/7/sys/dev/mii/mii.h stable/7/sys/dev/mii/mii_physubr.c stable/7/sys/dev/mii/miivar.h stable/7/sys/dev/mii/ukphy.c stable/7/sys/dev/mii/ukphy_subr.c stable/7/sys/dev/msk/if_msk.c stable/7/sys/dev/nfe/if_nfe.c stable/7/sys/dev/stge/if_stge.c stable/7/sys/net/if_media.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/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/bce/if_bce.c Fri Nov 26 19:48:27 2010 (r215879) @@ -1137,7 +1137,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 | MIIF_FORCEPAUSE); if (rc != 0) { BCE_PRINTF("%s(%d): attaching PHYs failed\n", __FILE__, __LINE__); @@ -1763,8 +1763,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); @@ -1774,7 +1773,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); Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/bge/if_bge.c Fri Nov 26 19:48:27 2010 (r215879) @@ -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); @@ -3102,9 +3104,9 @@ bge_attach(device_t dev) again: bge_asf_driver_up(sc); - error = (mii_attach(dev, &sc->bge_miibus, ifp, + error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd, bge_ifmedia_sts, BMSR_DEFCAPMASK, - phy_addr, MII_OFFSET_ANY, 0)); + phy_addr, MII_OFFSET_ANY, MIIF_DOPAUSE | MIIF_FORCEPAUSE); if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/mii/brgphy.c Fri Nov 26 19:48:27 2010 (r215879) @@ -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 *); @@ -172,6 +172,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)); } @@ -186,7 +187,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; @@ -206,8 +206,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); @@ -215,8 +214,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); @@ -274,7 +271,7 @@ brgphy_attach(device_t dev) bce_sc = ifp->if_softc; } - /* Todo: Need to add additional controllers such as 5787F */ + /* 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 && @@ -282,8 +279,7 @@ brgphy_attach(device_t dev) 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; + ma->mii_capmask &= ~BMSR_EXTSTAT; } brgphy_reset(sc); @@ -298,27 +294,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, "); @@ -340,11 +319,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); @@ -370,15 +348,14 @@ brgphy_service(struct mii_softc *sc, str 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); @@ -400,7 +377,7 @@ brgphy_service(struct mii_softc *sc, str * 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; @@ -417,7 +394,7 @@ brgphy_service(struct mii_softc *sc, str /* Retry autonegotiation */ sc->mii_ticks = 0; - brgphy_mii_phy_auto(sc); + brgphy_mii_phy_auto(sc, ife->ifm_media); break; } @@ -459,13 +436,17 @@ brgphy_service(struct mii_softc *sc, str return (0); } +/****************************************************************************/ +/* Sets the PHY link speed. */ +/* */ +/* Returns: */ +/* 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; @@ -482,7 +463,6 @@ brgphy_setmedia(struct mii_softc *sc, in break; } - /* Calculate duplex settings for 1000BasetT/1000BaseX. */ if ((media & IFM_GMASK) == IFM_FDX) { bmcr |= BRGPHY_BMCR_FDX; gig = BRGPHY_1000CTL_AFD; @@ -490,85 +470,68 @@ brgphy_setmedia(struct mii_softc *sc, in 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; + if (IFM_SUBTYPE(media) != IFM_1000_T && + IFM_SUBTYPE(media) != IFM_1000_SX) { + PHY_WRITE(sc, BRGPHY_MII_BMCR, bmcr); + return; + } - /* Set duplex speed advertisement for 1000BaseT/1000BaseX. */ + if (IFM_SUBTYPE(media) == IFM_1000_T) { + gig |= BRGPHY_1000CTL_MSE; + if ((media & IFM_ETH_MASTER) != 0 || + (sc->mii_pdata->mii_ifp->if_flags & IFF_LINK0) != 0) + gig |= BRGPHY_1000CTL_MSC; + } 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); - } - -brgphy_setmedia_exit: - return; } -/* 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) */ +/****************************************************************************/ +/* Set the media status based on the PHY settings. */ +/* */ +/* Returns: */ +/* None */ +/****************************************************************************/ static void 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. */ @@ -592,8 +555,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; @@ -611,7 +582,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); @@ -633,9 +603,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); @@ -661,65 +629,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) @@ -914,7 +859,6 @@ brgphy_fixup_jitter_bug(struct mii_softc PHY_WRITE(sc, dspcode[i].reg, dspcode[i].val); } - static void brgphy_fixup_disable_early_dac(struct mii_softc *sc) { @@ -927,7 +871,6 @@ brgphy_fixup_disable_early_dac(struct mi } - static void brgphy_ethernet_wirespeed(struct mii_softc *sc) { @@ -939,7 +882,6 @@ brgphy_ethernet_wirespeed(struct mii_sof PHY_WRITE(sc, BRGPHY_MII_AUXCTL, val | (1 << 15) | (1 << 4)); } - static void brgphy_jumbo_settings(struct mii_softc *sc, u_long mtu) { @@ -980,7 +922,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); @@ -1020,7 +962,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) @@ -1051,10 +992,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)) { @@ -1145,7 +1083,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)) @@ -1158,6 +1095,5 @@ brgphy_reset(struct mii_softc *sc) brgphy_jumbo_settings(sc, ifp->if_mtu); brgphy_ethernet_wirespeed(sc); } - } } Modified: stable/7/sys/dev/mii/ciphy.c ============================================================================== --- stable/7/sys/dev/mii/ciphy.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/mii/ciphy.c Fri Nov 26 19:48:27 2010 (r215879) @@ -165,7 +165,7 @@ ciphy_service(struct mii_softc *sc, stru 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,17 @@ setit: if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T) break; + gig |= CIPHY_1000CTL_MSE; + if ((ife->ifm_media & IFM_ETH_MASTER) != 0 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 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 +306,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 Modified: stable/7/sys/dev/mii/e1000phy.c ============================================================================== --- stable/7/sys/dev/mii/e1000phy.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/mii/e1000phy.c Fri Nov 26 19:48:27 2010 (r215879) @@ -91,7 +91,7 @@ DRIVER_MODULE(e1000phy, miibus, e1000phy 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, s 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,15 @@ e1000phy_service(struct mii_softc *sc, s 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 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 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 +414,7 @@ done: sc->mii_ticks = 0; e1000phy_reset(sc); - e1000phy_mii_phy_auto(esc); + e1000phy_mii_phy_auto(esc, ife->ifm_media); break; } @@ -440,7 +430,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 +475,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 +499,13 @@ e1000phy_mii_phy_auto(struct e1000phy_so 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); Modified: stable/7/sys/dev/mii/ip1000phy.c ============================================================================== --- stable/7/sys/dev/mii/ip1000phy.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/mii/ip1000phy.c Fri Nov 26 19:48:27 2010 (r215879) @@ -84,7 +84,7 @@ DRIVER_MODULE(ip1000phy, miibus, ip1000p 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, 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,11 @@ ip1000phy_service(struct mii_softc *sc, 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 || + (mii->mii_ifp->if_flags & IFF_LINK0) != 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 +242,7 @@ done: break; sc->mii_ticks = 0; - ip1000phy_mii_phy_auto(sc); + ip1000phy_mii_phy_auto(sc, ife->ifm_media); break; } @@ -276,7 +260,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 +328,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); - - /* - * 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; - } + if ((mii->mii_media_active & IFM_FDX) != 0) + mii->mii_media_active |= mii_phy_flowstatus(sc); - /* - * 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 +351,9 @@ ip1000phy_mii_phy_auto(struct mii_softc 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; Modified: stable/7/sys/dev/mii/mii.h ============================================================================== --- stable/7/sys/dev/mii/mii.h Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/mii/mii.h Fri Nov 26 19:48:27 2010 (r215879) @@ -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 */ Modified: stable/7/sys/dev/mii/mii_physubr.c ============================================================================== --- stable/7/sys/dev/mii/mii_physubr.c Fri Nov 26 19:36:26 2010 (r215878) +++ stable/7/sys/dev/mii/mii_physubr.c Fri Nov 26 19:48:27 2010 (r215879) @@ -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: - panic("mii_phy_setmedia: MASTER on wrong media"); + 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; @@ -384,6 +406,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) { @@ -427,6 +450,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, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 20:45:52 2010 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 682A21065787; Fri, 26 Nov 2010 20:45:52 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 552858FC14; Fri, 26 Nov 2010 20:45:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQKjqw1075940; Fri, 26 Nov 2010 20:45:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQKjq43075931; Fri, 26 Nov 2010 20:45:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262045.oAQKjq43075931@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 20:45: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: r215883 - stable/7/sys/dev/mii 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, 26 Nov 2010 20:45:52 -0000 Author: marius Date: Fri Nov 26 20:45:52 2010 New Revision: 215883 URL: http://svn.freebsd.org/changeset/base/215883 Log: MFC: r215298, r215459, r215714, r215716 - Change these drivers to take advantage and use the generic IEEE 802.3 annex 31B full duplex flow control as well as the IFM_1000_T master support committed in r215297 (merged to stable/7 in r215879). For atphy(4) and jmphy(4) this includes changing these PHY drivers to no longer unconditionally advertise support for flow control but only if the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set). - Rename {atphy,jmphy}_auto() to {atphy,jmphy}_setmedia() as these handle other media types as well. Reviewed by: yongari (plus additional testing) Obtained from: NetBSD (partially), OpenBSD (partially) Modified: stable/7/sys/dev/mii/atphy.c stable/7/sys/dev/mii/bmtphy.c stable/7/sys/dev/mii/gentbi.c stable/7/sys/dev/mii/inphy.c stable/7/sys/dev/mii/jmphy.c stable/7/sys/dev/mii/nsgphy.c stable/7/sys/dev/mii/nsphyter.c stable/7/sys/dev/mii/rgephy.c 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/mii/atphy.c ============================================================================== --- stable/7/sys/dev/mii/atphy.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/atphy.c Fri Nov 26 20:45:52 2010 (r215883) @@ -82,7 +82,7 @@ static int atphy_service(struct mii_soft 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, stru 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, stru /* * 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, stru 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 @@ done: } /* - * 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 @@ done: 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,16 +305,19 @@ 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 atphy_reset(struct mii_softc *sc) { + struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; struct atphy_softc *asc; uint32_t reg; int i; @@ -336,7 +340,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, ife == NULL ? IFM_AUTO : ife->ifm_media); for (i = 0; i < 1000; i++) { DELAY(1); @@ -378,12 +382,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); Modified: stable/7/sys/dev/mii/bmtphy.c ============================================================================== --- stable/7/sys/dev/mii/bmtphy.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/bmtphy.c Fri Nov 26 20:45:52 2010 (r215883) @@ -153,6 +153,8 @@ bmtphy_attach(device_t dev) sc->mii_service = bmtphy_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOMANPAUSE; + mii_phy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; @@ -243,7 +245,8 @@ bmtphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_10_T; if (aux_csr & AUX_CSR_FDX) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= + IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; } else Modified: stable/7/sys/dev/mii/gentbi.c ============================================================================== --- stable/7/sys/dev/mii/gentbi.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/gentbi.c Fri Nov 26 20:45:52 2010 (r215883) @@ -172,6 +172,8 @@ gentbi_attach(device_t dev) sc->mii_service = gentbi_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOMANPAUSE; + mii_phy_reset(sc); /* @@ -267,7 +269,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 Modified: stable/7/sys/dev/mii/inphy.c ============================================================================== --- stable/7/sys/dev/mii/inphy.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/inphy.c Fri Nov 26 20:45:52 2010 (r215883) @@ -113,6 +113,8 @@ inphy_attach(device_t dev) sc->mii_service = inphy_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOMANPAUSE; + ifmedia_add(&mii->mii_media, IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc->mii_inst), MII_MEDIA_100_TX, NULL); @@ -197,7 +199,8 @@ inphy_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_10_T; if (scr & SCR_FDX) - mii->mii_media_active |= IFM_FDX; + mii->mii_media_active |= + IFM_FDX | mii_phy_flowstatus(sc); else mii->mii_media_active |= IFM_HDX; } else Modified: stable/7/sys/dev/mii/jmphy.c ============================================================================== --- stable/7/sys/dev/mii/jmphy.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/jmphy.c Fri Nov 26 20:45:52 2010 (r215883) @@ -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, stru 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, stru 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 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); Modified: stable/7/sys/dev/mii/nsgphy.c ============================================================================== --- stable/7/sys/dev/mii/nsgphy.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/nsgphy.c Fri Nov 26 20:45:52 2010 (r215883) @@ -135,6 +135,8 @@ nsgphy_attach(device_t dev) sc->mii_service = nsgphy_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOMANPAUSE; + mii_phy_reset(sc); /* @@ -246,7 +248,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 Modified: stable/7/sys/dev/mii/nsphyter.c ============================================================================== --- stable/7/sys/dev/mii/nsphyter.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/nsphyter.c Fri Nov 26 20:45:52 2010 (r215883) @@ -143,6 +143,8 @@ nsphyter_attach(device_t dev) sc->mii_service = nsphyter_service; sc->mii_pdata = mii; + sc->mii_flags |= MIIF_NOMANPAUSE; + #if 1 #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) @@ -242,12 +244,8 @@ nsphyter_status(struct mii_softc *sc) else mii->mii_media_active |= IFM_100_TX; if ((physts & PHYSTS_DUPLEX) != 0) -#ifdef notyet mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc); -#else - mii->mii_media_active |= IFM_FDX; -#endif else mii->mii_media_active |= IFM_HDX; } else Modified: stable/7/sys/dev/mii/rgephy.c ============================================================================== --- stable/7/sys/dev/mii/rgephy.c Fri Nov 26 20:45:49 2010 (r215882) +++ stable/7/sys/dev/mii/rgephy.c Fri Nov 26 20:45:52 2010 (r215883) @@ -89,7 +89,7 @@ DRIVER_MODULE(rgephy, miibus, rgephy_dri 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, str 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, str 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 @@ setit: 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 @@ setit: 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); From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 20:55:59 2010 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 C52C81065672; Fri, 26 Nov 2010 20:55:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B2F418FC13; Fri, 26 Nov 2010 20:55:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQKtxhd076470; Fri, 26 Nov 2010 20:55:59 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQKtxiv076467; Fri, 26 Nov 2010 20:55:59 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262055.oAQKtxiv076467@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 20:55:59 +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: r215885 - in stable/7/sys/dev: bge mii 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, 26 Nov 2010 20:56:00 -0000 Author: marius Date: Fri Nov 26 20:55:59 2010 New Revision: 215885 URL: http://svn.freebsd.org/changeset/base/215885 Log: MFC: r215302 Move the limiting of the PHY to 10/100 modes of operation due to limitations of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it, update the list of models having that restriction to what OpenBSD uses, which in turn seems to have obtained that information from the Linux tg3 driver. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/mii/brgphy.c 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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Fri Nov 26 20:55:58 2010 (r215884) +++ stable/7/sys/dev/bge/if_bge.c Fri Nov 26 20:55:59 2010 (r215885) @@ -2640,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; @@ -2824,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 @@ -3104,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, MIIF_DOPAUSE | MIIF_FORCEPAUSE); + error = mii_attach(dev, &sc->bge_miibus, ifp, bge_ifmedia_upd, + bge_ifmedia_sts, capmask, phy_addr, MII_OFFSET_ANY, + MIIF_DOPAUSE | MIIF_FORCEPAUSE); if (error != 0) { if (trys++ < 4) { device_printf(sc->bge_dev, "Try again\n"); Modified: stable/7/sys/dev/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Fri Nov 26 20:55:58 2010 (r215884) +++ stable/7/sys/dev/mii/brgphy.c Fri Nov 26 20:55:59 2010 (r215885) @@ -271,17 +271,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)) { - ma->mii_capmask &= ~BMSR_EXTSTAT; - } - brgphy_reset(sc); /* Read the PHY's capabilities. */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 20:57:49 2010 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 2B02110657A5; Fri, 26 Nov 2010 20:57:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDEF38FC19; Fri, 26 Nov 2010 20:57:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQKvmeM076632; Fri, 26 Nov 2010 20:57:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQKvmt1076631; Fri, 26 Nov 2010 20:57:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262057.oAQKvmt1076631@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 20:57:48 +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: r215887 - stable/7/sys/dev/mii 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, 26 Nov 2010 20:57:49 -0000 Author: marius Date: Fri Nov 26 20:57:48 2010 New Revision: 215887 URL: http://svn.freebsd.org/changeset/base/215887 Log: MFC: r215711 Add missing newlines. Modified: stable/7/sys/dev/mii/mii.c 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/mii/mii.c ============================================================================== --- stable/7/sys/dev/mii/mii.c Fri Nov 26 20:57:45 2010 (r215886) +++ stable/7/sys/dev/mii/mii.c Fri Nov 26 20:57:48 2010 (r215887) @@ -137,7 +137,7 @@ miibus_attach(device_t dev) free(children, M_TEMP); } if (nchildren == 0) { - device_printf(dev, "cannot get children"); + device_printf(dev, "cannot get children\n"); return (ENXIO); } ivars = device_get_ivars(dev); @@ -320,12 +320,12 @@ mii_attach(device_t dev, device_t *miibu int bmsr, first, i, nchildren, offset, phymax, phymin, rv; if (phyloc != MII_PHY_ANY && offloc != MII_OFFSET_ANY) { - printf("%s: phyloc and offloc specified", __func__); + printf("%s: phyloc and offloc specified\n", __func__); return (EINVAL); } if (offloc != MII_OFFSET_ANY && (offloc < 0 || offloc >= MII_NPHY)) { - printf("%s: ivalid offloc %d", __func__, offloc); + printf("%s: ivalid offloc %d\n", __func__, offloc); return (EINVAL); } @@ -334,7 +334,7 @@ mii_attach(device_t dev, device_t *miibu phymax = MII_NPHY - 1; } else { if (phyloc < 0 || phyloc >= MII_NPHY) { - printf("%s: ivalid phyloc %d", __func__, phyloc); + printf("%s: ivalid phyloc %d\n", __func__, phyloc); return (EINVAL); } phymin = phymax = phyloc; @@ -361,7 +361,7 @@ mii_attach(device_t dev, device_t *miibu if (ivars->ifp != ifp || ivars->ifmedia_upd != ifmedia_upd || ivars->ifmedia_sts != ifmedia_sts || ivars->mii_flags != flags) { - printf("%s: non-matching invariant", __func__); + printf("%s: non-matching invariant\n", __func__); return (EINVAL); } /* From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 20:59:43 2010 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 C6E54106566B; Fri, 26 Nov 2010 20:59:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49198FC0C; Fri, 26 Nov 2010 20:59:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQKxhdj076781; Fri, 26 Nov 2010 20:59:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQKxhOv076778; Fri, 26 Nov 2010 20:59:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262059.oAQKxhOv076778@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 20:59:43 +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: r215888 - stable/7/sys/dev/mii 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, 26 Nov 2010 20:59:43 -0000 Author: marius Date: Fri Nov 26 20:59:43 2010 New Revision: 215888 URL: http://svn.freebsd.org/changeset/base/215888 Log: MFC: r215720 - Also probe BCM5214 and BCM5222. - Add some DSP init code for BCM5221. The values derived from Apple's GMAC driver and the same init code also exists in Linux's sungem_phy driver. - Only read media status bits when they are valid. Obtained from: NetBSD, OpenBSD Modified: stable/7/sys/dev/mii/bmtphy.c stable/7/sys/dev/mii/miidevs 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/mii/bmtphy.c ============================================================================== --- stable/7/sys/dev/mii/bmtphy.c Fri Nov 26 20:57:48 2010 (r215887) +++ stable/7/sys/dev/mii/bmtphy.c Fri Nov 26 20:59:43 2010 (r215888) @@ -85,6 +85,11 @@ __FBSDID("$FreeBSD$"); static int bmtphy_probe(device_t); static int bmtphy_attach(device_t); +struct bmtphy_softc { + struct mii_softc mii_sc; + int mii_model; +}; + static device_method_t bmtphy_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bmtphy_probe), @@ -100,18 +105,21 @@ static devclass_t bmtphy_devclass; static driver_t bmtphy_driver = { "bmtphy", bmtphy_methods, - sizeof(struct mii_softc) + sizeof(struct bmtphy_softc) }; DRIVER_MODULE(bmtphy, miibus, bmtphy_driver, bmtphy_devclass, 0, 0); static int bmtphy_service(struct mii_softc *, struct mii_data *, int); static void bmtphy_status(struct mii_softc *); +static void bmtphy_reset(struct mii_softc *); static const struct mii_phydesc bmtphys_dp[] = { MII_PHY_DESC(BROADCOM, BCM4401), MII_PHY_DESC(BROADCOM, BCM5201), + MII_PHY_DESC(BROADCOM, BCM5214), MII_PHY_DESC(BROADCOM, BCM5221), + MII_PHY_DESC(BROADCOM, BCM5222), MII_PHY_END }; @@ -137,11 +145,13 @@ bmtphy_probe(device_t dev) static int bmtphy_attach(device_t dev) { - struct mii_softc *sc; - struct mii_attach_args *ma; - struct mii_data *mii; + struct bmtphy_softc *bsc; + struct mii_softc *sc; + struct mii_attach_args *ma; + struct mii_data *mii; - sc = device_get_softc(dev); + bsc = device_get_softc(dev); + sc = &bsc->mii_sc; ma = device_get_ivars(dev); sc->mii_dev = device_get_parent(dev); mii = ma->mii_data; @@ -155,7 +165,9 @@ bmtphy_attach(device_t dev) sc->mii_flags |= MIIF_NOMANPAUSE; - mii_phy_reset(sc); + bsc->mii_model = MII_MODEL(ma->mii_id2); + + bmtphy_reset(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; device_printf(dev, " "); @@ -196,16 +208,15 @@ bmtphy_service(struct mii_softc *sc, str /* Callback if something changed. */ mii_phy_update(sc, cmd); - return (0); } static void bmtphy_status(struct mii_softc *sc) { - struct mii_data *mii; - struct ifmedia_entry *ife; - int bmsr, bmcr, aux_csr; + struct mii_data *mii; + struct ifmedia_entry *ife; + int bmsr, bmcr, aux_csr; mii = sc->mii_pdata; ife = mii->mii_media.ifm_cur; @@ -214,7 +225,6 @@ bmtphy_status(struct mii_softc *sc) mii->mii_media_active = IFM_ETHER; bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); - aux_csr = PHY_READ(sc, MII_BMTPHY_AUX_CSR); if (bmsr & BMSR_LINK) mii->mii_media_status |= IFM_ACTIVE; @@ -240,6 +250,7 @@ bmtphy_status(struct mii_softc *sc) return; } + aux_csr = PHY_READ(sc, MII_BMTPHY_AUX_CSR); if (aux_csr & AUX_CSR_SPEED) mii->mii_media_active |= IFM_100_TX; else @@ -252,3 +263,32 @@ bmtphy_status(struct mii_softc *sc) } else mii->mii_media_active = ife->ifm_media; } + +static void +bmtphy_reset(struct mii_softc *sc) +{ + struct bmtphy_softc *bsc; + u_int16_t data; + + bsc = (struct bmtphy_softc *)sc; + + mii_phy_reset(sc); + + if (bsc->mii_model == MII_MODEL_BROADCOM_BCM5221) { + /* Enable shadow register mode. */ + data = PHY_READ(sc, 0x1f); + PHY_WRITE(sc, 0x1f, data | 0x0080); + + /* Enable APD (Auto PowerDetect). */ + data = PHY_READ(sc, MII_BMTPHY_AUX2); + PHY_WRITE(sc, MII_BMTPHY_AUX2, data | 0x0020); + + /* Enable clocks across APD for Auto-MDIX functionality. */ + data = PHY_READ(sc, MII_BMTPHY_INTR); + PHY_WRITE(sc, MII_BMTPHY_INTR, data | 0x0004); + + /* Disable shadow register mode. */ + data = PHY_READ(sc, 0x1f); + PHY_WRITE(sc, 0x1f, data & ~0x0080); + } +} Modified: stable/7/sys/dev/mii/miidevs ============================================================================== --- stable/7/sys/dev/mii/miidevs Fri Nov 26 20:57:48 2010 (r215887) +++ stable/7/sys/dev/mii/miidevs Fri Nov 26 20:59:43 2010 (r215888) @@ -123,7 +123,9 @@ model ATHEROS F1_7 0x0007 Atheros F1 10 model BROADCOM 3C905B 0x0012 3c905B 10/100 internal PHY model BROADCOM 3C905C 0x0017 3c905C 10/100 internal PHY model BROADCOM BCM5201 0x0021 BCM5201 10/100baseTX PHY +model BROADCOM BCM5214 0x0028 BCM5214 Quad 10/100 PHY model BROADCOM BCM5221 0x001e BCM5221 10/100baseTX PHY +model BROADCOM BCM5222 0x0032 BCM5222 Dual 10/100 PHY model BROADCOM BCM4401 0x0036 BCM4401 10/100baseTX PHY model xxBROADCOM BCM5400 0x0004 Broadcom 1000baseTX PHY model xxBROADCOM BCM5401 0x0005 BCM5401 10/100/1000baseTX PHY From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 21:01:22 2010 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 0736A1065788; Fri, 26 Nov 2010 21:01:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E91E88FC1B; Fri, 26 Nov 2010 21:01:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQL1LZ4076974; Fri, 26 Nov 2010 21:01:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQL1LM7076972; Fri, 26 Nov 2010 21:01:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262101.oAQL1LM7076972@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 21:01:21 +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: r215891 - stable/7/sys/dev/gem 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, 26 Nov 2010 21:01:22 -0000 Author: marius Date: Fri Nov 26 21:01:21 2010 New Revision: 215891 URL: http://svn.freebsd.org/changeset/base/215891 Log: MFC: r215722 - Fix and enable support for flow control. - Partially revert r172334; as it turns out the DELAYs in gem_reset_{r,t}x() are actually necessary although bus space barriers and gem_bitwait() are used, otherwise the controller may trigger an IOMMU errors on at least sparc64. This is in line with what Linux and OpenSolaris do. Modified: stable/7/sys/dev/gem/if_gem.c 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/gem/if_gem.c ============================================================================== --- stable/7/sys/dev/gem/if_gem.c Fri Nov 26 21:01:19 2010 (r215890) +++ stable/7/sys/dev/gem/if_gem.c Fri Nov 26 21:01:21 2010 (r215891) @@ -302,7 +302,7 @@ gem_attach(struct gem_softc *sc) } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, - MII_OFFSET_ANY, 0); + MII_OFFSET_ANY, MIIF_DOPAUSE); } /* @@ -330,7 +330,7 @@ gem_attach(struct gem_softc *sc) } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, phy, - MII_OFFSET_ANY, 0); + MII_OFFSET_ANY, MIIF_DOPAUSE); } /* @@ -352,7 +352,7 @@ gem_attach(struct gem_softc *sc) sc->sc_flags |= GEM_SERDES; error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, gem_mediachange, gem_mediastatus, BMSR_DEFCAPMASK, - GEM_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); + GEM_PHYAD_EXTERNAL, MII_OFFSET_ANY, MIIF_DOPAUSE); } if (error != 0) { device_printf(sc->sc_dev, "attaching PHYs failed\n"); @@ -712,6 +712,9 @@ gem_reset_rx(struct gem_softc *sc) if (!GEM_BANK1_BITWAIT(sc, GEM_RX_CONFIG, GEM_RX_CONFIG_RXDMA_EN, 0)) device_printf(sc->sc_dev, "cannot disable RX DMA\n"); + /* Wait 5ms extra. */ + DELAY(5000); + /* Finally, reset the ERX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_RX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, @@ -784,6 +787,9 @@ gem_reset_tx(struct gem_softc *sc) if (!GEM_BANK1_BITWAIT(sc, GEM_TX_CONFIG, GEM_TX_CONFIG_TXDMA_EN, 0)) device_printf(sc->sc_dev, "cannot disable TX DMA\n"); + /* Wait 5ms extra. */ + DELAY(5000); + /* Finally, reset the ETX. */ GEM_BANK2_WRITE_4(sc, GEM_RESET, GEM_RESET_TX); GEM_BANK2_BARRIER(sc, GEM_RESET, 4, @@ -1239,7 +1245,7 @@ gem_init_regs(struct gem_softc *sc) GEM_BANK1_WRITE_4(sc, GEM_MAC_PREAMBLE_LEN, 0x7); GEM_BANK1_WRITE_4(sc, GEM_MAC_JAM_SIZE, 0x4); GEM_BANK1_WRITE_4(sc, GEM_MAC_ATTEMPT_LIMIT, 0x10); - GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_TYPE, 0x8088); + GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_TYPE, 0x8808); /* random number seed */ GEM_BANK1_WRITE_4(sc, GEM_MAC_RANDOM_SEED, @@ -2039,14 +2045,12 @@ gem_mii_statchg(device_t dev) v = GEM_BANK1_READ_4(sc, GEM_MAC_CONTROL_CONFIG) & ~(GEM_MAC_CC_RX_PAUSE | GEM_MAC_CC_TX_PAUSE); -#ifdef notyet if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) v |= GEM_MAC_CC_RX_PAUSE; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) v |= GEM_MAC_CC_TX_PAUSE; -#endif GEM_BANK1_WRITE_4(sc, GEM_MAC_CONTROL_CONFIG, v); if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_FDX) == 0 && From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 21:02:54 2010 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 7497F10656A3; Fri, 26 Nov 2010 21:02:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 624538FC1B; Fri, 26 Nov 2010 21:02:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQL2sk9077077; Fri, 26 Nov 2010 21:02:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQL2sYk077074; Fri, 26 Nov 2010 21:02:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262102.oAQL2sYk077074@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 21:02:54 +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: r215892 - 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: Fri, 26 Nov 2010 21:02:54 -0000 Author: marius Date: Fri Nov 26 21:02:54 2010 New Revision: 215892 URL: http://svn.freebsd.org/changeset/base/215892 Log: MFC: r215768 - Sprinkle const on tables. - Remove an alpha remnant. - Minor comment and style fixes. Modified: stable/7/sys/dev/fxp/if_fxp.c 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 Fri Nov 26 21:01:21 2010 (r215891) +++ stable/7/sys/dev/fxp/if_fxp.c Fri Nov 26 21:02:54 2010 (r215892) @@ -107,11 +107,11 @@ static int tx_threshold = 64; /* * The configuration byte map has several undefined fields which * must be one or must be zero. Set up a template for these bits. - * The actual configuration is performed in fxp_init. + * The actual configuration is performed in fxp_init_body. * * See struct fxp_cb_config for the bit definitions. */ -static u_char fxp_cb_config_template[] = { +static const u_char const fxp_cb_config_template[] = { 0x0, 0x0, /* cb_status */ 0x0, 0x0, /* cb_command */ 0x0, 0x0, 0x0, 0x0, /* link_addr */ @@ -155,7 +155,7 @@ static u_char fxp_cb_config_template[] = * particular variants, but we don't currently differentiate between * them. */ -static struct fxp_ident fxp_ident_table[] = { +static const struct fxp_ident const fxp_ident_table[] = { { 0x1029, -1, 0, "Intel 82559 PCI/CardBus Pro/100" }, { 0x1030, -1, 0, "Intel 82559 Pro/100 Ethernet" }, { 0x1031, -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" }, @@ -217,7 +217,7 @@ static int fxp_shutdown(device_t dev); static int fxp_suspend(device_t dev); static int fxp_resume(device_t dev); -static struct fxp_ident *fxp_find_ident(device_t dev); +static const struct fxp_ident *fxp_find_ident(device_t dev); static void fxp_intr(void *xsc); static void fxp_rxcsum(struct fxp_softc *sc, struct ifnet *ifp, struct mbuf *m, uint16_t status, int pos); @@ -367,12 +367,12 @@ fxp_dma_wait(struct fxp_softc *sc, volat device_printf(sc->dev, "DMA timeout\n"); } -static struct fxp_ident * +static const struct fxp_ident * fxp_find_ident(device_t dev) { uint16_t devid; uint8_t revid; - struct fxp_ident *ident; + const struct fxp_ident *ident; if (pci_get_vendor(dev) == FXP_VENDORID_INTEL) { devid = pci_get_device(dev); @@ -393,7 +393,7 @@ fxp_find_ident(device_t dev) static int fxp_probe(device_t dev) { - struct fxp_ident *ident; + const struct fxp_ident *ident; ident = fxp_find_ident(dev); if (ident != NULL) { @@ -1615,21 +1615,7 @@ fxp_encap(struct fxp_softc *sc, struct m /* * Advance the end of list forward. */ - -#ifdef __alpha__ - /* - * On platforms which can't access memory in 16-bit - * granularities, we must prevent the card from DMA'ing - * up the status while we update the command field. - * This could cause us to overwrite the completion status. - * XXX This is probably bogus and we're _not_ looking - * for atomicity here. - */ - atomic_clear_16(&sc->fxp_desc.tx_last->tx_cb->cb_command, - htole16(FXP_CB_COMMAND_S)); -#else sc->fxp_desc.tx_last->tx_cb->cb_command &= htole16(~FXP_CB_COMMAND_S); -#endif /*__alpha__*/ sc->fxp_desc.tx_last = txp; /* @@ -2978,13 +2964,13 @@ static uint32_t fxp_ucode_d102e[] = D102 #define UCODE(x) x, sizeof(x)/sizeof(uint32_t) -struct ucode { +static const struct ucode { uint32_t revision; uint32_t *ucode; int length; u_short int_delay_offset; u_short bundle_max_offset; -} ucode_table[] = { +} const ucode_table[] = { { FXP_REV_82558_A4, UCODE(fxp_ucode_d101a), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82558_B0, UCODE(fxp_ucode_d101b0), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82559_A0, UCODE(fxp_ucode_d101ma), @@ -3003,7 +2989,7 @@ struct ucode { static void fxp_load_ucode(struct fxp_softc *sc) { - struct ucode *uc; + const struct ucode *uc; struct fxp_cb_ucode *cbp; int i; @@ -3170,11 +3156,13 @@ sysctl_int_range(SYSCTL_HANDLER_ARGS, in static int sysctl_hw_fxp_int_delay(SYSCTL_HANDLER_ARGS) { + return (sysctl_int_range(oidp, arg1, arg2, req, 300, 3000)); } static int sysctl_hw_fxp_bundle_max(SYSCTL_HANDLER_ARGS) { + return (sysctl_int_range(oidp, arg1, arg2, req, 1, 0xffff)); } Modified: stable/7/sys/dev/fxp/if_fxpvar.h ============================================================================== --- stable/7/sys/dev/fxp/if_fxpvar.h Fri Nov 26 21:01:21 2010 (r215891) +++ stable/7/sys/dev/fxp/if_fxpvar.h Fri Nov 26 21:02:54 2010 (r215892) @@ -146,7 +146,7 @@ struct fxp_ident { uint16_t devid; int16_t revid; /* -1 matches anything */ uint8_t ich; - char *name; + const char *name; }; struct fxp_hwstats { @@ -182,7 +182,7 @@ struct fxp_softc { struct resource *fxp_res[2]; /* I/O and IRQ resources */ struct resource_spec *fxp_spec; /* the resource spec we used */ void *ih; /* interrupt handler cookie */ - struct fxp_ident *ident; + const struct fxp_ident *ident; struct mtx sc_mtx; bus_dma_tag_t fxp_txmtag; /* bus DMA tag for Tx mbufs */ bus_dma_tag_t fxp_rxmtag; /* bus DMA tag for Rx mbufs */ From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 21:07:21 2010 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 0626B1065672; Fri, 26 Nov 2010 21:07:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E78A18FC12; Fri, 26 Nov 2010 21:07:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQL7KBL077310; Fri, 26 Nov 2010 21:07:20 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQL7KpQ077308; Fri, 26 Nov 2010 21:07:20 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262107.oAQL7KpQ077308@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 21:07: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: r215895 - stable/7/sys/dev/cas 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, 26 Nov 2010 21:07:21 -0000 Author: marius Date: Fri Nov 26 21:07:20 2010 New Revision: 215895 URL: http://svn.freebsd.org/changeset/base/215895 Log: MFC: r215721 - Fix and enable support for flow control. - Fix compilation with CAS_DEBUG defined. Modified: stable/7/sys/dev/cas/if_cas.c 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/cas/if_cas.c ============================================================================== --- stable/7/sys/dev/cas/if_cas.c Fri Nov 26 21:07:19 2010 (r215894) +++ stable/7/sys/dev/cas/if_cas.c Fri Nov 26 21:07:20 2010 (r215895) @@ -346,7 +346,7 @@ cas_attach(struct cas_softc *sc) } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, - MII_PHY_ANY, MII_OFFSET_ANY, 0); + MII_PHY_ANY, MII_OFFSET_ANY, MIIF_DOPAUSE); } /* * Fall back on an internal PHY if no external PHY was found. @@ -366,7 +366,7 @@ cas_attach(struct cas_softc *sc) } error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, - MII_PHY_ANY, MII_OFFSET_ANY, 0); + MII_PHY_ANY, MII_OFFSET_ANY, MIIF_DOPAUSE); } } else { /* @@ -388,7 +388,7 @@ cas_attach(struct cas_softc *sc) BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); error = mii_attach(sc->sc_dev, &sc->sc_miibus, ifp, cas_mediachange, cas_mediastatus, BMSR_DEFCAPMASK, - CAS_PHYAD_EXTERNAL, MII_OFFSET_ANY, 0); + CAS_PHYAD_EXTERNAL, MII_OFFSET_ANY, MIIF_DOPAUSE); } if (error != 0) { device_printf(sc->sc_dev, "attaching PHYs failed\n"); @@ -1093,8 +1093,7 @@ cas_init_locked(struct cas_softc *sc) /* Set the PAUSE thresholds. We use the maximum OFF threshold. */ CAS_WRITE_4(sc, CAS_RX_PTHRS, - ((111 * 64) << CAS_RX_PTHRS_XOFF_SHFT) | - ((15 * 64) << CAS_RX_PTHRS_XON_SHFT)); + (111 << CAS_RX_PTHRS_XOFF_SHFT) | (15 << CAS_RX_PTHRS_XON_SHFT)); /* RX blanking */ CAS_WRITE_4(sc, CAS_RX_BLANK, @@ -1339,7 +1338,7 @@ cas_init_regs(struct cas_softc *sc) CAS_WRITE_4(sc, CAS_MAC_PREAMBLE_LEN, 0x7); CAS_WRITE_4(sc, CAS_MAC_JAM_SIZE, 0x4); CAS_WRITE_4(sc, CAS_MAC_ATTEMPT_LIMIT, 0x10); - CAS_WRITE_4(sc, CAS_MAC_CTRL_TYPE, 0x8088); + CAS_WRITE_4(sc, CAS_MAC_CTRL_TYPE, 0x8808); /* random number seed */ CAS_WRITE_4(sc, CAS_MAC_RANDOM_SEED, @@ -1572,11 +1571,11 @@ cas_tint(struct cas_softc *sc) } #ifdef CAS_DEBUG - CTR4(KTR_CAS, "%s: CAS_TX_STATE_MACHINE %x CAS_TX_DESC_BASE %llx " + CTR5(KTR_CAS, "%s: CAS_TX_SM1 %x CAS_TX_SM2 %x CAS_TX_DESC_BASE %llx " "CAS_TX_COMP3 %x", - __func__, CAS_READ_4(sc, CAS_TX_STATE_MACHINE), - ((long long)CAS_READ_4(sc, CAS_TX_DESC_BASE_HI3) << 32) | - CAS_READ_4(sc, CAS_TX_DESC_BASE_LO3), + __func__, CAS_READ_4(sc, CAS_TX_SM1), CAS_READ_4(sc, CAS_TX_SM2), + ((long long)CAS_READ_4(sc, CAS_TX_DESC3_BASE_HI) << 32) | + CAS_READ_4(sc, CAS_TX_DESC3_BASE_LO), CAS_READ_4(sc, CAS_TX_COMP3)); #endif @@ -1638,7 +1637,7 @@ cas_rint(struct cas_softc *sc) rxhead = CAS_READ_4(sc, CAS_RX_COMP_HEAD); #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: sc->sc_rxcptr %d, sc->sc_rxdptr %d, head %d", - __func__, sc->rxcptr, sc->sc_rxdptr, rxhead); + __func__, sc->sc_rxcptr, sc->sc_rxdptr, rxhead); #endif skip = 0; CAS_CDSYNC(sc, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); @@ -1865,7 +1864,7 @@ cas_rint(struct cas_softc *sc) #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: done sc->sc_rxcptr %d, sc->sc_rxdptr %d, head %d", - __func__, sc->rxcptr, sc->sc_rxdptr, + __func__, sc->sc_rxcptr, sc->sc_rxdptr, CAS_READ_4(sc, CAS_RX_COMP_HEAD)); #endif } @@ -1988,7 +1987,7 @@ cas_intr_task(void *arg, int pending __u #ifdef CAS_DEBUG CTR4(KTR_CAS, "%s: %s: cplt %x, status %x", device_get_name(sc->sc_dev), __func__, - (status >> CAS_STATUS_TX_COMP3_SHIFT), (u_int)status); + (status >> CAS_STATUS_TX_COMP3_SHFT), (u_int)status); /* * PCS interrupts must be cleared, otherwise no traffic is passed! @@ -2100,15 +2099,15 @@ cas_watchdog(struct cas_softc *sc) #ifdef CAS_DEBUG CTR4(KTR_CAS, - "%s: CAS_RX_CONFIG %x CAS_MAC_RX_STATUS %x CAS_MAC_RX_CONFIG %x", - __func__, CAS_READ_4(sc, CAS_RX_CONFIG), + "%s: CAS_RX_CONF %x CAS_MAC_RX_STATUS %x CAS_MAC_RX_CONF %x", + __func__, CAS_READ_4(sc, CAS_RX_CONF), CAS_READ_4(sc, CAS_MAC_RX_STATUS), - CAS_READ_4(sc, CAS_MAC_RX_CONFIG)); + CAS_READ_4(sc, CAS_MAC_RX_CONF)); CTR4(KTR_CAS, - "%s: CAS_TX_CONFIG %x CAS_MAC_TX_STATUS %x CAS_MAC_TX_CONFIG %x", - __func__, CAS_READ_4(sc, CAS_TX_CONFIG), + "%s: CAS_TX_CONF %x CAS_MAC_TX_STATUS %x CAS_MAC_TX_CONF %x", + __func__, CAS_READ_4(sc, CAS_TX_CONF), CAS_READ_4(sc, CAS_MAC_TX_STATUS), - CAS_READ_4(sc, CAS_MAC_TX_CONFIG)); + CAS_READ_4(sc, CAS_MAC_TX_CONF)); #endif if (sc->sc_wdog_timer == 0 || --sc->sc_wdog_timer != 0) @@ -2356,14 +2355,12 @@ cas_mii_statchg(device_t dev) v = CAS_READ_4(sc, CAS_MAC_CTRL_CONF) & ~(CAS_MAC_CTRL_CONF_TXP | CAS_MAC_CTRL_CONF_RXP); -#ifdef notyet if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) v |= CAS_MAC_CTRL_CONF_RXP; if ((IFM_OPTIONS(sc->sc_mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) v |= CAS_MAC_CTRL_CONF_TXP; -#endif CAS_WRITE_4(sc, CAS_MAC_CTRL_CONF, v); /* From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 21:32:21 2010 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 C15B3106564A; Fri, 26 Nov 2010 21:32:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE5528FC14; Fri, 26 Nov 2010 21:32:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQLWLWK081461; Fri, 26 Nov 2010 21:32:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQLWLdT081454; Fri, 26 Nov 2010 21:32:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201011262132.oAQLWLdT081454@svn.freebsd.org> From: Marius Strobl Date: Fri, 26 Nov 2010 21:32:21 +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: r215901 - stable/7/share/man/man4 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, 26 Nov 2010 21:32:21 -0000 Author: marius Date: Fri Nov 26 21:32:21 2010 New Revision: 215901 URL: http://svn.freebsd.org/changeset/base/215901 Log: MFC: r215780 Remove the description of the link0 link option, since r215297 (merged to stable/7 in r215879) the master media option generally should be used instead. This is MFC'ed in order to discourage the use of the link0 link option, although it's still available in stable/7). Modified: stable/7/share/man/man4/bge.4 stable/7/share/man/man4/msk.4 stable/7/share/man/man4/nge.4 stable/7/share/man/man4/sk.4 stable/7/share/man/man4/stge.4 stable/7/share/man/man4/vge.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/bge.4 ============================================================================== --- stable/7/share/man/man4/bge.4 Fri Nov 26 21:30:14 2010 (r215900) +++ stable/7/share/man/man4/bge.4 Fri Nov 26 21:32:21 2010 (r215901) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2010 +.Dd November 23, 2010 .Dt BGE 4 .Os .Sh NAME @@ -144,27 +144,6 @@ Force full duplex operation. Force half duplex operation. .El .Pp -The -.Nm -driver also supports one special link option for 1000baseTX cards: -.Bl -tag -width ".Cm link0" -.It Cm link0 -With 1000baseTX cards, establishing a link between two ports requires -that one port be configured as a master and the other a slave. -With autonegotiation, -the master/slave settings will be chosen automatically. -However when manually selecting the link state, it is necessary to -force one side of the link to be a master and the other a slave. -The -.Nm -driver configures the ports as slaves by default. -Setting the -.Cm link0 -flag with -.Xr ifconfig 8 -will set a port as a master instead. -.El -.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE Modified: stable/7/share/man/man4/msk.4 ============================================================================== --- stable/7/share/man/man4/msk.4 Fri Nov 26 21:30:14 2010 (r215900) +++ stable/7/share/man/man4/msk.4 Fri Nov 26 21:32:21 2010 (r215901) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 30, 2010 +.Dd November 23, 2010 .Dt MSK 4 .Os .Sh NAME @@ -125,27 +125,6 @@ Force full duplex operation. Force half duplex operation. .El .Pp -The -.Nm -driver also supports one special link option for 1000baseTX cards: -.Bl -tag -width ".Cm link0" -.It Cm link0 -With 1000baseTX cards, establishing a link between two ports requires -that one port is configured as master and the other one as slave. -With autonegotiation, -the master/slave settings will be chosen automatically. -However when manually selecting the link state, it is necessary to -force one side of the link to be a master and the other a slave. -The -.Nm -driver configures the ports as slaves by default. -Setting the -.Cm link0 -flag with -.Xr ifconfig 8 -will set a port as a master instead. -.El -.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE Modified: stable/7/share/man/man4/nge.4 ============================================================================== --- stable/7/share/man/man4/nge.4 Fri Nov 26 21:30:14 2010 (r215900) +++ stable/7/share/man/man4/nge.4 Fri Nov 26 21:32:21 2010 (r215901) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2009 +.Dd November 23, 2010 .Dt NGE 4 .Os .Sh NAME @@ -131,27 +131,6 @@ Force full duplex operation. Force half duplex operation. .El .Pp -The -.Nm -driver also supports one special link option for 1000baseTX cards: -.Bl -tag -width link0 -.It Cm link0 -With 1000baseTX cards, establishing a link between two ports requires -that one port be configured as a master and the other a slave. -With autonegotiation, -the master/slave settings will be chosen automatically. -However when manually selecting the link state, it is necessary to -force one side of the link to be a master and the other a slave. -The -.Nm -driver configures the ports as slaves by default. -Setting the -.Cm link0 -flag with -.Xr ifconfig 8 -will set a port as a master instead. -.El -.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE Modified: stable/7/share/man/man4/sk.4 ============================================================================== --- stable/7/share/man/man4/sk.4 Fri Nov 26 21:30:14 2010 (r215900) +++ stable/7/share/man/man4/sk.4 Fri Nov 26 21:32:21 2010 (r215901) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 23, 2009 +.Dd November 23, 2010 .Dt SK 4 .Os .Sh NAME @@ -134,28 +134,6 @@ Force full duplex operation Force half duplex operation. .El .Pp -The -.Nm -driver also supports one special link option for 1000baseTX cards: -.Pp -.Bl -tag -width xxxxxxxxxxxxxxxxxxxx -.It link0 -With 1000baseTX cards, establishing a link between two ports requires -that one port is configured as master and the other one as slave. -With autonegotiation, -the master/slave settings will be chosen automatically. -However when manually selecting the link state, it is necessary to -force one side of the link to be a master and the other a slave. -The -.Nm -driver configures the ports as slaves by default. -Setting the -.Ar link0 -flag with -.Xr ifconfig 8 -will set a port as a master instead. -.El -.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE Modified: stable/7/share/man/man4/stge.4 ============================================================================== --- stable/7/share/man/man4/stge.4 Fri Nov 26 21:30:14 2010 (r215900) +++ stable/7/share/man/man4/stge.4 Fri Nov 26 21:32:21 2010 (r215901) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2006 +.Dd November 23, 2010 .Dt STGE 4 .Os .Sh NAME @@ -136,27 +136,6 @@ Force full duplex operation. Force half duplex operation. .El .Pp -The -.Nm -driver also supports one special link option for 1000baseTX cards: -.Bl -tag -width ".Cm link0" -.It Cm link0 -With 1000baseTX cards, establishing a link between two ports requires -that one port is configured as master and the other one as slave. -With autonegotiation, -the master/slave settings will be chosen automatically. -However when manually selecting the link state, it is necessary to -force one side of the link to be a master and the other a slave. -The -.Nm -driver configures the ports as slaves by default. -Setting the -.Cm link0 -flag with -.Xr ifconfig 8 -will set a port as a master instead. -.El -.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE Modified: stable/7/share/man/man4/vge.4 ============================================================================== --- stable/7/share/man/man4/vge.4 Fri Nov 26 21:30:14 2010 (r215900) +++ stable/7/share/man/man4/vge.4 Fri Nov 26 21:32:21 2010 (r215901) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 18, 2009 +.Dd November 23, 2010 .Dt VGE 4 .Os .Sh NAME @@ -137,27 +137,6 @@ Force full duplex operation. Force half duplex operation. .El .Pp -The -.Nm -driver also supports one special link option for 1000baseTX cards: -.Bl -tag -width ".Cm link0" -.It Cm link0 -With 1000baseTX cards, establishing a link between two ports requires -that one port be configured as a master and the other a slave. -With autonegotiation, -the master/slave settings will be chosen automatically. -However when manually selecting the link state, it is necessary to -force one side of the link to be a master and the other a slave. -The -.Nm -driver configures the ports as slaves by default. -Setting the -.Cm link0 -flag with -.Xr ifconfig 8 -will set a port as a master instead. -.El -.Pp For more information on configuring this device, see .Xr ifconfig 8 . .Sh HARDWARE From owner-svn-src-stable-7@FreeBSD.ORG Fri Nov 26 22:31:56 2010 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 A880C1065694; Fri, 26 Nov 2010 22:31:56 +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 973C58FC2D; Fri, 26 Nov 2010 22:31:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAQMVuCn091760; Fri, 26 Nov 2010 22:31:56 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAQMVu0e091758; Fri, 26 Nov 2010 22:31:56 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201011262231.oAQMVu0e091758@svn.freebsd.org> From: Andriy Gapon Date: Fri, 26 Nov 2010 22:31:56 +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: r215909 - in stable: 7 8 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, 26 Nov 2010 22:31:56 -0000 Author: avg Date: Fri Nov 26 22:31:56 2010 New Revision: 215909 URL: http://svn.freebsd.org/changeset/base/215909 Log: add UPDATING entry for amd64 minidump version 2 This is a direct commit. Modified: stable/7/UPDATING Changes in other areas also in this revision: Modified: stable/8/UPDATING Modified: stable/7/UPDATING ============================================================================== --- stable/7/UPDATING Fri Nov 26 22:23:52 2010 (r215908) +++ stable/7/UPDATING Fri Nov 26 22:31:56 2010 (r215909) @@ -8,6 +8,12 @@ Items affecting the ports and packages s /usr/ports/UPDATING. Please read that file before running portupgrade. +20101126: + New version of minidump format for amd64 architecture was + introduced in r215874. To analyze vmcore files produced by + kernels at or after this version you will need updated userland, + libkvm actually, that is able to handle the new version. + 20100323: FreeBSD 7.3-RELEASE From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 01:09:55 2010 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 02DC2106564A; Sat, 27 Nov 2010 01:09:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E305A8FC12; Sat, 27 Nov 2010 01:09:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAR19sTC003106; Sat, 27 Nov 2010 01:09:54 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAR19sEu003096; Sat, 27 Nov 2010 01:09:54 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201011270109.oAR19sEu003096@svn.freebsd.org> From: Jack F Vogel Date: Sat, 27 Nov 2010 01:09:54 +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: r215922 - in stable/7/sys: conf dev/e1000 modules/em modules/igb 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, 27 Nov 2010 01:09:55 -0000 Author: jfv Date: Sat Nov 27 01:09:54 2010 New Revision: 215922 URL: http://svn.freebsd.org/changeset/base/215922 Log: MFC: r214646, r215781, r215789, 215808 Brings 7.4 e1000 drivers to the same level as 8.2 Modified: stable/7/sys/conf/files stable/7/sys/dev/e1000/e1000_82571.c stable/7/sys/dev/e1000/e1000_82571.h stable/7/sys/dev/e1000/e1000_82575.c stable/7/sys/dev/e1000/e1000_82575.h stable/7/sys/dev/e1000/e1000_api.c stable/7/sys/dev/e1000/e1000_api.h stable/7/sys/dev/e1000/e1000_defines.h stable/7/sys/dev/e1000/e1000_hw.h stable/7/sys/dev/e1000/e1000_ich8lan.c stable/7/sys/dev/e1000/e1000_ich8lan.h stable/7/sys/dev/e1000/e1000_mac.c stable/7/sys/dev/e1000/e1000_nvm.c stable/7/sys/dev/e1000/e1000_nvm.h stable/7/sys/dev/e1000/e1000_osdep.h stable/7/sys/dev/e1000/e1000_phy.c stable/7/sys/dev/e1000/e1000_phy.h stable/7/sys/dev/e1000/e1000_regs.h stable/7/sys/dev/e1000/if_em.c stable/7/sys/dev/e1000/if_em.h stable/7/sys/dev/e1000/if_igb.c stable/7/sys/dev/e1000/if_igb.h stable/7/sys/dev/e1000/if_lem.c stable/7/sys/dev/e1000/if_lem.h stable/7/sys/modules/em/Makefile stable/7/sys/modules/igb/Makefile Directory Properties: stable/7/ (props changed) Modified: stable/7/sys/conf/files ============================================================================== --- stable/7/sys/conf/files Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/conf/files Sat Nov 27 01:09:54 2010 (r215922) @@ -812,6 +812,10 @@ dev/e1000/e1000_nvm.c optional em | igb compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_phy.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_vf.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_mbx.c optional em | igb \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_osdep.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/et/if_et.c optional et Modified: stable/7/sys/dev/e1000/e1000_82571.c ============================================================================== --- stable/7/sys/dev/e1000/e1000_82571.c Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_82571.c Sat Nov 27 01:09:54 2010 (r215922) @@ -78,6 +78,10 @@ static s32 e1000_get_hw_semaphore_82571 static s32 e1000_fix_nvm_checksum_82571(struct e1000_hw *hw); static s32 e1000_get_phy_id_82571(struct e1000_hw *hw); static void e1000_put_hw_semaphore_82571(struct e1000_hw *hw); +static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw); +static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw); +static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw); +static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw); static void e1000_initialize_hw_bits_82571(struct e1000_hw *hw); static s32 e1000_write_nvm_eewr_82571(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); @@ -91,6 +95,7 @@ static void e1000_power_down_phy_copper_ static s32 e1000_init_phy_params_82571(struct e1000_hw *hw) { struct e1000_phy_info *phy = &hw->phy; + struct e1000_dev_spec_82571 *dev_spec = &hw->dev_spec._82571; s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_init_phy_params_82571"); @@ -104,9 +109,7 @@ static s32 e1000_init_phy_params_82571(s phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; phy->reset_delay_us = 100; - phy->ops.acquire = e1000_get_hw_semaphore_82571; phy->ops.check_reset_block = e1000_check_reset_block_generic; - phy->ops.release = e1000_put_hw_semaphore_82571; phy->ops.reset = e1000_phy_hw_reset_generic; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82571; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; @@ -124,6 +127,8 @@ static s32 e1000_init_phy_params_82571(s phy->ops.get_cable_length = e1000_get_cable_length_igp_2; phy->ops.read_reg = e1000_read_phy_reg_igp; phy->ops.write_reg = e1000_write_phy_reg_igp; + phy->ops.acquire = e1000_get_hw_semaphore_82571; + phy->ops.release = e1000_put_hw_semaphore_82571; /* This uses above function pointers */ ret_val = e1000_get_phy_id_82571(hw); @@ -145,6 +150,8 @@ static s32 e1000_init_phy_params_82571(s phy->ops.get_cable_length = e1000_get_cable_length_m88; phy->ops.read_reg = e1000_read_phy_reg_m88; phy->ops.write_reg = e1000_write_phy_reg_m88; + phy->ops.acquire = e1000_get_hw_semaphore_82571; + phy->ops.release = e1000_put_hw_semaphore_82571; /* This uses above function pointers */ ret_val = e1000_get_phy_id_82571(hw); @@ -158,6 +165,8 @@ static s32 e1000_init_phy_params_82571(s break; case e1000_82574: case e1000_82583: + E1000_MUTEX_INIT(&dev_spec->swflag_mutex); + phy->type = e1000_phy_bm; phy->ops.get_cfg_done = e1000_get_cfg_done_generic; phy->ops.get_info = e1000_get_phy_info_m88; @@ -167,6 +176,8 @@ static s32 e1000_init_phy_params_82571(s phy->ops.get_cable_length = e1000_get_cable_length_m88; phy->ops.read_reg = e1000_read_phy_reg_bm2; phy->ops.write_reg = e1000_write_phy_reg_bm2; + phy->ops.acquire = e1000_get_hw_semaphore_82574; + phy->ops.release = e1000_put_hw_semaphore_82574; /* This uses above function pointers */ ret_val = e1000_get_phy_id_82571(hw); @@ -250,9 +261,18 @@ static s32 e1000_init_nvm_params_82571(s } /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_82571; + switch (hw->mac.type) { + case e1000_82574: + case e1000_82583: + nvm->ops.acquire = e1000_get_hw_semaphore_82574; + nvm->ops.release = e1000_put_hw_semaphore_82574; + break; + default: + nvm->ops.acquire = e1000_acquire_nvm_82571; + nvm->ops.release = e1000_release_nvm_82571; + break; + } nvm->ops.read = e1000_read_nvm_eerd; - nvm->ops.release = e1000_release_nvm_82571; nvm->ops.update = e1000_update_nvm_checksum_82571; nvm->ops.validate = e1000_validate_nvm_checksum_82571; nvm->ops.valid_led_default = e1000_valid_led_default_82571; @@ -578,6 +598,101 @@ static void e1000_put_hw_semaphore_82571 } /** + * e1000_get_hw_semaphore_82573 - Acquire hardware semaphore + * @hw: pointer to the HW structure + * + * Acquire the HW semaphore during reset. + * + **/ +static s32 e1000_get_hw_semaphore_82573(struct e1000_hw *hw) +{ + u32 extcnf_ctrl; + s32 ret_val = E1000_SUCCESS; + s32 i = 0; + + DEBUGFUNC("e1000_get_hw_semaphore_82573"); + + extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; + do { + E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); + extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); + + if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) + break; + + extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; + + msec_delay(2); + i++; + } while (i < MDIO_OWNERSHIP_TIMEOUT); + + if (i == MDIO_OWNERSHIP_TIMEOUT) { + /* Release semaphores */ + e1000_put_hw_semaphore_82573(hw); + DEBUGOUT("Driver can't access the PHY\n"); + ret_val = -E1000_ERR_PHY; + goto out; + } + +out: + return ret_val; +} + +/** + * e1000_put_hw_semaphore_82573 - Release hardware semaphore + * @hw: pointer to the HW structure + * + * Release hardware semaphore used during reset. + * + **/ +static void e1000_put_hw_semaphore_82573(struct e1000_hw *hw) +{ + u32 extcnf_ctrl; + + DEBUGFUNC("e1000_put_hw_semaphore_82573"); + + extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); + extcnf_ctrl &= ~E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; + E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); +} + +/** + * e1000_get_hw_semaphore_82574 - Acquire hardware semaphore + * @hw: pointer to the HW structure + * + * Acquire the HW semaphore to access the PHY or NVM. + * + **/ +static s32 e1000_get_hw_semaphore_82574(struct e1000_hw *hw) +{ + s32 ret_val; + + DEBUGFUNC("e1000_get_hw_semaphore_82574"); + + E1000_MUTEX_LOCK(&hw->dev_spec._82571.swflag_mutex); + ret_val = e1000_get_hw_semaphore_82573(hw); + if (ret_val) + E1000_MUTEX_UNLOCK(&hw->dev_spec._82571.swflag_mutex); + return ret_val; +} + +/** + * e1000_put_hw_semaphore_82574 - Release hardware semaphore + * @hw: pointer to the HW structure + * + * Release hardware semaphore used to access the PHY or NVM + * + **/ +static void e1000_put_hw_semaphore_82574(struct e1000_hw *hw) +{ + DEBUGFUNC("e1000_put_hw_semaphore_82574"); + + e1000_put_hw_semaphore_82573(hw); + E1000_MUTEX_UNLOCK(&hw->dev_spec._82571.swflag_mutex); +} + +/** * e1000_acquire_nvm_82571 - Request for access to the EEPROM * @hw: pointer to the HW structure * @@ -598,8 +713,6 @@ static s32 e1000_acquire_nvm_82571(struc switch (hw->mac.type) { case e1000_82573: - case e1000_82574: - case e1000_82583: break; default: ret_val = e1000_acquire_nvm_generic(hw); @@ -926,9 +1039,8 @@ out: **/ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) { - u32 ctrl, extcnf_ctrl, ctrl_ext, icr; + u32 ctrl, ctrl_ext, icr; s32 ret_val; - u16 i = 0; DEBUGFUNC("e1000_reset_hw_82571"); @@ -955,33 +1067,33 @@ static s32 e1000_reset_hw_82571(struct e */ switch (hw->mac.type) { case e1000_82573: + ret_val = e1000_get_hw_semaphore_82573(hw); + break; case e1000_82574: case e1000_82583: - extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; - - do { - E1000_WRITE_REG(hw, E1000_EXTCNF_CTRL, extcnf_ctrl); - extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); - - if (extcnf_ctrl & E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP) - break; - - extcnf_ctrl |= E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP; - - msec_delay(2); - i++; - } while (i < MDIO_OWNERSHIP_TIMEOUT); + ret_val = e1000_get_hw_semaphore_82574(hw); break; default: break; } + if (ret_val) + DEBUGOUT("Cannot acquire MDIO ownership\n"); ctrl = E1000_READ_REG(hw, E1000_CTRL); DEBUGOUT("Issuing a global reset to MAC\n"); E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST); + /* Must release MDIO ownership and mutex after MAC reset. */ + switch (hw->mac.type) { + case e1000_82574: + case e1000_82583: + e1000_put_hw_semaphore_82574(hw); + break; + default: + break; + } + if (hw->nvm.type == e1000_nvm_flash_hw) { usec_delay(10); ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); @@ -1015,12 +1127,14 @@ static s32 e1000_reset_hw_82571(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); icr = E1000_READ_REG(hw, E1000_ICR); - /* Install any alternate MAC address into RAR0 */ - ret_val = e1000_check_alt_mac_addr_generic(hw); - if (ret_val) - goto out; + if (hw->mac.type == e1000_82571) { + /* Install any alternate MAC address into RAR0 */ + ret_val = e1000_check_alt_mac_addr_generic(hw); + if (ret_val) + goto out; - e1000_set_laa_state_82571(hw, TRUE); + e1000_set_laa_state_82571(hw, TRUE); + } /* Reinitialize the 82571 serdes link state machine */ if (hw->phy.media_type == e1000_media_type_internal_serdes) @@ -1330,6 +1444,42 @@ static s32 e1000_led_on_82574(struct e10 return E1000_SUCCESS; } +/** + * e1000_check_phy_82574 - check 82574 phy hung state + * @hw: pointer to the HW structure + * + * Returns whether phy is hung or not + **/ +bool e1000_check_phy_82574(struct e1000_hw *hw) +{ + u16 status_1kbt = 0; + u16 receive_errors = 0; + bool phy_hung = FALSE; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_check_phy_82574"); + + /* + * Read PHY Receive Error counter first, if its is max - all F's then + * read the Base1000T status register If both are max then PHY is hung. + */ + ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, + &receive_errors); + if (ret_val) + goto out; + if (receive_errors == E1000_RECEIVE_ERROR_MAX) { + ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, + &status_1kbt); + if (ret_val) + goto out; + if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == + E1000_IDLE_ERROR_COUNT_MASK) + phy_hung = TRUE; + } +out: + return phy_hung; +} + /** * e1000_setup_link_82571 - Setup flow control and link settings @@ -1460,6 +1610,8 @@ static s32 e1000_check_for_serdes_link_8 u32 rxcw; u32 ctrl; u32 status; + u32 txcw; + u32 i; s32 ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_check_for_serdes_link_82571"); @@ -1482,8 +1634,10 @@ static s32 e1000_check_for_serdes_link_8 e1000_serdes_link_autoneg_progress; mac->serdes_has_link = FALSE; DEBUGOUT("AN_UP -> AN_PROG\n"); + } else { + mac->serdes_has_link = TRUE; } - break; + break; case e1000_serdes_link_forced_up: /* @@ -1491,8 +1645,10 @@ static s32 e1000_check_for_serdes_link_8 * auto-negotiation in the TXCW register and disable * forced link in the Device Control register in an * attempt to auto-negotiate with our link partner. + * If the partner code word is null, stop forcing + * and restart auto negotiation. */ - if (rxcw & E1000_RXCW_C) { + if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) { /* Enable autoneg, and unforce link up */ E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); E1000_WRITE_REG(hw, E1000_CTRL, @@ -1501,6 +1657,8 @@ static s32 e1000_check_for_serdes_link_8 e1000_serdes_link_autoneg_progress; mac->serdes_has_link = FALSE; DEBUGOUT("FORCED_UP -> AN_PROG\n"); + } else { + mac->serdes_has_link = TRUE; } break; @@ -1559,6 +1717,7 @@ static s32 e1000_check_for_serdes_link_8 (ctrl & ~E1000_CTRL_SLU)); mac->serdes_link_state = e1000_serdes_link_autoneg_progress; + mac->serdes_has_link = FALSE; DEBUGOUT("DOWN -> AN_PROG\n"); break; } @@ -1569,16 +1728,32 @@ static s32 e1000_check_for_serdes_link_8 DEBUGOUT("ANYSTATE -> DOWN\n"); } else { /* - * We have sync, and can tolerate one invalid (IV) - * codeword before declaring link down, so reread - * to look again. + * Check several times, if Sync and Config + * both are consistently 1 then simply ignore + * the Invalid bit and restart Autoneg */ - usec_delay(10); - rxcw = E1000_READ_REG(hw, E1000_RXCW); - if (rxcw & E1000_RXCW_IV) { - mac->serdes_link_state = e1000_serdes_link_down; + for (i = 0; i < AN_RETRY_COUNT; i++) { + usec_delay(10); + rxcw = E1000_READ_REG(hw, E1000_RXCW); + if ((rxcw & E1000_RXCW_IV) && + !((rxcw & E1000_RXCW_SYNCH) && + (rxcw & E1000_RXCW_C))) { + mac->serdes_has_link = FALSE; + mac->serdes_link_state = + e1000_serdes_link_down; + DEBUGOUT("ANYSTATE -> DOWN\n"); + break; + } + } + + if (i == AN_RETRY_COUNT) { + txcw = E1000_READ_REG(hw, E1000_TXCW); + txcw |= E1000_TXCW_ANE; + E1000_WRITE_REG(hw, E1000_TXCW, txcw); + mac->serdes_link_state = + e1000_serdes_link_autoneg_progress; mac->serdes_has_link = FALSE; - DEBUGOUT("ANYSTATE -> DOWN\n"); + DEBUGOUT("ANYSTATE -> AN_PROG\n"); } } } @@ -1736,14 +1911,16 @@ static s32 e1000_read_mac_addr_82571(str DEBUGFUNC("e1000_read_mac_addr_82571"); - /* - * If there's an alternate MAC address place it in RAR0 - * so that it will override the Si installed default perm - * address. - */ - ret_val = e1000_check_alt_mac_addr_generic(hw); - if (ret_val) - goto out; + if (hw->mac.type == e1000_82571) { + /* + * If there's an alternate MAC address place it in RAR0 + * so that it will override the Si installed default perm + * address. + */ + ret_val = e1000_check_alt_mac_addr_generic(hw); + if (ret_val) + goto out; + } ret_val = e1000_read_mac_addr_generic(hw); Modified: stable/7/sys/dev/e1000/e1000_82571.h ============================================================================== --- stable/7/sys/dev/e1000/e1000_82571.h Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_82571.h Sat Nov 27 01:09:54 2010 (r215922) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2008, Intel Corporation + Copyright (c) 2001-2010, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -42,6 +42,7 @@ (ID_LED_DEF1_DEF2)) #define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000 +#define AN_RETRY_COUNT 5 /* Autoneg Retry Count value */ /* Intr Throttling - RW */ #define E1000_EITR_82574(_n) (0x000E8 + (0x4 * (_n))) @@ -53,6 +54,11 @@ #define E1000_RXCFGL 0x0B634 /* TimeSync Rx EtherType & Msg Type Reg - RW */ +#define E1000_BASE1000T_STATUS 10 +#define E1000_IDLE_ERROR_COUNT_MASK 0xFF +#define E1000_RECEIVE_ERROR_COUNTER 21 +#define E1000_RECEIVE_ERROR_MAX 0xFFFF +bool e1000_check_phy_82574(struct e1000_hw *hw); bool e1000_get_laa_state_82571(struct e1000_hw *hw); void e1000_set_laa_state_82571(struct e1000_hw *hw, bool state); Modified: stable/7/sys/dev/e1000/e1000_82575.c ============================================================================== --- stable/7/sys/dev/e1000/e1000_82575.c Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_82575.c Sat Nov 27 01:09:54 2010 (r215922) @@ -85,6 +85,7 @@ static void e1000_power_down_phy_copper_ static void e1000_shutdown_serdes_link_82575(struct e1000_hw *hw); static void e1000_power_up_serdes_link_82575(struct e1000_hw *hw); static s32 e1000_set_pcie_completion_timeout(struct e1000_hw *hw); +static s32 e1000_reset_mdicnfg_82580(struct e1000_hw *hw); static const u16 e1000_82580_rxpbs_table[] = { 36, 72, 144, 1, 2, 4, 8, 16, @@ -92,6 +93,37 @@ static const u16 e1000_82580_rxpbs_table #define E1000_82580_RXPBS_TABLE_SIZE \ (sizeof(e1000_82580_rxpbs_table)/sizeof(u16)) + +/** + * e1000_sgmii_uses_mdio_82575 - Determine if I2C pins are for external MDIO + * @hw: pointer to the HW structure + * + * Called to determine if the I2C pins are being used for I2C or as an + * external MDIO interface since the two options are mutually exclusive. + **/ +static bool e1000_sgmii_uses_mdio_82575(struct e1000_hw *hw) +{ + u32 reg = 0; + bool ext_mdio = FALSE; + + DEBUGFUNC("e1000_sgmii_uses_mdio_82575"); + + switch (hw->mac.type) { + case e1000_82575: + case e1000_82576: + reg = E1000_READ_REG(hw, E1000_MDIC); + ext_mdio = !!(reg & E1000_MDIC_DEST); + break; + case e1000_82580: + reg = E1000_READ_REG(hw, E1000_MDICNFG); + ext_mdio = !!(reg & E1000_MDICNFG_EXT_MDIO); + break; + default: + break; + } + return ext_mdio; +} + /** * e1000_init_phy_params_82575 - Init PHY func ptrs. * @hw: pointer to the HW structure @@ -100,6 +132,7 @@ static s32 e1000_init_phy_params_82575(s { struct e1000_phy_info *phy = &hw->phy; s32 ret_val = E1000_SUCCESS; + u32 ctrl_ext; DEBUGFUNC("e1000_init_phy_params_82575"); @@ -120,16 +153,26 @@ static s32 e1000_init_phy_params_82575(s phy->ops.get_cfg_done = e1000_get_cfg_done_82575; phy->ops.release = e1000_release_phy_82575; + ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); + if (e1000_sgmii_active_82575(hw)) { phy->ops.reset = e1000_phy_hw_reset_sgmii_82575; + ctrl_ext |= E1000_CTRL_I2C_ENA; + } else { + phy->ops.reset = e1000_phy_hw_reset_generic; + ctrl_ext &= ~E1000_CTRL_I2C_ENA; + } + + E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); + e1000_reset_mdicnfg_82580(hw); + + if (e1000_sgmii_active_82575(hw) && !e1000_sgmii_uses_mdio_82575(hw)) { phy->ops.read_reg = e1000_read_phy_reg_sgmii_82575; phy->ops.write_reg = e1000_write_phy_reg_sgmii_82575; } else if (hw->mac.type >= e1000_82580) { - phy->ops.reset = e1000_phy_hw_reset_generic; phy->ops.read_reg = e1000_read_phy_reg_82580; phy->ops.write_reg = e1000_write_phy_reg_82580; } else { - phy->ops.reset = e1000_phy_hw_reset_generic; phy->ops.read_reg = e1000_read_phy_reg_igp; phy->ops.write_reg = e1000_write_phy_reg_igp; } @@ -256,27 +299,15 @@ static s32 e1000_init_mac_params_82575(s switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) { case E1000_CTRL_EXT_LINK_MODE_SGMII: dev_spec->sgmii_active = TRUE; - ctrl_ext |= E1000_CTRL_I2C_ENA; break; case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: hw->phy.media_type = e1000_media_type_internal_serdes; - ctrl_ext |= E1000_CTRL_I2C_ENA; break; default: - ctrl_ext &= ~E1000_CTRL_I2C_ENA; break; } - E1000_WRITE_REG(hw, E1000_CTRL_EXT, ctrl_ext); - - /* - * if using i2c make certain the MDICNFG register is cleared to prevent - * communications from being misrouted to the mdic registers - */ - if ((ctrl_ext & E1000_CTRL_I2C_ENA) && (hw->mac.type == e1000_82580)) - E1000_WRITE_REG(hw, E1000_MDICNFG, 0); - /* Set mta register count */ mac->mta_reg_count = 128; /* Set uta register count */ @@ -367,6 +398,7 @@ void e1000_init_function_pointers_82575( hw->mac.ops.init_params = e1000_init_mac_params_82575; hw->nvm.ops.init_params = e1000_init_nvm_params_82575; hw->phy.ops.init_params = e1000_init_phy_params_82575; + hw->mbx.ops.init_params = e1000_init_mbx_params_pf; } /** @@ -492,6 +524,7 @@ static s32 e1000_get_phy_id_82575(struct s32 ret_val = E1000_SUCCESS; u16 phy_id; u32 ctrl_ext; + u32 mdic; DEBUGFUNC("e1000_get_phy_id_82575"); @@ -508,6 +541,28 @@ static s32 e1000_get_phy_id_82575(struct goto out; } + if (e1000_sgmii_uses_mdio_82575(hw)) { + switch (hw->mac.type) { + case e1000_82575: + case e1000_82576: + mdic = E1000_READ_REG(hw, E1000_MDIC); + mdic &= E1000_MDIC_PHY_MASK; + phy->addr = mdic >> E1000_MDIC_PHY_SHIFT; + break; + case e1000_82580: + mdic = E1000_READ_REG(hw, E1000_MDICNFG); + mdic &= E1000_MDICNFG_PHY_MASK; + phy->addr = mdic >> E1000_MDICNFG_PHY_SHIFT; + break; + default: + ret_val = -E1000_ERR_PHY; + goto out; + break; + } + ret_val = e1000_get_phy_id(hw); + goto out; + } + /* Power on sgmii phy if it is disabled */ ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); E1000_WRITE_REG(hw, E1000_CTRL_EXT, @@ -1243,6 +1298,7 @@ static s32 e1000_setup_serdes_link_82575 case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: /* disable PCS autoneg and support parallel detect only */ pcs_autoneg = FALSE; + /* fall through to default case */ default: /* * non-SGMII modes only supports a speed of 1000/Full for the @@ -1638,6 +1694,39 @@ out: return ret_val; } + +/** + * e1000_vmdq_set_anti_spoofing_pf - enable or disable anti-spoofing + * @hw: pointer to the hardware struct + * @enable: state to enter, either enabled or disabled + * @pf: Physical Function pool - do not set anti-spoofing for the PF + * + * enables/disables L2 switch anti-spoofing functionality. + **/ +void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf) +{ + u32 dtxswc; + + switch (hw->mac.type) { + case e1000_82576: + dtxswc = E1000_READ_REG(hw, E1000_DTXSWC); + if (enable) { + dtxswc |= (E1000_DTXSWC_MAC_SPOOF_MASK | + E1000_DTXSWC_VLAN_SPOOF_MASK); + /* The PF can spoof - it has to in order to + * support emulation mode NICs */ + dtxswc ^= (1 << pf | 1 << (pf + MAX_NUM_VFS)); + } else { + dtxswc &= ~(E1000_DTXSWC_MAC_SPOOF_MASK | + E1000_DTXSWC_VLAN_SPOOF_MASK); + } + E1000_WRITE_REG(hw, E1000_DTXSWC, dtxswc); + break; + default: + break; + } +} + /** * e1000_vmdq_set_loopback_pf - enable or disable vmdq loopback * @hw: pointer to the hardware struct @@ -1739,6 +1828,45 @@ out: } /** + * e1000_reset_mdicnfg_82580 - Reset MDICNFG destination and com_mdio bits + * @hw: pointer to the HW structure + * + * This resets the the MDICNFG.Destination and MDICNFG.Com_MDIO bits based on + * the values found in the EEPROM. This addresses an issue in which these + * bits are not restored from EEPROM after reset. + **/ +static s32 e1000_reset_mdicnfg_82580(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + u32 mdicnfg; + u16 nvm_data; + + DEBUGFUNC("e1000_reset_mdicnfg_82580"); + + if (hw->mac.type != e1000_82580) + goto out; + if (!e1000_sgmii_active_82575(hw)) + goto out; + + ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A + + NVM_82580_LAN_FUNC_OFFSET(hw->bus.func), 1, + &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + goto out; + } + + mdicnfg = E1000_READ_REG(hw, E1000_MDICNFG); + if (nvm_data & NVM_WORD24_EXT_MDIO) + mdicnfg |= E1000_MDICNFG_EXT_MDIO; + if (nvm_data & NVM_WORD24_COM_MDIO) + mdicnfg |= E1000_MDICNFG_COM_MDIO; + E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg); +out: + return ret_val; +} + +/** * e1000_reset_hw_82580 - Reset hardware * @hw: pointer to the HW structure * @@ -1814,6 +1942,10 @@ static s32 e1000_reset_hw_82580(struct e E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); icr = E1000_READ_REG(hw, E1000_ICR); + ret_val = e1000_reset_mdicnfg_82580(hw); + if (ret_val) + DEBUGOUT("Could not reset MDICNFG based on EEPROM\n"); + /* Install any alternate MAC address into RAR0 */ ret_val = e1000_check_alt_mac_addr_generic(hw); Modified: stable/7/sys/dev/e1000/e1000_82575.h ============================================================================== --- stable/7/sys/dev/e1000/e1000_82575.h Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_82575.h Sat Nov 27 01:09:54 2010 (r215922) @@ -458,6 +458,18 @@ struct e1000_adv_tx_context_desc { /* RX packet buffer size defines */ #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable); +void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); +enum e1000_promisc_type { + e1000_promisc_disabled = 0, /* all promisc modes disabled */ + e1000_promisc_unicast = 1, /* unicast promiscuous enabled */ + e1000_promisc_multicast = 2, /* multicast promiscuous enabled */ + e1000_promisc_enabled = 3, /* both uni and multicast promisc */ + e1000_num_promisc_types +}; + +void e1000_vfta_set_vf(struct e1000_hw *, u16, bool); +void e1000_rlpml_set_vf(struct e1000_hw *, u16); +s32 e1000_promisc_set_vf(struct e1000_hw *, enum e1000_promisc_type type); u16 e1000_rxpbs_adjust_82580(u32 data); #endif /* _E1000_82575_H_ */ Modified: stable/7/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/7/sys/dev/e1000/e1000_api.c Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_api.c Sat Nov 27 01:09:54 2010 (r215922) @@ -112,6 +112,31 @@ out: return ret_val; } +/** + * e1000_init_mbx_params - Initialize mailbox function pointers + * @hw: pointer to the HW structure + * + * This function initializes the function pointers for the PHY + * set of functions. Called by drivers or by e1000_setup_init_funcs. + **/ +s32 e1000_init_mbx_params(struct e1000_hw *hw) +{ + s32 ret_val = E1000_SUCCESS; + + if (hw->mbx.ops.init_params) { + ret_val = hw->mbx.ops.init_params(hw); + if (ret_val) { + DEBUGOUT("Mailbox Initialization Error\n"); + goto out; + } + } else { + DEBUGOUT("mbx.init_mbx_params was NULL\n"); + ret_val = -E1000_ERR_CONFIG; + } + +out: + return ret_val; +} /** * e1000_set_mac_type - Sets MAC type @@ -251,6 +276,8 @@ s32 e1000_set_mac_type(struct e1000_hw * break; case E1000_DEV_ID_ICH10_D_BM_LM: case E1000_DEV_ID_ICH10_D_BM_LF: + case E1000_DEV_ID_ICH10_D_BM_V: + case E1000_DEV_ID_ICH10_HANKSVILLE: mac->type = e1000_ich10lan; break; case E1000_DEV_ID_PCH_D_HV_DM: @@ -259,6 +286,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_M_HV_LC: mac->type = e1000_pchlan; break; + case E1000_DEV_ID_PCH2_LV_LM: + case E1000_DEV_ID_PCH2_LV_V: + mac->type = e1000_pch2lan; + break; case E1000_DEV_ID_82575EB_COPPER: case E1000_DEV_ID_82575EB_FIBER_SERDES: case E1000_DEV_ID_82575GB_QUAD_COPPER: @@ -269,6 +300,7 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_82576_FIBER: case E1000_DEV_ID_82576_SERDES: case E1000_DEV_ID_82576_QUAD_COPPER: + case E1000_DEV_ID_82576_QUAD_COPPER_ET2: case E1000_DEV_ID_82576_NS: case E1000_DEV_ID_82576_NS_SERDES: case E1000_DEV_ID_82576_SERDES_QUAD: @@ -279,8 +311,14 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_82580_SERDES: case E1000_DEV_ID_82580_SGMII: case E1000_DEV_ID_82580_COPPER_DUAL: + case E1000_DEV_ID_82580_QUAD_FIBER: + case E1000_DEV_ID_DH89XXCC_SGMII: + case E1000_DEV_ID_DH89XXCC_SERDES: mac->type = e1000_82580; break; + case E1000_DEV_ID_82576_VF: + mac->type = e1000_vfadapt; + break; default: /* Should never have loaded on this device */ ret_val = -E1000_ERR_MAC_INIT; @@ -326,6 +364,7 @@ s32 e1000_setup_init_funcs(struct e1000_ e1000_init_mac_ops_generic(hw); e1000_init_phy_ops_generic(hw); e1000_init_nvm_ops_generic(hw); + e1000_init_mbx_ops_generic(hw); /* * Set up the init function pointers. These are functions within the @@ -367,6 +406,7 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_ich9lan: case e1000_ich10lan: case e1000_pchlan: + case e1000_pch2lan: e1000_init_function_pointers_ich8lan(hw); break; case e1000_82575: @@ -374,6 +414,9 @@ s32 e1000_setup_init_funcs(struct e1000_ case e1000_82580: e1000_init_function_pointers_82575(hw); break; + case e1000_vfadapt: + e1000_init_function_pointers_vf(hw); + break; default: DEBUGOUT("Hardware not supported\n"); ret_val = -E1000_ERR_CONFIG; @@ -396,6 +439,10 @@ s32 e1000_setup_init_funcs(struct e1000_ ret_val = e1000_init_phy_params(hw); if (ret_val) goto out; + + ret_val = e1000_init_mbx_params(hw); + if (ret_val) + goto out; } out: @@ -1095,6 +1142,37 @@ s32 e1000_read_mac_addr(struct e1000_hw } /** + * e1000_read_pba_string - Read device part number string + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * @pba_num_size: size of part number buffer + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size) +{ + return e1000_read_pba_string_generic(hw, pba_num, pba_num_size); +} + +/** + * e1000_read_pba_length - Read device part number string length + * @hw: pointer to the HW structure + * @pba_num_size: size of part number buffer + * + * Reads the product board assembly (PBA) number length from the EEPROM and + * stores the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) +{ + return e1000_read_pba_length_generic(hw, pba_num_size); +} + +/** * e1000_read_pba_num - Read device part number * @hw: pointer to the HW structure * @pba_num: pointer to device part number Modified: stable/7/sys/dev/e1000/e1000_api.h ============================================================================== --- stable/7/sys/dev/e1000/e1000_api.h Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_api.h Sat Nov 27 01:09:54 2010 (r215922) @@ -55,6 +55,7 @@ s32 e1000_setup_init_funcs(struct e1000 s32 e1000_init_mac_params(struct e1000_hw *hw); s32 e1000_init_nvm_params(struct e1000_hw *hw); s32 e1000_init_phy_params(struct e1000_hw *hw); +s32 e1000_init_mbx_params(struct e1000_hw *hw); s32 e1000_get_bus_info(struct e1000_hw *hw); void e1000_clear_vfta(struct e1000_hw *hw); void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value); @@ -96,6 +97,9 @@ void e1000_power_up_phy(struct e1000_hw void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); +s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, + u32 pba_num_size); +s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); void e1000_reload_nvm(struct e1000_hw *hw); s32 e1000_update_nvm_checksum(struct e1000_hw *hw); s32 e1000_validate_nvm_checksum(struct e1000_hw *hw); Modified: stable/7/sys/dev/e1000/e1000_defines.h ============================================================================== --- stable/7/sys/dev/e1000/e1000_defines.h Sat Nov 27 00:46:57 2010 (r215921) +++ stable/7/sys/dev/e1000/e1000_defines.h Sat Nov 27 01:09:54 2010 (r215922) @@ -49,6 +49,8 @@ #define E1000_WUC_LSCWO 0x00000020 /* Link Status wake up override */ #define E1000_WUC_SPM 0x80000000 /* Enable SPM */ #define E1000_WUC_PHY_WAKE 0x00000100 /* if PHY supports wakeup */ +#define E1000_WUC_FLX6_PHY 0x4000 /* Flexible Filter 6 Enable */ +#define E1000_WUC_FLX7_PHY 0x8000 /* Flexible Filter 7 Enable */ /* Wake Up Filter Control */ #define E1000_WUFC_LNKC 0x00000001 /* Link Status Change Wakeup Enable */ @@ -73,6 +75,8 @@ #define E1000_WUFC_FLX3 0x00080000 /* Flexible Filter 3 Enable */ #define E1000_WUFC_FLX4 0x00100000 /* Flexible Filter 4 Enable */ #define E1000_WUFC_FLX5 0x00200000 /* Flexible Filter 5 Enable */ +#define E1000_WUFC_FLX6 0x00400000 /* Flexible Filter 6 Enable */ +#define E1000_WUFC_FLX7 0x00800000 /* Flexible Filter 7 Enable */ #define E1000_WUFC_ALL_FILTERS_PHY_4 0x0000F0FF /*Mask for all wakeup filters*/ #define E1000_WUFC_FLX_OFFSET_PHY 12 /* Offset to the Flexible Filters bits */ #define E1000_WUFC_FLX_FILTERS_PHY_4 0x0000F000 /*Mask for 4 flexible filters*/ @@ -80,9 +84,11 @@ #define E1000_WUFC_FLX_FILTERS_PHY_6 0x0000F600 /*Mask for 6 flexible filters*/ #define E1000_WUFC_ALL_FILTERS 0x000F00FF /* Mask for all wakeup filters */ #define E1000_WUFC_ALL_FILTERS_6 0x003F00FF /* Mask for all 6 wakeup filters*/ +#define E1000_WUFC_ALL_FILTERS_8 0x00FF00FF /* Mask for all 8 wakeup filters*/ #define E1000_WUFC_FLX_OFFSET 16 /* Offset to the Flexible Filters bits */ #define E1000_WUFC_FLX_FILTERS 0x000F0000 /*Mask for the 4 flexible filters */ #define E1000_WUFC_FLX_FILTERS_6 0x003F0000 /* Mask for 6 flexible filters */ +#define E1000_WUFC_FLX_FILTERS_8 0x00FF0000 /* Mask for 8 flexible filters */ /* * For 82576 to utilize Extended filter masks in addition to * existing (filter) masks @@ -109,10 +115,15 @@ #define E1000_WUS_FLX3 E1000_WUFC_FLX3 #define E1000_WUS_FLX4 E1000_WUFC_FLX4 #define E1000_WUS_FLX5 E1000_WUFC_FLX5 +#define E1000_WUS_FLX6 E1000_WUFC_FLX6 +#define E1000_WUS_FLX7 E1000_WUFC_FLX7 #define E1000_WUS_FLX4_PHY E1000_WUFC_FLX4_PHY #define E1000_WUS_FLX5_PHY E1000_WUFC_FLX5_PHY +#define E1000_WUS_FLX6_PHY 0x0400 +#define E1000_WUS_FLX7_PHY 0x0800 #define E1000_WUS_FLX_FILTERS E1000_WUFC_FLX_FILTERS #define E1000_WUS_FLX_FILTERS_6 E1000_WUFC_FLX_FILTERS_6 +#define E1000_WUS_FLX_FILTERS_8 E1000_WUFC_FLX_FILTERS_8 #define E1000_WUS_FLX_FILTERS_PHY_6 E1000_WUFC_FLX_FILTERS_PHY_6 /* Wake Up Packet Length */ @@ -122,6 +133,8 @@ #define E1000_FLEXIBLE_FILTER_COUNT_MAX 4 /* Six Flexible Filters are supported */ #define E1000_FLEXIBLE_FILTER_COUNT_MAX_6 6 +/* Eight Flexible Filters are supported */ +#define E1000_FLEXIBLE_FILTER_COUNT_MAX_8 8 /* Two Extended Flexible Filters are supported (82576) */ #define E1000_EXT_FLEXIBLE_FILTER_COUNT_MAX 2 #define E1000_FHFT_LENGTH_OFFSET 0xFC /* Length byte in FHFT */ @@ -132,6 +145,7 @@ #define E1000_FFLT_SIZE E1000_FLEXIBLE_FILTER_COUNT_MAX #define E1000_FFLT_SIZE_6 E1000_FLEXIBLE_FILTER_COUNT_MAX_6 +#define E1000_FFLT_SIZE_8 E1000_FLEXIBLE_FILTER_COUNT_MAX_8 #define E1000_FFMT_SIZE E1000_FLEXIBLE_FILTER_SIZE_MAX *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 03:12:39 2010 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 6FC38106564A; Sat, 27 Nov 2010 03:12:39 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7718FC08; Sat, 27 Nov 2010 03:12:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAR3CdsQ008968; Sat, 27 Nov 2010 03:12:39 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAR3CdGH008966; Sat, 27 Nov 2010 03:12:39 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011270312.oAR3CdGH008966@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 27 Nov 2010 03:12:39 +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: r215926 - stable/7/sys/netinet 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, 27 Nov 2010 03:12:39 -0000 Author: lstewart Date: Sat Nov 27 03:12:39 2010 New Revision: 215926 URL: http://svn.freebsd.org/changeset/base/215926 Log: Partially MFC r215166: Disable priming the congestion window from the host cache. The current method interacts poorly with delayed ack amongst other things, resulting in undesired delay during a connection's opening slow start. Even if we did fix the issues, the current method is still dubious at best and needs to be thought through thoroughly. Due to a mistake on my behalf, the change described above was committed to head as part of a larger patch in revision 215166. Instead of waiting for the MFC of 215166, I'm merging just this small portion for the upcoming release without bringing the mergeinfo for r215166 along. The mergeinfo will sort itself out when r215166 is eventually merged. This is an intentional direct commit to the 7-STABLE branch. Reported by: Maxim Dounin and others Submitted by: andre Modified: stable/7/sys/netinet/tcp_input.c Modified: stable/7/sys/netinet/tcp_input.c ============================================================================== --- stable/7/sys/netinet/tcp_input.c Sat Nov 27 02:18:55 2010 (r215925) +++ stable/7/sys/netinet/tcp_input.c Sat Nov 27 03:12:39 2010 (r215926) @@ -2987,10 +2987,14 @@ tcp_mss(struct tcpcb *tp, int offer) * hostcache when cwnd collapses so next connection doesn't * overloads the path again. * + * XXXAO: Initializing the CWND from the hostcache is broken + * and in its current form not RFC conformant. It is disabled + * until fixed or removed entirely. + * * RFC3390 says only do this if SYN or SYN/ACK didn't got lost. * We currently check only in syncache_socket for that. */ -#define TCP_METRICS_CWND +/* #define TCP_METRICS_CWND */ #ifdef TCP_METRICS_CWND if (metrics.rmx_cwnd) tp->snd_cwnd = max(mss, From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 03:46:32 2010 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 B1E25106566C; Sat, 27 Nov 2010 03:46:32 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9EE138FC0C; Sat, 27 Nov 2010 03:46:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAR3kWCd010702; Sat, 27 Nov 2010 03:46:32 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAR3kW2R010700; Sat, 27 Nov 2010 03:46:32 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201011270346.oAR3kW2R010700@svn.freebsd.org> From: Lawrence Stewart Date: Sat, 27 Nov 2010 03:46:32 +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: r215929 - stable/7/sys/netinet 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, 27 Nov 2010 03:46:32 -0000 Author: lstewart Date: Sat Nov 27 03:46:32 2010 New Revision: 215929 URL: http://svn.freebsd.org/changeset/base/215929 Log: MFC r215553: Fix a minor code redundancy nit. Modified: stable/7/sys/netinet/siftr.c 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/netinet/siftr.c ============================================================================== --- stable/7/sys/netinet/siftr.c Sat Nov 27 03:23:40 2010 (r215928) +++ stable/7/sys/netinet/siftr.c Sat Nov 27 03:46:32 2010 (r215929) @@ -742,14 +742,12 @@ siftr_findinpcb(int ipver, struct ip *ip ss->nskip_in_inpcb++; else ss->nskip_out_inpcb++; - - INP_INFO_RUNLOCK(&V_tcbinfo); } else { /* Acquire the inpcb lock. */ INP_UNLOCK_ASSERT(inp); INP_RLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); } + INP_INFO_RUNLOCK(&V_tcbinfo); return (inp); } From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 03:54:13 2010 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 A5034106566B; Sat, 27 Nov 2010 03:54:13 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 27AD18FC13; Sat, 27 Nov 2010 03:54:12 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id A24CA7E84A; Sat, 27 Nov 2010 14:35:22 +1100 (EST) Message-ID: <4CF07C7A.5090603@freebsd.org> Date: Sat, 27 Nov 2010 14:35:22 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.12) Gecko/20101117 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: Jack F Vogel References: <201011270109.oAR19sEu003096@svn.freebsd.org> In-Reply-To: <201011270109.oAR19sEu003096@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-7@FreeBSD.org Subject: Re: svn commit: r215922 - in stable/7/sys: conf dev/e1000 modules/em modules/igb 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, 27 Nov 2010 03:54:13 -0000 Hi Jack, On 11/27/10 12:09, Jack F Vogel wrote: > Author: jfv > Date: Sat Nov 27 01:09:54 2010 > New Revision: 215922 > URL: http://svn.freebsd.org/changeset/base/215922 > > Log: > MFC: r214646, r215781, r215789, 215808 > Brings 7.4 e1000 drivers to the same level as 8.2 > > Modified: > stable/7/sys/conf/files > stable/7/sys/dev/e1000/e1000_82571.c > stable/7/sys/dev/e1000/e1000_82571.h > stable/7/sys/dev/e1000/e1000_82575.c > stable/7/sys/dev/e1000/e1000_82575.h > stable/7/sys/dev/e1000/e1000_api.c > stable/7/sys/dev/e1000/e1000_api.h > stable/7/sys/dev/e1000/e1000_defines.h > stable/7/sys/dev/e1000/e1000_hw.h > stable/7/sys/dev/e1000/e1000_ich8lan.c > stable/7/sys/dev/e1000/e1000_ich8lan.h > stable/7/sys/dev/e1000/e1000_mac.c > stable/7/sys/dev/e1000/e1000_nvm.c > stable/7/sys/dev/e1000/e1000_nvm.h > stable/7/sys/dev/e1000/e1000_osdep.h > stable/7/sys/dev/e1000/e1000_phy.c > stable/7/sys/dev/e1000/e1000_phy.h > stable/7/sys/dev/e1000/e1000_regs.h > stable/7/sys/dev/e1000/if_em.c > stable/7/sys/dev/e1000/if_em.h > stable/7/sys/dev/e1000/if_igb.c > stable/7/sys/dev/e1000/if_igb.h > stable/7/sys/dev/e1000/if_lem.c > stable/7/sys/dev/e1000/if_lem.h > stable/7/sys/modules/em/Makefile > stable/7/sys/modules/igb/Makefile > Directory Properties: > stable/7/ (props changed) I believe this has broken the GENERIC kernel build. Did you run a test "make buildkernel" before committing the MFC? Cheers, Lawrence [...] /usr/obj/work/svn/freebsd_mirror/stable/7/make.amd64/make -V CFILES -V SYSTEM_CFILES -V GEN_CFILES | MKDEP_CPP="cc -E" CC="cc" xargs mkdep -a -f .newdep -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc -I. -I/work/svn/freebsd_mirror/stable/7/sys -I/work/svn/freebsd_mirror/stable/7/sys/contrib/altq -I/work/svn/freebsd_mirror/stable/7/sys/contrib/ipfilter -I/work/svn/freebsd_mirror/stable/7/sys/contrib/pf -I/work/svn/freebsd_mirror/stable/7/sys/dev/ath -I/work/svn/freebsd_mirror/stable/7/sys/dev/ath/ath_hal -I/work/svn/freebsd_mirror/stable/7/sys/contrib/ngatm -I/work/svn/freebsd_mirror/stable/7/sys/dev/twa -I/work/svn/freebsd_mirror/stable/7/sys/gnu/fs/xfs/FreeBSD -I/work/svn/freebsd_mirror/stable/7/sys/gnu/fs/xfs/FreeBSD/support -I/work/svn/freebsd_mirror/stable/7/sys/gnu/fs/xfs -I/work/svn/freebsd_mirror/stable/7/sys/contrib/opensolaris/compat -I/work/svn/freebsd_mirror/stable/7/sys/dev/cxgb -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=8000 --param inline-unit-growth=100 --param large-function-growth=1000 -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -ffreestanding cc: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_vf.c: No such file or directory cc: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_mbx.c: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/if_em.c:81: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/if_lem.c:81: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/if_igb.c:87: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_80003es2lan.c:40: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82540.c:46: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82541.c:44: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82542.c:39: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82543.c:44: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82571.c:52: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82575.c:44: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_ich8lan.c:65: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.c:35: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_mac.c:35: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_manage.c:35: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_nvm.c:35: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_phy.c:35: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory In file included from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, from /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_osdep.c:35: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: error: e1000_mbx.h: No such file or directory mkdep: compile failed *** Error code 1 Stop in /usr/obj/work/svn/freebsd_mirror/stable/7/sys/GENERIC. *** Error code 1 Stop in /work/svn/freebsd_mirror/stable/7. *** Error code 1 Stop in /work/svn/freebsd_mirror/stable/7. From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 04:46:16 2010 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 589F3106566C; Sat, 27 Nov 2010 04:46:16 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 44AD78FC16; Sat, 27 Nov 2010 04:46:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAR4kGgJ013718; Sat, 27 Nov 2010 04:46:16 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAR4kG5f013713; Sat, 27 Nov 2010 04:46:16 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201011270446.oAR4kG5f013713@svn.freebsd.org> From: Jack F Vogel Date: Sat, 27 Nov 2010 04:46:16 +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: r215933 - stable/7/sys/dev/e1000 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, 27 Nov 2010 04:46:16 -0000 Author: jfv Date: Sat Nov 27 04:46:16 2010 New Revision: 215933 URL: http://svn.freebsd.org/changeset/base/215933 Log: Add missing shared code files. Added: stable/7/sys/dev/e1000/e1000_mbx.c (contents, props changed) stable/7/sys/dev/e1000/e1000_mbx.h (contents, props changed) stable/7/sys/dev/e1000/e1000_vf.c (contents, props changed) stable/7/sys/dev/e1000/e1000_vf.h (contents, props changed) Added: stable/7/sys/dev/e1000/e1000_mbx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/e1000/e1000_mbx.c Sat Nov 27 04:46:16 2010 (r215933) @@ -0,0 +1,762 @@ +/****************************************************************************** + + Copyright (c) 2001-2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "e1000_mbx.h" + +/** + * e1000_null_mbx_check_for_flag - No-op function, return 0 + * @hw: pointer to the HW structure + **/ +static s32 e1000_null_mbx_check_for_flag(struct e1000_hw *hw, u16 mbx_id) +{ + DEBUGFUNC("e1000_null_mbx_check_flag"); + + return E1000_SUCCESS; +} + +/** + * e1000_null_mbx_transact - No-op function, return 0 + * @hw: pointer to the HW structure + **/ +static s32 e1000_null_mbx_transact(struct e1000_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + DEBUGFUNC("e1000_null_mbx_rw_msg"); + + return E1000_SUCCESS; +} + +/** + * e1000_read_mbx - Reads a message from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfuly read message from buffer + **/ +s32 e1000_read_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_read_mbx"); + + /* limit read to size of mailbox */ + if (size > mbx->size) + size = mbx->size; + + if (mbx->ops.read) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); + + return ret_val; +} + +/** + * e1000_write_mbx - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +s32 e1000_write_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = E1000_SUCCESS; + + DEBUGFUNC("e1000_write_mbx"); + + if (size > mbx->size) + ret_val = -E1000_ERR_MBX; + + else if (mbx->ops.write) + ret_val = mbx->ops.write(hw, msg, size, mbx_id); + + return ret_val; +} + +/** + * e1000_check_for_msg - checks to see if someone sent us mail + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 e1000_check_for_msg(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_msg"); + + if (mbx->ops.check_for_msg) + ret_val = mbx->ops.check_for_msg(hw, mbx_id); + + return ret_val; +} + +/** + * e1000_check_for_ack - checks to see if someone sent us ACK + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 e1000_check_for_ack(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_ack"); + + if (mbx->ops.check_for_ack) + ret_val = mbx->ops.check_for_ack(hw, mbx_id); + + return ret_val; +} + +/** + * e1000_check_for_rst - checks to see if other side has reset + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the Status bit was found or else ERR_MBX + **/ +s32 e1000_check_for_rst(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_rst"); + + if (mbx->ops.check_for_rst) + ret_val = mbx->ops.check_for_rst(hw, mbx_id); + + return ret_val; +} + +/** + * e1000_poll_for_msg - Wait for message notification + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message notification + **/ +static s32 e1000_poll_for_msg(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; + + DEBUGFUNC("e1000_poll_for_msg"); + + if (!countdown || !mbx->ops.check_for_msg) + goto out; + + while (countdown && mbx->ops.check_for_msg(hw, mbx_id)) { + countdown--; + if (!countdown) + break; + usec_delay(mbx->usec_delay); + } + + /* if we failed, all future posted messages fail until reset */ + if (!countdown) + mbx->timeout = 0; +out: + return countdown ? E1000_SUCCESS : -E1000_ERR_MBX; +} + +/** + * e1000_poll_for_ack - Wait for message acknowledgement + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message acknowledgement + **/ +static s32 e1000_poll_for_ack(struct e1000_hw *hw, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + int countdown = mbx->timeout; + + DEBUGFUNC("e1000_poll_for_ack"); + + if (!countdown || !mbx->ops.check_for_ack) + goto out; + + while (countdown && mbx->ops.check_for_ack(hw, mbx_id)) { + countdown--; + if (!countdown) + break; + usec_delay(mbx->usec_delay); + } + + /* if we failed, all future posted messages fail until reset */ + if (!countdown) + mbx->timeout = 0; +out: + return countdown ? E1000_SUCCESS : -E1000_ERR_MBX; +} + +/** + * e1000_read_posted_mbx - Wait for message notification and receive message + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully received a message notification and + * copied it into the receive buffer. + **/ +s32 e1000_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_read_posted_mbx"); + + if (!mbx->ops.read) + goto out; + + ret_val = e1000_poll_for_msg(hw, mbx_id); + + /* if ack received read message, otherwise we timed out */ + if (!ret_val) + ret_val = mbx->ops.read(hw, msg, size, mbx_id); +out: + return ret_val; +} + +/** + * e1000_write_posted_mbx - Write a message to the mailbox, wait for ack + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer and + * received an ack to that message within delay * timeout period + **/ +s32 e1000_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_write_posted_mbx"); + + /* exit if either we can't write or there isn't a defined timeout */ + if (!mbx->ops.write || !mbx->timeout) + goto out; + + /* send msg */ + ret_val = mbx->ops.write(hw, msg, size, mbx_id); + + /* if msg sent wait until we receive an ack */ + if (!ret_val) + ret_val = e1000_poll_for_ack(hw, mbx_id); +out: + return ret_val; +} + +/** + * e1000_init_mbx_ops_generic - Initialize mbx function pointers + * @hw: pointer to the HW structure + * + * Sets the function pointers to no-op functions + **/ +void e1000_init_mbx_ops_generic(struct e1000_hw *hw) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + mbx->ops.init_params = e1000_null_ops_generic; + mbx->ops.read = e1000_null_mbx_transact; + mbx->ops.write = e1000_null_mbx_transact; + mbx->ops.check_for_msg = e1000_null_mbx_check_for_flag; + mbx->ops.check_for_ack = e1000_null_mbx_check_for_flag; + mbx->ops.check_for_rst = e1000_null_mbx_check_for_flag; + mbx->ops.read_posted = e1000_read_posted_mbx; + mbx->ops.write_posted = e1000_write_posted_mbx; +} + +/** + * e1000_read_v2p_mailbox - read v2p mailbox + * @hw: pointer to the HW structure + * + * This function is used to read the v2p mailbox without losing the read to + * clear status bits. + **/ +static u32 e1000_read_v2p_mailbox(struct e1000_hw *hw) +{ + u32 v2p_mailbox = E1000_READ_REG(hw, E1000_V2PMAILBOX(0)); + + v2p_mailbox |= hw->dev_spec.vf.v2p_mailbox; + hw->dev_spec.vf.v2p_mailbox |= v2p_mailbox & E1000_V2PMAILBOX_R2C_BITS; + + return v2p_mailbox; +} + +/** + * e1000_check_for_bit_vf - Determine if a status bit was set + * @hw: pointer to the HW structure + * @mask: bitmask for bits to be tested and cleared + * + * This function is used to check for the read to clear bits within + * the V2P mailbox. + **/ +static s32 e1000_check_for_bit_vf(struct e1000_hw *hw, u32 mask) +{ + u32 v2p_mailbox = e1000_read_v2p_mailbox(hw); + s32 ret_val = -E1000_ERR_MBX; + + if (v2p_mailbox & mask) + ret_val = E1000_SUCCESS; + + hw->dev_spec.vf.v2p_mailbox &= ~mask; + + return ret_val; +} + +/** + * e1000_check_for_msg_vf - checks to see if the PF has sent mail + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the PF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_msg_vf(struct e1000_hw *hw, u16 mbx_id) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_msg_vf"); + + if (!e1000_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFSTS)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.reqs++; + } + + return ret_val; +} + +/** + * e1000_check_for_ack_vf - checks to see if the PF has ACK'd + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns SUCCESS if the PF has set the ACK bit or else ERR_MBX + **/ +static s32 e1000_check_for_ack_vf(struct e1000_hw *hw, u16 mbx_id) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_ack_vf"); + + if (!e1000_check_for_bit_vf(hw, E1000_V2PMAILBOX_PFACK)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.acks++; + } + + return ret_val; +} + +/** + * e1000_check_for_rst_vf - checks to see if the PF has reset + * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to check + * + * returns TRUE if the PF has set the reset done bit or else FALSE + **/ +static s32 e1000_check_for_rst_vf(struct e1000_hw *hw, u16 mbx_id) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_rst_vf"); + + if (!e1000_check_for_bit_vf(hw, (E1000_V2PMAILBOX_RSTD | + E1000_V2PMAILBOX_RSTI))) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.rsts++; + } + + return ret_val; +} + +/** + * e1000_obtain_mbx_lock_vf - obtain mailbox lock + * @hw: pointer to the HW structure + * + * return SUCCESS if we obtained the mailbox lock + **/ +static s32 e1000_obtain_mbx_lock_vf(struct e1000_hw *hw) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_obtain_mbx_lock_vf"); + + /* Take ownership of the buffer */ + E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_VFU); + + /* reserve mailbox for vf use */ + if (e1000_read_v2p_mailbox(hw) & E1000_V2PMAILBOX_VFU) + ret_val = E1000_SUCCESS; + + return ret_val; +} + +/** + * e1000_write_mbx_vf - Write a message to the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to write + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val; + u16 i; + + + DEBUGFUNC("e1000_write_mbx_vf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_vf(hw); + if (ret_val) + goto out_no_write; + + /* flush msg and acks as we are overwriting the message buffer */ + e1000_check_for_msg_vf(hw, 0); + e1000_check_for_ack_vf(hw, 0); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(0), i, msg[i]); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + + /* Drop VFU and interrupt the PF to tell it a message has been sent */ + E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_REQ); + +out_no_write: + return ret_val; +} + +/** + * e1000_read_mbx_vf - Reads a message from the inbox intended for vf + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read + * + * returns SUCCESS if it successfuly read message from buffer + **/ +static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 mbx_id) +{ + s32 ret_val = E1000_SUCCESS; + u16 i; + + DEBUGFUNC("e1000_read_mbx_vf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_vf(hw); + if (ret_val) + goto out_no_read; + + /* copy the message from the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(0), i); + + /* Acknowledge receipt and release mailbox, then we're done */ + E1000_WRITE_REG(hw, E1000_V2PMAILBOX(0), E1000_V2PMAILBOX_ACK); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + +out_no_read: + return ret_val; +} + +/** + * e1000_init_mbx_params_vf - set initial values for vf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for vf mailbox + */ +s32 e1000_init_mbx_params_vf(struct e1000_hw *hw) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + + /* start mailbox as timed out and let the reset_hw call set the timeout + * value to begin communications */ + mbx->timeout = 0; + mbx->usec_delay = E1000_VF_MBX_INIT_DELAY; + + mbx->size = E1000_VFMAILBOX_SIZE; + + mbx->ops.read = e1000_read_mbx_vf; + mbx->ops.write = e1000_write_mbx_vf; + mbx->ops.read_posted = e1000_read_posted_mbx; + mbx->ops.write_posted = e1000_write_posted_mbx; + mbx->ops.check_for_msg = e1000_check_for_msg_vf; + mbx->ops.check_for_ack = e1000_check_for_ack_vf; + mbx->ops.check_for_rst = e1000_check_for_rst_vf; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; + + return E1000_SUCCESS; +} + +static s32 e1000_check_for_bit_pf(struct e1000_hw *hw, u32 mask) +{ + u32 mbvficr = E1000_READ_REG(hw, E1000_MBVFICR); + s32 ret_val = -E1000_ERR_MBX; + + if (mbvficr & mask) { + ret_val = E1000_SUCCESS; + E1000_WRITE_REG(hw, E1000_MBVFICR, mask); + } + + return ret_val; +} + +/** + * e1000_check_for_msg_pf - checks to see if the VF has sent mail + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * returns SUCCESS if the VF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_msg_pf(struct e1000_hw *hw, u16 vf_number) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_msg_pf"); + + if (!e1000_check_for_bit_pf(hw, E1000_MBVFICR_VFREQ_VF1 << vf_number)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.reqs++; + } + + return ret_val; +} + +/** + * e1000_check_for_ack_pf - checks to see if the VF has ACKed + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * returns SUCCESS if the VF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_ack_pf(struct e1000_hw *hw, u16 vf_number) +{ + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_ack_pf"); + + if (!e1000_check_for_bit_pf(hw, E1000_MBVFICR_VFACK_VF1 << vf_number)) { + ret_val = E1000_SUCCESS; + hw->mbx.stats.acks++; + } + + return ret_val; +} + +/** + * e1000_check_for_rst_pf - checks to see if the VF has reset + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * returns SUCCESS if the VF has set the Status bit or else ERR_MBX + **/ +static s32 e1000_check_for_rst_pf(struct e1000_hw *hw, u16 vf_number) +{ + u32 vflre = E1000_READ_REG(hw, E1000_VFLRE); + s32 ret_val = -E1000_ERR_MBX; + + DEBUGFUNC("e1000_check_for_rst_pf"); + + if (vflre & (1 << vf_number)) { + ret_val = E1000_SUCCESS; + E1000_WRITE_REG(hw, E1000_VFLRE, (1 << vf_number)); + hw->mbx.stats.rsts++; + } + + return ret_val; +} + +/** + * e1000_obtain_mbx_lock_pf - obtain mailbox lock + * @hw: pointer to the HW structure + * @vf_number: the VF index + * + * return SUCCESS if we obtained the mailbox lock + **/ +static s32 e1000_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number) +{ + s32 ret_val = -E1000_ERR_MBX; + u32 p2v_mailbox; + + DEBUGFUNC("e1000_obtain_mbx_lock_pf"); + + /* Take ownership of the buffer */ + E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU); + + /* reserve mailbox for vf use */ + p2v_mailbox = E1000_READ_REG(hw, E1000_P2VMAILBOX(vf_number)); + if (p2v_mailbox & E1000_P2VMAILBOX_PFU) + ret_val = E1000_SUCCESS; + + return ret_val; +} + +/** + * e1000_write_mbx_pf - Places a message in the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @vf_number: the VF index + * + * returns SUCCESS if it successfully copied message into the buffer + **/ +static s32 e1000_write_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 vf_number) +{ + s32 ret_val; + u16 i; + + DEBUGFUNC("e1000_write_mbx_pf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_pf(hw, vf_number); + if (ret_val) + goto out_no_write; + + /* flush msg and acks as we are overwriting the message buffer */ + e1000_check_for_msg_pf(hw, vf_number); + e1000_check_for_ack_pf(hw, vf_number); + + /* copy the caller specified message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + E1000_WRITE_REG_ARRAY(hw, E1000_VMBMEM(vf_number), i, msg[i]); + + /* Interrupt VF to tell it a message has been sent and release buffer*/ + E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_STS); + + /* update stats */ + hw->mbx.stats.msgs_tx++; + +out_no_write: + return ret_val; + +} + +/** + * e1000_read_mbx_pf - Read a message from the mailbox + * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @vf_number: the VF index + * + * This function copies a message from the mailbox buffer to the caller's + * memory buffer. The presumption is that the caller knows that there was + * a message due to a VF request so no polling for message is needed. + **/ +static s32 e1000_read_mbx_pf(struct e1000_hw *hw, u32 *msg, u16 size, + u16 vf_number) +{ + s32 ret_val; + u16 i; + + DEBUGFUNC("e1000_read_mbx_pf"); + + /* lock the mailbox to prevent pf/vf race condition */ + ret_val = e1000_obtain_mbx_lock_pf(hw, vf_number); + if (ret_val) + goto out_no_read; + + /* copy the message to the mailbox memory buffer */ + for (i = 0; i < size; i++) + msg[i] = E1000_READ_REG_ARRAY(hw, E1000_VMBMEM(vf_number), i); + + /* Acknowledge the message and release buffer */ + E1000_WRITE_REG(hw, E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_ACK); + + /* update stats */ + hw->mbx.stats.msgs_rx++; + +out_no_read: + return ret_val; +} + +/** + * e1000_init_mbx_params_pf - set initial values for pf mailbox + * @hw: pointer to the HW structure + * + * Initializes the hw->mbx struct to correct values for pf mailbox + */ +s32 e1000_init_mbx_params_pf(struct e1000_hw *hw) +{ + struct e1000_mbx_info *mbx = &hw->mbx; + + if (hw->mac.type == e1000_82576) { + mbx->timeout = 0; + mbx->usec_delay = 0; + + mbx->size = E1000_VFMAILBOX_SIZE; + + mbx->ops.read = e1000_read_mbx_pf; + mbx->ops.write = e1000_write_mbx_pf; + mbx->ops.read_posted = e1000_read_posted_mbx; + mbx->ops.write_posted = e1000_write_posted_mbx; + mbx->ops.check_for_msg = e1000_check_for_msg_pf; + mbx->ops.check_for_ack = e1000_check_for_ack_pf; + mbx->ops.check_for_rst = e1000_check_for_rst_pf; + + mbx->stats.msgs_tx = 0; + mbx->stats.msgs_rx = 0; + mbx->stats.reqs = 0; + mbx->stats.acks = 0; + mbx->stats.rsts = 0; + } + + return E1000_SUCCESS; +} + Added: stable/7/sys/dev/e1000/e1000_mbx.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/e1000/e1000_mbx.h Sat Nov 27 04:46:16 2010 (r215933) @@ -0,0 +1,106 @@ +/****************************************************************************** + + Copyright (c) 2001-2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#ifndef _E1000_MBX_H_ +#define _E1000_MBX_H_ + +#include "e1000_api.h" + +/* Define mailbox register bits */ +#define E1000_V2PMAILBOX_REQ 0x00000001 /* Request for PF Ready bit */ +#define E1000_V2PMAILBOX_ACK 0x00000002 /* Ack PF message received */ +#define E1000_V2PMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ +#define E1000_V2PMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ +#define E1000_V2PMAILBOX_PFSTS 0x00000010 /* PF wrote a message in the MB */ +#define E1000_V2PMAILBOX_PFACK 0x00000020 /* PF ack the previous VF msg */ +#define E1000_V2PMAILBOX_RSTI 0x00000040 /* PF has reset indication */ +#define E1000_V2PMAILBOX_RSTD 0x00000080 /* PF has indicated reset done */ +#define E1000_V2PMAILBOX_R2C_BITS 0x000000B0 /* All read to clear bits */ + +#define E1000_P2VMAILBOX_STS 0x00000001 /* Initiate message send to VF */ +#define E1000_P2VMAILBOX_ACK 0x00000002 /* Ack message recv'd from VF */ +#define E1000_P2VMAILBOX_VFU 0x00000004 /* VF owns the mailbox buffer */ +#define E1000_P2VMAILBOX_PFU 0x00000008 /* PF owns the mailbox buffer */ +#define E1000_P2VMAILBOX_RVFU 0x00000010 /* Reset VFU - used when VF stuck */ + +#define E1000_MBVFICR_VFREQ_MASK 0x000000FF /* bits for VF messages */ +#define E1000_MBVFICR_VFREQ_VF1 0x00000001 /* bit for VF 1 message */ +#define E1000_MBVFICR_VFACK_MASK 0x00FF0000 /* bits for VF acks */ +#define E1000_MBVFICR_VFACK_VF1 0x00010000 /* bit for VF 1 ack */ + +#define E1000_VFMAILBOX_SIZE 16 /* 16 32 bit words - 64 bytes */ + +/* If it's a E1000_VF_* msg then it originates in the VF and is sent to the + * PF. The reverse is TRUE if it is E1000_PF_*. + * Message ACK's are the value or'd with 0xF0000000 + */ +#define E1000_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with + * this are the ACK */ +#define E1000_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with + * this are the NACK */ +#define E1000_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still + clear to send requests */ +#define E1000_VT_MSGINFO_SHIFT 16 +/* bits 23:16 are used for exra info for certain messages */ +#define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT) + +#define E1000_VF_RESET 0x01 /* VF requests reset */ +#define E1000_VF_SET_MAC_ADDR 0x02 /* VF requests to set MAC addr */ +#define E1000_VF_SET_MULTICAST 0x03 /* VF requests to set MC addr */ +#define E1000_VF_SET_MULTICAST_COUNT_MASK (0x1F << E1000_VT_MSGINFO_SHIFT) +#define E1000_VF_SET_MULTICAST_OVERFLOW (0x80 << E1000_VT_MSGINFO_SHIFT) +#define E1000_VF_SET_VLAN 0x04 /* VF requests to set VLAN */ +#define E1000_VF_SET_VLAN_ADD (0x01 << E1000_VT_MSGINFO_SHIFT) +#define E1000_VF_SET_LPE 0x05 /* VF requests to set VMOLR.LPE */ +#define E1000_VF_SET_PROMISC 0x06 /*VF requests to clear VMOLR.ROPE/MPME*/ +#define E1000_VF_SET_PROMISC_UNICAST (0x01 << E1000_VT_MSGINFO_SHIFT) +#define E1000_VF_SET_PROMISC_MULTICAST (0x02 << E1000_VT_MSGINFO_SHIFT) + +#define E1000_PF_CONTROL_MSG 0x0100 /* PF control message */ + +#define E1000_VF_MBX_INIT_TIMEOUT 2000 /* number of retries on mailbox */ +#define E1000_VF_MBX_INIT_DELAY 500 /* microseconds between retries */ + +s32 e1000_read_mbx(struct e1000_hw *, u32 *, u16, u16); +s32 e1000_write_mbx(struct e1000_hw *, u32 *, u16, u16); +s32 e1000_read_posted_mbx(struct e1000_hw *, u32 *, u16, u16); +s32 e1000_write_posted_mbx(struct e1000_hw *, u32 *, u16, u16); +s32 e1000_check_for_msg(struct e1000_hw *, u16); +s32 e1000_check_for_ack(struct e1000_hw *, u16); +s32 e1000_check_for_rst(struct e1000_hw *, u16); +void e1000_init_mbx_ops_generic(struct e1000_hw *hw); +s32 e1000_init_mbx_params_vf(struct e1000_hw *); +s32 e1000_init_mbx_params_pf(struct e1000_hw *); + +#endif /* _E1000_MBX_H_ */ Added: stable/7/sys/dev/e1000/e1000_vf.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/e1000/e1000_vf.c Sat Nov 27 04:46:16 2010 (r215933) @@ -0,0 +1,574 @@ +/****************************************************************************** + + Copyright (c) 2001-2010, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + + +#include "e1000_api.h" + + +static s32 e1000_init_phy_params_vf(struct e1000_hw *hw); +static s32 e1000_init_nvm_params_vf(struct e1000_hw *hw); +static void e1000_release_vf(struct e1000_hw *hw); +static s32 e1000_acquire_vf(struct e1000_hw *hw); +static s32 e1000_setup_link_vf(struct e1000_hw *hw); +static s32 e1000_get_bus_info_pcie_vf(struct e1000_hw *hw); +static s32 e1000_init_mac_params_vf(struct e1000_hw *hw); +static s32 e1000_check_for_link_vf(struct e1000_hw *hw); +static s32 e1000_get_link_up_info_vf(struct e1000_hw *hw, u16 *speed, + u16 *duplex); +static s32 e1000_init_hw_vf(struct e1000_hw *hw); +static s32 e1000_reset_hw_vf(struct e1000_hw *hw); +static void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, u8 *, u32); +static void e1000_rar_set_vf(struct e1000_hw *, u8 *, u32); +static s32 e1000_read_mac_addr_vf(struct e1000_hw *); + +/** + * e1000_init_phy_params_vf - Inits PHY params + * @hw: pointer to the HW structure + * + * Doesn't do much - there's no PHY available to the VF. + **/ +static s32 e1000_init_phy_params_vf(struct e1000_hw *hw) +{ + DEBUGFUNC("e1000_init_phy_params_vf"); + hw->phy.type = e1000_phy_vf; + hw->phy.ops.acquire = e1000_acquire_vf; + hw->phy.ops.release = e1000_release_vf; + + return E1000_SUCCESS; +} + +/** + * e1000_init_nvm_params_vf - Inits NVM params + * @hw: pointer to the HW structure + * + * Doesn't do much - there's no NVM available to the VF. + **/ +static s32 e1000_init_nvm_params_vf(struct e1000_hw *hw) +{ + DEBUGFUNC("e1000_init_nvm_params_vf"); + hw->nvm.type = e1000_nvm_none; + hw->nvm.ops.acquire = e1000_acquire_vf; + hw->nvm.ops.release = e1000_release_vf; + + return E1000_SUCCESS; +} + +/** + * e1000_init_mac_params_vf - Inits MAC params + * @hw: pointer to the HW structure + **/ +static s32 e1000_init_mac_params_vf(struct e1000_hw *hw) +{ + struct e1000_mac_info *mac = &hw->mac; + + DEBUGFUNC("e1000_init_mac_params_vf"); + + /* Set media type */ + /* + * Virtual functions don't care what they're media type is as they + * have no direct access to the PHY, or the media. That is handled + * by the physical function driver. + */ + hw->phy.media_type = e1000_media_type_unknown; + + /* No ASF features for the VF driver */ + mac->asf_firmware_present = FALSE; + /* ARC subsystem not supported */ + mac->arc_subsystem_valid = FALSE; + /* Disable adaptive IFS mode so the generic funcs don't do anything */ + mac->adaptive_ifs = FALSE; + /* VF's have no MTA Registers - PF feature only */ + mac->mta_reg_count = 128; + /* VF's have no access to RAR entries */ + mac->rar_entry_count = 1; + + /* Function pointers */ + /* link setup */ + mac->ops.setup_link = e1000_setup_link_vf; + /* bus type/speed/width */ + mac->ops.get_bus_info = e1000_get_bus_info_pcie_vf; + /* reset */ + mac->ops.reset_hw = e1000_reset_hw_vf; + /* hw initialization */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 04:58:58 2010 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 7383F106566B; Sat, 27 Nov 2010 04:58:58 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 810008FC15; Sat, 27 Nov 2010 04:58:57 +0000 (UTC) Received: by wwb39 with SMTP id 39so109059wwb.31 for ; Fri, 26 Nov 2010 20:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=hsHRHtqsTejax+k8rRiewOHmuNZANDWd78VdFbZrda8=; b=GHoIJ+dBgjZ1lXMUDIqzcE+cA+bs1ozBgqHwwB4+q/dT0WcqpU1O1km+qZ9086GKMR wiTU5GflUfoAsccfa+tGTOSTZ8IwpAfQHZFMupCIfM8U4y2tMYGd2CXoKEMcWHdHzZ8P Q0D1vBVhbT/lpNCVuZrl/daQI3DZv0cVRtR3c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XlCyE7DcpGcS5cAphZCUY534LqKzRHrnlO71mBtweMZ3MQfjuZiaJ5GNT2bZiZqcYL 2eYX+JxaiUQVEFEfxH6M4vg8zpE36fuYaHJUZOaCKtQCuK+hvdg4X5TSPBhL8oti7qbz U0aPzmRryHTuUfPqjr7d4C4xWDyE3TOo0UP+c= MIME-Version: 1.0 Received: by 10.216.24.139 with SMTP id x11mr2712805wex.27.1290833325275; Fri, 26 Nov 2010 20:48:45 -0800 (PST) Received: by 10.216.2.206 with HTTP; Fri, 26 Nov 2010 20:48:45 -0800 (PST) In-Reply-To: <4CF07C7A.5090603@freebsd.org> References: <201011270109.oAR19sEu003096@svn.freebsd.org> <4CF07C7A.5090603@freebsd.org> Date: Fri, 26 Nov 2010 20:48:45 -0800 Message-ID: From: Jack Vogel To: Lawrence Stewart Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r215922 - in stable/7/sys: conf dev/e1000 modules/em modules/igb 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, 27 Nov 2010 04:58:58 -0000 Working all day on my holidays... got tired and forgot the svn add, its fixed. Jack On Fri, Nov 26, 2010 at 7:35 PM, Lawrence Stewart wrote: > Hi Jack, > > On 11/27/10 12:09, Jack F Vogel wrote: > > Author: jfv > > Date: Sat Nov 27 01:09:54 2010 > > New Revision: 215922 > > URL: http://svn.freebsd.org/changeset/base/215922 > > > > Log: > > MFC: r214646, r215781, r215789, 215808 > > Brings 7.4 e1000 drivers to the same level as 8.2 > > > > Modified: > > stable/7/sys/conf/files > > stable/7/sys/dev/e1000/e1000_82571.c > > stable/7/sys/dev/e1000/e1000_82571.h > > stable/7/sys/dev/e1000/e1000_82575.c > > stable/7/sys/dev/e1000/e1000_82575.h > > stable/7/sys/dev/e1000/e1000_api.c > > stable/7/sys/dev/e1000/e1000_api.h > > stable/7/sys/dev/e1000/e1000_defines.h > > stable/7/sys/dev/e1000/e1000_hw.h > > stable/7/sys/dev/e1000/e1000_ich8lan.c > > stable/7/sys/dev/e1000/e1000_ich8lan.h > > stable/7/sys/dev/e1000/e1000_mac.c > > stable/7/sys/dev/e1000/e1000_nvm.c > > stable/7/sys/dev/e1000/e1000_nvm.h > > stable/7/sys/dev/e1000/e1000_osdep.h > > stable/7/sys/dev/e1000/e1000_phy.c > > stable/7/sys/dev/e1000/e1000_phy.h > > stable/7/sys/dev/e1000/e1000_regs.h > > stable/7/sys/dev/e1000/if_em.c > > stable/7/sys/dev/e1000/if_em.h > > stable/7/sys/dev/e1000/if_igb.c > > stable/7/sys/dev/e1000/if_igb.h > > stable/7/sys/dev/e1000/if_lem.c > > stable/7/sys/dev/e1000/if_lem.h > > stable/7/sys/modules/em/Makefile > > stable/7/sys/modules/igb/Makefile > > Directory Properties: > > stable/7/ (props changed) > > I believe this has broken the GENERIC kernel build. Did you run a test > "make buildkernel" before committing the MFC? > > Cheers, > Lawrence > > [...] > /usr/obj/work/svn/freebsd_mirror/stable/7/make.amd64/make -V CFILES -V > SYSTEM_CFILES -V GEN_CFILES | MKDEP_CPP="cc -E" CC="cc" xargs mkdep -a > -f .newdep -O2 -frename-registers -pipe -fno-strict-aliasing -std=c99 > -g -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -nostdinc -I. > -I/work/svn/freebsd_mirror/stable/7/sys > -I/work/svn/freebsd_mirror/stable/7/sys/contrib/altq > -I/work/svn/freebsd_mirror/stable/7/sys/contrib/ipfilter > -I/work/svn/freebsd_mirror/stable/7/sys/contrib/pf > -I/work/svn/freebsd_mirror/stable/7/sys/dev/ath > -I/work/svn/freebsd_mirror/stable/7/sys/dev/ath/ath_hal > -I/work/svn/freebsd_mirror/stable/7/sys/contrib/ngatm > -I/work/svn/freebsd_mirror/stable/7/sys/dev/twa > -I/work/svn/freebsd_mirror/stable/7/sys/gnu/fs/xfs/FreeBSD > -I/work/svn/freebsd_mirror/stable/7/sys/gnu/fs/xfs/FreeBSD/support > -I/work/svn/freebsd_mirror/stable/7/sys/gnu/fs/xfs > -I/work/svn/freebsd_mirror/stable/7/sys/contrib/opensolaris/compat > -I/work/svn/freebsd_mirror/stable/7/sys/dev/cxgb -D_KERNEL > -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common > -finline-limit=8000 --param inline-unit-growth=100 --param > large-function-growth=1000 -mcmodel=kernel -mno-red-zone -mfpmath=387 > -mno-sse -mno-sse2 -mno-mmx -mno-3dnow -msoft-float > -fno-asynchronous-unwind-tables -ffreestanding > cc: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_vf.c: No such > file or directory > cc: /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_mbx.c: No such > file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/if_em.c:81: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/if_lem.c:81: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/if_igb.c:87: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_80003es2lan.c:40: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82540.c:46: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82541.c:44: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82542.c:39: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82543.c:44: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82571.c:52: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_82575.c:44: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_ich8lan.c:65: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.c:35: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_mac.c:35: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_manage.c:35: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_nvm.c:35: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_phy.c:35: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > In file included from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_api.h:38, > from > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_osdep.c:35: > /work/svn/freebsd_mirror/stable/7/sys/dev/e1000/e1000_hw.h:630:23: > error: e1000_mbx.h: No such file or directory > mkdep: compile failed > *** Error code 1 > > Stop in /usr/obj/work/svn/freebsd_mirror/stable/7/sys/GENERIC. > *** Error code 1 > > Stop in /work/svn/freebsd_mirror/stable/7. > *** Error code 1 > > Stop in /work/svn/freebsd_mirror/stable/7. > > From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 06:35:15 2010 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 C2B03106566B; Sat, 27 Nov 2010 06:35:15 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADBA08FC23; Sat, 27 Nov 2010 06:35:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oAR6ZFxc017404; Sat, 27 Nov 2010 06:35:15 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oAR6ZFV0017399; Sat, 27 Nov 2010 06:35:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201011270635.oAR6ZFV0017399@svn.freebsd.org> From: Xin LI Date: Sat, 27 Nov 2010 06:35:15 +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: r215935 - in stable/7: include lib/libc/gen 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, 27 Nov 2010 06:35:16 -0000 Author: delphij Date: Sat Nov 27 06:35:15 2010 New Revision: 215935 URL: http://svn.freebsd.org/changeset/base/215935 Log: MFC r215236: Sync with OpenBSD, primarily better signal and terminal handling. Obtained from: OpenBSD Modified: stable/7/include/readpassphrase.h stable/7/lib/libc/gen/readpassphrase.3 stable/7/lib/libc/gen/readpassphrase.c Directory Properties: stable/7/include/ (props changed) stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/include/readpassphrase.h ============================================================================== --- stable/7/include/readpassphrase.h Sat Nov 27 06:33:53 2010 (r215934) +++ stable/7/include/readpassphrase.h Sat Nov 27 06:35:15 2010 (r215935) @@ -1,31 +1,24 @@ -/* $OpenBSD: /usr/local/www/cvsroot/OpenBSD/src/include/readpassphrase.h,v 1.2 2002/02/16 21:27:17 millert Exp $ */ +/* $OpenBSD: readpassphrase.h,v 1.5 2003/06/17 21:56:23 millert Exp $ */ /* $FreeBSD$ */ /* - * Copyright (c) 2000 Todd C. Miller - * All rights reserved. + * Copyright (c) 2000, 2002 Todd C. Miller * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ #ifndef _READPASSPHRASE_H_ @@ -37,6 +30,7 @@ #define RPP_FORCELOWER 0x04 /* Force input to lower case. */ #define RPP_FORCEUPPER 0x08 /* Force input to upper case. */ #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ +#define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ #include #include Modified: stable/7/lib/libc/gen/readpassphrase.3 ============================================================================== --- stable/7/lib/libc/gen/readpassphrase.3 Sat Nov 27 06:33:53 2010 (r215934) +++ stable/7/lib/libc/gen/readpassphrase.3 Sat Nov 27 06:35:15 2010 (r215935) @@ -1,33 +1,26 @@ -.\" $OpenBSD: readpassphrase.3,v 1.7 2001/12/15 15:37:51 millert Exp $ +.\" $OpenBSD: readpassphrase.3,v 1.17 2007/05/31 19:19:28 jmc Exp $ .\" -.\" Copyright (c) 2000 Todd C. Miller -.\" All rights reserved. +.\" Copyright (c) 2000, 2002 Todd C. Miller .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, -.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" Sponsored in part by the Defense Advanced Research Projects +.\" Agency (DARPA) and Air Force Research Laboratory, Air Force +.\" Materiel Command, USAF, under agreement number F39502-99-1-0512. .\" .\" $FreeBSD$ .\" -.Dd December 7, 2001 +.Dd May 31, 2007 .Dt READPASSPHRASE 3 .Os .Sh NAME @@ -79,6 +72,8 @@ force input to lower case force input to upper case .It Dv RPP_SEVENBIT strip the high bit from input +.It Dv RPP_STDIN +force read of passphrase from stdin .El .Pp The calling process should zero the passphrase as soon as possible to @@ -87,7 +82,7 @@ space. .Sh RETURN VALUES Upon successful completion, .Fn readpassphrase -returns a pointer to the null-terminated passphrase. +returns a pointer to the NUL-terminated passphrase. If an error is encountered, the terminal state is restored and a .Dv NULL @@ -117,40 +112,6 @@ if (compare(transform(passbuf), epass) ! memset(passbuf, 0, sizeof(passbuf)); .Ed -.Sh SIGNALS -The -.Fn readpassphrase -function -will catch the following signals: -.Pp -.Bl -tag -compact -.It Dv SIGINT -.It Dv SIGHUP -.It Dv SIGQUIT -.It Dv SIGTERM -.It Dv SIGTSTP -.It Dv SIGTTIN -.It Dv SIGTTOU -.El -.Pp -When one of the above signals is intercepted, terminal echo will -be restored if it had previously been turned off. -If a signal handler was installed for the signal when -.Fn readpassphrase -was called that handler is then executed. -If no handler was previously installed for the signal then the -default action is taken as per -.Xr sigaction 2 . -.Pp -The -.Dv SIGTSTP , SIGTTIN , -and -.Dv SIGTTOU -signals (stop signal generated from keyboard or due to terminal I/O -from a background process) are treated specially. -When the process is resumed after it has been stopped, -.Fn readpassphrase -will reprint the prompt and the user may then enter a passphrase. .Sh ERRORS .Bl -tag -width Er .It Bq Er EINTR @@ -159,14 +120,14 @@ The function was interrupted by a signal. .It Bq Er EINVAL The -.Fa bufsiz +.Ar bufsiz argument was zero. .It Bq Er EIO The process is a member of a background process attempting to read from its controlling terminal, the process is ignoring or blocking the .Dv SIGTTIN -signal or the process group is orphaned. +signal, or the process group is orphaned. .It Bq Er EMFILE The process has already reached its limit for open file descriptors. .It Bq Er ENFILE @@ -176,6 +137,35 @@ There is no controlling terminal and the .Dv RPP_REQUIRE_TTY flag was specified. .El +.Sh SIGNALS +The +.Fn readpassphrase +function +will catch the following signals: +.Bd -literal -offset indent +SIGALRM SIGHUP SIGINT +SIGPIPE SIGQUIT SIGTERM +SIGTSTP SIGTTIN SIGTTOU +.Ed +.Pp +When one of the above signals is intercepted, terminal echo will +be restored if it had previously been turned off. +If a signal handler was installed for the signal when +.Fn readpassphrase +was called, that handler is then executed. +If no handler was previously installed for the signal then the +default action is taken as per +.Xr sigaction 2 . +.Pp +The +.Dv SIGTSTP , SIGTTIN +and +.Dv SIGTTOU +signals (stop signals generated from keyboard or due to terminal I/O +from a background process) are treated specially. +When the process is resumed after it has been stopped, +.Fn readpassphrase +will reprint the prompt and the user may then enter a passphrase. .Sh SEE ALSO .Xr sigaction 2 , .Xr getpass 3 Modified: stable/7/lib/libc/gen/readpassphrase.c ============================================================================== --- stable/7/lib/libc/gen/readpassphrase.c Sat Nov 27 06:33:53 2010 (r215934) +++ stable/7/lib/libc/gen/readpassphrase.c Sat Nov 27 06:35:15 2010 (r215935) @@ -1,35 +1,26 @@ -/* $OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $ */ +/* $OpenBSD: readpassphrase.c,v 1.23 2010/05/14 13:30:34 millert Exp $ */ /* - * Copyright (c) 2000 Todd C. Miller - * All rights reserved. + * Copyright (c) 2000-2002, 2007, 2010 + * Todd C. Miller * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Sponsored in part by the Defense Advanced Research Projects + * Agency (DARPA) and Air Force Research Laboratory, Air Force + * Materiel Command, USAF, under agreement number F39502-99-1-0512. */ -#if defined(LIBC_SCCS) && !defined(lint) -static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -46,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -static volatile sig_atomic_t signo; +static volatile sig_atomic_t signo[NSIG]; static void handler(int); @@ -54,11 +45,11 @@ char * readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags) { ssize_t nr; - int input, output, save_errno; + int input, output, save_errno, i, need_restart; char ch, *p, *end; struct termios term, oterm; - struct sigaction sa, saveint, savehup, savequit, saveterm; - struct sigaction savetstp, savettin, savettou; + struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm; + struct sigaction savetstp, savettin, savettou, savepipe; /* I suppose we could alloc on demand in this case (XXX). */ if (bufsiz == 0) { @@ -67,11 +58,17 @@ readpassphrase(const char *prompt, char } restart: + for (i = 0; i < NSIG; i++) + signo[i] = 0; + nr = -1; + save_errno = 0; + need_restart = 0; /* * Read and write to /dev/tty if available. If not, read from * stdin and write to stderr unless a tty is required. */ - if ((input = output = _open(_PATH_TTY, O_RDWR)) == -1) { + if ((flags & RPP_STDIN) || + (input = output = _open(_PATH_TTY, O_RDWR)) == -1) { if (flags & RPP_REQUIRE_TTY) { errno = ENOTTY; return(NULL); @@ -81,45 +78,55 @@ restart: } /* + * Turn off echo if possible. + * If we are using a tty but are not the foreground pgrp this will + * generate SIGTTOU, so do it *before* installing the signal handlers. + */ + if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) { + memcpy(&term, &oterm, sizeof(term)); + if (!(flags & RPP_ECHO_ON)) + term.c_lflag &= ~(ECHO | ECHONL); + if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) + term.c_cc[VSTATUS] = _POSIX_VDISABLE; + (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); + } else { + memset(&term, 0, sizeof(term)); + term.c_lflag |= ECHO; + memset(&oterm, 0, sizeof(oterm)); + oterm.c_lflag |= ECHO; + } + + /* * Catch signals that would otherwise cause the user to end * up with echo turned off in the shell. Don't worry about - * things like SIGALRM and SIGPIPE for now. + * things like SIGXCPU and SIGVTALRM for now. */ sigemptyset(&sa.sa_mask); sa.sa_flags = 0; /* don't restart system calls */ sa.sa_handler = handler; - (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGALRM, &sa, &savealrm); (void)_sigaction(SIGHUP, &sa, &savehup); + (void)_sigaction(SIGINT, &sa, &saveint); + (void)_sigaction(SIGPIPE, &sa, &savepipe); (void)_sigaction(SIGQUIT, &sa, &savequit); (void)_sigaction(SIGTERM, &sa, &saveterm); (void)_sigaction(SIGTSTP, &sa, &savetstp); (void)_sigaction(SIGTTIN, &sa, &savettin); (void)_sigaction(SIGTTOU, &sa, &savettou); - /* Turn off echo if possible. */ - if (tcgetattr(input, &oterm) == 0) { - memcpy(&term, &oterm, sizeof(term)); - if (!(flags & RPP_ECHO_ON)) - term.c_lflag &= ~(ECHO | ECHONL); - if (term.c_cc[VSTATUS] != _POSIX_VDISABLE) - term.c_cc[VSTATUS] = _POSIX_VDISABLE; - (void)tcsetattr(input, TCSAFLUSH|TCSASOFT, &term); - } else { - memset(&term, 0, sizeof(term)); - memset(&oterm, 0, sizeof(oterm)); - } - - (void)_write(output, prompt, strlen(prompt)); + if (!(flags & RPP_STDIN)) + (void)_write(output, prompt, strlen(prompt)); end = buf + bufsiz - 1; - for (p = buf; (nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r';) { + p = buf; + while ((nr = _read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r') { if (p < end) { if ((flags & RPP_SEVENBIT)) ch &= 0x7f; if (isalpha(ch)) { if ((flags & RPP_FORCELOWER)) - ch = tolower(ch); + ch = (char)tolower(ch); if ((flags & RPP_FORCEUPPER)) - ch = toupper(ch); + ch = (char)toupper(ch); } *p++ = ch; } @@ -130,11 +137,16 @@ restart: (void)_write(output, "\n", 1); /* Restore old terminal settings and signals. */ - if (memcmp(&term, &oterm, sizeof(term)) != 0) - (void)tcsetattr(input, TCSANOW|TCSASOFT, &oterm); - (void)_sigaction(SIGINT, &saveint, NULL); + if (memcmp(&term, &oterm, sizeof(term)) != 0) { + while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && + errno == EINTR && !signo[SIGTTOU]) + continue; + } + (void)_sigaction(SIGALRM, &savealrm, NULL); (void)_sigaction(SIGHUP, &savehup, NULL); + (void)_sigaction(SIGINT, &saveint, NULL); (void)_sigaction(SIGQUIT, &savequit, NULL); + (void)_sigaction(SIGPIPE, &savepipe, NULL); (void)_sigaction(SIGTERM, &saveterm, NULL); (void)_sigaction(SIGTSTP, &savetstp, NULL); (void)_sigaction(SIGTTIN, &savettin, NULL); @@ -146,18 +158,22 @@ restart: * If we were interrupted by a signal, resend it to ourselves * now that we have restored the signal handlers. */ - if (signo) { - kill(getpid(), signo); - switch (signo) { - case SIGTSTP: - case SIGTTIN: - case SIGTTOU: - signo = 0; - goto restart; + for (i = 0; i < NSIG; i++) { + if (signo[i]) { + kill(getpid(), i); + switch (i) { + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + need_restart = 1; + } } } + if (need_restart) + goto restart; - errno = save_errno; + if (save_errno) + errno = save_errno; return(nr == -1 ? NULL : buf); } @@ -174,5 +190,5 @@ getpass(const char *prompt) static void handler(int s) { - signo = s; + signo[s] = 1; } From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 18:18:09 2010 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 8192D106564A; Sat, 27 Nov 2010 18:18:09 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FF168FC19; Sat, 27 Nov 2010 18:18:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oARII904081789; Sat, 27 Nov 2010 18:18:09 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oARII9NX081787; Sat, 27 Nov 2010 18:18:09 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201011271818.oARII9NX081787@svn.freebsd.org> From: Jack F Vogel Date: Sat, 27 Nov 2010 18:18:09 +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: r215943 - stable/7/sys/dev/e1000 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, 27 Nov 2010 18:18:09 -0000 Author: jfv Date: Sat Nov 27 18:18:09 2010 New Revision: 215943 URL: http://svn.freebsd.org/changeset/base/215943 Log: Correct em_poll type for stable/7 Modified: stable/7/sys/dev/e1000/if_em.c Modified: stable/7/sys/dev/e1000/if_em.c ============================================================================== --- stable/7/sys/dev/e1000/if_em.c Sat Nov 27 15:41:44 2010 (r215942) +++ stable/7/sys/dev/e1000/if_em.c Sat Nov 27 18:18:09 2010 (r215943) @@ -1270,7 +1270,7 @@ em_init(void *arg) * Legacy polling routine: note this only works with single queue * *********************************************************************/ -static int +static void em_poll(struct ifnet *ifp, enum poll_cmd cmd, int count) { struct adapter *adapter = ifp->if_softc; @@ -1282,7 +1282,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd EM_CORE_LOCK(adapter); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { EM_CORE_UNLOCK(adapter); - return (0); + return; } if (cmd == POLL_AND_CHECK_STATUS) { @@ -1305,7 +1305,7 @@ em_poll(struct ifnet *ifp, enum poll_cmd em_start_locked(ifp, txr); EM_TX_UNLOCK(txr); - return (rx_done); + return; } #endif /* DEVICE_POLLING */ From owner-svn-src-stable-7@FreeBSD.ORG Sat Nov 27 21:20:51 2010 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 9E193106566C; Sat, 27 Nov 2010 21:20:51 +0000 (UTC) (envelope-from brian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C5D28FC0C; Sat, 27 Nov 2010 21:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id oARLKpE1001025; Sat, 27 Nov 2010 21:20:51 GMT (envelope-from brian@svn.freebsd.org) Received: (from brian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oARLKpfX001022; Sat, 27 Nov 2010 21:20:51 GMT (envelope-from brian@svn.freebsd.org) Message-Id: <201011272120.oARLKpfX001022@svn.freebsd.org> From: Brian Somers Date: Sat, 27 Nov 2010 21:20:51 +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: r215954 - stable/7/sys/dev/asr 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, 27 Nov 2010 21:20:51 -0000 Author: brian Date: Sat Nov 27 21:20:51 2010 New Revision: 215954 URL: http://svn.freebsd.org/changeset/base/215954 Log: MFC r21584: Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case. Modified: stable/7/sys/dev/asr/asr.c 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/asr/asr.c ============================================================================== --- stable/7/sys/dev/asr/asr.c Sat Nov 27 21:18:08 2010 (r215953) +++ stable/7/sys/dev/asr/asr.c Sat Nov 27 21:20:51 2010 (r215954) @@ -3711,9 +3711,9 @@ asr_ioctl(struct cdev *dev, u_long cmd, Info.drive1CMOS = j; Info.numDrives = *((char *)ptok(0x475)); -#endif /* ASR_IOCTL_COMPAT */ - +#else /* ASR_IOCTL_COMPAT */ bzero(&Info, sizeof(Info)); +#endif /* ASR_IOCTL_COMPAT */ Info.processorFamily = ASR_sig.dsProcessorFamily; #if defined(__i386__)