From owner-svn-src-head@FreeBSD.ORG Sun May 8 01:01:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A69AE1065670; Sun, 8 May 2011 01:01:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C7EB8FC1B; Sun, 8 May 2011 01:01:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4811Rr9022211; Sun, 8 May 2011 01:01:27 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4811RDN022207; Sun, 8 May 2011 01:01:27 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201105080101.p4811RDN022207@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 May 2011 01:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221615 - in head: etc/rc.d sys/fs/nfsserver X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 01:01:27 -0000 Author: rmacklem Date: Sun May 8 01:01:27 2011 New Revision: 221615 URL: http://svn.freebsd.org/changeset/base/221615 Log: Change the new NFS server so that it uses vfs.nfsd naming for its sysctls instead of vfs.newnfs. This separates the names from the ones used by the client. Modified: head/etc/rc.d/nfsd head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Sun May 8 00:39:49 2011 (r221614) +++ head/etc/rc.d/nfsd Sun May 8 01:01:27 2011 (r221615) @@ -33,13 +33,13 @@ nfsd_precmd() else rc_flags="${nfs_server_flags}" - # Load the modules now, so that the vfs.newnfs sysctl + # Load the modules now, so that the vfs.nfsd sysctl # oids are available. load_kld nfsd if checkyesno nfs_reserved_port_only; then echo 'NFS on reserved port only=YES' - sysctl vfs.newnfs.nfs_privport=1 > /dev/null + sysctl vfs.nfsd.nfs_privport=1 > /dev/null fi if checkyesno nfsv4_server_enable; then @@ -52,7 +52,7 @@ nfsd_precmd() fi else echo 'NFSv4 is disabled' - sysctl vfs.newnfs.server_max_nfsvers=3 > /dev/null + sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null fi fi Modified: head/sys/fs/nfsserver/nfs_nfsdkrpc.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun May 8 00:39:49 2011 (r221614) +++ head/sys/fs/nfsserver/nfs_nfsdkrpc.c Sun May 8 01:01:27 2011 (r221615) @@ -75,21 +75,21 @@ static int newnfs_nfsv3_procid[NFS_V3NPR }; -SYSCTL_DECL(_vfs_newnfs); +SYSCTL_DECL(_vfs_nfsd); SVCPOOL *nfsrvd_pool; static int nfs_privport = 0; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, nfs_privport, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, nfs_privport, CTLFLAG_RW, &nfs_privport, 0, "Only allow clients using a privileged port for NFSv2 and 3"); static int nfs_minvers = NFS_VER2; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, server_min_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_min_nfsvers, CTLFLAG_RW, &nfs_minvers, 0, "The lowest version of NFS handled by the server"); static int nfs_maxvers = NFS_VER4; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, server_max_nfsvers, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, server_max_nfsvers, CTLFLAG_RW, &nfs_maxvers, 0, "The highest version of NFS handled by the server"); static int nfs_proc(struct nfsrv_descript *, u_int32_t, struct socket *, @@ -475,7 +475,7 @@ nfsrvd_init(int terminating) NFSD_UNLOCK(); - nfsrvd_pool = svcpool_create("nfsd", SYSCTL_STATIC_CHILDREN(_vfs_newnfs)); + nfsrvd_pool = svcpool_create("nfsd", SYSCTL_STATIC_CHILDREN(_vfs_nfsd)); nfsrvd_pool->sp_rcache = NULL; nfsrvd_pool->sp_assign = NULL; nfsrvd_pool->sp_done = NULL; Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 8 00:39:49 2011 (r221614) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sun May 8 01:01:27 2011 (r221615) @@ -76,16 +76,16 @@ static int nfs_commit_miss; extern int nfsrv_issuedelegs; extern int nfsrv_dolocallocks; -SYSCTL_DECL(_vfs_newnfs); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, mirrormnt, CTLFLAG_RW, +SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "New NFS server"); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, &nfsrv_enable_crossmntpt, 0, "Enable nfsd to cross mount points"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_blks, CTLFLAG_RW, &nfs_commit_blks, 0, ""); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, issue_delegations, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_delegations, CTLFLAG_RW, &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); -SYSCTL_INT(_vfs_newnfs, OID_AUTO, enable_locallocks, CTLFLAG_RW, +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); #define NUM_HEURISTIC 1017 From owner-svn-src-head@FreeBSD.ORG Sun May 8 03:24:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 680181065673; Sun, 8 May 2011 03:24:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C2698FC0A; Sun, 8 May 2011 03:24:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p483OIKh027044; Sun, 8 May 2011 03:24:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p483OIfF027042; Sun, 8 May 2011 03:24:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105080324.p483OIfF027042@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 03:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221616 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 03:24:18 -0000 Author: adrian Date: Sun May 8 03:24:17 2011 New Revision: 221616 URL: http://svn.freebsd.org/changeset/base/221616 Log: Fiddle with the AR5416 1.0 chainmask setup. Apparently all three RX chains need to be enabled before initial calibration is done, even if only two are configured. Reorder the alt chain swap bit to match what the Atheros HAL is doing. Obtained From: ath9k, Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 01:01:27 2011 (r221615) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 03:24:17 2011 (r221616) @@ -1285,26 +1285,46 @@ ar5416SetReset(struct ath_hal *ah, int t void ar5416InitChainMasks(struct ath_hal *ah) { - if (AH5416(ah)->ah_rx_chainmask == 0x5 || - AH5416(ah)->ah_tx_chainmask == 0x5) - OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); - /* Setup Chain Masks */ - OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask); - OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + int rx_chainmask = AH5416(ah)->ah_rx_chainmask; + + if (rx_chainmask) + OS_REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); + + /* + * Workaround for OWL 1.0 calibration failure; enable multi-chain; + * then set true mask after calibration. + */ + if (IS_5416V1(ah) && (rx_chainmask == 0x5 || rx_chainmask == 0x3)) { + OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, 0x7); + OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, 0x7); + } else { + OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + } OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); + if (AH5416(ah)->ah_tx_chainmask == 0x5) + OS_REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); + if (AR_SREV_HOWL(ah)) { OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, OS_REG_READ(ah, AR_PHY_ANALOG_SWAP) | 0x00000001); } } +/* + * Work-around for Owl 1.0 calibration failure. + * + * ar5416InitChainMasks sets the RX chainmask to 0x7 if it's Owl 1.0 + * due to init calibration failures. ar5416RestoreChainMask restores + * these registers to the correct setting. + */ void ar5416RestoreChainMask(struct ath_hal *ah) { int rx_chainmask = AH5416(ah)->ah_rx_chainmask; - if ((rx_chainmask == 0x5) || (rx_chainmask == 0x3)) { + if (IS_5416V1(ah) && (rx_chainmask == 0x5 || rx_chainmask == 0x3)) { OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx_chainmask); OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx_chainmask); } From owner-svn-src-head@FreeBSD.ORG Sun May 8 05:25:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35DDC106566C; Sun, 8 May 2011 05:25:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B20B8FC12; Sun, 8 May 2011 05:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p485PgFE030654; Sun, 8 May 2011 05:25:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p485PgSL030651; Sun, 8 May 2011 05:25:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105080525.p485PgSL030651@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 05:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221617 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 05:25:43 -0000 Author: adrian Date: Sun May 8 05:25:42 2011 New Revision: 221617 URL: http://svn.freebsd.org/changeset/base/221617 Log: * Add in a comment about ar5416InitUserSettings() potentially modifying AR_DIAG_SW. There's a hardware workaround which sets disabling some errors early at startup and clears said bits before the PCU begins receiving - it does this to avoid RX descriptor status errors. It's possible these bits aren't being completely properly twiddled in all instances; but in particular if the diag_reg HAL variable is set it won't be setting these bits correctly. I'll review this at some point. * Disable multicast search on mac address and key id - the driver doesn't use it at the moment and thus adhoc may be broken for merlin and later. * Change this to be for Merlin 1.0 (which from what I understand wasn't ever publicly released) to be more correct. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 03:24:17 2011 (r221616) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 05:25:42 2011 (r221617) @@ -286,6 +286,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO ar5416InitIMR(ah, opmode); ar5212SetCoverageClass(ah, AH_PRIVATE(ah)->ah_coverageClass, 1); ar5416InitQoS(ah); + /* This may override the AR_DIAG_SW register */ ar5416InitUserSettings(ah); /* @@ -2508,8 +2509,9 @@ ar5416OverrideIni(struct ath_hal *ah, co */ OS_REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); - if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { val = OS_REG_READ(ah, AR_PCU_MISC_MODE2); + val &= (~AR_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE); if (!AR_SREV_9271(ah)) val &= ~AR_PCU_MISC_MODE2_HWWAR1; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sun May 8 03:24:17 2011 (r221616) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sun May 8 05:25:42 2011 (r221617) @@ -535,6 +535,12 @@ #define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002 #define AR_PCU_MISC_MODE2_NO_CRYPTO_FOR_NON_DATA_PKT 0x00000004 +/* + * This bit enables the Multicast search based on both MAC Address and Key ID. + * If bit is 0, then Multicast search is based on MAC address only. + * For Merlin and above only. + */ +#define AR_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE 0x00000040 #define AR_PCU_MISC_MODE2_HWWAR1 0x00100000 #define AR_PCU_MISC_MODE2_HWWAR2 0x02000000 From owner-svn-src-head@FreeBSD.ORG Sun May 8 05:45:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68EEA106564A; Sun, 8 May 2011 05:45:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DBC8B8FC0C; Sun, 8 May 2011 05:45:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p485j6oA031249; Sun, 8 May 2011 05:45:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p485j6E1031247; Sun, 8 May 2011 05:45:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105080545.p485j6E1031247@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 05:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221618 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 05:45:07 -0000 Author: adrian Date: Sun May 8 05:45:06 2011 New Revision: 221618 URL: http://svn.freebsd.org/changeset/base/221618 Log: Properly indent the WAR code i pasted in from ath9k a few months ago. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 05:25:42 2011 (r221617) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 05:45:06 2011 (r221618) @@ -2509,18 +2509,17 @@ ar5416OverrideIni(struct ath_hal *ah, co */ OS_REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); - if (AR_SREV_MERLIN_10_OR_LATER(ah)) { - val = OS_REG_READ(ah, AR_PCU_MISC_MODE2); + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + val = OS_REG_READ(ah, AR_PCU_MISC_MODE2); val &= (~AR_PCU_MISC_MODE2_ADHOC_MCAST_KEYID_ENABLE); + if (!AR_SREV_9271(ah)) + val &= ~AR_PCU_MISC_MODE2_HWWAR1; - if (!AR_SREV_9271(ah)) - val &= ~AR_PCU_MISC_MODE2_HWWAR1; + if (AR_SREV_9287_11_OR_LATER(ah)) + val = val & (~AR_PCU_MISC_MODE2_HWWAR2); - if (AR_SREV_9287_11_OR_LATER(ah)) - val = val & (~AR_PCU_MISC_MODE2_HWWAR2); - - OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val); - } + OS_REG_WRITE(ah, AR_PCU_MISC_MODE2, val); + } /* * Disable RIFS search on some chips to avoid baseband From owner-svn-src-head@FreeBSD.ORG Sun May 8 07:21:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DA7C1065670; Sun, 8 May 2011 07:21:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75A9C8FC08; Sun, 8 May 2011 07:21:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p487L9oC034117; Sun, 8 May 2011 07:21:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p487L9LG034115; Sun, 8 May 2011 07:21:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105080721.p487L9LG034115@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 07:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221620 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 07:21:09 -0000 Author: adrian Date: Sun May 8 07:21:09 2011 New Revision: 221620 URL: http://svn.freebsd.org/changeset/base/221620 Log: Fiddle with the PLL initialisation order to match ath9k/Atheros HAL. This seems to make the AR9160 behave better during heavy scanning, where before it'd hang and require a hard reset to recover. Obtained From: Linux ath9k, Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 06:25:50 2011 (r221619) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun May 8 07:21:09 2011 (r221620) @@ -521,7 +521,6 @@ ar5416InitBB(struct ath_hal *ah, const s /* Turn on PLL on 5416 */ HALDEBUG(ah, HAL_DEBUG_RESET, "%s %s channel\n", __func__, IEEE80211_IS_CHAN_5GHZ(chan) ? "5GHz" : "2GHz"); - AH5416(ah)->ah_initPLL(ah, chan); /* Activate the PHY (includes baseband activate and synthesizer on) */ OS_REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN); @@ -674,6 +673,10 @@ ar5416ChipReset(struct ath_hal *ah, cons if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; +#ifdef notyet + ahp->ah_chipFullSleep = AH_FALSE; +#endif + AH5416(ah)->ah_initPLL(ah, chan); /* @@ -682,8 +685,7 @@ ar5416ChipReset(struct ath_hal *ah, cons * with an active radio can result in corrupted shifts to the * radio device. */ - if (chan != AH_NULL) - ar5416SetRfMode(ah, chan); + ar5416SetRfMode(ah, chan); return AH_TRUE; } @@ -1103,7 +1105,11 @@ ar5416Disable(struct ath_hal *ah) { if (!ar5212SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; - return ar5416SetResetReg(ah, HAL_RESET_COLD); + if (! ar5416SetResetReg(ah, HAL_RESET_COLD)) + return AH_FALSE; + + AH5416(ah)->ah_initPLL(ah, AH_NULL); + return AH_TRUE; } /* @@ -1115,7 +1121,11 @@ ar5416Disable(struct ath_hal *ah) HAL_BOOL ar5416PhyDisable(struct ath_hal *ah) { - return ar5416SetResetReg(ah, HAL_RESET_WARM); + if (! ar5416SetResetReg(ah, HAL_RESET_WARM)) + return AH_FALSE; + + AH5416(ah)->ah_initPLL(ah, AH_NULL); + return AH_TRUE; } /* @@ -1278,8 +1288,6 @@ ar5416SetReset(struct ath_hal *ah, int t } } - AH5416(ah)->ah_initPLL(ah, AH_NULL); - return AH_TRUE; } From owner-svn-src-head@FreeBSD.ORG Sun May 8 08:18:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47815106566B; Sun, 8 May 2011 08:18:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A1F38FC14; Sun, 8 May 2011 08:18:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p488IV7A035987; Sun, 8 May 2011 08:18:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p488IVAB035985; Sun, 8 May 2011 08:18:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105080818.p488IVAB035985@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 08:18:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221622 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 08:18:31 -0000 Author: adrian Date: Sun May 8 08:18:30 2011 New Revision: 221622 URL: http://svn.freebsd.org/changeset/base/221622 Log: These EEPROM bits actually defined whether HT/20 and HT/40 support for the given channel is available. It isn't used yet; ar5416GetWirelessModes() needs to be taught about this rather than assuming HT20/HT40 is available. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Sun May 8 08:17:16 2011 (r221621) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.h Sun May 8 08:18:30 2011 (r221622) @@ -95,10 +95,10 @@ #define AR5416_OPFLAGS_11A 0x01 #define AR5416_OPFLAGS_11G 0x02 -#define AR5416_OPFLAGS_5G_HT40 0x04 -#define AR5416_OPFLAGS_2G_HT40 0x08 -#define AR5416_OPFLAGS_5G_HT20 0x10 -#define AR5416_OPFLAGS_2G_HT20 0x20 +#define AR5416_OPFLAGS_N_5G_HT40 0x04 /* If set, disable 5G HT40 */ +#define AR5416_OPFLAGS_N_2G_HT40 0x08 +#define AR5416_OPFLAGS_N_5G_HT20 0x10 +#define AR5416_OPFLAGS_N_2G_HT20 0x20 /* RF silent fields in EEPROM */ #define EEP_RFSILENT_ENABLED 0x0001 /* enabled/disabled */ From owner-svn-src-head@FreeBSD.ORG Sun May 8 08:22:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51FB2106566B; Sun, 8 May 2011 08:22:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3AD8FC16; Sun, 8 May 2011 08:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p488MC8c036154; Sun, 8 May 2011 08:22:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p488MCEV036152; Sun, 8 May 2011 08:22:12 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201105080822.p488MCEV036152@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 8 May 2011 08:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221623 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 08:22:12 -0000 Author: hselasky Date: Sun May 8 08:22:11 2011 New Revision: 221623 URL: http://svn.freebsd.org/changeset/base/221623 Log: Cleanup usb_notify_addq_compat(). It should not be needed any more. MFC after: 7 days Modified: head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun May 8 08:18:30 2011 (r221622) +++ head/sys/dev/usb/usb_device.c Sun May 8 08:22:11 2011 (r221623) @@ -2387,77 +2387,6 @@ usbd_get_device_index(struct usb_device } #if USB_HAVE_DEVCTL -/*------------------------------------------------------------------------* - * usb_notify_addq - * - * This function will generate events for dev. - *------------------------------------------------------------------------*/ -#ifndef BURN_BRIDGES -static void -usb_notify_addq_compat(const char *type, struct usb_device *udev) -{ - char *data = NULL; - const char *ntype; - struct malloc_type *mt; - const size_t buf_size = 512; - - /* Convert notify type */ - if (strcmp(type, "ATTACH") == 0) - ntype = "+"; - else if (strcmp(type, "DETACH") == 0) - ntype = "-"; - else - return; - - mtx_lock(&malloc_mtx); - mt = malloc_desc2type("bus"); /* XXX M_BUS */ - mtx_unlock(&malloc_mtx); - if (mt == NULL) - return; - - data = malloc(buf_size, mt, M_NOWAIT); - if (data == NULL) - return; - - /* String it all together. */ - snprintf(data, buf_size, - "%s" -#if USB_HAVE_UGEN - "%s " -#endif - "at port=%u " - "vendor=0x%04x " - "product=0x%04x " - "devclass=0x%02x " - "devsubclass=0x%02x " - "sernum=\"%s\" " - "release=0x%04x " -#if USB_HAVE_UGEN - "on %s\n" -#endif - "", - ntype, -#if USB_HAVE_UGEN - udev->ugen_name, -#endif - udev->port_no, - UGETW(udev->ddesc.idVendor), - UGETW(udev->ddesc.idProduct), - udev->ddesc.bDeviceClass, - udev->ddesc.bDeviceSubClass, - usb_get_serial(udev), - UGETW(udev->ddesc.bcdDevice) -#if USB_HAVE_UGEN - , udev->parent_hub != NULL ? - udev->parent_hub->ugen_name : - device_get_nameunit(device_get_parent(udev->bus->bdev)) -#endif - ); - - devctl_queue_data(data); -} -#endif - static void usb_notify_addq(const char *type, struct usb_device *udev) { @@ -2465,10 +2394,6 @@ usb_notify_addq(const char *type, struct struct sbuf *sb; int i; -#ifndef BURN_BRIDGES - usb_notify_addq_compat(type, udev); -#endif - /* announce the device */ sb = sbuf_new_auto(); sbuf_printf(sb, From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:08:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB8DA1065670; Sun, 8 May 2011 09:08:50 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 939BD8FC14; Sun, 8 May 2011 09:08:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4898owY037595; Sun, 8 May 2011 09:08:50 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4898o4S037593; Sun, 8 May 2011 09:08:50 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080908.p4898o4S037593@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221624 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:08:50 -0000 Author: pjd Date: Sun May 8 09:08:50 2011 New Revision: 221624 URL: http://svn.freebsd.org/changeset/base/221624 Log: Add magic field to the g_eli_key structure to detect if we are really operating on proper structures. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_key_cache.c Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Sun May 8 08:22:11 2011 (r221623) +++ head/sys/geom/eli/g_eli_key_cache.c Sun May 8 09:08:50 2011 (r221624) @@ -57,9 +57,13 @@ static uint64_t g_eli_key_cache_misses; SYSCTL_UQUAD(_kern_geom_eli, OID_AUTO, key_cache_misses, CTLFLAG_RW, &g_eli_key_cache_misses, 0, "Key cache misses"); +#define G_ELI_KEY_MAGIC 0xe11341c + struct g_eli_key { /* Key value, must be first in the structure. */ uint8_t gek_key[G_ELI_DATAKEYLEN]; + /* Magic. */ + int gek_magic; /* Key number. */ uint64_t gek_keyno; /* Reference counter. */ @@ -98,6 +102,7 @@ g_eli_key_fill(struct g_eli_softc *sc, s sizeof(hmacdata), key->gek_key, 0); key->gek_keyno = keyno; key->gek_count = 0; + key->gek_magic = G_ELI_KEY_MAGIC; } static struct g_eli_key * @@ -150,6 +155,7 @@ g_eli_key_replace(struct g_eli_softc *sc { mtx_assert(&sc->sc_ekeys_lock, MA_OWNED); + KASSERT(key->gek_magic == G_ELI_KEY_MAGIC, ("Invalid magic.")); RB_REMOVE(g_eli_key_tree, &sc->sc_ekeys_tree, key); TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next); @@ -167,7 +173,7 @@ g_eli_key_remove(struct g_eli_softc *sc, { mtx_assert(&sc->sc_ekeys_lock, MA_OWNED); - + KASSERT(key->gek_magic == G_ELI_KEY_MAGIC, ("Invalid magic.")); KASSERT(key->gek_count == 0, ("gek_count=%d", key->gek_count)); RB_REMOVE(g_eli_key_tree, &sc->sc_ekeys_tree, key); @@ -276,6 +282,8 @@ g_eli_key_hold(struct g_eli_softc *sc, o /* We have all the keys, so avoid some overhead. */ key = RB_FIND(g_eli_key_tree, &sc->sc_ekeys_tree, &keysearch); KASSERT(key != NULL, ("No key %ju found.", (uintmax_t)keyno)); + KASSERT(key->gek_magic == G_ELI_KEY_MAGIC, + ("Invalid key magic.")); return (key->gek_key); } @@ -306,6 +314,8 @@ g_eli_key_hold(struct g_eli_softc *sc, o key->gek_count++; mtx_unlock(&sc->sc_ekeys_lock); + KASSERT(key->gek_magic == G_ELI_KEY_MAGIC, ("Invalid key magic.")); + return (key->gek_key); } @@ -317,6 +327,8 @@ g_eli_key_drop(struct g_eli_softc *sc, u if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) != 0) return; + KASSERT(key->gek_magic == G_ELI_KEY_MAGIC, ("Invalid key magic.")); + if (sc->sc_ekeys_total == sc->sc_ekeys_allocated) return; From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:09:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFD54106566B; Sun, 8 May 2011 09:09:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2A5A8FC08; Sun, 8 May 2011 09:09:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4899nd3037662; Sun, 8 May 2011 09:09:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4899nUY037660; Sun, 8 May 2011 09:09:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080909.p4899nUY037660@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221625 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:09:50 -0000 Author: pjd Date: Sun May 8 09:09:49 2011 New Revision: 221625 URL: http://svn.freebsd.org/changeset/base/221625 Log: Drop proper key. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_integrity.c Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Sun May 8 09:08:50 2011 (r221624) +++ head/sys/geom/eli/g_eli_integrity.c Sun May 8 09:09:49 2011 (r221625) @@ -149,7 +149,7 @@ g_eli_auth_read_done(struct cryptop *crp bp->bio_error = crp->crp_etype; } sc = bp->bio_to->geom->softc; - g_eli_key_drop(sc, crp->crp_desc->crd_key); + g_eli_key_drop(sc, crp->crp_desc->crd_next->crd_key); /* * Do we have all sectors already? */ From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:11:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5325106566C; Sun, 8 May 2011 09:11:04 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7F498FC14; Sun, 8 May 2011 09:11:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489B4pR037760; Sun, 8 May 2011 09:11:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489B4jd037758; Sun, 8 May 2011 09:11:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080911.p489B4jd037758@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221626 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:11:05 -0000 Author: pjd Date: Sun May 8 09:11:04 2011 New Revision: 221626 URL: http://svn.freebsd.org/changeset/base/221626 Log: Remove prototype for a function that no longer exist. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sun May 8 09:09:49 2011 (r221625) +++ head/sys/geom/eli/g_eli.h Sun May 8 09:11:04 2011 (r221626) @@ -509,8 +509,6 @@ void g_eli_config(struct gctl_req *req, void g_eli_read_done(struct bio *bp); void g_eli_write_done(struct bio *bp); int g_eli_crypto_rerun(struct cryptop *crp); -uint8_t *g_eli_crypto_key(struct g_eli_softc *sc, off_t offset, - size_t blocksize); void g_eli_crypto_ivgen(struct g_eli_softc *sc, off_t offset, u_char *iv, size_t size); From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:11:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92184106566B; Sun, 8 May 2011 09:11:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8382C8FC08; Sun, 8 May 2011 09:11:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489Bx5U037827; Sun, 8 May 2011 09:11:59 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489BxTW037814; Sun, 8 May 2011 09:11:59 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201105080911.p489BxTW037814@svn.freebsd.org> From: Michael Tuexen Date: Sun, 8 May 2011 09:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221627 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:11:59 -0000 Author: tuexen Date: Sun May 8 09:11:59 2011 New Revision: 221627 URL: http://svn.freebsd.org/changeset/base/221627 Log: Fix a locking issue showing up on Mac OS X when subscribing to authentication events. DTLS/SCTP renegotiations trigger the bug. MFC after: 2 weeks. Modified: head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_auth.c ============================================================================== --- head/sys/netinet/sctp_auth.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_auth.c Sun May 8 09:11:59 2011 (r221627) @@ -598,7 +598,11 @@ sctp_auth_key_acquire(struct sctp_tcb *s } void -sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id) +sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t key_id, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { sctp_sharedkey_t *skey; @@ -616,7 +620,7 @@ sctp_auth_key_release(struct sctp_tcb *s if ((skey->refcount <= 1) && (skey->deactivated)) { /* notify ULP that key is no longer used */ sctp_ulp_notify(SCTP_NOTIFY_AUTH_FREE_KEY, stcb, - key_id, 0, SCTP_SO_LOCKED); + key_id, 0, so_locked); SCTPDBG(SCTP_DEBUG_AUTH2, "%s: stcb %p key %u no longer used, %d\n", __FUNCTION__, stcb, key_id, skey->refcount); Modified: head/sys/netinet/sctp_auth.h ============================================================================== --- head/sys/netinet/sctp_auth.h Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_auth.h Sun May 8 09:11:59 2011 (r221627) @@ -156,7 +156,9 @@ sctp_copy_skeylist(const struct sctp_key /* ref counts on shared keys, by key id */ extern void sctp_auth_key_acquire(struct sctp_tcb *stcb, uint16_t keyid); -extern void sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid); +extern void +sctp_auth_key_release(struct sctp_tcb *stcb, uint16_t keyid, + int so_locked); /* hmac list handling */ Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_indata.c Sun May 8 09:11:59 2011 (r221627) @@ -375,7 +375,7 @@ abandon: chk->data = NULL; } /* Now free the address and data */ - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } return; @@ -479,7 +479,7 @@ abandon: sctp_ucount_decr(asoc->cnt_on_reasm_queue); /* free up the chk */ chk->data = NULL; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (asoc->fragmented_delivery_inprogress == 0) { /* @@ -1011,7 +1011,7 @@ sctp_queue_data_for_reasm(struct sctp_tc sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } else { last_flags = at->rec.data.rcv_flags; @@ -2416,7 +2416,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i stcb->sctp_ep, stcb, NULL, SCTP_FROM_SCTP_INDATA + SCTP_LOC_18); } sctp_send_shutdown(stcb, stcb->asoc.primary_destination); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } else { int is_a_gap; @@ -2466,7 +2466,7 @@ sctp_sack_check(struct sctp_tcb *stcb, i * there are gaps or duplicates. */ (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } } else { if (!SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { @@ -3993,7 +3993,7 @@ sctp_express_handle_sack(struct sctp_tcb SCTP_LOG_FREE_SENT); } asoc->sent_queue_cnt--; - sctp_free_a_chunk(stcb, tp1); + sctp_free_a_chunk(stcb, tp1, SCTP_SO_NOT_LOCKED); } else { break; } @@ -4709,7 +4709,7 @@ sctp_handle_sack(struct mbuf *m, int off 0, SCTP_LOG_FREE_SENT); } - sctp_free_a_chunk(stcb, tp1); + sctp_free_a_chunk(stcb, tp1, SCTP_SO_NOT_LOCKED); wake_him++; } if (TAILQ_EMPTY(&asoc->sent_queue) && (asoc->total_flight > 0)) { @@ -5260,7 +5260,7 @@ sctp_flush_reassm_for_str_seq(struct sct sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } else if (SCTP_SSN_GT(chk->rec.data.stream_seq, seq)) { /* * If the stream_seq is > than the purging one, we @@ -5431,7 +5431,7 @@ sctp_handle_forward_tsn(struct sctp_tcb sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } else { /* * Ok we have gone beyond the end of the fwd-tsn's Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_input.c Sun May 8 09:11:59 2011 (r221627) @@ -193,7 +193,11 @@ outnow: */ int -sctp_is_there_unsent_data(struct sctp_tcb *stcb) +sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { int unsent_data = 0; unsigned int i; @@ -242,7 +246,7 @@ sctp_is_there_unsent_data(struct sctp_tc sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); } else { unsent_data++; break; @@ -301,7 +305,7 @@ sctp_process_init(struct sctp_init_chunk chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } } @@ -323,7 +327,7 @@ sctp_process_init(struct sctp_init_chunk sp->net = NULL; } /* Free the chunk */ - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, SCTP_SO_NOT_LOCKED); /* sa_ignore FREED_MEMORY */ } } @@ -902,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow sctp_timer_stop(SCTP_TIMER_TYPE_SHUTDOWN, stcb->sctp_ep, stcb, net, SCTP_FROM_SCTP_INPUT + SCTP_LOC_8); } /* Now is there unsent data on a stream somewhere? */ - some_on_streamwheel = sctp_is_there_unsent_data(stcb); + some_on_streamwheel = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || @@ -3127,7 +3131,7 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun chk->data = NULL; } stcb->asoc.ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); if (override == 0) { break; } @@ -3367,7 +3371,7 @@ process_chunk_drop(struct sctp_tcb *stcb case SCTP_SELECTIVE_ACK: case SCTP_NR_SELECTIVE_ACK: /* resend the sack */ - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); break; case SCTP_HEARTBEAT_REQUEST: /* resend a demand HB */ @@ -3376,7 +3380,7 @@ process_chunk_drop(struct sctp_tcb *stcb * Only retransmit if we KNOW we wont destroy the * tcb */ - (void)sctp_send_hb(stcb, 1, net); + (void)sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED); } break; case SCTP_SHUTDOWN: @@ -3547,7 +3551,7 @@ sctp_clean_up_stream_reset(struct sctp_t chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); /* sa_ignore NO_NULL_CHK */ stcb->asoc.str_reset = NULL; } @@ -3987,7 +3991,7 @@ strres_nochunk: sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return (ret_code); } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); Modified: head/sys/netinet/sctp_input.h ============================================================================== --- head/sys/netinet/sctp_input.h Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_input.h Sun May 8 09:11:59 2011 (r221627) @@ -53,7 +53,7 @@ sctp_reset_in_stream(struct sctp_tcb *st uint16_t * list); -int sctp_is_there_unsent_data(struct sctp_tcb *stcb); +int sctp_is_there_unsent_data(struct sctp_tcb *stcb, int so_locked); #endif #endif Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_output.c Sun May 8 09:11:59 2011 (r221627) @@ -6178,7 +6178,7 @@ sctp_sendall_iterator(struct sctp_inpcb /* shutdown this assoc */ int cnt; - cnt = sctp_is_there_unsent_data(stcb); + cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_NOT_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && @@ -6425,7 +6425,7 @@ sctp_toss_old_cookies(struct sctp_tcb *s chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } } @@ -6454,7 +6454,7 @@ sctp_toss_old_asconf(struct sctp_tcb *st chk->data = NULL; } asoc->ctrl_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } } @@ -6553,7 +6553,11 @@ all_done: } static void -sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc) +sctp_clean_up_ctl(struct sctp_tcb *stcb, struct sctp_association *asoc, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_tmit_chunk *chk, *nchk; @@ -6580,7 +6584,7 @@ sctp_clean_up_ctl(struct sctp_tcb *stcb, asoc->ctrl_queue_cnt--; if (chk->rec.chunk_id.id == SCTP_FORWARD_CUM_TSN) asoc->fwd_tsn_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); } else if (chk->rec.chunk_id.id == SCTP_STREAM_RESET) { /* special handling, we must look into the param */ if (chk != asoc->str_reset) { @@ -6660,7 +6664,12 @@ sctp_move_to_outqueue(struct sctp_tcb *s int *locked, int *giveup, int eeor_mode, - int *bail) + int *bail, + int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { /* Move from the stream to the send_queue keeping track of the total */ struct sctp_association *asoc; @@ -6731,7 +6740,7 @@ one_more_time: sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* we can't be locked to it */ *locked = 0; stcb->asoc.locked_on_sending = NULL; @@ -6897,7 +6906,7 @@ dont_do_it: chk->last_mbuf = NULL; if (chk->data == NULL) { sp->some_taken = some_taken; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); *bail = 1; to_move = 0; goto out_of; @@ -7001,7 +7010,7 @@ dont_do_it: atomic_add_int(&sp->length, to_move); chk->data = NULL; *bail = 1; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); to_move = 0; goto out_of; } else { @@ -7018,7 +7027,7 @@ dont_do_it: panic("prepend failes HELP?"); #else SCTP_PRINTF("prepend fails HELP?\n"); - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); #endif *bail = 1; to_move = 0; @@ -7140,7 +7149,7 @@ dont_do_it: sctp_m_freem(sp->data); sp->data = NULL; } - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* we can't be locked to it */ *locked = 0; @@ -7163,7 +7172,11 @@ out_of: static void sctp_fill_outqueue(struct sctp_tcb *stcb, - struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now) + struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_association *asoc; struct sctp_stream_out *strq, *strqn; @@ -7200,7 +7213,7 @@ sctp_fill_outqueue(struct sctp_tcb *stcb giveup = 0; bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, - &giveup, eeor_mode, &bail); + &giveup, eeor_mode, &bail, so_locked); if (moved_how_much) stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved_how_much); @@ -7440,7 +7453,7 @@ nothing_to_send: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_CWND_LOGGING_ENABLE) { sctp_log_cwnd(stcb, net, 4, SCTP_CWND_LOG_FILL_OUTQ_CALLED); } - sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now); + sctp_fill_outqueue(stcb, net, frag_point, eeor_mode, &quit_now, so_locked); if (quit_now) { /* memory alloc failure */ no_data_chunks = 1; @@ -8378,7 +8391,7 @@ no_data_fill: } else { *reason_code = 5; } - sctp_clean_up_ctl(stcb, asoc); + sctp_clean_up_ctl(stcb, asoc, so_locked); return (0); } @@ -8403,7 +8416,7 @@ sctp_queue_op_err(struct sctp_tcb *stcb, chk->copy_by_ref = 0; SCTP_BUF_PREPEND(op_err, sizeof(struct sctp_chunkhdr), M_DONTWAIT); if (op_err == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } chk->send_size = 0; @@ -8992,7 +9005,7 @@ sctp_chunk_retransmission(struct sctp_in return (0); } else { /* Clean up the fwd-tsn list */ - sctp_clean_up_ctl(stcb, asoc); + sctp_clean_up_ctl(stcb, asoc, so_locked); return (0); } } @@ -9446,7 +9459,7 @@ sctp_chunk_output(struct sctp_inpcb *inp * running, if so piggy-back the sack. */ if (SCTP_OS_TIMER_PENDING(&stcb->asoc.dack_timer.timer)) { - sctp_send_sack(stcb); + sctp_send_sack(stcb, so_locked); (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); } while (asoc->sent_queue_retran_cnt) { @@ -9730,7 +9743,7 @@ send_forward_tsn(struct sctp_tcb *stcb, chk->whoTo = NULL; chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -9875,7 +9888,11 @@ sctp_fill_in_rest: } void -sctp_send_sack(struct sctp_tcb *stcb) +sctp_send_sack(struct sctp_tcb *stcb, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { /*- * Queue up a SACK or NR-SACK in the control queue. @@ -10017,7 +10034,7 @@ sctp_send_sack(struct sctp_tcb *stcb) sctp_m_freem(a_chk->data); a_chk->data = NULL; } - sctp_free_a_chunk(stcb, a_chk); + sctp_free_a_chunk(stcb, a_chk, so_locked); /* sa_ignore NO_NULL_CHK */ if (stcb->asoc.delayed_ack) { sctp_timer_stop(SCTP_TIMER_TYPE_RECV, @@ -10691,7 +10708,11 @@ sctp_select_hb_destination(struct sctp_t } int -sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net) +sctp_send_hb(struct sctp_tcb *stcb, int user_req, struct sctp_nets *u_net, int so_locked +#if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) + SCTP_UNUSED +#endif +) { struct sctp_tmit_chunk *chk; struct sctp_nets *net; @@ -10747,7 +10768,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); return (0); } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -10836,7 +10857,7 @@ sctp_send_hb(struct sctp_tcb *stcb, int sctp_free_remote_addr(chk->whoTo); chk->whoTo = NULL; } - sctp_free_a_chunk((struct sctp_tcb *)NULL, chk); + sctp_free_a_chunk((struct sctp_tcb *)NULL, chk, so_locked); return (-1); } } @@ -10892,7 +10913,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb chk->send_size = sizeof(struct sctp_ecne_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -10955,7 +10976,7 @@ sctp_send_packet_dropped(struct sctp_tcb chk->copy_by_ref = 0; iph = mtod(m, struct ip *); if (iph == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } switch (iph->ip_v) { @@ -10995,7 +11016,7 @@ sctp_send_packet_dropped(struct sctp_tcb * INIT-ACK, because we can't know if the initiation * tag is correct or not. */ - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; default: break; @@ -11018,7 +11039,7 @@ sctp_send_packet_dropped(struct sctp_tcb chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { jump_out: - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -11129,7 +11150,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str chk->send_size = sizeof(struct sctp_cwr_chunk); chk->data = sctp_get_mbuf_for_msg(chk->send_size, 0, M_DONTWAIT, 1, MT_HEADER); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } SCTP_BUF_RESV_UF(chk->data, SCTP_MIN_OVERHEAD); @@ -11418,7 +11439,7 @@ sctp_send_str_reset_req(struct sctp_tcb chk->data = sctp_get_mbuf_for_msg(MCLBYTES, 0, M_DONTWAIT, 1, MT_DATA); if (chk->data == NULL) { - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_LOCKED); SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } @@ -12108,7 +12129,7 @@ sctp_copy_it_in(struct sctp_tcb *stcb, *error = sctp_copy_one(sp, uio, resv_in_first); skip_copy: if (*error) { - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, SCTP_SO_LOCKED); sp = NULL; } else { if (sp->sinfo_flags & SCTP_ADDR_OVER) { @@ -13206,7 +13227,7 @@ dataless_eof: SCTP_TCB_LOCK(stcb); hold_tcblock = 1; } - cnt = sctp_is_there_unsent_data(stcb); + cnt = sctp_is_there_unsent_data(stcb, SCTP_SO_LOCKED); if (TAILQ_EMPTY(&asoc->send_queue) && TAILQ_EMPTY(&asoc->sent_queue) && (cnt == 0)) { Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_output.h Sun May 8 09:11:59 2011 (r221627) @@ -152,9 +152,9 @@ sctp_send_abort_tcb(struct sctp_tcb *, s void send_forward_tsn(struct sctp_tcb *, struct sctp_association *); -void sctp_send_sack(struct sctp_tcb *); +void sctp_send_sack(struct sctp_tcb *, int); -int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *); +int sctp_send_hb(struct sctp_tcb *, int, struct sctp_nets *, int); void sctp_send_ecn_echo(struct sctp_tcb *, struct sctp_nets *, uint32_t); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_pcb.c Sun May 8 09:11:59 2011 (r221627) @@ -4988,7 +4988,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } sctp_free_spbufspace(stcb, asoc, sp); if (sp->holds_key_ref) - sctp_auth_key_release(stcb, sp->auth_keyid); + sctp_auth_key_release(stcb, sp->auth_keyid, SCTP_SO_LOCKED); /* Free the zone stuff */ SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), sp); SCTP_DECR_STRMOQ_COUNT(); @@ -5021,7 +5021,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); atomic_subtract_int(&SCTP_BASE_INFO(ipi_free_chunks), 1); @@ -5043,7 +5043,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); if (chk->whoTo) { sctp_free_remote_addr(chk->whoTo); chk->whoTo = NULL; @@ -5067,7 +5067,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, } } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5081,7 +5081,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5095,7 +5095,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -5108,7 +5108,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, chk->data = NULL; } if (chk->holds_key_ref) - sctp_auth_key_release(stcb, chk->auth_keyid); + sctp_auth_key_release(stcb, chk->auth_keyid, SCTP_SO_LOCKED); sctp_free_remote_addr(chk->whoTo); SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_chunk), chk); SCTP_DECR_CHK_COUNT(); @@ -6895,7 +6895,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, sctp_m_freem(chk->data); chk->data = NULL; } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } /* Ok that was fun, now we will drain all the inbound streams? */ @@ -6958,7 +6958,7 @@ sctp_drain_mbufs(struct sctp_inpcb *inp, asoc->last_revoke_count = cnt; (void)SCTP_OS_TIMER_STOP(&stcb->asoc.dack_timer.timer); /* sa_ignore NO_NULL_CHK */ - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_DRAIN, SCTP_SO_NOT_LOCKED); reneged_asoc_ids[reneged_at] = sctp_get_associd(stcb); reneged_at++; Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_timer.c Sun May 8 09:11:59 2011 (r221627) @@ -597,7 +597,7 @@ sctp_recover_sent_list(struct sctp_tcb * } } asoc->sent_queue_cnt--; - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); } } SCTP_PRINTF("after recover order is as follows\n"); @@ -1056,7 +1056,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * no recent feed back in an RTO or * more, request a RTT update */ - if (sctp_send_hb(stcb, 1, net) < 0) + if (sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED) < 0) /* * Less than 0 means we lost * the assoc @@ -1120,7 +1120,7 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, * but is in PF state, a PF-heartbeat needs to be sent * manually. */ - if (sctp_send_hb(stcb, 1, net) < 0) + if (sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED) < 0) /* Return less than 0 means we lost the association */ return (1); } @@ -1598,7 +1598,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * } /* Send a new HB, this will do threshold managment, pick a new dest */ if (cnt_of_unconf == 0) { - if (sctp_send_hb(stcb, 0, NULL) < 0) { + if (sctp_send_hb(stcb, 0, NULL, SCTP_SO_NOT_LOCKED) < 0) { return (1); } } else { @@ -1620,7 +1620,7 @@ sctp_heartbeat_timer(struct sctp_inpcb * net->src_addr_selected = 0; } } - ret = sctp_send_hb(stcb, 1, net); + ret = sctp_send_hb(stcb, 1, net, SCTP_SO_NOT_LOCKED); if (ret < 0) return 1; else if (ret == 0) { Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_usrreq.c Sun May 8 09:11:59 2011 (r221627) @@ -3997,7 +3997,7 @@ sctp_setopt(struct socket *so, int optna /************************NET SPECIFIC SET ******************/ if (paddrp->spp_flags & SPP_HB_DEMAND) { /* on demand HB */ - if (sctp_send_hb(stcb, 1, net) < 0) { + if (sctp_send_hb(stcb, 1, net, SCTP_SO_LOCKED) < 0) { /* asoc destroyed */ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctp_var.h Sun May 8 09:11:59 2011 (r221627) @@ -87,9 +87,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } -#define sctp_free_a_strmoq(_stcb, _strmoq) { \ +#define sctp_free_a_strmoq(_stcb, _strmoq, _so_locked) { \ if ((_strmoq)->holds_key_ref) { \ - sctp_auth_key_release(stcb, sp->auth_keyid); \ + sctp_auth_key_release(stcb, sp->auth_keyid, _so_locked); \ (_strmoq)->holds_key_ref = 0; \ } \ SCTP_ZONE_FREE(SCTP_BASE_INFO(ipi_zone_strmoq), (_strmoq)); \ @@ -105,9 +105,9 @@ extern struct pr_usrreqs sctp_usrreqs; } \ } -#define sctp_free_a_chunk(_stcb, _chk) { \ +#define sctp_free_a_chunk(_stcb, _chk, _so_locked) { \ if ((_chk)->holds_key_ref) {\ - sctp_auth_key_release((_stcb), (_chk)->auth_keyid); \ + sctp_auth_key_release((_stcb), (_chk)->auth_keyid, _so_locked); \ (_chk)->holds_key_ref = 0; \ } \ if (_stcb) { \ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 8 09:11:04 2011 (r221626) +++ head/sys/netinet/sctputil.c Sun May 8 09:11:59 2011 (r221627) @@ -1634,7 +1634,7 @@ sctp_timeout_handler(void *t) } { SCTP_STAT_INCR(sctps_timosack); stcb->asoc.timosack++; - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_NOT_LOCKED); } #ifdef SCTP_AUDITING_ENABLED sctp_auditing(4, inp, stcb, net); @@ -3656,7 +3656,7 @@ sctp_report_all_outbound(struct sctp_tcb chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); /* sa_ignore FREED_MEMORY */ } /* pending send queue SHOULD be empty */ @@ -3672,7 +3672,7 @@ sctp_report_all_outbound(struct sctp_tcb chk->data = NULL; } } - sctp_free_a_chunk(stcb, chk); + sctp_free_a_chunk(stcb, chk, so_locked); /* sa_ignore FREED_MEMORY */ } for (i = 0; i < asoc->streamoutcnt; i++) { @@ -3697,7 +3697,7 @@ sctp_report_all_outbound(struct sctp_tcb sp->net = NULL; } /* Free the chunk */ - sctp_free_a_strmoq(stcb, sp); + sctp_free_a_strmoq(stcb, sp, so_locked); /* sa_ignore FREED_MEMORY */ } } @@ -5033,7 +5033,7 @@ sctp_user_rcvd(struct sctp_tcb *stcb, ui goto out; } SCTP_STAT_INCR(sctps_wu_sacks_sent); - sctp_send_sack(stcb); + sctp_send_sack(stcb, SCTP_SO_LOCKED); sctp_chunk_output(stcb->sctp_ep, stcb, SCTP_OUTPUT_FROM_USR_RCVD, SCTP_SO_LOCKED); From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:17:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CB7106566B; Sun, 8 May 2011 09:17:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FE648FC0A; Sun, 8 May 2011 09:17:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489Hv9I038041; Sun, 8 May 2011 09:17:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489HuAH038037; Sun, 8 May 2011 09:17:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080917.p489HuAH038037@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221628 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:17:57 -0000 Author: pjd Date: Sun May 8 09:17:56 2011 New Revision: 221628 URL: http://svn.freebsd.org/changeset/base/221628 Log: When support for multiple encryption keys was committed, GELI integrity mode was not updated to pass CRD_F_KEY_EXPLICIT flag to opencrypto. This resulted in always using first key. We need to support providers created with this bug, so set special G_ELI_FLAG_FIRST_KEY flag for GELI provider in integrity mode with version smaller than 6 and pass the CRD_F_KEY_EXPLICIT flag to opencrypto only if G_ELI_FLAG_FIRST_KEY doesn't exist. Reported by: Anton Yuzhaninov MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/geom/eli/g_eli_integrity.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sun May 8 09:11:59 2011 (r221627) +++ head/sys/geom/eli/g_eli.c Sun May 8 09:17:56 2011 (r221628) @@ -329,7 +329,12 @@ g_eli_newsession(struct g_eli_worker *wr crie.cri_klen = sc->sc_ekeylen; if (sc->sc_ealgo == CRYPTO_AES_XTS) crie.cri_klen <<= 1; - crie.cri_key = sc->sc_ekey; + if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) != 0) { + crie.cri_key = g_eli_key_hold(sc, 0, + LIST_FIRST(&sc->sc_geom->consumer)->provider->sectorsize); + } else { + crie.cri_key = sc->sc_ekey; + } if (sc->sc_flags & G_ELI_FLAG_AUTH) { bzero(&cria, sizeof(cria)); cria.cri_alg = sc->sc_aalgo; @@ -368,6 +373,9 @@ g_eli_newsession(struct g_eli_worker *wr panic("%s: invalid condition", __func__); } + if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) != 0) + g_eli_key_drop(sc, crie.cri_key); + return (error); } @@ -708,6 +716,8 @@ g_eli_create(struct gctl_req *req, struc sc->sc_flags |= G_ELI_FLAG_NATIVE_BYTE_ORDER; if (md->md_version < 5) sc->sc_flags |= G_ELI_FLAG_SINGLE_KEY; + if (md->md_version < 6 && (sc->sc_flags & G_ELI_FLAG_AUTH) != 0) + sc->sc_flags |= G_ELI_FLAG_FIRST_KEY; sc->sc_ealgo = md->md_ealgo; sc->sc_nkey = nkey; Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sun May 8 09:11:59 2011 (r221627) +++ head/sys/geom/eli/g_eli.h Sun May 8 09:17:56 2011 (r221628) @@ -63,10 +63,19 @@ * 2 - Added G_ELI_FLAG_READONLY. * 3 - Added 'configure' subcommand. * 4 - IV is generated from offset converted to little-endian - * (flag G_ELI_FLAG_NATIVE_BYTE_ORDER will be set for older versions). + * (the G_ELI_FLAG_NATIVE_BYTE_ORDER flag will be set for older versions). * 5 - Added multiple encrypton keys and AES-XTS support. + * 6 - Fixed usage of multiple keys for authenticated providers (the + * G_ELI_FLAG_FIRST_KEY flag will be set for older versions). */ -#define G_ELI_VERSION 5 +#define G_ELI_VERSION_00 0 +#define G_ELI_VERSION_01 1 +#define G_ELI_VERSION_02 2 +#define G_ELI_VERSION_03 3 +#define G_ELI_VERSION_04 4 +#define G_ELI_VERSION_05 5 +#define G_ELI_VERSION_06 6 +#define G_ELI_VERSION G_ELI_VERSION_06 /* ON DISK FLAGS. */ /* Use random, onetime keys. */ @@ -92,6 +101,8 @@ #define G_ELI_FLAG_SINGLE_KEY 0x00080000 /* Device suspended. */ #define G_ELI_FLAG_SUSPEND 0x00100000 +/* Provider uses first encryption key. */ +#define G_ELI_FLAG_FIRST_KEY 0x00200000 #define G_ELI_NEW_BIO 255 Modified: head/sys/geom/eli/g_eli_integrity.c ============================================================================== --- head/sys/geom/eli/g_eli_integrity.c Sun May 8 09:11:59 2011 (r221627) +++ head/sys/geom/eli/g_eli_integrity.c Sun May 8 09:17:56 2011 (r221628) @@ -513,6 +513,8 @@ g_eli_auth_run(struct g_eli_worker *wr, crde->crd_skip = sc->sc_alen; crde->crd_len = data_secsize; crde->crd_flags = CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; + if ((sc->sc_flags & G_ELI_FLAG_FIRST_KEY) == 0) + crde->crd_flags |= CRD_F_KEY_EXPLICIT; if (bp->bio_cmd == BIO_WRITE) crde->crd_flags |= CRD_F_ENCRYPT; crde->crd_alg = sc->sc_ealgo; From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:25:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1BED106567B; Sun, 8 May 2011 09:25:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48B68FC17; Sun, 8 May 2011 09:25:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489PGGd038302; Sun, 8 May 2011 09:25:16 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489PG12038300; Sun, 8 May 2011 09:25:16 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080925.p489PG12038300@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221629 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:25:17 -0000 Author: pjd Date: Sun May 8 09:25:16 2011 New Revision: 221629 URL: http://svn.freebsd.org/changeset/base/221629 Log: Detect and handle metadata of version 6. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Sun May 8 09:17:56 2011 (r221628) +++ head/sys/geom/eli/g_eli.h Sun May 8 09:25:16 2011 (r221629) @@ -265,7 +265,7 @@ eli_metadata_decode_v0(const u_char *dat } static __inline int -eli_metadata_decode_v1v2v3v4v5(const u_char *data, struct g_eli_metadata *md) +eli_metadata_decode_v1v2v3v4v5v6(const u_char *data, struct g_eli_metadata *md) { MD5_CTX ctx; const u_char *p; @@ -296,15 +296,16 @@ eli_metadata_decode(const u_char *data, bcopy(data, md->md_magic, sizeof(md->md_magic)); md->md_version = le32dec(data + sizeof(md->md_magic)); switch (md->md_version) { - case 0: + case G_ELI_VERSION_00: error = eli_metadata_decode_v0(data, md); break; - case 1: - case 2: - case 3: - case 4: - case 5: - error = eli_metadata_decode_v1v2v3v4v5(data, md); + case G_ELI_VERSION_01: + case G_ELI_VERSION_02: + case G_ELI_VERSION_03: + case G_ELI_VERSION_04: + case G_ELI_VERSION_05: + case G_ELI_VERSION_06: + error = eli_metadata_decode_v1v2v3v4v5v6(data, md); break; default: error = EINVAL; From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:25:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7669A1065678; Sun, 8 May 2011 09:25:54 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 696AB8FC25; Sun, 8 May 2011 09:25:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489PsPs038355; Sun, 8 May 2011 09:25:54 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489PsFt038353; Sun, 8 May 2011 09:25:54 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080925.p489PsFt038353@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221630 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:25:54 -0000 Author: pjd Date: Sun May 8 09:25:54 2011 New Revision: 221630 URL: http://svn.freebsd.org/changeset/base/221630 Log: Version 6 is compatible with version 5 when it comes to control commands. MFC after: 1 week Modified: head/sys/geom/eli/g_eli_ctl.c Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Sun May 8 09:25:16 2011 (r221629) +++ head/sys/geom/eli/g_eli_ctl.c Sun May 8 09:25:54 2011 (r221630) @@ -1014,7 +1014,12 @@ g_eli_config(struct gctl_req *req, struc gctl_error(req, "No '%s' argument.", "version"); return; } - if (*version != G_ELI_VERSION) { + while (*version != G_ELI_VERSION) { + if (G_ELI_VERSION == G_ELI_VERSION_06 && + *version == G_ELI_VERSION_05) { + /* Compatible. */ + break; + } gctl_error(req, "Userland and kernel parts are out of sync."); return; } From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:29:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21F02106564A; Sun, 8 May 2011 09:29:22 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14D248FC13; Sun, 8 May 2011 09:29:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489TLkm038488; Sun, 8 May 2011 09:29:21 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489TLMK038486; Sun, 8 May 2011 09:29:21 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080929.p489TLMK038486@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221631 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:29:22 -0000 Author: pjd Date: Sun May 8 09:29:21 2011 New Revision: 221631 URL: http://svn.freebsd.org/changeset/base/221631 Log: Export GELI class version via sysctl kern.geom.eli.version. MFC after: 1 week Modified: head/sys/geom/eli/g_eli.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sun May 8 09:25:54 2011 (r221630) +++ head/sys/geom/eli/g_eli.c Sun May 8 09:29:21 2011 (r221631) @@ -57,6 +57,9 @@ MALLOC_DEFINE(M_ELI, "eli data", "GEOM_E SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, eli, CTLFLAG_RW, 0, "GEOM_ELI stuff"); +static int g_eli_version = G_ELI_VERSION; +SYSCTL_INT(_kern_geom_eli, OID_AUTO, version, CTLFLAG_RD, &g_eli_version, 0, + "GELI version"); int g_eli_debug = 0; TUNABLE_INT("kern.geom.eli.debug", &g_eli_debug); SYSCTL_INT(_kern_geom_eli, OID_AUTO, debug, CTLFLAG_RW, &g_eli_debug, 0, From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:31:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAA271065672; Sun, 8 May 2011 09:31:17 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD70D8FC15; Sun, 8 May 2011 09:31:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489VHBL038584; Sun, 8 May 2011 09:31:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489VHFS038582; Sun, 8 May 2011 09:31:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201105080931.p489VHFS038582@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 8 May 2011 09:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221632 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:31:18 -0000 Author: trociny Date: Sun May 8 09:31:17 2011 New Revision: 221632 URL: http://svn.freebsd.org/changeset/base/221632 Log: Fix isitme(), which is used to check if node-specific configuration belongs to our node, and was returning false positive if the first part of a node name matches short hostname. Approved by: pjd (mentor) Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun May 8 09:29:21 2011 (r221631) +++ head/sbin/hastd/parse.y Sun May 8 09:31:17 2011 (r221632) @@ -92,8 +92,10 @@ isitme(const char *name) * Now check if it matches first part of the host name. */ pos = strchr(buf, '.'); - if (pos != NULL && pos != buf && strncmp(buf, name, pos - buf) == 0) + if (pos != NULL && (size_t)(pos - buf) == strlen(name) && + strncmp(buf, name, pos - buf) == 0) { return (1); + } /* * At the end check if name is equal to our host's UUID. From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:46:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F4EA106566B; Sun, 8 May 2011 09:46:10 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2797A8FC08; Sun, 8 May 2011 09:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p489kAgr039068; Sun, 8 May 2011 09:46:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p489kAHs039066; Sun, 8 May 2011 09:46:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105080946.p489kAHs039066@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 09:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221633 - head/sbin/geom/class/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:46:10 -0000 Author: pjd Date: Sun May 8 09:46:09 2011 New Revision: 221633 URL: http://svn.freebsd.org/changeset/base/221633 Log: Document the following sysctls: kern.geom.eli.version kern.geom.eli.key_cache_limit kern.geom.eli.key_cache_hits kern.geom.eli.key_cache_misses MFC after: 1 week Modified: head/sbin/geom/class/eli/geli.8 Modified: head/sbin/geom/class/eli/geli.8 ============================================================================== --- head/sbin/geom/class/eli/geli.8 Sun May 8 09:31:17 2011 (r221632) +++ head/sbin/geom/class/eli/geli.8 Sun May 8 09:46:09 2011 (r221633) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2005-2010 Pawel Jakub Dawidek +.\" Copyright (c) 2005-2011 Pawel Jakub Dawidek .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -627,9 +627,13 @@ variables can be used to control the beh .Nm ELI GEOM class. The default value is shown next to each variable. -All variables can also be set in +Some variables can also be set in .Pa /boot/loader.conf . .Bl -tag -width indent +.It Va kern.geom.eli.version +Version number of the +.Nm ELI +GEOM class. .It Va kern.geom.eli.debug : No 0 Debug level of the .Nm ELI @@ -668,6 +672,22 @@ When set to 1, can speed-up crypto opera Batching allows to reduce number of interrupts by responding on a group of crypto requests with one interrupt. The crypto card and the driver has to support this feature. +.It Va kern.geom.eli.key_cache_limit : No 8192 +Specifies how many encryption keys to cache. +The default limit +.No ( 8192 +keys) will allow to cache all keys for 4TB provider with 512 bytes sectors and +will take around 1MB of memory. +.It Va kern.geom.eli.key_cache_hits +Reports how many times we were looking up a key and it was already in cache. +This sysctl is not updated for providers that need less keys than the limit +specified in +.Va kern.geom.eli.key_cache_limit . +.It Va kern.geom.eli.key_cache_misses +Reports how many times we were looking up a key and it was not in cache. +This sysctl is not updated for providers that need less keys than the limit +specified in +.Va kern.geom.eli.key_cache_limit . .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. From owner-svn-src-head@FreeBSD.ORG Sun May 8 09:50:17 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFABF106566B; Sun, 8 May 2011 09:50:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 79BBE8FC08; Sun, 8 May 2011 09:50:17 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p489o442008739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2011 19:50:06 +1000 Date: Sun, 8 May 2011 19:50:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper In-Reply-To: Message-ID: <20110508194150.R981@besplex.bde.org> References: <201105071628.p47GSO16006145@svn.freebsd.org> <201105071836.00660.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1604857336-1304848204=:981" Cc: "svn-src-head@freebsd.org" , mdf@FreeBSD.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r221604 - head/usr.sbin/usbdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 09:50:18 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1604857336-1304848204=:981 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 7 May 2011, Garrett Cooper wrote: > On Sat, May 7, 2011 at 10:13 AM, wrote: >> On Sat, May 7, 2011 at 9:36 AM, Hans Petter Selasky w= rote: >>> On Saturday 07 May 2011 18:28:24 Hans Petter Selasky wrote: >>>> =A0 - Use memcpy() instead of bcopy(). >>> >>> - Use memset() instead of bzero(). >> >> Why? =A0It usually falls through to the same code in libc. =A0Is there >> some standardization on memfoo versus bfoo here? As part of adding lots of style bugs I suppose. > bfoo is marked legacy per POSIX 2001.1; example: > http://pubs.opengroup.org/onlinepubs/009695399/functions/bcopy.html . bfoo was correctly left out of POSIX.1-1988. However, POSIX.1-2001 brought back lots of historical cruft 13 years after POSIX.1-1988 deprecated it by not having it at all. However2, the bcopy family is not historical cruft in BSD. > A lot of folks (Linux leading the charge) are actively working to > deprecate the APIs. Another reason to not deprecate it in BSD :-). bzero() is technically better than memset() since it doesn't waste space or time for an extra arg. bcmp() is technically better than memcmp() for the usual case where you only want a binary result. The other bcopy functions are just different spellings of the newer interfaces. Bruce --0-1604857336-1304848204=:981-- From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:14:36 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A675106566B; Sun, 8 May 2011 10:14:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id E9C758FC13; Sun, 8 May 2011 10:14:35 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p48AEQoA032357 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2011 20:14:26 +1000 Date: Sun, 8 May 2011 20:14:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky In-Reply-To: <201105071955.35305.hselasky@c2i.net> Message-ID: <20110508195020.V981@besplex.bde.org> References: <201105071628.p47GSO16006145@svn.freebsd.org> <201105071836.00660.hselasky@c2i.net> <201105071955.35305.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "svn-src-head@freebsd.org" , mdf@FreeBSD.org, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r221604 - head/usr.sbin/usbdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:14:36 -0000 On Sat, 7 May 2011, Hans Petter Selasky wrote: > On Saturday 07 May 2011 19:13:27 mdf@freebsd.org wrote: >> On Sat, May 7, 2011 at 9:36 AM, Hans Petter Selasky > wrote: >>> On Saturday 07 May 2011 18:28:24 Hans Petter Selasky wrote: >>>> - Use memcpy() instead of bcopy(). >>> >>> - Use memset() instead of bzero(). >> >> Why? It usually falls through to the same code in libc. Is there >> some standardization on memfoo versus bfoo here? > > I thought that memset() was a compiler builtin and bzero() optimised for > larger amounts of data? In the kernel, compiler builtins aren't used, memset() is slightly pessimized, and bzero() is not optimized (except in old versions of FreeBSD on i386, attempts were made to optimize bzero() for large data at a tiny cost to small data). A better implementation would use the compiler builtin for both. My version does this, but the gains (or losses) from using builtins for this and other things in the kernel insignificant. Here it is for bzero(): #define bzero(p, n) ({ \ if (__builtin_constant_p(n) && (n) <= 32) \ __builtin_memset((p), 0, (n)); \ else \ (bzero)((p), (n)); \ }) This hard-codes the limit of 32 for the builtin since some versions of gcc use a worse limit. In userland, on at least amd64 and i386, the extern bzero() and memset() are unoptimized, but the compiler builtin is used for memset() only. A better implementation of bzero() would use the compiler builtin for it too. The above is not good enough for libc, since it evaluates args more than once and has a hard-coded gccism. The correct optimizations for bzero() etc. are very machine-dependent and context-dependent and are far too hard for anyone or the compiler or the CPU to get right (but I believe newer Intel CPUs are closer to making unoptimized stosb as fast as possible). Context-dependent parts include whether the data should go through cache(s) (it shouldn't iff it won't be used soon and the memory system is such that not going through caches is either faster or saves time later). Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:19:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46EA8106564A; Sun, 8 May 2011 10:19:30 +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 395E68FC08; Sun, 8 May 2011 10:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48AJUdY040119; Sun, 8 May 2011 10:19:30 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48AJUpL040117; Sun, 8 May 2011 10:19:30 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081019.p48AJUpL040117@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 10:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221634 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:19:30 -0000 Author: bschmidt Date: Sun May 8 10:19:29 2011 New Revision: 221634 URL: http://svn.freebsd.org/changeset/base/221634 Log: Re-add 2 device IDs which got lost. Pointed out by: benjsc Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 09:46:09 2011 (r221633) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 10:19:29 2011 (r221634) @@ -92,8 +92,10 @@ static const struct iwn_ident iwn_ident_ { 0x8086, 0x4229, "Intel(R) Wireless WiFi Link 4965" }, { 0x8086, 0x422b, "Intel(R) Centrino(R) Ultimate-N 6300" }, { 0x8086, 0x422c, "Intel(R) Centrino(R) Advanced-N 6200" }, + { 0x8086, 0x422d, "Intel(R) Wireless WiFi Link 4965" }, { 0x8086, 0x4230, "Intel(R) Wireless WiFi Link 4965" }, { 0x8086, 0x4232, "Intel(R) WiFi Link 5100" }, + { 0x8086, 0x4233, "Intel(R) Wireless WiFi Link 4965" }, { 0x8086, 0x4235, "Intel(R) Ultimate N WiFi Link 5300" }, { 0x8086, 0x4236, "Intel(R) Ultimate N WiFi Link 5300" }, { 0x8086, 0x4237, "Intel(R) WiFi Link 5100" }, From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:21:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75E25106566C; Sun, 8 May 2011 10:21:42 +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 686948FC13; Sun, 8 May 2011 10:21:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48ALgfE040239; Sun, 8 May 2011 10:21:42 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48ALgnD040236; Sun, 8 May 2011 10:21:42 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081021.p48ALgnD040236@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 10:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221635 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:21:42 -0000 Author: bschmidt Date: Sun May 8 10:21:42 2011 New Revision: 221635 URL: http://svn.freebsd.org/changeset/base/221635 Log: The 6000 series adapters have a slightly different offset for band 6, 2GHz HT40 channels. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 10:19:29 2011 (r221634) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 10:21:42 2011 (r221635) @@ -1784,7 +1784,10 @@ iwn5000_read_eeprom(struct iwn_softc *sc /* Read the list of authorized channels (20MHz ones only). */ for (i = 0; i < 5; i++) { - addr = base + iwn5000_regulatory_bands[i]; + if (sc->hw_type >= IWN_HW_REV_TYPE_6000) + addr = base + iwn6000_regulatory_bands[i]; + else + addr = base + iwn5000_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); } Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun May 8 10:19:29 2011 (r221634) +++ head/sys/dev/iwn/if_iwnreg.h Sun May 8 10:21:42 2011 (r221635) @@ -1403,6 +1403,7 @@ struct iwn_fw_tlv { #define IWN5000_EEPROM_BAND4 0x02e #define IWN5000_EEPROM_BAND5 0x03a #define IWN5000_EEPROM_BAND6 0x041 +#define IWN6000_EEPROM_BAND6 0x040 #define IWN5000_EEPROM_BAND7 0x049 #define IWN6000_EEPROM_ENHINFO 0x054 #define IWN5000_EEPROM_CRYSTAL 0x128 @@ -1486,6 +1487,16 @@ static const uint32_t iwn5000_regulatory IWN5000_EEPROM_BAND7 }; +static const uint32_t iwn6000_regulatory_bands[IWN_NBANDS] = { + IWN5000_EEPROM_BAND1, + IWN5000_EEPROM_BAND2, + IWN5000_EEPROM_BAND3, + IWN5000_EEPROM_BAND4, + IWN5000_EEPROM_BAND5, + IWN6000_EEPROM_BAND6, + IWN5000_EEPROM_BAND7 +}; + #define IWN_CHAN_BANDS_COUNT 7 #define IWN_MAX_CHAN_PER_BAND 14 static const struct iwn_chan_band { From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:31:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2400F106564A; Sun, 8 May 2011 10:31:23 +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 161BE8FC12; Sun, 8 May 2011 10:31:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48AVMRJ041623; Sun, 8 May 2011 10:31:22 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48AVMO7041621; Sun, 8 May 2011 10:31:22 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081031.p48AVMO7041621@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 10:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221636 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:31:23 -0000 Author: bschmidt Date: Sun May 8 10:31:22 2011 New Revision: 221636 URL: http://svn.freebsd.org/changeset/base/221636 Log: Hook HT channel setup. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 10:21:42 2011 (r221635) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 10:31:22 2011 (r221636) @@ -154,9 +154,7 @@ static void iwn4965_print_power_group(st static void iwn5000_read_eeprom(struct iwn_softc *); static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *); static void iwn_read_eeprom_band(struct iwn_softc *, int); -#if 0 /* HT */ static void iwn_read_eeprom_ht40(struct iwn_softc *, int); -#endif static void iwn_read_eeprom_channels(struct iwn_softc *, int, uint32_t); static struct iwn_eeprom_chan *iwn_find_eeprom_channel(struct iwn_softc *, struct ieee80211_channel *); @@ -1696,7 +1694,7 @@ iwn4965_read_eeprom(struct iwn_softc *sc iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4); /* Read the list of authorized channels (20MHz ones only). */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 7; i++) { addr = iwn4965_regulatory_bands[i]; iwn_read_eeprom_channels(sc, i, addr); } @@ -1783,7 +1781,7 @@ iwn5000_read_eeprom(struct iwn_softc *sc sc->eeprom_domain, 4); /* Read the list of authorized channels (20MHz ones only). */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 7; i++) { if (sc->hw_type >= IWN_HW_REV_TYPE_6000) addr = base + iwn6000_regulatory_bands[i]; else @@ -1889,18 +1887,15 @@ iwn_read_eeprom_band(struct iwn_softc *s "add chan %d flags 0x%x maxpwr %d\n", chan, channels[i].flags, channels[i].maxpwr); -#if 0 /* HT */ - /* XXX no constraints on using HT20 */ - /* add HT20, HT40 added separately */ - c = &ic->ic_channels[ic->ic_nchans++]; - c[0] = c[-1]; - c->ic_flags |= IEEE80211_CHAN_HT20; - /* XXX NARROW =>'s 1/2 and 1/4 width? */ -#endif + if (sc->sc_flags & IWN_FLAG_HAS_11N) { + /* add HT20, HT40 added separately */ + c = &ic->ic_channels[ic->ic_nchans++]; + c[0] = c[-1]; + c->ic_flags |= IEEE80211_CHAN_HT20; + } } } -#if 0 /* HT */ static void iwn_read_eeprom_ht40(struct iwn_softc *sc, int n) { @@ -1909,55 +1904,59 @@ iwn_read_eeprom_ht40(struct iwn_softc *s struct iwn_eeprom_chan *channels = sc->eeprom_channels[n]; const struct iwn_chan_band *band = &iwn_bands[n]; struct ieee80211_channel *c, *cent, *extc; - int i; + uint8_t chan; + int i, nflags; + + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) + return; for (i = 0; i < band->nchan; i++) { - if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID) || - !(channels[i].flags & IWN_EEPROM_CHAN_WIDE)) { + if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) { DPRINTF(sc, IWN_DEBUG_RESET, "skip chan %d flags 0x%x maxpwr %d\n", band->chan[i], channels[i].flags, channels[i].maxpwr); continue; } + chan = band->chan[i]; + nflags = iwn_eeprom_channel_flags(&channels[i]); + /* * Each entry defines an HT40 channel pair; find the * center channel, then the extension channel above. */ - cent = ieee80211_find_channel_byieee(ic, band->chan[i], - band->flags & ~IEEE80211_CHAN_HT); + cent = ieee80211_find_channel_byieee(ic, chan, + (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); if (cent == NULL) { /* XXX shouldn't happen */ device_printf(sc->sc_dev, - "%s: no entry for channel %d\n", - __func__, band->chan[i]); + "%s: no entry for channel %d\n", __func__, chan); continue; } extc = ieee80211_find_channel(ic, cent->ic_freq+20, - band->flags & ~IEEE80211_CHAN_HT); + (n == 5 ? IEEE80211_CHAN_G : IEEE80211_CHAN_A)); if (extc == NULL) { DPRINTF(sc, IWN_DEBUG_RESET, - "skip chan %d, extension channel not found\n", - band->chan[i]); + "%s: skip chan %d, extension channel not found\n", + __func__, chan); continue; } DPRINTF(sc, IWN_DEBUG_RESET, "add ht40 chan %d flags 0x%x maxpwr %d\n", - band->chan[i], channels[i].flags, channels[i].maxpwr); + chan, channels[i].flags, channels[i].maxpwr); c = &ic->ic_channels[ic->ic_nchans++]; c[0] = cent[0]; c->ic_extieee = extc->ic_ieee; c->ic_flags &= ~IEEE80211_CHAN_HT; - c->ic_flags |= IEEE80211_CHAN_HT40U; + c->ic_flags |= IEEE80211_CHAN_HT40U | nflags; c = &ic->ic_channels[ic->ic_nchans++]; c[0] = extc[0]; c->ic_extieee = cent->ic_ieee; c->ic_flags &= ~IEEE80211_CHAN_HT; - c->ic_flags |= IEEE80211_CHAN_HT40D; + c->ic_flags |= IEEE80211_CHAN_HT40D | nflags; } } -#endif static void iwn_read_eeprom_channels(struct iwn_softc *sc, int n, uint32_t addr) @@ -1970,25 +1969,34 @@ iwn_read_eeprom_channels(struct iwn_soft if (n < 5) iwn_read_eeprom_band(sc, n); -#if 0 /* HT */ else iwn_read_eeprom_ht40(sc, n); -#endif ieee80211_sort_channels(ic->ic_channels, ic->ic_nchans); } static struct iwn_eeprom_chan * iwn_find_eeprom_channel(struct iwn_softc *sc, struct ieee80211_channel *c) { - int i, j; + int band, chan, i, j; - for (j = 0; j < 7; j++) { - for (i = 0; i < iwn_bands[j].nchan; i++) { - if (iwn_bands[j].chan[i] == c->ic_ieee) - return &sc->eeprom_channels[j][i]; + if (IEEE80211_IS_CHAN_HT40(c)) { + band = IEEE80211_IS_CHAN_5GHZ(c) ? 6 : 5; + if (IEEE80211_IS_CHAN_HT40D(c)) + chan = c->ic_extieee; + else + chan = c->ic_ieee; + for (i = 0; i < iwn_bands[band].nchan; i++) { + if (iwn_bands[band].chan[i] == chan) + return &sc->eeprom_channels[band][i]; + } + } else { + for (j = 0; j < 5; j++) { + for (i = 0; i < iwn_bands[j].nchan; i++) { + if (iwn_bands[j].chan[i] == c->ic_ieee) + return &sc->eeprom_channels[j][i]; + } } } - return NULL; } From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:35:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EED3E106566C; Sun, 8 May 2011 10:35:16 +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 E14428FC15; Sun, 8 May 2011 10:35:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48AZGsr041779; Sun, 8 May 2011 10:35:16 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48AZGMn041775; Sun, 8 May 2011 10:35:16 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081035.p48AZGMn041775@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 10:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221637 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:35:17 -0000 Author: bschmidt Date: Sun May 8 10:35:16 2011 New Revision: 221637 URL: http://svn.freebsd.org/changeset/base/221637 Log: Use the enhanced TX power information availabe on newer EEPROMs. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 10:31:22 2011 (r221636) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 10:35:16 2011 (r221637) @@ -2033,18 +2033,22 @@ static void iwn_read_eeprom_enhinfo(struct iwn_softc *sc) { struct iwn_eeprom_enhinfo enhinfo[35]; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_channel *c; uint16_t val, base; int8_t maxpwr; - int i; + uint8_t flags; + int i, j; iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2); base = le16toh(val); iwn_read_prom_data(sc, base + IWN6000_EEPROM_ENHINFO, enhinfo, sizeof enhinfo); - memset(sc->enh_maxpwr, 0, sizeof sc->enh_maxpwr); for (i = 0; i < nitems(enhinfo); i++) { - if (enhinfo[i].chan == 0 || enhinfo[i].reserved != 0) + flags = enhinfo[i].flags; + if (!(flags & IWN_ENHINFO_VALID)) continue; /* Skip invalid entries. */ maxpwr = 0; @@ -2058,11 +2062,34 @@ iwn_read_eeprom_enhinfo(struct iwn_softc maxpwr = MAX(maxpwr, enhinfo[i].mimo2); else if (sc->ntxchains == 3) maxpwr = MAX(maxpwr, enhinfo[i].mimo3); - maxpwr /= 2; /* Convert half-dBm to dBm. */ - DPRINTF(sc, IWN_DEBUG_RESET, "enhinfo %d, maxpwr=%d\n", i, - maxpwr); - sc->enh_maxpwr[i] = maxpwr; + for (j = 0; j < ic->ic_nchans; j++) { + c = &ic->ic_channels[j]; + if ((flags & IWN_ENHINFO_5GHZ)) { + if (!IEEE80211_IS_CHAN_A(c)) + continue; + } else if ((flags & IWN_ENHINFO_OFDM)) { + if (!IEEE80211_IS_CHAN_G(c)) + continue; + } else if (!IEEE80211_IS_CHAN_B(c)) + continue; + if ((flags & IWN_ENHINFO_HT40)) { + if (!IEEE80211_IS_CHAN_HT40(c)) + continue; + } else { + if (IEEE80211_IS_CHAN_HT40(c)) + continue; + } + if (enhinfo[i].chan != 0 && + enhinfo[i].chan != c->ic_ieee) + continue; + + DPRINTF(sc, IWN_DEBUG_RESET, + "channel %d(%x), maxpwr %d\n", c->ic_ieee, + c->ic_flags, maxpwr / 2); + c->ic_maxregpower = maxpwr / 2; + c->ic_maxpower = maxpwr; + } } } Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun May 8 10:31:22 2011 (r221636) +++ head/sys/dev/iwn/if_iwnreg.h Sun May 8 10:35:16 2011 (r221637) @@ -1433,7 +1433,17 @@ struct iwn_eeprom_chan { } __packed; struct iwn_eeprom_enhinfo { - uint16_t chan; + uint8_t flags; +#define IWN_ENHINFO_VALID 0x01 +#define IWN_ENHINFO_5GHZ 0x02 +#define IWN_ENHINFO_OFDM 0x04 +#define IWN_ENHINFO_HT40 0x08 +#define IWN_ENHINFO_HTAP 0x10 +#define IWN_ENHINFO_RES1 0x20 +#define IWN_ENHINFO_RES2 0x40 +#define IWN_ENHINFO_COMMON 0x80 + + uint8_t chan; int8_t chain[3]; /* max power in half-dBm */ uint8_t reserved; int8_t mimo2; /* max power in half-dBm */ Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun May 8 10:31:22 2011 (r221636) +++ head/sys/dev/iwn/if_iwnvar.h Sun May 8 10:35:16 2011 (r221637) @@ -295,7 +295,6 @@ struct iwn_softc { int8_t maxpwr2GHz; int8_t maxpwr5GHz; int8_t maxpwr[IEEE80211_CHAN_MAX]; - int8_t enh_maxpwr[35]; int32_t temp_off; uint32_t int_mask; From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:54:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96749106566B; Sun, 8 May 2011 10:54:50 +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 88FE48FC16; Sun, 8 May 2011 10:54:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48AsoGU042419; Sun, 8 May 2011 10:54:50 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48Aso1H042417; Sun, 8 May 2011 10:54:50 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081054.p48Aso1H042417@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 10:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221638 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:54:50 -0000 Author: bschmidt Date: Sun May 8 10:54:50 2011 New Revision: 221638 URL: http://svn.freebsd.org/changeset/base/221638 Log: Allocate all TX rings, those will be use for TX packet aggregation. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 10:35:16 2011 (r221637) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 10:54:50 2011 (r221638) @@ -1489,13 +1489,6 @@ iwn_alloc_tx_ring(struct iwn_softc *sc, __func__, error); goto fail; } - /* - * We only use rings 0 through 4 (4 EDCA + cmd) so there is no need - * to allocate commands space for other rings. - * XXX Do we really need to allocate descriptors for other rings? - */ - if (qid > 4) - return 0; size = IWN_TX_RING_COUNT * sizeof (struct iwn_tx_cmd); error = iwn_dma_contig_alloc(sc, &ring->cmd_dma, (void **)&ring->cmd, From owner-svn-src-head@FreeBSD.ORG Sun May 8 10:57:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA95106566C; Sun, 8 May 2011 10:57:45 +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 0E5C58FC0C; Sun, 8 May 2011 10:57:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48Aviiq042562; Sun, 8 May 2011 10:57:44 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48AviJE042560; Sun, 8 May 2011 10:57:44 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081057.p48AviJE042560@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 10:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221639 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 10:57:45 -0000 Author: bschmidt Date: Sun May 8 10:57:44 2011 New Revision: 221639 URL: http://svn.freebsd.org/changeset/base/221639 Log: RX aggregation is slightly different then the legacy path, we will only receive one RX_PHY for each aggregate and not one RX_PHY per frame. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 10:54:50 2011 (r221638) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 10:57:44 2011 (r221639) @@ -2253,7 +2253,6 @@ iwn_rx_done(struct iwn_softc *sc, struct "%s: missing RX_PHY\n", __func__); return; } - sc->last_rx_valid = 0; stat = &sc->last_rx_stat; } else stat = (struct iwn_rx_stat *)(desc + 1); From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:01:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63927106564A; Sun, 8 May 2011 11:01:53 +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 563948FC08; Sun, 8 May 2011 11:01:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48B1rH9042739; Sun, 8 May 2011 11:01:53 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48B1rKj042737; Sun, 8 May 2011 11:01:53 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081101.p48B1rKj042737@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 11:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221640 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:01:53 -0000 Author: bschmidt Date: Sun May 8 11:01:53 2011 New Revision: 221640 URL: http://svn.freebsd.org/changeset/base/221640 Log: Disable background scan support for 4965 adapters. On legacy channels every once in a while the firmware throws a SYSASSERT on line 208. On HT channels though this does always happen and I'm not aware of any workaround currently. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 10:57:44 2011 (r221639) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:01:53 2011 (r221640) @@ -584,12 +584,14 @@ iwn_attach(device_t dev) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_WPA | IEEE80211_C_SHPREAMBLE /* short preamble supported */ - | IEEE80211_C_BGSCAN /* background scanning */ #if 0 | IEEE80211_C_IBSS /* ibss/adhoc mode */ #endif | IEEE80211_C_WME /* WME */ ; + if (sc->hw_type != IWN_HW_REV_TYPE_4965) + ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */ + #if 0 /* HT */ /* XXX disable until HT channel setup works */ ic->ic_htcaps = From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:03:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28B3F106566C; Sun, 8 May 2011 11:03:17 +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 1B7788FC1C; Sun, 8 May 2011 11:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48B3G6i042827; Sun, 8 May 2011 11:03:16 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48B3G6B042825; Sun, 8 May 2011 11:03:16 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081103.p48B3G6B042825@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 11:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221641 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:03:17 -0000 Author: bschmidt Date: Sun May 8 11:03:16 2011 New Revision: 221641 URL: http://svn.freebsd.org/changeset/base/221641 Log: Add HT capabilities to probe requests. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:01:53 2011 (r221640) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:03:16 2011 (r221641) @@ -4942,6 +4942,7 @@ iwn_scan(struct iwn_softc *sc) struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_scan_state *ss = ic->ic_scan; /*XXX*/ + struct ieee80211_node *ni = ss->ss_vap->iv_bss; struct iwn_scan_hdr *hdr; struct iwn_cmd_data *tx; struct iwn_scan_essid *essid; @@ -5028,10 +5029,8 @@ iwn_scan(struct iwn_softc *sc) frm = ieee80211_add_rates(frm, rs); if (rs->rs_nrates > IEEE80211_RATE_SIZE) frm = ieee80211_add_xrates(frm, rs); -#if 0 /* HT */ - if (ic->ic_flags & IEEE80211_F_HTON) - frm = ieee80211_add_htcaps(frm, ic); -#endif + if (ic->ic_htcaps & IEEE80211_HTC_HT) + frm = ieee80211_add_htcap(frm, ni); /* Set length of probe request. */ tx->len = htole16(frm - (uint8_t *)wh); From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:05:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A8311065679; Sun, 8 May 2011 11:05:03 +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 5E96C8FC23; Sun, 8 May 2011 11:05:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48B53WK042930; Sun, 8 May 2011 11:05:03 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48B53qZ042928; Sun, 8 May 2011 11:05:03 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081105.p48B53qZ042928@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 11:05:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221642 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:05:03 -0000 Author: bschmidt Date: Sun May 8 11:05:03 2011 New Revision: 221642 URL: http://svn.freebsd.org/changeset/base/221642 Log: Read chainmask information before announcing it. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:03:16 2011 (r221641) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:05:03 2011 (r221642) @@ -550,21 +550,6 @@ iwn_attach(device_t dev) /* Clear pending interrupts. */ IWN_WRITE(sc, IWN_INT, 0xffffffff); - /* Count the number of available chains. */ - sc->ntxchains = - ((sc->txchainmask >> 2) & 1) + - ((sc->txchainmask >> 1) & 1) + - ((sc->txchainmask >> 0) & 1); - sc->nrxchains = - ((sc->rxchainmask >> 2) & 1) + - ((sc->rxchainmask >> 1) & 1) + - ((sc->rxchainmask >> 0) & 1); - if (bootverbose) { - device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n", - sc->ntxchains, sc->nrxchains, sc->eeprom_domain, - macaddr, ":"); - } - ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(dev, "can not allocate ifnet structure\n"); @@ -592,6 +577,28 @@ iwn_attach(device_t dev) if (sc->hw_type != IWN_HW_REV_TYPE_4965) ic->ic_caps |= IEEE80211_C_BGSCAN; /* background scanning */ + /* Read MAC address, channels, etc from EEPROM. */ + if ((error = iwn_read_eeprom(sc, macaddr)) != 0) { + device_printf(dev, "could not read EEPROM, error %d\n", + error); + goto fail; + } + + /* Count the number of available chains. */ + sc->ntxchains = + ((sc->txchainmask >> 2) & 1) + + ((sc->txchainmask >> 1) & 1) + + ((sc->txchainmask >> 0) & 1); + sc->nrxchains = + ((sc->rxchainmask >> 2) & 1) + + ((sc->rxchainmask >> 1) & 1) + + ((sc->rxchainmask >> 0) & 1); + if (bootverbose) { + device_printf(dev, "MIMO %dT%dR, %.4s, address %6D\n", + sc->ntxchains, sc->nrxchains, sc->eeprom_domain, + macaddr, ":"); + } + #if 0 /* HT */ /* XXX disable until HT channel setup works */ ic->ic_htcaps = @@ -623,13 +630,6 @@ iwn_attach(device_t dev) ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DIS; #endif - /* Read MAC address, channels, etc from EEPROM. */ - if ((error = iwn_read_eeprom(sc, macaddr)) != 0) { - device_printf(dev, "could not read EEPROM, error %d\n", - error); - goto fail; - } - #if 0 /* HT */ /* Set supported HT rates. */ ic->ic_sup_mcs[0] = 0xff; From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:10:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68880106564A; Sun, 8 May 2011 11:10:56 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8BB8FC12; Sun, 8 May 2011 11:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48BAuAI043165; Sun, 8 May 2011 11:10:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BAuK9043163; Sun, 8 May 2011 11:10:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105081110.p48BAuK9043163@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 8 May 2011 11:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221643 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:10:56 -0000 Author: pjd Date: Sun May 8 11:10:56 2011 New Revision: 221643 URL: http://svn.freebsd.org/changeset/base/221643 Log: Allow to specify remote as 'none' again which was broken by r219351, where 'none' was defined as a value for checksum. Reported by: trasz MFC after: 1 week Modified: head/sbin/hastd/parse.y Modified: head/sbin/hastd/parse.y ============================================================================== --- head/sbin/hastd/parse.y Sun May 8 11:05:03 2011 (r221642) +++ head/sbin/hastd/parse.y Sun May 8 11:10:56 2011 (r221643) @@ -289,6 +289,7 @@ yy_config_free(struct hastd_config *conf %token FULLSYNC MEMSYNC ASYNC NONE CRC32 SHA256 HOLE LZF %token NUM STR OB CB +%type remote_str %type replication_type %type checksum_type %type compression_type @@ -796,7 +797,7 @@ resource_node_entry: source_statement ; -remote_statement: REMOTE STR +remote_statement: REMOTE remote_str { assert(depth == 2); if (mynode) { @@ -813,6 +814,12 @@ remote_statement: REMOTE STR } ; +remote_str: + NONE { $$ = strdup("none"); } + | + STR { } + ; + source_statement: SOURCE STR { assert(depth == 2); From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:16:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E1411065672; Sun, 8 May 2011 11:16:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4150B8FC0C; Sun, 8 May 2011 11:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48BGI7g043383; Sun, 8 May 2011 11:16:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BGIp0043381; Sun, 8 May 2011 11:16:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081116.p48BGIp0043381@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 11:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221644 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:16:18 -0000 Author: ae Date: Sun May 8 11:16:17 2011 New Revision: 221644 URL: http://svn.freebsd.org/changeset/base/221644 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun May 8 11:10:56 2011 (r221643) +++ head/sys/geom/part/g_part_mbr.c Sun May 8 11:16:17 2011 (r221644) @@ -262,7 +262,7 @@ g_part_mbr_create(struct g_part_table *b if (pp->sectorsize < MBRSIZE) return (ENOSPC); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT_MAX); basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; @@ -433,7 +433,7 @@ g_part_mbr_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_mbr_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT_MAX); buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:20:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F0381065673; Sun, 8 May 2011 11:20:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6220B8FC15; Sun, 8 May 2011 11:20:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48BKR01043546; Sun, 8 May 2011 11:20:27 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BKRB7043544; Sun, 8 May 2011 11:20:27 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081120.p48BKRB7043544@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 11:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221645 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:20:27 -0000 Author: ae Date: Sun May 8 11:20:27 2011 New Revision: 221645 URL: http://svn.freebsd.org/changeset/base/221645 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sun May 8 11:16:17 2011 (r221644) +++ head/sys/geom/part/g_part_pc98.c Sun May 8 11:20:27 2011 (r221645) @@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table * cyl = basetable->gpt_heads * basetable->gpt_sectors; - msize = MIN(pp->mediasize / SECSIZE, 0xffffffff); + msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; @@ -451,7 +451,7 @@ g_part_pc98_read(struct g_part_table *ba pp = cp->provider; table = (struct g_part_pc98_table *)basetable; - msize = pp->mediasize / SECSIZE; + msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); buf = g_read_data(cp, 0L, BOOTSIZE, &error); if (buf == NULL) From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:32:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EF92106566C; Sun, 8 May 2011 11:32:20 +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 6098B8FC0A; Sun, 8 May 2011 11:32:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48BWKV2043928; Sun, 8 May 2011 11:32:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BWKEk043924; Sun, 8 May 2011 11:32:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105081132.p48BWKEk043924@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 8 May 2011 11:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221646 - in head: bin/sh tools/regression/bin/sh/builtins tools/regression/bin/sh/expansion X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:32:20 -0000 Author: jilles Date: Sun May 8 11:32:20 2011 New Revision: 221646 URL: http://svn.freebsd.org/changeset/base/221646 Log: sh: Add UTF-8 support to pattern matching. ?, [...] patterns match codepoints instead of bytes. They do not match invalid sequences. [...] patterns must not contain invalid sequences otherwise they will not match anything. This is so that ${var#?} removes the first codepoint, not the first byte, without putting UTF-8 knowledge into the ${var#pattern} code. However, * continues to match any string and an invalid sequence matches an identical invalid sequence. (This differs from fnmatch(3).) Added: head/tools/regression/bin/sh/builtins/case5.0 (contents, props changed) head/tools/regression/bin/sh/expansion/trim8.0 (contents, props changed) Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sun May 8 11:20:27 2011 (r221645) +++ head/bin/sh/expand.c Sun May 8 11:32:20 2011 (r221646) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * Routines to expand arguments to commands. We have to deal with @@ -111,16 +112,16 @@ static void addfname(char *); static struct strlist *expsort(struct strlist *); static struct strlist *msort(struct strlist *, int); static char *cvtnum(int, char *); -static int collate_range_cmp(int, int); +static int collate_range_cmp(wchar_t, wchar_t); static int -collate_range_cmp(int c1, int c2) +collate_range_cmp(wchar_t c1, wchar_t c2) { - static char s1[2], s2[2]; + static wchar_t s1[2], s2[2]; s1[0] = c1; s2[0] = c2; - return (strcoll(s1, s2)); + return (wcscoll(s1, s2)); } /* @@ -1377,6 +1378,23 @@ msort(struct strlist *list, int len) +static wchar_t +get_wc(const char **p) +{ + wchar_t c; + int chrlen; + + chrlen = mbtowc(&c, *p, 4); + if (chrlen == 0) + return 0; + else if (chrlen == -1) + c = 0; + else + *p += chrlen; + return c; +} + + /* * Returns true if the pattern matches the string. */ @@ -1386,6 +1404,7 @@ patmatch(const char *pattern, const char { const char *p, *q; char c; + wchar_t wc, wc2; p = pattern; q = string; @@ -1404,7 +1423,11 @@ patmatch(const char *pattern, const char case '?': if (squoted && *q == CTLESC) q++; - if (*q++ == '\0') + if (localeisutf8) + wc = get_wc(&q); + else + wc = *q++; + if (wc == '\0') return 0; break; case '*': @@ -1434,7 +1457,7 @@ patmatch(const char *pattern, const char case '[': { const char *endp; int invert, found; - char chr; + wchar_t chr; endp = p; if (*endp == '!' || *endp == '^') @@ -1455,8 +1478,11 @@ patmatch(const char *pattern, const char p++; } found = 0; - chr = *q++; - if (squoted && chr == CTLESC) + if (squoted && *q == CTLESC) + q++; + if (localeisutf8) + chr = get_wc(&q); + else chr = *q++; if (chr == '\0') return 0; @@ -1466,19 +1492,31 @@ patmatch(const char *pattern, const char continue; if (c == CTLESC) c = *p++; + if (localeisutf8 && c & 0x80) { + p--; + wc = get_wc(&p); + if (wc == 0) /* bad utf-8 */ + return 0; + } else + wc = c; if (*p == '-' && p[1] != ']') { p++; while (*p == CTLQUOTEMARK) p++; if (*p == CTLESC) p++; - if ( collate_range_cmp(chr, c) >= 0 - && collate_range_cmp(chr, *p) <= 0 + if (localeisutf8) { + wc2 = get_wc(&p); + if (wc2 == 0) /* bad utf-8 */ + return 0; + } else + wc2 = *p++; + if ( collate_range_cmp(chr, wc) >= 0 + && collate_range_cmp(chr, wc2) <= 0 ) found = 1; - p++; } else { - if (chr == c) + if (chr == wc) found = 1; } } while ((c = *p++) != ']'); Added: head/tools/regression/bin/sh/builtins/case5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/case5.0 Sun May 8 11:32:20 2011 (r221646) @@ -0,0 +1,57 @@ +# $FreeBSD$ + +unset LC_ALL +LC_CTYPE=en_US.UTF-8 +export LC_CTYPE + +c1=e +# a umlaut +c2=$(printf '\303\244') +# euro sign +c3=$(printf '\342\202\254') +# some sort of 't' outside BMP +c4=$(printf '\360\235\225\245') + +ok=0 +case $c1$c2$c3$c4 in +*) ok=1 ;; +esac +if [ $ok = 0 ]; then + echo wrong at $LINENO + exit 3 +fi + +case $c1$c2$c3$c4 in +$c1$c2$c3$c4) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +"$c1$c2$c3$c4") ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +????) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1.$c2.$c3.$c4 in +?.?.?.?) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +[!a][!b][!c][!d]) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +[$c1][$c2][$c3][$c4]) ;; +*) echo wrong at $LINENO ;; +esac + +case $c1$c2$c3$c4 in +["$c1"]["$c2"]["$c3"]["$c4"]) ;; +*) echo wrong at $LINENO ;; +esac Added: head/tools/regression/bin/sh/expansion/trim8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/trim8.0 Sun May 8 11:32:20 2011 (r221646) @@ -0,0 +1,75 @@ +# $FreeBSD$ + +unset LC_ALL +LC_CTYPE=en_US.UTF-8 +export LC_CTYPE + +c1=e +# a umlaut +c2=$(printf '\303\244') +# euro sign +c3=$(printf '\342\202\254') +# some sort of 't' outside BMP +c4=$(printf '\360\235\225\245') + +s=$c1$c2$c3$c4 + +testcase() { + code="$1" + expected="$2" + oIFS="$IFS" + eval "$code" + IFS='|' + result="$#|$*" + IFS="$oIFS" + if [ "x$result" = "x$expected" ]; then + ok=x$ok + else + failures=x$failures + echo "For $code, expected $expected actual $result" + fi +} + +testcase 'set -- "$s"' "1|$s" +testcase 'set -- "${s#$c2}"' "1|$s" +testcase 'set -- "${s#*}"' "1|$s" +testcase 'set -- "${s#$c1}"' "1|$c2$c3$c4" +testcase 'set -- "${s#$c1$c2}"' "1|$c3$c4" +testcase 'set -- "${s#$c1$c2$c3}"' "1|$c4" +testcase 'set -- "${s#$c1$c2$c3$c4}"' "1|" +testcase 'set -- "${s#?}"' "1|$c2$c3$c4" +testcase 'set -- "${s#??}"' "1|$c3$c4" +testcase 'set -- "${s#???}"' "1|$c4" +testcase 'set -- "${s#????}"' "1|" +testcase 'set -- "${s#*$c3}"' "1|$c4" +testcase 'set -- "${s%$c4}"' "1|$c1$c2$c3" +testcase 'set -- "${s%$c3$c4}"' "1|$c1$c2" +testcase 'set -- "${s%$c2$c3$c4}"' "1|$c1" +testcase 'set -- "${s%$c1$c2$c3$c4}"' "1|" +testcase 'set -- "${s%?}"' "1|$c1$c2$c3" +testcase 'set -- "${s%??}"' "1|$c1$c2" +testcase 'set -- "${s%???}"' "1|$c1" +testcase 'set -- "${s%????}"' "1|" +testcase 'set -- "${s%$c2*}"' "1|$c1" +testcase 'set -- "${s##$c2}"' "1|$s" +testcase 'set -- "${s##*}"' "1|" +testcase 'set -- "${s##$c1}"' "1|$c2$c3$c4" +testcase 'set -- "${s##$c1$c2}"' "1|$c3$c4" +testcase 'set -- "${s##$c1$c2$c3}"' "1|$c4" +testcase 'set -- "${s##$c1$c2$c3$c4}"' "1|" +testcase 'set -- "${s##?}"' "1|$c2$c3$c4" +testcase 'set -- "${s##??}"' "1|$c3$c4" +testcase 'set -- "${s##???}"' "1|$c4" +testcase 'set -- "${s##????}"' "1|" +testcase 'set -- "${s##*$c3}"' "1|$c4" +testcase 'set -- "${s%%$c4}"' "1|$c1$c2$c3" +testcase 'set -- "${s%%$c3$c4}"' "1|$c1$c2" +testcase 'set -- "${s%%$c2$c3$c4}"' "1|$c1" +testcase 'set -- "${s%%$c1$c2$c3$c4}"' "1|" +testcase 'set -- "${s%%?}"' "1|$c1$c2$c3" +testcase 'set -- "${s%%??}"' "1|$c1$c2" +testcase 'set -- "${s%%???}"' "1|$c1" +testcase 'set -- "${s%%????}"' "1|" +testcase 'set -- "${s%%$c2*}"' "1|$c1" + +test "x$failures" = x From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:34:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06F71106566C; Sun, 8 May 2011 11:34:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8AF8FC08; Sun, 8 May 2011 11:34:58 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p48BYpkX058461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2011 14:34:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p48BYpB9068470; Sun, 8 May 2011 14:34:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p48BYpPO068469; Sun, 8 May 2011 14:34:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 May 2011 14:34:51 +0300 From: Kostik Belousov To: "Andrey V. Elsukov" Message-ID: <20110508113451.GY48734@deviant.kiev.zoral.com.ua> References: <201105081120.p48BKRB7043544@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xfLSUI6RYrtWMjtK" Content-Disposition: inline In-Reply-To: <201105081120.p48BKRB7043544@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221645 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:34:59 -0000 --xfLSUI6RYrtWMjtK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 08, 2011 at 11:20:27AM +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Sun May 8 11:20:27 2011 > New Revision: 221645 > URL: http://svn.freebsd.org/changeset/base/221645 >=20 > Log: > Limit number of sectors that can be addressed. > =20 > MFC after: 1 week >=20 > Modified: > head/sys/geom/part/g_part_pc98.c >=20 > Modified: head/sys/geom/part/g_part_pc98.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/geom/part/g_part_pc98.c Sun May 8 11:16:17 2011 (r221644) > +++ head/sys/geom/part/g_part_pc98.c Sun May 8 11:20:27 2011 (r221645) > @@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table * > =20 > cyl =3D basetable->gpt_heads * basetable->gpt_sectors; > =20 > - msize =3D MIN(pp->mediasize / SECSIZE, 0xffffffff); > + msize =3D MIN(pp->mediasize / SECSIZE, UINT_MAX); Shouldn't this be UINT32_MAX (consistently) ? --xfLSUI6RYrtWMjtK Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3Gf9sACgkQC3+MBN1Mb4hnBgCfUhhIp0+nLXWtYSyWTAIOGstW eJgAoNgNiGhzr/h/ve1gIzE0FZadzrg1 =H1z7 -----END PGP SIGNATURE----- --xfLSUI6RYrtWMjtK-- From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:42:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96FD3106566C; Sun, 8 May 2011 11:42:51 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701F88FC14; Sun, 8 May 2011 11:42:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48Bgp8n044266; Sun, 8 May 2011 11:42:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48Bgp9g044263; Sun, 8 May 2011 11:42:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081142.p48Bgp9g044263@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 11:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221647 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:42:51 -0000 Author: ae Date: Sun May 8 11:42:51 2011 New Revision: 221647 URL: http://svn.freebsd.org/changeset/base/221647 Log: Replace UINT_MAX to UINT32_MAX. Pointed out by: kib MFC after: 1 week Modified: head/sys/geom/part/g_part_mbr.c head/sys/geom/part/g_part_pc98.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun May 8 11:32:20 2011 (r221646) +++ head/sys/geom/part/g_part_mbr.c Sun May 8 11:42:51 2011 (r221647) @@ -262,7 +262,7 @@ g_part_mbr_create(struct g_part_table *b if (pp->sectorsize < MBRSIZE) return (ENOSPC); - msize = MIN(pp->mediasize / pp->sectorsize, UINT_MAX); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); basetable->gpt_first = basetable->gpt_sectors; basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; @@ -433,7 +433,7 @@ g_part_mbr_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_mbr_table *)basetable; - msize = MIN(pp->mediasize / pp->sectorsize, UINT_MAX); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) Modified: head/sys/geom/part/g_part_pc98.c ============================================================================== --- head/sys/geom/part/g_part_pc98.c Sun May 8 11:32:20 2011 (r221646) +++ head/sys/geom/part/g_part_pc98.c Sun May 8 11:42:51 2011 (r221647) @@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table * cyl = basetable->gpt_heads * basetable->gpt_sectors; - msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); + msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX); basetable->gpt_first = cyl; basetable->gpt_last = msize - (msize % cyl) - 1; @@ -451,7 +451,7 @@ g_part_pc98_read(struct g_part_table *ba pp = cp->provider; table = (struct g_part_pc98_table *)basetable; - msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); + msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX); buf = g_read_data(cp, 0L, BOOTSIZE, &error); if (buf == NULL) From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:49:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1029A106566B; Sun, 8 May 2011 11:49:51 +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 02B2A8FC0C; Sun, 8 May 2011 11:49:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48BnooB044511; Sun, 8 May 2011 11:49:50 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BnoHC044507; Sun, 8 May 2011 11:49:50 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081149.p48BnoHC044507@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 11:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221648 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:49:51 -0000 Author: bschmidt Date: Sun May 8 11:49:50 2011 New Revision: 221648 URL: http://svn.freebsd.org/changeset/base/221648 Log: Prepare for transmitting frames at MCS rates: - instead of calling iwn_plcp_signal() for every frame, map the expected value directly within wn->ridx - concat plcp, rflags and xrflags, there is no clean byte boundary within the flags, for example the antenna setting uses bit 6, 7 and 8 - there is still need for a custom rate to plcp mapping, as those expected by the hardware are not conform to the std Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:42:51 2011 (r221647) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:49:50 2011 (r221648) @@ -199,7 +199,6 @@ static void iwn5000_update_sched(struct #ifdef notyet static void iwn5000_reset_sched(struct iwn_softc *, int, int); #endif -static uint8_t iwn_plcp_signal(int); static int iwn_tx_data(struct iwn_softc *, struct mbuf *, struct ieee80211_node *); static int iwn_tx_data_raw(struct iwn_softc *, struct mbuf *, @@ -2094,15 +2093,48 @@ iwn_node_alloc(struct ieee80211vap *vap, return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } +static __inline int +rate2plcp(int rate) +{ + switch (rate & 0xff) { + case 12: return 0xd; + case 18: return 0xf; + case 24: return 0x5; + case 36: return 0x7; + case 48: return 0x9; + case 72: return 0xb; + case 96: return 0x1; + case 108: return 0x3; + case 2: return 10; + case 4: return 20; + case 11: return 55; + case 22: return 110; + } + return 0; +} + static void iwn_newassoc(struct ieee80211_node *ni, int isnew) { + struct ieee80211com *ic = ni->ni_ic; + struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_node *wn = (void *)ni; - int ridx, i; + uint8_t txant; + int i, plcp, rate, ridx; + + /* Use the first valid TX antenna. */ + txant = IWN_LSB(sc->txchainmask); for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - ridx = iwn_plcp_signal(ni->ni_rates.rs_rates[i]); - wn->ridx[i] = ridx; + rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL; + plcp = rate2plcp(rate); + ridx = ic->ic_rt->rateCodeToIndex[rate]; + + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + plcp |= IWN_RFLAG_CCK; + plcp |= IWN_RFLAG_ANT(txant); + wn->ridx[rate] = htole32(plcp); } } @@ -3087,18 +3119,6 @@ iwn5000_reset_sched(struct iwn_softc *sc } #endif -static uint8_t -iwn_plcp_signal(int rate) { - int i; - - for (i = 0; i < IWN_RIDX_MAX + 1; i++) { - if ((rate & IEEE80211_RATE_VAL) == iwn_rates[i].rate) - return i; - } - - return 0; -} - static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { @@ -3111,7 +3131,6 @@ iwn_tx_data(struct iwn_softc *sc, struct struct iwn_tx_data *data; struct iwn_tx_cmd *cmd; struct iwn_cmd_data *tx; - const struct iwn_rate *rinfo; struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; struct mbuf *m1; @@ -3155,8 +3174,7 @@ iwn_tx_data(struct iwn_softc *sc, struct (void) ieee80211_ratectl_rate(ni, NULL, 0); rate = ni->ni_txrate; } - ridx = iwn_plcp_signal(rate); - rinfo = &iwn_rates[ridx]; + ridx = ic->ic_rt->rateCodeToIndex[rate]; /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_WEP) { @@ -3175,7 +3193,7 @@ iwn_tx_data(struct iwn_softc *sc, struct struct iwn_tx_radiotap_header *tap = &sc->sc_txtap; tap->wt_flags = 0; - tap->wt_rate = rinfo->rate; + tap->wt_rate = rate; if (k != NULL) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; @@ -3262,14 +3280,13 @@ iwn_tx_data(struct iwn_softc *sc, struct tx->rts_ntries = 60; tx->data_ntries = 15; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->plcp = rinfo->plcp; - tx->rflags = rinfo->flags; + tx->rate = wn->ridx[rate]; if (tx->id == sc->broadcast_id) { /* Group or management frame. */ tx->linkq = 0; /* XXX Alternate between antenna A and B? */ txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); } else { tx->linkq = ni->ni_rates.rs_nrates - ridx - 1; flags |= IWN_TX_LINKQ; /* enable MRR */ @@ -3364,7 +3381,6 @@ static int iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { - const struct iwn_rate *rinfo; struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ifp->if_l2com; @@ -3395,13 +3411,12 @@ iwn_tx_data_raw(struct iwn_softc *sc, st /* Choose a TX rate index. */ rate = params->ibp_rate0; - if (!ieee80211_isratevalid(ic->ic_rt, rate)) { + ridx = ic->ic_rt->rateCodeToIndex[rate]; + if (ridx == (uint8_t)-1) { /* XXX fall back to mcast/mgmt rate? */ m_freem(m); return EINVAL; } - ridx = iwn_plcp_signal(rate); - rinfo = &iwn_rates[ridx]; totlen = m->m_pkthdr.len; @@ -3472,12 +3487,14 @@ iwn_tx_data_raw(struct iwn_softc *sc, st tx->rts_ntries = params->ibp_try1; tx->data_ntries = params->ibp_try0; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->plcp = rinfo->plcp; - tx->rflags = rinfo->flags; + tx->rate = htole32(rate2plcp(rate)); + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + tx->rate |= htole32(IWN_RFLAG_CCK); /* Group or management frame. */ tx->linkq = 0; txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); tx->hiaddr = IWN_HIADDR(data->scratch_paddr); @@ -3817,9 +3834,8 @@ iwn_set_link_quality(struct iwn_softc *s struct iwn_node *wn = (void *)ni; struct ieee80211_rateset *rs = &ni->ni_rates; struct iwn_cmd_link_quality linkq; - const struct iwn_rate *rinfo; uint8_t txant; - int i, txrate; + int i, rate, txrate; /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); @@ -3835,10 +3851,9 @@ iwn_set_link_quality(struct iwn_softc *s /* Start at highest available bit-rate. */ txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { - rinfo = &iwn_rates[wn->ridx[txrate]]; - linkq.retry[i].plcp = rinfo->plcp; - linkq.retry[i].rflags = rinfo->flags; - linkq.retry[i].rflags |= IWN_RFLAG_ANT(txant); + rate = rs->rs_rates[txrate] & IEEE80211_RATE_VAL; + linkq.retry[i] = wn->ridx[rate]; + /* Next retry at immediate lower bit-rate. */ if (txrate > 0) txrate--; @@ -3857,7 +3872,6 @@ iwn_add_broadcast_node(struct iwn_softc struct ieee80211com *ic = ifp->if_l2com; struct iwn_node_info node; struct iwn_cmd_link_quality linkq; - const struct iwn_rate *rinfo; uint8_t txant; int i, error; @@ -3881,16 +3895,13 @@ iwn_add_broadcast_node(struct iwn_softc /* Use lowest mandatory bit-rate. */ if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) - rinfo = &iwn_rates[IWN_RIDX_OFDM6]; + linkq.retry[0] = htole32(0xd); else - rinfo = &iwn_rates[IWN_RIDX_CCK1]; - linkq.retry[0].plcp = rinfo->plcp; - linkq.retry[0].rflags = rinfo->flags; - linkq.retry[0].rflags |= IWN_RFLAG_ANT(txant); + linkq.retry[0] = htole32(10 | IWN_RFLAG_CCK); + linkq.retry[0] |= htole32(IWN_RFLAG_ANT(txant)); /* Use same bit-rate for all TX retries. */ for (i = 1; i < IWN_MAX_TX_RETRIES; i++) { - linkq.retry[i].plcp = linkq.retry[0].plcp; - linkq.retry[i].rflags = linkq.retry[0].rflags; + linkq.retry[i] = linkq.retry[0]; } return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async); } @@ -4991,18 +5002,17 @@ iwn_scan(struct iwn_softc *sc) if (IEEE80211_IS_CHAN_A(ic->ic_curchan)) { /* Send probe requests at 6Mbps. */ - tx->plcp = iwn_rates[IWN_RIDX_OFDM6].plcp; + tx->rate = htole32(0xd); rs = &ic->ic_sup_rates[IEEE80211_MODE_11A]; } else { hdr->flags = htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO); /* Send probe requests at 1Mbps. */ - tx->plcp = iwn_rates[IWN_RIDX_CCK1].plcp; - tx->rflags = IWN_RFLAG_CCK; + tx->rate = htole32(10 | IWN_RFLAG_CCK); rs = &ic->ic_sup_rates[IEEE80211_MODE_11G]; } /* Use the first valid TX antenna. */ txant = IWN_LSB(sc->txchainmask); - tx->rflags |= IWN_RFLAG_ANT(txant); + tx->rate |= htole32(IWN_RFLAG_ANT(txant)); essid = (struct iwn_scan_essid *)(tx + 1); if (ss->ss_ssid[0].len != 0) { Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun May 8 11:42:51 2011 (r221647) +++ head/sys/dev/iwn/if_iwnreg.h Sun May 8 11:49:50 2011 (r221648) @@ -625,8 +625,8 @@ struct iwn4965_node_info { uint32_t reserved7; } __packed; -#define IWN_RFLAG_CCK (1 << 1) -#define IWN_RFLAG_ANT(x) ((x) << 6) +#define IWN_RFLAG_CCK (1 << 9) +#define IWN_RFLAG_ANT(x) ((x) << 14) /* Structure for command IWN_CMD_TX_DATA. */ struct iwn_cmd_data { @@ -647,9 +647,7 @@ struct iwn_cmd_data { #define IWN_TX_NEED_PADDING (1 << 20) uint32_t scratch; - uint8_t plcp; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint8_t id; uint8_t security; @@ -690,11 +688,7 @@ struct iwn_cmd_link_quality { uint8_t ampdu_threshold; uint8_t ampdu_max; uint32_t reserved2; - struct { - uint8_t plcp; - uint8_t rflags; - uint16_t xrflags; - } __packed retry[IWN_MAX_TX_RETRIES]; + uint32_t retry[IWN_MAX_TX_RETRIES]; uint32_t reserved3; } __packed; @@ -1065,9 +1059,7 @@ struct iwn4965_tx_stat { uint8_t btkillcnt; uint8_t rtsfailcnt; uint8_t ackfailcnt; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t duration; uint16_t reserved; uint32_t power[2]; @@ -1079,9 +1071,7 @@ struct iwn5000_tx_stat { uint8_t btkillcnt; uint8_t rtsfailcnt; uint8_t ackfailcnt; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t duration; uint16_t reserved; uint32_t power[2]; @@ -1136,9 +1126,7 @@ struct iwn_rx_stat { uint16_t chan; uint8_t phybuf[32]; - uint8_t rate; - uint8_t rflags; - uint16_t xrflags; + uint32_t rate; uint16_t len; uint16_t reserve3; } __packed; @@ -1534,26 +1522,6 @@ static const struct iwn_chan_band { #define IWN_RIDX_CCK1 0 #define IWN_RIDX_OFDM6 4 -static const struct iwn_rate { - uint8_t rate; - uint8_t plcp; - uint8_t flags; -} iwn_rates[IWN_RIDX_MAX + 1] = { - { 2, 10, IWN_RFLAG_CCK }, - { 4, 20, IWN_RFLAG_CCK }, - { 11, 55, IWN_RFLAG_CCK }, - { 22, 110, IWN_RFLAG_CCK }, - { 12, 0xd, 0 }, - { 18, 0xf, 0 }, - { 24, 0x5, 0 }, - { 36, 0x7, 0 }, - { 48, 0x9, 0 }, - { 72, 0xb, 0 }, - { 96, 0x1, 0 }, - { 108, 0x3, 0 }, - { 120, 0x3, 0 } -}; - #define IWN4965_MAX_PWR_INDEX 107 /* Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun May 8 11:42:51 2011 (r221647) +++ head/sys/dev/iwn/if_iwnvar.h Sun May 8 11:49:50 2011 (r221648) @@ -101,7 +101,7 @@ struct iwn_node { struct ieee80211_node ni; /* must be the first */ uint16_t disable_tid; uint8_t id; - uint8_t ridx[IEEE80211_RATE_MAXSIZE]; + uint32_t ridx[256]; }; struct iwn_calib_state { From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:54:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4931065673; Sun, 8 May 2011 11:54: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 A3FD48FC0A; Sun, 8 May 2011 11:54:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48Bsc8h044693; Sun, 8 May 2011 11:54:38 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48Bsc7e044690; Sun, 8 May 2011 11:54:38 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081154.p48Bsc7e044690@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 11:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221649 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:54:38 -0000 Author: bschmidt Date: Sun May 8 11:54:38 2011 New Revision: 221649 URL: http://svn.freebsd.org/changeset/base/221649 Log: Add support for transmitting frames at MCS rates. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:49:50 2011 (r221648) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:54:38 2011 (r221649) @@ -2119,22 +2119,47 @@ iwn_newassoc(struct ieee80211_node *ni, struct ieee80211com *ic = ni->ni_ic; struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_node *wn = (void *)ni; - uint8_t txant; + uint8_t txant1, txant2; int i, plcp, rate, ridx; /* Use the first valid TX antenna. */ - txant = IWN_LSB(sc->txchainmask); + txant1 = IWN_LSB(sc->txchainmask); + txant2 = IWN_LSB(sc->txchainmask & ~txant1); + + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + ridx = ni->ni_rates.rs_nrates - 1; + for (i = ni->ni_htrates.rs_nrates - 1; i >= 0; i--) { + plcp = ni->ni_htrates.rs_rates[i] | IWN_RFLAG_MCS; + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + plcp |= IWN_RFLAG_HT40; + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + plcp |= IWN_RFLAG_SGI; + } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + plcp |= IWN_RFLAG_SGI; + if (i > 7) + plcp |= IWN_RFLAG_ANT(txant1 | txant2); + else + plcp |= IWN_RFLAG_ANT(txant1); + if (ridx >= 0) { + rate = ni->ni_rates.rs_rates[ridx]; + rate &= IEEE80211_RATE_VAL; + wn->ridx[rate] = plcp; + } + wn->ridx[IEEE80211_RATE_MCS | i] = plcp; + ridx--; + } + } else { + for (i = 0; i < ni->ni_rates.rs_nrates; i++) { + rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL; - for (i = 0; i < ni->ni_rates.rs_nrates; i++) { - rate = ni->ni_rates.rs_rates[i] & IEEE80211_RATE_VAL; - plcp = rate2plcp(rate); - ridx = ic->ic_rt->rateCodeToIndex[rate]; - - if (ridx < IWN_RIDX_OFDM6 && - IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) - plcp |= IWN_RFLAG_CCK; - plcp |= IWN_RFLAG_ANT(txant); - wn->ridx[rate] = htole32(plcp); + plcp = rate2plcp(rate); + ridx = ic->ic_rt->rateCodeToIndex[rate]; + if (ridx < IWN_RIDX_OFDM6 && + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan)) + plcp |= IWN_RFLAG_CCK; + plcp |= IWN_RFLAG_ANT(txant1); + wn->ridx[rate] = htole32(plcp); + } } } @@ -3849,11 +3874,21 @@ iwn_set_link_quality(struct iwn_softc *s linkq.ampdu_limit = htole16(4000); /* 4ms */ /* Start at highest available bit-rate. */ - txrate = rs->rs_nrates - 1; + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + txrate = ni->ni_htrates.rs_nrates - 1; + else + txrate = rs->rs_nrates - 1; for (i = 0; i < IWN_MAX_TX_RETRIES; i++) { - rate = rs->rs_rates[txrate] & IEEE80211_RATE_VAL; + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) + rate = IEEE80211_RATE_MCS | txrate; + else + rate = rs->rs_rates[txrate] & IEEE80211_RATE_VAL; linkq.retry[i] = wn->ridx[rate]; + if ((le32toh(wn->ridx[rate]) & IWN_RFLAG_MCS) && + (le32toh(wn->ridx[rate]) & 0xff) > 7) + linkq.mimo = i + 1; + /* Next retry at immediate lower bit-rate. */ if (txrate > 0) txrate--; Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun May 8 11:49:50 2011 (r221648) +++ head/sys/dev/iwn/if_iwnreg.h Sun May 8 11:54:38 2011 (r221649) @@ -625,7 +625,12 @@ struct iwn4965_node_info { uint32_t reserved7; } __packed; +#define IWN_RFLAG_MCS (1 << 8) #define IWN_RFLAG_CCK (1 << 9) +#define IWN_RFLAG_GREENFIELD (1 << 10) +#define IWN_RFLAG_HT40 (1 << 11) +#define IWN_RFLAG_DUPLICATE (1 << 12) +#define IWN_RFLAG_SGI (1 << 13) #define IWN_RFLAG_ANT(x) ((x) << 14) /* Structure for command IWN_CMD_TX_DATA. */ From owner-svn-src-head@FreeBSD.ORG Sun May 8 11:58:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9BE2106564A; Sun, 8 May 2011 11:58:23 +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 AC8C68FC08; Sun, 8 May 2011 11:58:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48BwNx1044855; Sun, 8 May 2011 11:58:23 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48BwNdC044852; Sun, 8 May 2011 11:58:23 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081158.p48BwNdC044852@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 11:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221650 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 11:58:23 -0000 Author: bschmidt Date: Sun May 8 11:58:23 2011 New Revision: 221650 URL: http://svn.freebsd.org/changeset/base/221650 Log: Add support for RX packet aggregation. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:54:38 2011 (r221649) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 11:58:23 2011 (r221650) @@ -251,11 +251,11 @@ static uint8_t *ieee80211_add_ssid(uint8 static int iwn_scan(struct iwn_softc *); static int iwn_auth(struct iwn_softc *, struct ieee80211vap *vap); static int iwn_run(struct iwn_softc *, struct ieee80211vap *vap); +static int iwn_ampdu_rx_start(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); +static void iwn_ampdu_rx_stop(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); #if 0 /* HT */ -static int iwn_ampdu_rx_start(struct ieee80211com *, - struct ieee80211_node *, uint8_t); -static void iwn_ampdu_rx_stop(struct ieee80211com *, - struct ieee80211_node *, uint8_t); static int iwn_ampdu_tx_start(struct ieee80211com *, struct ieee80211_node *, uint8_t); static void iwn_ampdu_tx_stop(struct ieee80211com *, @@ -653,9 +653,11 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; -#if 0 /* HT */ + sc->sc_ampdu_rx_start = ic->ic_ampdu_rx_start; ic->ic_ampdu_rx_start = iwn_ampdu_rx_start; + sc->sc_ampdu_rx_stop = ic->ic_ampdu_rx_stop; ic->ic_ampdu_rx_stop = iwn_ampdu_rx_stop; +#if 0 /* HT */ ic->ic_ampdu_tx_start = iwn_ampdu_tx_start; ic->ic_ampdu_tx_stop = iwn_ampdu_tx_stop; #endif @@ -2434,6 +2436,8 @@ iwn_rx_done(struct iwn_softc *sc, struct /* Send the frame to the 802.11 layer. */ if (ni != NULL) { + if (ni->ni_flags & IEEE80211_NODE_HT) + m->m_flags |= M_AMPDU; (void)ieee80211_input(ni, m, rssi - nf, nf); /* Node is no longer needed. */ ieee80211_free_node(ni); @@ -3765,7 +3769,8 @@ iwn_cmd(struct iwn_softc *sc, int code, bus_addr_t paddr; int totlen, error; - IWN_LOCK_ASSERT(sc); + if (async == 0) + IWN_LOCK_ASSERT(sc); desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -5321,30 +5326,39 @@ iwn_run(struct iwn_softc *sc, struct iee #undef MS } -#if 0 /* HT */ /* * This function is called by upper layer when an ADDBA request is received * from another STA and before the ADDBA response is sent. */ static int -iwn_ampdu_rx_start(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, + int baparamset, int batimeout, int baseqctl) { - struct ieee80211_rx_ba *ba = &ni->ni_rx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; +#define MS(_v, _f) (((_v) & _f) >> _f##_S) + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; + uint16_t ssn; + uint8_t tid; + int error; + + tid = MS(le16toh(baparamset), IEEE80211_BAPS_TID); + ssn = MS(le16toh(baseqctl), IEEE80211_BASEQ_START); memset(&node, 0, sizeof node); node.id = wn->id; node.control = IWN_NODE_UPDATE; node.flags = IWN_FLAG_SET_ADDBA; node.addba_tid = tid; - node.addba_ssn = htole16(ba->ba_winstart); + node.addba_ssn = htole16(ssn); DPRINTF(sc, IWN_DEBUG_RECV, "ADDBA RA=%d TID=%d SSN=%d\n", - wn->id, tid, ba->ba_winstart); - return ops->add_node(sc, &node, 1); + wn->id, tid, ssn); + error = ops->add_node(sc, &node, 1); + if (error != 0) + return error; + return sc->sc_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl); +#undef MS } /* @@ -5352,13 +5366,20 @@ iwn_ampdu_rx_start(struct ieee80211com * * Block Ack agreement (eg. uppon receipt of a DELBA frame). */ static void -iwn_ampdu_rx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) { - struct iwn_softc *sc = ic->ic_softc; + struct ieee80211com *ic = ni->ni_ic; + struct iwn_softc *sc = ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; + uint8_t tid; + + /* XXX: tid as an argument */ + for (tid = 0; tid < WME_NUM_TID; tid++) { + if (&ni->ni_rx_ampdu[tid] == rap) + break; + } memset(&node, 0, sizeof node); node.id = wn->id; @@ -5367,8 +5388,10 @@ iwn_ampdu_rx_stop(struct ieee80211com *i node.delba_tid = tid; DPRINTF(sc, IWN_DEBUG_RECV, "DELBA RA=%d TID=%d\n", wn->id, tid); (void)ops->add_node(sc, &node, 1); + sc->sc_ampdu_rx_stop(ni, rap); } +#if 0 /* HT */ /* * This function is called by upper layer when an ADDBA response is received * from another STA. Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun May 8 11:54:38 2011 (r221649) +++ head/sys/dev/iwn/if_iwnvar.h Sun May 8 11:58:23 2011 (r221650) @@ -306,6 +306,11 @@ struct iwn_softc { int sc_tx_timer; + int (*sc_ampdu_rx_start)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *, int, int, int); + void (*sc_ampdu_rx_stop)(struct ieee80211_node *, + struct ieee80211_rx_ampdu *); + struct iwn_rx_radiotap_header sc_rxtap; struct iwn_tx_radiotap_header sc_txtap; }; From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:06:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 049A91065744; Sun, 8 May 2011 12:06:13 +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 EAEA68FC1A; Sun, 8 May 2011 12:06:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48C6CBO045135; Sun, 8 May 2011 12:06:12 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48C6CnJ045131; Sun, 8 May 2011 12:06:12 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081206.p48C6CnJ045131@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 12:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221651 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:06:13 -0000 Author: bschmidt Date: Sun May 8 12:06:12 2011 New Revision: 221651 URL: http://svn.freebsd.org/changeset/base/221651 Log: Add support for TX packet aggregation. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 11:58:23 2011 (r221650) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 12:06:12 2011 (r221651) @@ -172,10 +172,8 @@ static void iwn_rx_phy(struct iwn_softc struct iwn_rx_data *); static void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#if 0 /* HT */ static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#endif static void iwn5000_rx_calib_results(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, @@ -186,6 +184,7 @@ static void iwn5000_tx_done(struct iwn_s struct iwn_rx_data *); static void iwn_tx_done(struct iwn_softc *, struct iwn_rx_desc *, int, uint8_t); +static void iwn_ampdu_tx_done(struct iwn_softc *, int, int, int, void *); static void iwn_cmd_done(struct iwn_softc *, struct iwn_rx_desc *); static void iwn_notif_intr(struct iwn_softc *); static void iwn_wakeup_intr(struct iwn_softc *); @@ -255,20 +254,22 @@ static int iwn_ampdu_rx_start(struct iee struct ieee80211_rx_ampdu *, int, int, int); static void iwn_ampdu_rx_stop(struct ieee80211_node *, struct ieee80211_rx_ampdu *); -#if 0 /* HT */ +static int iwn_addba_request(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); +static int iwn_addba_response(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); static int iwn_ampdu_tx_start(struct ieee80211com *, struct ieee80211_node *, uint8_t); -static void iwn_ampdu_tx_stop(struct ieee80211com *, - struct ieee80211_node *, uint8_t); +static void iwn_ampdu_tx_stop(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); static void iwn4965_ampdu_tx_start(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); -static void iwn4965_ampdu_tx_stop(struct iwn_softc *, + struct ieee80211_node *, int, uint8_t, uint16_t); +static void iwn4965_ampdu_tx_stop(struct iwn_softc *, int, uint8_t, uint16_t); static void iwn5000_ampdu_tx_start(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); -static void iwn5000_ampdu_tx_stop(struct iwn_softc *, + struct ieee80211_node *, int, uint8_t, uint16_t); +static void iwn5000_ampdu_tx_stop(struct iwn_softc *, int, uint8_t, uint16_t); -#endif static int iwn5000_query_calibration(struct iwn_softc *); static int iwn5000_send_calibration(struct iwn_softc *); static int iwn5000_send_wimax_coex(struct iwn_softc *); @@ -657,10 +658,12 @@ iwn_attach(device_t dev) ic->ic_ampdu_rx_start = iwn_ampdu_rx_start; sc->sc_ampdu_rx_stop = ic->ic_ampdu_rx_stop; ic->ic_ampdu_rx_stop = iwn_ampdu_rx_stop; -#if 0 /* HT */ - ic->ic_ampdu_tx_start = iwn_ampdu_tx_start; - ic->ic_ampdu_tx_stop = iwn_ampdu_tx_stop; -#endif + sc->sc_addba_request = ic->ic_addba_request; + ic->ic_addba_request = iwn_addba_request; + sc->sc_addba_response = ic->ic_addba_response; + ic->ic_addba_response = iwn_addba_response; + sc->sc_addba_stop = ic->ic_addba_stop; + ic->ic_addba_stop = iwn_ampdu_tx_stop; ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_updateedca; ic->ic_update_mcast = iwn_update_mcast; @@ -717,11 +720,10 @@ iwn4965_attach(struct iwn_softc *sc, uin ops->set_gains = iwn4965_set_gains; ops->add_node = iwn4965_add_node; ops->tx_done = iwn4965_tx_done; -#if 0 /* HT */ ops->ampdu_tx_start = iwn4965_ampdu_tx_start; ops->ampdu_tx_stop = iwn4965_ampdu_tx_stop; -#endif sc->ntxqs = IWN4965_NTXQUEUES; + sc->firstaggqueue = IWN4965_FIRSTAGGQUEUE; sc->ndmachnls = IWN4965_NDMACHNLS; sc->broadcast_id = IWN4965_ID_BROADCAST; sc->rxonsz = IWN4965_RXONSZ; @@ -756,11 +758,10 @@ iwn5000_attach(struct iwn_softc *sc, uin ops->set_gains = iwn5000_set_gains; ops->add_node = iwn5000_add_node; ops->tx_done = iwn5000_tx_done; -#if 0 /* HT */ ops->ampdu_tx_start = iwn5000_ampdu_tx_start; ops->ampdu_tx_stop = iwn5000_ampdu_tx_stop; -#endif sc->ntxqs = IWN5000_NTXQUEUES; + sc->firstaggqueue = IWN5000_FIRSTAGGQUEUE; sc->ndmachnls = IWN5000_NDMACHNLS; sc->broadcast_id = IWN5000_ID_BROADCAST; sc->rxonsz = IWN5000_RXONSZ; @@ -2447,21 +2448,53 @@ iwn_rx_done(struct iwn_softc *sc, struct IWN_LOCK(sc); } -#if 0 /* HT */ /* Process an incoming Compressed BlockAck. */ static void iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, struct iwn_rx_data *data) { + struct ifnet *ifp = sc->sc_ifp; + struct iwn_node *wn; + struct ieee80211_node *ni; struct iwn_compressed_ba *ba = (struct iwn_compressed_ba *)(desc + 1); struct iwn_tx_ring *txq; + struct ieee80211_tx_ampdu *tap; + uint64_t bitmap; + uint8_t tid; + int ackfailcnt = 0, i, shift; bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - txq = &sc->txq[letoh16(ba->qid)]; - /* XXX TBD */ + txq = &sc->txq[le16toh(ba->qid)]; + tap = sc->qid2tap[le16toh(ba->qid)]; + tid = WME_AC_TO_TID(tap->txa_ac); + ni = tap->txa_ni; + wn = (void *)ni; + + if (wn->agg[tid].bitmap == 0) + return; + + shift = wn->agg[tid].startidx - ((le16toh(ba->seq) >> 4) & 0xff); + if (shift < 0) + shift += 0x100; + + if (wn->agg[tid].nframes > (64 - shift)) + return; + + bitmap = (le64toh(ba->bitmap) >> shift) & wn->agg[tid].bitmap; + for (i = 0; bitmap; i++) { + if ((bitmap & 1) == 0) { + ifp->if_oerrors++; + ieee80211_ratectl_tx_complete(ni->ni_vap, ni, + IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL); + } else { + ifp->if_opackets++; + ieee80211_ratectl_tx_complete(ni->ni_vap, ni, + IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL); + } + bitmap >>= 1; + } } -#endif /* * Process a CALIBRATION_RESULT notification sent by the initialization @@ -2590,7 +2623,11 @@ iwn4965_tx_done(struct iwn_softc *sc, st struct iwn_rx_data *data) { struct iwn4965_tx_stat *stat = (struct iwn4965_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf]; + struct iwn_tx_ring *ring; + int qid; + + qid = desc->qid & 0xf; + ring = &sc->txq[qid]; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n", @@ -2599,7 +2636,13 @@ iwn4965_tx_done(struct iwn_softc *sc, st le32toh(stat->status)); bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - iwn_tx_done(sc, desc, stat->ackfailcnt, le32toh(stat->status) & 0xff); + if (qid >= sc->firstaggqueue) { + iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, + &stat->status); + } else { + iwn_tx_done(sc, desc, stat->ackfailcnt, + le32toh(stat->status) & 0xff); + } } static void @@ -2607,7 +2650,11 @@ iwn5000_tx_done(struct iwn_softc *sc, st struct iwn_rx_data *data) { struct iwn5000_tx_stat *stat = (struct iwn5000_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf]; + struct iwn_tx_ring *ring; + int qid; + + qid = desc->qid & 0xf; + ring = &sc->txq[qid]; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d retries %d nkill %d rate %x duration %d status %x\n", @@ -2621,7 +2668,13 @@ iwn5000_tx_done(struct iwn_softc *sc, st #endif bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - iwn_tx_done(sc, desc, stat->ackfailcnt, le16toh(stat->status) & 0xff); + if (qid >= sc->firstaggqueue) { + iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, + &stat->status); + } else { + iwn_tx_done(sc, desc, stat->ackfailcnt, + le16toh(stat->status) & 0xff); + } } /* @@ -2722,6 +2775,96 @@ iwn_cmd_done(struct iwn_softc *sc, struc wakeup(&ring->desc[desc->idx]); } +static void +iwn_ampdu_tx_done(struct iwn_softc *sc, int qid, int idx, int nframes, + void *stat) +{ + struct ifnet *ifp = sc->sc_ifp; + struct iwn_tx_ring *ring = &sc->txq[qid]; + struct iwn_tx_data *data; + struct mbuf *m; + struct iwn_node *wn; + struct ieee80211_node *ni; + struct ieee80211vap *vap; + struct ieee80211_tx_ampdu *tap; + uint64_t bitmap; + uint32_t *status = stat; + uint16_t *aggstatus = stat; + uint8_t tid; + int bit, i, lastidx, seqno, shift, start; + +#ifdef NOT_YET + if (nframes == 1) { + if ((*status & 0xff) != 1 && (*status & 0xff) != 2) + printf("ieee80211_send_bar()\n"); + } +#endif + + bitmap = 0; + start = idx; + for (i = 0; i < nframes; i++) { + if (le16toh(aggstatus[i * 2]) & 0xc) + continue; + + idx = le16toh(aggstatus[2*i + 1]) & 0xff; + bit = idx - start; + shift = 0; + if (bit >= 64) { + shift = 0x100 - idx + start; + bit = 0; + start = idx; + } else if (bit <= -64) + bit = 0x100 - start + idx; + else if (bit < 0) { + shift = start - idx; + start = idx; + bit = 0; + } + bitmap = bitmap << shift; + bitmap |= 1ULL << bit; + } + tap = sc->qid2tap[qid]; + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + + seqno = le32toh(*(status + nframes)) & 0xfff; + for (lastidx = (seqno & 0xff); ring->read != lastidx;) { + data = &ring->data[ring->read]; + + KASSERT(data->ni != NULL, ("no node")); + + /* Unmap and free mbuf. */ + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(ring->data_dmat, data->map); + m = data->m, data->m = NULL; + ni = data->ni, data->ni = NULL; + vap = ni->ni_vap; + + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 1); + + m_freem(m); + ieee80211_free_node(ni); + + ring->queued--; + ring->read = (ring->read + 1) % IWN_TX_RING_COUNT; + } + + sc->sc_tx_timer = 0; + if (ring->queued < IWN_TX_RING_LOMARK) { + sc->qfullmsk &= ~(1 << ring->qid); + if (sc->qfullmsk == 0 && + (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + iwn_start_locked(ifp); + } + } +} + /* * Process an INT_FH_RX or INT_SW_RX interrupt. */ @@ -2766,12 +2909,10 @@ iwn_notif_intr(struct iwn_softc *sc) iwn_rx_done(sc, desc, data); break; -#if 0 /* HT */ case IWN_RX_COMPRESSED_BA: /* A Compressed BlockAck has been received. */ iwn_rx_compressed_ba(sc, desc, data); break; -#endif case IWN_TX_DONE: /* An 802.11 frame has been transmitted. */ @@ -3151,6 +3292,7 @@ iwn5000_reset_sched(struct iwn_softc *sc static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { + struct iwn_ops *ops = &sc->ops; const struct ieee80211_txparam *tp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; @@ -3186,7 +3328,16 @@ iwn_tx_data(struct iwn_softc *sc, struct } ac = M_WME_GETAC(m); - ring = &sc->txq[ac]; + if (IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) { + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; + + ring = &sc->txq[*(int *)tap->txa_private]; + *(uint16_t *)wh->i_seq = + htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT); + ni->ni_txseqs[tid]++; + } else { + ring = &sc->txq[ac]; + } desc = &ring->desc[ring->cur]; data = &ring->data[ring->cur]; @@ -3390,10 +3541,8 @@ iwn_tx_data(struct iwn_softc *sc, struct bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); -#endif /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3410,6 +3559,7 @@ static int iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { + struct iwn_ops *ops = &sc->ops; struct ifnet *ifp = sc->sc_ifp; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ifp->if_l2com; @@ -3594,10 +3744,8 @@ iwn_tx_data_raw(struct iwn_softc *sc, st bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); -#endif /* Kick TX ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3761,6 +3909,7 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, static int iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int async) { + struct iwn_ops *ops = &sc->ops; struct iwn_tx_ring *ring = &sc->txq[4]; struct iwn_tx_desc *desc; struct iwn_tx_data *data; @@ -3820,10 +3969,8 @@ iwn_cmd(struct iwn_softc *sc, int code, bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); -#ifdef notyet /* Update TX scheduler. */ ops->update_sched(sc, ring->qid, ring->cur, 0, 0); -#endif /* Kick command ring. */ ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; @@ -3874,7 +4021,7 @@ iwn_set_link_quality(struct iwn_softc *s linkq.id = wn->id; linkq.antmsk_1stream = txant; linkq.antmsk_2stream = IWN_ANT_AB; - linkq.ampdu_max = 31; + linkq.ampdu_max = 64; linkq.ampdu_threshold = 3; linkq.ampdu_limit = htole16(4000); /* 4ms */ @@ -5391,7 +5538,56 @@ iwn_ampdu_rx_stop(struct ieee80211_node sc->sc_ampdu_rx_stop(ni, rap); } -#if 0 /* HT */ +static int +iwn_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int dialogtoken, int baparamset, int batimeout) +{ + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int qid; + + for (qid = sc->firstaggqueue; qid < sc->ntxqs; qid++) { + if (sc->qid2tap[qid] == NULL) + break; + } + if (qid == sc->ntxqs) { + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: not free aggregation queue\n", + __func__); + return 0; + } + tap->txa_private = malloc(sizeof(int), M_DEVBUF, M_NOWAIT); + if (tap->txa_private == NULL) { + device_printf(sc->sc_dev, + "%s: failed to alloc TX aggregation structure\n", __func__); + return 0; + } + sc->qid2tap[qid] = tap; + *(int *)tap->txa_private = qid; + return sc->sc_addba_request(ni, tap, dialogtoken, baparamset, + batimeout); +} + +static int +iwn_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, + int code, int baparamset, int batimeout) +{ + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; + int qid = *(int *)tap->txa_private; + uint8_t tid = WME_AC_TO_TID(tap->txa_ac); + int ret; + + if (code == IEEE80211_STATUS_SUCCESS) { + ni->ni_txseqs[tid] = tap->txa_start & 0xfff; + ret = iwn_ampdu_tx_start(ni->ni_ic, ni, tid); + if (ret != 1) + return ret; + } else { + sc->qid2tap[qid] = NULL; + free(tap->txa_private, M_DEVBUF); + tap->txa_private = NULL; + } + return sc->sc_addba_response(ni, tap, code, baparamset, batimeout); +} + /* * This function is called by upper layer when an ADDBA response is received * from another STA. @@ -5400,12 +5596,12 @@ static int iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni, uint8_t tid) { - struct ieee80211_tx_ba *ba = &ni->ni_tx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; + struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[TID_TO_WME_AC(tid)]; + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; struct iwn_node *wn = (void *)ni; struct iwn_node_info node; - int error; + int error, qid; /* Enable TX for the specified RA/TID. */ wn->disable_tid &= ~(1 << tid); @@ -5416,35 +5612,44 @@ iwn_ampdu_tx_start(struct ieee80211com * node.disable_tid = htole16(wn->disable_tid); error = ops->add_node(sc, &node, 1); if (error != 0) - return error; + return 0; if ((error = iwn_nic_lock(sc)) != 0) - return error; - ops->ampdu_tx_start(sc, ni, tid, ba->ba_winstart); + return 0; + qid = *(int *)tap->txa_private; + ops->ampdu_tx_start(sc, ni, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); - return 0; + + iwn_set_link_quality(sc, ni); + return 1; } static void -iwn_ampdu_tx_stop(struct ieee80211com *ic, struct ieee80211_node *ni, - uint8_t tid) +iwn_ampdu_tx_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) { - struct ieee80211_tx_ba *ba = &ni->ni_tx_ba[tid]; - struct iwn_softc *sc = ic->ic_softc; + struct iwn_softc *sc = ni->ni_ic->ic_ifp->if_softc; struct iwn_ops *ops = &sc->ops; + uint8_t tid = WME_AC_TO_TID(tap->txa_ac); + int qid; + + if (tap->txa_private == NULL) + return; + qid = *(int *)tap->txa_private; if (iwn_nic_lock(sc) != 0) return; - ops->ampdu_tx_stop(sc, tid, ba->ba_winstart); + ops->ampdu_tx_stop(sc, qid, tid, tap->txa_start & 0xfff); iwn_nic_unlock(sc); + sc->qid2tap[qid] = NULL; + free(tap->txa_private, M_DEVBUF); + tap->txa_private = NULL; } static void iwn4965_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, - uint8_t tid, uint16_t ssn) + int qid, uint8_t tid, uint16_t ssn) { struct iwn_node *wn = (void *)ni; - int qid = 7 + tid; /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), @@ -5458,6 +5663,7 @@ iwn4965_ampdu_tx_start(struct iwn_softc iwn_prph_setbits(sc, IWN4965_SCHED_QCHAIN_SEL, 1 << qid); /* Set starting sequence number from the ADDBA request. */ + sc->txq[qid].cur = sc->txq[qid].read = (ssn & 0xff); IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, qid << 8 | (ssn & 0xff)); iwn_prph_write(sc, IWN4965_SCHED_QUEUE_RDPTR(qid), ssn); @@ -5478,10 +5684,8 @@ iwn4965_ampdu_tx_start(struct iwn_softc } static void -iwn4965_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) +iwn4965_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { - int qid = 7 + tid; - /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN4965_SCHED_QUEUE_STATUS(qid), IWN4965_TXQ_STATUS_CHGACT); @@ -5500,10 +5704,9 @@ iwn4965_ampdu_tx_stop(struct iwn_softc * static void iwn5000_ampdu_tx_start(struct iwn_softc *sc, struct ieee80211_node *ni, - uint8_t tid, uint16_t ssn) + int qid, uint8_t tid, uint16_t ssn) { struct iwn_node *wn = (void *)ni; - int qid = 10 + tid; /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), @@ -5520,6 +5723,7 @@ iwn5000_ampdu_tx_start(struct iwn_softc iwn_prph_setbits(sc, IWN5000_SCHED_AGGR_SEL, 1 << qid); /* Set starting sequence number from the ADDBA request. */ + sc->txq[qid].cur = sc->txq[qid].read = (ssn & 0xff); IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, qid << 8 | (ssn & 0xff)); iwn_prph_write(sc, IWN5000_SCHED_QUEUE_RDPTR(qid), ssn); @@ -5536,10 +5740,8 @@ iwn5000_ampdu_tx_start(struct iwn_softc } static void -iwn5000_ampdu_tx_stop(struct iwn_softc *sc, uint8_t tid, uint16_t ssn) +iwn5000_ampdu_tx_stop(struct iwn_softc *sc, int qid, uint8_t tid, uint16_t ssn) { - int qid = 10 + tid; - /* Stop TX scheduler while we're changing its configuration. */ iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_CHGACT); @@ -5558,7 +5760,6 @@ iwn5000_ampdu_tx_stop(struct iwn_softc * iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid), IWN5000_TXQ_STATUS_INACTIVE | iwn_tid2fifo[tid]); } -#endif /* * Query calibration tables from the initialization firmware. We do this Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun May 8 11:58:23 2011 (r221650) +++ head/sys/dev/iwn/if_iwnreg.h Sun May 8 12:06:12 2011 (r221651) @@ -27,6 +27,9 @@ #define IWN4965_NTXQUEUES 16 #define IWN5000_NTXQUEUES 20 +#define IWN4965_FIRSTAGGQUEUE 7 +#define IWN5000_FIRSTAGGQUEUE 10 + #define IWN4965_NDMACHNLS 7 #define IWN5000_NDMACHNLS 8 Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Sun May 8 11:58:23 2011 (r221650) +++ head/sys/dev/iwn/if_iwnvar.h Sun May 8 12:06:12 2011 (r221651) @@ -78,6 +78,7 @@ struct iwn_tx_ring { int qid; int queued; int cur; + int read; }; struct iwn_softc; @@ -102,6 +103,11 @@ struct iwn_node { uint16_t disable_tid; uint8_t id; uint32_t ridx[256]; + struct { + uint64_t bitmap; + int startidx; + int nframes; + } agg[IEEE80211_TID_SIZE]; }; struct iwn_calib_state { @@ -174,12 +180,10 @@ struct iwn_ops { int); void (*tx_done)(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -#if 0 /* HT */ void (*ampdu_tx_start)(struct iwn_softc *, - struct ieee80211_node *, uint8_t, uint16_t); - void (*ampdu_tx_stop)(struct iwn_softc *, uint8_t, + struct ieee80211_node *, int, uint8_t, uint16_t); + void (*ampdu_tx_stop)(struct iwn_softc *, int, uint8_t, uint16_t); -#endif }; struct iwn_vap { @@ -215,6 +219,7 @@ struct iwn_softc { const struct iwn_sensitivity_limits *limits; int ntxqs; + int firstaggqueue; int ndmachnls; uint8_t broadcast_id; int rxonsz; @@ -306,10 +311,19 @@ struct iwn_softc { int sc_tx_timer; + struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES]; + int (*sc_ampdu_rx_start)(struct ieee80211_node *, struct ieee80211_rx_ampdu *, int, int, int); void (*sc_ampdu_rx_stop)(struct ieee80211_node *, struct ieee80211_rx_ampdu *); + int (*sc_addba_request)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + int (*sc_addba_response)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *, int, int, int); + void (*sc_addba_stop)(struct ieee80211_node *, + struct ieee80211_tx_ampdu *); + struct iwn_rx_radiotap_header sc_rxtap; struct iwn_tx_radiotap_header sc_txtap; From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:11:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5771E106564A; Sun, 8 May 2011 12:11:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4ADE78FC16; Sun, 8 May 2011 12:11:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CBH1j045325; Sun, 8 May 2011 12:11:17 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CBHgF045323; Sun, 8 May 2011 12:11:17 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081211.p48CBHgF045323@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 12:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221652 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:11:17 -0000 Author: ae Date: Sun May 8 12:11:16 2011 New Revision: 221652 URL: http://svn.freebsd.org/changeset/base/221652 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Sun May 8 12:06:12 2011 (r221651) +++ head/sys/geom/part/g_part_bsd.c Sun May 8 12:11:16 2011 (r221652) @@ -206,7 +206,7 @@ g_part_bsd_create(struct g_part_table *b if (BBSIZE % pp->sectorsize) return (ENOTBLK); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); secpercyl = basetable->gpt_sectors * basetable->gpt_heads; ncyls = msize / secpercyl; @@ -365,7 +365,7 @@ g_part_bsd_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_bsd_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); table->bbarea = g_read_data(cp, 0, BBSIZE, &error); if (table->bbarea == NULL) From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:11:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41FD7106566B; Sun, 8 May 2011 12:11:21 +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 34E618FC17; Sun, 8 May 2011 12:11:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CBL7d045363; Sun, 8 May 2011 12:11:21 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CBLqH045360; Sun, 8 May 2011 12:11:21 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081211.p48CBLqH045360@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 12:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221653 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:11:21 -0000 Author: bschmidt Date: Sun May 8 12:11:20 2011 New Revision: 221653 URL: http://svn.freebsd.org/changeset/base/221653 Log: Notify firmware about various HT parameters once associated. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 12:11:16 2011 (r221652) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 12:11:20 2011 (r221653) @@ -5348,12 +5348,12 @@ iwn_auth(struct iwn_softc *sc, struct ie static int iwn_run(struct iwn_softc *sc, struct ieee80211vap *vap) { -#define MS(v,x) (((v) & x) >> x##_S) struct iwn_ops *ops = &sc->ops; struct ifnet *ifp = sc->sc_ifp; struct ieee80211com *ic = ifp->if_l2com; struct ieee80211_node *ni = vap->iv_bss; struct iwn_node_info node; + uint32_t htflags = 0; int error; if (ic->ic_opmode == IEEE80211_M_MONITOR) { @@ -5389,26 +5389,22 @@ iwn_run(struct iwn_softc *sc, struct iee sc->rxon.cck_mask = 0x0f; sc->rxon.ofdm_mask = 0x15; } -#if 0 /* HT */ if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - sc->rxon.flags &= ~htole32(IWN_RXON_HT); - if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) - sc->rxon.flags |= htole32(IWN_RXON_HT40U); - else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) - sc->rxon.flags |= htole32(IWN_RXON_HT40D); - else - sc->rxon.flags |= htole32(IWN_RXON_HT20); - sc->rxon.rxchain = htole16( - IWN_RXCHAIN_VALID(3) - | IWN_RXCHAIN_MIMO_COUNT(3) - | IWN_RXCHAIN_IDLE_COUNT(1) - | IWN_RXCHAIN_MIMO_FORCE); - - maxrxampdu = MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); - ampdudensity = MS(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); - } else - maxrxampdu = ampdudensity = 0; -#endif + htflags |= IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode); + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + switch (ic->ic_curhtprotmode) { + case IEEE80211_HTINFO_OPMODE_HT20PR: + htflags |= IWN_RXON_HT_MODEPURE40; + break; + default: + htflags |= IWN_RXON_HT_MODEMIXED; + break; + } + } + if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) + htflags |= IWN_RXON_HT_HT40MINUS; + } + sc->rxon.flags |= htole32(htflags); sc->rxon.filter |= htole32(IWN_FILTER_BSS); DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n", sc->rxon.chan, sc->rxon.flags); @@ -5435,10 +5431,20 @@ iwn_run(struct iwn_softc *sc, struct iee memset(&node, 0, sizeof node); IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr); node.id = IWN_ID_BSS; -#ifdef notyet - node.htflags = htole32(IWN_AMDPU_SIZE_FACTOR(3) | - IWN_AMDPU_DENSITY(5)); /* 2us */ -#endif + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { + switch (ni->ni_htcap & IEEE80211_HTCAP_SMPS) { + case IEEE80211_HTCAP_SMPS_ENA: + node.htflags |= htole32(IWN_SMPS_MIMO_DIS); + break; + case IEEE80211_HTCAP_SMPS_DYNAMIC: + node.htflags |= htole32(IWN_SMPS_MIMO_PROT); + break; + } + node.htflags |= htole32(IWN_AMDPU_SIZE_FACTOR(3) | + IWN_AMDPU_DENSITY(5)); /* 4us */ + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) + node.htflags |= htole32(IWN_NODE_HT40); + } DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node\n", __func__); error = ops->add_node(sc, &node, 1); if (error != 0) { @@ -5470,7 +5476,6 @@ iwn_run(struct iwn_softc *sc, struct iee /* Link LED always on while associated. */ iwn_set_led(sc, IWN_LED_LINK, 0, 1); return 0; -#undef MS } /* Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sun May 8 12:11:16 2011 (r221652) +++ head/sys/dev/iwn/if_iwnreg.h Sun May 8 12:11:20 2011 (r221653) @@ -492,6 +492,10 @@ struct iwn_rxon { #define IWN_RXON_ANTENNA_A (1 << 8) #define IWN_RXON_ANTENNA_B (1 << 9) #define IWN_RXON_TSF (1 << 15) +#define IWN_RXON_HT_HT40MINUS (1 << 22) +#define IWN_RXON_HT_PROTMODE(x) (x << 23) +#define IWN_RXON_HT_MODEPURE40 (1 << 25) +#define IWN_RXON_HT_MODEMIXED (2 << 25) #define IWN_RXON_CTS_TO_SELF (1 << 30) uint32_t filter; @@ -591,7 +595,10 @@ struct iwn_node_info { uint8_t txmic[8]; uint32_t htflags; +#define IWN_SMPS_MIMO_PROT (1 << 17) #define IWN_AMDPU_SIZE_FACTOR(x) ((x) << 19) +#define IWN_NODE_HT40 (1 << 21) +#define IWN_SMPS_MIMO_DIS (1 << 22) #define IWN_AMDPU_DENSITY(x) ((x) << 23) uint32_t mask; From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:16:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76457106564A; Sun, 8 May 2011 12:16:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69B468FC08; Sun, 8 May 2011 12:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CGdto045574; Sun, 8 May 2011 12:16:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CGdd5045572; Sun, 8 May 2011 12:16:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081216.p48CGdd5045572@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 12:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221654 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:16:39 -0000 Author: ae Date: Sun May 8 12:16:39 2011 New Revision: 221654 URL: http://svn.freebsd.org/changeset/base/221654 Log: Limit number of sectors that can be addressed. Reject table if blkcount from metadata is greater than provider. Modified: head/sys/geom/part/g_part_apm.c Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Sun May 8 12:11:20 2011 (r221653) +++ head/sys/geom/part/g_part_apm.c Sun May 8 12:16:39 2011 (r221654) @@ -255,7 +255,7 @@ g_part_apm_create(struct g_part_table *b return (ENOSPC); /* APM uses 32-bit LBAs. */ - last = MIN(pp->mediasize / pp->sectorsize, 0xffffffff) - 1; + last = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX) - 1; basetable->gpt_first = 2 + basetable->gpt_entries; basetable->gpt_last = last; @@ -398,6 +398,8 @@ g_part_apm_probe(struct g_part_table *ba g_free(buf); if (table->ddr.ddr_blksize != pp->sectorsize) return (ENXIO); + if (table->ddr.ddr_blkcount > pp->mediasize / pp->sectorsize) + return (ENXIO); } else { /* * Check for Tivo drives, which have no DDR and a different @@ -412,7 +414,8 @@ g_part_apm_probe(struct g_part_table *ba } table->ddr.ddr_sig = APM_DDR_SIG; /* XXX */ table->ddr.ddr_blksize = pp->sectorsize; /* XXX */ - table->ddr.ddr_blkcount = pp->mediasize / pp->sectorsize;/* XXX */ + table->ddr.ddr_blkcount = + MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); table->tivo_series1 = 1; g_free(buf); } From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:16:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F275106566C; Sun, 8 May 2011 12:16:39 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A288FC0A; Sun, 8 May 2011 12:16:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CGdem045578; Sun, 8 May 2011 12:16:39 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CGdw3045576; Sun, 8 May 2011 12:16:39 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201105081216.p48CGdw3045576@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 8 May 2011 12:16:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221655 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:16:39 -0000 Author: bcr (doc committer) Date: Sun May 8 12:16:39 2011 New Revision: 221655 URL: http://svn.freebsd.org/changeset/base/221655 Log: Jails have a problem in that if the jail directory is world-readable, an attacker with root access to the jail can create a setuid binary for their own use in the host environment (if they also have this access), thus breaking root in the host. This exploit is impossible if the jail's files are not world-readable. Add instructions to the man page on how to create a jail with the correct permissions set. PR: docs/156853 Submitted by: Chris Rees (utisoft at gmail dot com) Reviewed by: cperciva (security parts) MFC after: 9 days Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun May 8 12:16:39 2011 (r221654) +++ head/usr.sbin/jail/jail.8 Sun May 8 12:16:39 2011 (r221655) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 17, 2010 +.Dd May 8, 2011 .Dt JAIL 8 .Os .Sh NAME @@ -431,7 +431,7 @@ command script can be used: .Bd -literal D=/here/is/the/jail cd /usr/src -mkdir -p $D +mkdir -p -m 0700 $D make world DESTDIR=$D make distribution DESTDIR=$D mount -t devfs devfs $D/dev @@ -448,6 +448,10 @@ in the per-jail devfs. A simple devfs ruleset for jails is available as ruleset #4 in .Pa /etc/defaults/devfs.rules . .Pp +Non-superusers in the host system should not be able to access the +jail's files; otherwise an attacker with root access to the jail +could obtain elevated privileges on the host. +.Pp In many cases this example would put far more in the jail than needed. In the other extreme case a jail might contain only one file: the executable to be run in the jail. From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:20:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E8F1065670; Sun, 8 May 2011 12:20:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C44E8FC08; Sun, 8 May 2011 12:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CKUix045737; Sun, 8 May 2011 12:20:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CKUv5045735; Sun, 8 May 2011 12:20:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081220.p48CKUv5045735@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 12:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221656 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:20:30 -0000 Author: ae Date: Sun May 8 12:20:30 2011 New Revision: 221656 URL: http://svn.freebsd.org/changeset/base/221656 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_ebr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Sun May 8 12:16:39 2011 (r221655) +++ head/sys/geom/part/g_part_ebr.c Sun May 8 12:20:30 2011 (r221656) @@ -288,7 +288,7 @@ g_part_ebr_create(struct g_part_table *b if (strcmp(psn, "MBR")) return (ENXIO); - msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff); + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); msize -= msize % basetable->gpt_sectors; basetable->gpt_first = 0; basetable->gpt_last = msize - 1; @@ -464,7 +464,7 @@ g_part_ebr_read(struct g_part_table *bas pp = cp->provider; table = (struct g_part_ebr_table *)basetable; - msize = pp->mediasize / pp->sectorsize; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); lba = 0; while (1) { From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:23:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 864861065673; Sun, 8 May 2011 12:23:01 +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 5F4D68FC15; Sun, 8 May 2011 12:23:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CN11L045862; Sun, 8 May 2011 12:23:01 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CN1Qm045860; Sun, 8 May 2011 12:23:01 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201105081223.p48CN1Qm045860@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 8 May 2011 12:23:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221657 - head/sys/dev/iwn X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:23:01 -0000 Author: bschmidt Date: Sun May 8 12:23:01 2011 New Revision: 221657 URL: http://svn.freebsd.org/changeset/base/221657 Log: Enable 11n (sans HT40) support. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun May 8 12:20:30 2011 (r221656) +++ head/sys/dev/iwn/if_iwn.c Sun May 8 12:23:01 2011 (r221657) @@ -599,45 +599,30 @@ iwn_attach(device_t dev) macaddr, ":"); } -#if 0 /* HT */ - /* XXX disable until HT channel setup works */ - ic->ic_htcaps = - IEEE80211_HTCAP_SMPS_ENA /* SM PS mode enabled */ - | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width */ - | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ - | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ - | IEEE80211_HTCAP_RXSTBC_2STREAM/* 1-2 spatial streams */ - | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ - /* s/w capabilities */ - | IEEE80211_HTC_HT /* HT operation */ - | IEEE80211_HTC_AMPDU /* tx A-MPDU */ - | IEEE80211_HTC_AMSDU /* tx A-MSDU */ - ; - - /* Set HT capabilities. */ - ic->ic_htcaps = + if (sc->sc_flags & IWN_FLAG_HAS_11N) { + ic->ic_rxstream = sc->nrxchains; + ic->ic_txstream = sc->ntxchains; + ic->ic_htcaps = + IEEE80211_HTCAP_SMPS_OFF /* SMPS mode disabled */ + | IEEE80211_HTCAP_SHORTGI20 /* short GI in 20MHz */ +#ifdef notyet + | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width*/ + | IEEE80211_HTCAP_SHORTGI40 /* short GI in 40MHz */ + | IEEE80211_HTCAP_GREENFIELD #if IWN_RBUF_SIZE == 8192 - IEEE80211_HTCAP_AMSDU7935 | + | IEEE80211_HTCAP_MAXAMSDU_7935 /* max A-MSDU length */ +#else + | IEEE80211_HTCAP_MAXAMSDU_3839 /* max A-MSDU length */ #endif - IEEE80211_HTCAP_CBW20_40 | - IEEE80211_HTCAP_SGI20 | - IEEE80211_HTCAP_SGI40; - if (sc->hw_type != IWN_HW_REV_TYPE_4965) - ic->ic_htcaps |= IEEE80211_HTCAP_GF; - if (sc->hw_type == IWN_HW_REV_TYPE_6050) - ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DYN; - else - ic->ic_htcaps |= IEEE80211_HTCAP_SMPS_DIS; #endif - -#if 0 /* HT */ - /* Set supported HT rates. */ - ic->ic_sup_mcs[0] = 0xff; - if (sc->nrxchains > 1) - ic->ic_sup_mcs[1] = 0xff; - if (sc->nrxchains > 2) - ic->ic_sup_mcs[2] = 0xff; + /* s/w capabilities */ + | IEEE80211_HTC_HT /* HT operation */ + | IEEE80211_HTC_AMPDU /* tx A-MPDU */ +#ifdef notyet + | IEEE80211_HTC_AMSDU /* tx A-MSDU */ #endif + ; + } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_softc = sc; From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:28:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FA71065672; Sun, 8 May 2011 12:28:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC8F38FC18; Sun, 8 May 2011 12:28:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CSDo7046103; Sun, 8 May 2011 12:28:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CSDmp046101; Sun, 8 May 2011 12:28:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105081228.p48CSDmp046101@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 8 May 2011 12:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221658 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:28:14 -0000 Author: ae Date: Sun May 8 12:28:13 2011 New Revision: 221658 URL: http://svn.freebsd.org/changeset/base/221658 Log: Limit number of sectors that can be addressed. MFC after: 1 week Modified: head/sys/geom/part/g_part_vtoc8.c Modified: head/sys/geom/part/g_part_vtoc8.c ============================================================================== --- head/sys/geom/part/g_part_vtoc8.c Sun May 8 12:23:01 2011 (r221657) +++ head/sys/geom/part/g_part_vtoc8.c Sun May 8 12:28:13 2011 (r221658) @@ -198,9 +198,7 @@ g_part_vtoc8_create(struct g_part_table table = (struct g_part_vtoc8_table *)basetable; - msize = pp->mediasize / pp->sectorsize; - if (msize > 0xffffffffu) - msize = 0xffffffffu; + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); table->secpercyl = basetable->gpt_sectors * basetable->gpt_heads; pcyls = msize / table->secpercyl; acyls = 2; @@ -392,8 +390,7 @@ g_part_vtoc8_read(struct g_part_table *b bcopy(buf, &table->vtoc, sizeof(table->vtoc)); g_free(buf); - msize = pp->mediasize / pp->sectorsize; - + msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); sectors = be16dec(&table->vtoc.nsecs); if (sectors < 1) goto invalid_label; From owner-svn-src-head@FreeBSD.ORG Sun May 8 12:34:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B0FA106564A; Sun, 8 May 2011 12:34:32 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 137498FC12; Sun, 8 May 2011 12:34:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48CYVlU046322; Sun, 8 May 2011 12:34:31 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48CYVSl046318; Sun, 8 May 2011 12:34:31 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201105081234.p48CYVSl046318@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 8 May 2011 12:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221659 - in head/sbin: dumpfs growfs tunefs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 12:34:32 -0000 Author: gavin Date: Sun May 8 12:34:31 2011 New Revision: 221659 URL: http://svn.freebsd.org/changeset/base/221659 Log: We now have multiple filesystems (UFS, ZFS, ...), so for tools that only operate on one type of filesystem, mention this. While here, capitalise the use of "UFS" in growfs.8 to match other uses of the term in other man pages. MFC after: 1 week Modified: head/sbin/dumpfs/dumpfs.8 head/sbin/growfs/growfs.8 head/sbin/tunefs/tunefs.8 Modified: head/sbin/dumpfs/dumpfs.8 ============================================================================== --- head/sbin/dumpfs/dumpfs.8 Sun May 8 12:28:13 2011 (r221658) +++ head/sbin/dumpfs/dumpfs.8 Sun May 8 12:34:31 2011 (r221659) @@ -28,12 +28,12 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd May 8, 2011 .Dt DUMPFS 8 .Os .Sh NAME .Nm dumpfs -.Nd dump file system information +.Nd dump UFS file system information .Sh SYNOPSIS .Nm .Op Fl f @@ -42,7 +42,7 @@ .Sh DESCRIPTION The .Nm -utility prints out the super block and cylinder group information +utility prints out the UFS super block and cylinder group information for the file system or special device specified, unless the .Fl f or Modified: head/sbin/growfs/growfs.8 ============================================================================== --- head/sbin/growfs/growfs.8 Sun May 8 12:28:13 2011 (r221658) +++ head/sbin/growfs/growfs.8 Sun May 8 12:34:31 2011 (r221659) @@ -37,12 +37,12 @@ .\" $TSHeader: src/sbin/growfs/growfs.8,v 1.3 2000/12/12 19:31:00 tomsoft Exp $ .\" $FreeBSD$ .\" -.Dd September 8, 2000 +.Dd May 8, 2011 .Dt GROWFS 8 .Os .Sh NAME .Nm growfs -.Nd grow size of an existing ufs file system +.Nd grow size of an existing UFS file system .Sh SYNOPSIS .Nm .Op Fl Ny Modified: head/sbin/tunefs/tunefs.8 ============================================================================== --- head/sbin/tunefs/tunefs.8 Sun May 8 12:28:13 2011 (r221658) +++ head/sbin/tunefs/tunefs.8 Sun May 8 12:34:31 2011 (r221659) @@ -28,12 +28,12 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 9, 2010 +.Dd May 8, 2011 .Dt TUNEFS 8 .Os .Sh NAME .Nm tunefs -.Nd tune up an existing file system +.Nd tune up an existing UFS file system .Sh SYNOPSIS .Nm .Op Fl A @@ -56,7 +56,7 @@ .Sh DESCRIPTION The .Nm -utility is designed to change the dynamic parameters of a file system +utility is designed to change the dynamic parameters of a UFS file system which affect the layout policies. The .Nm From owner-svn-src-head@FreeBSD.ORG Sun May 8 13:17:25 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF242106566B; Sun, 8 May 2011 13:17:25 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 6990F8FC15; Sun, 8 May 2011 13:17:24 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id p48CosSi062038; Sun, 8 May 2011 14:50:55 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4DC691AE.701@FreeBSD.org> Date: Sun, 08 May 2011 14:50:54 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Attilio Rao References: <201105062043.p46Kh2Vs065320@svn.freebsd.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------020806010604040907000603" X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Nathan Whitehorn , andreast@FreeBSD.org Subject: Re: svn commit: r221550 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 13:17:25 -0000 This is a multi-part message in MIME format. --------------020806010604040907000603 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 08.05.11 00:17, Attilio Rao wrote: > 2011/5/6 Attilio Rao: >> 2011/5/6 Nathan Whitehorn: >>> Author: nwhitehorn >>> Date: Fri May 6 20:43:02 2011 >>> New Revision: 221550 >>> URL: http://svn.freebsd.org/changeset/base/221550 >>> >>> Log: >>> SMP has worked perfectly for a very long time on 32-bit PowerPC on both >>> UP and SMP hardware. Enable it in GENERIC. >>> >> >> While working on largeSMP, I think there is a breakage in atomic.h. >> More specifically, atomic_store_rel_long() (and related functions) are >> not going to properly work because powerpc defines them as: >> >> atomic_store_rel_long -> atomic_store_rel_32(volatile u_int *p, u_int v) >> >> while this should really follow the long arguments. >> >> This happens because powerpc doesn't follow the other architectures >> semantic on defining the "similar" atomic operations. >> Other arches define an hardcode version of _type version of the >> function and than make a macro the _32 (or whatever) version. >> In other words this is what they do: >> >> void >> atomic_store_rel_32() >> { >> ... >> } >> >> #define atomic_store_rel_int atomic_store_rel_32 >> >> which si clearly dangerous for cases as reported above. Maybe that >> could be fixed by passing sized types, rather than simply int or long >> in numbered version, but I'd really prefer to follow the semantic by >> other architectures and then have: >> >> void >> atomic_store_rel_int() >> { >> ... >> } >> >> #define atomic_store_rel_32 atomic_store_rel_int >> >> I fixed the ATOMIC_STORE_LOAD case in my code, because I needed it, >> but the final cleanup is much bigger. >> I can make a patch tomorrow if you can test it. >> > > Can you please test and review this patch?: > http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc.diff > > Unfortunately I'm having issues with the toolchains in atm, so I can't > really neither test compile it. I built kernel and world on both, on a 32-bit system and on a 64-bit system with 32-bit compat support. The 32-bit world failed due to type punning issues from umtx.h:121ff Attached my try to workaround these issues. With my try I can build both, kernel and world. Right now I have a world running with it (32-bit). I do not know if my try is correct. Even less after reading the comments from Bruce. But I think if it is on a somehow correct way, then we need something similar for the other _long functions on 32-bit where we go from the u_long to u_int. (e.g, atomic_add_long etc.) I'm ready for more testing. Gruss, Andreas --------------020806010604040907000603 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="atomic_ppc-1.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="atomic_ppc-1.diff" LS0tIGF0b21pYy5oLmF0dGlsaW8JMjAxMS0wNS0wOCAxMTowMDo0Mi4wMDAwMDAwMDAgKzAy MDAKKysrIGF0b21pYy5oLmFuZHJlYXMJMjAxMS0wNS0wOCAxNDowMTowMC4wMDAwMDAwMDAg KzAyMDAKQEAgLTY1MSwxNiArNjUxLDI3IEBACiAjZGVmaW5lCWF0b21pY19jbXBzZXRfcmVs X3B0cihkc3QsIG9sZCwgbmV3KQkJCQlcCiAJYXRvbWljX2NtcHNldF9yZWxfbG9uZygodm9s YXRpbGUgdV9sb25nICopKGRzdCksICh1X2xvbmcpKG9sZCksCVwKIAkgICAgKHVfbG9uZyko bmV3KSkKLSNlbHNlCi0jZGVmaW5lCWF0b21pY19jbXBzZXRfbG9uZyhkc3QsIG9sZCwgbmV3 KQkJCQlcCi0JYXRvbWljX2NtcHNldF9pbnQoKHZvbGF0aWxlIHVfaW50ICopKGRzdCksICh1 X2ludCkob2xkKSwJXAotCSAgICAodV9pbnQpKG5ldykpCi0jZGVmaW5lCWF0b21pY19jbXBz ZXRfYWNxX2xvbmcoZHN0LCBvbGQsIG5ldykJCQkJXAotCWF0b21pY19jbXBzZXRfYWNxX2lu dCgodm9sYXRpbGUgdV9pbnQgKikoZHN0KSwgKHVfaW50KShvbGQpLAlcCi0JICAgICh1X2lu dCkobmV3KSkKLSNkZWZpbmUJYXRvbWljX2NtcHNldF9yZWxfbG9uZyhkc3QsIG9sZCwgbmV3 KQkJCQlcCi0JYXRvbWljX2NtcHNldF9yZWxfaW50KCh2b2xhdGlsZSB1X2ludCAqKShkc3Qp LCAodV9pbnQpKG9sZCksCVwKLQkgICAgKHVfaW50KShuZXcpKQorI2Vsc2UgIC8qIF9fcG93 ZXJwYzY0X18gICovCitzdGF0aWMgX19pbmxpbmUgaW50CithdG9taWNfY21wc2V0X2xvbmco dm9sYXRpbGUgdV9sb25nICpkc3QsIHVfbG9uZyBvbGQsIHVfbG9uZyBuZXcpCit7CisJcmV0 dXJuIChhdG9taWNfY21wc2V0X2ludCgodm9sYXRpbGUgdV9pbnQgKilkc3QsICh1X2ludClv bGQsIAorCQkJCSAgKHVfaW50KW5ldykpOworfQorCitzdGF0aWMgX19pbmxpbmUgaW50Cith dG9taWNfY21wc2V0X2FjcV9sb25nKHZvbGF0aWxlIHVfbG9uZyAqZHN0LCB1X2xvbmcgb2xk LCB1X2xvbmcgbmV3KQoreworCXJldHVybiAoYXRvbWljX2NtcHNldF9hY3FfaW50KCh2b2xh dGlsZSB1X2ludCAqKWRzdCwgKHVfaW50KW9sZCwgCisJCQkJICAgICAgKHVfaW50KW5ldykp OworfQorCitzdGF0aWMgX19pbmxpbmUgaW50CithdG9taWNfY21wc2V0X3JlbF9sb25nKHZv bGF0aWxlIHVfbG9uZyAqZHN0LCB1X2xvbmcgb2xkLCB1X2xvbmcgbmV3KQoreworCXJldHVy biAoYXRvbWljX2NtcHNldF9yZWxfaW50KCh2b2xhdGlsZSB1X2ludCAqKWRzdCwgKHVfaW50 KW9sZCwgCisJCQkJICAgICAgKHVfaW50KW5ldykpOworfQogCiAjZGVmaW5lCWF0b21pY19j bXBzZXRfcHRyKGRzdCwgb2xkLCBuZXcpCQkJCVwKIAlhdG9taWNfY21wc2V0X2ludCgodm9s YXRpbGUgdV9pbnQgKikoZHN0KSwgKHVfaW50KShvbGQpLAlcCkBAIC02NzEsNyArNjgyLDcg QEAKICNkZWZpbmUJYXRvbWljX2NtcHNldF9yZWxfcHRyKGRzdCwgb2xkLCBuZXcpCQkJCVwK IAlhdG9taWNfY21wc2V0X3JlbF9pbnQoKHZvbGF0aWxlIHVfaW50ICopKGRzdCksICh1X2lu dCkob2xkKSwJXAogCSAgICAodV9pbnQpKG5ldykpCi0jZW5kaWYKKyNlbmRpZiAgLyogX19w b3dlcnBjNjRfXyAgKi8KIAogc3RhdGljIF9faW5saW5lIHVfaW50CiBhdG9taWNfZmV0Y2hh ZGRfaW50KHZvbGF0aWxlIHVfaW50ICpwLCB1X2ludCB2KQo= --------------020806010604040907000603-- From owner-svn-src-head@FreeBSD.ORG Sun May 8 13:21:49 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32ED7106564A; Sun, 8 May 2011 13:21:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id C57E58FC16; Sun, 8 May 2011 13:21:48 +0000 (UTC) Received: from c122-106-155-58.carlnfd1.nsw.optusnet.com.au (c122-106-155-58.carlnfd1.nsw.optusnet.com.au [122.106.155.58]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p48DLjYm004537 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 May 2011 23:21:46 +1000 Date: Sun, 8 May 2011 23:21:45 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20110508113451.GY48734@deviant.kiev.zoral.com.ua> Message-ID: <20110508230559.Y1726@besplex.bde.org> References: <201105081120.p48BKRB7043544@svn.freebsd.org> <20110508113451.GY48734@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, "Andrey V. Elsukov" , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221645 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 13:21:49 -0000 On Sun, 8 May 2011, Kostik Belousov wrote: > On Sun, May 08, 2011 at 11:20:27AM +0000, Andrey V. Elsukov wrote: >> Log: >> Limit number of sectors that can be addressed. >> >> MFC after: 1 week >> >> Modified: >> head/sys/geom/part/g_part_pc98.c >> >> Modified: head/sys/geom/part/g_part_pc98.c >> ============================================================================== >> --- head/sys/geom/part/g_part_pc98.c Sun May 8 11:16:17 2011 (r221644) >> +++ head/sys/geom/part/g_part_pc98.c Sun May 8 11:20:27 2011 (r221645) >> @@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table * >> >> cyl = basetable->gpt_heads * basetable->gpt_sectors; >> >> - msize = MIN(pp->mediasize / SECSIZE, 0xffffffff); >> + msize = MIN(pp->mediasize / SECSIZE, UINT_MAX); > Shouldn't this be UINT32_MAX (consistently) ? It was that before. This was correct, since msize has type uint32_t. Hard-coding the 0xffffffff for the limit is no different than hard-coding 32 for the type name or limit. Use of MIN() in the kernel is a style bug. MIN() in the kernel was removed in 4.4BSD, but came back to support contrib'ed code and is now used in non-contribed- code :-(. Here min() could be used, but is fragile. There is no min32() or what there should be -- a type-generic safe macro min(). Use of the unsafe macro MIN() gives different fragility than use of the non-type-generic but safe (non-macro) min(). This style bug is not present in the top-level geom directory, but is common in subdirectories (66 instances). Bruce From owner-svn-src-head@FreeBSD.ORG Sun May 8 14:03:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4626106564A; Sun, 8 May 2011 14:03:44 +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 C73068FC13; Sun, 8 May 2011 14:03:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48E3iRF049336; Sun, 8 May 2011 14:03:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48E3it6049334; Sun, 8 May 2011 14:03:44 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105081403.p48E3it6049334@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 8 May 2011 14:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221660 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 14:03:44 -0000 Author: jilles Date: Sun May 8 14:03:44 2011 New Revision: 221660 URL: http://svn.freebsd.org/changeset/base/221660 Log: sh(1): Update BUGS section for UTF-8 support. Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun May 8 12:34:31 2011 (r221659) +++ head/bin/sh/sh.1 Sun May 8 14:03:44 2011 (r221660) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd May 5, 2011 +.Dd May 8, 2011 .Dt SH 1 .Os .Sh NAME @@ -2591,4 +2591,9 @@ was originally written by .Sh BUGS The .Nm -utility does not recognize multibyte characters. +utility does not recognize multibyte characters other than UTF-8. +Splitting using +.Va IFS +and the line editing library +.Xr editline 3 +do not recognize multibyte characters. From owner-svn-src-head@FreeBSD.ORG Sun May 8 14:57:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D84F6106566C; Sun, 8 May 2011 14:57:01 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB0198FC0A; Sun, 8 May 2011 14:57:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48Ev1Pw051187; Sun, 8 May 2011 14:57:01 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48Ev1OA051185; Sun, 8 May 2011 14:57:01 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <201105081457.p48Ev1OA051185@svn.freebsd.org> From: Benedict Reuschling Date: Sun, 8 May 2011 14:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221665 - head/usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 14:57:01 -0000 Author: bcr (doc committer) Date: Sun May 8 14:57:01 2011 New Revision: 221665 URL: http://svn.freebsd.org/changeset/base/221665 Log: Revert r221655: Various people voiced their concerns about these changes. Until this is resolved, we should use the old version. Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun May 8 14:56:02 2011 (r221664) +++ head/usr.sbin/jail/jail.8 Sun May 8 14:57:01 2011 (r221665) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2011 +.Dd January 17, 2010 .Dt JAIL 8 .Os .Sh NAME @@ -431,7 +431,7 @@ command script can be used: .Bd -literal D=/here/is/the/jail cd /usr/src -mkdir -p -m 0700 $D +mkdir -p $D make world DESTDIR=$D make distribution DESTDIR=$D mount -t devfs devfs $D/dev @@ -448,10 +448,6 @@ in the per-jail devfs. A simple devfs ruleset for jails is available as ruleset #4 in .Pa /etc/defaults/devfs.rules . .Pp -Non-superusers in the host system should not be able to access the -jail's files; otherwise an attacker with root access to the jail -could obtain elevated privileges on the host. -.Pp In many cases this example would put far more in the jail than needed. In the other extreme case a jail might contain only one file: the executable to be run in the jail. From owner-svn-src-head@FreeBSD.ORG Sun May 8 15:25:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D50D1065670; Sun, 8 May 2011 15:25:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3C388FC15; Sun, 8 May 2011 15:25:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48FPMQf052092; Sun, 8 May 2011 15:25:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48FPMp9052090; Sun, 8 May 2011 15:25:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105081525.p48FPMp9052090@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 15:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221666 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 15:25:23 -0000 Author: adrian Date: Sun May 8 15:25:22 2011 New Revision: 221666 URL: http://svn.freebsd.org/changeset/base/221666 Log: * Add AR_SREV_KITE macro for later use * Modify AR_SREV_MERLIN_20() to match the Atheros/Linux ath9k behaviour - its supposed to match Merlin 2.0 and later Merlin chips. AR_SREV_MERLIN_20_OR_LATER() matches AR9280 2.0 and later chips (AR9285, AR9287, etc.) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sun May 8 14:57:01 2011 (r221665) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sun May 8 15:25:22 2011 (r221666) @@ -701,7 +701,7 @@ #define AR_SREV_MERLIN_20(_ah) \ (AR_SREV_MERLIN(_ah) && \ - AH_PRIVATE((_ah))->ah_macRev == AR_XSREV_REVISION_MERLIN_20) + AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_MERLIN_20) #define AR_SREV_MERLIN_20_OR_LATER(_ah) \ ((AH_PRIVATE((_ah))->ah_macVersion > AR_XSREV_VERSION_MERLIN) || \ @@ -741,5 +741,6 @@ /* Not yet implemented chips */ #define AR_SREV_9271(_ah) 0 #define AR_SREV_9287_11_OR_LATER(_ah) 0 +#define AR_SREV_KIWI_10_OR_LATER(_ah) 0 #endif /* _DEV_ATH_AR5416REG_H */ From owner-svn-src-head@FreeBSD.ORG Sun May 8 15:55:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E54D106566C; Sun, 8 May 2011 15:55:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 053D18FC08; Sun, 8 May 2011 15:55:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48FtqTe053021; Sun, 8 May 2011 15:55:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48FtqWR053018; Sun, 8 May 2011 15:55:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105081555.p48FtqWR053018@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 May 2011 15:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221667 - in head/sys/dev/ath/ath_hal: . ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 15:55:53 -0000 Author: adrian Date: Sun May 8 15:55:52 2011 New Revision: 221667 URL: http://svn.freebsd.org/changeset/base/221667 Log: Fix the 5ghz fast clock logic. The macro which I incorrectly copied into ah_internal.h assumed that it'd be called with an AR_SREV_MERLIN_20() check to ensure it was only enabled for Merlin (AR9280) silicon revision 2.0 or later. Trouble is, the 5GHz fast clock EEPROM flag is only valid for EEPROM revision 16 or greater; it's assumed to be enabled by default for Merlin rev >= 2.0. This meant it'd be incorrectly set for AR5416 and AR9160 in 5GHz mode. This would have affected non-default clock timings such as SIFS, ACK and slot time. The incorrect slot time was very likely wrong for 5ghz mode. Modified: head/sys/dev/ath/ath_hal/ah_internal.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sun May 8 15:25:22 2011 (r221666) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sun May 8 15:55:52 2011 (r221667) @@ -205,7 +205,8 @@ typedef struct { halMbssidAggrSupport : 1, halBssidMatchSupport : 1, hal4kbSplitTransSupport : 1, - halHasRxSelfLinkedTail : 1; + halHasRxSelfLinkedTail : 1, + halSupportsFastClock5GHz : 1; /* Hardware supports 5ghz fast clock; check eeprom/channel before using */ uint32_t halWirelessModes; uint16_t halTotalQueues; uint16_t halKeyCacheSize; @@ -807,10 +808,21 @@ extern HAL_BOOL ath_ee_FillVpdTable(uint extern int16_t ath_ee_interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight); -/* Whether 5ghz fast clock is needed for Merlin and later */ +/* Whether 5ghz fast clock is needed */ +/* + * The chipset (Merlin, AR9300/later) should set the capability flag below; + * this flag simply says that the hardware can do it, not that the EEPROM + * says it can. + * + * Merlin 2.0/2.1 chips with an EEPROM version > 16 do 5ghz fast clock + * if the relevant eeprom flag is set. + * Merlin 2.0/2.1 chips with an EEPROM version <= 16 do 5ghz fast clock + * by default. + */ #define IS_5GHZ_FAST_CLOCK_EN(_ah, _c) \ (IEEE80211_IS_CHAN_5GHZ(_c) && \ - ath_hal_eepromGetFlag(ah, AR_EEP_FSTCLK_5G)) + AH_PRIVATE((_ah))->ah_caps.halSupportsFastClock5GHz && \ + ath_hal_eepromGetFlag((_ah), AR_EEP_FSTCLK_5G)) #endif /* _ATH_AH_INTERAL_H_ */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sun May 8 15:25:22 2011 (r221666) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sun May 8 15:55:52 2011 (r221667) @@ -787,8 +787,14 @@ ar9280FillCapabilityInfo(struct ath_hal pCap->halMbssidAggrSupport = AH_TRUE; pCap->hal4AddrAggrSupport = AH_TRUE; - if (AR_SREV_MERLIN_20_OR_LATER(ah)) + if (AR_SREV_MERLIN_20(ah)) { pCap->halPSPollBroken = AH_FALSE; + /* + * This just enables the support; it doesn't + * state 5ghz fast clock will always be used. + */ + pCap->halSupportsFastClock5GHz = AH_TRUE; + } pCap->halRxStbcSupport = 1; pCap->halTxStbcSupport = 1; From owner-svn-src-head@FreeBSD.ORG Sun May 8 16:15:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16301106566B; Sun, 8 May 2011 16:15:51 +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 07B898FC13; Sun, 8 May 2011 16:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48GFoKp053637; Sun, 8 May 2011 16:15:50 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48GFo5V053634; Sun, 8 May 2011 16:15:50 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105081615.p48GFo5V053634@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 8 May 2011 16:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221668 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 16:15:51 -0000 Author: jilles Date: Sun May 8 16:15:50 2011 New Revision: 221668 URL: http://svn.freebsd.org/changeset/base/221668 Log: sh: Optimize variable code by storing the length of the name. Obtained from: NetBSD Modified: head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun May 8 15:55:52 2011 (r221667) +++ head/bin/sh/var.c Sun May 8 16:15:50 2011 (r221668) @@ -136,8 +136,8 @@ static const int locale_categories[7] = LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, LC_MESSAGES, 0 }; -static struct var **hashvar(const char *); static int varequal(const char *, const char *); +static struct var *find_var(const char *, struct var ***, int *); static int localevar(const char *); /* @@ -174,20 +174,18 @@ initvar(void) struct var **vpp; for (ip = varinit ; (vp = ip->var) != NULL ; ip++) { - if ((vp->flags & VEXPORT) == 0) { - vpp = hashvar(ip->text); - vp->next = *vpp; - *vpp = vp; - vp->text = __DECONST(char *, ip->text); - vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED; - vp->func = ip->func; - } + if (find_var(ip->text, &vpp, &vp->name_len) != NULL) + continue; + vp->next = *vpp; + *vpp = vp; + vp->text = __DECONST(char *, ip->text); + vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED; + vp->func = ip->func; } /* * PS1 depends on uid */ - if ((vps1.flags & VEXPORT) == 0) { - vpp = hashvar("PS1="); + if (find_var("PS1", &vpp, &vps1.name_len) == NULL) { vps1.next = *vpp; *vpp = &vps1; vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# "); @@ -323,50 +321,46 @@ void setvareq(char *s, int flags) { struct var *vp, **vpp; - int len; + int nlen; if (aflag) flags |= VEXPORT; - vpp = hashvar(s); - for (vp = *vpp ; vp ; vp = vp->next) { - if (varequal(s, vp->text)) { - if (vp->flags & VREADONLY) { - len = strchr(s, '=') - s; - error("%.*s: is read only", len, s); - } - if (flags & VNOSET) - return; - INTOFF; + vp = find_var(s, &vpp, &nlen); + if (vp != NULL) { + if (vp->flags & VREADONLY) + error("%.*s: is read only", vp->name_len, s); + if (flags & VNOSET) + return; + INTOFF; - if (vp->func && (flags & VNOFUNC) == 0) - (*vp->func)(strchr(s, '=') + 1); + if (vp->func && (flags & VNOFUNC) == 0) + (*vp->func)(s + vp->name_len + 1); - if ((vp->flags & (VTEXTFIXED|VSTACK)) == 0) - ckfree(vp->text); + if ((vp->flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(vp->text); - vp->flags &= ~(VTEXTFIXED|VSTACK|VUNSET); - vp->flags |= flags; - vp->text = s; - - /* - * We could roll this to a function, to handle it as - * a regular variable function callback, but why bother? - * - * Note: this assumes iflag is not set to 1 initially. - * As part of init(), this is called before arguments - * are looked at. - */ - if ((vp == &vmpath || (vp == &vmail && ! mpathset())) && - iflag == 1) - chkmail(1); - if ((vp->flags & VEXPORT) && localevar(s)) { - change_env(s, 1); - (void) setlocale(LC_ALL, ""); - updatecharset(); - } - INTON; - return; + vp->flags &= ~(VTEXTFIXED|VSTACK|VUNSET); + vp->flags |= flags; + vp->text = s; + + /* + * We could roll this to a function, to handle it as + * a regular variable function callback, but why bother? + * + * Note: this assumes iflag is not set to 1 initially. + * As part of init(), this is called before arguments + * are looked at. + */ + if ((vp == &vmpath || (vp == &vmail && ! mpathset())) && + iflag == 1) + chkmail(1); + if ((vp->flags & VEXPORT) && localevar(s)) { + change_env(s, 1); + (void) setlocale(LC_ALL, ""); + updatecharset(); } + INTON; + return; } /* not found */ if (flags & VNOSET) @@ -374,6 +368,7 @@ setvareq(char *s, int flags) vp = ckmalloc(sizeof (*vp)); vp->flags = flags; vp->text = s; + vp->name_len = nlen; vp->next = *vpp; vp->func = NULL; INTOFF; @@ -415,14 +410,10 @@ lookupvar(const char *name) { struct var *v; - for (v = *hashvar(name) ; v ; v = v->next) { - if (varequal(v->text, name)) { - if (v->flags & VUNSET) - return NULL; - return strchr(v->text, '=') + 1; - } - } - return NULL; + v = find_var(name, NULL, NULL); + if (v == NULL || v->flags & VUNSET) + return NULL; + return v->text + v->name_len + 1; } @@ -447,15 +438,12 @@ bltinlookup(const char *name, int doall) } if (result != NULL) return result; - for (v = *hashvar(name) ; v ; v = v->next) { - if (varequal(v->text, name)) { - if ((v->flags & VUNSET) - || (!doall && (v->flags & VEXPORT) == 0)) - return NULL; - return strchr(v->text, '=') + 1; - } - } - return NULL; + + v = find_var(name, NULL, NULL); + if (v == NULL || v->flags & VUNSET || + (!doall && (v->flags & VEXPORT) == 0)) + return NULL; + return v->text + v->name_len + 1; } @@ -665,22 +653,18 @@ exportcmd(int argc, char **argv) if ((p = strchr(name, '=')) != NULL) { p++; } else { - vpp = hashvar(name); - for (vp = *vpp ; vp ; vp = vp->next) { - if (varequal(vp->text, name)) { - - vp->flags |= flag; - if ((vp->flags & VEXPORT) && localevar(vp->text)) { - change_env(vp->text, 1); - (void) setlocale(LC_ALL, ""); - updatecharset(); - } - goto found; + vp = find_var(name, NULL, NULL); + if (vp != NULL) { + vp->flags |= flag; + if ((vp->flags & VEXPORT) && localevar(vp->text)) { + change_env(vp->text, 1); + (void) setlocale(LC_ALL, ""); + updatecharset(); } + continue; } } setvar(name, p, flag); -found:; } } else { for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) { @@ -747,8 +731,7 @@ mklocal(char *name) memcpy(lvp->text, optlist, sizeof optlist); vp = NULL; } else { - vpp = hashvar(name); - for (vp = *vpp ; vp && ! varequal(vp->text, name) ; vp = vp->next); + vp = find_var(name, &vpp, NULL); if (vp == NULL) { if (strchr(name, '=')) setvareq(savestr(name), VSTRFIXED); @@ -761,7 +744,7 @@ mklocal(char *name) lvp->text = vp->text; lvp->flags = vp->flags; vp->flags |= VSTRFIXED|VTEXTFIXED; - if (strchr(name, '=')) + if (name[vp->name_len] == '=') setvareq(savestr(name), 0); } } @@ -857,55 +840,34 @@ unsetvar(const char *s) struct var **vpp; struct var *vp; - vpp = hashvar(s); - for (vp = *vpp ; vp ; vpp = &vp->next, vp = *vpp) { - if (varequal(vp->text, s)) { - if (vp->flags & VREADONLY) - return (1); - INTOFF; - if (*(strchr(vp->text, '=') + 1) != '\0') - setvar(s, nullstr, 0); - if ((vp->flags & VEXPORT) && localevar(vp->text)) { - change_env(s, 0); - setlocale(LC_ALL, ""); - updatecharset(); - } - vp->flags &= ~VEXPORT; - vp->flags |= VUNSET; - if ((vp->flags & VSTRFIXED) == 0) { - if ((vp->flags & VTEXTFIXED) == 0) - ckfree(vp->text); - *vpp = vp->next; - ckfree(vp); - } - INTON; - return (0); - } + vp = find_var(s, &vpp, NULL); + if (vp == NULL) + return (0); + if (vp->flags & VREADONLY) + return (1); + INTOFF; + if (vp->text[vp->name_len + 1] != '\0') + setvar(s, nullstr, 0); + if ((vp->flags & VEXPORT) && localevar(vp->text)) { + change_env(s, 0); + setlocale(LC_ALL, ""); + updatecharset(); } - + vp->flags &= ~VEXPORT; + vp->flags |= VUNSET; + if ((vp->flags & VSTRFIXED) == 0) { + if ((vp->flags & VTEXTFIXED) == 0) + ckfree(vp->text); + *vpp = vp->next; + ckfree(vp); + } + INTON; return (0); } /* - * Find the appropriate entry in the hash table from the name. - */ - -static struct var ** -hashvar(const char *p) -{ - unsigned int hashval; - - hashval = ((unsigned char) *p) << 4; - while (*p && *p != '=') - hashval += (unsigned char) *p++; - return &vartab[hashval % VTABSIZE]; -} - - - -/* * Returns true if the two strings specify the same varable. The first * variable name is terminated by '='; the second may be terminated by * either '=' or '\0'. @@ -922,3 +884,41 @@ varequal(const char *p, const char *q) return 1; return 0; } + +/* + * Search for a variable. + * 'name' may be terminated by '=' or a NUL. + * vppp is set to the pointer to vp, or the list head if vp isn't found + * lenp is set to the number of charactets in 'name' + */ + +static struct var * +find_var(const char *name, struct var ***vppp, int *lenp) +{ + unsigned int hashval; + int len; + struct var *vp, **vpp; + const char *p = name; + + hashval = 0; + while (*p && *p != '=') + hashval = 2 * hashval + (unsigned char)*p++; + len = p - name; + + if (lenp) + *lenp = len; + vpp = &vartab[hashval % VTABSIZE]; + if (vppp) + *vppp = vpp; + + for (vp = *vpp ; vp ; vpp = &vp->next, vp = *vpp) { + if (vp->name_len != len) + continue; + if (memcmp(vp->text, name, len) != 0) + continue; + if (vppp) + *vppp = vpp; + return vp; + } + return NULL; +} Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Sun May 8 15:55:52 2011 (r221667) +++ head/bin/sh/var.h Sun May 8 16:15:50 2011 (r221668) @@ -51,6 +51,7 @@ struct var { struct var *next; /* next entry in hash list */ int flags; /* flags are defined above */ + int name_len; /* length of name */ char *text; /* name=value */ void (*func)(const char *); /* function to be called when */ From owner-svn-src-head@FreeBSD.ORG Sun May 8 17:40:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F02071065677; Sun, 8 May 2011 17:40:10 +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 D6CD38FC1F; Sun, 8 May 2011 17:40:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p48HeAT3056137; Sun, 8 May 2011 17:40:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p48HeAoK056129; Sun, 8 May 2011 17:40:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105081740.p48HeAoK056129@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 8 May 2011 17:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221669 - in head: bin/sh tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 17:40:11 -0000 Author: jilles Date: Sun May 8 17:40:10 2011 New Revision: 221669 URL: http://svn.freebsd.org/changeset/base/221669 Log: sh: Add \u/\U support (in $'...') for UTF-8. Because we have no iconv in base, support for other charsets is not possible. Note that \u/\U are processed using the locale that was active when the shell started. This is necessary to avoid behaviour that depends on the parse/execute split (for example when placing braces around an entire script). Therefore, UTF-8 encoding is implemented manually. Added: head/tools/regression/bin/sh/parser/dollar-quote10.0 (contents, props changed) head/tools/regression/bin/sh/parser/dollar-quote11.0 (contents, props changed) Modified: head/bin/sh/main.c head/bin/sh/parser.c head/bin/sh/sh.1 head/bin/sh/var.c head/bin/sh/var.h Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun May 8 16:15:50 2011 (r221668) +++ head/bin/sh/main.c Sun May 8 17:40:10 2011 (r221669) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); int rootpid; int rootshell; struct jmploc main_handler; -int localeisutf8; +int localeisutf8, initial_localeisutf8; static void read_profile(const char *); static char *find_dot_file(char *); @@ -97,7 +97,7 @@ main(int argc, char *argv[]) char *shinit; (void) setlocale(LC_ALL, ""); - updatecharset(); + initcharset(); state = 0; if (setjmp(main_handler.loc)) { switch (exception) { Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Sun May 8 16:15:50 2011 (r221668) +++ head/bin/sh/parser.c Sun May 8 17:40:10 2011 (r221669) @@ -1219,6 +1219,29 @@ readcstyleesc(char *out) if (v == 0 || (v >= 0xd800 && v <= 0xdfff)) synerror("Bad escape sequence"); /* We really need iconv here. */ + if (initial_localeisutf8 && v > 127) { + CHECKSTRSPACE(4, out); + /* + * We cannot use wctomb() as the locale may have + * changed. + */ + if (v <= 0x7ff) { + USTPUTC(0xc0 | v >> 6, out); + USTPUTC(0x80 | (v & 0x3f), out); + return out; + } else if (v <= 0xffff) { + USTPUTC(0xe0 | v >> 12, out); + USTPUTC(0x80 | ((v >> 6) & 0x3f), out); + USTPUTC(0x80 | (v & 0x3f), out); + return out; + } else if (v <= 0x10ffff) { + USTPUTC(0xf0 | v >> 18, out); + USTPUTC(0x80 | ((v >> 12) & 0x3f), out); + USTPUTC(0x80 | ((v >> 6) & 0x3f), out); + USTPUTC(0x80 | (v & 0x3f), out); + return out; + } + } if (v > 127) v = '?'; break; Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sun May 8 16:15:50 2011 (r221668) +++ head/bin/sh/sh.1 Sun May 8 17:40:10 2011 (r221669) @@ -463,8 +463,8 @@ The Unicode code point (eight hexadecimal digits) .El .Pp -The sequences for Unicode code points currently only provide useful results -for values below 128. +The sequences for Unicode code points are currently only useful with +UTF-8 locales. They reject code point 0 and UTF-16 surrogates. .Pp If an escape sequence would produce a byte with value 0, Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Sun May 8 16:15:50 2011 (r221668) +++ head/bin/sh/var.c Sun May 8 17:40:10 2011 (r221669) @@ -517,6 +517,13 @@ updatecharset(void) localeisutf8 = !strcmp(charset, "UTF-8"); } +void +initcharset(void) +{ + updatecharset(); + initial_localeisutf8 = localeisutf8; +} + /* * Generate a list of exported variables. This routine is used to construct * the third argument to execve when executing a program. Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Sun May 8 16:15:50 2011 (r221668) +++ head/bin/sh/var.h Sun May 8 17:40:10 2011 (r221669) @@ -83,6 +83,8 @@ extern struct var vterm; #endif extern int localeisutf8; +/* The parser uses the locale that was in effect at startup. */ +extern int initial_localeisutf8; /* * The following macros access the values of the above variables. @@ -116,6 +118,7 @@ char *bltinlookup(const char *, int); void bltinsetlocale(void); void bltinunsetlocale(void); void updatecharset(void); +void initcharset(void); char **environment(void); int showvarscmd(int, char **); int exportcmd(int, char **); Added: head/tools/regression/bin/sh/parser/dollar-quote10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/dollar-quote10.0 Sun May 8 17:40:10 2011 (r221669) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +# a umlaut +s=$(printf '\303\244') +# euro sign +s=$s$(printf '\342\202\254') + +# Start a new shell so the locale change is picked up. +ss="$(LC_ALL=en_US.UTF-8 ${SH} -c "printf %s \$'\u00e4\u20ac'")" +[ "$s" = "$ss" ] Added: head/tools/regression/bin/sh/parser/dollar-quote11.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/dollar-quote11.0 Sun May 8 17:40:10 2011 (r221669) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +# some sort of 't' outside BMP +s=$s$(printf '\360\235\225\245') + +# Start a new shell so the locale change is picked up. +ss="$(LC_ALL=en_US.UTF-8 ${SH} -c "printf %s \$'\U0001d565'")" +[ "$s" = "$ss" ] From owner-svn-src-head@FreeBSD.ORG Sun May 8 22:15:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C9C01065670; Sun, 8 May 2011 22:15:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 78D208FC0C; Sun, 8 May 2011 22:15:39 +0000 (UTC) Received: by yxl31 with SMTP id 31so2057624yxl.13 for ; Sun, 08 May 2011 15:15:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=BES7lP6X7HfDxF59Tz43qFljA2f/MlFepSZetdpdzks=; b=d4ExrJ+Cb6GxLGD8NWGBmkfiApms3hLMrFeV7PZ31chkwiE/YdR9JedNYtlIbUZmMo nXnIN9F7OQgr8TAR+4dM3pGr1lU8JR424QigDSji9zcMjyqdUv09Vf0w1UP6qu62G8pj 8Drb+s15i8n5uKAVA2FRcHSjNOEVVg8XVE8Mw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=fZfNOJrK2xQSo0gYKAbCXCV2RnYMEqOHXl9ZF8ICo9OJ9VI5RGmA2eXmQRxKpapw15 gph17K/8Ac78WzREsOu+JEkoAiHFPlM+9kEBbcmFv2PFnEyXDyVDGZDwYO+zcRg2R8tR uS2VJPUZnnoT14AqMbWD2pH/1V3BWAikPZjHo= MIME-Version: 1.0 Received: by 10.236.153.161 with SMTP id f21mr7119822yhk.37.1304892938528; Sun, 08 May 2011 15:15:38 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.111.33 with HTTP; Sun, 8 May 2011 15:15:38 -0700 (PDT) In-Reply-To: <4DC691AE.701@FreeBSD.org> References: <201105062043.p46Kh2Vs065320@svn.freebsd.org> <4DC691AE.701@FreeBSD.org> Date: Sun, 8 May 2011 18:15:38 -0400 X-Google-Sender-Auth: C6Ido5muFa1yfAZGIzMToWBQ66Y Message-ID: From: Attilio Rao To: Andreas Tobler Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Nathan Whitehorn Subject: Re: svn commit: r221550 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 May 2011 22:15:40 -0000 2011/5/8 Andreas Tobler : > On 08.05.11 00:17, Attilio Rao wrote: >> >> 2011/5/6 Attilio Rao: >>> >>> 2011/5/6 Nathan Whitehorn: >>>> >>>> Author: nwhitehorn >>>> Date: Fri May =C2=A06 20:43:02 2011 >>>> New Revision: 221550 >>>> URL: http://svn.freebsd.org/changeset/base/221550 >>>> >>>> Log: >>>> =C2=A0SMP has worked perfectly for a very long time on 32-bit PowerPC = on both >>>> =C2=A0UP and SMP hardware. Enable it in GENERIC. >>>> >>> >>> While working on largeSMP, I think there is a breakage in atomic.h. >>> More specifically, atomic_store_rel_long() (and related functions) are >>> not going to properly work because powerpc defines them as: >>> >>> atomic_store_rel_long -> =C2=A0atomic_store_rel_32(volatile u_int *p, u= _int v) >>> >>> while this should really follow the long arguments. >>> >>> This happens because powerpc doesn't follow the other architectures >>> semantic on defining the "similar" atomic operations. >>> Other arches define an hardcode version of _type version of the >>> function and than make a macro the _32 (or whatever) version. >>> In other words this is what they do: >>> >>> void >>> atomic_store_rel_32() >>> { >>> ... >>> } >>> >>> #define atomic_store_rel_int atomic_store_rel_32 >>> >>> which si clearly dangerous for cases as reported above. Maybe that >>> could be fixed by passing sized types, rather than simply int or long >>> in numbered version, but I'd really prefer to follow the semantic by >>> other architectures and then have: >>> >>> void >>> atomic_store_rel_int() >>> { >>> ... >>> } >>> >>> #define atomic_store_rel_32 atomic_store_rel_int >>> >>> I fixed the ATOMIC_STORE_LOAD case in my code, because I needed it, >>> but the final cleanup is much bigger. >>> I can make a patch tomorrow if you can test it. >>> >> >> Can you please test and review this patch?: >> http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc.diff >> >> Unfortunately I'm having issues with the toolchains in atm, so I can't >> really neither test compile it. > > I built kernel and world on both, on a 32-bit system and on a 64-bit syst= em > with 32-bit compat support. > > The 32-bit world failed due to type punning issues from umtx.h:121ff > > Attached my try to workaround these issues. With my try I can build both, > kernel and world. Right now I have a world running with it (32-bit). > I do not know if my try is correct. Even less after reading the comments > from Bruce. > But I think if it is on a somehow correct way, then we need something > similar for the other _long functions on 32-bit where we go from the u_lo= ng > to u_int. (e.g, atomic_add_long etc.) > > I'm ready for more testing. So based on your and Bruce's feedbacks I've reworked the patch a bit: http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc2.diff This should make type-pun correctly and avoid auto-casting on _ptr function= s. I'm sorry I couldn't even test-compile it, but I'm confident you can fix edge cases alone. Let me know. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon May 9 07:37:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33B35106566B; Mon, 9 May 2011 07:37:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19DE48FC12; Mon, 9 May 2011 07:37:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p497bltH081939; Mon, 9 May 2011 07:37:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p497blVE081937; Mon, 9 May 2011 07:37:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201105090737.p497blVE081937@svn.freebsd.org> From: Alexander Motin Date: Mon, 9 May 2011 07:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221690 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 07:37:48 -0000 Author: mav Date: Mon May 9 07:37:47 2011 New Revision: 221690 URL: http://svn.freebsd.org/changeset/base/221690 Log: Refactor TCP ISN increment logic. Instead of firing callout at 100Hz to keep constant ISN growth rate, do the same directly inside tcp_new_isn(), taking into account how much time (ticks) passed since the last call. On my test systems this decreases idle interrupt rate from 140Hz to 70Hz. Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon May 9 07:15:15 2011 (r221689) +++ head/sys/netinet/tcp_subr.c Mon May 9 07:37:47 2011 (r221690) @@ -224,7 +224,6 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone); VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]); static struct inpcb *tcp_notify(struct inpcb *, int); -static void tcp_isn_tick(void *); static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr); @@ -255,7 +254,6 @@ static VNET_DEFINE(uma_zone_t, tcpcb_zon #define V_tcpcb_zone VNET(tcpcb_zone) MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); -struct callout isn_callout; static struct mtx isn_mtx; #define ISN_LOCK_INIT() mtx_init(&isn_mtx, "isn_mtx", NULL, MTX_DEF) @@ -358,8 +356,6 @@ tcp_init(void) #undef TCP_MINPROTOHDR ISN_LOCK_INIT(); - callout_init(&isn_callout, CALLOUT_MPSAFE); - callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL); EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, SHUTDOWN_PRI_DEFAULT); EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, @@ -385,7 +381,6 @@ void tcp_fini(void *xtp) { - callout_stop(&isn_callout); } /* @@ -1571,11 +1566,13 @@ tcp6_ctlinput(int cmd, struct sockaddr * #define ISN_RANDOM_INCREMENT (4096 - 1) static VNET_DEFINE(u_char, isn_secret[32]); +static VNET_DEFINE(int, isn_last); static VNET_DEFINE(int, isn_last_reseed); static VNET_DEFINE(u_int32_t, isn_offset); static VNET_DEFINE(u_int32_t, isn_offset_old); #define V_isn_secret VNET(isn_secret) +#define V_isn_last VNET(isn_last) #define V_isn_last_reseed VNET(isn_last_reseed) #define V_isn_offset VNET(isn_offset) #define V_isn_offset_old VNET(isn_offset_old) @@ -1586,6 +1583,7 @@ tcp_new_isn(struct tcpcb *tp) MD5_CTX isn_ctx; u_int32_t md5_buffer[4]; tcp_seq new_isn; + u_int32_t projected_offset; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -1621,38 +1619,17 @@ tcp_new_isn(struct tcpcb *tp) new_isn = (tcp_seq) md5_buffer[0]; V_isn_offset += ISN_STATIC_INCREMENT + (arc4random() & ISN_RANDOM_INCREMENT); - new_isn += V_isn_offset; - ISN_UNLOCK(); - return (new_isn); -} - -/* - * Increment the offset to the next ISN_BYTES_PER_SECOND / 100 boundary - * to keep time flowing at a relatively constant rate. If the random - * increments have already pushed us past the projected offset, do nothing. - */ -static void -tcp_isn_tick(void *xtp) -{ - VNET_ITERATOR_DECL(vnet_iter); - u_int32_t projected_offset; - - VNET_LIST_RLOCK_NOSLEEP(); - ISN_LOCK(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); /* XXX appease INVARIANTS */ - projected_offset = - V_isn_offset_old + ISN_BYTES_PER_SECOND / 100; - + if (ticks != V_isn_last) { + projected_offset = V_isn_offset_old + + ISN_BYTES_PER_SECOND / hz * (ticks - V_isn_last); if (SEQ_GT(projected_offset, V_isn_offset)) V_isn_offset = projected_offset; - V_isn_offset_old = V_isn_offset; - CURVNET_RESTORE(); + V_isn_last = ticks; } + new_isn += V_isn_offset; ISN_UNLOCK(); - VNET_LIST_RUNLOCK_NOSLEEP(); - callout_reset(&isn_callout, hz/100, tcp_isn_tick, NULL); + return (new_isn); } /* From owner-svn-src-head@FreeBSD.ORG Mon May 9 10:39:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05B25106564A; Mon, 9 May 2011 10:39:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA4CC8FC16; Mon, 9 May 2011 10:39:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49AdFCP093146; Mon, 9 May 2011 10:39:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49AdF52093144; Mon, 9 May 2011 10:39:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105091039.p49AdF52093144@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 May 2011 10:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221691 - head/tools/tools/ath/ath_ee_v4k_print X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 10:39:16 -0000 Author: adrian Date: Mon May 9 10:39:15 2011 New Revision: 221691 URL: http://svn.freebsd.org/changeset/base/221691 Log: This is a full 32 bit field for kite. Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c ============================================================================== --- head/tools/tools/ath/ath_ee_v4k_print/v4k.c Mon May 9 07:37:47 2011 (r221690) +++ head/tools/tools/ath/ath_ee_v4k_print/v4k.c Mon May 9 10:39:15 2011 (r221691) @@ -89,7 +89,7 @@ eeprom_v4k_modal_print(uint16_t *buf) MODAL_EEP4K_HEADER *mh = &eep->ee_base.modalHeader; int i; - printf("| antCtrlCommon: 0x%.4x |\n", mh->antCtrlCommon); + printf("| antCtrlCommon: 0x%.8x |\n", mh->antCtrlCommon); printf("| switchSettling: 0x%.2x |\n", mh->switchSettling); printf("| adcDesiredSize: %d |\n| pgaDesiredSize: %.2f dBm |\n", mh->adcDesiredSize, (float) mh->pgaDesiredSize / 2.0); From owner-svn-src-head@FreeBSD.ORG Mon May 9 13:16:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A047106566C; Mon, 9 May 2011 13:16:21 +0000 (UTC) (envelope-from vanhu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A7EE8FC1A; Mon, 9 May 2011 13:16:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49DGLvc097884; Mon, 9 May 2011 13:16:21 GMT (envelope-from vanhu@svn.freebsd.org) Received: (from vanhu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49DGLbX097882; Mon, 9 May 2011 13:16:21 GMT (envelope-from vanhu@svn.freebsd.org) Message-Id: <201105091316.p49DGLbX097882@svn.freebsd.org> From: VANHULLEBUS Yvan Date: Mon, 9 May 2011 13:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221692 - head/sys/netipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 13:16:21 -0000 Author: vanhu Date: Mon May 9 13:16:21 2011 New Revision: 221692 URL: http://svn.freebsd.org/changeset/base/221692 Log: Release SP's refcount in key_get_spdbyid(). PR: 156676 Submitted by: Tobias Brunner (tobias@strongswan.org) MFC after: 1 week Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Mon May 9 10:39:15 2011 (r221691) +++ head/sys/netipsec/key.c Mon May 9 13:16:21 2011 (r221692) @@ -2283,6 +2283,7 @@ key_spdget(so, m, mhp) } n = key_setdumpsp(sp, SADB_X_SPDGET, 0, mhp->msg->sadb_msg_pid); + KEY_FREESP(&sp); if (n != NULL) { m_freem(m); return key_sendup_mbuf(so, n, KEY_SENDUP_ONE); From owner-svn-src-head@FreeBSD.ORG Mon May 9 13:40:56 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 282B8106564A; Mon, 9 May 2011 13:40:56 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id BB10A8FC17; Mon, 9 May 2011 13:40:54 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-8-131.flashcable.ch [91.190.8.131]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id p49Den1E079774; Mon, 9 May 2011 15:40:51 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <4DC7EEE1.8000901@FreeBSD.org> Date: Mon, 09 May 2011 15:40:49 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Attilio Rao References: <201105062043.p46Kh2Vs065320@svn.freebsd.org> <4DC691AE.701@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andreas Tobler , Nathan Whitehorn Subject: Re: svn commit: r221550 - head/sys/powerpc/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 13:40:56 -0000 On 09.05.11 00:15, Attilio Rao wrote: > 2011/5/8 Andreas Tobler: >> On 08.05.11 00:17, Attilio Rao wrote: >>> >>> 2011/5/6 Attilio Rao: >>>> >>>> 2011/5/6 Nathan Whitehorn: >>>>> >>>>> Author: nwhitehorn >>>>> Date: Fri May 6 20:43:02 2011 >>>>> New Revision: 221550 >>>>> URL: http://svn.freebsd.org/changeset/base/221550 >>>>> >>>>> Log: >>>>> SMP has worked perfectly for a very long time on 32-bit PowerPC on both >>>>> UP and SMP hardware. Enable it in GENERIC. >>>>> >>>> >>>> While working on largeSMP, I think there is a breakage in atomic.h. >>>> More specifically, atomic_store_rel_long() (and related functions) are >>>> not going to properly work because powerpc defines them as: >>>> >>>> atomic_store_rel_long -> atomic_store_rel_32(volatile u_int *p, u_int v) >>>> >>>> while this should really follow the long arguments. >>>> >>>> This happens because powerpc doesn't follow the other architectures >>>> semantic on defining the "similar" atomic operations. >>>> Other arches define an hardcode version of _type version of the >>>> function and than make a macro the _32 (or whatever) version. >>>> In other words this is what they do: >>>> >>>> void >>>> atomic_store_rel_32() >>>> { >>>> ... >>>> } >>>> >>>> #define atomic_store_rel_int atomic_store_rel_32 >>>> >>>> which si clearly dangerous for cases as reported above. Maybe that >>>> could be fixed by passing sized types, rather than simply int or long >>>> in numbered version, but I'd really prefer to follow the semantic by >>>> other architectures and then have: >>>> >>>> void >>>> atomic_store_rel_int() >>>> { >>>> ... >>>> } >>>> >>>> #define atomic_store_rel_32 atomic_store_rel_int >>>> >>>> I fixed the ATOMIC_STORE_LOAD case in my code, because I needed it, >>>> but the final cleanup is much bigger. >>>> I can make a patch tomorrow if you can test it. >>>> >>> >>> Can you please test and review this patch?: >>> http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc.diff >>> >>> Unfortunately I'm having issues with the toolchains in atm, so I can't >>> really neither test compile it. >> >> I built kernel and world on both, on a 32-bit system and on a 64-bit system >> with 32-bit compat support. >> >> The 32-bit world failed due to type punning issues from umtx.h:121ff >> >> Attached my try to workaround these issues. With my try I can build both, >> kernel and world. Right now I have a world running with it (32-bit). >> I do not know if my try is correct. Even less after reading the comments >> from Bruce. >> But I think if it is on a somehow correct way, then we need something >> similar for the other _long functions on 32-bit where we go from the u_long >> to u_int. (e.g, atomic_add_long etc.) >> >> I'm ready for more testing. > > So based on your and Bruce's feedbacks I've reworked the patch a bit: > http://www.freebsd.org/~attilio/largeSMP/atomic-powerpc2.diff > > This should make type-pun correctly and avoid auto-casting on _ptr functions. > > I'm sorry I couldn't even test-compile it, but I'm confident you can > fix edge cases alone. > Let me know. Both builds ok and booted. Thanks, Andreas From owner-svn-src-head@FreeBSD.ORG Mon May 9 14:04:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 977B1106571A; Mon, 9 May 2011 14:04:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87C758FC16; Mon, 9 May 2011 14:04:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49E4njd099413; Mon, 9 May 2011 14:04:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49E4nKs099411; Mon, 9 May 2011 14:04:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105091404.p49E4nKs099411@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 May 2011 14:04:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221693 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 14:04:49 -0000 Author: adrian Date: Mon May 9 14:04:49 2011 New Revision: 221693 URL: http://svn.freebsd.org/changeset/base/221693 Log: Remove an un-needed PA cal call here. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Mon May 9 13:16:21 2011 (r221692) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Mon May 9 14:04:49 2011 (r221693) @@ -263,7 +263,5 @@ ar9285InitCalHardware(struct ath_hal *ah if (! ar9285_hw_clc(ah, chan)) return AH_FALSE; - ar9285_hw_pa_cal(ah, AH_TRUE); - return AH_TRUE; } From owner-svn-src-head@FreeBSD.ORG Mon May 9 15:19:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAA4106564A; Mon, 9 May 2011 15:19:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BF358FC0C; Mon, 9 May 2011 15:19:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49FJnd6001767; Mon, 9 May 2011 15:19:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49FJnir001762; Mon, 9 May 2011 15:19:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105091519.p49FJnir001762@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 May 2011 15:19:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221694 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 15:19:49 -0000 Author: adrian Date: Mon May 9 15:19:49 2011 New Revision: 221694 URL: http://svn.freebsd.org/changeset/base/221694 Log: Import some initial Kite fixed diversity code from Atheros. For now, the diversity settings are controlled by 'txantenna', -not- rxantenna. This is because the earlier chipsets had controllable TX diversity; the RX antenna setting twiddles the default antenna register. I'll try sort that stuff out at some point. Call the antenna switch function from the board setup function so scans, channel changes, mode changes, etc don't set the diversity back to a default state too far from what's intended. Things to todo: * Squirrel away the last antenna diversity/combining parameters and restore them during board setup if HAL_ANT_VARIABLE is defined. That way scans, etc don't reset the diversity settings. * Add some more public facing statistics, rather than what's simply logged under HAL_DEBUG_DIVERSITY. For now, the fixed antenna settings behave better than variable settings for me. I have some further fiddling to do.. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285.h Mon May 9 14:04:49 2011 (r221693) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.h Mon May 9 15:19:49 2011 (r221694) @@ -21,10 +21,10 @@ #include "ar5416/ar5416.h" enum ar9285_ant_div_comb_lna_conf { - ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2, - ATH_ANT_DIV_COMB_LNA2, - ATH_ANT_DIV_COMB_LNA1, - ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2, + ATH_ANT_DIV_COMB_LNA1_MINUS_LNA2 = 0, + ATH_ANT_DIV_COMB_LNA2 = 1, + ATH_ANT_DIV_COMB_LNA1 = 2, + ATH_ANT_DIV_COMB_LNA1_PLUS_LNA2 = 3, }; struct ar9285_ant_comb { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May 9 14:04:49 2011 (r221693) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May 9 15:19:49 2011 (r221694) @@ -407,15 +407,6 @@ ar9285FillCapabilityInfo(struct ath_hal return AH_TRUE; } -/* - * Antenna selection is not (currently) done this way. - */ -HAL_BOOL -ar9285SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings) -{ - return AH_TRUE; -} - static const char* ar9285Probe(uint16_t vendorid, uint16_t devid) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Mon May 9 14:04:49 2011 (r221693) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Mon May 9 15:19:49 2011 (r221694) @@ -374,11 +374,19 @@ ar9285_ant_comb_scan(struct ath_hal *ah, if (! ar9285_check_div_comb(ah)) return; + if (AH5212(ah)->ah_diversity == AH_FALSE) + return; + rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) & ATH_ANT_RX_MASK; main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) & ATH_ANT_RX_MASK; +#if 0 + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main: %d, alt: %d, rx_ant_conf: %x, main_ant_conf: %x\n", + __func__, main_rssi, alt_rssi, rx_ant_conf, main_ant_conf); +#endif + /* Record packet only when alt_rssi is positive */ if (alt_rssi > 0) { antcomb->total_pkt_count++; @@ -587,6 +595,24 @@ div_comb_done: ar9285_antdiv_comb_conf_set(ah, &div_ant_conf); + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: total_pkt_count=%d\n", + __func__, antcomb->total_pkt_count); + + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_total_rssi=%d\n", + __func__, antcomb->main_total_rssi); + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_total_rssi=%d\n", + __func__, antcomb->alt_total_rssi); + + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_rssi_avg=%d\n", + __func__, main_rssi_avg); + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_alt_rssi_avg=%d\n", + __func__, alt_rssi_avg); + + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_recv_cnt=%d\n", + __func__, antcomb->main_recv_cnt); + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_recv_cnt=%d\n", + __func__, antcomb->alt_recv_cnt); + if (curr_alt_set != div_ant_conf.alt_lna_conf) HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: lna_conf: %x -> %x\n", __func__, curr_alt_set, div_ant_conf.alt_lna_conf); @@ -604,3 +630,117 @@ div_comb_done: antcomb->main_recv_cnt = 0; antcomb->alt_recv_cnt = 0; } + +/* + * Set the antenna switch to control RX antenna diversity. + * + * If a fixed configuration is used, the LNA and div bias + * settings are fixed and the antenna diversity scanning routine + * is disabled. + * + * If a variable configuration is used, a default is programmed + * in and sampling commences per RXed packet. + * + * Since this is called from ar9285SetBoardValues() to setup + * diversity, it means that after a reset or scan, any current + * software diversity combining settings will be lost and won't + * re-appear until after the first successful sample run. + * Please keep this in mind if you're seeing weird performance + * that happens to relate to scan/diversity timing. + */ +HAL_BOOL +ar9285SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings) +{ + int regVal; + const HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; + const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader; + uint8_t ant_div_control1, ant_div_control2; + + if (pModal->version < 3) { + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: not supported\n", + __func__); + return AH_FALSE; /* Can't do diversity */ + } + + /* Store settings */ + AH5212(ah)->ah_antControl = settings; + AH5212(ah)->ah_diversity = (settings == HAL_ANT_VARIABLE); + + /* XXX don't fiddle if the PHY is in sleep mode or ! chan */ + + /* Begin setting the relevant registers */ + + ant_div_control1 = pModal->antdiv_ctl1; + ant_div_control2 = pModal->antdiv_ctl2; + + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL)); + + /* enable antenna diversity only if diversityControl == HAL_ANT_VARIABLE */ + if (settings == HAL_ANT_VARIABLE) + regVal |= SM(ant_div_control1, AR_PHY_9285_ANT_DIV_CTL); + + if (settings == HAL_ANT_VARIABLE) { + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_VARIABLE\n", + __func__); + regVal |= SM(ant_div_control2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM((ant_div_control2 >> 2), AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM((ant_div_control1 >> 1), AR_PHY_9285_ANT_DIV_ALT_GAINTB); + regVal |= SM((ant_div_control1 >> 2), AR_PHY_9285_ANT_DIV_MAIN_GAINTB); + } else { + if (settings == HAL_ANT_FIXED_A) { + /* Diversity disabled, RX = LNA1 */ + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_FIXED_A\n", + __func__); + regVal |= SM(ATH_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM(ATH_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_0, AR_PHY_9285_ANT_DIV_ALT_GAINTB); + regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_1, AR_PHY_9285_ANT_DIV_MAIN_GAINTB); + } + else if (settings == HAL_ANT_FIXED_B) { + /* Diversity disabled, RX = LNA2 */ + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: HAL_ANT_FIXED_B\n", + __func__); + regVal |= SM(ATH_ANT_DIV_COMB_LNA1, AR_PHY_9285_ANT_DIV_ALT_LNACONF); + regVal |= SM(ATH_ANT_DIV_COMB_LNA2, AR_PHY_9285_ANT_DIV_MAIN_LNACONF); + regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_1, AR_PHY_9285_ANT_DIV_ALT_GAINTB); + regVal |= SM(AR_PHY_9285_ANT_DIV_GAINTB_0, AR_PHY_9285_ANT_DIV_MAIN_GAINTB); + } + } + + OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + regVal &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + if (settings == HAL_ANT_VARIABLE) + regVal |= SM((ant_div_control1 >> 3), AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); + + OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, regVal); + regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); + + /* + * If Diversity combining is available and the diversity setting + * is to allow variable diversity, enable it by default. + * + * This will be eventually overridden by the software antenna + * diversity logic. + * + * Note that yes, this following section overrides the above + * settings for the LNA configuration and fast-bias. + */ + if (ar9285_check_div_comb(ah) && AH5212(ah)->ah_diversity == AH_TRUE) { + // If support DivComb, set MAIN to LNA1 and ALT to LNA2 at the first beginning + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, + "%s: Enable initial settings for combined diversity\n", + __func__); + regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); + regVal &= (~(AR_PHY_9285_ANT_DIV_MAIN_LNACONF | AR_PHY_9285_ANT_DIV_ALT_LNACONF)); + regVal |= (ATH_ANT_DIV_COMB_LNA1 << AR_PHY_9285_ANT_DIV_MAIN_LNACONF_S); + regVal |= (ATH_ANT_DIV_COMB_LNA2 << AR_PHY_9285_ANT_DIV_ALT_LNACONF_S); + regVal &= (~(AR_PHY_9285_FAST_DIV_BIAS)); + regVal |= (0 << AR_PHY_9285_FAST_DIV_BIAS_S); + OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); + } + + return AH_TRUE; +} Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Mon May 9 14:04:49 2011 (r221693) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Mon May 9 15:19:49 2011 (r221694) @@ -237,8 +237,6 @@ ar9285SetBoardValues(struct ath_hal *ah, const MODAL_EEP4K_HEADER *pModal; uint8_t txRxAttenLocal; uint8_t ob[5], db1[5], db2[5]; - uint8_t ant_div_control1, ant_div_control2; - uint32_t regVal; pModal = &eep->modalHeader; txRxAttenLocal = 23; @@ -248,36 +246,10 @@ ar9285SetBoardValues(struct ath_hal *ah, /* Single chain for 4K EEPROM*/ ar9285SetBoardGain(ah, pModal, eep, txRxAttenLocal); - /* Initialize Ant Diversity settings from EEPROM */ - if (pModal->version >= 3) { - ant_div_control1 = pModal->antdiv_ctl1; - ant_div_control2 = pModal->antdiv_ctl2; - - regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); - regVal &= (~(AR_PHY_9285_ANT_DIV_CTL_ALL)); - - regVal |= SM(ant_div_control1, - AR_PHY_9285_ANT_DIV_CTL); - regVal |= SM(ant_div_control2, - AR_PHY_9285_ANT_DIV_ALT_LNACONF); - regVal |= SM((ant_div_control2 >> 2), - AR_PHY_9285_ANT_DIV_MAIN_LNACONF); - regVal |= SM((ant_div_control1 >> 1), - AR_PHY_9285_ANT_DIV_ALT_GAINTB); - regVal |= SM((ant_div_control1 >> 2), - AR_PHY_9285_ANT_DIV_MAIN_GAINTB); - - OS_REG_WRITE(ah, AR_PHY_MULTICHAIN_GAIN_CTL, regVal); - regVal = OS_REG_READ(ah, AR_PHY_MULTICHAIN_GAIN_CTL); - regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); - regVal &= (~AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); - regVal |= SM((ant_div_control1 >> 3), - AR_PHY_CCK_DETECT_BB_ENABLE_ANT_FAST_DIV); - - OS_REG_WRITE(ah, AR_PHY_CCK_DETECT, regVal); - regVal = OS_REG_READ(ah, AR_PHY_CCK_DETECT); - } + /* Initialize Ant Diversity settings if supported */ + (void) ar9285SetAntennaSwitch(ah, AH5212(ah)->ah_antControl); + /* Configure TX power calibration */ if (pModal->version >= 2) { ob[0] = pModal->ob_0; ob[1] = pModal->ob_1; @@ -379,6 +351,7 @@ ar9285SetBoardValues(struct ath_hal *ah, if (AR_SREV_9271(ah) || AR_SREV_KITE(ah)) { uint8_t bb_desired_scale = (pModal->bb_scale_smrt_antenna & EEP_4K_BB_DESIRED_SCALE_MASK); if ((eep->baseEepHeader.txGainType == 0) && (bb_desired_scale != 0)) { + ath_hal_printf(ah, "[ath]: adjusting cck tx gain factor\n"); uint32_t pwrctrl, mask, clr; mask = (1<<0) | (1<<5) | (1<<10) | (1<<15) | (1<<20) | (1<<25); From owner-svn-src-head@FreeBSD.ORG Mon May 9 15:57:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91324106566C; Mon, 9 May 2011 15:57:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 674B68FC13; Mon, 9 May 2011 15:57:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49Fv4RJ002894; Mon, 9 May 2011 15:57:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49Fv4SU002892; Mon, 9 May 2011 15:57:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201105091557.p49Fv4SU002892@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 9 May 2011 15:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221695 - head/sys/dev/sound/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 15:57:04 -0000 Author: hselasky Date: Mon May 9 15:57:04 2011 New Revision: 221695 URL: http://svn.freebsd.org/changeset/base/221695 Log: Workaround for broken no-name USB audio devices sold by dealextreme called "3D sound" and the alike. MFC after: 14 days Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Mon May 9 15:19:49 2011 (r221694) +++ head/sys/dev/sound/usb/uaudio.c Mon May 9 15:57:04 2011 (r221695) @@ -789,6 +789,46 @@ uaudio_chan_dump_ep_desc(const usb_endpo #endif +/* + * The following is a workaround for broken no-name USB audio devices + * sold by dealextreme called "3D sound". The problem is that the + * manufacturer computed wMaxPacketSize is too small to hold the + * actual data sent. In other words the device sometimes sends more + * data than it actually reports it can send in a single isochronous + * packet. + */ +static void +uaudio_record_fix_fs(usb_endpoint_descriptor_audio_t *ep, + uint32_t xps, uint32_t add) +{ + uint32_t mps; + + mps = UGETW(ep->wMaxPacketSize); + + /* + * If the device indicates it can send more data than what the + * sample rate indicates, we apply the workaround. + */ + if (mps > xps) { + + /* allow additional data */ + xps += add; + + /* check against the maximum USB 1.x length */ + if (xps > 1023) + xps = 1023; + + /* check if we should do an update */ + if (mps < xps) { + /* simply update the wMaxPacketSize field */ + USETW(ep->wMaxPacketSize, xps); + DPRINTF("Workaround: Updated wMaxPacketSize " + "from %d to %d bytes.\n", + (int)mps, (int)xps); + } + } +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) @@ -797,7 +837,7 @@ uaudio_chan_fill_info_sub(struct uaudio_ const struct usb_audio_streaming_interface_descriptor *asid = NULL; const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; - const usb_endpoint_descriptor_audio_t *ed1 = NULL; + usb_endpoint_descriptor_audio_t *ed1 = NULL; const usb_endpoint_descriptor_audio_t *ed2 = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; @@ -999,6 +1039,13 @@ uaudio_chan_fill_info_sub(struct uaudio_ UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * chan->p_asf1d->bBitResolution) / 8); + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } + if (sc->sc_sndstat_valid) { sbuf_printf(&sc->sc_sndstat, "\n\t" "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", From owner-svn-src-head@FreeBSD.ORG Mon May 9 16:27:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D54A1065673; Mon, 9 May 2011 16:27:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C83D8FC12; Mon, 9 May 2011 16:27:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49GRdRi003987; Mon, 9 May 2011 16:27:39 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49GRdP4003978; Mon, 9 May 2011 16:27:39 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201105091627.p49GRdP4003978@svn.freebsd.org> From: Ed Schouten Date: Mon, 9 May 2011 16:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221698 - in head/sys/teken: . demo libteken stress X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 16:27:39 -0000 Author: ed Date: Mon May 9 16:27:39 2011 New Revision: 221698 URL: http://svn.freebsd.org/changeset/base/221698 Log: Add proper build infrastructure for teken. I'm not sure whether we should install teken as a library on any stock FreeBSD installation, but I can imagine people want to tinker around with it now and then. Create a /sys/teken/libteken, which holds a Makefile to install a shared library version of the terminal emulator, complete with a manpage. Also add Makefiles for the demo/stress applications, to build it against the shared library. Added: head/sys/teken/demo/ head/sys/teken/demo/Makefile (contents, props changed) head/sys/teken/demo/teken_demo.c - copied, changed from r221665, head/sys/teken/teken_demo.c head/sys/teken/libteken/ head/sys/teken/libteken/Makefile (contents, props changed) head/sys/teken/libteken/Symbol.map (contents, props changed) head/sys/teken/libteken/teken.3 (contents, props changed) head/sys/teken/stress/ head/sys/teken/stress/Makefile (contents, props changed) head/sys/teken/stress/teken_stress.c - copied, changed from r221665, head/sys/teken/teken_stress.c Deleted: head/sys/teken/Makefile head/sys/teken/teken_demo.c head/sys/teken/teken_stress.c Modified: head/sys/teken/teken.c head/sys/teken/teken.h Added: head/sys/teken/demo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/teken/demo/Makefile Mon May 9 16:27:39 2011 (r221698) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= teken_demo +LDADD= -lncurses -lteken -lutil +MAN= + +WARNS?= 6 + +.include Copied and modified: head/sys/teken/demo/teken_demo.c (from r221665, head/sys/teken/teken_demo.c) ============================================================================== --- head/sys/teken/teken_demo.c Sun May 8 14:57:01 2011 (r221665, copy source) +++ head/sys/teken/demo/teken_demo.c Mon May 9 16:27:39 2011 (r221698) @@ -45,7 +45,7 @@ #include #endif -#include "teken.h" +#include static tf_bell_t test_bell; static tf_cursor_t test_cursor; Added: head/sys/teken/libteken/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/teken/libteken/Makefile Mon May 9 16:27:39 2011 (r221698) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +LIB= teken +SHLIB_MAJOR= 0 + +CFLAGS+=-I. +WARNS?= 6 + +SRCDIR= ${.CURDIR}/.. +.PATH: ${SRCDIR} + +SRCS= teken.c teken_state.h +INCS= teken.h +CLEANFILES=teken_state.h + +MAN= teken.3 +MLINKS= teken.3 teken_256to8.3 \ + teken.3 teken_get_curattr.3 \ + teken.3 teken_get_cursor.3 \ + teken.3 teken_get_defattr.3 \ + teken.3 teken_get_defattr_cons25.3 \ + teken.3 teken_get_sequence.3 \ + teken.3 teken_get_winsize.3 \ + teken.3 teken_init.3 \ + teken.3 teken_input.3 \ + teken.3 teken_set_8bit.3 \ + teken.3 teken_set_cons25.3 \ + teken.3 teken_set_curattr.3 \ + teken.3 teken_set_cursor.3 \ + teken.3 teken_set_defattr.3 \ + teken.3 teken_set_winsize.3 + +teken_state.h: ${SRCDIR}/gensequences ${SRCDIR}/sequences + awk -f ${SRCDIR}/gensequences ${SRCDIR}/sequences > ${.TARGET} + +VERSION_DEF= ${.CURDIR}/../../../lib/libc/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map + +.include Added: head/sys/teken/libteken/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/teken/libteken/Symbol.map Mon May 9 16:27:39 2011 (r221698) @@ -0,0 +1,21 @@ +/* + * $FreeBSD$ + */ + +FBSD_1.2 { + teken_256to8; + teken_get_curattr; + teken_get_cursor; + teken_get_defattr; + teken_get_defattr_cons25; + teken_get_sequence; + teken_get_winsize; + teken_init; + teken_input; + teken_set_8bit; + teken_set_cons25; + teken_set_curattr; + teken_set_cursor; + teken_set_defattr; + teken_set_winsize; +}; Added: head/sys/teken/libteken/teken.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/teken/libteken/teken.3 Mon May 9 16:27:39 2011 (r221698) @@ -0,0 +1,220 @@ +.\" Copyright (c) 2011 Ed Schouten +.\" 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. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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$ +.\" +.Dd May 9, 2011 +.Dt TEKEN 3 +.Os +.Sh NAME +.Nm teken +.Nd xterm-like terminal emulation interface +.Sh LIBRARY +.Lb libteken +.Sh SYNOPSIS +.In teken.h +.Ft void +.Fn teken_init "teken_t *t" "const teken_funcs_t *funcs" "void *thunk" +.Ft void +.Fn teken_input "teken_t *t" "const void *buf" "size_t nbytes" +.Ft const teken_pos_t * +.Fn teken_get_winsize "teken_t *t" +.Ft void +.Fn teken_set_winsize "teken_t *t" "const teken_pos_t *size" +.Ft const teken_pos_t * +.Fn teken_get_cursor "teken_t *t" +.Ft void +.Fn teken_set_cursor "teken_t *t" "const teken_pos_t *pos" +.Ft const teken_attr_t * +.Fn teken_get_curattr "teken_t *t" +.Ft void +.Fn teken_set_curattr "teken_t *t" "const teken_attr_t *attr" +.Ft const teken_attr_t * +.Fn teken_get_defattr "teken_t *t" +.Ft void +.Fn teken_set_defattr "teken_t *t" "const teken_attr_t *attr" +.Ft const char * +.Fn teken_get_sequence "teken_t *t" "unsigned int id" +.Ft teken_color_t +.Fn teken_256to8 "teken_color_t color" +.Ft void +.Fn teken_get_defattr_cons25 "teken_t *t" "int *fg" "int *bg" +.Ft void +.Fn teken_set_8bit "teken_t *t" +.Ft void +.Fn teken_set_cons25 "teken_t *t" +.Sh DESCRIPTION +The +.Nm +library implements the input parser of a 256-color xterm-like terminal. +It converts a stream of UTF-8 encoded characters into a series of +primitive drawing instructions that can be used by a console driver or +terminal emulator to render a terminal application. +.Pp +The +.Fn teken_init +function is used to initialize terminal state object +.Fa t , +having type +.Vt teken_t . +The supplied +.Vt teken_funcs_t +structure +.Fa funcs +contains a set of callback functions, which are called when supplying +data to +.Fn teken_input . +The +.Fa thunk +argument stores an arbitrary pointer, which is passed to each invocation +of the callback functions. +.Pp +The +.Vt teken_funcs_t +structure stores the following callbacks: +.Bd -literal -offset indent +typedef struct { + tf_bell_t *tf_bell; /* Audible/visible bell. */ + tf_cursor_t *tf_cursor; /* Move cursor to x/y. */ + tf_putchar_t *tf_putchar; /* Put Unicode character at x/y. */ + tf_fill_t *tf_fill; /* Fill rectangle with character. */ + tf_copy_t *tf_copy; /* Copy rectangle to new location. */ + tf_param_t *tf_param; /* Miscellaneous options. */ + tf_respond_t *tf_respond; /* Send response string to user. */ +} teken_funcs_t; +.Ed +.Pp +All callbacks must be provided, though unimplemented callbacks may some +times be sufficient. +The actual types of these callbacks can be found in +.In teken.h . +.Pp +By default, +.Fn teken_init +initializes the +.Vt teken_t +structure to emulate a terminal having 24 rows and 80 columns. +The +.Fn teken_get_winsize +and +.Fn teken_set_winsize +functions can be used to obtain and modify the dimensions of the +terminal. +.Pp +Even though the cursor position is normally controlled by input of data +through +.Fn teken_input +and returned by the +.Fn tf_cursor +callback, it can be obtained and modified manually using the +.Fn teken_get_cursor +and +.Fn teken_set_cursor +functions. +The same holds for +.Fn teken_get_curattr +and +.Fn teken_set_curattr , +which can be used to change the currently selected font attributes and +foreground and background color. +.Pp +By default, +.Nm +emulates a white-on-black terminal, which means the default foreground +color is white, while the background color is black. +These defaults can be modified using +.Fn teken_get_defattr +and +.Fn teken_set_defattr . +.Pp +The +.Fn teken_get_sequence +function is a utility function that can be used to obtain escape +sequences of special keyboard keys, generated by user input. +The +.Fa id +parameter must be one of the +.Dv TKEY_* +parameters listed in +.In teken.h . +.Sh LEGACY FEATURES +This library also provides a set of functions that shouldn't be used in +any modern applications. +.Pp +The +.Fn teken_256to8 +function converts a color code to one of the 8 primary colors, allowing +the terminal to be rendered on graphics hardware that only supports 8 or +16 colors (e.g. VGA). +.Pp +The +.Fn teken_get_defattr_cons25 +function obtains the default terminal attributes as a pair of foreground +and background colors, using ANSI color numbering. +.Pp +The +.Fn teken_set_8bit +function disables UTF-8 processing and switches to 8-bit character mode, +which can be used to support character sets like CP437 and ISO-8859-1. +.Pp +The +.Fn teken_set_cons25 +function switches terminal emulation to +.Dv cons25 , +which is used by versions of +.Fx +prior to 9.0. +.Sh SECURITY CONSIDERATIONS +The +.Fn tf_respond +callback is used to respond to device status requests commands generated +by an application. +In the past, there have been various security issues, where a malicious +application sends a device status request before termination, causing +the generated response to be interpreted by applications such as +.Xr sh 1 . +.Pp +.Nm +only implements a small subset of responses which are unlikely to cause +any harm. +Still, it is advised to leave +.Fn tf_respond +unimplemented. +.Sh SEE ALSO +.Xr ncurses 3 , +.Xr termcap 3 , +.Xr syscons 4 . +.Sh HISTORY +The +.Nm +library appeared in +.Fx 8.0 , +though it was only available and used inside the kernel. +In +.Fx 9.0 , +the +.Nm +library appeared in userspace. +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/sys/teken/stress/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/teken/stress/Makefile Mon May 9 16:27:39 2011 (r221698) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= teken_stress +LDADD= -lteken +MAN= + +WARNS?= 6 + +.include Copied and modified: head/sys/teken/stress/teken_stress.c (from r221665, head/sys/teken/teken_stress.c) ============================================================================== --- head/sys/teken/teken_stress.c Sun May 8 14:57:01 2011 (r221665, copy source) +++ head/sys/teken/stress/teken_stress.c Mon May 9 16:27:39 2011 (r221698) @@ -34,7 +34,7 @@ #include #include -#include "teken.h" +#include static tf_bell_t stress_bell; static tf_cursor_t stress_cursor; Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Mon May 9 16:16:15 2011 (r221697) +++ head/sys/teken/teken.c Mon May 9 16:27:39 2011 (r221698) @@ -32,7 +32,6 @@ #include #include #define teken_assert(x) MPASS(x) -#define teken_printf(x,...) #else /* !(__FreeBSD__ && _KERNEL) */ #include #include @@ -40,14 +39,11 @@ #include #include #define teken_assert(x) assert(x) -#define teken_printf(x,...) do { \ - if (df != NULL) \ - fprintf(df, x, ## __VA_ARGS__); \ -} while (0) -/* debug messages */ -static FILE *df; #endif /* __FreeBSD__ && _KERNEL */ +/* debug messages */ +#define teken_printf(x,...) + /* Private flags for t_stateflags. */ #define TS_FIRSTDIGIT 0x0001 /* First numeric digit in escape sequence. */ #define TS_INSERT 0x0002 /* Insert mode. */ @@ -153,12 +149,6 @@ teken_init(teken_t *t, const teken_funcs { teken_pos_t tp = { .tp_row = 24, .tp_col = 80 }; -#if !(defined(__FreeBSD__) && defined(_KERNEL)) - df = fopen("teken.log", "w"); - if (df != NULL) - setvbuf(df, NULL, _IOLBF, BUFSIZ); -#endif /* !(__FreeBSD__ && _KERNEL) */ - t->t_funcs = tf; t->t_softc = softc; Modified: head/sys/teken/teken.h ============================================================================== --- head/sys/teken/teken.h Mon May 9 16:16:15 2011 (r221697) +++ head/sys/teken/teken.h Mon May 9 16:27:39 2011 (r221698) @@ -29,6 +29,8 @@ #ifndef _TEKEN_H_ #define _TEKEN_H_ +#include + /* * libteken: terminal emulation library. * From owner-svn-src-head@FreeBSD.ORG Mon May 9 16:49:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABEDE1065673; Mon, 9 May 2011 16:49:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D6378FC14; Mon, 9 May 2011 16:49:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49GneTn004725; Mon, 9 May 2011 16:49:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49Gnere004723; Mon, 9 May 2011 16:49:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105091649.p49Gnere004723@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 May 2011 16:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221700 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 16:49:40 -0000 Author: adrian Date: Mon May 9 16:49:40 2011 New Revision: 221700 URL: http://svn.freebsd.org/changeset/base/221700 Log: Disable TX STBC - it isn't used for now, but it isn't supported on Kite. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May 9 16:47:13 2011 (r221699) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Mon May 9 16:49:40 2011 (r221700) @@ -401,8 +401,9 @@ ar9285FillCapabilityInfo(struct ath_hal if (AR_SREV_KITE_12_OR_LATER(ah)) pCap->halPSPollBroken = AH_FALSE; + /* Only RX STBC supported */ pCap->halRxStbcSupport = 1; - pCap->halTxStbcSupport = 1; + pCap->halTxStbcSupport = 0; return AH_TRUE; } From owner-svn-src-head@FreeBSD.ORG Mon May 9 17:10:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEF92106566C; Mon, 9 May 2011 17:10:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0DFC8FC0A; Mon, 9 May 2011 17:10:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49HAm0T005383; Mon, 9 May 2011 17:10:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49HAmIY005381; Mon, 9 May 2011 17:10:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105091710.p49HAmIY005381@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 May 2011 17:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221701 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 17:10:49 -0000 Author: adrian Date: Mon May 9 17:10:48 2011 New Revision: 221701 URL: http://svn.freebsd.org/changeset/base/221701 Log: Fix a regression I introduced - only swap analog chains if the RX chainmask is 0x5. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon May 9 16:49:40 2011 (r221700) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon May 9 17:10:48 2011 (r221701) @@ -1296,7 +1296,8 @@ ar5416InitChainMasks(struct ath_hal *ah) { int rx_chainmask = AH5416(ah)->ah_rx_chainmask; - if (rx_chainmask) + /* Flip this for this chainmask regardless of chip */ + if (rx_chainmask == 0x5) OS_REG_SET_BIT(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); /* From owner-svn-src-head@FreeBSD.ORG Mon May 9 17:30:26 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FEBE106566B; Mon, 9 May 2011 17:30:26 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473368FC14; Mon, 9 May 2011 17:30:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49HUQoR006013; Mon, 9 May 2011 17:30:26 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49HUQK6006010; Mon, 9 May 2011 17:30:26 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105091730.p49HUQK6006010@svn.freebsd.org> From: Adrian Chadd Date: Mon, 9 May 2011 17:30:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221702 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 17:30:26 -0000 Author: adrian Date: Mon May 9 17:30:25 2011 New Revision: 221702 URL: http://svn.freebsd.org/changeset/base/221702 Log: Disable diversity combining support until I can get a firm answer from Atheros as to what/when this is supposed to be enabled. Using the default RX fast diversity settings seems to help quite a bit. Whilst I'm here, change the prototype to return HAL_BOOL rather than int. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c Mon May 9 17:10:48 2011 (r221701) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.c Mon May 9 17:30:25 2011 (r221702) @@ -75,24 +75,30 @@ ar9285_antdiv_comb_conf_set(struct ath_h } /* - * Check whether antenna diversity should be enabled + * Check whether combined + fast antenna diversity should be enabled. + * + * This enables software-driven RX antenna diversity based on RX + * RSSI + antenna config packet sampling. */ -int +HAL_BOOL ar9285_check_div_comb(struct ath_hal *ah) { uint8_t ant_div_ctl1; HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; const MODAL_EEP4K_HEADER *pModal = &ee->ee_base.modalHeader; + /* For now, simply disable this until it's better debugged. -adrian */ + return AH_FALSE; + if (! AR_SREV_KITE(ah)) - return 0; + return AH_FALSE; if (pModal->version < 3) - return 0; + return AH_FALSE; ant_div_ctl1 = pModal->antdiv_ctl1; if ((ant_div_ctl1 & 0x1) && ((ant_div_ctl1 >> 3) & 0x1)) - return 1; + return AH_TRUE; - return 0; + return AH_FALSE; } Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h Mon May 9 17:10:48 2011 (r221701) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_phy.h Mon May 9 17:30:25 2011 (r221702) @@ -41,6 +41,6 @@ extern void ar9285_antdiv_comb_conf_set( struct ar9285_antcomb_conf *antconf); extern void ar9285_antdiv_comb_conf_get(struct ath_hal *ah, struct ar9285_antcomb_conf *antconf); -extern int ar9285_check_div_comb(struct ath_hal *ah); +extern HAL_BOOL ar9285_check_div_comb(struct ath_hal *ah); #endif From owner-svn-src-head@FreeBSD.ORG Mon May 9 17:34:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B98C1106566B; Mon, 9 May 2011 17:34:00 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA58F8FC0A; Mon, 9 May 2011 17:34:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49HY0j3006185; Mon, 9 May 2011 17:34:00 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49HY0P3006180; Mon, 9 May 2011 17:34:00 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105091734.p49HY0P3006180@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 9 May 2011 17:34:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 17:34:00 -0000 Author: jkim Date: Mon May 9 17:34:00 2011 New Revision: 221703 URL: http://svn.freebsd.org/changeset/base/221703 Log: Implement boot-time TSC synchronization test for SMP. This test is executed when the user has indicated that the system has synchronized TSCs or it has P-state invariant TSCs. For the former case, we may clear the tunable if it fails the test to prevent accidental foot-shooting. For the latter case, we may set it if it passes the test to notify the user that it may be usable. Modified: head/sys/amd64/include/clock.h head/sys/i386/include/clock.h head/sys/x86/isa/clock.c head/sys/x86/x86/tsc.c Modified: head/sys/amd64/include/clock.h ============================================================================== --- head/sys/amd64/include/clock.h Mon May 9 17:30:25 2011 (r221702) +++ head/sys/amd64/include/clock.h Mon May 9 17:34:00 2011 (r221703) @@ -29,7 +29,6 @@ void i8254_init(void); void startrtclock(void); void init_TSC(void); -void init_TSC_tc(void); #define HAS_TIMER_SPKR 1 int timer_spkr_acquire(void); Modified: head/sys/i386/include/clock.h ============================================================================== --- head/sys/i386/include/clock.h Mon May 9 17:30:25 2011 (r221702) +++ head/sys/i386/include/clock.h Mon May 9 17:34:00 2011 (r221703) @@ -30,7 +30,6 @@ void i8254_init(void); void startrtclock(void); void timer_restore(void); void init_TSC(void); -void init_TSC_tc(void); #define HAS_TIMER_SPKR 1 int timer_spkr_acquire(void); Modified: head/sys/x86/isa/clock.c ============================================================================== --- head/sys/x86/isa/clock.c Mon May 9 17:30:25 2011 (r221702) +++ head/sys/x86/isa/clock.c Mon May 9 17:34:00 2011 (r221703) @@ -498,7 +498,6 @@ void cpu_initclocks(void) { - init_TSC_tc(); cpu_initclocks_bsp(); } Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Mon May 9 17:30:25 2011 (r221702) +++ head/sys/x86/x86/tsc.c Mon May 9 17:34:00 2011 (r221703) @@ -326,7 +326,73 @@ init_TSC(void) tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY); } -void +#ifdef SMP + +#define TSC_READ(x) \ +static void \ +tsc_read_##x(void *arg) \ +{ \ + uint32_t *tsc = arg; \ + u_int cpu = PCPU_GET(cpuid); \ + \ + tsc[cpu * 3 + x] = rdtsc32(); \ +} +TSC_READ(0) +TSC_READ(1) +TSC_READ(2) +#undef TSC_READ + +#define N 1000 + +static void +comp_smp_tsc(void *arg) +{ + uint32_t *tsc; + int32_t d1, d2; + u_int cpu = PCPU_GET(cpuid); + u_int i, j, size; + + size = (mp_maxid + 1) * 3; + for (i = 0, tsc = arg; i < N; i++, tsc += size) + CPU_FOREACH(j) { + if (j == cpu) + continue; + d1 = tsc[cpu * 3 + 1] - tsc[j * 3]; + d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1]; + if (d1 <= 0 || d2 <= 0) { + smp_tsc = 0; + return; + } + } +} + +static int +test_smp_tsc(void) +{ + uint32_t *data, *tsc; + u_int i, size; + + if (!smp_tsc && !tsc_is_invariant) + return (-100); + size = (mp_maxid + 1) * 3; + data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); + for (i = 0, tsc = data; i < N; i++, tsc += size) + smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); + smp_tsc = 1; /* XXX */ + smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, + smp_no_rendevous_barrier, data); + free(data, M_TEMP); + if (bootverbose) + printf("SMP: %sed TSC synchronization test\n", + smp_tsc ? "pass" : "fail"); + return (smp_tsc ? 800 : -100); +} + +#undef N + +#endif /* SMP */ + +static void init_TSC_tc(void) { @@ -347,26 +413,25 @@ init_TSC_tc(void) tsc_timecounter.tc_quality = -1000; if (bootverbose) printf("TSC timecounter disabled: APM enabled.\n"); + goto init; } #ifdef SMP /* - * We can not use the TSC in SMP mode unless the TSCs on all CPUs - * are somehow synchronized. Some hardware configurations do - * this, but we have no way of determining whether this is the - * case, so we do not use the TSC in multi-processor systems - * unless the user indicated (by setting kern.timecounter.smp_tsc - * to 1) that he believes that his TSCs are synchronized. + * We can not use the TSC in SMP mode unless the TSCs on all CPUs are + * synchronized. If the user is sure that the system has synchronized + * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value. */ - if (mp_ncpus > 1 && !smp_tsc) - tsc_timecounter.tc_quality = -100; + if (smp_cpus > 1) + tsc_timecounter.tc_quality = test_smp_tsc(); #endif - +init: if (tsc_freq != 0) { tsc_timecounter.tc_frequency = tsc_freq; tc_init(&tsc_timecounter); } } +SYSINIT(tsc_tc, SI_SUB_SMP, SI_ORDER_ANY, init_TSC_tc, NULL); /* * When cpufreq levels change, find out about the (new) max frequency. We From owner-svn-src-head@FreeBSD.ORG Mon May 9 17:53:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 2363E1065686; Mon, 9 May 2011 17:53:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 9 May 2011 13:52:47 -0400 User-Agent: KMail/1.6.2 References: <201105091734.p49HY0P3006180@svn.freebsd.org> In-Reply-To: <201105091734.p49HY0P3006180@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_xnCyNZcCSRePH+t" Message-Id: <201105091352.49971.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 17:53:03 -0000 --Boundary-00=_xnCyNZcCSRePH+t Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Monday 09 May 2011 01:34 pm, Jung-uk Kim wrote: > Author: jkim > Date: Mon May 9 17:34:00 2011 > New Revision: 221703 > URL: http://svn.freebsd.org/changeset/base/221703 > > Log: > Implement boot-time TSC synchronization test for SMP. This test > is executed when the user has indicated that the system has > synchronized TSCs or it has P-state invariant TSCs. For the former > case, we may clear the tunable if it fails the test to prevent > accidental foot-shooting. For the latter case, we may set it if it > passes the test to notify the user that it may be usable. For now, we don't change TSC quality. However, if it goes well, I am planning on committing the attached patch to change that. If you experience any false detections, please report to me privately. Please also note that we don't test TSC drifts across cores at run-time, so we may have to leave SMP TSC quality as is, i.e., 800. It is yet to be determined. Please let me know what you think. Thanks! Jung-uk Kim --Boundary-00=_xnCyNZcCSRePH+t Content-Type: text/plain; charset="iso-8859-1"; name="tc_qualities.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tc_qualities.diff" Index: sys/dev/acpica/acpi_hpet.c =================================================================== --- sys/dev/acpica/acpi_hpet.c (revision 221701) +++ sys/dev/acpica/acpi_hpet.c (working copy) @@ -476,7 +476,7 @@ hpet_attach(device_t dev) sc->tc.tc_get_timecount = hpet_get_timecount, sc->tc.tc_counter_mask = ~0u, sc->tc.tc_name = "HPET", - sc->tc.tc_quality = 900, + sc->tc.tc_quality = 950, sc->tc.tc_frequency = sc->freq; sc->tc.tc_priv = sc; tc_init(&sc->tc); Index: sys/dev/acpica/acpi_timer.c =================================================================== --- sys/dev/acpica/acpi_timer.c (revision 221701) +++ sys/dev/acpica/acpi_timer.c (working copy) @@ -203,7 +203,7 @@ acpi_timer_probe(device_t dev) if (j == 10) { acpi_timer_timecounter.tc_name = "ACPI-fast"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount; - acpi_timer_timecounter.tc_quality = 1000; + acpi_timer_timecounter.tc_quality = 900; } else { acpi_timer_timecounter.tc_name = "ACPI-safe"; acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount_safe; Index: sys/x86/x86/tsc.c =================================================================== --- sys/x86/x86/tsc.c (revision 221703) +++ sys/x86/x86/tsc.c (working copy) @@ -385,7 +385,7 @@ test_smp_tsc(void) if (bootverbose) printf("SMP: %sed TSC synchronization test\n", smp_tsc ? "pass" : "fail"); - return (smp_tsc ? 800 : -100); + return (smp_tsc ? 1000 : -100); } #undef N @@ -422,9 +422,13 @@ init_TSC_tc(void) * synchronized. If the user is sure that the system has synchronized * TSCs, set kern.timecounter.smp_tsc tunable to a non-zero value. */ - if (smp_cpus > 1) + if (smp_cpus > 1) { tsc_timecounter.tc_quality = test_smp_tsc(); + goto init; + } #endif + if (tsc_is_invariant) + tsc_timecounter.tc_quality = 1000; init: if (tsc_freq != 0) { tsc_timecounter.tc_frequency = tsc_freq; --Boundary-00=_xnCyNZcCSRePH+t-- From owner-svn-src-head@FreeBSD.ORG Mon May 9 18:46:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25191106566C; Mon, 9 May 2011 18:46:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 159318FC16; Mon, 9 May 2011 18:46:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49IkntU008688; Mon, 9 May 2011 18:46:49 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49Iknns008683; Mon, 9 May 2011 18:46:49 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105091846.p49Iknns008683@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 9 May 2011 18:46:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221708 - in head/sys: dev/syscons isa pc98/cbus X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 18:46:50 -0000 Author: jkim Date: Mon May 9 18:46:49 2011 New Revision: 221708 URL: http://svn.freebsd.org/changeset/base/221708 Log: Move VT switching hack for suspend/resume from bus drivers to syscons.c using event handlers. A different version was Submitted by: Taku YAMAMOTO (taku at tackymt dot homeip dot net) Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h head/sys/isa/syscons_isa.c head/sys/pc98/cbus/syscons_cbus.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon May 9 18:31:26 2011 (r221707) +++ head/sys/dev/syscons/syscons.c Mon May 9 18:46:49 2011 (r221708) @@ -104,7 +104,8 @@ static scr_stat main_console; static struct tty *main_devs[MAXCONS]; static char init_done = COLD; -static char shutdown_in_progress = FALSE; +static int shutdown_in_progress = FALSE; +static int suspend_in_progress = FALSE; static char sc_malloc = FALSE; static int saver_mode = CONS_NO_SAVER; /* LKM/user saver */ @@ -128,6 +129,13 @@ static void none_saver(sc_softc_t *sc, static void (*current_saver)(sc_softc_t *, int) = none_saver; #endif +#ifdef SC_NO_SUSPEND_VTYSWITCH +static int sc_no_suspend_vtswitch = 1; +#else +static int sc_no_suspend_vtswitch = 0; +#endif +static int sc_susp_scr; + SYSCTL_NODE(_hw, OID_AUTO, syscons, CTLFLAG_RD, 0, "syscons"); SYSCTL_NODE(_hw_syscons, OID_AUTO, saver, CTLFLAG_RD, 0, "saver"); SYSCTL_INT(_hw_syscons_saver, OID_AUTO, keybonly, CTLFLAG_RW, @@ -142,6 +150,9 @@ SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_re SYSCTL_INT(_hw_syscons, OID_AUTO, kbd_debug, CTLFLAG_RW|CTLFLAG_SECURE, &enable_kdbkey, 0, "enable keyboard debug"); #endif +TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch); +SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW, + &sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend."); #if !defined(SC_NO_FONT_LOADING) && defined(SC_DFLT_FONT) #include "font.h" #endif @@ -170,7 +181,9 @@ static kbd_callback_func_t sckbdevent; static void scinit(int unit, int flags); static scr_stat *sc_get_stat(struct tty *tp); static void scterm(int unit, int flags); -static void scshutdown(void *arg, int howto); +static void scshutdown(void *, int); +static void scsuspend(void *); +static void scresume(void *); static u_int scgetc(sc_softc_t *sc, u_int flags); #define SCGETC_CN 1 #define SCGETC_NONBLOCK 2 @@ -518,10 +531,15 @@ sc_attach_unit(int unit, int flags) printf("\n"); } - /* register a shutdown callback for the kernel console */ - if (sc_console_unit == unit) - EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, - (void *)(uintptr_t)unit, SHUTDOWN_PRI_DEFAULT); + /* Register suspend/resume/shutdown callbacks for the kernel console. */ + if (sc_console_unit == unit) { + EVENTHANDLER_REGISTER(power_suspend, scsuspend, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(power_resume, scresume, NULL, + EVENTHANDLER_PRI_ANY); + EVENTHANDLER_REGISTER(shutdown_pre_sync, scshutdown, NULL, + SHUTDOWN_PRI_DEFAULT); + } for (vc = 0; vc < sc->vtys; vc++) { if (sc->dev[vc] == NULL) { @@ -1718,7 +1736,7 @@ sccnupdate(scr_stat *scp) { /* this is a cut-down version of scrn_timer()... */ - if (scp->sc->suspend_in_progress || scp->sc->font_loading_in_progress) + if (suspend_in_progress || scp->sc->font_loading_in_progress) return; if (debugger > 0 || panicstr || shutdown_in_progress) { @@ -1768,7 +1786,7 @@ scrn_timer(void *arg) return; /* don't do anything when we are performing some I/O operations */ - if (sc->suspend_in_progress || sc->font_loading_in_progress) { + if (suspend_in_progress || sc->font_loading_in_progress) { if (again) timeout(scrn_timer, sc, hz / 10); return; @@ -3007,16 +3025,64 @@ scterm(int unit, int flags) } static void -scshutdown(void *arg, int howto) +scshutdown(__unused void *arg, __unused int howto) { - /* assert(sc_console != NULL) */ - sc_touch_scrn_saver(); - if (!cold && sc_console - && sc_console->sc->cur_scp->smode.mode == VT_AUTO - && sc_console->smode.mode == VT_AUTO) - sc_switch_scr(sc_console->sc, sc_console->index); - shutdown_in_progress = TRUE; + KASSERT(sc_console != NULL, ("sc_console != NULL")); + KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL")); + KASSERT(sc_console->sc->cur_scp != NULL, + ("sc_console->sc->cur_scp != NULL")); + + sc_touch_scrn_saver(); + if (!cold && + sc_console->sc->cur_scp->index != sc_console->index && + sc_console->sc->cur_scp->smode.mode == VT_AUTO && + sc_console->smode.mode == VT_AUTO) + sc_switch_scr(sc_console->sc, sc_console->index); + shutdown_in_progress = TRUE; +} + +static void +scsuspend(__unused void *arg) +{ + int retry; + + KASSERT(sc_console != NULL, ("sc_console != NULL")); + KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL")); + KASSERT(sc_console->sc->cur_scp != NULL, + ("sc_console->sc->cur_scp != NULL")); + + sc_susp_scr = sc_console->sc->cur_scp->index; + if (sc_no_suspend_vtswitch || + sc_susp_scr == sc_console->index) { + sc_touch_scrn_saver(); + sc_susp_scr = -1; + return; + } + for (retry = 0; retry < 10; retry++) { + sc_switch_scr(sc_console->sc, sc_console->index); + if (!sc_console->sc->switch_in_progress) + break; + pause("scsuspend", hz); + } + suspend_in_progress = TRUE; +} + +static void +scresume(__unused void *arg) +{ + + KASSERT(sc_console != NULL, ("sc_console != NULL")); + KASSERT(sc_console->sc != NULL, ("sc_console->sc != NULL")); + KASSERT(sc_console->sc->cur_scp != NULL, + ("sc_console->sc->cur_scp != NULL")); + + suspend_in_progress = FALSE; + if (sc_susp_scr < 0) { + mark_all(sc_console->sc->cur_scp); + return; + } + sc_switch_scr(sc_console->sc, sc_susp_scr); } int Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon May 9 18:31:26 2011 (r221707) +++ head/sys/dev/syscons/syscons.h Mon May 9 18:46:49 2011 (r221708) @@ -230,7 +230,6 @@ typedef struct sc_softc { char switch_in_progress; char write_in_progress; char blink_in_progress; - char suspend_in_progress; struct mtx video_mtx; long scrn_time_stamp; Modified: head/sys/isa/syscons_isa.c ============================================================================== --- head/sys/isa/syscons_isa.c Mon May 9 18:31:26 2011 (r221707) +++ head/sys/isa/syscons_isa.c Mon May 9 18:46:49 2011 (r221708) @@ -69,17 +69,6 @@ __FBSDID("$FreeBSD$"); static devclass_t sc_devclass; static sc_softc_t main_softc; -#ifdef SC_NO_SUSPEND_VTYSWITCH -static int sc_no_suspend_vtswitch = 1; -#else -static int sc_no_suspend_vtswitch = 0; -#endif -static int sc_cur_scr; - -TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch); -SYSCTL_DECL(_hw_syscons); -SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW, - &sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend."); static void scidentify(driver_t *driver, device_t parent) @@ -108,53 +97,6 @@ scattach(device_t dev) SC_AUTODETECT_KBD)); } -static int -scsuspend(device_t dev) -{ - int retry = 10; - sc_softc_t *sc; - - sc = &main_softc; - - if (sc->cur_scp == NULL) - return (0); - - if (sc->suspend_in_progress == 0) { - sc_cur_scr = sc->cur_scp->index; - if (!sc_no_suspend_vtswitch && sc_cur_scr != 0) - do { - sc_switch_scr(sc, 0); - if (!sc->switch_in_progress) - break; - pause("scsuspend", hz); - } while (retry--); - } - sc->suspend_in_progress++; - - return (0); -} - -static int -scresume(device_t dev) -{ - sc_softc_t *sc; - - sc = &main_softc; - - if (sc->cur_scp == NULL) - return (0); - - sc->suspend_in_progress--; - if (sc->suspend_in_progress == 0) { - if (!sc_no_suspend_vtswitch && sc_cur_scr != 0) - sc_switch_scr(sc, sc_cur_scr); - else - mark_all(sc->cur_scp); - } - - return (0); -} - int sc_max_unit(void) { @@ -300,8 +242,6 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_identify, scidentify), DEVMETHOD(device_probe, scprobe), DEVMETHOD(device_attach, scattach), - DEVMETHOD(device_suspend, scsuspend), - DEVMETHOD(device_resume, scresume), { 0, 0 } }; @@ -312,70 +252,3 @@ static driver_t sc_driver = { }; DRIVER_MODULE(sc, isa, sc_driver, sc_devclass, 0, 0); - -static devclass_t scpm_devclass; - -static void -scpm_identify(driver_t *driver, device_t parent) -{ - - device_add_child(parent, "scpm", 0); -} - -static int -scpm_probe(device_t dev) -{ - - device_set_desc(dev, SC_DRIVER_NAME " suspend/resume"); - device_quiet(dev); - - return (BUS_PROBE_DEFAULT); -} - -static int -scpm_attach(device_t dev) -{ - - bus_generic_probe(dev); - bus_generic_attach(dev); - - return (0); -} - -static int -scpm_suspend(device_t dev) -{ - int error; - - error = bus_generic_suspend(dev); - if (error != 0) - return (error); - - return (scsuspend(dev)); -} - -static int -scpm_resume(device_t dev) -{ - - scresume(dev); - - return (bus_generic_resume(dev)); -} - -static device_method_t scpm_methods[] = { - DEVMETHOD(device_identify, scpm_identify), - DEVMETHOD(device_probe, scpm_probe), - DEVMETHOD(device_attach, scpm_attach), - DEVMETHOD(device_suspend, scpm_suspend), - DEVMETHOD(device_resume, scpm_resume), - { 0, 0 } -}; - -static driver_t scpm_driver = { - "scpm", - scpm_methods, - 0 -}; - -DRIVER_MODULE(scpm, vgapm, scpm_driver, scpm_devclass, 0, 0); Modified: head/sys/pc98/cbus/syscons_cbus.c ============================================================================== --- head/sys/pc98/cbus/syscons_cbus.c Mon May 9 18:31:26 2011 (r221707) +++ head/sys/pc98/cbus/syscons_cbus.c Mon May 9 18:46:49 2011 (r221708) @@ -49,17 +49,6 @@ __FBSDID("$FreeBSD$"); static devclass_t sc_devclass; static sc_softc_t main_softc; -#ifdef SC_NO_SUSPEND_VTYSWITCH -static int sc_no_suspend_vtswitch = 1; -#else -static int sc_no_suspend_vtswitch = 0; -#endif -static int sc_cur_scr; - -TUNABLE_INT("hw.syscons.sc_no_suspend_vtswitch", &sc_no_suspend_vtswitch); -SYSCTL_DECL(_hw_syscons); -SYSCTL_INT(_hw_syscons, OID_AUTO, sc_no_suspend_vtswitch, CTLFLAG_RW, - &sc_no_suspend_vtswitch, 0, "Disable VT switch before suspend."); static void scidentify(driver_t *driver, device_t parent) @@ -87,47 +76,6 @@ scattach(device_t dev) return sc_attach_unit(device_get_unit(dev), device_get_flags(dev)); } -static int -scsuspend(device_t dev) -{ - int retry = 10; - sc_softc_t *sc; - - sc = &main_softc; - - if (sc->cur_scp == NULL) - return (0); - - sc_cur_scr = sc->cur_scp->index; - - if (sc_no_suspend_vtswitch) - return (0); - - do { - sc_switch_scr(sc, 0); - if (!sc->switch_in_progress) { - break; - } - pause("scsuspend", hz); - } while (retry--); - - return (0); -} - -static int -scresume(device_t dev) -{ - sc_softc_t *sc; - - if (sc_no_suspend_vtswitch) - return (0); - - sc = &main_softc; - sc_switch_scr(sc, sc_cur_scr); - - return (0); -} - int sc_max_unit(void) { @@ -242,8 +190,6 @@ static device_method_t sc_methods[] = { DEVMETHOD(device_identify, scidentify), DEVMETHOD(device_probe, scprobe), DEVMETHOD(device_attach, scattach), - DEVMETHOD(device_suspend, scsuspend), - DEVMETHOD(device_resume, scresume), { 0, 0 } }; From owner-svn-src-head@FreeBSD.ORG Mon May 9 18:46:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3735F1065673; Mon, 9 May 2011 18:46:54 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 27C628FC1A; Mon, 9 May 2011 18:46:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49IksWB008727; Mon, 9 May 2011 18:46:54 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49IkrUQ008724; Mon, 9 May 2011 18:46:54 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201105091846.p49IkrUQ008724@svn.freebsd.org> From: David Christensen Date: Mon, 9 May 2011 18:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221709 - head/sys/dev/bxe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 18:46:54 -0000 Author: davidch Date: Mon May 9 18:46:53 2011 New Revision: 221709 URL: http://svn.freebsd.org/changeset/base/221709 Log: - Simplify multicast address programming. - Fix an incorrect "uint32_t *" cast in bxe_set_rx_mode(). Submitted by: yongari@ Approved by: davidch@ MFC after: Two weeks Modified: head/sys/dev/bxe/if_bxe.c head/sys/dev/bxe/if_bxe.h Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Mon May 9 18:46:49 2011 (r221708) +++ head/sys/dev/bxe/if_bxe.c Mon May 9 18:46:53 2011 (r221709) @@ -3323,7 +3323,7 @@ bxe_stop_locked(struct bxe_softc *sc, in bxe_set_mac_addr_e1(sc, 0); for (i = 0; i < config->hdr.length; i++) - CAM_INVALIDATE(config->config_table[i]); + CAM_INVALIDATE(&config->config_table[i]); config->hdr.length = i; config->hdr.offset = BXE_MAX_MULTICAST * (1 + port); @@ -14254,6 +14254,8 @@ static void bxe_set_mac_addr_e1(struct bxe_softc *sc, int set) { struct mac_configuration_cmd *config; + struct mac_configuration_entry *config_table; + uint8_t *eaddr; int port; DBENTER(BXE_VERBOSE_MISC); @@ -14274,43 +14276,40 @@ bxe_set_mac_addr_e1(struct bxe_softc *sc config->hdr.reserved1 = 0; /* Program the primary MAC address. */ - config->config_table[0].cam_entry.msb_mac_addr = - ntohs(*(uint16_t *)&sc->link_params.mac_addr[0]); - config->config_table[0].cam_entry.middle_mac_addr = - ntohs(*(uint16_t *)&sc->link_params.mac_addr[2]); - config->config_table[0].cam_entry.lsb_mac_addr = - ntohs(*(uint16_t *)&sc->link_params.mac_addr[4]); - config->config_table[0].cam_entry.flags = htole16(port); + config_table = &config->config_table[0]; + eaddr = sc->link_params.mac_addr; + config_table->cam_entry.msb_mac_addr = eaddr[0] << 8 | eaddr[1]; + config_table->cam_entry.middle_mac_addr = eaddr[2] << 8 | eaddr[3]; + config_table->cam_entry.lsb_mac_addr = eaddr[4] << 8 | eaddr[5]; + config_table->cam_entry.flags = htole16(port); if (set) - config->config_table[0].target_table_entry.flags = 0; + config_table->target_table_entry.flags = 0; else - CAM_INVALIDATE(config->config_table[0]); + CAM_INVALIDATE(config_table); - /* t48 config->config_table[0].target_table_entry.client_id = 0; */ - config->config_table[0].target_table_entry.vlan_id = 0; + config_table->target_table_entry.vlan_id = 0; DBPRINT(sc, BXE_VERBOSE, "%s(): %s MAC (%04x:%04x:%04x)\n", __FUNCTION__, (set ? "Setting" : "Clearing"), - config->config_table[0].cam_entry.msb_mac_addr, - config->config_table[0].cam_entry.middle_mac_addr, - config->config_table[0].cam_entry.lsb_mac_addr); + config_table->cam_entry.msb_mac_addr, + config_table->cam_entry.middle_mac_addr, + config_table->cam_entry.lsb_mac_addr); /* Program the broadcast MAC address. */ - config->config_table[1].cam_entry.msb_mac_addr = 0xffff; - config->config_table[1].cam_entry.middle_mac_addr = 0xffff; - config->config_table[1].cam_entry.lsb_mac_addr = 0xffff; - config->config_table[1].cam_entry.flags = htole16(port); + config_table = &config->config_table[1]; + config_table->cam_entry.msb_mac_addr = 0xffff; + config_table->cam_entry.middle_mac_addr = 0xffff; + config_table->cam_entry.lsb_mac_addr = 0xffff; + config_table->cam_entry.flags = htole16(port); if (set) - config->config_table[1].target_table_entry.flags = + config_table->target_table_entry.flags = TSTORM_CAM_TARGET_TABLE_ENTRY_BROADCAST; else - CAM_INVALIDATE(config->config_table[1]); - - /*t48 config->config_table[1].target_table_entry.client_id = 0; */ - config->config_table[1].target_table_entry.vlan_id = 0; + CAM_INVALIDATE(config_table); + config_table->target_table_entry.vlan_id = 0; /* Post the command to slow path queue. */ bxe_sp_post(sc, RAMROD_CMD_ID_ETH_SET_MAC, 0, @@ -14330,6 +14329,8 @@ static void bxe_set_mac_addr_e1h(struct bxe_softc *sc, int set) { struct mac_configuration_cmd_e1h *config; + struct mac_configuration_entry_e1h *config_table; + uint8_t *eaddr; int func, port; DBENTER(BXE_VERBOSE_MISC); @@ -14356,30 +14357,27 @@ bxe_set_mac_addr_e1h(struct bxe_softc *s config->hdr.reserved1 = 0; /* Program the primary MAC address. */ - config->config_table[0].msb_mac_addr = - ntohs(*(uint16_t *)&sc->link_params.mac_addr[0]); - config->config_table[0].middle_mac_addr = - ntohs(*(uint16_t *)&sc->link_params.mac_addr[2]); - config->config_table[0].lsb_mac_addr = - ntohs(*(uint16_t *)&sc->link_params.mac_addr[4]); - config->config_table[0].clients_bit_vector = - htole32(1 << sc->fp->cl_id); + config_table = &config->config_table[0]; + eaddr = sc->link_params.mac_addr; + config_table->msb_mac_addr = eaddr[0] << 8 | eaddr[1]; + config_table->middle_mac_addr = eaddr[2] << 8 | eaddr[3]; + config_table->lsb_mac_addr = eaddr[4] << 8 | eaddr[5]; + config_table->clients_bit_vector = htole32(1 << sc->fp->cl_id); - config->config_table[0].vlan_id = 0; - config->config_table[0].e1hov_id = htole16(sc->e1hov); + config_table->vlan_id = 0; + config_table->e1hov_id = htole16(sc->e1hov); if (set) - config->config_table[0].flags = port; + config_table->flags = port; else - config->config_table[0].flags = + config_table->flags = MAC_CONFIGURATION_ENTRY_E1H_ACTION_TYPE; DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): %s MAC (%04x:%04x:%04x), E1HOV = %d, CLID = %d\n", __FUNCTION__, (set ? "Setting" : "Clearing"), - config->config_table[0].msb_mac_addr, - config->config_table[0].middle_mac_addr, - config->config_table[0].lsb_mac_addr, sc->e1hov, BP_L_ID(sc)); + config_table->msb_mac_addr, config_table->middle_mac_addr, + config_table->lsb_mac_addr, sc->e1hov, BP_L_ID(sc)); bxe_sp_post(sc, RAMROD_CMD_ID_ETH_SET_MAC, 0, U64_HI(BXE_SP_MAPPING(sc, mac_config)), @@ -14402,7 +14400,9 @@ bxe_set_rx_mode(struct bxe_softc *sc) struct ifnet *ifp; struct ifmultiaddr *ifma; struct mac_configuration_cmd *config; + struct mac_configuration_entry *config_table; uint32_t mc_filter[MC_HASH_SIZE]; + uint8_t *maddr; uint32_t crc, bit, regidx, rx_mode; int i, old, offset, port; @@ -14431,8 +14431,8 @@ bxe_set_rx_mode(struct bxe_softc *sc) /* Enable promiscuous mode. */ rx_mode = BXE_RX_MODE_PROMISC; - } else if ((ifp->if_flags & IFF_ALLMULTI) || - (ifp->if_amcount > BXE_MAX_MULTICAST)) { + } else if (ifp->if_flags & IFF_ALLMULTI || + ifp->if_amcount > BXE_MAX_MULTICAST) { DBPRINT(sc, BXE_VERBOSE_MISC, "%s(): Enabling all multicast mode.\n", __FUNCTION__); @@ -14453,28 +14453,28 @@ bxe_set_rx_mode(struct bxe_softc *sc) TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) continue; - - config->config_table[i].cam_entry.msb_mac_addr = - bswap16(*(uint32_t *)(LLADDR((struct sockaddr_dl *)ifma->ifma_addr))); - config->config_table[i].cam_entry.middle_mac_addr = - bswap16(*(uint16_t *)(LLADDR((struct sockaddr_dl *)ifma->ifma_addr) + 2)); - config->config_table[i].cam_entry.lsb_mac_addr = - bswap16(*(uint16_t *)(LLADDR((struct sockaddr_dl *)ifma->ifma_addr) + 4)); - - config->config_table[i].cam_entry.flags = htole16(port); - config->config_table[i].target_table_entry.flags = 0; - config->config_table[i].target_table_entry. - clients_bit_vector = htole32(1 << BP_L_ID(sc)); - config->config_table[i].target_table_entry.vlan_id = 0; - + maddr = (uint8_t *)LLADDR( + (struct sockaddr_dl *)ifma->ifma_addr); + config_table = &config->config_table[i]; + config_table->cam_entry.msb_mac_addr = + maddr[0] << 8 | maddr[1]; + config_table->cam_entry.middle_mac_addr = + maddr[2] << 8 | maddr[3]; + config_table->cam_entry.lsb_mac_addr = + maddr[4] << 8 | maddr[5]; + config_table->cam_entry.flags = htole16(port); + config_table->target_table_entry.flags = 0; + config_table->target_table_entry. + clients_bit_vector = + htole32(1 << BP_L_ID(sc)); + config_table->target_table_entry.vlan_id = 0; i++; - DBPRINT(sc, BXE_INFO, "%s(): Setting MCAST[%d] (%04X:%04X:%04X)\n", __FUNCTION__, i, - config->config_table[i].cam_entry.msb_mac_addr, - config->config_table[i].cam_entry.middle_mac_addr, - config->config_table[i].cam_entry.lsb_mac_addr); + config_table->cam_entry.msb_mac_addr, + config_table->cam_entry.middle_mac_addr, + config_table->cam_entry.lsb_mac_addr); } IF_ADDR_UNLOCK(ifp); @@ -14484,11 +14484,11 @@ bxe_set_rx_mode(struct bxe_softc *sc) /* Invalidate any extra MC entries in the CAM. */ if (old > i) { for (; i < old; i++) { - if (CAM_IS_INVALID( - config->config_table[i])) + config_table = &config->config_table[i]; + if (CAM_IS_INVALID(config_table)) break; /* Invalidate */ - CAM_INVALIDATE(config->config_table[i]); + CAM_INVALIDATE(config_table); } } @@ -14501,7 +14501,6 @@ bxe_set_rx_mode(struct bxe_softc *sc) bxe_sp_post(sc, RAMROD_CMD_ID_ETH_SET_MAC, 0, U64_HI(BXE_SP_MAPPING(sc, mcast_config)), U64_LO(BXE_SP_MAPPING(sc, mcast_config)), 0); - } else { /* E1H */ /* Accept one or more multicasts */ memset(mc_filter, 0, 4 * MC_HASH_SIZE); Modified: head/sys/dev/bxe/if_bxe.h ============================================================================== --- head/sys/dev/bxe/if_bxe.h Mon May 9 18:46:49 2011 (r221708) +++ head/sys/dev/bxe/if_bxe.h Mon May 9 18:46:53 2011 (r221709) @@ -1773,11 +1773,11 @@ struct bxe_softc { USTORM_ETH_ST_CONTEXT_CONFIG_BD_SB_INDEX_NUMBER)) #define CAM_IS_INVALID(x) \ - (x.target_table_entry.flags == \ + ((x)->target_table_entry.flags == \ TSTORM_CAM_TARGET_TABLE_ENTRY_ACTION_TYPE) #define CAM_INVALIDATE(x) \ - (x.target_table_entry.flags = TSTORM_CAM_TARGET_TABLE_ENTRY_ACTION_TYPE) + ((x)->target_table_entry.flags = TSTORM_CAM_TARGET_TABLE_ENTRY_ACTION_TYPE) /* Number of uint32_t elements in multicast hash array. */ #define MC_HASH_SIZE 8 From owner-svn-src-head@FreeBSD.ORG Mon May 9 19:34:50 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84F81106566C; Mon, 9 May 2011 19:34:50 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 42F6B8FC0C; Mon, 9 May 2011 19:34:49 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.4/8.14.2) with ESMTP id p49J0BQJ017523; Mon, 9 May 2011 15:00:11 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.4/8.14.2/Submit) id p49J0A9Z017522; Mon, 9 May 2011 15:00:10 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Mon, 9 May 2011 15:00:10 -0400 From: David Schultz To: Bruce Evans Message-ID: <20110509190010.GA17384@zim.MIT.EDU> Mail-Followup-To: Bruce Evans , Hans Petter Selasky , mdf@freebsd.org, "src-committers@freebsd.org" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" References: <201105071628.p47GSO16006145@svn.freebsd.org> <201105071836.00660.hselasky@c2i.net> <201105071955.35305.hselasky@c2i.net> <20110508195020.V981@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110508195020.V981@besplex.bde.org> Cc: "svn-src-head@freebsd.org" , mdf@FreeBSD.ORG, "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Hans Petter Selasky Subject: Re: svn commit: r221604 - head/usr.sbin/usbdump X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 19:34:50 -0000 On Sun, May 08, 2011, Bruce Evans wrote: > #define bzero(p, n) ({ \ > if (__builtin_constant_p(n) && (n) <= 32) \ > __builtin_memset((p), 0, (n)); \ > else \ > (bzero)((p), (n)); \ > }) > > This hard-codes the limit of 32 for the builtin since some versions of > gcc use a worse limit. > > In userland, on at least amd64 and i386, the extern bzero() and memset() > are unoptimized, but the compiler builtin is used for memset() only. A > better implementation of bzero() would use the compiler builtin for it > too. The above is not good enough for libc, since it evaluates args more > than once and has a hard-coded gccism. __builtin_constant_p(exp) is a special macro that doesn't (or shouldn't) cause exp to be evaluated, so your defintion shouldn't cause the argument to be evaluated more than once unless it is, in fact, a constant expression... and if it's a constant expression, we don't care. gcc purportedly has a bzero() builtin, by the way. I'm not sure if it's normally enabled, or whether it's any good. I doubt it's smart enough to translate memset(p, 0, len) into bzero(p, len). From owner-svn-src-head@FreeBSD.ORG Mon May 9 20:10:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5C2A1065670; Mon, 9 May 2011 20:10:46 +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 C6AA48FC08; Mon, 9 May 2011 20:10:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49KAkml011388; Mon, 9 May 2011 20:10:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49KAko0011386; Mon, 9 May 2011 20:10:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105092010.p49KAko0011386@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 May 2011 20:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221712 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 20:10:46 -0000 Author: yongari Date: Mon May 9 20:10:46 2011 New Revision: 221712 URL: http://svn.freebsd.org/changeset/base/221712 Log: Since r117657, bge(4) does not enable buffer manager for BCM5705 or newer controllers. However, all data sheet I have access has no indication that buffer manager should not be touched on these controllers. It seems the buffer manager always runs on BCM5705 or newer controllers. Some controller(e.g. BCM5719) needs other buffer manager configuration so driver should enable buffer manager for all controllers. Both Linux and OpenBSD/NetBSD use the same approach. This change polls enable bit of block to know whether specified block was really stopped as well as enabling buffer manager for all controllers in driver initialization. Obtained from: NetBSD Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Mon May 9 19:40:36 2011 (r221711) +++ head/sys/dev/bge/if_bge.c Mon May 9 20:10:46 2011 (r221712) @@ -403,6 +403,7 @@ static void bge_start(struct ifnet *); static int bge_ioctl(struct ifnet *, u_long, caddr_t); static void bge_init_locked(struct bge_softc *); static void bge_init(void *); +static void bge_stop_block(struct bge_softc *, bus_size_t, uint32_t); static void bge_stop(struct bge_softc *); static void bge_watchdog(struct bge_softc *); static int bge_shutdown(device_t); @@ -1593,22 +1594,19 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10); /* Enable buffer manager */ - if (!(BGE_IS_5705_PLUS(sc))) { - CSR_WRITE_4(sc, BGE_BMAN_MODE, - BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN); + CSR_WRITE_4(sc, BGE_BMAN_MODE, + BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN); - /* Poll for buffer manager start indication */ - for (i = 0; i < BGE_TIMEOUT; i++) { - DELAY(10); - if (CSR_READ_4(sc, BGE_BMAN_MODE) & BGE_BMANMODE_ENABLE) - break; - } + /* Poll for buffer manager start indication */ + for (i = 0; i < BGE_TIMEOUT; i++) { + DELAY(10); + if (CSR_READ_4(sc, BGE_BMAN_MODE) & BGE_BMANMODE_ENABLE) + break; + } - if (i == BGE_TIMEOUT) { - device_printf(sc->bge_dev, - "buffer manager failed to start\n"); - return (ENXIO); - } + if (i == BGE_TIMEOUT) { + device_printf(sc->bge_dev, "buffer manager failed to start\n"); + return (ENXIO); } /* Enable flow-through queues */ @@ -5136,6 +5134,20 @@ bge_watchdog(struct bge_softc *sc) ifp->if_oerrors++; } +static void +bge_stop_block(struct bge_softc *sc, bus_size_t reg, uint32_t bit) +{ + int i; + + BGE_CLRBIT(sc, reg, bit); + + for (i = 0; i < BGE_TIMEOUT; i++) { + if ((CSR_READ_4(sc, reg) & bit) == 0) + return; + DELAY(100); + } +} + /* * Stop the adapter and free any mbufs allocated to the * RX and TX lists. @@ -5164,35 +5176,36 @@ bge_stop(struct bge_softc *sc) /* * Disable all of the receiver blocks. */ - BGE_CLRBIT(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); - BGE_CLRBIT(sc, BGE_RBDI_MODE, BGE_RBDIMODE_ENABLE); - BGE_CLRBIT(sc, BGE_RXLP_MODE, BGE_RXLPMODE_ENABLE); - if (!(BGE_IS_5705_PLUS(sc))) - BGE_CLRBIT(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); - BGE_CLRBIT(sc, BGE_RDBDI_MODE, BGE_RBDIMODE_ENABLE); - BGE_CLRBIT(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE); - BGE_CLRBIT(sc, BGE_RBDC_MODE, BGE_RBDCMODE_ENABLE); + bge_stop_block(sc, BGE_RX_MODE, BGE_RXMODE_ENABLE); + bge_stop_block(sc, BGE_RBDI_MODE, BGE_RBDIMODE_ENABLE); + bge_stop_block(sc, BGE_RXLP_MODE, BGE_RXLPMODE_ENABLE); + if (BGE_IS_5700_FAMILY(sc)) + bge_stop_block(sc, BGE_RXLS_MODE, BGE_RXLSMODE_ENABLE); + bge_stop_block(sc, BGE_RDBDI_MODE, BGE_RBDIMODE_ENABLE); + bge_stop_block(sc, BGE_RDC_MODE, BGE_RDCMODE_ENABLE); + bge_stop_block(sc, BGE_RBDC_MODE, BGE_RBDCMODE_ENABLE); /* * Disable all of the transmit blocks. */ - BGE_CLRBIT(sc, BGE_SRS_MODE, BGE_SRSMODE_ENABLE); - BGE_CLRBIT(sc, BGE_SBDI_MODE, BGE_SBDIMODE_ENABLE); - BGE_CLRBIT(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); - BGE_CLRBIT(sc, BGE_RDMA_MODE, BGE_RDMAMODE_ENABLE); - BGE_CLRBIT(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); - if (!(BGE_IS_5705_PLUS(sc))) - BGE_CLRBIT(sc, BGE_DMAC_MODE, BGE_DMACMODE_ENABLE); - BGE_CLRBIT(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); + bge_stop_block(sc, BGE_SRS_MODE, BGE_SRSMODE_ENABLE); + bge_stop_block(sc, BGE_SBDI_MODE, BGE_SBDIMODE_ENABLE); + bge_stop_block(sc, BGE_SDI_MODE, BGE_SDIMODE_ENABLE); + bge_stop_block(sc, BGE_RDMA_MODE, BGE_RDMAMODE_ENABLE); + bge_stop_block(sc, BGE_SDC_MODE, BGE_SDCMODE_ENABLE); + if (BGE_IS_5700_FAMILY(sc)) + bge_stop_block(sc, BGE_DMAC_MODE, BGE_DMACMODE_ENABLE); + bge_stop_block(sc, BGE_SBDC_MODE, BGE_SBDCMODE_ENABLE); /* * Shut down all of the memory managers and related * state machines. */ - BGE_CLRBIT(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE); - BGE_CLRBIT(sc, BGE_WDMA_MODE, BGE_WDMAMODE_ENABLE); - if (!(BGE_IS_5705_PLUS(sc))) - BGE_CLRBIT(sc, BGE_MBCF_MODE, BGE_MBCFMODE_ENABLE); + bge_stop_block(sc, BGE_HCC_MODE, BGE_HCCMODE_ENABLE); + bge_stop_block(sc, BGE_WDMA_MODE, BGE_WDMAMODE_ENABLE); + if (BGE_IS_5700_FAMILY(sc)) + bge_stop_block(sc, BGE_MBCF_MODE, BGE_MBCFMODE_ENABLE); + CSR_WRITE_4(sc, BGE_FTQ_RESET, 0xFFFFFFFF); CSR_WRITE_4(sc, BGE_FTQ_RESET, 0); if (!(BGE_IS_5705_PLUS(sc))) { From owner-svn-src-head@FreeBSD.ORG Mon May 9 20:20:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23FD51065674; Mon, 9 May 2011 20:20:44 +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 15C6C8FC08; Mon, 9 May 2011 20:20:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49KKhIL011708; Mon, 9 May 2011 20:20:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49KKhDi011705; Mon, 9 May 2011 20:20:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105092020.p49KKhDi011705@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 May 2011 20:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221713 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 20:20:44 -0000 Author: yongari Date: Mon May 9 20:20:43 2011 New Revision: 221713 URL: http://svn.freebsd.org/changeset/base/221713 Log: Recognize BCM5719C PHY. Submitted by: Geans Pin at Broadcom Modified: head/sys/dev/mii/brgphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/brgphy.c ============================================================================== --- head/sys/dev/mii/brgphy.c Mon May 9 20:10:46 2011 (r221712) +++ head/sys/dev/mii/brgphy.c Mon May 9 20:20:43 2011 (r221713) @@ -140,6 +140,7 @@ static const struct mii_phydesc brgphys[ MII_PHY_DESC(BROADCOM2, BCM5761), MII_PHY_DESC(BROADCOM2, BCM5784), MII_PHY_DESC(BROADCOM3, BCM5717C), + MII_PHY_DESC(BROADCOM3, BCM5719C), MII_PHY_DESC(BROADCOM3, BCM57765), MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), MII_PHY_END Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Mon May 9 20:10:46 2011 (r221712) +++ head/sys/dev/mii/miidevs Mon May 9 20:20:43 2011 (r221713) @@ -177,6 +177,7 @@ model BROADCOM2 BCM5709C 0x003c BCM5709 model BROADCOM2 BCM5761 0x003d BCM5761 10/100/1000baseT PHY model BROADCOM2 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T media interface +model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface From owner-svn-src-head@FreeBSD.ORG Mon May 9 20:27:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E254106566C; Mon, 9 May 2011 20:27:49 +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 8FE7F8FC1C; Mon, 9 May 2011 20:27:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49KRnPJ011955; Mon, 9 May 2011 20:27:49 GMT (envelope-from mlaier@svn.freebsd.org) Received: (from mlaier@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49KRnkJ011953; Mon, 9 May 2011 20:27:49 GMT (envelope-from mlaier@svn.freebsd.org) Message-Id: <201105092027.p49KRnkJ011953@svn.freebsd.org> From: Max Laier Date: Mon, 9 May 2011 20:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221714 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 20:27:49 -0000 Author: mlaier Date: Mon May 9 20:27:49 2011 New Revision: 221714 URL: http://svn.freebsd.org/changeset/base/221714 Log: Another long standing vm bug found at Isilon: Fix a race between vm_object_collapse and vm_fault. Reviewed by: alc@ MFC after: 3 days Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon May 9 20:20:43 2011 (r221713) +++ head/sys/vm/vm_object.c Mon May 9 20:27:49 2011 (r221714) @@ -1468,6 +1468,24 @@ vm_object_backing_scan(vm_object_t objec pp = vm_page_lookup(object, new_pindex); if ( + (op & OBSC_COLLAPSE_NOWAIT) != 0 && + (pp != NULL && pp->valid == 0) + ) { + /* + * The page in the parent is not (yet) valid. + * We don't know anything about the state of + * the original page. It might be mapped, + * so we must avoid the next if here. + * + * This is due to a race in vm_fault() where + * we must unbusy the original (backing_obj) + * page before we can (re)lock the parent. + * Hence we can get here. + */ + p = next; + continue; + } + if ( pp != NULL || vm_pager_has_page(object, new_pindex, NULL, NULL) ) { From owner-svn-src-head@FreeBSD.ORG Mon May 9 21:51:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C76B7106566B; Mon, 9 May 2011 21:51:59 +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 B70D78FC08; Mon, 9 May 2011 21:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p49LpxaE014485; Mon, 9 May 2011 21:51:59 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p49Lpxp8014470; Mon, 9 May 2011 21:51:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105092151.p49Lpxp8014470@svn.freebsd.org> From: Xin LI Date: Mon, 9 May 2011 21:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221715 - head/contrib/less X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2011 21:51:59 -0000 Author: delphij Date: Mon May 9 21:51:59 2011 New Revision: 221715 URL: http://svn.freebsd.org/changeset/base/221715 Log: MFV: Update to less v443. MFC after: 1 month Modified: head/contrib/less/LICENSE head/contrib/less/Makefile.aut head/contrib/less/Makefile.wnm head/contrib/less/NEWS head/contrib/less/README head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/charset.h head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/configure head/contrib/less/configure.ac head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/defines.ds head/contrib/less/defines.h.in head/contrib/less/defines.o2 head/contrib/less/defines.o9 head/contrib/less/defines.wn head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.man head/contrib/less/less.nro head/contrib/less/lessecho.c head/contrib/less/lessecho.man head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.h head/contrib/less/lesskey.man head/contrib/less/lesskey.nro head/contrib/less/lglob.h head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/pattern.h head/contrib/less/pckeys.h head/contrib/less/position.c head/contrib/less/position.h head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c head/contrib/less/version.c Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/LICENSE ============================================================================== --- head/contrib/less/LICENSE Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/LICENSE Mon May 9 21:51:59 2011 (r221715) @@ -2,7 +2,7 @@ ------------ Less -Copyright (C) 1984-2009 Mark Nudelman +Copyright (C) 1984-2011 Mark Nudelman Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/contrib/less/Makefile.aut ============================================================================== --- head/contrib/less/Makefile.aut Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/Makefile.aut Mon May 9 21:51:59 2011 (r221715) @@ -34,6 +34,14 @@ DISTFILES = \ all: help.c funcs.h ${srcdir}/configure +release: .FORCE + ${MAKE} -f Makefile.aut tagall + ${MAKE} -f Makefile.aut all + ${MAKE} -f Makefile.aut clean + ${MAKE} -f Makefile.aut dist + +.FORCE: + help.c: less.hlp mkhelp -mv -f ${srcdir}/help.c ${srcdir}/help.c.old rm -rf help.c Modified: head/contrib/less/Makefile.wnm ============================================================================== --- head/contrib/less/Makefile.wnm Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/Makefile.wnm Mon May 9 21:51:59 2011 (r221715) @@ -7,11 +7,11 @@ CC = cl # Normal flags CFLAGS = /nologo /ML /W3 /GX /O2 /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c -LDFLAGS = /subsystem:console /incremental:no /machine:I386 +LDFLAGS = /nologo /subsystem:console /incremental:no /machine:I386 # Debugging flags #CFLAGS = /nologo /MDd /W3 /GX /Od /Gm /Zi /I "." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /c -#LDFLAGS = /subsystem:console /incremental:yes /debug /machine:I386 +#LDFLAGS = /nologo /subsystem:console /incremental:yes /debug /machine:I386 LD = link LIBS = user32.lib Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/NEWS Mon May 9 21:51:59 2011 (r221715) @@ -12,6 +12,37 @@ ====================================================================== + Major changes between "less" versions 436 and 443 + +* Change search behavior such that when a search is given an explicit + pattern, the entire displayed screen is included in the search and + not just the portion after the target line. + +* Add -A option to change search behavior to the old way: only + the portion of the screen after the target line is searched. + +* Add %F formatting to prompt strings, replaced by the last component + of the input file. + +* Control-G while editing a command exits the command. + +* Less now exits with status 2 if control-C is pressed and -K is in effect. + +* Fix "ungetc overflow" when passing long commands via the -p option. + +* Fix bug in using line filtering via the & command + in combination with -i and -I. + +* Fix bug in handling negative arguments to the -j option. + +* Fix bug in handling %t in prompt strings. + +* Improve handling of long option names. + +* Improve percentage calculation for very large files. + +====================================================================== + Major changes between "less" versions 429 and 436 * Don't pass "-" to non-pipe LESSOPEN unless it starts with "-". Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/README Mon May 9 21:51:59 2011 (r221715) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 436 + Less, version 443 - This is the distribution of less, version 436, released 07 Jul 2009. + This is the distribution of less, version 443, released 09 Apr 2011. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -101,6 +101,10 @@ complaints, etc., you may mail to the au Note to hackers: comments noting possible improvements are enclosed in double curly brackets {{ like this }}. +(Note that the above note was originally written at a time when +"hackers" most commonly meant "enthusiastic and dedicated computer +programmers", not "persons who attempt to circumvent computer security".) + ======================================================================= Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/brac.c Mon May 9 21:51:59 2011 (r221715) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/ch.c Mon May 9 21:51:59 2011 (r221715) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/charset.c Mon May 9 21:51:59 2011 (r221715) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -395,7 +395,7 @@ init_charset() binary_char(c) LWCHAR c; { - if (utf_mode) + if (utf_mode) return (is_ubin_char(c)); c &= 0377; return (chardef[c] & IS_BINARY_CHAR); @@ -817,7 +817,7 @@ static struct wchar_range ubin_table[] = { 0x000B, 0x000C} /* Cc */, { 0x000E, 0x001A} /* Cc */, { 0x001C, 0x001F} /* Cc */, - { 0x007F, 0x009F} /* Cc */, + { 0x007F, 0x009F} /* Cc */, #if 0 { 0x00AD, 0x00AD} /* Cf */, #endif Modified: head/contrib/less/charset.h ============================================================================== --- head/contrib/less/charset.h Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/charset.h Mon May 9 21:51:59 2011 (r221715) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2009 Mark Nudelman + * Copyright (C) 2005-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/cmd.h Mon May 9 21:51:59 2011 (r221715) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -98,6 +98,7 @@ #define EC_F_COMPLETE 17 #define EC_B_COMPLETE 18 #define EC_LITERAL 19 +#define EC_ABORT 20 #define EC_NOACTION 101 #define EC_UINVALID 102 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/cmdbuf.c Mon May 9 21:51:59 2011 (r221715) @@ -1,5 +1,5 @@ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -857,6 +857,10 @@ cmd_edit(c) case EC_LINEKILL: not_in_completion(); return (cmd_kill()); + case EC_ABORT: + not_in_completion(); + (void) cmd_kill(); + return (CC_QUIT); case EC_W_BACKSPACE: not_in_completion(); return (cmd_werase()); Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/command.c Mon May 9 21:51:59 2011 (r221715) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /* - * Copyright (C) 1984-2009 Mark Nudelman + * Copyright (C) 1984-2011 Mark Nudelman * * You may distribute under the terms of either the GNU General Public * License or the Less License, as specified in the README file. @@ -57,8 +57,6 @@ extern int shift_count; extern int oldbot; extern int forw_prompt; -static char ungot[UNGOT_SIZE]; -static char *ungotp = NULL; #if SHELL_ESCAPE static char *shellcmd = NULL; /* For holding last shell command for "!!" */ #endif @@ -66,7 +64,8 @@ static int mca; /* The multicharacter static int search_type; /* The previous type of search */ static LINENUM number; /* The number typed by the user */ static long fraction; /* The fractional part of the number */ -static char optchar; +static struct loption *curropt; +static int opt_lower; static int optflag; static int optgetname; static POSITION bottompos; @@ -75,6 +74,13 @@ static int save_hshift; static char pipec; #endif +struct ungot { + struct ungot *ug_next; + char ug_char; +}; +static struct ungot* ungot = NULL; +static int unget_end = 0; + static void multi_search(); /* @@ -228,8 +234,8 @@ exec_mca() every_first_cmd = save(cbuf); break; case A_OPT_TOGGLE: - toggle_option(optchar, cbuf, optflag); - optchar = '\0'; + toggle_option(curropt, opt_lower, cbuf, optflag); + curropt = NULL; break; case A_F_BRACKET: match_brac(cbuf[0], cbuf[1], 1, (int) number); @@ -282,22 +288,254 @@ exec_mca() } /* - * Add a character to a multi-character command. + * Is a character an erase or kill char? */ static int -mca_char(c) +is_erase_char(c) + int c; +{ + return (c == erase_char || c == erase2_char || c == kill_char); +} + +/* + * Handle the first char of an option (after the initial dash). + */ + static int +mca_opt_first_char(c) + int c; +{ + int flag = (optflag & ~OPT_NO_PROMPT); + if (flag == OPT_NO_TOGGLE) + { + switch (c) + { + case '_': + /* "__" = long option name. */ + optgetname = TRUE; + mca_opt_toggle(); + return (MCA_MORE); + } + } else + { + switch (c) + { + case '+': + /* "-+" = UNSET. */ + optflag = (flag == OPT_UNSET) ? + OPT_TOGGLE : OPT_UNSET; + mca_opt_toggle(); + return (MCA_MORE); + case '!': + /* "-!" = SET */ + optflag = (flag == OPT_SET) ? + OPT_TOGGLE : OPT_SET; + mca_opt_toggle(); + return (MCA_MORE); + case CONTROL('P'): + optflag ^= OPT_NO_PROMPT; + mca_opt_toggle(); + return (MCA_MORE); + case '-': + /* "--" = long option name. */ + optgetname = TRUE; + mca_opt_toggle(); + return (MCA_MORE); + } + } + /* Char was not handled here. */ + return (NO_MCA); +} + +/* + * Add a char to a long option name. + * See if we've got a match for an option name yet. + * If so, display the complete name and stop + * accepting chars until user hits RETURN. + */ + static int +mca_opt_nonfirst_char(c) int c; { char *p; - int flag; - char buf[3]; + char *oname; + + if (curropt != NULL) + { + /* + * Already have a match for the name. + * Don't accept anything but erase/kill. + */ + if (is_erase_char(c)) + return (MCA_DONE); + return (MCA_MORE); + } + /* + * Add char to cmd buffer and try to match + * the option name. + */ + if (cmd_char(c) == CC_QUIT) + return (MCA_DONE); + p = get_cmdbuf(); + opt_lower = ASCII_IS_LOWER(p[0]); + curropt = findopt_name(&p, &oname, NULL); + if (curropt != NULL) + { + /* + * Got a match. + * Remember the option and + * display the full option name. + */ + cmd_reset(); + mca_opt_toggle(); + for (p = oname; *p != '\0'; p++) + { + c = *p; + if (!opt_lower && ASCII_IS_LOWER(c)) + c = ASCII_TO_UPPER(c); + if (cmd_char(c) != CC_OK) + return (MCA_DONE); + } + } + return (MCA_MORE); +} + +/* + * Handle a char of an option toggle command. + */ + static int +mca_opt_char(c) + int c; +{ PARG parg; + /* + * This may be a short option (single char), + * or one char of a long option name, + * or one char of the option parameter. + */ + if (curropt == NULL && len_cmdbuf() == 0) + { + int ret = mca_opt_first_char(c); + if (ret != NO_MCA) + return (ret); + } + if (optgetname) + { + /* We're getting a long option name. */ + if (c != '\n' && c != '\r') + return (mca_opt_nonfirst_char(c)); + if (curropt == NULL) + { + parg.p_string = get_cmdbuf(); + error("There is no --%s option", &parg); + return (MCA_DONE); + } + optgetname = FALSE; + cmd_reset(); + } else + { + if (is_erase_char(c)) + return (NO_MCA); + if (curropt != NULL) + /* We're getting the option parameter. */ + return (NO_MCA); + curropt = findopt(c); + if (curropt == NULL) + { + parg.p_string = propt(c); + error("There is no %s option", &parg); + return (MCA_DONE); + } + } + /* + * If the option which was entered does not take a + * parameter, toggle the option immediately, + * so user doesn't have to hit RETURN. + */ + if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || + !opt_has_param(curropt)) + { + toggle_option(curropt, ASCII_IS_LOWER(c), "", optflag); + return (MCA_DONE); + } + /* + * Display a prompt appropriate for the option parameter. + */ + start_mca(A_OPT_TOGGLE, opt_prompt(curropt), (void*)NULL, 0); + return (MCA_MORE); +} + +/* + * Handle a char of a search command. + */ + static int +mca_search_char(c) + int c; +{ + int flag = 0; + + /* + * Certain characters as the first char of + * the pattern have special meaning: + * ! Toggle the NO_MATCH flag + * * Toggle the PAST_EOF flag + * @ Toggle the FIRST_FILE flag + */ + if (len_cmdbuf() > 0) + return (NO_MCA); + + switch (c) + { + case '*': + if (less_is_more) + break; + case CONTROL('E'): /* ignore END of file */ + if (mca != A_FILTER) + flag = SRCH_PAST_EOF; + break; + case '@': + if (less_is_more) + break; + case CONTROL('F'): /* FIRST file */ + if (mca != A_FILTER) + flag = SRCH_FIRST_FILE; + break; + case CONTROL('K'): /* KEEP position */ + if (mca != A_FILTER) + flag = SRCH_NO_MOVE; + break; + case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ + flag = SRCH_NO_REGEX; + break; + case CONTROL('N'): /* NOT match */ + case '!': + flag = SRCH_NO_MATCH; + break; + } + + if (flag != 0) + { + search_type ^= flag; + mca_search(); + return (MCA_MORE); + } + return (NO_MCA); +} + +/* + * Handle a character of a multi-character command. + */ + static int +mca_char(c) + int c; +{ + int ret; + switch (mca) { case 0: /* - * Not in a multicharacter command. + * We're not in a multicharacter command. */ return (NO_MCA); @@ -320,7 +558,8 @@ mca_char(c) { /* * Not part of the number. - * Treat as a normal command character. + * End the number and treat this char + * as a normal command character. */ number = cmd_int(&fraction); mca = 0; @@ -330,218 +569,26 @@ mca_char(c) break; case A_OPT_TOGGLE: - /* - * Special case for the TOGGLE_OPTION command. - * If the option letter which was entered is a - * single-char option, execute the command immediately, - * so user doesn't have to hit RETURN. - * If the first char is + or -, this indicates - * OPT_UNSET or OPT_SET respectively, instead of OPT_TOGGLE. - * "--" begins inputting a long option name. - */ - if (optchar == '\0' && len_cmdbuf() == 0) - { - flag = (optflag & ~OPT_NO_PROMPT); - if (flag == OPT_NO_TOGGLE) - { - switch (c) - { - case '_': - /* "__" = long option name. */ - optgetname = TRUE; - mca_opt_toggle(); - return (MCA_MORE); - } - } else - { - switch (c) - { - case '+': - /* "-+" = UNSET. */ - optflag = (flag == OPT_UNSET) ? - OPT_TOGGLE : OPT_UNSET; - mca_opt_toggle(); - return (MCA_MORE); - case '!': - /* "-!" = SET */ - optflag = (flag == OPT_SET) ? - OPT_TOGGLE : OPT_SET; - mca_opt_toggle(); - return (MCA_MORE); - case CONTROL('P'): - optflag ^= OPT_NO_PROMPT; - mca_opt_toggle(); - return (MCA_MORE); - case '-': - /* "--" = long option name. */ - optgetname = TRUE; - mca_opt_toggle(); - return (MCA_MORE); - } - } - } - if (optgetname) - { - /* - * We're getting a long option name. - * See if we've matched an option name yet. - * If so, display the complete name and stop - * accepting chars until user hits RETURN. - */ - struct loption *o; - char *oname; - int lc; - - if (c == '\n' || c == '\r') - { - /* - * When the user hits RETURN, make sure - * we've matched an option name, then - * pretend he just entered the equivalent - * option letter. - */ - if (optchar == '\0') - { - parg.p_string = get_cmdbuf(); - error("There is no --%s option", &parg); - return (MCA_DONE); - } - optgetname = FALSE; - cmd_reset(); - c = optchar; - } else - { - if (optchar != '\0') - { - /* - * Already have a match for the name. - * Don't accept anything but erase/kill. - */ - if (c == erase_char || - c == erase2_char || - c == kill_char) - return (MCA_DONE); - return (MCA_MORE); - } - /* - * Add char to cmd buffer and try to match - * the option name. - */ - if (cmd_char(c) == CC_QUIT) - return (MCA_DONE); - p = get_cmdbuf(); - lc = ASCII_IS_LOWER(p[0]); - o = findopt_name(&p, &oname, NULL); - if (o != NULL) - { - /* - * Got a match. - * Remember the option letter and - * display the full option name. - */ - optchar = o->oletter; - if (!lc && ASCII_IS_LOWER(optchar)) - optchar = ASCII_TO_UPPER(optchar); - cmd_reset(); - mca_opt_toggle(); - for (p = oname; *p != '\0'; p++) - { - c = *p; - if (!lc && ASCII_IS_LOWER(c)) - c = ASCII_TO_UPPER(c); - if (cmd_char(c) != CC_OK) - return (MCA_DONE); - } - } - return (MCA_MORE); - } - } else - { - if (c == erase_char || c == erase2_char || c == kill_char) - break; - if (optchar != '\0') - /* We already have the option letter. */ - break; - } - - optchar = c; - if ((optflag & ~OPT_NO_PROMPT) != OPT_TOGGLE || - single_char_option(c)) - { - toggle_option(c, "", optflag); - return (MCA_DONE); - } - /* - * Display a prompt appropriate for the option letter. - */ - if ((p = opt_prompt(c)) == NULL) - { - buf[0] = '-'; - buf[1] = c; - buf[2] = '\0'; - p = buf; - } - start_mca(A_OPT_TOGGLE, p, (void*)NULL, 0); - return (MCA_MORE); + ret = mca_opt_char(c); + if (ret != NO_MCA) + return (ret); + break; case A_F_SEARCH: case A_B_SEARCH: case A_FILTER: - /* - * Special case for search commands. - * Certain characters as the first char of - * the pattern have special meaning: - * ! Toggle the NO_MATCH flag - * * Toggle the PAST_EOF flag - * @ Toggle the FIRST_FILE flag - */ - if (len_cmdbuf() > 0) - /* - * Only works for the first char of the pattern. - */ - break; + ret = mca_search_char(c); + if (ret != NO_MCA) + return (ret); + break; - flag = 0; - switch (c) - { - case '*': - if (less_is_more) - break; - case CONTROL('E'): /* ignore END of file */ - if (mca != A_FILTER) - flag = SRCH_PAST_EOF; - break; - case '@': - if (less_is_more) - break; - case CONTROL('F'): /* FIRST file */ - if (mca != A_FILTER) - flag = SRCH_FIRST_FILE; - break; - case CONTROL('K'): /* KEEP position */ - if (mca != A_FILTER) - flag = SRCH_NO_MOVE; - break; - case CONTROL('R'): /* Don't use REGULAR EXPRESSIONS */ - flag = SRCH_NO_REGEX; - break; - case CONTROL('N'): /* NOT match */ - case '!': - flag = SRCH_NO_MATCH; - break; - } - if (flag != 0) - { - search_type ^= flag; - mca_search(); - return (MCA_MORE); - } + default: + /* Other multicharacter command. */ break; } /* - * Any other multicharacter command - * is terminated by a newline. + * The multichar command is terminated by a newline. */ if (c == '\n' || c == '\r') { @@ -641,7 +688,7 @@ prompt() { register char *p; - if (ungotp != NULL && ungotp > ungot) + if (ungot != NULL) { /* * No prompt necessary if commands are from @@ -731,48 +778,59 @@ dispversion() public int getcc() { - if (ungotp == NULL) + if (unget_end) + { /* - * Normal case: no ungotten chars, so get one from the user. + * We have just run out of ungotten chars. */ - return (getchr()); - - if (ungotp > ungot) + unget_end = 0; + if (len_cmdbuf() == 0 || !empty_screen()) + return (getchr()); /* - * Return the next ungotten char. + * Command is incomplete, so try to complete it. */ - return (*--ungotp); + switch (mca) + { + case A_DIGIT: + /* + * We have a number but no command. Treat as #g. + */ + return ('g'); - /* - * We have just run out of ungotten chars. - */ - ungotp = NULL; - if (len_cmdbuf() == 0 || !empty_screen()) - return (getchr()); - /* - * Command is incomplete, so try to complete it. - */ - switch (mca) - { - case A_DIGIT: - /* - * We have a number but no command. Treat as #g. - */ - return ('g'); + case A_F_SEARCH: + case A_B_SEARCH: + /* + * We have "/string" but no newline. Add the \n. + */ + return ('\n'); - case A_F_SEARCH: - case A_B_SEARCH: - /* - * We have "/string" but no newline. Add the \n. - */ - return ('\n'); + default: + /* + * Some other incomplete command. Let user complete it. + */ + return (getchr()); + } + } - default: + if (ungot == NULL) + { /* - * Some other incomplete command. Let user complete it. + * Normal case: no ungotten chars, so get one from the user. */ return (getchr()); } + + /* + * Return the next ungotten char. + */ + { + struct ungot *ug = ungot; + char c = ug->ug_char; + ungot = ug->ug_next; + free(ug); + unget_end = (ungot == NULL); + return (c); + } } /* @@ -783,14 +841,11 @@ getcc() ungetcc(c) int c; { - if (ungotp == NULL) - ungotp = ungot; - if (ungotp >= ungot + sizeof(ungot)) - { - error("ungetcc overflow", NULL_PARG); - quit(QUIT_ERROR); - } - *ungotp++ = c; + struct ungot *ug = (struct ungot *) ecalloc(1, sizeof(struct ungot)); + + ug->ug_char = c; + ug->ug_next = ungot; + ungot = ug; } /* @@ -933,7 +988,7 @@ commands() mca = 0; cmd_accept(); number = 0; - optchar = '\0'; + curropt = NULL; /* * See if any signals need processing. Modified: head/contrib/less/configure ============================================================================== --- head/contrib/less/configure Mon May 9 20:27:49 2011 (r221714) +++ head/contrib/less/configure Mon May 9 21:51:59 2011 (r221715) @@ -1,18 +1,22 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for less 1. +# Generated by GNU Autoconf 2.67 for less 1. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -20,23 +24,15 @@ if test -n "${ZSH_VERSION+set}" && (emul alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; esac - fi - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - as_nl=' ' export as_nl @@ -44,7 +40,13 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -55,7 +57,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in + case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -78,13 +80,6 @@ if test "${PATH_SEPARATOR+set}" != set; } fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -94,15 +89,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -case $0 in +case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done IFS=$as_save_IFS ;; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue May 10 01:05:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 906161065673; Tue, 10 May 2011 01:05:41 +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 823F18FC18; Tue, 10 May 2011 01:05:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4A15fBB020236; Tue, 10 May 2011 01:05:41 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4A15fwJ020234; Tue, 10 May 2011 01:05:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105100105.p4A15fwJ020234@svn.freebsd.org> From: Xin LI Date: Tue, 10 May 2011 01:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221718 - head/usr.bin/less X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 01:05:41 -0000 Author: delphij Date: Tue May 10 01:05:41 2011 New Revision: 221718 URL: http://svn.freebsd.org/changeset/base/221718 Log: Regenerated with latest configure script. MFC after: 1 month Modified: head/usr.bin/less/defines.h Modified: head/usr.bin/less/defines.h ============================================================================== --- head/usr.bin/less/defines.h Mon May 9 22:29:54 2011 (r221717) +++ head/usr.bin/less/defines.h Tue May 10 01:05:41 2011 (r221718) @@ -221,6 +221,9 @@ /* Define HAVE_FILENO if you have the fileno() macro. */ #define HAVE_FILENO 1 +/* Define HAVE_FLOAT if your compiler supports the "double" type. */ +#define HAVE_FLOAT 1 + /* Define to 1 if you have the `fsync' function. */ #define HAVE_FSYNC 1 @@ -388,6 +391,9 @@ /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "less" +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + /* Define to the version of this package. */ #define PACKAGE_VERSION "1" From owner-svn-src-head@FreeBSD.ORG Tue May 10 02:34:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27815106566B; Tue, 10 May 2011 02:34:12 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18A488FC14; Tue, 10 May 2011 02:34:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4A2YBc3022810; Tue, 10 May 2011 02:34:11 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4A2YB4h022808; Tue, 10 May 2011 02:34:11 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201105100234.p4A2YB4h022808@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 10 May 2011 02:34:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221719 - head/sbin/devd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 02:34:12 -0000 Author: bms Date: Tue May 10 02:34:11 2011 New Revision: 221719 URL: http://svn.freebsd.org/changeset/base/221719 Log: Typo. For USB devices, 'serial' should be 'sernum'. See sys/dev/usb/usb_device.c for what devctl_notify() gets. Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Tue May 10 01:05:41 2011 (r221718) +++ head/sbin/devd/devd.conf.5 Tue May 10 02:34:11 2011 (r221719) @@ -283,7 +283,7 @@ Hub port number (USB) Product ID (pccard/USB). .It Li release Hardware revision (USB) -.It Li serial +.It Li sernum Serial Number (USB). .It Li slot Card slot. From owner-svn-src-head@FreeBSD.ORG Tue May 10 02:38:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B282106564A; Tue, 10 May 2011 02:38:44 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C70C8FC12; Tue, 10 May 2011 02:38:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4A2ciOo022964; Tue, 10 May 2011 02:38:44 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4A2ci8F022962; Tue, 10 May 2011 02:38:44 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <201105100238.p4A2ci8F022962@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 10 May 2011 02:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221720 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 02:38:44 -0000 Author: bms Date: Tue May 10 02:38:44 2011 New Revision: 221720 URL: http://svn.freebsd.org/changeset/base/221720 Log: Add VID for Simtec Electronics. Add PID for Simtec Electronics EntropyKey, a hardware random number generator. Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 10 02:34:11 2011 (r221719) +++ head/sys/dev/usb/usbdevs Tue May 10 02:38:44 2011 (r221720) @@ -681,6 +681,7 @@ vendor HAUPPAUGE2 0x2040 Hauppauge Compu vendor TLAYTECH 0x20b9 Tlay Tech vendor ENCORE 0x203d Encore vendor PARA 0x20b8 PARA Industrial +vendor SIMTEC 0x20df Simtec Electronics vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor TRIPPLITE 0x2478 Tripp-Lite @@ -2513,6 +2514,9 @@ product PANASONIC TYTP50P6S 0x3900 TY-TP /* PARA Industrial products */ product PARA RT3070 0x8888 RT3070 +/* Simtec Electronics products */ +product SIMTEC ENTROPYKEY 0x0001 Entropy Key + /* Pegatron products */ product PEGATRON RT2870 0x0002 RT2870 product PEGATRON RT3070 0x000c RT3070 From owner-svn-src-head@FreeBSD.ORG Tue May 10 04:32:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79568106564A; Tue, 10 May 2011 04:32:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 691758FC15; Tue, 10 May 2011 04:32:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4A4WR2O026667; Tue, 10 May 2011 04:32:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4A4WRvM026664; Tue, 10 May 2011 04:32:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105100432.p4A4WRvM026664@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 May 2011 04:32:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221722 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 04:32:27 -0000 Author: adrian Date: Tue May 10 04:32:27 2011 New Revision: 221722 URL: http://svn.freebsd.org/changeset/base/221722 Log: AR9285 (Kite) fixes. * Correct some of the silicon revision checks to match what the Atheros HAL does. (See [1] below.) * Move the PA cal and init cal method assignment to -after- the mac version/revision IDs are stored. The AR9285 init cal was never being called. * Enable ANI. Note Kite 1.0 and 1.1 were prototypes that shouldn't be seen in the wild. Linux ath9k simply removed the prototype code from their codebase. I'm going to leave it in there for now but make it conditionally compilable in the future. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue May 10 02:58:08 2011 (r221721) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Tue May 10 04:32:27 2011 (r221722) @@ -74,8 +74,33 @@ static void ar9285WriteIni(struct ath_ha static void ar9285AniSetup(struct ath_hal *ah) { - /* NB: disable ANI for reliable RIFS rx */ - ar5416AniAttach(ah, AH_NULL, AH_NULL, AH_FALSE); + /* + * These are the parameters from the AR5416 ANI code; + * they likely need quite a bit of adjustment for the + * AR9285. + */ + static const struct ar5212AniParams aniparams = { + .maxNoiseImmunityLevel = 4, /* levels 0..4 */ + .totalSizeDesired = { -55, -55, -55, -55, -62 }, + .coarseHigh = { -14, -14, -14, -14, -12 }, + .coarseLow = { -64, -64, -64, -64, -70 }, + .firpwr = { -78, -78, -78, -78, -80 }, + .maxSpurImmunityLevel = 2, + .cycPwrThr1 = { 2, 4, 6 }, + .maxFirstepLevel = 2, /* levels 0..2 */ + .firstep = { 0, 4, 8 }, + .ofdmTrigHigh = 500, + .ofdmTrigLow = 200, + .cckTrigHigh = 200, + .cckTrigLow = 100, + .rssiThrHigh = 40, + .rssiThrLow = 7, + .period = 100, + }; + /* NB: disable ANI noise immmunity for reliable RIFS rx */ + AH5416(ah)->ah_ani_function &= ~ HAL_ANI_NOISE_IMMUNITY_LEVEL; + + ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } /* @@ -122,10 +147,6 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s AH5416(ah)->ah_cal.adcDcCalInitData.calData = &ar9280_adc_init_dc_cal; AH5416(ah)->ah_cal.suppCals = ADC_GAIN_CAL | ADC_DC_CAL | IQ_MISMATCH_CAL; - if (AR_SREV_KITE_12_OR_LATER(ah)) - AH5416(ah)->ah_cal_initcal = ar9285InitCalHardware; - AH5416(ah)->ah_cal_pacal = ar9002_hw_pa_cal; - AH5416(ah)->ah_spurMitigate = ar9280SpurMitigate; AH5416(ah)->ah_writeIni = ar9285WriteIni; AH5416(ah)->ah_rx_chainmask = AR9285_DEFAULT_RXCHAINMASK; @@ -173,6 +194,12 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s } ar5416AttachPCIE(ah); + /* Attach methods that require MAC version/revision info */ + if (AR_SREV_KITE_12_OR_LATER(ah)) + AH5416(ah)->ah_cal_initcal = ar9285InitCalHardware; + if (AR_SREV_KITE_11_OR_LATER(ah)) + AH5416(ah)->ah_cal_pacal = ar9002_hw_pa_cal; + ecode = ath_hal_v4kEepromAttach(ah); if (ecode != HAL_OK) goto bad; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Tue May 10 02:58:08 2011 (r221721) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Tue May 10 04:32:27 2011 (r221722) @@ -60,13 +60,13 @@ ar9285_hw_pa_cal(struct ath_hal *ah, HAL { 0x7838, 0 }, }; - HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n"); - /* PA CAL is not needed for high power solution */ if (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL) == AR5416_EEP_TXGAIN_HIGH_POWER) return; + HALDEBUG(ah, HAL_DEBUG_PERCAL, "Running PA Calibration\n"); + for (i = 0; i < N(regList); i++) regList[i][1] = OS_REG_READ(ah, regList[i][0]); @@ -151,7 +151,7 @@ ar9285_hw_pa_cal(struct ath_hal *ah, HAL void ar9002_hw_pa_cal(struct ath_hal *ah, HAL_BOOL is_reset) { - if (AR_SREV_KITE_12_OR_LATER(ah)) { + if (AR_SREV_KITE_11_OR_LATER(ah)) { if (is_reset || !AH9285(ah)->pacal_info.skipcount) ar9285_hw_pa_cal(ah, is_reset); else @@ -260,7 +260,8 @@ HAL_BOOL ar9285InitCalHardware(struct ath_hal *ah, const struct ieee80211_channel *chan) { - if (! ar9285_hw_clc(ah, chan)) + if (AR_SREV_KITE(ah) && AR_SREV_KITE_10_OR_LATER(ah) && + (! ar9285_hw_clc(ah, chan))) return AH_FALSE; return AH_TRUE; From owner-svn-src-head@FreeBSD.ORG Tue May 10 10:48:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1238E1065678; Tue, 10 May 2011 10:48:44 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0311F8FC18; Tue, 10 May 2011 10:48:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AAmhnG040879; Tue, 10 May 2011 10:48:43 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AAmht1040877; Tue, 10 May 2011 10:48:43 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101048.p4AAmht1040877@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 10:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221726 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 10:48:44 -0000 Author: ru Date: Tue May 10 10:48:43 2011 New Revision: 221726 URL: http://svn.freebsd.org/changeset/base/221726 Log: Another fallout from r220359: MK_GNU_CPIO was mistakenly re-added after being removed in r205702. Remove it again. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue May 10 07:12:11 2011 (r221725) +++ head/share/mk/bsd.own.mk Tue May 10 10:48:43 2011 (r221726) @@ -394,7 +394,6 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ - GNU_CPIO \ HESIOD \ ICONV \ IDEA \ @@ -405,7 +404,7 @@ __DEFAULT_NO_OPTIONS = \ # this means that we have to test TARGET_ARCH (the buildworld case) as well # as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not # used at all in bsd.*.mk, but we have to make an exception here if we want -# to allow defaults for some things like clang and ftd to vary by target +# to allow defaults for some things like clang and fdt to vary by target # architecture. # .if defined(TARGET_ARCH) From owner-svn-src-head@FreeBSD.ORG Tue May 10 10:58:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36475106566C; Tue, 10 May 2011 10:58:58 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 271128FC16; Tue, 10 May 2011 10:58:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AAwwB3041209; Tue, 10 May 2011 10:58:58 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AAwwkv041206; Tue, 10 May 2011 10:58:58 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201105101058.p4AAwwkv041206@svn.freebsd.org> From: Poul-Henning Kamp Date: Tue, 10 May 2011 10:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221727 - head/usr.bin/tip/tip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 10:58:58 -0000 Author: phk Date: Tue May 10 10:58:57 2011 New Revision: 221727 URL: http://svn.freebsd.org/changeset/base/221727 Log: Flush the scriptfile whenever we see a non-graphical character to get more real-time logging, without forcing a write(2) on every single character. Modified: head/usr.bin/tip/tip/tipout.c Modified: head/usr.bin/tip/tip/tipout.c ============================================================================== --- head/usr.bin/tip/tip/tipout.c Tue May 10 10:48:43 2011 (r221726) +++ head/usr.bin/tip/tip/tipout.c Tue May 10 10:58:57 2011 (r221727) @@ -170,12 +170,18 @@ tipout(void) if (boolean(value(SCRIPT)) && fscript != NULL) { if (!boolean(value(BEAUTIFY))) { fwrite(buf, 1, cnt, fscript); - continue; + } else { + for (cp = buf; cp < buf + cnt; cp++) + if ((*cp >= ' ' && *cp <= '~') || + any(*cp, value(EXCEPTIONS))) + putc(*cp, fscript); + } + for (cp = buf; cp < buf + cnt; cp++) { + if (!isgraph(*cp)) { + fflush(fscript); + break; + } } - for (cp = buf; cp < buf + cnt; cp++) - if ((*cp >= ' ' && *cp <= '~') || - any(*cp, value(EXCEPTIONS))) - putc(*cp, fscript); } } } From owner-svn-src-head@FreeBSD.ORG Tue May 10 11:00:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DBFC1065673; Tue, 10 May 2011 11:00:40 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9138FC15; Tue, 10 May 2011 11:00:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AB0edI041316; Tue, 10 May 2011 11:00:40 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AB0e3G041314; Tue, 10 May 2011 11:00:40 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101100.p4AB0e3G041314@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 11:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221728 - head/share/mk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 11:00:40 -0000 Author: ru Date: Tue May 10 11:00:40 2011 New Revision: 221728 URL: http://svn.freebsd.org/changeset/base/221728 Log: Removed unsupported options MK_BINUTILS and MK_GCC that were silently added in r218936. Modified: head/share/mk/bsd.own.mk Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Tue May 10 10:58:57 2011 (r221727) +++ head/share/mk/bsd.own.mk Tue May 10 11:00:40 2011 (r221728) @@ -297,7 +297,6 @@ __DEFAULT_YES_OPTIONS = \ BIND_MTREE \ BIND_NAMED \ BIND_UTILS \ - BINUTILS \ BLUETOOTH \ BOOT \ BSD_CPIO \ @@ -318,7 +317,6 @@ __DEFAULT_YES_OPTIONS = \ FP_LIBC \ FREEBSD_UPDATE \ GAMES \ - GCC \ GCOV \ GDB \ GNU \ From owner-svn-src-head@FreeBSD.ORG Tue May 10 11:06:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93DDD1065670; Tue, 10 May 2011 11:06:14 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6B68FC0A; Tue, 10 May 2011 11:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AB6EZb041515; Tue, 10 May 2011 11:06:14 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AB6EUC041514; Tue, 10 May 2011 11:06:14 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101106.p4AB6EUC041514@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 11:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221729 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 11:06:14 -0000 Author: ru Date: Tue May 10 11:06:14 2011 New Revision: 221729 URL: http://svn.freebsd.org/changeset/base/221729 Log: The Objective C support was removed in r220755. Submitted by: des Deleted: head/tools/build/options/WITHOUT_OBJC From owner-svn-src-head@FreeBSD.ORG Tue May 10 11:14:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A90D6106566B; Tue, 10 May 2011 11:14:40 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98C128FC0A; Tue, 10 May 2011 11:14:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ABEe1V041834; Tue, 10 May 2011 11:14:40 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ABEeqM041830; Tue, 10 May 2011 11:14:40 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101114.p4ABEeqM041830@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 11:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221730 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 11:14:40 -0000 Author: ru Date: Tue May 10 11:14:40 2011 New Revision: 221730 URL: http://svn.freebsd.org/changeset/base/221730 Log: - There now exist options that have different defaults depending on the architecture, reflect this in documentation. For such options, both WITH_FOO and WITHOUT_FOO description files should be provided. Prodded by: des - Setting a build option may enforce other build options, try harder to detect this case. - Setting a build option may change other option's default value, try harder to detect this case. Added: head/tools/build/options/WITH_CLANG - copied, changed from r221204, head/tools/build/options/WITHOUT_CLANG head/tools/build/options/WITH_FDT - copied, changed from r221539, head/tools/build/options/WITHOUT_FDT Modified: head/tools/build/options/makeman Copied and modified: head/tools/build/options/WITH_CLANG (from r221204, head/tools/build/options/WITHOUT_CLANG) ============================================================================== --- head/tools/build/options/WITHOUT_CLANG Fri Apr 29 10:33:54 2011 (r221204, copy source) +++ head/tools/build/options/WITH_CLANG Tue May 10 11:14:40 2011 (r221730) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build the Clang C/C++ compiler. +Set to build the Clang C/C++ compiler. Copied and modified: head/tools/build/options/WITH_FDT (from r221539, head/tools/build/options/WITHOUT_FDT) ============================================================================== --- head/tools/build/options/WITHOUT_FDT Fri May 6 19:10:27 2011 (r221539, copy source) +++ head/tools/build/options/WITH_FDT Tue May 10 11:14:40 2011 (r221730) @@ -1,3 +1,3 @@ .\" $FreeBSD$ -Set to not build Flattened Device Tree support as part of the base system. +Set to build Flattened Device Tree support as part of the base system. This includes the device tree compiler (dtc) and libfdt support library. Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Tue May 10 11:06:14 2011 (r221729) +++ head/tools/build/options/makeman Tue May 10 11:14:40 2011 (r221730) @@ -2,34 +2,98 @@ # # This file is in the public domain. +set -o errexit + ident='$FreeBSD$' +t=$(mktemp -d -t makeman) +trap 'test -d $t && rm -rf $t' exit + # -# usage: show { settings | options } ... +# usage: no_targets all_targets yes_targets +# +no_targets() +{ + for t1 in $1 ; do + for t2 in $2 ; do + if [ "${t1}" = "${t2}" ] ; then + continue 2 + fi + done + echo ${t1} + done +} + +show_options() +{ + ALL_TARGETS=$(echo $(make -C ../../.. targets | tail -n +2)) + rm -f $t/settings + for target in ${ALL_TARGETS} ; do + make -C ../../.. showconfig \ + SRCCONF=/dev/null __MAKE_CONF=/dev/null \ + TARGET_ARCH=${target#*/} TARGET=${target%/*} | + while read var _ val ; do + opt=${var#MK_} + case ${val} in + yes) + echo ${opt} ${target} + ;; + no) + echo ${opt} + ;; + *) + echo 'make showconfig broken' >&2 + exit 1 + ;; + esac + done > $t/settings.target + if [ -r $t/settings ] ; then + join -t\ $t/settings $t/settings.target > $t/settings.new + mv $t/settings.new $t/settings + else + mv $t/settings.target $t/settings + fi + done + + cat $t/settings | while read opt targets ; do + if [ "${targets}" = "${ALL_TARGETS}" ] ; then + echo "WITHOUT_${opt}" + elif [ -z "${targets}" ] ; then + echo "WITH_${opt}" + else + echo "WITHOUT_${opt}" $(no_targets "${ALL_TARGETS}" "${targets}") + echo "WITH_${opt} ${targets}" + fi + done +} + +# +# usage: show { settings | with | without } ... # show() { - mode=$1; shift + mode=$1 ; shift case ${mode} in settings) yes_prefix=WITH no_prefix=WITHOUT ;; - options) - yes_prefix=WITHOUT + with) + yes_prefix=WITH no_prefix=WITH ;; + without) + yes_prefix=WITHOUT + no_prefix=WITHOUT + ;; *) - echo "internal error" >/dev/stderr + echo 'internal error' >&2 exit 1 ;; esac - ( - cd ../../.. - make "$@" showconfig SRCCONF=/dev/null __MAKE_CONF=/dev/null - ) | - while read var _ val; do + make -C ../../.. "$@" showconfig __MAKE_CONF=/dev/null | + while read var _ val ; do opt=${var#MK_} case ${val} in yes) @@ -39,7 +103,7 @@ show() echo ${no_prefix}_${opt} ;; *) - echo "make showconfig broken" >/dev/stderr + echo 'make showconfig broken' >&2 exit 1 ;; esac @@ -49,7 +113,6 @@ show() main() { - trap 'rm -f _defcfg _config _config2 _deps _deps2' exit ident=${ident#$} ident=${ident% $} fbsdid='$'FreeBSD'$' @@ -57,7 +120,7 @@ main() .\" DO NOT EDIT-- this file is automatically generated. .\" from ${ident} .\" ${fbsdid} -.Dd $(LC_TIME=C date +'%B %e, %Y') +.Dd $(echo $(LC_TIME=C date +'%B %e, %Y')) .Dt SRC.CONF 5 .Os .Sh NAME @@ -134,46 +197,68 @@ The following list provides a name and s that can be used for source builds. .Bl -tag -width indent EOF - show settings |sort >_defcfg - show options | - while read opt; do - if [ -f ${opt} ]; then - cat < $t/config_default + show with SRCCONF=/dev/null | sort > $t/config_WITH_ALL + show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL + + show_options | + while read opt targets ; do + if [ ! -f ${opt} ] ; then + echo "no description found for ${opt}, skipping" >&2 + continue + else + echo ".It Va ${opt}" sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} + if [ -n "${targets}" ] ; then + echo '.Pp' + echo 'It is a default setting on' + echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). + fi + fi + + if [ "${opt%%_*}" = "WITHOUT" ] ; then + sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf + show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt} + comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps + elif [ "${opt%%_*}" = "WITH" ] ; then + sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf + show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt} + comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps else - echo "no description found for ${opt}, skipping" >/dev/stderr - continue + echo 'internal error' >&2 + exit 1 fi - show settings -D${opt} |sort >_config - comm -13 _defcfg _config |grep -v "^${opt}$" >_deps - if [ -s _deps ]; then - cat <_config2 - comm -13 _config _config2 >_deps2 - if [ -s _deps2 ]; then - cat < $t/config_${opt} + comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" | + comm -13 $t/deps - > $t/deps2 + + if [ -s $t/deps2 ] ; then + if [ -s $t/deps ] ; then + echo '.Pp' + fi + echo 'When set, the following options are also in effect:' + echo '.Pp' + echo '.Bl -inset -compact' + cat $t/deps2 | while read opt2 ; do + echo ".It Va ${opt2}" + noopt=$(echo ${opt2} | sed -e's/WITH_/WITHOUT_/;t' -e's/WITHOUT_/WITH_/') + echo '(unless' + echo ".Va ${noopt}" + echo 'is set explicitly)' + done + echo '.El' fi done cat < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55E12106564A; Tue, 10 May 2011 12:40:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459438FC0A; Tue, 10 May 2011 12:40:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ACeaAD044382; Tue, 10 May 2011 12:40:36 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ACeaug044380; Tue, 10 May 2011 12:40:36 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201105101240.p4ACeaug044380@svn.freebsd.org> From: John Baldwin Date: Tue, 10 May 2011 12:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221731 - head/sys/dev/puc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 12:40:36 -0000 Author: jhb Date: Tue May 10 12:40:35 2011 New Revision: 221731 URL: http://svn.freebsd.org/changeset/base/221731 Log: Add an entry for the SIIG Quartet Serial 850 which uses an Oxford chip with a non-default clock. PR: kern/147583 MFC after: 1 week Modified: head/sys/dev/puc/pucdata.c Modified: head/sys/dev/puc/pucdata.c ============================================================================== --- head/sys/dev/puc/pucdata.c Tue May 10 11:14:40 2011 (r221730) +++ head/sys/dev/puc/pucdata.c Tue May 10 12:40:35 2011 (r221731) @@ -638,6 +638,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_4S, 0x10, 0, 8, }, + { 0x1415, 0x9501, 0x131f, 0x2052, + "SIIG Quartet Serial 850", + DEFAULT_RCLK * 10, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x1415, 0x9501, 0x14db, 0x2150, "Kuroutoshikou SERIAL4P-LPPCI2", DEFAULT_RCLK * 10, From owner-svn-src-head@FreeBSD.ORG Tue May 10 12:57:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE71D106564A; Tue, 10 May 2011 12:57:39 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DF0F8FC0A; Tue, 10 May 2011 12:57:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ACvdsi044903; Tue, 10 May 2011 12:57:39 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ACvdKu044901; Tue, 10 May 2011 12:57:39 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101257.p4ACvdKu044901@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 12:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221732 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 12:57:39 -0000 Author: ru Date: Tue May 10 12:57:39 2011 New Revision: 221732 URL: http://svn.freebsd.org/changeset/base/221732 Log: Style. Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Tue May 10 12:40:35 2011 (r221731) +++ head/tools/build/options/makeman Tue May 10 12:57:39 2011 (r221732) @@ -206,21 +206,21 @@ EOF if [ ! -f ${opt} ] ; then echo "no description found for ${opt}, skipping" >&2 continue - else - echo ".It Va ${opt}" - sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} - if [ -n "${targets}" ] ; then - echo '.Pp' - echo 'It is a default setting on' - echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). - fi fi - if [ "${opt%%_*}" = "WITHOUT" ] ; then + echo ".It Va ${opt}" + sed -e's/\$\(FreeBSD: .*\) \$/from \1/' ${opt} + if [ -n "${targets}" ] ; then + echo '.Pp' + echo 'It is a default setting on' + echo $(echo ${targets} | sed -e's/ /, /g' -e's/\(.*\), /\1 and /'). + fi + + if [ "${opt%%_*}" = 'WITHOUT' ] ; then sed -n "/^WITH_${opt#WITHOUT_}$/!s/$/=/p" $t/config_WITH_ALL > $t/src.conf show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITH_ALL_${opt} comm -13 $t/config_WITH_ALL $t/config_WITH_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps - elif [ "${opt%%_*}" = "WITH" ] ; then + elif [ "${opt%%_*}" = 'WITH' ] ; then sed -n "/^WITHOUT${opt#WITH}$/!s/$/=/p" $t/config_WITHOUT_ALL > $t/src.conf show settings SRCCONF=$t/src.conf -D${opt} | sort > $t/config_WITHOUT_ALL_${opt} comm -13 $t/config_WITHOUT_ALL $t/config_WITHOUT_ALL_${opt} | sed -n "/^${opt}$/!p" > $t/deps From owner-svn-src-head@FreeBSD.ORG Tue May 10 13:01:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 768F8106566B; Tue, 10 May 2011 13:01:11 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66AE48FC16; Tue, 10 May 2011 13:01:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AD1Bh4045061; Tue, 10 May 2011 13:01:11 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AD1BFa045059; Tue, 10 May 2011 13:01:11 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101301.p4AD1BFa045059@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 13:01:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221733 - head/tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 13:01:11 -0000 Author: ru Date: Tue May 10 13:01:11 2011 New Revision: 221733 URL: http://svn.freebsd.org/changeset/base/221733 Log: Reassurance for impatient. Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Tue May 10 12:57:39 2011 (r221732) +++ head/tools/build/options/makeman Tue May 10 13:01:11 2011 (r221733) @@ -260,6 +260,7 @@ EOF done echo '.El' fi + twiddle >&2 done cat < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FE15106566C; Tue, 10 May 2011 13:25:43 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E1ED8FC1C; Tue, 10 May 2011 13:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ADPhJK045828; Tue, 10 May 2011 13:25:43 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ADPhs3045825; Tue, 10 May 2011 13:25:43 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105101325.p4ADPhs3045825@svn.freebsd.org> From: Ruslan Ermilov Date: Tue, 10 May 2011 13:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221734 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 13:25:43 -0000 Author: ru Date: Tue May 10 13:25:42 2011 New Revision: 221734 URL: http://svn.freebsd.org/changeset/base/221734 Log: Regen. Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue May 10 13:01:11 2011 (r221733) +++ head/share/man/man5/src.conf.5 Tue May 10 13:25:42 2011 (r221734) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: head/tools/build/options/makeman 221161 2011-04-28 11:21:49Z des +.\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd April 30, 2011 +.Dd May 10, 2011 .Dt SRC.CONF 5 .Os .Sh NAME @@ -78,9 +78,9 @@ The following list provides a name and s that can be used for source builds. .Bl -tag -width indent .It Va WITHOUT_ACCT -.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 183242 2008-09-21 22:02:26Z sam +.\" from FreeBSD: head/tools/build/options/WITHOUT_ACCT 221540 2011-05-06 19:13:03Z ru Set to not build process accounting tools such as -.Xr ac 8 +.Xr ac 8 and .Xr accton 8 . .It Va WITHOUT_ACPI @@ -132,6 +132,8 @@ When set, it also enforces the following .It .Va WITHOUT_BIND_ETC .It +.Va WITHOUT_BIND_LIBS +.It .Va WITHOUT_BIND_LIBS_LWRES .It .Va WITHOUT_BIND_MTREE @@ -253,6 +255,15 @@ When set, it also enforces the following .It Va WITHOUT_CLANG .\" from FreeBSD: head/tools/build/options/WITHOUT_CLANG 208971 2010-06-10 06:20:26Z ed Set to not build the Clang C/C++ compiler. +.Pp +It is a default setting on +arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc64, sparc64/sparc64 and sun4v/sparc64. +.It Va WITH_CLANG +.\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru +Set to build the Clang C/C++ compiler. +.Pp +It is a default setting on +amd64/amd64, i386/i386, pc98/i386 and powerpc/powerpc. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build @@ -264,10 +275,6 @@ When set, it also enforces the following .Pp .Bl -item -compact .It -.Va WITHOUT_GSSAPI -(can be overridden with -.Va WITH_GSSAPI ) -.It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT @@ -276,6 +283,15 @@ When set, it also enforces the following .It .Va WITHOUT_OPENSSL .El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_GSSAPI +(unless +.Va WITH_GSSAPI +is set explicitly) +.El .It Va WITHOUT_CTM .\" from FreeBSD: head/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build @@ -285,7 +301,7 @@ and related utilities. .\" from FreeBSD: head/tools/build/options/WITHOUT_CVS 156932 2006-03-21 07:50:50Z ru Set to not build CVS. .It Va WITHOUT_CXX -.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220401 2011-04-06 20:08:23Z uqs +.\" from FreeBSD: head/tools/build/options/WITHOUT_CXX 220402 2011-04-06 20:19:07Z uqs Set to not build .Xr g++ 1 and related libraries. @@ -316,12 +332,22 @@ dynamically. Set to avoid installing examples to .Pa /usr/share/examples/ . .It Va WITHOUT_FDT -.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 218942 2011-02-22 08:20:12Z uqs -Set to not build Flattened Device Tree support as part of the base system. This -includes the device tree compiler (dtc) and libfdt support library. +.\" from FreeBSD: head/tools/build/options/WITHOUT_FDT 221539 2011-05-06 19:10:27Z ru +Set to not build Flattened Device Tree support as part of the base system. +This includes the device tree compiler (dtc) and libfdt support library. +.Pp +It is a default setting on +amd64/amd64, i386/i386, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, pc98/i386, powerpc/powerpc64, sparc64/sparc64 and sun4v/sparc64. +.It Va WITH_FDT +.\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru +Set to build Flattened Device Tree support as part of the base system. +This includes the device tree compiler (dtc) and libfdt support library. +.Pp +It is a default setting on +arm/arm, arm/armeb and powerpc/powerpc. .It Va WITHOUT_FLOPPY -.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 183306 2008-09-23 16:15:42Z sam -Set to not build or install programs +.\" from FreeBSD: head/tools/build/options/WITHOUT_FLOPPY 221540 2011-05-06 19:13:03Z ru +Set to not build or install programs for operating floppy disk driver. .It Va WITHOUT_FORTH .\" from FreeBSD: head/tools/build/options/WITHOUT_FORTH 156932 2006-03-21 07:50:50Z ru @@ -367,9 +393,11 @@ Set to build some programs without optio .It Va WITHOUT_GPIB .\" from FreeBSD: head/tools/build/options/WITHOUT_GPIB 156932 2006-03-21 07:50:50Z ru Set to not build GPIB bus support. -.It Va WITH_GPIO -.\" from FreeBSD: head/tools/build/options/WITH_GPIO 213463 2010-10-05 22:26:01Z gonzo -Set to build gpioctl(8) as part of the base system. +.It Va WITHOUT_GPIO +.\" from FreeBSD: head/tools/build/options/WITHOUT_GPIO 221541 2011-05-06 19:14:06Z ru +Set to not build +.Xr gpioctl 8 +as part of the base system. .It Va WITHOUT_GROFF .\" from FreeBSD: head/tools/build/options/WITHOUT_GROFF 218941 2011-02-22 08:13:49Z uqs Set to not build @@ -398,7 +426,7 @@ It is .Em "YOUR RESPONSIBILITY" to determine if you can legally use IDEA. .It Va WITHOUT_INET -.\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET 221266 2011-04-30 17:58:28Z bz Set to not build programs and libraries related to IPv4 networking. When set, it also enforces the following options: .Pp @@ -420,7 +448,7 @@ When set, it also enforces the following .\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build libraries, programs, and kernel modules without IPv6 support. .It Va WITHOUT_INET_SUPPORT -.\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITHOUT_INET_SUPPORT 221266 2011-04-30 17:58:28Z bz Set to build libraries, programs, and kernel modules without IPv4 support. .It Va WITHOUT_INFO .\" from FreeBSD: head/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru @@ -464,12 +492,17 @@ When set, it also enforces the following .Pp .Bl -item -compact .It -.Va WITHOUT_GSSAPI -(can be overridden with -.Va WITH_GSSAPI ) -.It .Va WITHOUT_KERBEROS_SUPPORT .El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_GSSAPI +(unless +.Va WITH_GSSAPI +is set explicitly) +.El .It Va WITHOUT_KERBEROS_SUPPORT .\" from FreeBSD: head/tools/build/options/WITHOUT_KERBEROS_SUPPORT 156932 2006-03-21 07:50:50Z ru Set to build some programs without Kerberos support, like @@ -525,6 +558,8 @@ When set, it also enforces the following .It .Va WITHOUT_BIND_ETC .It +.Va WITHOUT_BIND_LIBS +.It .Va WITHOUT_BIND_LIBS_LWRES .It .Va WITHOUT_BIND_MTREE @@ -551,6 +586,8 @@ When set, it also enforces the following .It .Va WITHOUT_BIND_ETC .It +.Va WITHOUT_BIND_LIBS +.It .Va WITHOUT_BIND_LIBS_LWRES .It .Va WITHOUT_BIND_MTREE @@ -597,13 +634,13 @@ and related support files. .It Va WITHOUT_MAN .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN 156932 2006-03-21 07:50:50Z ru Set to not build manual pages. -When set, it also enforces the following options: +When set, the following options are also in effect: .Pp -.Bl -item -compact -.It -.Va WITHOUT_MAN_UTILS -(can be overridden with -.Va WITH_MAN_UTILS ) +.Bl -inset -compact +.It Va WITHOUT_MAN_UTILS +(unless +.Va WITH_MAN_UTILS +is set explicitly) .El .It Va WITHOUT_MAN_UTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_MAN_UTILS 208322 2010-05-20 00:07:21Z jkim @@ -675,9 +712,6 @@ will not be built either if this option Set to not build .Xr ntpd 8 and related programs. -.It Va WITHOUT_OBJC -.\" from FreeBSD: head/tools/build/options/WITHOUT_OBJC 156932 2006-03-21 07:50:50Z ru -Set to not build Objective C support. .It Va WITHOUT_OPENSSH .\" from FreeBSD: head/tools/build/options/WITHOUT_OPENSSH 156932 2006-03-21 07:50:50Z ru Set to not build OpenSSH. @@ -688,16 +722,21 @@ When set, it also enforces the following .Pp .Bl -item -compact .It -.Va WITHOUT_GSSAPI -(can be overridden with -.Va WITH_GSSAPI ) -.It .Va WITHOUT_KERBEROS .It .Va WITHOUT_KERBEROS_SUPPORT .It .Va WITHOUT_OPENSSH .El +.Pp +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_GSSAPI +(unless +.Va WITH_GSSAPI +is set explicitly) +.El .It Va WITHOUT_PAM .\" from FreeBSD: head/tools/build/options/WITHOUT_PAM 174550 2007-12-12 16:43:17Z ru Set to not build PAM library and modules. From owner-svn-src-head@FreeBSD.ORG Tue May 10 14:03:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B022C106564A; Tue, 10 May 2011 14:03:05 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7A48FC0A; Tue, 10 May 2011 14:03:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AE35d5047118; Tue, 10 May 2011 14:03:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AE35b4047116; Tue, 10 May 2011 14:03:05 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105101403.p4AE35b4047116@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 10 May 2011 14:03:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221738 - head/sys/powerpc/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 14:03:05 -0000 Author: nwhitehorn Date: Tue May 10 14:03:05 2011 New Revision: 221738 URL: http://svn.freebsd.org/changeset/base/221738 Log: Only try to set up IPIs at boot on systems that actually have more than one CPU. This fixes a panic observed on Heathrow-based systems without SMP-capable PICs when the kernel had both options SMP and INVARIANTS. MFC after: 5 days Modified: head/sys/powerpc/powerpc/intr_machdep.c Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Tue May 10 13:59:33 2011 (r221737) +++ head/sys/powerpc/powerpc/intr_machdep.c Tue May 10 14:03:05 2011 (r221738) @@ -397,18 +397,22 @@ powerpc_enable_intr(void) #ifdef SMP /* Install an IPI handler. */ - for (n = 0; n < npics; n++) { - if (piclist[n].dev != root_pic) - continue; - - KASSERT(piclist[n].ipis != 0, ("%s", __func__)); - error = powerpc_setup_intr("IPI", - MAP_IRQ(piclist[n].node, piclist[n].irqs), - powerpc_ipi_handler, NULL, NULL, - INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); - if (error) { - printf("unable to setup IPI handler\n"); - return (error); + if (mp_ncpus > 1) { + for (n = 0; n < npics; n++) { + if (piclist[n].dev != root_pic) + continue; + + KASSERT(piclist[n].ipis != 0, + ("%s: SMP root PIC does not supply any IPIs", + __func__)); + error = powerpc_setup_intr("IPI", + MAP_IRQ(piclist[n].node, piclist[n].irqs), + powerpc_ipi_handler, NULL, NULL, + INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); + if (error) { + printf("unable to setup IPI handler\n"); + return (error); + } } } #endif From owner-svn-src-head@FreeBSD.ORG Tue May 10 15:05:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21F7E1065672; Tue, 10 May 2011 15:05:28 +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 EB6EF8FC12; Tue, 10 May 2011 15:05:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AF5RC2049107; Tue, 10 May 2011 15:05:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AF5Rl7049104; Tue, 10 May 2011 15:05:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105101505.p4AF5Rl7049104@svn.freebsd.org> From: Andriy Gapon Date: Tue, 10 May 2011 15:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221740 - in head/sys/cddl/dev/dtrace: amd64 i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 15:05:28 -0000 Author: avg Date: Tue May 10 15:05:27 2011 New Revision: 221740 URL: http://svn.freebsd.org/changeset/base/221740 Log: dtrace: remove unused code Which is also useless, IMO. MFC after: 5 days Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue May 10 14:21:44 2011 (r221739) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Tue May 10 15:05:27 2011 (r221740) @@ -359,26 +359,6 @@ static uint64_t nsec_scale; #define SCALE_SHIFT 28 static void -dtrace_gethrtime_init_sync(void *arg) -{ -#ifdef CHECK_SYNC - /* - * Delay this function from returning on one - * of the CPUs to check that the synchronisation - * works. - */ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) { - int i; - for (i = 0; i < 1000000000; i++) - tgt_cpu_tsc = rdtsc(); - tgt_cpu_tsc = 0; - } -#endif -} - -static void dtrace_gethrtime_init_cpu(void *arg) { uintptr_t cpu = (uintptr_t) arg; @@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg) pc = pcpu_find(i); map = PCPU_GET(cpumask) | pc->pc_cpumask; - smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, + smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, smp_no_rendevous_barrier, (void *)(uintptr_t) i); Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue May 10 14:21:44 2011 (r221739) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Tue May 10 15:05:27 2011 (r221740) @@ -359,26 +359,6 @@ static uint64_t nsec_scale; #define SCALE_SHIFT 28 static void -dtrace_gethrtime_init_sync(void *arg) -{ -#ifdef CHECK_SYNC - /* - * Delay this function from returning on one - * of the CPUs to check that the synchronisation - * works. - */ - uintptr_t cpu = (uintptr_t) arg; - - if (cpu == curcpu) { - int i; - for (i = 0; i < 1000000000; i++) - tgt_cpu_tsc = rdtsc(); - tgt_cpu_tsc = 0; - } -#endif -} - -static void dtrace_gethrtime_init_cpu(void *arg) { uintptr_t cpu = (uintptr_t) arg; @@ -434,7 +414,7 @@ dtrace_gethrtime_init(void *arg) pc = pcpu_find(i); map = PCPU_GET(cpumask) | pc->pc_cpumask; - smp_rendezvous_cpus(map, dtrace_gethrtime_init_sync, + smp_rendezvous_cpus(map, NULL, dtrace_gethrtime_init_cpu, smp_no_rendevous_barrier, (void *)(uintptr_t) i); From owner-svn-src-head@FreeBSD.ORG Tue May 10 15:08:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CE65106567B; Tue, 10 May 2011 15:08:13 +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 718D38FC19; Tue, 10 May 2011 15:08:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AF8DhJ049225; Tue, 10 May 2011 15:08:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AF8D4J049223; Tue, 10 May 2011 15:08:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105101508.p4AF8D4J049223@svn.freebsd.org> From: Andriy Gapon Date: Tue, 10 May 2011 15:08:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221741 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 15:08:13 -0000 Author: avg Date: Tue May 10 15:08:13 2011 New Revision: 221741 URL: http://svn.freebsd.org/changeset/base/221741 Log: bitcount32: replace lengthy comment with a reference to SWAR MFC after: 5 days Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue May 10 15:05:27 2011 (r221740) +++ head/sys/sys/systm.h Tue May 10 15:08:13 2011 (r221741) @@ -374,44 +374,8 @@ int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); /* - * This is about as magic as it gets. fortune(1) has got similar code - * for reversing bits in a word. Who thinks up this stuff?? - * - * Yes, it does appear to be consistently faster than: - * while (i = ffs(m)) { - * m >>= i; - * bits++; - * } - * and - * while (lsb = (m & -m)) { // This is magic too - * m &= ~lsb; // or: m ^= lsb - * bits++; - * } - * Both of these latter forms do some very strange things on gcc-3.1 with - * -mcpu=pentiumpro and/or -march=pentiumpro and/or -O or -O2. - * There is probably an SSE or MMX popcnt instruction. - * - * I wonder if this should be in libkern? - * - * XXX Stop the presses! Another one: - * static __inline u_int32_t - * popcnt1(u_int32_t v) - * { - * v -= ((v >> 1) & 0x55555555); - * v = (v & 0x33333333) + ((v >> 2) & 0x33333333); - * v = (v + (v >> 4)) & 0x0F0F0F0F; - * return (v * 0x01010101) >> 24; - * } - * The downside is that it has a multiply. With a pentium3 with - * -mcpu=pentiumpro and -march=pentiumpro then gcc-3.1 will use - * an imull, and in that case it is faster. In most other cases - * it appears slightly slower. - * - * Another variant (also from fortune): - * #define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) - * #define BX_(x) ((x) - (((x)>>1)&0x77777777) \ - * - (((x)>>2)&0x33333333) \ - * - (((x)>>3)&0x11111111)) + * Population count algorithm using SWAR approach + * - "SIMD Within A Register". */ static __inline uint32_t bitcount32(uint32_t x) From owner-svn-src-head@FreeBSD.ORG Tue May 10 15:25:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 583851065670; Tue, 10 May 2011 15:25:32 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3DC8FC0A; Tue, 10 May 2011 15:25:31 +0000 (UTC) Received: by wyf23 with SMTP id 23so6180133wyf.13 for ; Tue, 10 May 2011 08:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=47WmXn8AhQwVMHOiMqFbr/zn4qAzxNGiG7rYIVrFQYw=; b=o3hU9pf895QaPkM6wg2ast3qOB/UcvjBlwN4PyOdajgDtwSEp6kBxjHLlp+5fd8G85 /ZoKHzGQuoG0qA5849Z+4+qrfkpt696HoEuIaQyvQatPxzE9MVUzxOHRm+/oOvGwYM0R glbuHPHAC6BwyCad1fpzEeTrrkYuuzjWN6uRM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=dY0ewOAtglVeEWPaArd94O54TUV+nrkLmgPHNuyXermPNlV34cSrB65UCPs9K2j0V7 TQGUZtFnXpjT8Vp1pc+FJ1c9jNOP8697A7JrrTzryb+CfeA6tv2ed6p4e9l4xhd8hoHV M/rQay3a31FsxJMu1Lqh3bIw6ERWzsQcjemOU= Received: by 10.227.100.219 with SMTP id z27mr38204wbn.45.1305039717453; Tue, 10 May 2011 08:01:57 -0700 (PDT) Received: from localhost (lan-78-157-92-5.vln.skynet.lt [78.157.92.5]) by mx.google.com with ESMTPS id bs4sm4446552wbb.52.2011.05.10.08.01.55 (version=SSLv3 cipher=OTHER); Tue, 10 May 2011 08:01:56 -0700 (PDT) Date: Tue, 10 May 2011 18:01:16 +0300 From: Gleb Kurtsou To: John Baldwin Message-ID: <20110510150116.GA51558@tops> References: <201104281736.p3SHaQhl032994@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: <201104281736.p3SHaQhl032994@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221176 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 15:25:32 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Could you also commit the patch attached. No functional changes, it removes incorrect comment copy-pasted from UFS to ext2. Thanks, Gleb. --liOOAslEiF7prFVr Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0002-ext2fs-Remove-stale-comment.patch" >From 24f4656c71d716e23e3c043ac6d0894284efa301 Mon Sep 17 00:00:00 2001 From: Gleb Kurtsou Date: Thu, 21 Oct 2010 01:51:59 +0300 Subject: [PATCH 02/25] ext2fs: Remove stale comment --- sys/fs/ext2fs/ext2_lookup.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/sys/fs/ext2fs/ext2_lookup.c b/sys/fs/ext2fs/ext2_lookup.c index 56963b2..7edd54f 100644 --- a/sys/fs/ext2fs/ext2_lookup.c +++ b/sys/fs/ext2fs/ext2_lookup.c @@ -117,12 +117,6 @@ static int ext2_dirbadentry(struct vnode *dp, struct ext2fs_direct_2 *de, /* * Vnode op for reading directories. - * - * The routine below assumes that the on-disk format of a directory - * is the same as that defined by . If the on-disk - * format changes, then it will be necessary to do a conversion - * from the on-disk format that read returns to the format defined - * by . */ /* * this is exactly what we do here - the problem is that the conversion -- 1.7.3.5 --liOOAslEiF7prFVr-- From owner-svn-src-head@FreeBSD.ORG Tue May 10 16:44:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B40E106566C; Tue, 10 May 2011 16:44:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B6A58FC0C; Tue, 10 May 2011 16:44:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AGiHY8052108; Tue, 10 May 2011 16:44:17 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AGiHO1052105; Tue, 10 May 2011 16:44:17 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201105101644.p4AGiHO1052105@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 10 May 2011 16:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221743 - in head/sys: amd64/conf i386/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 16:44:17 -0000 Author: jkim Date: Tue May 10 16:44:16 2011 New Revision: 221743 URL: http://svn.freebsd.org/changeset/base/221743 Log: Add SC_PIXEL_MODE to GENERIC for amd64 and i386. Requested by: many Modified: head/sys/amd64/conf/GENERIC head/sys/i386/conf/GENERIC Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue May 10 15:54:37 2011 (r221742) +++ head/sys/amd64/conf/GENERIC Tue May 10 16:44:16 2011 (r221743) @@ -165,6 +165,7 @@ device splash # Splash screen and scre # syscons is the default console driver, resembling an SCO console device sc +options SC_PIXEL_MODE # add support for the raster text mode device agp # support several AGP chipsets Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue May 10 15:54:37 2011 (r221742) +++ head/sys/i386/conf/GENERIC Tue May 10 16:44:16 2011 (r221743) @@ -170,6 +170,7 @@ device splash # Splash screen and scre # syscons is the default console driver, resembling an SCO console device sc +options SC_PIXEL_MODE # add support for the raster text mode device agp # support several AGP chipsets From owner-svn-src-head@FreeBSD.ORG Tue May 10 18:38:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18639106564A; Tue, 10 May 2011 18:38:02 +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 08BE68FC16; Tue, 10 May 2011 18:38:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AIc1jJ055663; Tue, 10 May 2011 18:38:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AIc1cZ055661; Tue, 10 May 2011 18:38:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105101838.p4AIc1cZ055661@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 May 2011 18:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221746 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 18:38:02 -0000 Author: marius Date: Tue May 10 18:38:01 2011 New Revision: 221746 URL: http://svn.freebsd.org/changeset/base/221746 Log: Fix a bug in r221407; this driver doesn't add the media itself. PR: 156893 Modified: head/sys/dev/mii/ip1000phy.c Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Tue May 10 18:19:56 2011 (r221745) +++ head/sys/dev/mii/ip1000phy.c Tue May 10 18:38:01 2011 (r221746) @@ -111,7 +111,7 @@ ip1000phy_attach(device_t dev) strcmp(ma->mii_data->mii_ifp->if_dname, "stge") == 0 && (miibus_get_flags(dev) & MIIF_MACPRIV0) != 0) flags |= MIIF_PHYPRIV0; - mii_phy_dev_attach(dev, flags, &ip1000phy_funcs, 0); + mii_phy_dev_attach(dev, flags, &ip1000phy_funcs, 1); return (0); } From owner-svn-src-head@FreeBSD.ORG Tue May 10 18:41:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 094BA1065670; Tue, 10 May 2011 18:41:47 +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 EDF218FC0A; Tue, 10 May 2011 18:41:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4AIfkEi055802; Tue, 10 May 2011 18:41:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4AIfkXx055800; Tue, 10 May 2011 18:41:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105101841.p4AIfkXx055800@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 May 2011 18:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221747 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 18:41:47 -0000 Author: marius Date: Tue May 10 18:41:46 2011 New Revision: 221747 URL: http://svn.freebsd.org/changeset/base/221747 Log: Fix whitespace. Modified: head/sys/dev/mii/ip1000phy.c Modified: head/sys/dev/mii/ip1000phy.c ============================================================================== --- head/sys/dev/mii/ip1000phy.c Tue May 10 18:38:01 2011 (r221746) +++ head/sys/dev/mii/ip1000phy.c Tue May 10 18:41:46 2011 (r221747) @@ -70,7 +70,7 @@ static devclass_t ip1000phy_devclass; static driver_t ip1000phy_driver = { "ip1000phy", ip1000phy_methods, - sizeof (struct mii_softc) + sizeof(struct mii_softc) }; DRIVER_MODULE(ip1000phy, miibus, ip1000phy_driver, ip1000phy_devclass, 0, 0); From owner-svn-src-head@FreeBSD.ORG Tue May 10 21:18:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86DD8106566B; Tue, 10 May 2011 21:18:45 +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 7705D8FC0C; Tue, 10 May 2011 21:18:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ALIj5C060524; Tue, 10 May 2011 21:18:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ALIjrD060522; Tue, 10 May 2011 21:18:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105102118.p4ALIjrD060522@svn.freebsd.org> From: Marius Strobl Date: Tue, 10 May 2011 21:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221750 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2011 21:18:45 -0000 Author: marius Date: Tue May 10 21:18:45 2011 New Revision: 221750 URL: http://svn.freebsd.org/changeset/base/221750 Log: Add an ATOMIC_CLEAR_LONG. Modified: head/sys/sparc64/include/asmacros.h Modified: head/sys/sparc64/include/asmacros.h ============================================================================== --- head/sys/sparc64/include/asmacros.h Tue May 10 18:44:40 2011 (r221749) +++ head/sys/sparc64/include/asmacros.h Tue May 10 21:18:45 2011 (r221750) @@ -90,6 +90,17 @@ bne,pn %icc, 9b ; \ mov r3, r2 +/* + * Atomically clear a number of bits of an u_long in memory. + */ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + #define PCPU(member) PCPU_REG + PC_ ## member #define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg From owner-svn-src-head@FreeBSD.ORG Wed May 11 00:52:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB2D81065672; Wed, 11 May 2011 00:52:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14FF8FC13; Wed, 11 May 2011 00:52:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4B0qf6V066926; Wed, 11 May 2011 00:52:41 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4B0qffn066909; Wed, 11 May 2011 00:52:41 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201105110052.p4B0qffn066909@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Wed, 11 May 2011 00:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221753 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 00:52:42 -0000 Author: gonzo Date: Wed May 11 00:52:41 2011 New Revision: 221753 URL: http://svn.freebsd.org/changeset/base/221753 Log: Use new option names for NFS client and NFS server See UPDATING entry for 20110427 Modified: head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/AR71XX head/sys/mips/conf/AR91XX_BASE head/sys/mips/conf/IDT head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/QEMU head/sys/mips/conf/RT305X head/sys/mips/conf/SENTRY5 head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.SWARM Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/ADM5120 Wed May 11 00:52:41 2011 (r221753) @@ -33,8 +33,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework #options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/ALCHEMY Wed May 11 00:52:41 2011 (r221753) @@ -33,8 +33,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework # options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/AR71XX ============================================================================== --- head/sys/mips/conf/AR71XX Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/AR71XX Wed May 11 00:52:41 2011 (r221753) @@ -19,8 +19,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/AR91XX_BASE ============================================================================== --- head/sys/mips/conf/AR91XX_BASE Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/AR91XX_BASE Wed May 11 00:52:41 2011 (r221753) @@ -29,7 +29,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 #InterNETworking -options NFSCLIENT #Network Filesystem Client +options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/IDT ============================================================================== --- head/sys/mips/conf/IDT Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/IDT Wed May 11 00:52:41 2011 (r221753) @@ -16,8 +16,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options BOOTP Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/MALTA Wed May 11 00:52:41 2011 (r221753) @@ -44,8 +44,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/MALTA64 Wed May 11 00:52:41 2011 (r221753) @@ -44,8 +44,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/OCTEON1 Wed May 11 00:52:41 2011 (r221753) @@ -51,10 +51,10 @@ options UFS_ACL # Support for access options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling options MD_ROOT # MD is a potential root device -options NFSCLIENT # Network Filesystem Client -options NFSSERVER # Network Filesystem Server +options NFSCL # Network Filesystem Client +options NFSD # Network Filesystem Server options NFSLOCKD # Network Lock Manager -options NFS_ROOT # NFS usable as /, requires NFSCLIENT +options NFS_ROOT # NFS usable as /, requires NFSCL options MSDOSFS # MSDOS Filesystem options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/PB92 Wed May 11 00:52:41 2011 (r221753) @@ -25,7 +25,7 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking options INET6 -# options NFSCLIENT #Network Filesystem Client +# options NFSCL #Network Filesystem Client options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options ALQ Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/QEMU Wed May 11 00:52:41 2011 (r221753) @@ -32,8 +32,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/RT305X Wed May 11 00:52:41 2011 (r221753) @@ -50,8 +50,8 @@ options SCHED_ULE #options SCHED_4BSD #4BSD scheduler #options COMPAT_43 options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework #options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/SENTRY5 Wed May 11 00:52:41 2011 (r221753) @@ -44,8 +44,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/XLR Wed May 11 00:52:41 2011 (r221753) @@ -67,7 +67,7 @@ options FFS # Berkeley Fast Filesyste #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -options NFSCLIENT +options NFSCL options NFS_ROOT # options BOOTP Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/XLR64 Wed May 11 00:52:41 2011 (r221753) @@ -42,7 +42,7 @@ options FFS # Berkeley Fast Filesyste #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -options NFSCLIENT +options NFSCL options NFS_ROOT # options BOOTP Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/XLRN32 Wed May 11 00:52:41 2011 (r221753) @@ -41,7 +41,7 @@ options FFS # Berkeley Fast Filesyste #options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories -options NFSCLIENT +options NFSCL options NFS_ROOT # options BOOTP Modified: head/sys/mips/conf/std.SWARM ============================================================================== --- head/sys/mips/conf/std.SWARM Wed May 11 00:47:24 2011 (r221752) +++ head/sys/mips/conf/std.SWARM Wed May 11 00:52:41 2011 (r221753) @@ -20,8 +20,8 @@ options KDB options SCHED_4BSD #4BSD scheduler options INET #InterNETworking -options NFSCLIENT #Network Filesystem Client -options NFS_ROOT #NFS usable as /, requires NFSCLIENT +options NFSCL #Network Filesystem Client +options NFS_ROOT #NFS usable as /, requires NFSCL options PSEUDOFS #Pseudo-filesystem framework options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions From owner-svn-src-head@FreeBSD.ORG Wed May 11 09:47:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C80D0106566C; Wed, 11 May 2011 09:47:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7E4B8FC13; Wed, 11 May 2011 09:47:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4B9lmXw083749; Wed, 11 May 2011 09:47:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4B9lmlg083747; Wed, 11 May 2011 09:47:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105110947.p4B9lmlg083747@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 09:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221766 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 09:47:48 -0000 Author: adrian Date: Wed May 11 09:47:48 2011 New Revision: 221766 URL: http://svn.freebsd.org/changeset/base/221766 Log: Restore the RSSI threshold after writing the board values. This would be overwritten by the board initvals written in ah->writeIni(). Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed May 11 09:46:36 2011 (r221765) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed May 11 09:47:48 2011 (r221766) @@ -157,9 +157,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO FAIL(HAL_EIO); } - /* Restore bmiss rssi & count thresholds */ - OS_REG_WRITE(ah, AR_RSSI_THR, rssiThrReg); - /* Restore TSF */ if (tsf) ar5212SetTsf64(ah, tsf); @@ -270,6 +267,9 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO OS_REG_WRITE(ah, AR_ISR, ~0); /* cleared on write */ + /* Restore bmiss rssi & count thresholds */ + OS_REG_WRITE(ah, AR_RSSI_THR, rssiThrReg); + if (!ar5212SetChannel(ah, chan)) FAIL(HAL_EIO); From owner-svn-src-head@FreeBSD.ORG Wed May 11 10:30:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F347106566B; Wed, 11 May 2011 10:30:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E5368FC1C; Wed, 11 May 2011 10:30:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BAUVK8085526; Wed, 11 May 2011 10:30:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BAUVw7085524; Wed, 11 May 2011 10:30:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111030.p4BAUVw7085524@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 10:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221772 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 10:30:31 -0000 Author: adrian Date: Wed May 11 10:30:31 2011 New Revision: 221772 URL: http://svn.freebsd.org/changeset/base/221772 Log: Remove a now unneeded comment.. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 09:56:31 2011 (r221771) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 10:30:31 2011 (r221772) @@ -263,7 +263,6 @@ ar5416InitCal(struct ath_hal *ah, const * higher than normal value if DC offset and noise floor cal are * triggered at the same time. */ - /* XXX this actually kicks off a NF calibration -adrian */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); /* * This sometimes takes a -lot- longer than it should. From owner-svn-src-head@FreeBSD.ORG Wed May 11 11:02:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E43D3106567A; Wed, 11 May 2011 11:02:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B82658FC0A; Wed, 11 May 2011 11:02:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BB2K1f087403; Wed, 11 May 2011 11:02:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BB2Kew087401; Wed, 11 May 2011 11:02:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111102.p4BB2Kew087401@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 11:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221773 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 11:02:21 -0000 Author: adrian Date: Wed May 11 11:02:20 2011 New Revision: 221773 URL: http://svn.freebsd.org/changeset/base/221773 Log: Remove the initial NF completion check. This is taking quite a while for some people in some situations (eg AR5418 in phk's Abusive Radio Environment). Instead, the rest of the calibration related code should ensure that a NF calibration has occured before reading NF values and kicking off another NF calibration. The channel should also likely be marked as "noisy" (CWINT) if the NF calibration takes too long. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 10:30:31 2011 (r221772) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 11:02:20 2011 (r221773) @@ -264,31 +264,13 @@ ar5416InitCal(struct ath_hal *ah, const * triggered at the same time. */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); - /* - * This sometimes takes a -lot- longer than it should. - * Just give it a bit more time. - */ - for (i = 0; i < MAX_CAL_CHECK; i++) { - if (ar5212WaitNFCalComplete(ah, 10000)) - break; - HALDEBUG(ah, HAL_DEBUG_ANY, "%s: initial NF calibration did " - "not complete in time; noisy environment (pass %d)?\n", __func__, i); - } - /* - * Although periodic and NF calibrations shouldn't run concurrently, - * this was causing the radio to not be usable on the active - * channel if the channel was busy. - * - * Instead, now simply print a warning and continue. That way if users - * report "weird crap", they should get this warning. + * This may take a while to run; make sure subsequent + * calibration routines check that this has completed + * before reading the value and triggering a subsequent + * calibration. */ - if (i >= MAX_CAL_CHECK) { - ath_hal_printf(ah, "[ath] Warning - initial NF calibration did " - "not complete in time, noisy environment?\n"); - /* return AH_FALSE; */ - } /* Initialize list pointers */ cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL; From owner-svn-src-head@FreeBSD.ORG Wed May 11 13:20:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCDE4106566B; Wed, 11 May 2011 13:20:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B883F8FC12; Wed, 11 May 2011 13:20:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BDKPcw091515; Wed, 11 May 2011 13:20:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BDKP3A091513; Wed, 11 May 2011 13:20:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111320.p4BDKP3A091513@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 13:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221775 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 13:20:25 -0000 Author: adrian Date: Wed May 11 13:20:25 2011 New Revision: 221775 URL: http://svn.freebsd.org/changeset/base/221775 Log: Remove unused variable Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 11:30:36 2011 (r221774) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 13:20:25 2011 (r221775) @@ -241,7 +241,6 @@ ar5416InitCal(struct ath_hal *ah, const { struct ar5416PerCal *cal = &AH5416(ah)->ah_cal; HAL_CHANNEL_INTERNAL *ichan; - int i; ichan = ath_hal_checkchannel(ah, chan); HALASSERT(ichan != AH_NULL); From owner-svn-src-head@FreeBSD.ORG Wed May 11 13:22:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA251065675; Wed, 11 May 2011 13:22:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 099FA8FC12; Wed, 11 May 2011 13:22:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BDMfgt091630; Wed, 11 May 2011 13:22:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BDMfgY091627; Wed, 11 May 2011 13:22:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111322.p4BDMfgY091627@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 13:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221776 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 13:22:42 -0000 Author: adrian Date: Wed May 11 13:22:41 2011 New Revision: 221776 URL: http://svn.freebsd.org/changeset/base/221776 Log: Add a new flag - HAL_DEBUG_UNMASKABLE - which always logs a debug message (when debug is enabled) no matter what. Modified: head/sys/dev/ath/ath_hal/ah_debug.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Wed May 11 13:20:25 2011 (r221775) +++ head/sys/dev/ath/ath_hal/ah_debug.h Wed May 11 13:22:41 2011 (r221776) @@ -48,6 +48,7 @@ enum { HAL_DEBUG_DFS = 0x00200000, /* DFS debugging */ HAL_DEBUG_HANG = 0x00400000, /* BB/MAC hang debugging */ + HAL_DEBUG_UNMASKABLE = 0xf0000000, /* always printed */ HAL_DEBUG_ANY = 0xffffffff }; #endif /* _ATH_AH_DEBUG_H_ */ Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed May 11 13:20:25 2011 (r221775) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed May 11 13:22:41 2011 (r221776) @@ -517,7 +517,8 @@ extern void ath_hal_free(void *); extern int ath_hal_debug; #define HALDEBUG(_ah, __m, ...) \ do { \ - if (ath_hal_debug & (__m)) { \ + if ((__m) == HAL_DEBUG_UNMASKABLE || \ + (ath_hal_debug & (__m))) { \ DO_HALDEBUG((_ah), (__m), __VA_ARGS__); \ } \ } while(0); From owner-svn-src-head@FreeBSD.ORG Wed May 11 13:24:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E9B3106566C; Wed, 11 May 2011 13:24:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CC208FC16; Wed, 11 May 2011 13:24:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BDOHdG091715; Wed, 11 May 2011 13:24:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BDOHd0091713; Wed, 11 May 2011 13:24:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111324.p4BDOHd0091713@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 13:24:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221777 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 13:24:17 -0000 Author: adrian Date: Wed May 11 13:24:17 2011 New Revision: 221777 URL: http://svn.freebsd.org/changeset/base/221777 Log: Make sure the chip is awake before writing to it to finally detach it. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed May 11 13:22:41 2011 (r221776) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed May 11 13:24:17 2011 (r221777) @@ -420,6 +420,12 @@ ar5416Detach(struct ath_hal *ah) HALASSERT(ah != AH_NULL); HALASSERT(ah->ah_magic == AR5416_MAGIC); + /* Make sure that chip is awake before writing to it */ + if (! ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) + HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, + "%s: failed to wake up chip\n", + __func__); + ar5416AniDetach(ah); ar5212RfDetach(ah); ah->ah_disable(ah); From owner-svn-src-head@FreeBSD.ORG Wed May 11 13:25:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F72A106564A; Wed, 11 May 2011 13:25:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7938FC0C; Wed, 11 May 2011 13:25:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BDPhU3091795; Wed, 11 May 2011 13:25:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BDPhTA091793; Wed, 11 May 2011 13:25:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111325.p4BDPhTA091793@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 13:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221778 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 13:25:43 -0000 Author: adrian Date: Wed May 11 13:25:43 2011 New Revision: 221778 URL: http://svn.freebsd.org/changeset/base/221778 Log: Always log if the NF CCA load fails; so users with debugging enabled can see they're likely in a very noisy environment. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 13:24:17 2011 (r221777) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 13:25:43 2011 (r221778) @@ -638,8 +638,8 @@ ar5416LoadNF(struct ath_hal *ah, const s * here, the baseband nf cal will just be capped by our present * noisefloor until the next calibration timer. */ - HALDEBUG(ah, HAL_DEBUG_ANY, "Timeout while waiting for nf " - "to load: AR_PHY_AGC_CONTROL=0x%x\n", + HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "Timeout while waiting for " + "nf to load: AR_PHY_AGC_CONTROL=0x%x\n", OS_REG_READ(ah, AR_PHY_AGC_CONTROL)); return; } From owner-svn-src-head@FreeBSD.ORG Wed May 11 13:40:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E7D2106566C; Wed, 11 May 2011 13:40:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 228F98FC12; Wed, 11 May 2011 13:40:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BDeEWU092254; Wed, 11 May 2011 13:40:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BDeEKp092252; Wed, 11 May 2011 13:40:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111340.p4BDeEKp092252@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 13:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221779 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 13:40:14 -0000 Author: adrian Date: Wed May 11 13:40:13 2011 New Revision: 221779 URL: http://svn.freebsd.org/changeset/base/221779 Log: Make the NF calibration logic (hopefully!) more resistive to noisy environments. In setups where NF calibration can take a while, don't load the CCA and kick off a new NF calibration if the previous one hasn't yet completed. This shouldn't happen unless the environment is noisy but those exist (hi phk!). Here, if the previous NF hasn't completed when ar5416LoadNf() is run (which reads the NF), it skips updating the history buffer, loading the NF CCA array and kicking off the next NF cal. It's hoped it'll occur in the next long calibration interval. Obtained from: Atheros, ath9k, my local HAL Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 13:25:43 2011 (r221778) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed May 11 13:40:13 2011 (r221779) @@ -442,6 +442,7 @@ ar5416PerCalibrationN(struct ath_hal *ah struct ar5416PerCal *cal = &AH5416(ah)->ah_cal; HAL_CAL_LIST *currCal = cal->cal_curr; HAL_CHANNEL_INTERNAL *ichan; + int r; OS_MARK(ah, AH_MARK_PERCAL, chan->ic_freq); @@ -498,17 +499,24 @@ ar5416PerCalibrationN(struct ath_hal *ah * Get the value from the previous NF cal * and update the history buffer. */ - ar5416GetNf(ah, chan); - - /* - * Load the NF from history buffer of the current channel. - * NF is slow time-variant, so it is OK to use a - * historical value. - */ - ar5416LoadNF(ah, AH_PRIVATE(ah)->ah_curchan); + r = ar5416GetNf(ah, chan); + if (r <= 0) { + /* NF calibration result isn't valid */ + HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: NF calibration" + " didn't finish; delaying CCA\n", __func__); + } else { + /* + * NF calibration result is valid. + * + * Load the NF from history buffer of the current channel. + * NF is slow time-variant, so it is OK to use a + * historical value. + */ + ar5416LoadNF(ah, AH_PRIVATE(ah)->ah_curchan); - /* start NF calibration, without updating BB NF register*/ - ar5416StartNFCal(ah); + /* start NF calibration, without updating BB NF register*/ + ar5416StartNFCal(ah); + } } return AH_TRUE; } @@ -758,17 +766,22 @@ ar5416SanitizeNF(struct ath_hal *ah, int /* * Read the NF and check it against the noise floor threshhold + * + * Return 0 if the NF calibration hadn't finished, 0 if it was + * invalid, or > 0 for a valid NF reading. */ static int16_t ar5416GetNf(struct ath_hal *ah, struct ieee80211_channel *chan) { int16_t nf, nfThresh; int i; + int retval = 0; if (ar5212IsNFCalInProgress(ah)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF didn't complete in calibration window\n", __func__); nf = 0; + retval = -1; /* NF didn't finish */ } else { /* Finished NF cal, check against threshold */ int16_t nfarray[NUM_NOISEFLOOR_READINGS] = { 0 }; @@ -780,7 +793,7 @@ ar5416GetNf(struct ath_hal *ah, struct i ar5416SanitizeNF(ah, nfarray); if (ar5416GetEepromNoiseFloorThresh(ah, chan, &nfThresh)) { if (nf > nfThresh) { - HALDEBUG(ah, HAL_DEBUG_ANY, + HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: noise floor failed detected; " "detected %d, threshold %d\n", __func__, nf, nfThresh); @@ -791,9 +804,11 @@ ar5416GetNf(struct ath_hal *ah, struct i */ chan->ic_state |= IEEE80211_CHANSTATE_CWINT; nf = 0; + retval = 0; } } else { nf = 0; + retval = 0; } /* Update MIMO channel statistics, regardless of validity or not (for now) */ for (i = 0; i < 3; i++) { @@ -804,6 +819,7 @@ ar5416GetNf(struct ath_hal *ah, struct i ar5416UpdateNFHistBuff(ah, AH5416(ah)->ah_cal.nfCalHist, nfarray); ichan->rawNoiseFloor = nf; + retval = nf; } - return nf; + return retval; } From owner-svn-src-head@FreeBSD.ORG Wed May 11 15:23:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38CDC1065670; Wed, 11 May 2011 15:23:28 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E1538FC0A; Wed, 11 May 2011 15:23:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BFNSTb095327; Wed, 11 May 2011 15:23:28 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BFNRCp095325; Wed, 11 May 2011 15:23:28 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201105111523.p4BFNRCp095325@svn.freebsd.org> From: Colin Percival Date: Wed, 11 May 2011 15:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221780 - head/usr.sbin/freebsd-update X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 15:23:28 -0000 Author: cperciva Date: Wed May 11 15:23:27 2011 New Revision: 221780 URL: http://svn.freebsd.org/changeset/base/221780 Log: Make freebsd-update(8) smarter in how it handles $FreeBSD$ tags in configuration files. If the current file differs from the canonical version from the old release only due to differences in the $FreeBSD$ tag (which can happen if the system was installed from source code, depending on how the src tree was checked out) then freebsd-update will treat the file as "unmodified" and silently update it to the "clean" version in the new release. If the only change being made to a configuration file is in the $FreeBSD$ tag (e.g., for any configuration files which have been modified locally, now that we're using SVN and the $FreeBSD$ tag changes when a branch is created), freebsd-update will no longer print the diff and prompt "Does this look reasonable (y/n)?". Nagged by: pgollucci MFC after: 1 month Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed May 11 13:40:13 2011 (r221779) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed May 11 15:23:27 2011 (r221780) @@ -2254,6 +2254,19 @@ upgrade_oldall_to_oldnew () { mv $2 $3 } +# Helper for upgrade_merge: Return zero true iff the two files differ only +# in the contents of their $FreeBSD$ tags. +samef () { + X=`sed -E 's/\\$FreeBSD.*\\$/\$FreeBSD\$/' < $1 | ${SHA256}` + Y=`sed -E 's/\\$FreeBSD.*\\$/\$FreeBSD\$/' < $2 | ${SHA256}` + + if [ $X = $Y ]; then + return 0; + else + return 1; + fi +} + # From the list of "old" files in $1, merge changes in $2 with those in $3, # and update $3 to reflect the hashes of merged files. upgrade_merge () { @@ -2337,6 +2350,14 @@ upgrade_merge () { # Ask the user to handle any files which didn't merge. while read F; do + # If the installed file differs from the version in + # the old release only due to $FreeBSD$ tag expansion + # then just use the version in the new release. + if samef merge/old/${F} merge/${OLDRELNUM}/${F}; then + cp merge/${RELNUM}/${F} merge/new/${F} + continue + fi + cat <<-EOF The following file could not be merged automatically: ${F} @@ -2351,9 +2372,18 @@ manually... # Ask the user to confirm that he likes how the result # of merging files. while read F; do - # Skip files which haven't changed. - if [ -f merge/new/${F} ] && - cmp -s merge/old/${F} merge/new/${F}; then + # Skip files which haven't changed except possibly + # in their $FreeBSD$ tags. + if [ -f merge/old/${F} ] && [ -f merge/new/${F} ] && + samef merge/old/${F} merge/new/${F}; then + continue + fi + + # Skip files where the installed file differs from + # the old file only due to $FreeBSD$ tags. + if [ -f merge/old/${F} ] && + [ -f merge/${OLDRELNUM}/${F} ] && + samef merge/old/${F} merge/${OLDRELNUM}/${F}; then continue fi From owner-svn-src-head@FreeBSD.ORG Wed May 11 16:44:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB1CD1065674; Wed, 11 May 2011 16:44:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9192D8FC16; Wed, 11 May 2011 16:44:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BGiJaY097790; Wed, 11 May 2011 16:44:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BGiJ5f097788; Wed, 11 May 2011 16:44:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111644.p4BGiJ5f097788@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 16:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221781 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 16:44:19 -0000 Author: adrian Date: Wed May 11 16:44:19 2011 New Revision: 221781 URL: http://svn.freebsd.org/changeset/base/221781 Log: net80211 alq bugfixes: * Track number of logged operations * call alq_post() so things are logged * network order things Modified: head/sys/net80211/ieee80211_alq.c Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Wed May 11 15:23:27 2011 (r221780) +++ head/sys/net80211/ieee80211_alq.c Wed May 11 16:44:19 2011 (r221781) @@ -64,7 +64,8 @@ __FBSDID("$FreeBSD$"); static struct alq *ieee80211_alq; static int ieee80211_alq_lost; -static char ieee80211_alq_logfile[MAXPATHLEN] = "/tmp/net80211.log"; +static int ieee80211_alq_logged; +static char ieee80211_alq_logfile[MAXPATHLEN] = "/mnt/tmp/net80211.log"; static unsigned int ieee80211_alq_qsize = 64*1024; static int @@ -113,6 +114,8 @@ SYSCTL_INT(_net_wlan, OID_AUTO, alq_size &ieee80211_alq_qsize, 0, "In-memory log size (#records)"); SYSCTL_INT(_net_wlan, OID_AUTO, alq_lost, CTLFLAG_RW, &ieee80211_alq_lost, 0, "Debugging operations not logged"); +SYSCTL_INT(_net_wlan, OID_AUTO, alq_logged, CTLFLAG_RW, + &ieee80211_alq_logged, 0, "Debugging operations logged"); static struct ale * ieee80211_alq_get(void) @@ -122,6 +125,8 @@ ieee80211_alq_get(void) ale = alq_get(ieee80211_alq, ALQ_NOWAIT); if (!ale) ieee80211_alq_lost++; + else + ieee80211_alq_logged++; return ale; } @@ -131,14 +136,18 @@ ieee80211_alq_log(struct ieee80211vap *v struct ale *ale; struct ieee80211_alq_rec *r; + if (ieee80211_alq == NULL) + return; + ale = ieee80211_alq_get(); if (! ale) return; r = (struct ieee80211_alq_rec *) ale; - r->r_timestamp = ticks; + r->r_timestamp = htonl(ticks); r->r_version = 1; - r->r_wlan = vap->iv_ifp->if_dunit; + r->r_wlan = htons(vap->iv_ifp->if_dunit); r->r_op = op; memcpy(&r->r_payload, p, MIN(l, sizeof(r->r_payload))); + alq_post(ieee80211_alq, ale); } From owner-svn-src-head@FreeBSD.ORG Wed May 11 17:20:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C33CE1065670; Wed, 11 May 2011 17:20:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B44488FC21; Wed, 11 May 2011 17:20:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BHKZhb098903; Wed, 11 May 2011 17:20:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BHKZt2098901; Wed, 11 May 2011 17:20:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105111720.p4BHKZt2098901@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 May 2011 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221782 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 17:20:35 -0000 Author: adrian Date: Wed May 11 17:20:35 2011 New Revision: 221782 URL: http://svn.freebsd.org/changeset/base/221782 Log: Fix up the net80211 alq logging - this commit makes it usable. * revert a local path change that shouldn't have made it to the commit * fix some indenting/wrapping * Fix the ale data copy - i should be copying into the ale data pointer, not over the ale entry itself. Modified: head/sys/net80211/ieee80211_alq.c Modified: head/sys/net80211/ieee80211_alq.c ============================================================================== --- head/sys/net80211/ieee80211_alq.c Wed May 11 16:44:19 2011 (r221781) +++ head/sys/net80211/ieee80211_alq.c Wed May 11 17:20:35 2011 (r221782) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); static struct alq *ieee80211_alq; static int ieee80211_alq_lost; static int ieee80211_alq_logged; -static char ieee80211_alq_logfile[MAXPATHLEN] = "/mnt/tmp/net80211.log"; +static char ieee80211_alq_logfile[MAXPATHLEN] = "/tmp/net80211.log"; static unsigned int ieee80211_alq_qsize = 64*1024; static int @@ -84,7 +84,9 @@ ieee80211_alq_setlogging(int enable) sizeof (struct ieee80211_alq_rec), ieee80211_alq_qsize); ieee80211_alq_lost = 0; - printf("net80211: logging to %s enabled\n", ieee80211_alq_logfile); + ieee80211_alq_logged = 0; + printf("net80211: logging to %s enabled; struct size %d bytes\n", + ieee80211_alq_logfile, sizeof(struct ieee80211_alq_rec)); } else { if (ieee80211_alq) alq_close(ieee80211_alq); @@ -143,7 +145,7 @@ ieee80211_alq_log(struct ieee80211vap *v if (! ale) return; - r = (struct ieee80211_alq_rec *) ale; + r = (struct ieee80211_alq_rec *) ale->ae_data; r->r_timestamp = htonl(ticks); r->r_version = 1; r->r_wlan = htons(vap->iv_ifp->if_dunit); From owner-svn-src-head@FreeBSD.ORG Wed May 11 17:50:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E308F106566C; Wed, 11 May 2011 17:50:19 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9EBC8FC12; Wed, 11 May 2011 17:50:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BHoJEj099843; Wed, 11 May 2011 17:50:19 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BHoJtO099841; Wed, 11 May 2011 17:50:19 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201105111750.p4BHoJtO099841@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 11 May 2011 17:50:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221783 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 17:50:20 -0000 Author: obrien Date: Wed May 11 17:50:19 2011 New Revision: 221783 URL: http://svn.freebsd.org/changeset/base/221783 Log: + DTrace as a bootstrap tool is only needed on certain older systems. + Be more consistent between BMAKE and TMAKE. + Add NO_CTF to crosstools as is done for bootstrap and build tools. Reviewed by: marcel Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed May 11 17:20:35 2011 (r221782) +++ head/Makefile.inc1 Wed May 11 17:50:19 2011 (r221783) @@ -246,9 +246,10 @@ TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \ ${BMAKEENV} ${MAKE} -f Makefile.inc1 \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ DESTDIR= \ + BOOTSTRAPPING=${OSRELDATE} \ SSP_CFLAGS= \ - BOOTSTRAPPING=${OSRELDATE} -DNO_LINT -DNO_CPU_CFLAGS \ - -DNO_WARNS -DNO_CTF + -DNO_LINT \ + -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF # cross-tools stage XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \ @@ -829,7 +830,7 @@ buildkernel: @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ - ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS \ + ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile # XXX - Gratuitously builds aicasm in the ``makeoptions NO_MODULES'' case. .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) @@ -1024,7 +1025,9 @@ _clang_tblgen= \ usr.bin/clang/tblgen .endif -.if ${MK_CDDL} != "no" +.if ${MK_CDDL} != "no" && \ + ${BOOTSTRAPPING} < 800038 && \ + !(${BOOTSTRAPPING} >= 700112 && ${BOOTSTRAPPING} < 799999) _dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge .endif @@ -1033,6 +1036,9 @@ _dtrace_tools= cddl/usr.bin/sgsmsg cddl/ _dtc= gnu/usr.bin/dtc .endif +# Please document (add comment) why something is in 'bootstrap-tools'. +# Try to bound the building of the bootstrap-tool to just the +# FreeBSD versions that need the tool built at this stage of the build. bootstrap-tools: .for _tool in \ ${_clang_tblgen} \ From owner-svn-src-head@FreeBSD.ORG Wed May 11 17:57:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DEBC1065673; Wed, 11 May 2011 17:57:16 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EFEF8FC14; Wed, 11 May 2011 17:57:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BHvGqX000210; Wed, 11 May 2011 17:57:16 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BHvFMm000208; Wed, 11 May 2011 17:57:15 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201105111757.p4BHvFMm000208@svn.freebsd.org> From: Dmitry Chagin Date: Wed, 11 May 2011 17:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221784 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 17:57:16 -0000 Author: dchagin Date: Wed May 11 17:57:15 2011 New Revision: 221784 URL: http://svn.freebsd.org/changeset/base/221784 Log: Remove wrong comment. MFC after: 1 week. Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed May 11 17:50:19 2011 (r221783) +++ head/sys/amd64/amd64/machdep.c Wed May 11 17:57:15 2011 (r221784) @@ -1298,9 +1298,6 @@ add_smap_entry(struct bios_smap *smap, v * available physical memory in the system, then test this memory and * build the phys_avail array describing the actually-available memory. * - * If we cannot accurately determine the physical memory map, then use - * value from the 0xE801 call, and failing that, the RTC. - * * Total memory size may be set by the kernel environment variable * hw.physmem or the compile-time define MAXMEM. * From owner-svn-src-head@FreeBSD.ORG Wed May 11 19:59:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BF41106564A; Wed, 11 May 2011 19:59:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324A78FC13; Wed, 11 May 2011 19:59:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BJxipi004098; Wed, 11 May 2011 19:59:44 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BJxiN0004096; Wed, 11 May 2011 19:59:44 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201105111959.p4BJxiN0004096@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 11 May 2011 19:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221788 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 19:59:44 -0000 Author: ae Date: Wed May 11 19:59:43 2011 New Revision: 221788 URL: http://svn.freebsd.org/changeset/base/221788 Log: Add basic metadata integrity check. In case when partition table was probed and read successfull, but it contains invalid values (e.g. overlapped partitions, offset or size is out of bounds), then table will be rejected. MFC after: 1 month Modified: head/sys/geom/part/g_part.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed May 11 19:06:09 2011 (r221787) +++ head/sys/geom/part/g_part.c Wed May 11 19:59:43 2011 (r221788) @@ -231,6 +231,48 @@ g_part_geometry(struct g_part_table *tab } } +static int +g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp) +{ + struct g_part_entry *e1, *e2; + struct g_provider *pp; + + pp = cp->provider; + if (table->gpt_first > table->gpt_last || + table->gpt_last > pp->mediasize / pp->sectorsize - 1) + goto fail; + + LIST_FOREACH(e1, &table->gpt_entry, gpe_entry) { + if (e1->gpe_deleted || e1->gpe_internal) + continue; + if (e1->gpe_start < table->gpt_first || + e1->gpe_start > table->gpt_last || + e1->gpe_end < e1->gpe_start || + e1->gpe_end > table->gpt_last) + goto fail; + e2 = e1; + while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) { + if (e2->gpe_deleted || e2->gpe_internal) + continue; + if (e1->gpe_start >= e2->gpe_start && + e1->gpe_start <= e2->gpe_end) + goto fail; + if (e1->gpe_end >= e2->gpe_start && + e1->gpe_end <= e2->gpe_end) + goto fail; + if (e1->gpe_start < e2->gpe_start && + e1->gpe_end > e2->gpe_end) + goto fail; + } + } + return (0); +fail: + if (bootverbose) + printf("GEOM_PART: integrity check failed (%s, %s)\n", + pp->name, table->gpt_scheme->name); + return (EINVAL); +} + struct g_part_entry * g_part_new_entry(struct g_part_table *table, int index, quad_t start, quad_t end) @@ -1310,9 +1352,11 @@ g_part_ctl_undo(struct gctl_req *req, st error = G_PART_READ(table, cp); if (error) goto fail; + error = g_part_check_integrity(table, cp); + if (error) + goto fail; g_topology_lock(); - LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { if (!entry->gpe_internal) g_part_new_provider(gp, table, entry); @@ -1773,6 +1817,9 @@ g_part_taste(struct g_class *mp, struct error = G_PART_READ(table, cp); if (error) goto fail; + error = g_part_check_integrity(table, cp); + if (error) + goto fail; g_topology_lock(); LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { From owner-svn-src-head@FreeBSD.ORG Wed May 11 20:31:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC8D91065674; Wed, 11 May 2011 20:31:27 +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 B27CC8FC17; Wed, 11 May 2011 20:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BKVReO005051; Wed, 11 May 2011 20:31:27 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BKVREu005043; Wed, 11 May 2011 20:31:27 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201105112031.p4BKVREu005043@svn.freebsd.org> From: Jack F Vogel Date: Wed, 11 May 2011 20:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221789 - in head/sys/dev: ahci ata ata/chipsets ichsmb ichwd sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 20:31:28 -0000 Author: jfv Date: Wed May 11 20:31:27 2011 New Revision: 221789 URL: http://svn.freebsd.org/changeset/base/221789 Log: Chipset support for the new Intel Panther Point PCH, thanks to Seth Heasley for preparing the changes. Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ichsmb/ichsmb_pci.c head/sys/dev/ichwd/ichwd.c head/sys/dev/ichwd/ichwd.h head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/ahci/ahci.c Wed May 11 20:31:27 2011 (r221789) @@ -164,10 +164,18 @@ static struct { {0x1c038086, 0x00, "Intel Cougar Point", 0}, {0x1c048086, 0x00, "Intel Cougar Point", 0}, {0x1c058086, 0x00, "Intel Cougar Point", 0}, - {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x1d028086, 0x00, "Intel Patsburg", 0}, {0x1d048086, 0x00, "Intel Patsburg", 0}, {0x1d068086, 0x00, "Intel Patsburg", 0}, + {0x1e028086, 0x00, "Intel Panther Point", 0}, + {0x1e038086, 0x00, "Intel Panther Point", 0}, + {0x1e048086, 0x00, "Intel Panther Point", 0}, + {0x1e058086, 0x00, "Intel Panther Point", 0}, + {0x1e068086, 0x00, "Intel Panther Point", 0}, + {0x1e078086, 0x00, "Intel Panther Point", 0}, + {0x1e0e8086, 0x00, "Intel Panther Point", 0}, + {0x1e0f8086, 0x00, "Intel Panther Point", 0}, + {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/ata/ata-pci.h Wed May 11 20:31:27 2011 (r221789) @@ -233,6 +233,19 @@ struct ata_pci_controller { #define ATA_PBG_R2 0x1d068086 #define ATA_PBG_S2 0x1d088086 +#define ATA_PPT_S1 0x1e008086 +#define ATA_PPT_S2 0x1e018086 +#define ATA_PPT_AH1 0x1e028086 +#define ATA_PPT_AH2 0x1e038086 +#define ATA_PPT_R1 0x1e048086 +#define ATA_PPT_R2 0x1e058086 +#define ATA_PPT_R3 0x1e068086 +#define ATA_PPT_R4 0x1e078086 +#define ATA_PPT_S3 0x1e088086 +#define ATA_PPT_S4 0x1e098086 +#define ATA_PPT_R5 0x1e0e8086 +#define ATA_PPT_R6 0x1e0f8086 + #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/ata/chipsets/ata-intel.c Wed May 11 20:31:27 2011 (r221789) @@ -181,6 +181,18 @@ ata_intel_probe(device_t dev) { ATA_PBG_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Patsburg" }, { ATA_PBG_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Patsburg" }, + { ATA_PPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, + { ATA_PPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Panther Point" }, { ATA_I31244, 0, 0, 2, ATA_SA150, "31244" }, { ATA_ISCH, 0, 0, 1, ATA_UDMA5, "SCH" }, { ATA_DH89XXCC, 0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" }, Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/ichsmb/ichsmb_pci.c Wed May 11 20:31:27 2011 (r221789) @@ -84,6 +84,7 @@ __FBSDID("$FreeBSD$"); #define ID_DH89XXCC 0x23308086 #define ID_PATSBURG 0x1d228086 #define ID_CPT 0x1c228086 +#define ID_PPT 0x1e228086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -186,6 +187,9 @@ ichsmb_pci_probe(device_t dev) case ID_CPT: device_set_desc(dev, "Intel Cougar Point SMBus controller"); break; + case ID_PPT: + device_set_desc(dev, "Intel Panther Point SMBus controller"); + break; default: return (ENXIO); } Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/ichwd/ichwd.c Wed May 11 20:31:27 2011 (r221789) @@ -157,9 +157,41 @@ static struct ichwd_device ichwd_devices { DEVICEID_CPT29, "Intel Cougar Point watchdog timer", 10 }, { DEVICEID_CPT30, "Intel Cougar Point watchdog timer", 10 }, { DEVICEID_CPT31, "Intel Cougar Point watchdog timer", 10 }, - { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, { DEVICEID_PATSBURG_LPC1, "Intel Patsburg watchdog timer", 10 }, { DEVICEID_PATSBURG_LPC2, "Intel Patsburg watchdog timer", 10 }, + { DEVICEID_PPT0, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT1, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT2, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT3, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT4, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT5, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT6, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT7, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT8, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT9, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT10, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT11, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT12, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT13, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT14, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT15, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT16, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT17, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT18, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT19, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT20, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT21, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT22, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT23, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT24, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT25, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT26, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT27, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT28, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT29, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT30, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_PPT31, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, { 0, NULL, 0 }, }; Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/ichwd/ichwd.h Wed May 11 20:31:27 2011 (r221789) @@ -99,6 +99,38 @@ struct ichwd_softc { #define DEVICEID_CPT31 0x1c5f #define DEVICEID_PATSBURG_LPC1 0x1d40 #define DEVICEID_PATSBURG_LPC2 0x1d41 +#define DEVICEID_PPT0 0x1e40 +#define DEVICEID_PPT1 0x1e41 +#define DEVICEID_PPT2 0x1e42 +#define DEVICEID_PPT3 0x1e43 +#define DEVICEID_PPT4 0x1e44 +#define DEVICEID_PPT5 0x1e45 +#define DEVICEID_PPT6 0x1e46 +#define DEVICEID_PPT7 0x1e47 +#define DEVICEID_PPT8 0x1e48 +#define DEVICEID_PPT9 0x1e49 +#define DEVICEID_PPT10 0x1e4a +#define DEVICEID_PPT11 0x1e4b +#define DEVICEID_PPT12 0x1e4c +#define DEVICEID_PPT13 0x1e4d +#define DEVICEID_PPT14 0x1e4e +#define DEVICEID_PPT15 0x1e4f +#define DEVICEID_PPT16 0x1e50 +#define DEVICEID_PPT17 0x1e51 +#define DEVICEID_PPT18 0x1e52 +#define DEVICEID_PPT19 0x1e53 +#define DEVICEID_PPT20 0x1e54 +#define DEVICEID_PPT21 0x1e55 +#define DEVICEID_PPT22 0x1e56 +#define DEVICEID_PPT23 0x1e57 +#define DEVICEID_PPT24 0x1e58 +#define DEVICEID_PPT25 0x1e59 +#define DEVICEID_PPT26 0x1e5a +#define DEVICEID_PPT27 0x1e5b +#define DEVICEID_PPT28 0x1e5c +#define DEVICEID_PPT29 0x1e5d +#define DEVICEID_PPT30 0x1e5e +#define DEVICEID_PPT31 0x1e5f #define DEVICEID_DH89XXCC_LPC 0x2310 #define DEVICEID_82801AA 0x2410 #define DEVICEID_82801AB 0x2420 Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed May 11 19:59:43 2011 (r221788) +++ head/sys/dev/sound/pci/hda/hdac.c Wed May 11 20:31:27 2011 (r221789) @@ -142,6 +142,7 @@ SND_DECLARE_FILE("$FreeBSD$"); #define INTEL_VENDORID 0x8086 #define HDA_INTEL_CPT HDA_MODEL_CONSTRUCT(INTEL, 0x1c20) #define HDA_INTEL_PATSBURG HDA_MODEL_CONSTRUCT(INTEL, 0x1d20) +#define HDA_INTEL_PPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x1e20) #define HDA_INTEL_82801F HDA_MODEL_CONSTRUCT(INTEL, 0x2668) #define HDA_INTEL_63XXESB HDA_MODEL_CONSTRUCT(INTEL, 0x269a) #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) @@ -495,6 +496,7 @@ static const struct { } hdac_devices[] = { { HDA_INTEL_CPT, "Intel Cougar Point", 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0 }, + { HDA_INTEL_PPT, "Intel Panther Point", 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0 }, From owner-svn-src-head@FreeBSD.ORG Wed May 11 21:47:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43EB31065673; Wed, 11 May 2011 21:47:31 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 28F8F8FC13; Wed, 11 May 2011 21:47:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BLlV73007406; Wed, 11 May 2011 21:47:31 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BLlVAn007404; Wed, 11 May 2011 21:47:31 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201105112147.p4BLlVAn007404@svn.freebsd.org> From: Andrew Thompson Date: Wed, 11 May 2011 21:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221792 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 21:47:31 -0000 Author: thompsa Date: Wed May 11 21:47:30 2011 New Revision: 221792 URL: http://svn.freebsd.org/changeset/base/221792 Log: Move the three geom kprocs as threads under a single pid. Reviewed by: julian Modified: head/sys/geom/geom_kern.c Modified: head/sys/geom/geom_kern.c ============================================================================== --- head/sys/geom/geom_kern.c Wed May 11 21:15:12 2011 (r221791) +++ head/sys/geom/geom_kern.c Wed May 11 21:47:30 2011 (r221792) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -57,7 +58,10 @@ MALLOC_DEFINE(M_GEOM, "GEOM", "Geom data struct sx topology_lock; -static struct proc *g_up_proc; +static struct proc *g_proc; +static struct thread *g_up_td; +static struct thread *g_down_td; +static struct thread *g_event_td; int g_debugflags; int g_collectstats = 1; @@ -82,71 +86,43 @@ int g_shutdown; */ static void -g_up_procbody(void) +g_up_procbody(void *arg) { - struct proc *p = g_up_proc; - struct thread *tp = FIRST_THREAD_IN_PROC(p); mtx_assert(&Giant, MA_NOTOWNED); - thread_lock(tp); - sched_prio(tp, PRIBIO); - thread_unlock(tp); + thread_lock(g_up_td); + sched_prio(g_up_td, PRIBIO); + thread_unlock(g_up_td); for(;;) { - g_io_schedule_up(tp); + g_io_schedule_up(g_up_td); } } -static struct kproc_desc g_up_kp = { - "g_up", - g_up_procbody, - &g_up_proc, -}; - -static struct proc *g_down_proc; - static void -g_down_procbody(void) +g_down_procbody(void *arg) { - struct proc *p = g_down_proc; - struct thread *tp = FIRST_THREAD_IN_PROC(p); mtx_assert(&Giant, MA_NOTOWNED); - thread_lock(tp); - sched_prio(tp, PRIBIO); - thread_unlock(tp); + thread_lock(g_down_td); + sched_prio(g_down_td, PRIBIO); + thread_unlock(g_down_td); for(;;) { - g_io_schedule_down(tp); + g_io_schedule_down(g_down_td); } } -static struct kproc_desc g_down_kp = { - "g_down", - g_down_procbody, - &g_down_proc, -}; - -static struct proc *g_event_proc; - static void -g_event_procbody(void) +g_event_procbody(void *arg) { - struct proc *p = g_event_proc; - struct thread *tp = FIRST_THREAD_IN_PROC(p); mtx_assert(&Giant, MA_NOTOWNED); - thread_lock(tp); - sched_prio(tp, PRIBIO); - thread_unlock(tp); + thread_lock(g_event_td); + sched_prio(g_event_td, PRIBIO); + thread_unlock(g_event_td); g_run_events(); /* NOTREACHED */ } -static struct kproc_desc g_event_kp = { - "g_event", - g_event_procbody, - &g_event_proc, -}; - static void geom_shutdown(void *foo __unused) { @@ -164,9 +140,12 @@ g_init(void) g_event_init(); g_ctl_init(); mtx_lock(&Giant); - kproc_start(&g_event_kp); - kproc_start(&g_up_kp); - kproc_start(&g_down_kp); + kproc_kthread_add(g_event_procbody, NULL, &g_proc, &g_event_td, + RFHIGHPID, 0, "geom", "g_event"); + kproc_kthread_add(g_up_procbody, NULL, &g_proc, &g_up_td, + RFHIGHPID, 0, "geom", "g_up"); + kproc_kthread_add(g_down_procbody, NULL, &g_proc, &g_down_td, + RFHIGHPID, 0, "geom", "g_down"); mtx_unlock(&Giant); EVENTHANDLER_REGISTER(shutdown_pre_sync, geom_shutdown, NULL, SHUTDOWN_PRI_FIRST); From owner-svn-src-head@FreeBSD.ORG Wed May 11 21:52:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C18B106564A; Wed, 11 May 2011 21:52:27 +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 1B35C8FC17; Wed, 11 May 2011 21:52:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4BLqQLf007589; Wed, 11 May 2011 21:52:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4BLqQuI007584; Wed, 11 May 2011 21:52:26 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105112152.p4BLqQuI007584@svn.freebsd.org> From: Xin LI Date: Wed, 11 May 2011 21:52:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221793 - head/contrib/netcat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 21:52:27 -0000 Author: delphij Date: Wed May 11 21:52:26 2011 New Revision: 221793 URL: http://svn.freebsd.org/changeset/base/221793 Log: MFV: nc(1) from OpenBSD 4.9. MFC after: 1 month Obtained from: OpenBSD Modified: head/contrib/netcat/atomicio.c head/contrib/netcat/nc.1 head/contrib/netcat/netcat.c head/contrib/netcat/socks.c Directory Properties: head/contrib/netcat/ (props changed) Modified: head/contrib/netcat/atomicio.c ============================================================================== --- head/contrib/netcat/atomicio.c Wed May 11 21:47:30 2011 (r221792) +++ head/contrib/netcat/atomicio.c Wed May 11 21:52:26 2011 (r221793) @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.c,v 1.9 2007/09/07 14:50:44 tobias Exp $ */ +/* $OpenBSD: atomicio.c,v 1.10 2011/01/08 00:47:19 jeremy Exp $ */ /* * Copyright (c) 2006 Damien Miller. All rights reserved. * Copyright (c) 2005 Anil Madhavapeddy. All rights reserved. @@ -53,7 +53,7 @@ atomicio(ssize_t (*f) (int, void *, size case -1: if (errno == EINTR) continue; - if (errno == EAGAIN) { + if ((errno == EAGAIN) || (errno == ENOBUFS)) { (void)poll(&pfd, 1, -1); continue; } Modified: head/contrib/netcat/nc.1 ============================================================================== --- head/contrib/netcat/nc.1 Wed May 11 21:47:30 2011 (r221792) +++ head/contrib/netcat/nc.1 Wed May 11 21:52:26 2011 (r221793) @@ -1,4 +1,4 @@ -.\" $OpenBSD: nc.1,v 1.55 2010/07/25 07:51:39 guenther Exp $ +.\" $OpenBSD: nc.1,v 1.57 2011/01/09 22:16:46 jeremy Exp $ .\" .\" Copyright (c) 1996 David Sacerdote .\" All rights reserved. @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 25, 2010 +.Dd January 8, 2011 .Dt NC 1 .Os .Sh NAME @@ -44,7 +44,7 @@ .Op Fl O Ar length .Op Fl P Ar proxy_username .Op Fl p Ar source_port -.Op Fl s Ar source_ip_address +.Op Fl s Ar source .Op Fl T Ar ToS .Op Fl V Ar rtable .Op Fl w Ar timeout @@ -53,7 +53,7 @@ .Fl x Ar proxy_address Ns Oo : Ns .Ar port Oc .Xc Oc -.Op Ar hostname +.Op Ar destination .Op Ar port .Ek .Sh DESCRIPTION @@ -61,8 +61,10 @@ The .Nm (or .Nm netcat ) -utility is used for just about anything under the sun involving TCP -or UDP. +utility is used for just about anything under the sun involving TCP, +UDP, or +.Ux Ns -domain +sockets. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. @@ -175,8 +177,12 @@ instead of sequentially within a range o assigns them. .It Fl S Enables the RFC 2385 TCP MD5 signature option. -.It Fl s Ar source_ip_address +.It Fl s Ar source Specifies the IP of the interface which is used to send the packets. +For +.Ux Ns -domain +datagram sockets, specifies the local temporary socket file +to create and use so that datagrams can be received. It is an error to use this option in conjunction with the .Fl l option. @@ -201,6 +207,16 @@ Specifies to use sockets. .It Fl u Use UDP instead of the default option of TCP. +For +.Ux Ns -domain +sockets, use a datagram socket instead of a stream socket. +If a +.Ux Ns -domain +socket is used, a temporary receiving socket is created in +.Pa /tmp +unless the +.Fl s +flag is given. .It Fl V Ar rtable Set the routing table .Pq Dq FIB @@ -244,7 +260,7 @@ If the protocol is not specified, SOCKS Requests that .Nm should connect to -.Ar hostname +.Ar destination using a proxy at .Ar proxy_address and @@ -262,16 +278,22 @@ It is an error to use this option in con option. .El .Pp -.Ar hostname +.Ar destination can be a numerical IP address or a symbolic hostname (unless the .Fl n option is given). -In general, a hostname must be specified, +In general, a destination must be specified, unless the .Fl l option is given (in which case the local host is used). +For +.Ux Ns -domain +sockets, a destination is required and is the socket path to connect to +(or listen on if the +.Fl l +option is given). .Pp .Ar port can be a single integer or a range of ports. @@ -280,8 +302,7 @@ In general, a destination port must be specified, unless the .Fl U -option is given -(in which case a socket must be specified). +option is given. .Sh CLIENT/SERVER MODEL It is quite simple to build a very basic client/server model using .Nm . @@ -424,7 +445,7 @@ outgoing traffic only. .Pp Create and listen on a .Ux Ns -domain -socket: +stream socket: .Pp .Dl $ nc -lU /var/tmp/dsocket .Pp Modified: head/contrib/netcat/netcat.c ============================================================================== --- head/contrib/netcat/netcat.c Wed May 11 21:47:30 2011 (r221792) +++ head/contrib/netcat/netcat.c Wed May 11 21:52:26 2011 (r221793) @@ -1,4 +1,4 @@ -/* $OpenBSD: netcat.c,v 1.98 2010/07/03 04:44:51 guenther Exp $ */ +/* $OpenBSD: netcat.c,v 1.100 2011/01/09 22:16:46 jeremy Exp $ */ /* * Copyright (c) 2001 Eric Jackson * @@ -70,6 +70,7 @@ #define PORT_MAX 65535 #define PORT_MAX_LEN 6 +#define UNIX_DG_TMP_SOCKET_SIZE 19 /* Command Line Options */ int dflag; /* detached, no stdin */ @@ -98,6 +99,7 @@ u_int rtableid; int timeout = -1; int family = AF_UNSPEC; char *portlist[PORT_MAX+1]; +char *unix_dg_tmp_socket; void atelnet(int, unsigned char *, unsigned int); void build_ports(char *); @@ -108,6 +110,7 @@ int remote_connect(const char *, const c int socks_connect(const char *, const char *, struct addrinfo, const char *, const char *, struct addrinfo, int, const char *); int udptest(int); +int unix_bind(char *); int unix_connect(char *); int unix_listen(char *); void set_common_sockopts(int); @@ -134,6 +137,7 @@ main(int argc, char *argv[]) char *proxy; const char *errstr, *proxyhost = "", *proxyport = NULL; struct addrinfo proxyhints; + char unix_dg_tmp_socket_buf[UNIX_DG_TMP_SOCKET_SIZE]; struct option longopts[] = { { "no-tcpopt", no_argument, &FreeBSD_Oflag, 1 }, { NULL, 0, NULL, 0 } @@ -288,8 +292,6 @@ main(int argc, char *argv[]) /* Cruft to make sure options are clean, and used properly. */ if (argv[0] && !argv[1] && family == AF_UNIX) { - if (uflag) - errx(1, "cannot use -u and -U"); host = argv[0]; uport = NULL; } else if (argv[0] && !argv[1]) { @@ -312,6 +314,19 @@ main(int argc, char *argv[]) if (!lflag && kflag) errx(1, "must use -l with -k"); + /* Get name of temporary socket for unix datagram client */ + if ((family == AF_UNIX) && uflag && !lflag) { + if (sflag) { + unix_dg_tmp_socket = sflag; + } else { + strlcpy(unix_dg_tmp_socket_buf, "/tmp/nc.XXXXXXXXXX", + UNIX_DG_TMP_SOCKET_SIZE); + if (mktemp(unix_dg_tmp_socket_buf) == NULL) + err(1, "mktemp"); + unix_dg_tmp_socket = unix_dg_tmp_socket_buf; + } + } + /* Initialize addrinfo structure. */ if (family != AF_UNIX) { memset(&hints, 0, sizeof(struct addrinfo)); @@ -354,8 +369,12 @@ main(int argc, char *argv[]) int connfd; ret = 0; - if (family == AF_UNIX) - s = unix_listen(host); + if (family == AF_UNIX) { + if (uflag) + s = unix_bind(host); + else + s = unix_listen(host); + } /* Allow only one connection at a time, but stay alive. */ for (;;) { @@ -384,17 +403,21 @@ main(int argc, char *argv[]) if (rv < 0) err(1, "connect"); - connfd = s; + readwrite(s); } else { len = sizeof(cliaddr); connfd = accept(s, (struct sockaddr *)&cliaddr, &len); + readwrite(connfd); + close(connfd); } - readwrite(connfd); - close(connfd); if (family != AF_UNIX) close(s); + else if (uflag) { + if (connect(s, NULL, 0) < 0) + err(1, "connect"); + } if (!kflag) break; @@ -408,6 +431,8 @@ main(int argc, char *argv[]) } else ret = 1; + if (uflag) + unlink(unix_dg_tmp_socket); exit(ret); } else { @@ -468,18 +493,19 @@ main(int argc, char *argv[]) } /* - * unix_connect() - * Returns a socket connected to a local unix socket. Returns -1 on failure. + * unix_bind() + * Returns a unix socket bound to the given path */ int -unix_connect(char *path) +unix_bind(char *path) { struct sockaddr_un sun; int s; - if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + /* Create unix domain socket. */ + if ((s = socket(AF_UNIX, uflag ? SOCK_DGRAM : SOCK_STREAM, + 0)) < 0) return (-1); - (void)fcntl(s, F_SETFD, 1); memset(&sun, 0, sizeof(struct sockaddr_un)); sun.sun_family = AF_UNIX; @@ -490,27 +516,32 @@ unix_connect(char *path) errno = ENAMETOOLONG; return (-1); } - if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) { + + if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) { close(s); return (-1); } return (s); - } /* - * unix_listen() - * Create a unix domain socket, and listen on it. + * unix_connect() + * Returns a socket connected to a local unix socket. Returns -1 on failure. */ int -unix_listen(char *path) +unix_connect(char *path) { struct sockaddr_un sun; int s; - /* Create unix domain socket. */ - if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) - return (-1); + if (uflag) { + if ((s = unix_bind(unix_dg_tmp_socket)) < 0) + return (-1); + } else { + if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + return (-1); + } + (void)fcntl(s, F_SETFD, 1); memset(&sun, 0, sizeof(struct sockaddr_un)); sun.sun_family = AF_UNIX; @@ -521,11 +552,24 @@ unix_listen(char *path) errno = ENAMETOOLONG; return (-1); } - - if (bind(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) { + if (connect(s, (struct sockaddr *)&sun, SUN_LEN(&sun)) < 0) { close(s); return (-1); } + return (s); + +} + +/* + * unix_listen() + * Create a unix domain socket, and listen on it. + */ +int +unix_listen(char *path) +{ + int s; + if ((s = unix_bind(path)) < 0) + return (-1); if (listen(s, 5) < 0) { close(s); @@ -989,9 +1033,9 @@ usage(int ret) #else "usage: nc [-46DdhklnrStUuvz] [-I length] [-i interval] [-O length]\n" #endif - "\t [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS]\n" + "\t [-P proxy_username] [-p source_port] [-s source] [-T ToS]\n" "\t [-V rtable] [-w timeout] [-X proxy_protocol]\n" - "\t [-x proxy_address[:port]] [hostname] [port]\n"); + "\t [-x proxy_address[:port]] [destination] [port]\n"); if (ret) exit(1); } Modified: head/contrib/netcat/socks.c ============================================================================== --- head/contrib/netcat/socks.c Wed May 11 21:47:30 2011 (r221792) +++ head/contrib/netcat/socks.c Wed May 11 21:52:26 2011 (r221793) @@ -1,4 +1,4 @@ -/* $OpenBSD: socks.c,v 1.18 2010/04/20 07:26:35 nicm Exp $ */ +/* $OpenBSD: socks.c,v 1.19 2011/02/12 15:54:18 okan Exp $ */ /* * Copyright (c) 1999 Niklas Hallqvist. All rights reserved. @@ -222,11 +222,25 @@ socks_connect(const char *host, const ch if (cnt != wlen) err(1, "write failed (%zu/%zu)", cnt, wlen); - cnt = atomicio(read, proxyfd, buf, 10); - if (cnt != 10) - err(1, "read failed (%zu/10)", cnt); + cnt = atomicio(read, proxyfd, buf, 4); + if (cnt != 4) + err(1, "read failed (%zu/4)", cnt); if (buf[1] != 0) errx(1, "connection failed, SOCKS error %d", buf[1]); + switch (buf[3]) { + case SOCKS_IPV4: + cnt = atomicio(read, proxyfd, buf + 4, 6); + if (cnt != 6) + err(1, "read failed (%zd/6)", cnt); + break; + case SOCKS_IPV6: + cnt = atomicio(read, proxyfd, buf + 4, 18); + if (cnt != 18) + err(1, "read failed (%zd/18)", cnt); + break; + default: + errx(1, "connection failed, unsupported address type"); + } } else if (socksv == 4) { /* This will exit on lookup failure */ decode_addrport(host, port, (struct sockaddr *)&addr, From owner-svn-src-head@FreeBSD.ORG Wed May 11 23:59:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C703D106566B; Wed, 11 May 2011 23:59:56 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 585248FC12; Wed, 11 May 2011 23:59:55 +0000 (UTC) Received: by gxk28 with SMTP id 28so451512gxk.13 for ; Wed, 11 May 2011 16:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=EAax9Iw1dUyrHKp2kvzAH8kgslLzDBJ6tn/tP6qreh8=; b=SZ43pJPzWoAbuMAdO0RTEtIGT1kbjwZcREM2jpaFofmzQPZO2qEya17rArlB2Q+0Ua 5WdV6rpvZ0SHDHohnARrOBY6qX/IEHMyOyc9bVGOzjeJ51sJltd2NF2rsSOQy3mpBfkp X7j1cG8hIQPandRjvufMiIoxJsYhx/m5UlYM4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=lUXXoGXzyCLdAq1JCKveHze536DL3RA5DPTwVjTzC6o8Q4Iu6zA3AZZJx8sF6xsmFd 2MriR03ltYcXIBhRDwQ+Aq0BlVJEELRE784WNlWe+NW+FiuvIkQrtSH/bv7q4xjrqo9N LCNMWnuv/LN0ZY8Oxt+KqnYN3ttOyUEdCg8zE= Received: by 10.236.192.227 with SMTP id i63mr11088733yhn.182.1305158395370; Wed, 11 May 2011 16:59:55 -0700 (PDT) Received: from [192.168.14.127] ([24.114.252.245]) by mx.google.com with ESMTPS id 23sm347219yhl.101.2011.05.11.16.59.53 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 May 2011 16:59:54 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <201105112031.p4BKVREu005043@svn.freebsd.org> Date: Wed, 11 May 2011 19:59:53 -0400 Content-Transfer-Encoding: 7bit Message-Id: References: <201105112031.p4BKVREu005043@svn.freebsd.org> To: Jack F Vogel X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221789 - in head/sys/dev: ahci ata ata/chipsets ichsmb ichwd sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 May 2011 23:59:56 -0000 On May 11, 2011, at 4:31 PM, Jack F Vogel wrote: > +#define HDA_INTEL_PPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x1e20) Is this a typo? > #define HDA_INTEL_82801F HDA_MODEL_CONSTRUCT(INTEL, 0x2668) > #define HDA_INTEL_63XXESB HDA_MODEL_CONSTRUCT(INTEL, 0x269a) > #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) > @@ -495,6 +496,7 @@ static const struct { > } hdac_devices[] = { > { HDA_INTEL_CPT, "Intel Cougar Point", 0 }, > { HDA_INTEL_PATSBURG,"Intel Patsburg", 0 }, > + { HDA_INTEL_PPT, "Intel Panther Point", 0 }, > { HDA_INTEL_82801F, "Intel 82801F", 0 }, > { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0 }, > { HDA_INTEL_82801G, "Intel 82801G", 0 }, Thanks, -Garrett From owner-svn-src-head@FreeBSD.ORG Thu May 12 00:10:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 055061065677; Thu, 12 May 2011 00:10:30 +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 E98A98FC1D; Thu, 12 May 2011 00:10:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4C0ATla011632; Thu, 12 May 2011 00:10:29 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4C0ATJx011630; Thu, 12 May 2011 00:10:29 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201105120010.p4C0ATJx011630@svn.freebsd.org> From: Jack F Vogel Date: Thu, 12 May 2011 00:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221794 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 00:10:30 -0000 Author: jfv Date: Thu May 12 00:10:29 2011 New Revision: 221794 URL: http://svn.freebsd.org/changeset/base/221794 Log: Correct a typo Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed May 11 21:52:26 2011 (r221793) +++ head/sys/dev/sound/pci/hda/hdac.c Thu May 12 00:10:29 2011 (r221794) @@ -496,7 +496,7 @@ static const struct { } hdac_devices[] = { { HDA_INTEL_CPT, "Intel Cougar Point", 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0 }, - { HDA_INTEL_PPT, "Intel Panther Point", 0 }, + { HDA_INTEL_PPT1, "Intel Panther Point", 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0 }, From owner-svn-src-head@FreeBSD.ORG Thu May 12 00:38:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F7ED1065670; Thu, 12 May 2011 00:38:31 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 040208FC19; Thu, 12 May 2011 00:38:30 +0000 (UTC) Received: by vws18 with SMTP id 18so1053661vws.13 for ; Wed, 11 May 2011 17:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=RHRUeIhKyAtgyPSYNquXrP9AErlVbcLWEPg8PFiYDKY=; b=XbI6Djij8DyY099JAn9nsUHW0ux2v/ZdcKrg+/Lcl5yXoBpQp38ty9sVcl4K1Sht/B thdt3KYt6ww5F1bIfqnWlqJ3XZ2bffB3g5n7O37hcjp3CtvaMNAzOOOg6TcyX2S4MMoB jB8GCLsKTyX8wboGKPThrE0dqdnnLfbwLbXwk= 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=QDBR8sU9jtyVaLH6bmJu26cH/ihqrXC3c+dCRkON0+wCwJ+JTJJhNiy5AzIul5z2L0 hGfG1mcX5MtiE36+7sJexF0JDJc8xD/U7J45BMDbreluMsvfvmFQGB6mRUsTnY7TZlQW /X0B0sse2LSy9jQAWmZlZ0aE6ADvy0vI1UWRg= MIME-Version: 1.0 Received: by 10.52.74.99 with SMTP id s3mr2267554vdv.108.1305158909593; Wed, 11 May 2011 17:08:29 -0700 (PDT) Received: by 10.52.183.233 with HTTP; Wed, 11 May 2011 17:08:29 -0700 (PDT) In-Reply-To: References: <201105112031.p4BKVREu005043@svn.freebsd.org> Date: Wed, 11 May 2011 17:08:29 -0700 Message-ID: From: Jack Vogel To: Garrett Cooper Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jack F Vogel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221789 - in head/sys/dev: ahci ata ata/chipsets ichsmb ichwd sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 00:38:31 -0000 Hmmm, thanks for pointing that out, will check on Seth's email, clearly one or the other is wrong. Jack On Wed, May 11, 2011 at 4:59 PM, Garrett Cooper wrote: > On May 11, 2011, at 4:31 PM, Jack F Vogel wrote: > > > +#define HDA_INTEL_PPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x1e20) > > Is this a typo? > > > #define HDA_INTEL_82801F HDA_MODEL_CONSTRUCT(INTEL, 0x2668) > > #define HDA_INTEL_63XXESB HDA_MODEL_CONSTRUCT(INTEL, 0x269a) > > #define HDA_INTEL_82801G HDA_MODEL_CONSTRUCT(INTEL, 0x27d8) > > @@ -495,6 +496,7 @@ static const struct { > > } hdac_devices[] = { > > { HDA_INTEL_CPT, "Intel Cougar Point", 0 }, > > { HDA_INTEL_PATSBURG,"Intel Patsburg", 0 }, > > + { HDA_INTEL_PPT, "Intel Panther Point", 0 }, > > { HDA_INTEL_82801F, "Intel 82801F", 0 }, > > { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0 }, > > { HDA_INTEL_82801G, "Intel 82801G", 0 }, > > Thanks, > -Garrett > From owner-svn-src-head@FreeBSD.ORG Thu May 12 03:15:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA7D106566B; Thu, 12 May 2011 03:15:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 906858FC0A; Thu, 12 May 2011 03:15:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4C3FLXV017733; Thu, 12 May 2011 03:15:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4C3FLGS017731; Thu, 12 May 2011 03:15:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105120315.p4C3FLGS017731@svn.freebsd.org> From: Adrian Chadd Date: Thu, 12 May 2011 03:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221800 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 03:15:21 -0000 Author: adrian Date: Thu May 12 03:15:21 2011 New Revision: 221800 URL: http://svn.freebsd.org/changeset/base/221800 Log: Fixes from Atheros: * If AR9130, give the chip extra time to reset * If AR5416, don't shutdown the chip during reset Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Thu May 12 02:23:06 2011 (r221799) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c Thu May 12 03:15:21 2011 (r221800) @@ -56,7 +56,10 @@ ar5416SetPowerModeAwake(struct ath_hal * OS_REG_SET_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN); OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN); - OS_DELAY(50); /* Give chip the chance to awake */ + if (AR_SREV_HOWL(ah)) + OS_DELAY(10000); + else + OS_DELAY(50); /* Give chip the chance to awake */ for (i = POWER_UP_TIME / 50; i != 0; i--) { val = OS_REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M; @@ -94,7 +97,8 @@ ar5416SetPowerModeSleep(struct ath_hal * if (! AR_SREV_HOWL(ah)) OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF); /* Shutdown chip. Active low */ - OS_REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN); + if (! AR_SREV_OWL(ah)) + OS_REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN); } } From owner-svn-src-head@FreeBSD.ORG Thu May 12 03:25:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13DA5106566C; Thu, 12 May 2011 03:25:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04DE38FC08; Thu, 12 May 2011 03:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4C3POnS018082; Thu, 12 May 2011 03:25:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4C3POrI018080; Thu, 12 May 2011 03:25:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105120325.p4C3POrI018080@svn.freebsd.org> From: Adrian Chadd Date: Thu, 12 May 2011 03:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221801 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 03:25:25 -0000 Author: adrian Date: Thu May 12 03:25:24 2011 New Revision: 221801 URL: http://svn.freebsd.org/changeset/base/221801 Log: Fix the half/quater rate PLL setup for AR5416, AR9160 and (beta?) AR9280 chips. Note: This doesn't "fix" half/quarter rate support for these chips; it merely fixes an oversight. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu May 12 03:15:21 2011 (r221800) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu May 12 03:25:24 2011 (r221801) @@ -1389,10 +1389,12 @@ ar5416InitPLL(struct ath_hal *ah, const pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); else if (IEEE80211_IS_CHAN_QUARTER(chan)) pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); - else if (IEEE80211_IS_CHAN_5GHZ(chan)) + + if (IEEE80211_IS_CHAN_5GHZ(chan)) pll |= SM(0x28, AR_RTC_SOWL_PLL_DIV); else pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV); + } else pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV); } else if (AR_SREV_SOWL_10_OR_LATER(ah)) { @@ -1402,7 +1404,8 @@ ar5416InitPLL(struct ath_hal *ah, const pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); else if (IEEE80211_IS_CHAN_QUARTER(chan)) pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); - else if (IEEE80211_IS_CHAN_5GHZ(chan)) + + if (IEEE80211_IS_CHAN_5GHZ(chan)) pll |= SM(0x50, AR_RTC_SOWL_PLL_DIV); else pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV); @@ -1415,7 +1418,8 @@ ar5416InitPLL(struct ath_hal *ah, const pll |= SM(0x1, AR_RTC_PLL_CLKSEL); else if (IEEE80211_IS_CHAN_QUARTER(chan)) pll |= SM(0x2, AR_RTC_PLL_CLKSEL); - else if (IEEE80211_IS_CHAN_5GHZ(chan)) + + if (IEEE80211_IS_CHAN_5GHZ(chan)) pll |= SM(0xa, AR_RTC_PLL_DIV); else pll |= SM(0xb, AR_RTC_PLL_DIV); From owner-svn-src-head@FreeBSD.ORG Thu May 12 07:44:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75902106566B; Thu, 12 May 2011 07:44:41 +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 59DCB8FC17; Thu, 12 May 2011 07:44:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4C7ifOo025827; Thu, 12 May 2011 07:44:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4C7ifiM025825; Thu, 12 May 2011 07:44:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105120744.p4C7ifiM025825@svn.freebsd.org> From: Andriy Gapon Date: Thu, 12 May 2011 07:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221803 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 07:44:41 -0000 Author: avg Date: Thu May 12 07:44:41 2011 New Revision: 221803 URL: http://svn.freebsd.org/changeset/base/221803 Log: dsp/pcm: allow to mmap both read and write buffers using the same fd This brings our implementation in line with OSS specification for systems that support mmap. The change should also improve compatibility with OSS software not specifically written for FreeBSD, e.g. PulseAudio OSS plugin. Reviewed by: kib, jhb MFC after: 1 week Modified: head/sys/dev/sound/pcm/dsp.c Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Thu May 12 03:37:03 2011 (r221802) +++ head/sys/dev/sound/pcm/dsp.c Thu May 12 07:44:41 2011 (r221803) @@ -34,6 +34,11 @@ #include #include +#include +#include +#include +#include + SND_DECLARE_FILE("$FreeBSD$"); static int dsp_mmap_allow_prot_exec = 0; @@ -67,6 +72,7 @@ static d_write_t dsp_write; static d_ioctl_t dsp_ioctl; static d_poll_t dsp_poll; static d_mmap_t dsp_mmap; +static d_mmap_single_t dsp_mmap_single; struct cdevsw dsp_cdevsw = { .d_version = D_VERSION, @@ -77,6 +83,7 @@ struct cdevsw dsp_cdevsw = { .d_ioctl = dsp_ioctl, .d_poll = dsp_poll, .d_mmap = dsp_mmap, + .d_mmap_single = dsp_mmap_single, .d_name = "dsp", }; @@ -2187,6 +2194,16 @@ static int dsp_mmap(struct cdev *i_dev, vm_ooffset_t offset, vm_paddr_t *paddr, int nprot, vm_memattr_t *memattr) { + + /* XXX memattr is not honored */ + *paddr = vtophys(offset); + return (0); +} + +static int +dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, + vm_size_t size, struct vm_object **object, int nprot) +{ struct snddev_info *d; struct pcm_channel *wrch, *rdch, *c; @@ -2205,51 +2222,48 @@ dsp_mmap(struct cdev *i_dev, vm_ooffset_ #else if ((nprot & PROT_EXEC) && dsp_mmap_allow_prot_exec < 1) #endif - return (-1); + return (EINVAL); + + /* + * PROT_READ (alone) selects the input buffer. + * PROT_WRITE (alone) selects the output buffer. + * PROT_WRITE|PROT_READ together select the output buffer. + */ + if ((nprot & (PROT_READ | PROT_WRITE)) == 0) + return (EINVAL); d = dsp_get_info(i_dev); if (!DSP_REGISTERED(d, i_dev)) - return (-1); + return (EINVAL); PCM_GIANT_ENTER(d); getchns(i_dev, &rdch, &wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); - /* - * XXX The linux api uses the nprot to select read/write buffer - * our vm system doesn't allow this, so force write buffer. - * - * This is just a quack to fool full-duplex mmap, so that at - * least playback _or_ recording works. If you really got the - * urge to make _both_ work at the same time, avoid O_RDWR. - * Just open each direction separately and mmap() it. - * - * Failure is not an option due to INVARIANTS check within - * device_pager.c, which means, we have to give up one over - * another. - */ - c = (wrch != NULL) ? wrch : rdch; - + c = ((nprot & PROT_WRITE) != 0) ? wrch : rdch; if (c == NULL || (c->flags & CHN_F_MMAP_INVALID) || - offset >= sndbuf_getsize(c->bufsoft) || + (*offset + size) > sndbuf_getsize(c->bufsoft) || (wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) || (rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) { relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); PCM_GIANT_EXIT(d); - return (-1); + return (EINVAL); } - /* XXX full-duplex quack. */ if (wrch != NULL) wrch->flags |= CHN_F_MMAP; if (rdch != NULL) rdch->flags |= CHN_F_MMAP; - *paddr = vtophys(sndbuf_getbufofs(c->bufsoft, offset)); + *offset = (vm_ooffset_t)sndbuf_getbufofs(c->bufsoft, *offset); relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); + *object = vm_pager_allocate(OBJT_DEVICE, i_dev, + size, nprot, *offset, curthread->td_ucred); PCM_GIANT_LEAVE(d); + if (*object == NULL) + return (EINVAL); return (0); } From owner-svn-src-head@FreeBSD.ORG Thu May 12 09:47:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27633106566C; Thu, 12 May 2011 09:47:28 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id CC06C8FC14; Thu, 12 May 2011 09:47:27 +0000 (UTC) Received: from orion.SpringDaemons.com (c-76-102-119-9.hsd1.ca.comcast.net [76.102.119.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 4BD608FC2D; Thu, 12 May 2011 13:47:26 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 165B339858; Thu, 12 May 2011 02:49:57 -0700 (PDT) Date: Thu, 12 May 2011 02:49:56 -0700 From: Stanislav Sedov To: Jung-uk Kim Message-Id: <20110512024956.996cd973.stas@FreeBSD.org> In-Reply-To: <201105091734.p49HY0P3006180@svn.freebsd.org> References: <201105091734.p49HY0P3006180@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 09:47:28 -0000 On Mon, 9 May 2011 17:34:00 +0000 (UTC) Jung-uk Kim mentioned: > Author: jkim > Date: Mon May 9 17:34:00 2011 > New Revision: 221703 > URL: http://svn.freebsd.org/changeset/base/221703 > > Log: > Implement boot-time TSC synchronization test for SMP. This test is executed > when the user has indicated that the system has synchronized TSCs or it has > P-state invariant TSCs. For the former case, we may clear the tunable if it > fails the test to prevent accidental foot-shooting. For the latter case, we > may set it if it passes the test to notify the user that it may be usable. > Hi, Jung-uk! My kernel no longer boots on my Dual Xeon Dell Precision after this commit. It hangs immediately after the "AP launched" messages. I uploaded my verbose boot log from the old kernel to http://www.SpringDaemons.com/stas/boot.verbose Thanks! -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-head@FreeBSD.ORG Thu May 12 10:11:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D3BD1065670; Thu, 12 May 2011 10:11:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 121D08FC12; Thu, 12 May 2011 10:11:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CABOnw030392; Thu, 12 May 2011 10:11:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CABOwp030387; Thu, 12 May 2011 10:11:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105121011.p4CABOwp030387@svn.freebsd.org> From: Adrian Chadd Date: Thu, 12 May 2011 10:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221806 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 10:11:25 -0000 Author: adrian Date: Thu May 12 10:11:24 2011 New Revision: 221806 URL: http://svn.freebsd.org/changeset/base/221806 Log: Break out the AR9285 analog registers from ar5416/ar5416phy.h and put them in a new header file, ar9002/ar9285_an.h. Shuffle the AR9280 analog registers in ar5416/ar541phy.h into a contiguous spot. Added: head/sys/dev/ath/ath_hal/ar9002/ar9285an.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Thu May 12 09:29:24 2011 (r221805) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Thu May 12 10:11:24 2011 (r221806) @@ -78,27 +78,6 @@ #define AR_RTC_DERIVED_CLK_PERIOD_S 1 #endif /* AH_SUPPORT_AR9130 */ -/* AR9280: rf long shift registers */ -#define AR_AN_RF2G1_CH0 0x7810 -#define AR_AN_RF5G1_CH0 0x7818 -#define AR_AN_RF2G1_CH1 0x7834 -#define AR_AN_RF5G1_CH1 0x783C -#define AR_AN_TOP2 0x7894 -#define AR_AN_SYNTH9 0x7868 -#define AR9285_AN_RF2G1 0x7820 -#define AR9285_AN_RF2G2 0x7824 -#define AR9285_AN_RF2G3 0x7828 -#define AR9285_AN_RF2G4 0x782C -#define AR9285_AN_RF2G6 0x7834 -#define AR9285_AN_RF2G7 0x7838 -#define AR9285_AN_RF2G8 0x783C -#define AR9285_AN_RF2G9 0x7840 -#define AR9285_AN_RXTXBB1 0x7854 -#define AR9285_AN_TOP2 0x7868 -#define AR9285_AN_TOP3 0x786c -#define AR9285_AN_TOP4 0x7870 -#define AR9285_AN_TOP4_DEFAULT 0x10142c00 - #define AR_RESET_TSF 0x8020 #define AR_RXFIFO_CFG 0x8114 #define AR_PHY_ERR_1 0x812c @@ -374,6 +353,13 @@ #define AR_RTC_PLL_CLKSEL_S 8 /* AR9280: rf long shift registers */ +#define AR_AN_RF2G1_CH0 0x7810 +#define AR_AN_RF5G1_CH0 0x7818 +#define AR_AN_RF2G1_CH1 0x7834 +#define AR_AN_RF5G1_CH1 0x783C +#define AR_AN_TOP2 0x7894 +#define AR_AN_SYNTH9 0x7868 + #define AR_AN_RF2G1_CH0_OB 0x03800000 #define AR_AN_RF2G1_CH0_OB_S 23 #define AR_AN_RF2G1_CH0_DB 0x1C000000 @@ -408,85 +394,9 @@ #define AR_AN_SYNTH9_REFDIVA 0xf8000000 #define AR_AN_SYNTH9_REFDIVA_S 27 -/* AR9285 Analog registers */ -#define AR9285_AN_RF2G1_ENPACAL 0x00000800 -#define AR9285_AN_RF2G1_ENPACAL_S 11 -#define AR9285_AN_RF2G1_PDPADRV1 0x02000000 -#define AR9285_AN_RF2G1_PDPADRV1_S 25 -#define AR9285_AN_RF2G1_PDPADRV2 0x01000000 -#define AR9285_AN_RF2G1_PDPADRV2_S 24 -#define AR9285_AN_RF2G1_PDPAOUT 0x00800000 -#define AR9285_AN_RF2G1_PDPAOUT_S 23 - -#define AR9285_AN_RF2G2_OFFCAL 0x00001000 -#define AR9285_AN_RF2G2_OFFCAL_S 12 - -#define AR9285_AN_RF2G3_PDVCCOMP 0x02000000 -#define AR9285_AN_RF2G3_PDVCCOMP_S 25 -#define AR9285_AN_RF2G3_OB_0 0x00E00000 -#define AR9285_AN_RF2G3_OB_0_S 21 -#define AR9285_AN_RF2G3_OB_1 0x001C0000 -#define AR9285_AN_RF2G3_OB_1_S 18 -#define AR9285_AN_RF2G3_OB_2 0x00038000 -#define AR9285_AN_RF2G3_OB_2_S 15 -#define AR9285_AN_RF2G3_OB_3 0x00007000 -#define AR9285_AN_RF2G3_OB_3_S 12 -#define AR9285_AN_RF2G3_OB_4 0x00000E00 -#define AR9285_AN_RF2G3_OB_4_S 9 - -#define AR9285_AN_RF2G3_DB1_0 0x000001C0 -#define AR9285_AN_RF2G3_DB1_0_S 6 -#define AR9285_AN_RF2G3_DB1_1 0x00000038 -#define AR9285_AN_RF2G3_DB1_1_S 3 -#define AR9285_AN_RF2G3_DB1_2 0x00000007 -#define AR9285_AN_RF2G3_DB1_2_S 0 - -#define AR9285_AN_RF2G4_DB1_3 0xE0000000 -#define AR9285_AN_RF2G4_DB1_3_S 29 -#define AR9285_AN_RF2G4_DB1_4 0x1C000000 -#define AR9285_AN_RF2G4_DB1_4_S 26 - -#define AR9285_AN_RF2G4_DB2_0 0x03800000 -#define AR9285_AN_RF2G4_DB2_0_S 23 -#define AR9285_AN_RF2G4_DB2_1 0x00700000 -#define AR9285_AN_RF2G4_DB2_1_S 20 -#define AR9285_AN_RF2G4_DB2_2 0x000E0000 -#define AR9285_AN_RF2G4_DB2_2_S 17 -#define AR9285_AN_RF2G4_DB2_3 0x0001C000 -#define AR9285_AN_RF2G4_DB2_3_S 14 -#define AR9285_AN_RF2G4_DB2_4 0x00003800 -#define AR9285_AN_RF2G4_DB2_4_S 11 - -#define AR9285_AN_RF2G6_CCOMP 0x00007800 -#define AR9285_AN_RF2G6_CCOMP_S 11 -#define AR9285_AN_RF2G6_OFFS 0x03f00000 -#define AR9285_AN_RF2G6_OFFS_S 20 - #define AR9271_AN_RF2G6_OFFS 0x07f00000 #define AR9271_AN_RF2G6_OFFS_S 20 -#define AR9285_AN_RF2G7_PWDDB 0x00000002 -#define AR9285_AN_RF2G7_PWDDB_S 1 -#define AR9285_AN_RF2G7_PADRVGN2TAB0 0xE0000000 -#define AR9285_AN_RF2G7_PADRVGN2TAB0_S 29 - -#define AR9285_AN_RF2G8_PADRVGN2TAB0 0x0001C000 -#define AR9285_AN_RF2G8_PADRVGN2TAB0_S 14 - -#define AR9285_AN_RXTXBB1_PDRXTXBB1 0x00000020 -#define AR9285_AN_RXTXBB1_PDRXTXBB1_S 5 -#define AR9285_AN_RXTXBB1_PDV2I 0x00000080 -#define AR9285_AN_RXTXBB1_PDV2I_S 7 -#define AR9285_AN_RXTXBB1_PDDACIF 0x00000100 -#define AR9285_AN_RXTXBB1_PDDACIF_S 8 -#define AR9285_AN_RXTXBB1_SPARE9 0x00000001 -#define AR9285_AN_RXTXBB1_SPARE9_S 0 - -#define AR9285_AN_TOP3_XPABIAS_LVL 0x0000000C -#define AR9285_AN_TOP3_XPABIAS_LVL_S 2 -#define AR9285_AN_TOP3_PWDDAC 0x00800000 -#define AR9285_AN_TOP3_PWDDAC_S 23 - /* Sleep control */ #define AR5416_SLEEP1_CAB_TIMEOUT 0xFFE00000 /* Cab timeout (TU) */ #define AR5416_SLEEP1_CAB_TIMEOUT_S 22 Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Thu May 12 09:29:24 2011 (r221805) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_cal.c Thu May 12 10:11:24 2011 (r221806) @@ -36,6 +36,7 @@ #include "ar5416/ar5416phy.h" #include "ar9002/ar9002phy.h" #include "ar9002/ar9285phy.h" +#include "ar9002/ar9285an.h" #include "ar9002/ar9285_cal.h" Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Thu May 12 09:29:24 2011 (r221805) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Thu May 12 10:11:24 2011 (r221806) @@ -37,6 +37,7 @@ #include "ar5416/ar5416phy.h" #include "ar9002/ar9002phy.h" #include "ar9002/ar9285phy.h" +#include "ar9002/ar9285an.h" /* Eeprom versioning macros. Returns true if the version is equal or newer than the ver specified */ #define EEP_MINOR(_ah) \ Added: head/sys/dev/ath/ath_hal/ar9002/ar9285an.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285an.h Thu May 12 10:11:24 2011 (r221806) @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2008-2009 Sam Leffler, Errno Consulting + * Copyright (c) 2008 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or 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. + * + * $FreeBSD$ + */ + +#ifndef __AR9285_AN_H__ +#define __AR9285_AN_H__ + +/* AR9285 Analog register definitions */ + +#define AR9285_AN_RF2G1 0x7820 + +#define AR9285_AN_RF2G1_ENPACAL 0x00000800 +#define AR9285_AN_RF2G1_ENPACAL_S 11 +#define AR9285_AN_RF2G1_PDPADRV1 0x02000000 +#define AR9285_AN_RF2G1_PDPADRV1_S 25 +#define AR9285_AN_RF2G1_PDPADRV2 0x01000000 +#define AR9285_AN_RF2G1_PDPADRV2_S 24 +#define AR9285_AN_RF2G1_PDPAOUT 0x00800000 +#define AR9285_AN_RF2G1_PDPAOUT_S 23 + +#define AR9285_AN_RF2G2 0x7824 + +#define AR9285_AN_RF2G2_OFFCAL 0x00001000 +#define AR9285_AN_RF2G2_OFFCAL_S 12 + +#define AR9285_AN_RF2G3 0x7828 + +#define AR9285_AN_RF2G3_PDVCCOMP 0x02000000 +#define AR9285_AN_RF2G3_PDVCCOMP_S 25 +#define AR9285_AN_RF2G3_OB_0 0x00E00000 +#define AR9285_AN_RF2G3_OB_0_S 21 +#define AR9285_AN_RF2G3_OB_1 0x001C0000 +#define AR9285_AN_RF2G3_OB_1_S 18 +#define AR9285_AN_RF2G3_OB_2 0x00038000 +#define AR9285_AN_RF2G3_OB_2_S 15 +#define AR9285_AN_RF2G3_OB_3 0x00007000 +#define AR9285_AN_RF2G3_OB_3_S 12 +#define AR9285_AN_RF2G3_OB_4 0x00000E00 +#define AR9285_AN_RF2G3_OB_4_S 9 +#define AR9285_AN_RF2G3_DB1_0 0x000001C0 +#define AR9285_AN_RF2G3_DB1_0_S 6 +#define AR9285_AN_RF2G3_DB1_1 0x00000038 +#define AR9285_AN_RF2G3_DB1_1_S 3 +#define AR9285_AN_RF2G3_DB1_2 0x00000007 +#define AR9285_AN_RF2G3_DB1_2_S 0 + +#define AR9285_AN_RF2G4 0x782C + +#define AR9285_AN_RF2G4_DB1_3 0xE0000000 +#define AR9285_AN_RF2G4_DB1_3_S 29 +#define AR9285_AN_RF2G4_DB1_4 0x1C000000 +#define AR9285_AN_RF2G4_DB1_4_S 26 + +#define AR9285_AN_RF2G4_DB2_0 0x03800000 +#define AR9285_AN_RF2G4_DB2_0_S 23 +#define AR9285_AN_RF2G4_DB2_1 0x00700000 +#define AR9285_AN_RF2G4_DB2_1_S 20 +#define AR9285_AN_RF2G4_DB2_2 0x000E0000 +#define AR9285_AN_RF2G4_DB2_2_S 17 +#define AR9285_AN_RF2G4_DB2_3 0x0001C000 +#define AR9285_AN_RF2G4_DB2_3_S 14 +#define AR9285_AN_RF2G4_DB2_4 0x00003800 +#define AR9285_AN_RF2G4_DB2_4_S 11 + +#define AR9285_AN_RF2G6 0x7834 + +#define AR9285_AN_RF2G6_CCOMP 0x00007800 +#define AR9285_AN_RF2G6_CCOMP_S 11 +#define AR9285_AN_RF2G6_OFFS 0x03f00000 +#define AR9285_AN_RF2G6_OFFS_S 20 + +#define AR9285_AN_RF2G7 0x7838 + +#define AR9285_AN_RF2G7_PWDDB 0x00000002 +#define AR9285_AN_RF2G7_PWDDB_S 1 +#define AR9285_AN_RF2G7_PADRVGN2TAB0 0xE0000000 +#define AR9285_AN_RF2G7_PADRVGN2TAB0_S 29 + +#define AR9285_AN_RF2G8 0x783C + +#define AR9285_AN_RF2G8_PADRVGN2TAB0 0x0001C000 +#define AR9285_AN_RF2G8_PADRVGN2TAB0_S 14 + +#define AR9285_AN_RF2G9 0x7840 + +#define AR9285_AN_RXTXBB1 0x7854 + +#define AR9285_AN_RXTXBB1_PDRXTXBB1 0x00000020 +#define AR9285_AN_RXTXBB1_PDRXTXBB1_S 5 +#define AR9285_AN_RXTXBB1_PDV2I 0x00000080 +#define AR9285_AN_RXTXBB1_PDV2I_S 7 +#define AR9285_AN_RXTXBB1_PDDACIF 0x00000100 +#define AR9285_AN_RXTXBB1_PDDACIF_S 8 +#define AR9285_AN_RXTXBB1_SPARE9 0x00000001 +#define AR9285_AN_RXTXBB1_SPARE9_S 0 + +#define AR9285_AN_TOP2 0x7868 + +#define AR9285_AN_TOP3 0x786c + +#define AR9285_AN_TOP3_XPABIAS_LVL 0x0000000C +#define AR9285_AN_TOP3_XPABIAS_LVL_S 2 +#define AR9285_AN_TOP3_PWDDAC 0x00800000 +#define AR9285_AN_TOP3_PWDDAC_S 23 + +#define AR9285_AN_TOP4 0x7870 +#define AR9285_AN_TOP4_DEFAULT 0x10142c00 + +#endif /* __AR9285_AN_H__ */ From owner-svn-src-head@FreeBSD.ORG Thu May 12 10:11:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4F41065706; Thu, 12 May 2011 10:11:39 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6278FC1B; Thu, 12 May 2011 10:11:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CABdiL030440; Thu, 12 May 2011 10:11:39 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CABdkM030432; Thu, 12 May 2011 10:11:39 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105121011.p4CABdkM030432@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 12 May 2011 10:11:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221807 - in head: lib lib/libprocstat lib/libprocstat/zfs lib/libutil sys/kern sys/sys usr.bin/fstat usr.bin/fstat/zfs usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 10:11:39 -0000 Author: stas Date: Thu May 12 10:11:39 2011 New Revision: 221807 URL: http://svn.freebsd.org/changeset/base/221807 Log: - Commit work from libprocstat project. These patches add support for runtime file and processes information retrieval from the running kernel via sysctl in the form of new library, libprocstat. The library also supports KVM backend for analyzing memory crash dumps. Both procstat(1) and fstat(1) utilities have been modified to take advantage of the library (as the bonus point the fstat(1) utility no longer need superuser privileges to operate), and the procstat(1) utility is now able to display information from memory dumps as well. The newly introduced fuser(1) utility also uses this library and able to operate via sysctl and kvm backends. The library is by no means complete (e.g. KVM backend is missing vnode name resolution routines, and there're no manpages for the library itself) so I plan to improve it further. I'm commiting it so it will get wider exposure and review. We won't be able to MFC this work as it relies on changes in HEAD, which was introduced some time ago, that break kernel ABI. OTOH we may be able to merge the library with KVM backend if we really need it there. Discussed with: rwatson Added: head/lib/libprocstat/ head/lib/libprocstat/Makefile (contents, props changed) head/lib/libprocstat/cd9660.c (contents, props changed) head/lib/libprocstat/common_kvm.c (contents, props changed) head/lib/libprocstat/common_kvm.h (contents, props changed) head/lib/libprocstat/libprocstat.c (contents, props changed) head/lib/libprocstat/libprocstat.h (contents, props changed) head/lib/libprocstat/libprocstat_internal.h (contents, props changed) head/lib/libprocstat/msdosfs.c (contents, props changed) head/lib/libprocstat/ntfs.c (contents, props changed) head/lib/libprocstat/nwfs.c (contents, props changed) head/lib/libprocstat/smbfs.c (contents, props changed) head/lib/libprocstat/udf.c (contents, props changed) head/lib/libprocstat/zfs/ head/lib/libprocstat/zfs.c (contents, props changed) head/lib/libprocstat/zfs/Makefile (contents, props changed) head/lib/libutil/kinfo_getallproc.3 (contents, props changed) head/lib/libutil/kinfo_getallproc.c (contents, props changed) head/lib/libutil/kinfo_getproc.3 (contents, props changed) head/lib/libutil/kinfo_getproc.c (contents, props changed) head/usr.bin/fstat/functions.h (contents, props changed) head/usr.bin/fstat/fuser.1 (contents, props changed) head/usr.bin/fstat/fuser.c (contents, props changed) head/usr.bin/fstat/main.c (contents, props changed) Deleted: head/usr.bin/fstat/cd9660.c head/usr.bin/fstat/fstat.h head/usr.bin/fstat/msdosfs.c head/usr.bin/fstat/zfs/ head/usr.bin/fstat/zfs.c Modified: head/lib/Makefile head/lib/libutil/Makefile head/lib/libutil/libutil.h head/sys/kern/kern_descrip.c head/sys/kern/kern_proc.c head/sys/sys/user.h head/usr.bin/fstat/Makefile head/usr.bin/fstat/fstat.c head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_bin.c head/usr.bin/procstat/procstat_cred.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_sigs.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/procstat/procstat_vm.c Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Thu May 12 10:11:24 2011 (r221806) +++ head/lib/Makefile Thu May 12 10:11:39 2011 (r221807) @@ -92,6 +92,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libpkg} \ ${_libpmc} \ ${_libproc} \ + libprocstat \ librt \ ${_librtld_db} \ ${_libsdp} \ Added: head/lib/libprocstat/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/Makefile Thu May 12 10:11:39 2011 (r221807) @@ -0,0 +1,36 @@ +# $FreeBSD$ + +.include + +LIB= procstat + +SRCS= cd9660.c \ + common_kvm.c \ + libprocstat.c \ + msdosfs.c \ + ntfs.c \ + nwfs.c \ + smbfs.c \ + udf.c + +INCS= libprocstat.h +CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE +SHLIB_MAJOR= 1 +WITHOUT_MAN= yes + +# XXX This is a hack. +.if ${MK_CDDL} != "no" +CFLAGS+= -DZFS +OBJS+= zfs/zfs.o +SOBJS+= zfs/zfs.So +POBJS+= zfs/zfs.po +SUBDIR= zfs +zfs/zfs.o: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs.o +zfs/zfs.So: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs.So +zfs/zfs.po: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs.po +.endif + +.include Added: head/lib/libprocstat/cd9660.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/cd9660.c Thu May 12 10:11:39 2011 (r221807) @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2000 Peter Edwards + * Copyright (c) 1988, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by Peter Edwards + * + * 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + */ + +/* + * XXX - + * This had to be separated from fstat.c because cd9660s has namespace + * conflicts with UFS. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#define _KERNEL +#include +#undef _KERNEL + +#include +#include + +#include "libprocstat.h" +#include "common_kvm.h" + +int +isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) +{ + struct iso_node isonode; + struct iso_mnt mnt; + + if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &isonode, + sizeof(isonode))) { + warnx("can't read iso_node at %p", + (void *)VTOI(vp)); + return (1); + } + if (!kvm_read_all(kd, (unsigned long)isonode.i_mnt, &mnt, + sizeof(mnt))) { + warnx("can't read iso_mnt at %p", + (void *)VTOI(vp)); + return (1); + } + vn->vn_fsid = dev2udev(kd, mnt.im_dev); + vn->vn_mode = (mode_t)isonode.inode.iso_mode; + vn->vn_fileid = (long)isonode.i_number; + vn->vn_size = (u_long)isonode.i_size; + return (0); +} Added: head/lib/libprocstat/common_kvm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/common_kvm.c Thu May 12 10:11:39 2011 (r221807) @@ -0,0 +1,207 @@ +/*- + * Copyright (c) 2009 Stanislav Sedov + * Copyright (c) 1988, 1993 + * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#define _KERNEL +#include +#include +#include +#include +#include +#include +#undef _KERNEL +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include "common_kvm.h" + +int +kvm_read_all(kvm_t *kd, unsigned long addr, void *buf, size_t nbytes) +{ + ssize_t error; + + if (nbytes >= SSIZE_MAX) + return (0); + error = kvm_read(kd, addr, buf, nbytes); + return (error == (ssize_t)(nbytes)); +} + +int +kdevtoname(kvm_t *kd, struct cdev *dev, char *buf) +{ + struct cdev si; + + assert(buf); + if (!kvm_read_all(kd, (unsigned long)dev, &si, sizeof(si))) + return (1); + strlcpy(buf, si.__si_namebuf, SPECNAMELEN + 1); + return (0); +} + +int +ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) +{ + struct inode inode; + + if (!kvm_read_all(kd, (unsigned long)VTOI(vp), &inode, sizeof(inode))) { + warnx("can't read inode at %p", (void *)VTOI(vp)); + return (1); + } + /* + * The st_dev from stat(2) is a dev_t. These kernel structures + * contain cdev pointers. We need to convert to dev_t to make + * comparisons + */ + vn->vn_fsid = dev2udev(kd, inode.i_dev); + vn->vn_fileid = (long)inode.i_number; + vn->vn_mode = (mode_t)inode.i_mode; + vn->vn_size = (u_long)inode.i_size; + return (0); +} + +int +devfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) +{ + struct devfs_dirent devfs_dirent; + struct mount mount; + + if (!kvm_read_all(kd, (unsigned long)getvnodedata(vp), &devfs_dirent, + sizeof(devfs_dirent))) { + warnx("can't read devfs_dirent at %p", + (void *)vp->v_data); + return (1); + } + if (!kvm_read_all(kd, (unsigned long)getvnodemount(vp), &mount, + sizeof(mount))) { + warnx("can't read mount at %p", + (void *)getvnodemount(vp)); + return (1); + } + vn->vn_fsid = mount.mnt_stat.f_fsid.val[0]; + vn->vn_fileid = devfs_dirent.de_inode; + vn->vn_mode = (devfs_dirent.de_mode & ~S_IFMT) | S_IFCHR; + vn->vn_size = 0; + return (0); +} + +int +nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn) +{ + struct nfsnode nfsnode; + mode_t mode; + + if (!kvm_read_all(kd, (unsigned long)VTONFS(vp), &nfsnode, + sizeof(nfsnode))) { + warnx("can't read nfsnode at %p", + (void *)VTONFS(vp)); + return (1); + } + vn->vn_fsid = nfsnode.n_vattr.va_fsid; + vn->vn_fileid = nfsnode.n_vattr.va_fileid; + vn->vn_size = nfsnode.n_size; + mode = (mode_t)nfsnode.n_vattr.va_mode; + switch (vp->v_type) { + case VREG: + mode |= S_IFREG; + break; + case VDIR: + mode |= S_IFDIR; + break; + case VBLK: + mode |= S_IFBLK; + break; + case VCHR: + mode |= S_IFCHR; + break; + case VLNK: + mode |= S_IFLNK; + break; + case VSOCK: + mode |= S_IFSOCK; + break; + case VFIFO: + mode |= S_IFIFO; + break; + default: + break; + }; + vn->vn_mode = mode; + return (0); +} + +/* + * Read the cdev structure in the kernel in order to work out the + * associated dev_t + */ +dev_t +dev2udev(kvm_t *kd, struct cdev *dev) +{ + struct cdev_priv priv; + + assert(kd); + if (kvm_read_all(kd, (unsigned long)cdev2priv(dev), &priv, + sizeof(priv))) { + return ((dev_t)priv.cdp_inode); + } else { + warnx("can't convert cdev *%p to a dev_t\n", dev); + return (-1); + } +} + +void * +getvnodedata(struct vnode *vp) +{ + return (vp->v_data); +} + +struct mount * +getvnodemount(struct vnode *vp) +{ + return (vp->v_mount); +} Added: head/lib/libprocstat/common_kvm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/common_kvm.h Thu May 12 10:11:39 2011 (r221807) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2009 Stanislav Sedov + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 _COMMON_KVM_H_ +#define _COMMON_KVM_H_ + +dev_t dev2udev(kvm_t *kd, struct cdev *dev); +int kdevtoname(kvm_t *kd, struct cdev *dev, char *); +int kvm_read_all(kvm_t *kd, unsigned long addr, void *buf, + size_t nbytes); + +/* + * Filesystems specific access routines. + */ +int devfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int isofs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int msdosfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int nfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int ntfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int nwfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int smbfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int udf_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int ufs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +int zfs_filestat(kvm_t *kd, struct vnode *vp, struct vnstat *vn); +void *getvnodedata(struct vnode *vp); +struct mount *getvnodemount(struct vnode *vp); + +#endif /* _COMMON_KVM_H_ */ Added: head/lib/libprocstat/libprocstat.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/libprocstat.c Thu May 12 10:11:39 2011 (r221807) @@ -0,0 +1,1306 @@ +/*- + * Copyright (c) 2009 Stanislav Sedov + * Copyright (c) 1988, 1993 + * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define _WANT_FILE +#include +#include +#define _KERNEL +#include +#include +#include +#include +#include +#include +#undef _KERNEL +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include "libprocstat_internal.h" +#include "common_kvm.h" + +int statfs(const char *, struct statfs *); /* XXX */ + +#define PROCSTAT_KVM 1 +#define PROCSTAT_SYSCTL 2 + +static char *getmnton(kvm_t *kd, struct mount *m); +static struct filestat_list *procstat_getfiles_kvm( + struct procstat *procstat, struct kinfo_proc *kp, int mmapped); +static struct filestat_list *procstat_getfiles_sysctl( + struct procstat *procstat, struct kinfo_proc *kp, int mmapped); +static int procstat_get_pipe_info_sysctl(struct filestat *fst, + struct pipestat *pipe, char *errbuf); +static int procstat_get_pipe_info_kvm(kvm_t *kd, struct filestat *fst, + struct pipestat *pipe, char *errbuf); +static int procstat_get_pts_info_sysctl(struct filestat *fst, + struct ptsstat *pts, char *errbuf); +static int procstat_get_pts_info_kvm(kvm_t *kd, struct filestat *fst, + struct ptsstat *pts, char *errbuf); +static int procstat_get_socket_info_sysctl(struct filestat *fst, + struct sockstat *sock, char *errbuf); +static int procstat_get_socket_info_kvm(kvm_t *kd, struct filestat *fst, + struct sockstat *sock, char *errbuf); +static int to_filestat_flags(int flags); +static int procstat_get_vnode_info_kvm(kvm_t *kd, struct filestat *fst, + struct vnstat *vn, char *errbuf); +static int procstat_get_vnode_info_sysctl(struct filestat *fst, + struct vnstat *vn, char *errbuf); +static int vntype2psfsttype(int type); + +void +procstat_close(struct procstat *procstat) +{ + + assert(procstat); + if (procstat->type == PROCSTAT_KVM) + kvm_close(procstat->kd); +} + +struct procstat * +procstat_open_sysctl(void) +{ + struct procstat *procstat; + + procstat = calloc(1, sizeof(*procstat)); + if (procstat == NULL) { + warn("malloc()"); + return (NULL); + } + procstat->type = PROCSTAT_SYSCTL; + return (procstat); +} + +struct procstat * +procstat_open_kvm(const char *nlistf, const char *memf) +{ + struct procstat *procstat; + kvm_t *kd; + char buf[_POSIX2_LINE_MAX]; + + procstat = calloc(1, sizeof(*procstat)); + if (procstat == NULL) { + warn("malloc()"); + return (NULL); + } + kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf); + if (kd == NULL) { + warnx("kvm_openfiles(): %s", buf); + free(procstat); + return (NULL); + } + procstat->type = PROCSTAT_KVM; + procstat->kd = kd; + return (procstat); +} + +struct kinfo_proc * +procstat_getprocs(struct procstat *procstat, int what, int arg, + unsigned int *count) +{ + struct kinfo_proc *p0, *p; + size_t len; + int name[4]; + int error; + + assert(procstat); + assert(count); + p = NULL; + if (procstat->type == PROCSTAT_KVM) { + p0 = kvm_getprocs(procstat->kd, what, arg, count); + if (p0 == NULL || count == 0) + return (NULL); + len = *count * sizeof(*p); + p = malloc(len); + if (p == NULL) { + warnx("malloc(%zd)", len); + goto fail; + } + bcopy(p0, p, len); + return (p); + } else if (procstat->type == PROCSTAT_SYSCTL) { + len = 0; + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = what; + name[3] = arg; + error = sysctl(name, 4, NULL, &len, NULL, 0); + if (error < 0 && errno != EPERM) { + warn("sysctl(kern.proc)"); + goto fail; + } + if (len == 0) { + warnx("no processes?"); + goto fail; + } + p = malloc(len); + if (p == NULL) { + warnx("malloc(%zd)", len); + goto fail; + } + error = sysctl(name, 4, p, &len, NULL, 0); + if (error < 0 && errno != EPERM) { + warn("sysctl(kern.proc)"); + goto fail; + } + /* Perform simple consistency checks. */ + if ((len % sizeof(*p)) != 0 || p->ki_structsize != sizeof(*p)) { + warnx("kinfo_proc structure size mismatch"); + goto fail; + } + *count = len / sizeof(*p); + return (p); + } else { + warnx("unknown access method"); + return (NULL); + } +fail: + if (p) + free(p); + return (NULL); +} + +void +procstat_freeprocs(struct procstat *procstat __unused, struct kinfo_proc *p) +{ + + if (p != NULL) + free(p); + p = NULL; +} + +struct filestat_list * +procstat_getfiles(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) +{ + + if (procstat->type == PROCSTAT_SYSCTL) + return (procstat_getfiles_sysctl(procstat, kp, mmapped)); + else if (procstat->type == PROCSTAT_KVM) + return (procstat_getfiles_kvm(procstat, kp, mmapped)); + else + return (NULL); +} + +void +procstat_freefiles(struct procstat *procstat, struct filestat_list *head) +{ + struct filestat *fst, *tmp; + + STAILQ_FOREACH_SAFE(fst, head, next, tmp) { + if (fst->fs_path != NULL) + free(fst->fs_path); + free(fst); + } + free(head); + if (procstat->vmentries != NULL) { + free (procstat->vmentries); + procstat->vmentries = NULL; + } + if (procstat->files != NULL) { + free (procstat->files); + procstat->files = NULL; + } +} + +static struct filestat * +filestat_new_entry(void *typedep, int type, int fd, int fflags, int uflags, + int refcount, off_t offset, char *path) +{ + struct filestat *entry; + + entry = calloc(1, sizeof(*entry)); + if (entry == NULL) { + warn("malloc()"); + return (NULL); + } + entry->fs_typedep = typedep; + entry->fs_fflags = fflags; + entry->fs_uflags = uflags; + entry->fs_fd = fd; + entry->fs_type = type; + entry->fs_ref_count = refcount; + entry->fs_offset = offset; + entry->fs_path = path; + return (entry); +} + +static struct vnode * +getctty(kvm_t *kd, struct kinfo_proc *kp) +{ + struct pgrp pgrp; + struct proc proc; + struct session sess; + int error; + + assert(kp); + error = kvm_read_all(kd, (unsigned long)kp->ki_paddr, &proc, + sizeof(proc)); + if (error == 0) { + warnx("can't read proc struct at %p for pid %d", + kp->ki_paddr, kp->ki_pid); + return (NULL); + } + if (proc.p_pgrp == NULL) + return (NULL); + error = kvm_read_all(kd, (unsigned long)proc.p_pgrp, &pgrp, + sizeof(pgrp)); + if (error == 0) { + warnx("can't read pgrp struct at %p for pid %d", + proc.p_pgrp, kp->ki_pid); + return (NULL); + } + error = kvm_read_all(kd, (unsigned long)pgrp.pg_session, &sess, + sizeof(sess)); + if (error == 0) { + warnx("can't read session struct at %p for pid %d", + pgrp.pg_session, kp->ki_pid); + return (NULL); + } + return (sess.s_ttyvp); +} + +static struct filestat_list * +procstat_getfiles_kvm(struct procstat *procstat, struct kinfo_proc *kp, int mmapped) +{ + struct file file; + struct filedesc filed; + struct vm_map_entry vmentry; + struct vm_object object; + struct vmspace vmspace; + vm_map_entry_t entryp; + vm_map_t map; + vm_object_t objp; + struct vnode *vp; + struct file **ofiles; + struct filestat *entry; + struct filestat_list *head; + kvm_t *kd; + void *data; + int i, fflags; + int prot, type; + unsigned int nfiles; + + assert(procstat); + kd = procstat->kd; + if (kd == NULL) + return (NULL); + if (kp->ki_fd == NULL) + return (NULL); + if (!kvm_read_all(kd, (unsigned long)kp->ki_fd, &filed, + sizeof(filed))) { + warnx("can't read filedesc at %p", (void *)kp->ki_fd); + return (NULL); + } + + /* + * Allocate list head. + */ + head = malloc(sizeof(*head)); + if (head == NULL) + return (NULL); + STAILQ_INIT(head); + + /* root directory vnode, if one. */ + if (filed.fd_rdir) { + entry = filestat_new_entry(filed.fd_rdir, PS_FST_TYPE_VNODE, -1, + PS_FST_FFLAG_READ, PS_FST_UFLAG_RDIR, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + /* current working directory vnode. */ + if (filed.fd_cdir) { + entry = filestat_new_entry(filed.fd_cdir, PS_FST_TYPE_VNODE, -1, + PS_FST_FFLAG_READ, PS_FST_UFLAG_CDIR, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + /* jail root, if any. */ + if (filed.fd_jdir) { + entry = filestat_new_entry(filed.fd_jdir, PS_FST_TYPE_VNODE, -1, + PS_FST_FFLAG_READ, PS_FST_UFLAG_JAIL, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + /* ktrace vnode, if one */ + if (kp->ki_tracep) { + entry = filestat_new_entry(kp->ki_tracep, PS_FST_TYPE_VNODE, -1, + PS_FST_FFLAG_READ | PS_FST_FFLAG_WRITE, + PS_FST_UFLAG_TRACE, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + /* text vnode, if one */ + if (kp->ki_textvp) { + entry = filestat_new_entry(kp->ki_textvp, PS_FST_TYPE_VNODE, -1, + PS_FST_FFLAG_READ, PS_FST_UFLAG_TEXT, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + /* Controlling terminal. */ + if ((vp = getctty(kd, kp)) != NULL) { + entry = filestat_new_entry(vp, PS_FST_TYPE_VNODE, -1, + PS_FST_FFLAG_READ | PS_FST_FFLAG_WRITE, + PS_FST_UFLAG_CTTY, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + + nfiles = filed.fd_lastfile + 1; + ofiles = malloc(nfiles * sizeof(struct file *)); + if (ofiles == NULL) { + warn("malloc(%zd)", nfiles * sizeof(struct file *)); + goto do_mmapped; + } + if (!kvm_read_all(kd, (unsigned long)filed.fd_ofiles, ofiles, + nfiles * sizeof(struct file *))) { + warnx("cannot read file structures at %p", + (void *)filed.fd_ofiles); + free(ofiles); + goto do_mmapped; + } + for (i = 0; i <= filed.fd_lastfile; i++) { + if (ofiles[i] == NULL) + continue; + if (!kvm_read_all(kd, (unsigned long)ofiles[i], &file, + sizeof(struct file))) { + warnx("can't read file %d at %p", i, + (void *)ofiles[i]); + continue; + } + switch (file.f_type) { + case DTYPE_VNODE: + type = PS_FST_TYPE_VNODE; + data = file.f_vnode; + break; + case DTYPE_SOCKET: + type = PS_FST_TYPE_SOCKET; + data = file.f_data; + break; + case DTYPE_PIPE: + type = PS_FST_TYPE_PIPE; + data = file.f_data; + break; + case DTYPE_FIFO: + type = PS_FST_TYPE_FIFO; + data = file.f_vnode; + break; +#ifdef DTYPE_PTS + case DTYPE_PTS: + type = PS_FST_TYPE_PTS; + data = file.f_data; + break; +#endif + default: + continue; + } + entry = filestat_new_entry(data, type, i, + to_filestat_flags(file.f_flag), 0, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + free(ofiles); + +do_mmapped: + + /* + * Process mmapped files if requested. + */ + if (mmapped) { + if (!kvm_read_all(kd, (unsigned long)kp->ki_vmspace, &vmspace, + sizeof(vmspace))) { + warnx("can't read vmspace at %p", + (void *)kp->ki_vmspace); + goto exit; + } + map = &vmspace.vm_map; + + for (entryp = map->header.next; + entryp != &kp->ki_vmspace->vm_map.header; + entryp = vmentry.next) { + if (!kvm_read_all(kd, (unsigned long)entryp, &vmentry, + sizeof(vmentry))) { + warnx("can't read vm_map_entry at %p", + (void *)entryp); + continue; + } + if (vmentry.eflags & MAP_ENTRY_IS_SUB_MAP) + continue; + if ((objp = vmentry.object.vm_object) == NULL) + continue; + for (; objp; objp = object.backing_object) { + if (!kvm_read_all(kd, (unsigned long)objp, + &object, sizeof(object))) { + warnx("can't read vm_object at %p", + (void *)objp); + break; + } + } + + /* We want only vnode objects. */ + if (object.type != OBJT_VNODE) + continue; + + prot = vmentry.protection; + fflags = 0; + if (prot & VM_PROT_READ) + fflags = PS_FST_FFLAG_READ; + if (prot & VM_PROT_WRITE) + fflags |= PS_FST_FFLAG_WRITE; + + /* + * Create filestat entry. + */ + entry = filestat_new_entry(object.handle, + PS_FST_TYPE_VNODE, -1, fflags, + PS_FST_UFLAG_MMAP, 0, 0, NULL); + if (entry != NULL) + STAILQ_INSERT_TAIL(head, entry, next); + } + } +exit: + return (head); +} + +/* + * kinfo types to filestat translation. + */ +static int +kinfo_type2fst(int kftype) +{ + static struct { + int kf_type; + int fst_type; + } kftypes2fst[] = { + { KF_TYPE_CRYPTO, PS_FST_TYPE_CRYPTO }, + { KF_TYPE_FIFO, PS_FST_TYPE_FIFO }, + { KF_TYPE_KQUEUE, PS_FST_TYPE_KQUEUE }, + { KF_TYPE_MQUEUE, PS_FST_TYPE_MQUEUE }, + { KF_TYPE_NONE, PS_FST_TYPE_NONE }, + { KF_TYPE_PIPE, PS_FST_TYPE_PIPE }, + { KF_TYPE_PTS, PS_FST_TYPE_PTS }, + { KF_TYPE_SEM, PS_FST_TYPE_SEM }, + { KF_TYPE_SHM, PS_FST_TYPE_SHM }, + { KF_TYPE_SOCKET, PS_FST_TYPE_SOCKET }, + { KF_TYPE_VNODE, PS_FST_TYPE_VNODE }, + { KF_TYPE_UNKNOWN, PS_FST_TYPE_UNKNOWN } + }; +#define NKFTYPES (sizeof(kftypes2fst) / sizeof(*kftypes2fst)) + unsigned int i; + + for (i = 0; i < NKFTYPES; i++) + if (kftypes2fst[i].kf_type == kftype) + break; + if (i == NKFTYPES) + return (PS_FST_TYPE_UNKNOWN); + return (kftypes2fst[i].fst_type); +} + +/* + * kinfo flags to filestat translation. + */ +static int +kinfo_fflags2fst(int kfflags) +{ + static struct { + int kf_flag; + int fst_flag; + } kfflags2fst[] = { + { KF_FLAG_APPEND, PS_FST_FFLAG_APPEND }, + { KF_FLAG_ASYNC, PS_FST_FFLAG_ASYNC }, + { KF_FLAG_CREAT, PS_FST_FFLAG_CREAT }, + { KF_FLAG_DIRECT, PS_FST_FFLAG_DIRECT }, + { KF_FLAG_EXCL, PS_FST_FFLAG_EXCL }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Thu May 12 10:44:03 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C44CC1065670; Thu, 12 May 2011 10:44:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 04A748FC13; Thu, 12 May 2011 10:44:01 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA23752; Thu, 12 May 2011 13:43:59 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DCBB9EE.8070809@FreeBSD.org> Date: Thu, 12 May 2011 13:43:58 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Stanislav Sedov References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> In-Reply-To: <20110512024956.996cd973.stas@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 10:44:03 -0000 on 12/05/2011 12:49 Stanislav Sedov said the following: > On Mon, 9 May 2011 17:34:00 +0000 (UTC) > Jung-uk Kim mentioned: > >> Author: jkim >> Date: Mon May 9 17:34:00 2011 >> New Revision: 221703 >> URL: http://svn.freebsd.org/changeset/base/221703 >> >> Log: >> Implement boot-time TSC synchronization test for SMP. This test is executed >> when the user has indicated that the system has synchronized TSCs or it has >> P-state invariant TSCs. For the former case, we may clear the tunable if it >> fails the test to prevent accidental foot-shooting. For the latter case, we >> may set it if it passes the test to notify the user that it may be usable. >> > > Hi, Jung-uk! > > My kernel no longer boots on my Dual Xeon Dell Precision after this > commit. It hangs immediately after the "AP launched" messages. > > I uploaded my verbose boot log from the old kernel to > http://www.SpringDaemons.com/stas/boot.verbose I believe that this was the first stress test for smp_rendezvous() that has uncovered a bug in it. I think that a fix similar to what I committed in my xcpu branch is needed. Theory: - smp_rv_waiters[2] becomes equal to smp_rv_ncpus - [at least] one slave CPU is still in the last call to cpu_spinwait() in smp_rendezvous_action() - master CPU notices that the condition is true, exits smp_rendezvous_cpus() and calls it again - the slave CPU is still in spinwait - the master CPU resets smp_rv_waiters[2] to zero - the slave CPU exits spinwait, see smp_rv_waiters[2] with zero value - endless loop -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu May 12 10:52:56 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98A521065670; Thu, 12 May 2011 10:52:56 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 479988FC1C; Thu, 12 May 2011 10:52:56 +0000 (UTC) Received: from orion.SpringDaemons.com (c-76-102-119-9.hsd1.ca.comcast.net [76.102.119.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 22C978FC2D; Thu, 12 May 2011 14:52:55 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 2C47439D5B; Thu, 12 May 2011 03:55:23 -0700 (PDT) Date: Thu, 12 May 2011 03:55:22 -0700 From: Stanislav Sedov To: Andriy Gapon Message-Id: <20110512035522.e42b379c.stas@FreeBSD.org> In-Reply-To: <4DCBB9EE.8070809@FreeBSD.org> References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> <4DCBB9EE.8070809@FreeBSD.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 10:52:56 -0000 On Thu, 12 May 2011 13:43:58 +0300 Andriy Gapon mentioned: > > Theory: > - smp_rv_waiters[2] becomes equal to smp_rv_ncpus > - [at least] one slave CPU is still in the last call to cpu_spinwait() in > smp_rendezvous_action() > - master CPU notices that the condition is true, exits smp_rendezvous_cpus() and > calls it again > - the slave CPU is still in spinwait > - the master CPU resets smp_rv_waiters[2] to zero > - the slave CPU exits spinwait, see smp_rv_waiters[2] with zero value > - endless loop > That might explain it. Do you have a patch for me to try? Thanks! -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-head@FreeBSD.ORG Thu May 12 10:56:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A2741065674; Thu, 12 May 2011 10:56:34 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE5E98FC16; Thu, 12 May 2011 10:56:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CAuXJZ034119; Thu, 12 May 2011 10:56:33 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CAuXpu034117; Thu, 12 May 2011 10:56:33 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105121056.p4CAuXpu034117@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 12 May 2011 10:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221808 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 10:56:34 -0000 Author: stas Date: Thu May 12 10:56:33 2011 New Revision: 221808 URL: http://svn.freebsd.org/changeset/base/221808 Log: - Do no try to drop a NULL filedesc pointer. Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu May 12 10:11:39 2011 (r221807) +++ head/sys/kern/kern_descrip.c Thu May 12 10:56:33 2011 (r221808) @@ -3224,7 +3224,8 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER } FILEDESC_SUNLOCK(fdp); fail: - fddrop(fdp); + if (fdp != NULL) + fddrop(fdp); free(kif, M_TEMP); return (error); } From owner-svn-src-head@FreeBSD.ORG Thu May 12 11:05:29 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E746E1065670; Thu, 12 May 2011 11:05:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BEF358FC16; Thu, 12 May 2011 11:05:27 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA24238; Thu, 12 May 2011 14:05:25 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DCBBEF5.4090004@FreeBSD.org> Date: Thu, 12 May 2011 14:05:25 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: John Baldwin References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> <4DCBB9EE.8070809@FreeBSD.org> <20110512035522.e42b379c.stas@FreeBSD.org> <4DCBBCBE.5020004@FreeBSD.org> In-Reply-To: <4DCBBCBE.5020004@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, neel@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-head@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 11:05:30 -0000 on 12/05/2011 13:55 John Baldwin said the following: > On 5/12/11 6:55 AM, Stanislav Sedov wrote: >> On Thu, 12 May 2011 13:43:58 +0300 >> Andriy Gapon mentioned: >> >>> >>> Theory: >>> - smp_rv_waiters[2] becomes equal to smp_rv_ncpus >>> - [at least] one slave CPU is still in the last call to cpu_spinwait() in >>> smp_rendezvous_action() >>> - master CPU notices that the condition is true, exits smp_rendezvous_cpus() and >>> calls it again >>> - the slave CPU is still in spinwait >>> - the master CPU resets smp_rv_waiters[2] to zero >>> - the slave CPU exits spinwait, see smp_rv_waiters[2] with zero value >>> - endless loop >>> >> >> That might explain it. >> Do you have a patch for me to try? >> >> Thanks! >> > > The NetApp folks working on BHyVe also ran into this. They have a fix that I > think sounds reasonable which is to add a generation count to the smp rendezvous > "structure" and have waiting CPUs stop waiting if the generation count changes. > This is an adaption of my patch in xcpu branch to head (not tested): Index: sys/kern/subr_smp.c =================================================================== --- sys/kern/subr_smp.c (revision 221521) +++ sys/kern/subr_smp.c (working copy) @@ -110,7 +110,7 @@ static void (*volatile smp_rv_action_func)(void *arg); static void (*volatile smp_rv_teardown_func)(void *arg); static void *volatile smp_rv_func_arg; -static volatile int smp_rv_waiters[3]; +static volatile int smp_rv_waiters[4]; /* * Shared mutex to restrict busywaits between smp_rendezvous() and @@ -338,11 +338,15 @@ /* spin on exit rendezvous */ atomic_add_int(&smp_rv_waiters[2], 1); - if (local_teardown_func == smp_no_rendevous_barrier) + if (local_teardown_func == smp_no_rendevous_barrier) { + atomic_add_int(&smp_rv_waiters[3], 1); return; + } while (smp_rv_waiters[2] < smp_rv_ncpus) cpu_spinwait(); + atomic_add_int(&smp_rv_waiters[3], 1); + /* teardown function */ if (local_teardown_func != NULL) local_teardown_func(local_func_arg); @@ -385,6 +389,7 @@ smp_rv_func_arg = arg; smp_rv_waiters[1] = 0; smp_rv_waiters[2] = 0; + smp_rv_waiters[3] = 0; atomic_store_rel_int(&smp_rv_waiters[0], 0); /* signal other processors, which will enter the IPI with interrupts off */ @@ -395,7 +400,7 @@ smp_rendezvous_action(); if (teardown_func == smp_no_rendevous_barrier) - while (atomic_load_acq_int(&smp_rv_waiters[2]) < ncpus) + while (atomic_load_acq_int(&smp_rv_waiters[3]) < ncpus) cpu_spinwait(); /* release lock */ -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu May 12 11:23:07 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF88B106568E; Thu, 12 May 2011 11:23:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 6B5F78FC20; Thu, 12 May 2011 11:23:05 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA24689; Thu, 12 May 2011 14:23:03 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DCBC316.5030209@FreeBSD.org> Date: Thu, 12 May 2011 14:23:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jung-uk Kim References: <201105091734.p49HY0P3006180@svn.freebsd.org> In-Reply-To: <201105091734.p49HY0P3006180@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 11:23:07 -0000 on 09/05/2011 20:34 Jung-uk Kim said the following: > Author: jkim > Date: Mon May 9 17:34:00 2011 > New Revision: 221703 > URL: http://svn.freebsd.org/changeset/base/221703 [snip] I would to note [again] that I don't like code style of this change. > Modified: head/sys/x86/x86/tsc.c > ============================================================================== > --- head/sys/x86/x86/tsc.c Mon May 9 17:30:25 2011 (r221702) > +++ head/sys/x86/x86/tsc.c Mon May 9 17:34:00 2011 (r221703) > @@ -326,7 +326,73 @@ init_TSC(void) > tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY); > } > > -void > +#ifdef SMP > + > +#define TSC_READ(x) \ > +static void \ > +tsc_read_##x(void *arg) \ > +{ \ > + uint32_t *tsc = arg; \ > + u_int cpu = PCPU_GET(cpuid); \ > + \ > + tsc[cpu * 3 + x] = rdtsc32(); \ > +} > +TSC_READ(0) > +TSC_READ(1) > +TSC_READ(2) > +#undef TSC_READ > + > +#define N 1000 I don't like macro overuse in the above. Especially "N". > +static void > +comp_smp_tsc(void *arg) > +{ > + uint32_t *tsc; > + int32_t d1, d2; > + u_int cpu = PCPU_GET(cpuid); > + u_int i, j, size; > + > + size = (mp_maxid + 1) * 3; > + for (i = 0, tsc = arg; i < N; i++, tsc += size) > + CPU_FOREACH(j) { > + if (j == cpu) > + continue; > + d1 = tsc[cpu * 3 + 1] - tsc[j * 3]; > + d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1]; > + if (d1 <= 0 || d2 <= 0) { > + smp_tsc = 0; > + return; > + } > + } > +} > + > +static int > +test_smp_tsc(void) > +{ > + uint32_t *data, *tsc; > + u_int i, size; > + > + if (!smp_tsc && !tsc_is_invariant) > + return (-100); > + size = (mp_maxid + 1) * 3; > + data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); > + for (i = 0, tsc = data; i < N; i++, tsc += size) > + smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); I don't like that what is logically a two dimensional array 3 x (mp_maxid + 1) is represented as a one-dimensional array with all ensuing multiplications by three and other array index manipulations. > + smp_tsc = 1; /* XXX */ > + smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, > + smp_no_rendevous_barrier, data); > + free(data, M_TEMP); > + if (bootverbose) > + printf("SMP: %sed TSC synchronization test\n", > + smp_tsc ? "pass" : "fail"); > + return (smp_tsc ? 800 : -100); I still think something higher should be returned here for the smp_tsc == true case. It doesn't make sense to go through the shenanigans to underrate TSC in the end. On a more general note, smp_rendezvous() might not be the best mechanism here. In my opinion/understanding, smp_rendezvous() provides only the following guarantees: - if a setup action is specified, then every CPU executes the setup action before any CPU executes the main action - if a teardown action is specified, then every CPU executes the main action before any CPU executes the teardown action There are no timing guarantees, only the sequence guarantees. Any timing observations that we may have now are a product of the implementation and can change if the implementation change. So the newly introduced check may miss systemic differences in TSC values between CPUs if they are small enough. But I am not really sure if such a small differences would really matter. Worse case if there is some difference in TSC frequency between CPUs (e.g. in different sockets), after a powerup or a reset difference between TSC values may be very small, but could grow more and more with uptime. Not sure if this is a realistic enough scenario, though. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu May 12 11:26:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A54106566C; Thu, 12 May 2011 11:26:45 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 785518FC14; Thu, 12 May 2011 11:26:44 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4CBQe4m096648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 May 2011 14:26:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4CBQeMk045072; Thu, 12 May 2011 14:26:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4CBQeUx045071; Thu, 12 May 2011 14:26:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 May 2011 14:26:40 +0300 From: Kostik Belousov To: Stanislav Sedov Message-ID: <20110512112640.GQ48734@deviant.kiev.zoral.com.ua> References: <201105121011.p4CABdkM030432@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6yI7Fv2tfqWgENHd" Content-Disposition: inline In-Reply-To: <201105121011.p4CABdkM030432@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221807 - in head: lib lib/libprocstat lib/libprocstat/zfs lib/libutil sys/kern sys/sys usr.bin/fstat usr.bin/fstat/zfs usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 11:26:45 -0000 --6yI7Fv2tfqWgENHd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 12, 2011 at 10:11:39AM +0000, Stanislav Sedov wrote: > Author: stas > Date: Thu May 12 10:11:39 2011 > New Revision: 221807 > URL: http://svn.freebsd.org/changeset/base/221807 >=20 > Log: > - Commit work from libprocstat project. These patches add support > for runtime file and processes information retrieval from the > running kernel via sysctl in the form of new library, libprocstat. > The library also supports KVM backend for analyzing memory crash > dumps. Both procstat(1) and fstat(1) utilities have been modified > to take advantage of the library (as the bonus point the fstat(1) > utility no longer need superuser privileges to operate), and the > procstat(1) utility is now able to display information from memory > dumps as well. > > The newly introduced fuser(1) utility also uses this library and > able to operate via sysctl and kvm backends. > > The library is by no means complete (e.g. KVM backend is missing > vnode name resolution routines, and there're no manpages for the > library itself) so I plan to improve it further. I'm commiting it > so it will get wider exposure and review. > > We won't be able to MFC this work as it relies on changes in HEAD, > which was introduced some time ago, that break kernel ABI. OTOH > we may be able to merge the library with KVM backend if we really > need it there. Could you, please, point out the mentioned ABI changes ? --6yI7Fv2tfqWgENHd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3Lw/AACgkQC3+MBN1Mb4hpWgCfQtdL9E4s4w9H2hU9A3dsmMGR IwMAnRUWWLOglUX0mRaHRRam4h5omdey =AXhL -----END PGP SIGNATURE----- --6yI7Fv2tfqWgENHd-- From owner-svn-src-head@FreeBSD.ORG Thu May 12 10:56:00 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08509106566B; Thu, 12 May 2011 10:56:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CF4368FC08; Thu, 12 May 2011 10:55:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6CFBF46B03; Thu, 12 May 2011 06:55:59 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (unknown [24.114.252.233]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CB3228A027; Thu, 12 May 2011 06:55:58 -0400 (EDT) Message-ID: <4DCBBCBE.5020004@FreeBSD.org> Date: Thu, 12 May 2011 06:55:58 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Stanislav Sedov , neel@FreeBSD.org References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> <4DCBB9EE.8070809@FreeBSD.org> <20110512035522.e42b379c.stas@FreeBSD.org> In-Reply-To: <20110512035522.e42b379c.stas@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 12 May 2011 06:55:59 -0400 (EDT) X-Mailman-Approved-At: Thu, 12 May 2011 11:43:59 +0000 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Jung-uk Kim , Andriy Gapon Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 10:56:00 -0000 On 5/12/11 6:55 AM, Stanislav Sedov wrote: > On Thu, 12 May 2011 13:43:58 +0300 > Andriy Gapon mentioned: > >> >> Theory: >> - smp_rv_waiters[2] becomes equal to smp_rv_ncpus >> - [at least] one slave CPU is still in the last call to cpu_spinwait() in >> smp_rendezvous_action() >> - master CPU notices that the condition is true, exits smp_rendezvous_cpus() and >> calls it again >> - the slave CPU is still in spinwait >> - the master CPU resets smp_rv_waiters[2] to zero >> - the slave CPU exits spinwait, see smp_rv_waiters[2] with zero value >> - endless loop >> > > That might explain it. > Do you have a patch for me to try? > > Thanks! > The NetApp folks working on BHyVe also ran into this. They have a fix that I think sounds reasonable which is to add a generation count to the smp rendezvous "structure" and have waiting CPUs stop waiting if the generation count changes. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu May 12 11:59:19 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E53CF1065677; Thu, 12 May 2011 11:59:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id ED9588FC0C; Thu, 12 May 2011 11:59:17 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA25529; Thu, 12 May 2011 14:59:16 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DCBCB93.200@FreeBSD.org> Date: Thu, 12 May 2011 14:59:15 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: John Baldwin References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> <4DCBB9EE.8070809@FreeBSD.org> <20110512035522.e42b379c.stas@FreeBSD.org> <4DCBBCBE.5020004@FreeBSD.org> <4DCBBEF5.4090004@FreeBSD.org> <4DCBC73D.9070006@FreeBSD.org> In-Reply-To: <4DCBC73D.9070006@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, neel@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-head@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 11:59:20 -0000 on 12/05/2011 14:40 John Baldwin said the following: > > Hmmm, this might be interesting. I think you want to always wait for this though > even if you have a teardown function. > I think so too. In fact I have that change in my private tree, but was still waiting (a few months) for someone to enlighten why the code is the way it is. It seems that the problematic case is when both of the following are true: curcpu is not in the target cpu set and teardown function is not a "no rendevous" one [spelling mistake preserved :-)]. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu May 12 11:40:47 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F28F1065672; Thu, 12 May 2011 11:40:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 311FD8FC1C; Thu, 12 May 2011 11:40:47 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D8F5246B03; Thu, 12 May 2011 07:40:46 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (unknown [24.114.252.233]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3CB598A01B; Thu, 12 May 2011 07:40:46 -0400 (EDT) Message-ID: <4DCBC73D.9070006@FreeBSD.org> Date: Thu, 12 May 2011 07:40:45 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Andriy Gapon References: <201105091734.p49HY0P3006180@svn.freebsd.org> <20110512024956.996cd973.stas@FreeBSD.org> <4DCBB9EE.8070809@FreeBSD.org> <20110512035522.e42b379c.stas@FreeBSD.org> <4DCBBCBE.5020004@FreeBSD.org> <4DCBBEF5.4090004@FreeBSD.org> In-Reply-To: <4DCBBEF5.4090004@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 12 May 2011 07:40:46 -0400 (EDT) X-Mailman-Approved-At: Thu, 12 May 2011 12:02:01 +0000 Cc: src-committers@FreeBSD.org, neel@FreeBSD.org, svn-src-all@FreeBSD.org, Stanislav Sedov , svn-src-head@FreeBSD.org, Jung-uk Kim Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 11:40:47 -0000 On 5/12/11 7:05 AM, Andriy Gapon wrote: > on 12/05/2011 13:55 John Baldwin said the following: >> On 5/12/11 6:55 AM, Stanislav Sedov wrote: >>> On Thu, 12 May 2011 13:43:58 +0300 >>> Andriy Gapon mentioned: >>> >>>> >>>> Theory: >>>> - smp_rv_waiters[2] becomes equal to smp_rv_ncpus >>>> - [at least] one slave CPU is still in the last call to cpu_spinwait() in >>>> smp_rendezvous_action() >>>> - master CPU notices that the condition is true, exits smp_rendezvous_cpus() and >>>> calls it again >>>> - the slave CPU is still in spinwait >>>> - the master CPU resets smp_rv_waiters[2] to zero >>>> - the slave CPU exits spinwait, see smp_rv_waiters[2] with zero value >>>> - endless loop >>>> >>> >>> That might explain it. >>> Do you have a patch for me to try? >>> >>> Thanks! >>> >> >> The NetApp folks working on BHyVe also ran into this. They have a fix that I >> think sounds reasonable which is to add a generation count to the smp rendezvous >> "structure" and have waiting CPUs stop waiting if the generation count changes. >> > > This is an adaption of my patch in xcpu branch to head (not tested): Hmmm, this might be interesting. I think you want to always wait for this though even if you have a teardown function. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu May 12 12:18:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5576106566C; Thu, 12 May 2011 12:18:01 +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 A55888FC18; Thu, 12 May 2011 12:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CCI1Kt036533; Thu, 12 May 2011 12:18:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CCI11Y036531; Thu, 12 May 2011 12:18:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201105121218.p4CCI11Y036531@svn.freebsd.org> From: Andriy Gapon Date: Thu, 12 May 2011 12:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221809 - head/sys/dev/sound/pcm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 12:18:01 -0000 Author: avg Date: Thu May 12 12:18:01 2011 New Revision: 221809 URL: http://svn.freebsd.org/changeset/base/221809 Log: fix build on 32-bit platforms for r221803 Casting a pointer to a wide integer is probably not that bad, but I am still guilty of not testing this. Pointyhat to: avg MFC after: 1 week X-MFC with: r221803 Modified: head/sys/dev/sound/pcm/dsp.c Modified: head/sys/dev/sound/pcm/dsp.c ============================================================================== --- head/sys/dev/sound/pcm/dsp.c Thu May 12 10:56:33 2011 (r221808) +++ head/sys/dev/sound/pcm/dsp.c Thu May 12 12:18:01 2011 (r221809) @@ -2255,7 +2255,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_o if (rdch != NULL) rdch->flags |= CHN_F_MMAP; - *offset = (vm_ooffset_t)sndbuf_getbufofs(c->bufsoft, *offset); + *offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset); relchns(i_dev, rdch, wrch, SD_F_PRIO_RD | SD_F_PRIO_WR); *object = vm_pager_allocate(OBJT_DEVICE, i_dev, size, nprot, *offset, curthread->td_ucred); From owner-svn-src-head@FreeBSD.ORG Thu May 12 14:03:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DD271065674; Thu, 12 May 2011 14:03:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D82F8FC15; Thu, 12 May 2011 14:03:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CE3UKD039858; Thu, 12 May 2011 14:03:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CE3TED039856; Thu, 12 May 2011 14:03:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105121403.p4CE3TED039856@svn.freebsd.org> From: Adrian Chadd Date: Thu, 12 May 2011 14:03:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221811 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 14:03:30 -0000 Author: adrian Date: Thu May 12 14:03:29 2011 New Revision: 221811 URL: http://svn.freebsd.org/changeset/base/221811 Log: Now that the devices with functioning ps-poll hardware support have been enumerated (merlin and later), flick this on. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu May 12 14:01:40 2011 (r221810) +++ head/sys/dev/ath/if_ath.c Thu May 12 14:03:29 2011 (r221811) @@ -1946,17 +1946,15 @@ ath_calcrxfilter(struct ath_softc *sc) IEEE80211_IS_CHAN_ANYG(ic->ic_curchan)) rfilt |= HAL_RX_FILTER_BEACON; -#if 0 /* * Enable hardware PS-POLL RX only for hostap mode; * STA mode sends PS-POLL frames but never * receives them. */ - if (ath_hal_getcapability(ah, HAL_CAP_HAS_PSPOLL, + if (ath_hal_getcapability(sc->sc_ah, HAL_CAP_PSPOLL, 0, NULL) == HAL_OK && ic->ic_opmode == IEEE80211_M_HOSTAP) rfilt |= HAL_RX_FILTER_PSPOLL; -#endif if (sc->sc_nmeshvaps) { rfilt |= HAL_RX_FILTER_BEACON; From owner-svn-src-head@FreeBSD.ORG Thu May 12 14:16:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E257C1065674; Thu, 12 May 2011 14:16:07 +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 D24028FC0C; Thu, 12 May 2011 14:16:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CEG7xL040262; Thu, 12 May 2011 14:16:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CEG73V040260; Thu, 12 May 2011 14:16:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105121416.p4CEG73V040260@svn.freebsd.org> From: Marius Strobl Date: Thu, 12 May 2011 14:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221812 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 14:16:08 -0000 Author: marius Date: Thu May 12 14:16:07 2011 New Revision: 221812 URL: http://svn.freebsd.org/changeset/base/221812 Log: Some PHYs like the Level One LXT970 optionally can default to isolation after rest, in which case we may need to deisolate it. Tested by: nwhitehorn MFC after 1 week Modified: head/sys/dev/mii/mii_physubr.c Modified: head/sys/dev/mii/mii_physubr.c ============================================================================== --- head/sys/dev/mii/mii_physubr.c Thu May 12 14:03:29 2011 (r221811) +++ head/sys/dev/mii/mii_physubr.c Thu May 12 14:16:07 2011 (r221812) @@ -257,7 +257,7 @@ void mii_phy_reset(struct mii_softc *sc) { struct ifmedia_entry *ife = sc->mii_pdata->mii_media.ifm_cur; - int reg, i; + int i, reg; if ((sc->mii_flags & MIIF_NOISOLATE) != 0) reg = BMCR_RESET; @@ -273,11 +273,14 @@ mii_phy_reset(struct mii_softc *sc) DELAY(1000); } - if ((sc->mii_flags & MIIF_NOISOLATE) == 0) { - if ((ife == NULL && sc->mii_inst != 0) || - (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst)) - PHY_WRITE(sc, MII_BMCR, reg | BMCR_ISO); - } + /* NB: a PHY may default to isolation. */ + reg &= ~BMCR_ISO; + if ((sc->mii_flags & MIIF_NOISOLATE) == 0 && + ((ife == NULL && sc->mii_inst != 0) || + (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst))) + reg |= BMCR_ISO; + if (PHY_READ(sc, MII_BMCR) != reg) + PHY_WRITE(sc, MII_BMCR, reg); } void From owner-svn-src-head@FreeBSD.ORG Thu May 12 14:27:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6147A106564A; Thu, 12 May 2011 14:27:29 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50A118FC17; Thu, 12 May 2011 14:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CERTiC040619; Thu, 12 May 2011 14:27:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CERTwI040617; Thu, 12 May 2011 14:27:29 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105121427.p4CERTwI040617@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 12 May 2011 14:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221813 - head/sys/dev/bm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 14:27:29 -0000 Author: nwhitehorn Date: Thu May 12 14:27:28 2011 New Revision: 221813 URL: http://svn.freebsd.org/changeset/base/221813 Log: Remove some hacks to handle strange behavior of LXT 970 PHYs now better handled in miibus after r221812. Thanks to marius@ for piecing this together! Modified: head/sys/dev/bm/if_bm.c Modified: head/sys/dev/bm/if_bm.c ============================================================================== --- head/sys/dev/bm/if_bm.c Thu May 12 14:16:07 2011 (r221812) +++ head/sys/dev/bm/if_bm.c Thu May 12 14:27:28 2011 (r221813) @@ -1130,21 +1130,11 @@ bm_chip_setup(struct bm_softc *sc) { uint16_t reg; uint16_t *eaddr_sect; - struct mii_data *mii; - struct mii_softc *miisc; eaddr_sect = (uint16_t *)(sc->sc_enaddr); dbdma_stop(sc->sc_txdma); dbdma_stop(sc->sc_rxdma); - /* Reset MII */ - mii = device_get_softc(sc->sc_miibus); - LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { - PHY_RESET(miisc); - PHY_WRITE(miisc, MII_BMCR, PHY_READ(miisc, MII_BMCR) & - ~BMCR_ISO); - } - /* Reset chip */ CSR_WRITE_2(sc, BM_RX_RESET, 0x0000); CSR_WRITE_2(sc, BM_TX_RESET, 0x0001); From owner-svn-src-head@FreeBSD.ORG Thu May 12 15:03:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08B76106564A; Thu, 12 May 2011 15:03:18 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC34B8FC19; Thu, 12 May 2011 15:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CF3HH2041987; Thu, 12 May 2011 15:03:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CF3HuI041985; Thu, 12 May 2011 15:03:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105121503.p4CF3HuI041985@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 12 May 2011 15:03:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221814 - head/release/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 15:03:18 -0000 Author: nwhitehorn Date: Thu May 12 15:03:17 2011 New Revision: 221814 URL: http://svn.freebsd.org/changeset/base/221814 Log: Add (somewhat speculative) bootable CD support for PAPR/pSeries-type systems. In principle, FreeBSD should run on at least some of these already, and support for the remainder will hopefully show up eventually, so add this while I'm thinking about it. Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Thu May 12 14:27:28 2011 (r221813) +++ head/release/powerpc/mkisoimages.sh Thu May 12 15:03:17 2011 (r221814) @@ -24,6 +24,7 @@ # into base-bits-dir as part of making the image. if [ "x$1" = "x-b" ]; then + # Apple boot code uudecode -o /tmp/hfs-boot-block.bz2 `dirname $0`/hfs-boot.bz2.uu bzip2 -d /tmp/hfs-boot-block.bz2 OFFSET=$(hd /tmp/hfs-boot-block | grep 'Loader START' | cut -f 1 -d ' ') @@ -31,6 +32,19 @@ if [ "x$1" = "x-b" ]; then dd if=$4/boot/loader of=/tmp/hfs-boot-block seek=$OFFSET conv=notrunc bootable="-o bootimage=macppc;/tmp/hfs-boot-block -o no-emul-boot" + + # pSeries/PAPR boot code + mkdir $4/ppc + cat > $4/ppc/bootinfo.txt << EOF + +FreeBSD/powerpc +FreeBSD + +boot &device;:&partition;,\boot\loader &device;:0 + + +EOF + shift else bootable="" @@ -48,3 +62,5 @@ echo "/dev/iso9660/`echo $LABEL | tr '[: makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* rm $1/etc/fstab rm /tmp/hfs-boot-block +rm -rf $1/ppc + From owner-svn-src-head@FreeBSD.ORG Thu May 12 15:12:10 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32987106566B; Thu, 12 May 2011 15:12:10 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id B59378FC0C; Thu, 12 May 2011 15:12:09 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p4CFC8Ix066807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 May 2011 17:12:08 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1305213128; bh=j/Q1SX3vA3lfIF+sNdQoiNUXquEKNCunBgfC1j61iTg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=COqFtPbgjwnVqgS3iVNuQZrJpeAbG54ol0RqrlcIHMj0l6MiXtYTWqPoP3DV87l+D ctI62XpWDhXMgve5gieBHxpRhIINoXU8nhl09wbd4louwgwLeSxSqHolfrYeTgeN7w kHaeiQj8gTMK2OTbG4zN7Y6jmGAkPWBp2euVxlYM= Date: Thu, 12 May 2011 17:12:08 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Roman Divacky Message-ID: <20110512151207.GJ11355@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Roman Divacky , Brooks Davis , Dimitry Andric , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, pawel.worach@gmail.com References: <201105022113.p42LD8TH055002@svn.freebsd.org> <20110503133927.GA41839@freebsd.org> <20110503092757.GA24552@lor.one-eyed-alien.net> <20110503165119.GA64219@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110503165119.GA64219@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Brooks Davis , svn-src-all@FreeBSD.org, Dimitry Andric , src-committers@FreeBSD.org, svn-src-head@FreeBSD.org, pawel.worach@gmail.com Subject: Re: svn commit: r221348 - head/sys/boot/i386/boot2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 15:12:10 -0000 On Tue, 03.05.2011 at 18:51:19 +0200, Roman Divacky wrote: > On Tue, May 03, 2011 at 04:27:57AM -0500, Brooks Davis wrote: > > On Tue, May 03, 2011 at 03:39:27PM +0200, Roman Divacky wrote: > > > With the recent libobjc removal this means that we can compile > > > all (no exceptions) of FreeBSD/{i386,amd64} with clang. > > > > > > Quite a milestone in my opinion :) > > > > > > Great news! Thanks for all the work to make this happen! > > > > Has boot2 been submitted to LLVM as a clang regression test? > > No, but we are setting up a testing environment to track the code > size changes in boot2. > > Pawel, can you comment on this? Bonus points for doing this retro-actively. That is, use the current clang we have in the tree and track the size changes to boot2 over the years. Just for the lulz ... Uli From owner-svn-src-head@FreeBSD.ORG Thu May 12 15:15:10 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52E9F1065688; Thu, 12 May 2011 15:15:10 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id DC2AC8FC15; Thu, 12 May 2011 15:15:09 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p4CFF88v066860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 May 2011 17:15:08 +0200 (CEST) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1305213309; bh=P32AWU7EDr4U228Xot3KChC7Rkzf0pnk8uxOSofQJA0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:In-Reply-To; b=dPLFLzei65YJUbkC5HT2TPC0Ay+wVTpLOFcRxcVsQxhl9lubHqkrDdu/Hy8sIRML/ F4hIuQaC2dQZVeeJvhGDMZveKL9CtbTs0jI/E9kV34WSTDZY1gGYzVv+af6EeAMBKi zuIjENbzffn3ipBUL25XWhAHy5IrJPdkqbpd1Ebw= Date: Thu, 12 May 2011 17:15:08 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: "Andrey V. Elsukov" Message-ID: <20110512151508.GK11355@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , "Andrey V. Elsukov" , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201105030733.p437XduH075011@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105030733.p437XduH075011@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221363 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 15:15:10 -0000 On Tue, 03.05.2011 at 07:33:39 +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Tue May 3 07:33:39 2011 > New Revision: 221363 > URL: http://svn.freebsd.org/changeset/base/221363 > > Log: > Add "-a alignment" option to gpart(8). When it specified gpart(8) > tries to align partition start offset and size to be multiple of > alignment value. > Aligned to what? The disk or the partition scheme? Consider someone having a GELI partition of arbitrary alignment, how would a bsdlabel or GPT label inside this GELI partition be aligned when 4K alignment is requested? Cheers, Uli From owner-svn-src-head@FreeBSD.ORG Thu May 12 15:53:41 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 679671065670; Thu, 12 May 2011 15:53:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 2E5A8151133; Thu, 12 May 2011 15:53:39 +0000 (UTC) Message-ID: <4DCC0273.6010904@FreeBSD.org> Date: Thu, 12 May 2011 19:53:23 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: =?UTF-8?B?VWxyaWNoIFNww7ZybGVpbg==?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201105030733.p437XduH075011@svn.freebsd.org> <20110512151508.GK11355@acme.spoerlein.net> In-Reply-To: <20110512151508.GK11355@acme.spoerlein.net> X-Enigmail-Version: 1.1.2 OpenPGP: id=10C8A17A Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC52AD52512BCA0A5B6D660BB" Cc: Subject: Re: svn commit: r221363 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 15:53:41 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC52AD52512BCA0A5B6D660BB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12.05.2011 19:15, Ulrich Sp=C3=B6rlein wrote: >> Add "-a alignment" option to gpart(8). When it specified gpart(8) >> tries to align partition start offset and size to be multiple of >> alignment value. >> =20 >=20 > Aligned to what? The disk or the partition scheme? Consider someone > having a GELI partition of arbitrary alignment, how would a bsdlabel or= > GPT label inside this GELI partition be aligned when 4K alignment is > requested? Each partition has three mandatory parameters: start offset, end offset and partition type. These offsets are within top level provider. With 4K alignment gpart(8) would try to adjust partition start and end offset to be multiple of 4K. --=20 WBR, Andrey V. Elsukov --------------enigC52AD52512BCA0A5B6D660BB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBAgAGBQJNzAJ6AAoJEAHF6gQQyKF61REIAKoLQFhzI3Q0FdpKRcVr+y2w NO4iUdqiew62nEm+C7sFLSI1OHGNebGtjgigfZas8w4QER/CehpH1v0Xov43FLMf WpQAsscQEeZ8chrV/YEWM7zZVbk8N7GvwgMikWNd8a6VO28u2UBW4fSq7owCDlCD jV3aSaWvuUcvwcp482rZ/SJpvLO5QEjuUpHH1wzGg3/ZRjoZLuuFQuciqHYknto0 aKxPLhuOfUkJkm/cOnD9B0DfvrOFOtVVRot2bL+2cNS1x1jYOVn4toAr8iYPdFuo Z3htknQCidrX/keOwgEkXyncjxgbbOZYklIBJLGB5IbvXKkUW4oA6JZKbvmFCmA= =v0De -----END PGP SIGNATURE----- --------------enigC52AD52512BCA0A5B6D660BB-- From owner-svn-src-head@FreeBSD.ORG Thu May 12 16:39:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 15E45106564A; Thu, 12 May 2011 16:39:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Thu, 12 May 2011 12:39:28 -0400 User-Agent: KMail/1.6.2 References: <201105091734.p49HY0P3006180@svn.freebsd.org> <4DCBC316.5030209@FreeBSD.org> In-Reply-To: <4DCBC316.5030209@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105121239.31340.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 16:39:41 -0000 On Thursday 12 May 2011 07:23 am, Andriy Gapon wrote: > on 09/05/2011 20:34 Jung-uk Kim said the following: > > Author: jkim > > Date: Mon May 9 17:34:00 2011 > > New Revision: 221703 > > URL: http://svn.freebsd.org/changeset/base/221703 > > [snip] > > I would to note [again] that I don't like code style of this > change. > > > Modified: head/sys/x86/x86/tsc.c > > ================================================================= > >============= --- head/sys/x86/x86/tsc.c Mon May 9 17:30:25 > > 2011 (r221702) +++ head/sys/x86/x86/tsc.c Mon May 9 17:34:00 > > 2011 (r221703) @@ -326,7 +326,73 @@ init_TSC(void) > > tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY); > > } > > > > -void > > +#ifdef SMP > > + > > +#define TSC_READ(x) \ > > +static void \ > > +tsc_read_##x(void *arg) \ > > +{ \ > > + uint32_t *tsc = arg; \ > > + u_int cpu = PCPU_GET(cpuid); \ > > + \ > > + tsc[cpu * 3 + x] = rdtsc32(); \ > > +} > > +TSC_READ(0) > > +TSC_READ(1) > > +TSC_READ(2) > > +#undef TSC_READ > > + > > +#define N 1000 > > I don't like macro overuse in the above. > Especially "N". I think duplicating trivial and almost identical functions is more harmful to many eyes. 'N' here is temporary and arbitrary. I think 1,000 is actually overkill but I wanted to "stress-test" smp_rendezvous(). :-P Now that you found a bug in the function, I can remove N but I want to keep it for a while. Actually, it was already proven useful, i.e., I gave a user the following patch: -#define N 1000 +#define N 100 and it worked around his problem for now (until you commit the smp_rendezvous() fix). > > +static void > > +comp_smp_tsc(void *arg) > > +{ > > + uint32_t *tsc; > > + int32_t d1, d2; > > + u_int cpu = PCPU_GET(cpuid); > > + u_int i, j, size; > > + > > + size = (mp_maxid + 1) * 3; > > + for (i = 0, tsc = arg; i < N; i++, tsc += size) > > + CPU_FOREACH(j) { > > + if (j == cpu) > > + continue; > > + d1 = tsc[cpu * 3 + 1] - tsc[j * 3]; > > + d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1]; > > + if (d1 <= 0 || d2 <= 0) { > > + smp_tsc = 0; > > + return; > > + } > > + } > > +} > > + > > +static int > > +test_smp_tsc(void) > > +{ > > + uint32_t *data, *tsc; > > + u_int i, size; > > + > > + if (!smp_tsc && !tsc_is_invariant) > > + return (-100); > > + size = (mp_maxid + 1) * 3; > > + data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); > > + for (i = 0, tsc = data; i < N; i++, tsc += size) > > + smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); > > I don't like that what is logically a two dimensional array 3 x > (mp_maxid + 1) is represented as a one-dimensional array with all > ensuing multiplications by three and other array index > manipulations. (As I said earlier) I agree with you in general but using two-dimensional array or array of pointers just added more complexity to the code and it didn't make the code any clearer than I originally thought. Again, it is just a matter of taste, anyway. ;-) > > + smp_tsc = 1; /* XXX */ > > + smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, > > + smp_no_rendevous_barrier, data); > > + free(data, M_TEMP); > > + if (bootverbose) > > + printf("SMP: %sed TSC synchronization test\n", > > + smp_tsc ? "pass" : "fail"); > > + return (smp_tsc ? 800 : -100); > > I still think something higher should be returned here for the > smp_tsc == true case. It doesn't make sense to go through the > shenanigans to underrate TSC in the end. http://docs.freebsd.org/cgi/mid.cgi?201105091352.49971.jkim I thought you wanted a separate commit, didn't you? > On a more general note, smp_rendezvous() might not be the best > mechanism here. In my opinion/understanding, smp_rendezvous() > provides only the following guarantees: > - if a setup action is specified, then every CPU executes the setup > action before any CPU executes the main action > - if a teardown action is specified, then every CPU executes the > main action before any CPU executes the teardown action > > There are no timing guarantees, only the sequence guarantees. That's all I wanted to test, i.e., we only validate whether all TSCs are in order (and that's all we can do, in fact). > Any timing observations that we may have now are a product of the > implementation and can change if the implementation change. So the > newly introduced check may miss systemic differences in TSC values > between CPUs if they are small enough. But I am not really sure if > such a small differences would really matter. > > Worse case if there is some difference in TSC frequency between > CPUs (e.g. in different sockets), after a powerup or a reset > difference between TSC values may be very small, but could grow > more and more with uptime. Not sure if this is a realistic enough > scenario, though. Actually, I am kinda reluctant to enable smp_tsc by default on recent CPUs. Although they made all TSCs in sync, it is very very tricky to make it work in reality, e.g., https://patchwork.kernel.org/patch/691712/ Sigh... Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Thu May 12 17:02:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 885E21065672; Thu, 12 May 2011 17:02:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78DF38FC13; Thu, 12 May 2011 17:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CH2uZu045629; Thu, 12 May 2011 17:02:56 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CH2u1w045627; Thu, 12 May 2011 17:02:56 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105121702.p4CH2u1w045627@svn.freebsd.org> From: Warner Losh Date: Thu, 12 May 2011 17:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221816 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 17:02:56 -0000 Author: imp Date: Thu May 12 17:02:56 2011 New Revision: 221816 URL: http://svn.freebsd.org/changeset/base/221816 Log: Fix printf int mismatch on 32-bit architectures... Modified: head/usr.bin/fstat/fstat.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Thu May 12 15:21:59 2011 (r221815) +++ head/usr.bin/fstat/fstat.c Thu May 12 17:02:56 2011 (r221816) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -452,7 +453,7 @@ print_vnode_info(struct procstat *procst else { strmode(vn.vn_mode, mode); } - (void)printf(" %6ld %10s", vn.vn_fileid, mode); + (void)printf(" %6jd %10s", (intmax_t)vn.vn_fileid, mode); if (vn.vn_type == PS_FST_VTYPE_VBLK || vn.vn_type == PS_FST_VTYPE_VCHR) { if (nflg || !*vn.vn_devname) @@ -461,7 +462,7 @@ print_vnode_info(struct procstat *procst printf(" %6s", vn.vn_devname); } } else - printf(" %6lu", vn.vn_size); + printf(" %6ju", (intmax_t)vn.vn_size); print_access_flags(fst->fs_fflags); } From owner-svn-src-head@FreeBSD.ORG Thu May 12 17:11:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF00106566C; Thu, 12 May 2011 17:11:31 +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 D08168FC18; Thu, 12 May 2011 17:11:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CHBVhJ046020; Thu, 12 May 2011 17:11:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CHBVcG046018; Thu, 12 May 2011 17:11:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105121711.p4CHBVcG046018@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 12 May 2011 17:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221817 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 17:11:32 -0000 Author: yongari Date: Thu May 12 17:11:31 2011 New Revision: 221817 URL: http://svn.freebsd.org/changeset/base/221817 Log: Explicitly clear 1000baseT control register for F1 PHY used in AR8132 FastEthernet controller. The PHY has no ability to establish a gigabit link. Previously only link parters which support down-shifting was able to establish link. This change should fix a long standing link establishment issue of AR8132. PR: kern/156935 MFC after: 1 week Modified: head/sys/dev/mii/atphy.c Modified: head/sys/dev/mii/atphy.c ============================================================================== --- head/sys/dev/mii/atphy.c Thu May 12 17:02:56 2011 (r221816) +++ head/sys/dev/mii/atphy.c Thu May 12 17:11:31 2011 (r221817) @@ -359,6 +359,18 @@ atphy_setmedia(struct mii_softc *sc, int (EXTSR_1000TFDX | EXTSR_1000THDX)) != 0) PHY_WRITE(sc, MII_100T2CR, GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX); + else if (sc->mii_mpd_model == MII_MODEL_xxATHEROS_F1) { + /* + * AR8132 has 10/100 PHY and the PHY uses the same + * model number of F1 gigabit PHY. The PHY has no + * ability to establish gigabit link so explicitly + * disable 1000baseT configuration for the PHY. + * Otherwise, there is a case that atphy(4) could + * not establish a link against gigabit link partner + * unless the link partner supports down-shifting. + */ + PHY_WRITE(sc, MII_100T2CR, 0); + } PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_AUTOEN | BMCR_STARTNEG); return (EJUSTRETURN); From owner-svn-src-head@FreeBSD.ORG Thu May 12 17:15:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E6BD106564A; Thu, 12 May 2011 17:15:58 +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 F25D58FC12; Thu, 12 May 2011 17:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CHFvi2046187; Thu, 12 May 2011 17:15:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CHFvO1046184; Thu, 12 May 2011 17:15:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201105121715.p4CHFvO1046184@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 12 May 2011 17:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221818 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 17:15:58 -0000 Author: yongari Date: Thu May 12 17:15:57 2011 New Revision: 221818 URL: http://svn.freebsd.org/changeset/base/221818 Log: Add initial BCM5719 support. TSO and jumbo frame was intentionally disabled for BCM5719 A0 revision due to known hardware errata. Many thanks to Broadcom for continuing support of FreeBSD. Submitted by: Geans Pin at Broadcom Modified: head/sys/dev/bge/if_bge.c head/sys/dev/bge/if_bgereg.h Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu May 12 17:11:31 2011 (r221817) +++ head/sys/dev/bge/if_bge.c Thu May 12 17:15:57 2011 (r221818) @@ -171,6 +171,7 @@ static const struct bge_type { { BCOM_VENDORID, BCOM_DEVICEID_BCM5715S }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5717 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5718 }, + { BCOM_VENDORID, BCOM_DEVICEID_BCM5719 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5720 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5721 }, { BCOM_VENDORID, BCOM_DEVICEID_BCM5722 }, @@ -299,6 +300,7 @@ static const struct bge_revision { { BGE_CHIPID_BCM5715_A3, "BCM5715 A3" }, { BGE_CHIPID_BCM5717_A0, "BCM5717 A0" }, { BGE_CHIPID_BCM5717_B0, "BCM5717 B0" }, + { BGE_CHIPID_BCM5719_A0, "BCM5719 A0" }, { BGE_CHIPID_BCM5755_A0, "BCM5755 A0" }, { BGE_CHIPID_BCM5755_A1, "BCM5755 A1" }, { BGE_CHIPID_BCM5755_A2, "BCM5755 A2" }, @@ -346,6 +348,7 @@ static const struct bge_revision const b { BGE_ASICREV_BCM57765, "unknown BCM57765" }, { BGE_ASICREV_BCM57780, "unknown BCM57780" }, { BGE_ASICREV_BCM5717, "unknown BCM5717" }, + { BGE_ASICREV_BCM5719, "unknown BCM5719" }, { 0, NULL } }; @@ -1481,6 +1484,14 @@ bge_chipinit(struct bge_softc *sc) dma_rw_ctl &= ~BGE_PCIDMARWCTL_DIS_CACHE_ALIGNMENT; if (sc->bge_chipid == BGE_CHIPID_BCM57765_A0) dma_rw_ctl &= ~BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK; + /* + * Enable HW workaround for controllers that misinterpret + * a status tag update and leave interrupts permanently + * disabled. + */ + if (sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM57765) + dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA; } pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4); @@ -1537,7 +1548,7 @@ bge_blockinit(struct bge_softc *sc) struct bge_rcb *rcb; bus_size_t vrcb; bge_hostaddr taddr; - uint32_t val; + uint32_t dmactl, val; int i, limit; /* @@ -1594,8 +1605,16 @@ bge_blockinit(struct bge_softc *sc) CSR_WRITE_4(sc, BGE_BMAN_DMA_DESCPOOL_HIWAT, 10); /* Enable buffer manager */ - CSR_WRITE_4(sc, BGE_BMAN_MODE, - BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN); + val = BGE_BMANMODE_ENABLE | BGE_BMANMODE_LOMBUF_ATTN; + /* + * Change the arbitration algorithm of TXMBUF read request to + * round-robin instead of priority based for BCM5719. When + * TXFIFO is almost empty, RDMA will hold its request until + * TXFIFO is not almost empty. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) + val |= BGE_BMANMODE_NO_TX_UNDERRUN; + CSR_WRITE_4(sc, BGE_BMAN_MODE, val); /* Poll for buffer manager start indication */ for (i = 0; i < BGE_TIMEOUT; i++) { @@ -1692,7 +1711,8 @@ bge_blockinit(struct bge_softc *sc) rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(BGE_MAX_FRAMELEN, 0); } - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) rcb->bge_nicaddr = BGE_STD_RX_RINGS_5717; else rcb->bge_nicaddr = BGE_STD_RX_RINGS; @@ -1724,7 +1744,8 @@ bge_blockinit(struct bge_softc *sc) BUS_DMASYNC_PREREAD); rcb->bge_maxlen_flags = BGE_RCB_MAXLEN_FLAGS(0, BGE_RCB_FLAG_USE_EXT_RX_BD | BGE_RCB_FLAG_RING_DISABLED); - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS_5717; else rcb->bge_nicaddr = BGE_JUMBO_RX_RINGS; @@ -1812,7 +1833,8 @@ bge_blockinit(struct bge_softc *sc) BGE_HOSTADDR(taddr, sc->bge_ldata.bge_tx_ring_paddr); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_hi, taddr.bge_addr_hi); RCB_WRITE_4(sc, vrcb, bge_hostaddr.bge_addr_lo, taddr.bge_addr_lo); - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) RCB_WRITE_4(sc, vrcb, bge_nicaddr, BGE_SEND_RING_5717); else RCB_WRITE_4(sc, vrcb, bge_nicaddr, @@ -1825,7 +1847,8 @@ bge_blockinit(struct bge_softc *sc) * 'ring diabled' bit in the flags field of all the receive * return ring control blocks, located in NIC memory. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) { /* Should be 17, use 16 until we get an SRAM map. */ limit = 16; } else if (!BGE_IS_5705_PLUS(sc)) @@ -2029,15 +2052,35 @@ bge_blockinit(struct bge_softc *sc) sc->bge_asicrev == BGE_ASICREV_BCM5785 || sc->bge_asicrev == BGE_ASICREV_BCM57780 || BGE_IS_5717_PLUS(sc)) { + dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL); + /* + * Adjust tx margin to prevent TX data corruption and + * fix internal FIFO overflow. + */ + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { + dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK | + BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK | + BGE_RDMA_RSRVCTRL_TXMRGN_MASK); + dmactl |= BGE_RDMA_RSRVCTRL_FIFO_LWM_1_5K | + BGE_RDMA_RSRVCTRL_FIFO_HWM_1_5K | + BGE_RDMA_RSRVCTRL_TXMRGN_320B; + } /* * Enable fix for read DMA FIFO overruns. * The fix is to limit the number of RX BDs * the hardware would fetch at a fime. */ - CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, - CSR_READ_4(sc, BGE_RDMA_RSRVCTRL) | + CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl | BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } + + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } + CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); @@ -2189,6 +2232,7 @@ bge_probe(device_t dev) switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: id = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -2712,6 +2756,7 @@ bge_attach(device_t dev) switch (pci_get_device(dev)) { case BCOM_DEVICEID_BCM5717: case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: sc->bge_chipid = pci_read_config(dev, BGE_PCI_GEN2_PRODID_ASICREV, 4); break; @@ -2742,11 +2787,13 @@ bge_attach(device_t dev) * BCM57XX | 1 | X | X | X | * BCM5704 | 1 | X | 1 | X | * BCM5717 | 1 | 8 | 2 | 9 | + * BCM5719 | 1 | 8 | 2 | 9 | * * Other addresses may respond but they are not * IEEE compliant PHYs and should be ignored. */ - if (sc->bge_asicrev == BGE_ASICREV_BCM5717) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5717 || + sc->bge_asicrev == BGE_ASICREV_BCM5719) { f = pci_get_function(dev); if (sc->bge_chipid == BGE_CHIPID_BCM5717_A0) { if (CSR_READ_4(sc, BGE_SGDIG_STS) & @@ -2754,7 +2801,7 @@ bge_attach(device_t dev) phy_addr = f + 8; else phy_addr = f + 1; - } else if (sc->bge_chipid == BGE_CHIPID_BCM5717_B0) { + } else { if (CSR_READ_4(sc, BGE_CPMU_PHY_STRAP) & BGE_CPMU_PHY_STRAP_IS_SERDES) phy_addr = f + 8; @@ -2780,11 +2827,17 @@ bge_attach(device_t dev) /* Save chipset family. */ switch (sc->bge_asicrev) { case BGE_ASICREV_BCM5717: + case BGE_ASICREV_BCM5719: sc->bge_flags |= BGE_FLAG_SHORT_DMA_BUG; case BGE_ASICREV_BCM57765: sc->bge_flags |= BGE_FLAG_5717_PLUS | BGE_FLAG_5755_PLUS | BGE_FLAG_575X_PLUS | BGE_FLAG_5705_PLUS | BGE_FLAG_JUMBO | BGE_FLAG_JUMBO_FRAME; + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + /* Jumbo frame on BCM5719 A0 does not work. */ + sc->bge_flags &= ~BGE_FLAG_JUMBO_FRAME; + } break; case BGE_ASICREV_BCM5755: case BGE_ASICREV_BCM5761: @@ -2832,6 +2885,7 @@ bge_attach(device_t dev) if ((BGE_IS_5705_PLUS(sc)) && sc->bge_asicrev != BGE_ASICREV_BCM5906 && sc->bge_asicrev != BGE_ASICREV_BCM5717 && + sc->bge_asicrev != BGE_ASICREV_BCM5719 && sc->bge_asicrev != BGE_ASICREV_BCM5785 && sc->bge_asicrev != BGE_ASICREV_BCM57765 && sc->bge_asicrev != BGE_ASICREV_BCM57780) { @@ -2914,6 +2968,11 @@ bge_attach(device_t dev) if (BGE_IS_5717_PLUS(sc)) { /* BCM5717 requires different TSO configuration. */ sc->bge_flags |= BGE_FLAG_TSO3; + if (sc->bge_asicrev == BGE_ASICREV_BCM5719 && + sc->bge_chipid == BGE_CHIPID_BCM5719_A0) { + /* TSO on BCM5719 A0 does not work. */ + sc->bge_flags &= ~BGE_FLAG_TSO3; + } } else if (BGE_IS_5755_PLUS(sc)) { /* * BCM5754 and BCM5787 shares the same ASIC id so @@ -2936,7 +2995,9 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; - if (pci_get_max_read_req(dev) != 4096) + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) + pci_set_max_read_req(dev, 2048); + else if (pci_get_max_read_req(dev) != 4096) pci_set_max_read_req(dev, 4096); } else { /* Modified: head/sys/dev/bge/if_bgereg.h ============================================================================== --- head/sys/dev/bge/if_bgereg.h Thu May 12 17:11:31 2011 (r221817) +++ head/sys/dev/bge/if_bgereg.h Thu May 12 17:15:57 2011 (r221818) @@ -319,6 +319,7 @@ #define BGE_CHIPID_BCM57780_A1 0x57780001 #define BGE_CHIPID_BCM5717_A0 0x05717000 #define BGE_CHIPID_BCM5717_B0 0x05717100 +#define BGE_CHIPID_BCM5719_A0 0x05719000 #define BGE_CHIPID_BCM57765_A0 0x57785000 #define BGE_CHIPID_BCM57765_B0 0x57785100 @@ -342,6 +343,7 @@ #define BGE_ASICREV_USE_PRODID_REG 0x0f /* BGE_PCI_PRODID_ASICREV ASIC rev. identifiers. */ #define BGE_ASICREV_BCM5717 0x5717 +#define BGE_ASICREV_BCM5719 0x5719 #define BGE_ASICREV_BCM5761 0x5761 #define BGE_ASICREV_BCM5784 0x5784 #define BGE_ASICREV_BCM5785 0x5785 @@ -385,6 +387,7 @@ #define BGE_PCIDMARWCTL_RD_CMD_SHIFT(x) ((x) << 24) #define BGE_PCIDMARWCTL_WR_CMD_SHIFT(x) ((x) << 28) +#define BGE_PCIDMARWCTL_TAGGED_STATUS_WA 0x00000080 #define BGE_PCIDMARWCTL_CRDRDR_RDMA_MRRS_MSK 0x00000380 #define BGE_PCI_READ_BNDRY_DISABLE 0x00000000 @@ -1494,6 +1497,7 @@ #define BGE_BMANMODE_ATTN 0x00000004 #define BGE_BMANMODE_TESTMODE 0x00000008 #define BGE_BMANMODE_LOMBUF_ATTN 0x00000010 +#define BGE_BMANMODE_NO_TX_UNDERRUN 0x80000000 /* Buffer manager status register */ #define BGE_BMANSTAT_ERRO 0x00000004 @@ -1506,6 +1510,7 @@ #define BGE_RDMA_MODE 0x4800 #define BGE_RDMA_STATUS 0x4804 #define BGE_RDMA_RSRVCTRL 0x4900 +#define BGE_RDMA_LSO_CRPTEN_CTRL 0x4910 /* Read DMA mode register */ #define BGE_RDMAMODE_RESET 0x00000001 @@ -1540,6 +1545,15 @@ /* Read DMA Reserved Control register */ #define BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004 +#define BGE_RDMA_RSRVCTRL_FIFO_LWM_1_5K 0x00000C00 +#define BGE_RDMA_RSRVCTRL_FIFO_HWM_1_5K 0x000C0000 +#define BGE_RDMA_RSRVCTRL_TXMRGN_320B 0x28000000 +#define BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK 0x00000FF0 +#define BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000 +#define BGE_RDMA_RSRVCTRL_TXMRGN_MASK 0xFFE00000 + +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 /* * Write DMA control registers @@ -2261,6 +2275,7 @@ struct bge_status_block { #define BCOM_DEVICEID_BCM5715S 0x1679 #define BCOM_DEVICEID_BCM5717 0x1655 #define BCOM_DEVICEID_BCM5718 0x1656 +#define BCOM_DEVICEID_BCM5719 0x1657 #define BCOM_DEVICEID_BCM5720 0x1658 #define BCOM_DEVICEID_BCM5721 0x1659 #define BCOM_DEVICEID_BCM5722 0x165A From owner-svn-src-head@FreeBSD.ORG Thu May 12 18:01:16 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8718106566B; Thu, 12 May 2011 18:01:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 506228FC12; Thu, 12 May 2011 18:01:14 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA02443; Thu, 12 May 2011 21:01:13 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QKaCH-000Kev-DO; Thu, 12 May 2011 21:01:13 +0300 Message-ID: <4DCC2068.1080903@FreeBSD.org> Date: Thu, 12 May 2011 21:01:12 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110503 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Warner Losh References: <201105121702.p4CH2u1w045627@svn.freebsd.org> In-Reply-To: <201105121702.p4CH2u1w045627@svn.freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221816 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 18:01:16 -0000 on 12/05/2011 20:02 Warner Losh said the following: > - printf(" %6lu", vn.vn_size); > + printf(" %6ju", (intmax_t)vn.vn_size); Just a nit - uintmax_t should be more appropriate here. Thank you for fixing this! > print_access_flags(fst->fs_fflags); > } -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Thu May 12 18:57:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC977106566B; Thu, 12 May 2011 18:57:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7F00E8FC12; Thu, 12 May 2011 18:57:47 +0000 (UTC) Received: from orion.SpringDaemons.com (207.47.0.2.static.nextweb.net [207.47.0.2]) by mx0.deglitch.com (Postfix) with ESMTPA id ECB2F8FC2D; Thu, 12 May 2011 22:57:45 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 9F36A5C41; Thu, 12 May 2011 11:57:03 -0700 (PDT) Date: Thu, 12 May 2011 11:57:03 -0700 From: Stanislav Sedov To: Warner Losh Message-Id: <20110512115703.91e816b7.stas@FreeBSD.org> In-Reply-To: <201105121702.p4CH2u1w045627@svn.freebsd.org> References: <201105121702.p4CH2u1w045627@svn.freebsd.org> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221816 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 18:57:47 -0000 On Thu, 12 May 2011 17:02:56 +0000 (UTC) Warner Losh mentioned: > Author: imp > Date: Thu May 12 17:02:56 2011 > New Revision: 221816 > URL: http://svn.freebsd.org/changeset/base/221816 > > Log: > Fix printf int mismatch on 32-bit architectures... > Thanks a lot! Apparently I did `make universe` in the wrong tree... -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-head@FreeBSD.ORG Thu May 12 19:10:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43BCE106564A; Thu, 12 May 2011 19:10:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 302C38FC16; Thu, 12 May 2011 19:10:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CJA1U8048411; Thu, 12 May 2011 19:10:01 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CJA1WD048409; Thu, 12 May 2011 19:10:01 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105121910.p4CJA1WD048409@svn.freebsd.org> From: Warner Losh Date: Thu, 12 May 2011 19:10:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221819 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 19:10:01 -0000 Author: imp Date: Thu May 12 19:10:00 2011 New Revision: 221819 URL: http://svn.freebsd.org/changeset/base/221819 Log: uintmax_t is a better type here... Submitted by: avg@ Modified: head/usr.bin/fstat/fstat.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Thu May 12 17:15:57 2011 (r221818) +++ head/usr.bin/fstat/fstat.c Thu May 12 19:10:00 2011 (r221819) @@ -462,7 +462,7 @@ print_vnode_info(struct procstat *procst printf(" %6s", vn.vn_devname); } } else - printf(" %6ju", (intmax_t)vn.vn_size); + printf(" %6ju", (uintmax_t)vn.vn_size); print_access_flags(fst->fs_fflags); } From owner-svn-src-head@FreeBSD.ORG Thu May 12 19:23:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41E74106566C; Thu, 12 May 2011 19:23:23 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id B180E8FC1B; Thu, 12 May 2011 19:23:22 +0000 (UTC) Received: by yie12 with SMTP id 12so698073yie.13 for ; Thu, 12 May 2011 12:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=dkpVMyD7e9jSGqG123CM5kECtbc0CuEenTyhqq7+XLg=; b=ESEfkyFeVu5EC4iSM2CVkZ5Pz6UrE2a29NblGG/EOK8DTq0nAWx+zKnKVF9rmuyz6d 6iXQmC6E7GEAkI7PMGHrh6qr7xycEKvmXjHe2Ex2K7TvcKeax637CrfoaGJHcMHlLnUM ADg2b/it2x5H++4wid39EpB/tqimHwln0ovkc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=OD7xYHFgm0RmlSlF6KQqpZE3hSQ7a9tvFQGGs386mmFZ0R9kOeXPa5AqB+A3BjgYzZ UleqZYHqJa5RWDh3H6wj+8MVW0PA6CtQyyS18lag0re7/HRj9OqP/5Ch/FYXX0AN/oJ7 5x2T8w0d152QfmabL7EiFlqH4lev5a/uJbjck= Received: by 10.151.100.18 with SMTP id c18mr329056ybm.288.1305228201703; Thu, 12 May 2011 12:23:21 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([192.75.139.248]) by mx.google.com with ESMTPS id b4sm2682396ybo.23.2011.05.12.12.23.20 (version=SSLv3 cipher=OTHER); Thu, 12 May 2011 12:23:20 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DCC33A4.4040301@FreeBSD.org> Date: Thu, 12 May 2011 22:23:16 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: "Andrey V. Elsukov" References: <201105030733.p437XduH075011@svn.freebsd.org> <20110512151508.GK11355@acme.spoerlein.net> <4DCC0273.6010904@FreeBSD.org> In-Reply-To: <4DCC0273.6010904@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, =?UTF-8?B?VWxyaWNoIFNww7ZybGVpbg==?= , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r221363 - head/sbin/geom/class/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 19:23:23 -0000 On 12.05.2011 18:53, Andrey V. Elsukov wrote: > On 12.05.2011 19:15, Ulrich Spörlein wrote: >>> Add "-a alignment" option to gpart(8). When it specified gpart(8) >>> tries to align partition start offset and size to be multiple of >>> alignment value. >>> >> >> Aligned to what? The disk or the partition scheme? Consider someone >> having a GELI partition of arbitrary alignment, how would a bsdlabel or >> GPT label inside this GELI partition be aligned when 4K alignment is >> requested? > > Each partition has three mandatory parameters: start offset, end offset > and partition type. These offsets are within top level provider. With 4K > alignment gpart(8) would try to adjust partition start and end offset to > be multiple of 4K. Most of GEOM classes report enough alignment data (stripesize and stripeoffset). They should be taken to account to properly handle alignment partitions on cascaded partitioned tables (bsdlabel inside MBR). -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Thu May 12 21:12:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17455106566B; Thu, 12 May 2011 21:12:25 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 073DC8FC0A; Thu, 12 May 2011 21:12:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CLCOoM050741; Thu, 12 May 2011 21:12:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CLCOg6050738; Thu, 12 May 2011 21:12:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105122112.p4CLCOg6050738@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 12 May 2011 21:12:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221820 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 21:12:25 -0000 Author: des Date: Thu May 12 21:12:24 2011 New Revision: 221820 URL: http://svn.freebsd.org/changeset/base/221820 Log: Increase WARNS to 3. Modified: head/lib/libfetch/Makefile head/lib/libfetch/http.c Modified: head/lib/libfetch/Makefile ============================================================================== --- head/lib/libfetch/Makefile Thu May 12 19:10:00 2011 (r221819) +++ head/lib/libfetch/Makefile Thu May 12 21:12:24 2011 (r221820) @@ -26,7 +26,7 @@ LDADD= -lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?= 2 +WARNS?= 3 SHLIB_MAJOR= 6 Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu May 12 19:10:00 2011 (r221819) +++ head/lib/libfetch/http.c Thu May 12 21:12:24 2011 (r221820) @@ -508,7 +508,7 @@ http_conn_trimright(conn_t *conn) static hdr_t http_next_header(conn_t *conn, http_headerbuf_t *hbuf, const char **p) { - int i, len; + unsigned int i, len; /* * Have to do the stripping here because of the first line. So From owner-svn-src-head@FreeBSD.ORG Thu May 12 21:18:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 394B5106564A; Thu, 12 May 2011 21:18:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 288E58FC16; Thu, 12 May 2011 21:18:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CLIupZ050899; Thu, 12 May 2011 21:18:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CLIuNg050897; Thu, 12 May 2011 21:18:56 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105122118.p4CLIuNg050897@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 12 May 2011 21:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221821 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 21:18:56 -0000 Author: des Date: Thu May 12 21:18:55 2011 New Revision: 221821 URL: http://svn.freebsd.org/changeset/base/221821 Log: Mechanical whitespace cleanup. Modified: head/lib/libfetch/http.c Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu May 12 21:12:24 2011 (r221820) +++ head/lib/libfetch/http.c Thu May 12 21:18:55 2011 (r221821) @@ -454,7 +454,7 @@ http_match(const char *str, const char * * Get the next header and return the appropriate symbolic code. We * need to read one line ahead for checking for a continuation line * belonging to the current header (continuation lines start with - * white space). + * white space). * * We get called with a fresh line already in the conn buffer, either * from the previous http_next_header() invocation, or, the first @@ -462,7 +462,7 @@ http_match(const char *str, const char * * * This stops when we encounter an empty line (we dont read beyond the header * area). - * + * * Note that the "headerbuf" is just a place to return the result. Its * contents are not used for the next call. This means that no cleanup * is needed when ie doing another connection, just call the cleanup when @@ -487,7 +487,7 @@ init_http_headerbuf(http_headerbuf_t *bu buf->buflen = 0; } -static void +static void clean_http_headerbuf(http_headerbuf_t *buf) { if (buf->buf) @@ -496,10 +496,10 @@ clean_http_headerbuf(http_headerbuf_t *b } /* Remove whitespace at the end of the buffer */ -static void +static void http_conn_trimright(conn_t *conn) { - while (conn->buflen && + while (conn->buflen && isspace((unsigned char)conn->buf[conn->buflen - 1])) conn->buflen--; conn->buf[conn->buflen] = '\0'; @@ -510,9 +510,9 @@ http_next_header(conn_t *conn, http_head { unsigned int i, len; - /* + /* * Have to do the stripping here because of the first line. So - * it's done twice for the subsequent lines. No big deal + * it's done twice for the subsequent lines. No big deal */ http_conn_trimright(conn); if (conn->buflen == 0) @@ -527,19 +527,19 @@ http_next_header(conn_t *conn, http_head strcpy(hbuf->buf, conn->buf); hbuf->buflen = conn->buflen; - /* + /* * Fetch possible continuation lines. Stop at 1st non-continuation - * and leave it in the conn buffer - */ + * and leave it in the conn buffer + */ for (i = 0; i < HTTP_MAX_CONT_LINES; i++) { if (fetch_getln(conn) == -1) return (hdr_syserror); - /* + /* * Note: we carry on the idea from the previous version * that a pure whitespace line is equivalent to an empty * one (so it's not continuation and will be handled when - * we are called next) + * we are called next) */ http_conn_trimright(conn); if (conn->buf[0] != ' ' && conn->buf[0] != "\t"[0]) @@ -555,7 +555,7 @@ http_next_header(conn_t *conn, http_head } strcpy(hbuf->buf + hbuf->buflen, conn->buf); hbuf->buflen += conn->buflen; - } + } /* * We could check for malformed headers but we don't really care. @@ -574,12 +574,12 @@ http_next_header(conn_t *conn, http_head * [Proxy-]Authenticate header parsing */ -/* - * Read doublequote-delimited string into output buffer obuf (allocated +/* + * Read doublequote-delimited string into output buffer obuf (allocated * by caller, whose responsibility it is to ensure that it's big enough) * cp points to the first char after the initial '"' - * Handles \ quoting - * Returns pointer to the first char after the terminating double quote, or + * Handles \ quoting + * Returns pointer to the first char after the terminating double quote, or * NULL for error. */ static const char * @@ -620,7 +620,7 @@ typedef struct { int nc; /* Nonce count */ } http_auth_challenge_t; -static void +static void init_http_auth_challenge(http_auth_challenge_t *b) { b->scheme = HTTPAS_UNKNOWN; @@ -628,18 +628,18 @@ init_http_auth_challenge(http_auth_chall b->stale = b->nc = 0; } -static void +static void clean_http_auth_challenge(http_auth_challenge_t *b) { - if (b->realm) + if (b->realm) free(b->realm); - if (b->qop) + if (b->qop) free(b->qop); - if (b->nonce) + if (b->nonce) free(b->nonce); - if (b->opaque) + if (b->opaque) free(b->opaque); - if (b->algo) + if (b->algo) free(b->algo); init_http_auth_challenge(b); } @@ -652,7 +652,7 @@ typedef struct { int valid; /* We did parse an authenticate header */ } http_auth_challenges_t; -static void +static void init_http_auth_challenges(http_auth_challenges_t *cs) { int i; @@ -661,7 +661,7 @@ init_http_auth_challenges(http_auth_chal cs->count = cs->valid = 0; } -static void +static void clean_http_auth_challenges(http_auth_challenges_t *cs) { int i; @@ -675,19 +675,19 @@ clean_http_auth_challenges(http_auth_cha init_http_auth_challenges(cs); } -/* +/* * Enumeration for lexical elements. Separators will be returned as their own * ascii value */ typedef enum {HTTPHL_WORD=256, HTTPHL_STRING=257, HTTPHL_END=258, HTTPHL_ERROR = 259} http_header_lex_t; -/* +/* * Determine what kind of token comes next and return possible value * in buf, which is supposed to have been allocated big enough by - * caller. Advance input pointer and return element type. + * caller. Advance input pointer and return element type. */ -static int +static int http_header_lex(const char **cpp, char *buf) { size_t l; @@ -716,7 +716,7 @@ http_header_lex(const char **cpp, char * return (HTTPHL_WORD); } -/* +/* * Read challenges from http xxx-authenticate header and accumulate them * in the challenges list structure. * @@ -728,7 +728,7 @@ http_header_lex(const char **cpp, char * * * We support both approaches anyway */ -static int +static int http_parse_authenticate(const char *cp, http_auth_challenges_t *cs) { int ret = -1; @@ -752,7 +752,7 @@ http_parse_authenticate(const char *cp, /* Loop on challenges */ for (; cs->count < MAX_CHALLENGES; cs->count++) { - cs->challenges[cs->count] = + cs->challenges[cs->count] = malloc(sizeof(http_auth_challenge_t)); if (cs->challenges[cs->count] == NULL) { fetch_syserr(); @@ -765,14 +765,14 @@ http_parse_authenticate(const char *cp, cs->challenges[cs->count]->scheme = HTTPAS_DIGEST; } else { cs->challenges[cs->count]->scheme = HTTPAS_UNKNOWN; - /* - * Continue parsing as basic or digest may + /* + * Continue parsing as basic or digest may * follow, and the syntax is the same for * all. We'll just ignore this one when * looking at the list */ } - + /* Loop on attributes */ for (;;) { /* Key */ @@ -791,31 +791,31 @@ http_parse_authenticate(const char *cp, goto out; if (!strcasecmp(key, "realm")) - cs->challenges[cs->count]->realm = + cs->challenges[cs->count]->realm = strdup(value); else if (!strcasecmp(key, "qop")) - cs->challenges[cs->count]->qop = + cs->challenges[cs->count]->qop = strdup(value); else if (!strcasecmp(key, "nonce")) - cs->challenges[cs->count]->nonce = + cs->challenges[cs->count]->nonce = strdup(value); else if (!strcasecmp(key, "opaque")) - cs->challenges[cs->count]->opaque = + cs->challenges[cs->count]->opaque = strdup(value); else if (!strcasecmp(key, "algorithm")) - cs->challenges[cs->count]->algo = + cs->challenges[cs->count]->algo = strdup(value); else if (!strcasecmp(key, "stale")) - cs->challenges[cs->count]->stale = + cs->challenges[cs->count]->stale = strcasecmp(value, "no"); /* Else ignore unknown attributes */ /* Comma or Next challenge or End */ lex = http_header_lex(&cp, key); - /* - * If we get a word here, this is the beginning of the - * next challenge. Break the attributes loop - */ + /* + * If we get a word here, this is the beginning of the + * next challenge. Break the attributes loop + */ if (lex == HTTPHL_WORD) break; @@ -832,10 +832,10 @@ http_parse_authenticate(const char *cp, } /* End attributes loop */ } /* End challenge loop */ - /* - * Challenges max count exceeded. This really can't happen - * with normal data, something's fishy -> error - */ + /* + * Challenges max count exceeded. This really can't happen + * with normal data, something's fishy -> error + */ out: if (key) @@ -1011,16 +1011,16 @@ init_http_auth_params(http_auth_params_t s->scheme = s->realm = s->user = s->password = 0; } -static void +static void clean_http_auth_params(http_auth_params_t *s) { - if (s->scheme) + if (s->scheme) free(s->scheme); - if (s->realm) + if (s->realm) free(s->realm); - if (s->user) + if (s->user) free(s->user); - if (s->password) + if (s->password) free(s->password); init_http_auth_params(s); } @@ -1075,7 +1075,7 @@ http_authfromenv(const char *p, http_aut } ret = 0; out: - if (ret == -1) + if (ret == -1) clean_http_auth_params(parms); if (str) free(str); @@ -1083,9 +1083,9 @@ out: } -/* +/* * Digest response: the code to compute the digest is taken from the - * sample implementation in RFC2616 + * sample implementation in RFC2616 */ #define IN #define OUT @@ -1096,7 +1096,7 @@ typedef char HASH[HASHLEN]; typedef char HASHHEX[HASHHEXLEN+1]; static const char *hexchars = "0123456789abcdef"; -static void +static void CvtHex(IN HASH Bin, OUT HASHHEX Hex) { unsigned short i; @@ -1112,7 +1112,7 @@ CvtHex(IN HASH Bin, OUT HASHHEX Hex) }; /* calculate H(A1) as per spec */ -static void +static void DigestCalcHA1( IN char * pszAlg, IN char * pszUserName, @@ -1147,7 +1147,7 @@ DigestCalcHA1( } /* calculate request-digest/response-digest as per HTTP Digest spec */ -static void +static void DigestCalcResponse( IN HASHHEX HA1, /* H(A1) */ IN char * pszNonce, /* nonce from server */ @@ -1160,7 +1160,7 @@ DigestCalcResponse( OUT HASHHEX Response /* request-digest or response-digest */ ) { -/* DEBUG(fprintf(stderr, +/* DEBUG(fprintf(stderr, "Calc: HA1[%s] Nonce[%s] qop[%s] method[%s] URI[%s]\n", HA1, pszNonce, pszQop, pszMethod, pszDigestUri));*/ MD5_CTX Md5Ctx; @@ -1199,8 +1199,8 @@ DigestCalcResponse( CvtHex(RespHash, Response); } -/* - * Generate/Send a Digest authorization header +/* + * Generate/Send a Digest authorization header * This looks like: [Proxy-]Authorization: credentials * * credentials = "Digest" digest-response @@ -1233,10 +1233,10 @@ http_digest_auth(conn_t *conn, const cha DEBUG(fprintf(stderr, "realm/nonce not set in challenge\n")); return(-1); } - if (!c->algo) + if (!c->algo) c->algo = strdup(""); - if (asprintf(&options, "%s%s%s%s", + if (asprintf(&options, "%s%s%s%s", *c->algo? ",algorithm=" : "", c->algo, c->opaque? ",opaque=" : "", c->opaque?c->opaque:"")== -1) return (-1); @@ -1264,13 +1264,13 @@ http_digest_auth(conn_t *conn, const cha r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\"," "nonce=\"%s\",uri=\"%s\",response=\"%s\"," "qop=\"auth\", cnonce=\"%s\", nc=%s%s", - hdr, parms->user, c->realm, + hdr, parms->user, c->realm, c->nonce, url->doc, digest, cnonce, noncecount, options); } else { r = http_cmd(conn, "%s: Digest username=\"%s\",realm=\"%s\"," "nonce=\"%s\",uri=\"%s\",response=\"%s\"%s", - hdr, parms->user, c->realm, + hdr, parms->user, c->realm, c->nonce, url->doc, digest, options); } if (options) @@ -1301,7 +1301,7 @@ http_basic_auth(conn_t *conn, const char } /* - * Chose the challenge to answer and call the appropriate routine to + * Chose the challenge to answer and call the appropriate routine to * produce the header. */ static int @@ -1327,16 +1327,16 @@ http_authorize(conn_t *conn, const char } /* Error if "Digest" was specified and there is no Digest challenge */ - if (!digest && (parms->scheme && + if (!digest && (parms->scheme && !strcasecmp(parms->scheme, "digest"))) { - DEBUG(fprintf(stderr, + DEBUG(fprintf(stderr, "Digest auth in env, not supported by peer\n")); return (-1); } - /* - * If "basic" was specified in the environment, or there is no Digest + /* + * If "basic" was specified in the environment, or there is no Digest * challenge, do the basic thing. Don't need a challenge for this, - * so no need to check basic!=NULL + * so no need to check basic!=NULL */ if (!digest || (parms->scheme && !strcasecmp(parms->scheme,"basic"))) return (http_basic_auth(conn,hdr,parms->user,parms->password)); @@ -1492,7 +1492,7 @@ http_request(struct url *URL, const char http_auth_challenges_t proxy_challenges; /* The following calls don't allocate anything */ - init_http_headerbuf(&headerbuf); + init_http_headerbuf(&headerbuf); init_http_auth_challenges(&server_challenges); init_http_auth_challenges(&proxy_challenges); @@ -1578,65 +1578,65 @@ http_request(struct url *URL, const char /* virtual host */ http_cmd(conn, "Host: %s", host); - /* - * Proxy authorization: we only send auth after we received - * a 407 error. We do not first try basic anyway (changed - * when support was added for digest-auth) - */ + /* + * Proxy authorization: we only send auth after we received + * a 407 error. We do not first try basic anyway (changed + * when support was added for digest-auth) + */ if (purl && proxy_challenges.valid) { http_auth_params_t aparams; init_http_auth_params(&aparams); if (*purl->user || *purl->pwd) { - aparams.user = purl->user ? + aparams.user = purl->user ? strdup(purl->user) : strdup(""); aparams.password = purl->pwd? strdup(purl->pwd) : strdup(""); - } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && + } else if ((p = getenv("HTTP_PROXY_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { http_seterr(HTTP_NEED_PROXY_AUTH); goto ouch; } } - http_authorize(conn, "Proxy-Authorization", + http_authorize(conn, "Proxy-Authorization", &proxy_challenges, &aparams, url); clean_http_auth_params(&aparams); } - /* - * Server authorization: we never send "a priori" + /* + * Server authorization: we never send "a priori" * Basic auth, which used to be done if user/pass were * set in the url. This would be weird because we'd send the - * password in the clear even if Digest is finally to be + * password in the clear even if Digest is finally to be * used (it would have made more sense for the - * pre-digest version to do this when Basic was specified - * in the environment) - */ + * pre-digest version to do this when Basic was specified + * in the environment) + */ if (server_challenges.valid) { http_auth_params_t aparams; init_http_auth_params(&aparams); if (*url->user || *url->pwd) { - aparams.user = url->user ? + aparams.user = url->user ? strdup(url->user) : strdup(""); - aparams.password = url->pwd ? + aparams.password = url->pwd ? strdup(url->pwd) : strdup(""); - } else if ((p = getenv("HTTP_AUTH")) != NULL && + } else if ((p = getenv("HTTP_AUTH")) != NULL && *p != '\0') { if (http_authfromenv(p, &aparams) < 0) { http_seterr(HTTP_NEED_AUTH); goto ouch; } - } else if (fetchAuthMethod && + } else if (fetchAuthMethod && fetchAuthMethod(url) == 0) { - aparams.user = url->user ? + aparams.user = url->user ? strdup(url->user) : strdup(""); - aparams.password = url->pwd ? + aparams.password = url->pwd ? strdup(url->pwd) : strdup(""); } else { http_seterr(HTTP_NEED_AUTH); goto ouch; } - http_authorize(conn, "Authorization", + http_authorize(conn, "Authorization", &server_challenges, &aparams, url); clean_http_auth_params(&aparams); } @@ -1804,12 +1804,12 @@ http_request(struct url *URL, const char } while (h > hdr_end); /* we need to provide authentication */ - if (conn->err == HTTP_NEED_AUTH || + if (conn->err == HTTP_NEED_AUTH || conn->err == HTTP_NEED_PROXY_AUTH) { e = conn->err; - if ((conn->err == HTTP_NEED_AUTH && - !server_challenges.valid) || - (conn->err == HTTP_NEED_PROXY_AUTH && + if ((conn->err == HTTP_NEED_AUTH && + !server_challenges.valid) || + (conn->err == HTTP_NEED_PROXY_AUTH && !proxy_challenges.valid)) { /* 401/7 but no www/proxy-authenticate ?? */ DEBUG(fprintf(stderr, "401/7 and no auth header\n")); From owner-svn-src-head@FreeBSD.ORG Thu May 12 21:26:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3805106566C; Thu, 12 May 2011 21:26:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B36E88FC0A; Thu, 12 May 2011 21:26:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CLQg3a051092; Thu, 12 May 2011 21:26:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CLQgBs051088; Thu, 12 May 2011 21:26:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105122126.p4CLQgBs051088@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 12 May 2011 21:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221822 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 21:26:42 -0000 Author: des Date: Thu May 12 21:26:42 2011 New Revision: 221822 URL: http://svn.freebsd.org/changeset/base/221822 Log: Increase WARNS to 4. Modified: head/lib/libfetch/Makefile head/lib/libfetch/ftp.c head/lib/libfetch/http.c Modified: head/lib/libfetch/Makefile ============================================================================== --- head/lib/libfetch/Makefile Thu May 12 21:18:55 2011 (r221821) +++ head/lib/libfetch/Makefile Thu May 12 21:26:42 2011 (r221822) @@ -26,7 +26,7 @@ LDADD= -lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?= 3 +WARNS?= 4 SHLIB_MAJOR= 6 Modified: head/lib/libfetch/ftp.c ============================================================================== --- head/lib/libfetch/ftp.c Thu May 12 21:18:55 2011 (r221821) +++ head/lib/libfetch/ftp.c Thu May 12 21:26:42 2011 (r221822) @@ -127,7 +127,7 @@ unmappedaddr(struct sockaddr_in6 *sin6) !IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) return; sin4 = (struct sockaddr_in *)sin6; - addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12]; + addr = *(u_int32_t *)(uintptr_t)&sin6->sin6_addr.s6_addr[12]; port = sin6->sin6_port; memset(sin4, 0, sizeof(struct sockaddr_in)); sin4->sin_addr.s_addr = addr; Modified: head/lib/libfetch/http.c ============================================================================== --- head/lib/libfetch/http.c Thu May 12 21:18:55 2011 (r221821) +++ head/lib/libfetch/http.c Thu May 12 21:26:42 2011 (r221822) @@ -1087,7 +1087,7 @@ out: * Digest response: the code to compute the digest is taken from the * sample implementation in RFC2616 */ -#define IN +#define IN const #define OUT #define HASHLEN 16 From owner-svn-src-head@FreeBSD.ORG Thu May 12 21:30:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDF5B1065672; Thu, 12 May 2011 21:30:46 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C40C58FC18; Thu, 12 May 2011 21:30:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CLUkYN051201; Thu, 12 May 2011 21:30:46 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CLUk0O051199; Thu, 12 May 2011 21:30:46 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105122130.p4CLUk0O051199@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Thu, 12 May 2011 21:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221823 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 21:30:47 -0000 Author: des Date: Thu May 12 21:30:46 2011 New Revision: 221823 URL: http://svn.freebsd.org/changeset/base/221823 Log: Builds cleanly at the default WARNS level (WARNS=6). Modified: head/lib/libfetch/Makefile Modified: head/lib/libfetch/Makefile ============================================================================== --- head/lib/libfetch/Makefile Thu May 12 21:26:42 2011 (r221822) +++ head/lib/libfetch/Makefile Thu May 12 21:30:46 2011 (r221823) @@ -26,7 +26,6 @@ LDADD= -lmd CFLAGS+= -DFTP_COMBINE_CWDS CSTD?= c99 -WARNS?= 4 SHLIB_MAJOR= 6 From owner-svn-src-head@FreeBSD.ORG Thu May 12 22:15:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AE54106566C; Thu, 12 May 2011 22:15:41 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 281908FC15; Thu, 12 May 2011 22:15:40 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id AC4AF45C9F; Fri, 13 May 2011 00:15:38 +0200 (CEST) Received: from localhost (unknown [24.114.252.238]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 437AB45C9B; Fri, 13 May 2011 00:15:33 +0200 (CEST) Date: Fri, 13 May 2011 00:15:13 +0200 From: Pawel Jakub Dawidek To: Stanislav Sedov Message-ID: <20110512221513.GA1410@garage.freebsd.pl> References: <201105121702.p4CH2u1w045627@svn.freebsd.org> <20110512115703.91e816b7.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline In-Reply-To: <20110512115703.91e816b7.stas@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.5 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Warner Losh Subject: Re: svn commit: r221816 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 22:15:41 -0000 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 12, 2011 at 11:57:03AM -0700, Stanislav Sedov wrote: > On Thu, 12 May 2011 17:02:56 +0000 (UTC) > Warner Losh mentioned: >=20 > > Author: imp > > Date: Thu May 12 17:02:56 2011 > > New Revision: 221816 > > URL: http://svn.freebsd.org/changeset/base/221816 > >=20 > > Log: > > Fix printf int mismatch on 32-bit architectures... > >=20 >=20 > Thanks a lot! > Apparently I did `make universe` in the wrong tree... Sure... :) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --82I3+IH0IqGh5yIs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk3MW/EACgkQForvXbEpPzSC3ACguc07vbeccB8Njxkr8P4tja9H DVMAnRwxtkKK+Mp+H2pBxMitDtFRLirp =8p5r -----END PGP SIGNATURE----- --82I3+IH0IqGh5yIs-- From owner-svn-src-head@FreeBSD.ORG Thu May 12 22:21:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AEAB10656AD; Thu, 12 May 2011 22:21:40 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0ABB88FC0A; Thu, 12 May 2011 22:21:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CMLdX6052196; Thu, 12 May 2011 22:21:39 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CMLdSo052193; Thu, 12 May 2011 22:21:39 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105122221.p4CMLdSo052193@svn.freebsd.org> From: Stanislav Sedov Date: Thu, 12 May 2011 22:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221824 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 22:21:40 -0000 Author: stas Date: Thu May 12 22:21:39 2011 New Revision: 221824 URL: http://svn.freebsd.org/changeset/base/221824 Log: - Don't try to build NWFS support module if NCP/IPX is disabled in the build. - Rename ZFS definition to LIBPROCSTAT_ZFS to be consistent with NWFS and to prevent possible collisions. Reported by: many Modified: head/lib/libprocstat/Makefile head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Thu May 12 21:30:46 2011 (r221823) +++ head/lib/libprocstat/Makefile Thu May 12 22:21:39 2011 (r221824) @@ -9,7 +9,6 @@ SRCS= cd9660.c \ libprocstat.c \ msdosfs.c \ ntfs.c \ - nwfs.c \ smbfs.c \ udf.c @@ -18,9 +17,14 @@ CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE SHLIB_MAJOR= 1 WITHOUT_MAN= yes +.if ${MK_NCP} != "no" +CFLAGS+= -DLIBPROCSTAT_NWFS +SRCS+= nwfs.c +.endif + # XXX This is a hack. .if ${MK_CDDL} != "no" -CFLAGS+= -DZFS +CFLAGS+= -DLIBPROCSTAT_ZFS OBJS+= zfs/zfs.o SOBJS+= zfs/zfs.So POBJS+= zfs/zfs.po Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu May 12 21:30:46 2011 (r221823) +++ head/lib/libprocstat/libprocstat.c Thu May 12 22:21:39 2011 (r221824) @@ -873,11 +873,13 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s FSTYPE(msdosfs), FSTYPE(nfs), FSTYPE(ntfs), +#ifdef LIBPROCSTAT_NWFS FSTYPE(nwfs), +#endif FSTYPE(smbfs), FSTYPE(udf), FSTYPE(ufs), -#ifdef ZFS +#ifdef LIBPROCSTAT_ZFS FSTYPE(zfs), #endif }; From owner-svn-src-head@FreeBSD.ORG Thu May 12 22:31:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8102106564A; Thu, 12 May 2011 22:31:13 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B782C8FC21; Thu, 12 May 2011 22:31:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CMVDfI052411; Thu, 12 May 2011 22:31:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CMVD3W052409; Thu, 12 May 2011 22:31:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201105122231.p4CMVD3W052409@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 12 May 2011 22:31:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221825 - head/release/powerpc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 22:31:14 -0000 Author: nwhitehorn Date: Thu May 12 22:31:13 2011 New Revision: 221825 URL: http://svn.freebsd.org/changeset/base/221825 Log: Fix pSeries/PAPR boot CD construction after actual testing. It seems that IBM SLOF is (a) case-sensitive and (b) accepts only booting files in certain subdirectories of the CD. Modified: head/release/powerpc/mkisoimages.sh Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Thu May 12 22:21:39 2011 (r221824) +++ head/release/powerpc/mkisoimages.sh Thu May 12 22:31:13 2011 (r221825) @@ -34,17 +34,15 @@ if [ "x$1" = "x-b" ]; then bootable="-o bootimage=macppc;/tmp/hfs-boot-block -o no-emul-boot" # pSeries/PAPR boot code - mkdir $4/ppc + mkdir -p $4/ppc/chrp + cp $4/boot/loader $4/ppc/chrp cat > $4/ppc/bootinfo.txt << EOF - -FreeBSD/powerpc -FreeBSD - -boot &device;:&partition;,\boot\loader &device;:0 - - + +FreeBSD Install +FreeBSD +boot &device;:&partition;,\ppc\chrp\loader + EOF - shift else bootable="" From owner-svn-src-head@FreeBSD.ORG Thu May 12 23:26:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28E69106564A; Thu, 12 May 2011 23:26:54 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17BC08FC17; Thu, 12 May 2011 23:26:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4CNQrUx053535; Thu, 12 May 2011 23:26:53 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4CNQrXa053532; Thu, 12 May 2011 23:26:53 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201105122326.p4CNQrXa053532@svn.freebsd.org> From: David Christensen Date: Thu, 12 May 2011 23:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221826 - head/sys/dev/bxe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2011 23:26:54 -0000 Author: davidch Date: Thu May 12 23:26:53 2011 New Revision: 221826 URL: http://svn.freebsd.org/changeset/base/221826 Log: - Use bus_describe_intr() to describe interrupt usage. - Use bus_bind_intr() to bind interrupt to a CPU when RSS/TSS is used. - Use M_DONTWAIT for RSS/TSS buffer allocation. - Add statistic to track max DRBR queue depth. - Fix problem in bxe_change_mtu() which referenced the old MTU size in a debug print statement. MFC after: Two weeks Modified: head/sys/dev/bxe/if_bxe.c head/sys/dev/bxe/if_bxe.h Modified: head/sys/dev/bxe/if_bxe.c ============================================================================== --- head/sys/dev/bxe/if_bxe.c Thu May 12 22:31:13 2011 (r221825) +++ head/sys/dev/bxe/if_bxe.c Thu May 12 23:26:53 2011 (r221826) @@ -1330,9 +1330,9 @@ bxe_interrupt_attach(struct bxe_softc *s /* Setup the slowpath deferred task queue. */ TASK_INIT(&sc->task, 0, bxe_task_sp, sc); sc->tq = taskqueue_create_fast("bxe_spq", M_NOWAIT, - taskqueue_thread_enqueue, &sc->tq); + taskqueue_thread_enqueue, &sc->tq); taskqueue_start_threads(&sc->tq, 1, PI_NET, "%s spq", - device_get_nameunit(sc->dev)); + device_get_nameunit(sc->dev)); #endif /* Setup interrupt handlers. */ @@ -1359,13 +1359,19 @@ bxe_interrupt_attach(struct bxe_softc *s goto bxe_interrupt_attach_exit; } +#if __FreeBSD_version >= 800504 + bus_describe_intr(sc->dev, + sc->bxe_msix_res[0], + sc->bxe_msix_tag[0], + "sp"); +#endif + /* Now initialize the fastpath vectors. */ for (i = 0; i < (sc->num_queues); i++) { fp = &sc->fp[i]; - DBPRINT(sc, - (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR), - "%s(): Enabling MSI-X[%d] vector.\n", - __FUNCTION__, i + 1); + DBPRINT(sc, (BXE_VERBOSE_LOAD | BXE_VERBOSE_INTR), + "%s(): Enabling MSI-X[%d] vector.\n", + __FUNCTION__, i + 1); /* * Setup the interrupt handler. Note that we pass the * fastpath context to the interrupt handler in this @@ -1377,8 +1383,7 @@ bxe_interrupt_attach(struct bxe_softc *s NULL, bxe_intr_fp, fp, - &sc->bxe_msix_tag[i + 1] - ); + &sc->bxe_msix_tag[i + 1]); if (rc) { BXE_PRINTF( @@ -1386,6 +1391,21 @@ bxe_interrupt_attach(struct bxe_softc *s __FILE__, __LINE__, (i + 1)); goto bxe_interrupt_attach_exit; } + +#if __FreeBSD_version >= 800504 + bus_describe_intr(sc->dev, + sc->bxe_msix_res[i + 1], + sc->bxe_msix_tag[i + 1], + "fp[%02d]", + i); +#endif + + /* Bind the fastpath instance to a CPU. */ + if (sc->num_queues > 1) { + bus_bind_intr(sc->dev, + sc->bxe_msix_res[i + 1], i); + } + #ifdef BXE_TASK TASK_INIT(&fp->task, 0, bxe_task_fp, fp); fp->tq = taskqueue_create_fast("bxe_fpq", M_NOWAIT, @@ -1418,6 +1438,13 @@ bxe_interrupt_attach(struct bxe_softc *s goto bxe_interrupt_attach_exit; } +#if __FreeBSD_version >= 800504 + bus_describe_intr(sc->dev, + sc->bxe_msi_res[0], + sc->bxe_msi_tag[0], + "sp"); +#endif + /* Now initialize the fastpath vectors. */ for (i = 0; i < (sc->num_queues); i++) { fp = &sc->fp[i]; @@ -1445,6 +1472,15 @@ bxe_interrupt_attach(struct bxe_softc *s __FILE__, __LINE__, (i + 1)); goto bxe_interrupt_attach_exit; } + +#if __FreeBSD_version >= 800504 + bus_describe_intr(sc->dev, + sc->bxe_msi_res[i + 1], + sc->bxe_msi_tag[i + 1], + "fp[%02d]", + i); +#endif + #ifdef BXE_TASK TASK_INIT(&fp->task, 0, bxe_task_fp, fp); fp->tq = taskqueue_create_fast("bxe_fpq", M_NOWAIT, @@ -3646,7 +3682,7 @@ bxe_alloc_buf_rings(struct bxe_softc *sc if (fp != NULL) { fp->br = buf_ring_alloc(BXE_BR_SIZE, - M_DEVBUF, M_WAITOK, &fp->mtx); + M_DEVBUF, M_DONTWAIT, &fp->mtx); if (fp->br == NULL) { rc = ENOMEM; return(rc); @@ -9404,7 +9440,7 @@ bxe_tx_mq_start_exit: /* - * Multiqueue (RSS) transmit routine. + * Multiqueue (TSS) transmit routine. * * Returns: * 0 if transmit succeeds, !0 otherwise. @@ -9415,14 +9451,18 @@ bxe_tx_mq_start_locked(struct ifnet *ifp { struct bxe_softc *sc; struct mbuf *next; - int rc = 0, tx_count = 0; + int depth, rc = 0, tx_count = 0; sc = fp->sc; DBENTER(BXE_EXTREME_SEND); + depth = drbr_inuse(ifp, fp->br); + if (depth > fp->max_drbr_queue_depth) { + fp->max_drbr_queue_depth = depth; + } DBPRINT(sc, BXE_EXTREME_SEND, "%s(): fp[%02d], drbr queue depth=%d\n", - __FUNCTION__, fp->index, drbr_inuse(ifp, fp->br)); + __FUNCTION__, fp->index, depth); BXE_FP_LOCK_ASSERT(fp); @@ -10509,11 +10549,11 @@ bxe_alloc_mbuf(struct bxe_fastpath *fp, /* Check whether the allocation succeeded and handle a failure. */ if (__predict_false(m_new == NULL)) { - DBPRINT(sc, BXE_WARN, "%s(): mbuf allocation failure!\n", - __FUNCTION__); + DBPRINT(sc, BXE_WARN, "%s(): Failed to allocate %d byte " + "mbuf on fp[%02d]!\n", __FUNCTION__, size, fp->index); fp->mbuf_alloc_failed++; - goto bxe_alloc_mbuf_exit; - } + goto bxe_alloc_mbuf_exit; + } /* Do a little extra error checking when debugging. */ DBRUN(M_ASSERTPKTHDR(m_new)); @@ -10556,7 +10596,7 @@ bxe_map_mbuf(struct bxe_fastpath *fp, st __FUNCTION__); sc->debug_mbuf_sim_map_failed++; fp->mbuf_alloc_failed++; - DBRUN(sc->debug_memory_allocated -= m->m_len); + sc->debug_memory_allocated -= m->m_len; m_freem(m); rc = EINVAL; goto bxe_map_mbuf_exit; @@ -10568,10 +10608,11 @@ bxe_map_mbuf(struct bxe_fastpath *fp, st /* Handle any mapping errors. */ if (__predict_false(rc)) { - DBPRINT(sc, BXE_WARN, "%s(): mbuf mapping failure (%d)!\n", - __FUNCTION__, rc); - m_freem(m); + DBPRINT(sc, BXE_WARN, "%s(): mbuf mapping failure (%d) on " + "fp[%02d]!\n", __FUNCTION__, rc, fp->index); fp->mbuf_alloc_failed++; + DBRUN(sc->debug_memory_allocated -= m->m_len); + m_freem(m); goto bxe_map_mbuf_exit; } @@ -10583,6 +10624,7 @@ bxe_map_mbuf(struct bxe_fastpath *fp, st *seg = segs[0]; bxe_map_mbuf_exit: + DBEXIT(BXE_INSANE); return (rc); } @@ -10961,6 +11003,19 @@ bxe_init_rx_chains(struct bxe_softc *sc) } } + /* + * ToDo: Need a cleanup path if memory allocation + * fails during initializtion. This is especially + * easy if multiqueue is used on a system with + * jumbo frames and many CPUs. On my 16GB system + * with 8 CPUs I get the following defaults: + * + * kern.ipc.nmbjumbo16: 3200 + * kern.ipc.nmbjumbo9: 6400 + * kern.ipc.nmbjumbop: 12800 + * kern.ipc.nmbclusters: 25600 + */ + DBEXIT(BXE_VERBOSE_LOAD | BXE_VERBOSE_RESET); } @@ -15554,7 +15609,7 @@ bxe_txeof(struct bxe_fastpath *fp) #endif txbd = - &fp->tx_bd_chain[TX_PAGE(sw_tx_chain_cons)][TX_IDX(sw_tx_chain_cons)].start_bd; +&fp->tx_bd_chain[TX_PAGE(sw_tx_chain_cons)][TX_IDX(sw_tx_chain_cons)].start_bd; #ifdef BXE_DEBUG if (txbd == NULL) { @@ -15764,7 +15819,7 @@ bxe_change_mtu(struct bxe_softc *sc, int sc->bxe_ifp->if_mtu = ifp->if_mtu; if (if_drv_running) { DBPRINT(sc, BXE_INFO_IOCTL, "%s(): Changing the MTU to %d.\n", - __FUNCTION__, sc->port.ether_mtu); + __FUNCTION__, sc->bxe_ifp->if_mtu); bxe_stop_locked(sc, UNLOAD_NORMAL); bxe_init_locked(sc, LOAD_NORMAL); @@ -16315,6 +16370,12 @@ bxe_add_sysctls(struct bxe_softc *sc) "tx_chain_lost_mbuf", CTLFLAG_RD, &fp->tx_chain_lost_mbuf, "Mbufs lost on TX chain count"); + + SYSCTL_ADD_INT(ctx, queue_list, OID_AUTO, + "max_drbr_queue_depth", + CTLFLAG_RD, &fp->max_drbr_queue_depth, + 0, "Driver queue maximum dpeth"); + #ifdef BXE_DEBUG SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "null_cqe_flags", Modified: head/sys/dev/bxe/if_bxe.h ============================================================================== --- head/sys/dev/bxe/if_bxe.h Thu May 12 22:31:13 2011 (r221825) +++ head/sys/dev/bxe/if_bxe.h Thu May 12 23:26:53 2011 (r221826) @@ -1110,6 +1110,8 @@ struct bxe_fastpath { int sge_mbuf_alloc; int tpa_mbuf_alloc; + int max_drbr_queue_depth; + uint64_t tpa_queue_used; unsigned long null_cqe_flags; @@ -1148,7 +1150,6 @@ struct bxe_fastpath { #define BXE_TX_CHAIN_PAGE_SZ BCM_PAGE_SIZE #define BXE_RX_CHAIN_PAGE_SZ BCM_PAGE_SIZE -/* ToDo: Audit this structure for unused varaibles. */ struct bxe_softc { struct ifnet *bxe_ifp; int media; From owner-svn-src-head@FreeBSD.ORG Fri May 13 03:40:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68F54106566B; Fri, 13 May 2011 03:40:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58DB28FC0A; Fri, 13 May 2011 03:40:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4D3eHCq058711; Fri, 13 May 2011 03:40:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4D3eHuk058709; Fri, 13 May 2011 03:40:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201105130340.p4D3eHuk058709@svn.freebsd.org> From: Alexander Motin Date: Fri, 13 May 2011 03:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221827 - head/sys/dev/xen/balloon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 03:40:17 -0000 Author: mav Date: Fri May 13 03:40:16 2011 New Revision: 221827 URL: http://svn.freebsd.org/changeset/base/221827 Log: Fix msleep() usage in Xen balloon driver to not wake up on every HZ tick. Modified: head/sys/dev/xen/balloon/balloon.c Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Thu May 12 23:26:53 2011 (r221826) +++ head/sys/dev/xen/balloon/balloon.c Fri May 13 03:40:16 2011 (r221827) @@ -147,12 +147,6 @@ balloon_retrieve(void) return page; } -static void -balloon_alarm(void *unused) -{ - wakeup(balloon_process); -} - static unsigned long current_target(void) { @@ -378,6 +372,8 @@ balloon_process(void *unused) mtx_lock(&balloon_mutex); for (;;) { + int sleep_time; + do { credit = current_target() - bs.current_pages; if (credit > 0) @@ -389,9 +385,12 @@ balloon_process(void *unused) /* Schedule more work if there is some still to be done. */ if (current_target() != bs.current_pages) - timeout(balloon_alarm, NULL, ticks + hz); + sleep_time = hz; + else + sleep_time = 0; - msleep(balloon_process, &balloon_mutex, 0, "balloon", -1); + msleep(balloon_process, &balloon_mutex, 0, "balloon", + sleep_time); } mtx_unlock(&balloon_mutex); } @@ -474,9 +473,6 @@ balloon_init(void *arg) bs.hard_limit = ~0UL; kproc_create(balloon_process, NULL, NULL, 0, 0, "balloon"); -// init_timer(&balloon_timer); -// balloon_timer.data = 0; -// balloon_timer.function = balloon_alarm; #ifndef XENHVM /* Initialise the balloon with excess memory space. */ From owner-svn-src-head@FreeBSD.ORG Fri May 13 05:27:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11C7106566C; Fri, 13 May 2011 05:27:58 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE1978FC12; Fri, 13 May 2011 05:27:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4D5Rwfq060923; Fri, 13 May 2011 05:27:58 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4D5RwSk060914; Fri, 13 May 2011 05:27:58 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201105130527.p4D5RwSk060914@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 13 May 2011 05:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221829 - in head/sys: kern sys ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 05:27:59 -0000 Author: mdf Date: Fri May 13 05:27:58 2011 New Revision: 221829 URL: http://svn.freebsd.org/changeset/base/221829 Log: Use a name instead of a magic number for kern_yield(9) when the priority should not change. Fetch the td_user_pri under the thread lock. This is probably not necessary but a magic number also seems preferable to knowing the implementation details here. Requested by: Jason Behmer < jason DOT behmer AT isilon DOT com > Modified: head/sys/kern/kern_synch.c head/sys/kern/kern_sysctl.c head/sys/kern/vfs_bio.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_vnops.c head/sys/sys/priority.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/kern/kern_synch.c Fri May 13 05:27:58 2011 (r221829) @@ -551,7 +551,7 @@ maybe_yield(void) { if (should_yield()) - kern_yield(curthread->td_user_pri); + kern_yield(PRI_USER); } void @@ -562,6 +562,8 @@ kern_yield(int prio) td = curthread; DROP_GIANT(); thread_lock(td); + if (prio == PRI_USER) + prio = td->td_user_pri; if (prio >= 0) sched_prio(td, prio); mi_switch(SW_VOL | SWT_RELINQUISH, NULL); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/kern/kern_sysctl.c Fri May 13 05:27:58 2011 (r221829) @@ -1590,7 +1590,7 @@ userland_sysctl(struct thread *td, int * SYSCTL_XUNLOCK(); if (error != EAGAIN) break; - kern_yield(curthread->td_user_pri); + kern_yield(PRI_USER); } CURVNET_RESTORE(); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/kern/vfs_bio.c Fri May 13 05:27:58 2011 (r221829) @@ -2234,7 +2234,7 @@ buf_daemon() while (numdirtybuffers > lodirtybuffers) { if (buf_do_flush(NULL) == 0) break; - kern_yield(-1); + kern_yield(PRI_UNCHANGED); } lodirtybuffers = lodirtysave; Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/kern/vfs_mount.c Fri May 13 05:27:58 2011 (r221829) @@ -1644,7 +1644,7 @@ __mnt_vnode_next(struct vnode **mvp, str KASSERT((*mvp)->v_mount == mp, ("marker vnode mount list mismatch")); if (should_yield()) { MNT_IUNLOCK(mp); - kern_yield(-1); + kern_yield(PRI_UNCHANGED); MNT_ILOCK(mp); } vp = TAILQ_NEXT(*mvp, v_nmntvnodes); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/kern/vfs_subr.c Fri May 13 05:27:58 2011 (r221829) @@ -718,7 +718,7 @@ next_iter: continue; MNT_IUNLOCK(mp); yield: - kern_yield(-1); + kern_yield(PRI_UNCHANGED); relock_mnt: MNT_ILOCK(mp); } @@ -831,7 +831,7 @@ vnlru_proc(void) vnlru_nowhere++; tsleep(vnlruproc, PPAUSE, "vlrup", hz * 3); } else - kern_yield(-1); + kern_yield(PRI_UNCHANGED); } } Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/kern/vfs_vnops.c Fri May 13 05:27:58 2011 (r221829) @@ -491,7 +491,7 @@ vn_rdwr_inchunks(rw, vp, base, len, offs break; offset += chunk; base = (char *)base + chunk; - kern_yield(curthread->td_user_pri); + kern_yield(PRI_USER); } while (len); if (aresid) *aresid = len + iaresid; Modified: head/sys/sys/priority.h ============================================================================== --- head/sys/sys/priority.h Fri May 13 04:54:01 2011 (r221828) +++ head/sys/sys/priority.h Fri May 13 05:27:58 2011 (r221829) @@ -117,6 +117,12 @@ #define PRI_MIN_IDLE (224) #define PRI_MAX_IDLE (PRI_MAX) +#ifdef _KERNEL +/* Other arguments for kern_yield(9). */ +#define PRI_USER -2 /* Change to current user priority. */ +#define PRI_UNCHANGED -1 /* Do not change priority. */ +#endif + struct priority { u_char pri_class; /* Scheduling class. */ u_char pri_level; /* Normal priority level. */ Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri May 13 04:54:01 2011 (r221828) +++ head/sys/ufs/ffs/ffs_softdep.c Fri May 13 05:27:58 2011 (r221829) @@ -1412,7 +1412,7 @@ softdep_process_worklist(mp, full) */ if (should_yield()) { FREE_LOCK(&lk); - kern_yield(-1); + kern_yield(PRI_UNCHANGED); bwillwrite(); ACQUIRE_LOCK(&lk); } From owner-svn-src-head@FreeBSD.ORG Fri May 13 07:21:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B0DB1065673; Fri, 13 May 2011 07:21:43 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB7D58FC1A; Fri, 13 May 2011 07:21:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4D7LfuR063132; Fri, 13 May 2011 07:21:41 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4D7LfIM063129; Fri, 13 May 2011 07:21:41 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201105130721.p4D7LfIM063129@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 13 May 2011 07:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221830 - head/lib/libfetch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 07:21:43 -0000 Author: des Date: Fri May 13 07:21:41 2011 New Revision: 221830 URL: http://svn.freebsd.org/changeset/base/221830 Log: Mark all socket and file descriptors close-on-exec. PR: bin/151866 MFC after: 3 weeks Modified: head/lib/libfetch/common.c head/lib/libfetch/file.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Fri May 13 05:27:58 2011 (r221829) +++ head/lib/libfetch/common.c Fri May 13 07:21:41 2011 (r221830) @@ -213,6 +213,7 @@ fetch_reopen(int sd) /* allocate and fill connection structure */ if ((conn = calloc(1, sizeof(*conn))) == NULL) return (NULL); + fcntl(sd, F_SETFD, FD_CLOEXEC); conn->sd = sd; ++conn->ref; return (conn); Modified: head/lib/libfetch/file.c ============================================================================== --- head/lib/libfetch/file.c Fri May 13 05:27:58 2011 (r221829) +++ head/lib/libfetch/file.c Fri May 13 07:21:41 2011 (r221830) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -57,6 +58,7 @@ fetchXGetFile(struct url *u, struct url_ fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } @@ -84,6 +86,7 @@ fetchPutFile(struct url *u, const char * fetch_syserr(); } + fcntl(fileno(f), F_SETFD, FD_CLOEXEC); return (f); } From owner-svn-src-head@FreeBSD.ORG Fri May 13 09:55:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6F8106566B; Fri, 13 May 2011 09:55:49 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DC338FC16; Fri, 13 May 2011 09:55:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4D9tnuA066092; Fri, 13 May 2011 09:55:49 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4D9tnYw066090; Fri, 13 May 2011 09:55:49 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201105130955.p4D9tnYw066090@svn.freebsd.org> From: Ruslan Ermilov Date: Fri, 13 May 2011 09:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221832 - head/usr.bin/mkuzip X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 09:55:49 -0000 Author: ru Date: Fri May 13 09:55:48 2011 New Revision: 221832 URL: http://svn.freebsd.org/changeset/base/221832 Log: Fixed an embedded shell script. Reviewed by: sobomax Modified: head/usr.bin/mkuzip/mkuzip.c Modified: head/usr.bin/mkuzip/mkuzip.c ============================================================================== --- head/usr.bin/mkuzip/mkuzip.c Fri May 13 09:52:04 2011 (r221831) +++ head/usr.bin/mkuzip/mkuzip.c Fri May 13 09:55:48 2011 (r221832) @@ -31,7 +31,7 @@ #define CLOOP_MAGIC_LEN 128 static char CLOOP_MAGIC_START[] = "#!/bin/sh\n#V2.0 Format\n" - "m=geom_uzip\n(kldstat -m $m 2>&-||kldload $m)>&-&&" + "(kldstat -qm g_uzip||kldload geom_uzip)>&-&&" "mount_cd9660 /dev/`mdconfig -af $0`.uzip $1\nexit $?\n"; static char *readblock(int, char *, u_int32_t); From owner-svn-src-head@FreeBSD.ORG Fri May 13 09:57:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F163106566C; Fri, 13 May 2011 09:57:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84CC98FC17; Fri, 13 May 2011 09:57:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4D9vCMu066170; Fri, 13 May 2011 09:57:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4D9vCBK066168; Fri, 13 May 2011 09:57:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105130957.p4D9vCBK066168@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 May 2011 09:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221833 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 09:57:12 -0000 Author: adrian Date: Fri May 13 09:57:12 2011 New Revision: 221833 URL: http://svn.freebsd.org/changeset/base/221833 Log: Some diversity changes relating to AR9285. * grab the main, alt and selected LNA config * add some optional / disabled logging code * add a check to reject packets with an invalid main rssi too, in case the alt is the active receive chain and main is -ve. Note: The software-controlled combined diversity code is still disabled. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Fri May 13 09:55:48 2011 (r221832) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c Fri May 13 09:57:12 2011 (r221833) @@ -368,27 +368,32 @@ ar9285_ant_comb_scan(struct ath_hal *ah, int curr_main_set, curr_bias; int main_rssi = rs->rs_rssi_ctl[0]; int alt_rssi = rs->rs_rssi_ctl[1]; - int rx_ant_conf, main_ant_conf; + int rx_ant_conf, main_ant_conf, alt_ant_conf; HAL_BOOL short_scan = AH_FALSE; + rx_ant_conf = (rs->rs_rssi_ctl[2] >> 4) & ATH_ANT_RX_MASK; + main_ant_conf = (rs->rs_rssi_ctl[2] >> 2) & ATH_ANT_RX_MASK; + alt_ant_conf = (rs->rs_rssi_ctl[2] >> 0) & ATH_ANT_RX_MASK; + +#if 0 + HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: RSSI %d/%d, conf %x/%x, rxconf %x, LNA: %d; ANT: %d; FastDiv: %d\n", + __func__, main_rssi, alt_rssi, main_ant_conf,alt_ant_conf, rx_ant_conf, + !!(rs->rs_rssi_ctl[2] & 0x80), !!(rs->rs_rssi_ctl[2] & 0x40), !!(rs->rs_rssi_ext[2] & 0x40)); +#endif + if (! ar9285_check_div_comb(ah)) return; if (AH5212(ah)->ah_diversity == AH_FALSE) return; - rx_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_CURRENT_SHIFT) & - ATH_ANT_RX_MASK; - main_ant_conf = (rs->rs_rssi_ctl[2] >> ATH_ANT_RX_MAIN_SHIFT) & - ATH_ANT_RX_MASK; - #if 0 HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main: %d, alt: %d, rx_ant_conf: %x, main_ant_conf: %x\n", __func__, main_rssi, alt_rssi, rx_ant_conf, main_ant_conf); #endif /* Record packet only when alt_rssi is positive */ - if (alt_rssi > 0) { + if (main_rssi > 0 && alt_rssi > 0) { antcomb->total_pkt_count++; antcomb->main_total_rssi += main_rssi; antcomb->alt_total_rssi += alt_rssi; @@ -613,13 +618,13 @@ div_comb_done: HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: alt_recv_cnt=%d\n", __func__, antcomb->alt_recv_cnt); - if (curr_alt_set != div_ant_conf.alt_lna_conf) +// if (curr_alt_set != div_ant_conf.alt_lna_conf) HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: lna_conf: %x -> %x\n", __func__, curr_alt_set, div_ant_conf.alt_lna_conf); - if (curr_main_set != div_ant_conf.main_lna_conf) +// if (curr_main_set != div_ant_conf.main_lna_conf) HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: main_lna_conf: %x -> %x\n", __func__, curr_main_set, div_ant_conf.main_lna_conf); - if (curr_bias != div_ant_conf.fast_div_bias) +// if (curr_bias != div_ant_conf.fast_div_bias) HALDEBUG(ah, HAL_DEBUG_DIVERSITY, "%s: fast_div_bias: %x -> %x\n", __func__, curr_bias, div_ant_conf.fast_div_bias); From owner-svn-src-head@FreeBSD.ORG Fri May 13 10:36:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 282B81065676; Fri, 13 May 2011 10:36:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 171528FC17; Fri, 13 May 2011 10:36:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DAacQO068721; Fri, 13 May 2011 10:36:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DAac1o068717; Fri, 13 May 2011 10:36:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105131036.p4DAac1o068717@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 May 2011 10:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221834 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 10:36:39 -0000 Author: adrian Date: Fri May 13 10:36:38 2011 New Revision: 221834 URL: http://svn.freebsd.org/changeset/base/221834 Log: Remove duplicate code - add a function which calculates the ratesArray[] table which contains the per-rate target TX power. This code is shared between the v14 eeprom board setup (AR5416, AR9160, AR9280) and will also be used by the upcoming Kite (AR9287) support. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri May 13 09:57:12 2011 (r221833) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri May 13 10:36:38 2011 (r221834) @@ -237,6 +237,15 @@ extern HAL_BOOL ar5416GetChipPowerLimits struct ieee80211_channel *chan); extern void ar5416GetChannelCenters(struct ath_hal *, const struct ieee80211_channel *chan, CHAN_CENTERS *centers); +extern void ar5416SetRatesArrayFromTargetPower(struct ath_hal *ah, + const struct ieee80211_channel *chan, + int16_t *ratesArray, + const CAL_TARGET_POWER_LEG *targetPowerCck, + const CAL_TARGET_POWER_LEG *targetPowerCckExt, + const CAL_TARGET_POWER_LEG *targetPowerOfdm, + const CAL_TARGET_POWER_LEG *targetPowerOfdmExt, + const CAL_TARGET_POWER_HT *targetPowerHt20, + const CAL_TARGET_POWER_HT *targetPowerHt40); extern void ar5416GetTargetPowers(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_TARGET_POWER_HT *powInfo, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Fri May 13 09:57:12 2011 (r221833) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Fri May 13 10:36:38 2011 (r221834) @@ -1635,6 +1635,63 @@ ar5416SetBoardValues(struct ath_hal *ah, */ /* + * Set the target power array "ratesArray" from the + * given set of target powers. + * + * This is used by the various chipset/EEPROM TX power + * setup routines. + */ +void +ar5416SetRatesArrayFromTargetPower(struct ath_hal *ah, + const struct ieee80211_channel *chan, + int16_t *ratesArray, + const CAL_TARGET_POWER_LEG *targetPowerCck, + const CAL_TARGET_POWER_LEG *targetPowerCckExt, + const CAL_TARGET_POWER_LEG *targetPowerOfdm, + const CAL_TARGET_POWER_LEG *targetPowerOfdmExt, + const CAL_TARGET_POWER_HT *targetPowerHt20, + const CAL_TARGET_POWER_HT *targetPowerHt40) +{ +#define N(a) (sizeof(a)/sizeof(a[0])) + int i; + + /* Blank the rates array, to be consistent */ + for (i = 0; i < Ar5416RateSize; i++) + ratesArray[i] = 0; + + /* Set rates Array from collected data */ + ratesArray[rate6mb] = ratesArray[rate9mb] = ratesArray[rate12mb] = + ratesArray[rate18mb] = ratesArray[rate24mb] = targetPowerOfdm->tPow2x[0]; + ratesArray[rate36mb] = targetPowerOfdm->tPow2x[1]; + ratesArray[rate48mb] = targetPowerOfdm->tPow2x[2]; + ratesArray[rate54mb] = targetPowerOfdm->tPow2x[3]; + ratesArray[rateXr] = targetPowerOfdm->tPow2x[0]; + + for (i = 0; i < N(targetPowerHt20->tPow2x); i++) { + ratesArray[rateHt20_0 + i] = targetPowerHt20->tPow2x[i]; + } + + if (IEEE80211_IS_CHAN_2GHZ(chan)) { + ratesArray[rate1l] = targetPowerCck->tPow2x[0]; + ratesArray[rate2s] = ratesArray[rate2l] = targetPowerCck->tPow2x[1]; + ratesArray[rate5_5s] = ratesArray[rate5_5l] = targetPowerCck->tPow2x[2]; + ratesArray[rate11s] = ratesArray[rate11l] = targetPowerCck->tPow2x[3]; + } + if (IEEE80211_IS_CHAN_HT40(chan)) { + for (i = 0; i < N(targetPowerHt40->tPow2x); i++) { + ratesArray[rateHt40_0 + i] = targetPowerHt40->tPow2x[i]; + } + ratesArray[rateDupOfdm] = targetPowerHt40->tPow2x[0]; + ratesArray[rateDupCck] = targetPowerHt40->tPow2x[0]; + ratesArray[rateExtOfdm] = targetPowerOfdmExt->tPow2x[0]; + if (IEEE80211_IS_CHAN_2GHZ(chan)) { + ratesArray[rateExtCck] = targetPowerCckExt->tPow2x[0]; + } + } +#undef N +} + +/* * ar5416SetPowerPerRateTable * * Sets the transmit power in the baseband for the given @@ -1855,33 +1912,13 @@ ar5416SetPowerPerRateTable(struct ath_ha } /* end ctl mode checking */ /* Set rates Array from collected data */ - ratesArray[rate6mb] = ratesArray[rate9mb] = ratesArray[rate12mb] = ratesArray[rate18mb] = ratesArray[rate24mb] = targetPowerOfdm.tPow2x[0]; - ratesArray[rate36mb] = targetPowerOfdm.tPow2x[1]; - ratesArray[rate48mb] = targetPowerOfdm.tPow2x[2]; - ratesArray[rate54mb] = targetPowerOfdm.tPow2x[3]; - ratesArray[rateXr] = targetPowerOfdm.tPow2x[0]; - - for (i = 0; i < N(targetPowerHt20.tPow2x); i++) { - ratesArray[rateHt20_0 + i] = targetPowerHt20.tPow2x[i]; - } - - if (IEEE80211_IS_CHAN_2GHZ(chan)) { - ratesArray[rate1l] = targetPowerCck.tPow2x[0]; - ratesArray[rate2s] = ratesArray[rate2l] = targetPowerCck.tPow2x[1]; - ratesArray[rate5_5s] = ratesArray[rate5_5l] = targetPowerCck.tPow2x[2]; - ratesArray[rate11s] = ratesArray[rate11l] = targetPowerCck.tPow2x[3]; - } - if (IEEE80211_IS_CHAN_HT40(chan)) { - for (i = 0; i < N(targetPowerHt40.tPow2x); i++) { - ratesArray[rateHt40_0 + i] = targetPowerHt40.tPow2x[i]; - } - ratesArray[rateDupOfdm] = targetPowerHt40.tPow2x[0]; - ratesArray[rateDupCck] = targetPowerHt40.tPow2x[0]; - ratesArray[rateExtOfdm] = targetPowerOfdmExt.tPow2x[0]; - if (IEEE80211_IS_CHAN_2GHZ(chan)) { - ratesArray[rateExtCck] = targetPowerCckExt.tPow2x[0]; - } - } + ar5416SetRatesArrayFromTargetPower(ah, chan, ratesArray, + &targetPowerCck, + &targetPowerCckExt, + &targetPowerOfdm, + &targetPowerOfdmExt, + &targetPowerHt20, + &targetPowerHt40); return AH_TRUE; #undef EXT_ADDITIVE #undef CTL_11A_EXT Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Fri May 13 09:57:12 2011 (r221833) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Fri May 13 10:36:38 2011 (r221834) @@ -533,32 +533,15 @@ ar9285SetPowerPerRateTable(struct ath_ha } } /* end ctl mode checking */ - /* Set rates Array from collected data */ - ratesArray[rate6mb] = ratesArray[rate9mb] = ratesArray[rate12mb] = ratesArray[rate18mb] = ratesArray[rate24mb] = targetPowerOfdm.tPow2x[0]; - ratesArray[rate36mb] = targetPowerOfdm.tPow2x[1]; - ratesArray[rate48mb] = targetPowerOfdm.tPow2x[2]; - ratesArray[rate54mb] = targetPowerOfdm.tPow2x[3]; - ratesArray[rateXr] = targetPowerOfdm.tPow2x[0]; - - for (i = 0; i < N(targetPowerHt20.tPow2x); i++) { - ratesArray[rateHt20_0 + i] = targetPowerHt20.tPow2x[i]; - } - - ratesArray[rate1l] = targetPowerCck.tPow2x[0]; - ratesArray[rate2s] = ratesArray[rate2l] = targetPowerCck.tPow2x[1]; - ratesArray[rate5_5s] = ratesArray[rate5_5l] = targetPowerCck.tPow2x[2]; - ratesArray[rate11s] = ratesArray[rate11l] = targetPowerCck.tPow2x[3]; - if (IEEE80211_IS_CHAN_HT40(chan)) { - for (i = 0; i < N(targetPowerHt40.tPow2x); i++) { - ratesArray[rateHt40_0 + i] = targetPowerHt40.tPow2x[i]; - } - ratesArray[rateDupOfdm] = targetPowerHt40.tPow2x[0]; - ratesArray[rateDupCck] = targetPowerHt40.tPow2x[0]; - ratesArray[rateExtOfdm] = targetPowerOfdmExt.tPow2x[0]; - if (IEEE80211_IS_CHAN_2GHZ(chan)) { - ratesArray[rateExtCck] = targetPowerCckExt.tPow2x[0]; - } - } + /* Set rates Array from collected data */ + ar5416SetRatesArrayFromTargetPower(ah, chan, ratesArray, + &targetPowerCck, + &targetPowerCckExt, + &targetPowerOfdm, + &targetPowerOfdmExt, + &targetPowerHt20, + &targetPowerHt40); + return AH_TRUE; #undef EXT_ADDITIVE #undef CTL_11G_EXT From owner-svn-src-head@FreeBSD.ORG Fri May 13 12:39:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4621E1065673; Fri, 13 May 2011 12:39:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 354BA8FC1A; Fri, 13 May 2011 12:39:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DCdc7m071152; Fri, 13 May 2011 12:39:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DCdccA071147; Fri, 13 May 2011 12:39:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201105131239.p4DCdccA071147@svn.freebsd.org> From: Alexander Motin Date: Fri, 13 May 2011 12:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221835 - in head/sys: i386/i386 i386/xen kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 12:39:38 -0000 Author: mav Date: Fri May 13 12:39:37 2011 New Revision: 221835 URL: http://svn.freebsd.org/changeset/base/221835 Log: Refactor Xen PV code to use new event timers subsystem. That uses one-shot Xen timer and time counter to provide one-shot and periodic time events. On my tests this reduces idle interruts rate down to about 30Hz, and accor- ding to Xen VM Manager reduces host CPU load by three times comparing to the previous periodic 100Hz clock. Also now, when needed, it is possible to increase HZ rate without useless CPU burning during idle periods. Now only ia64 and some ARMs left not migrated to the new event timers. Modified: head/sys/i386/i386/machdep.c head/sys/i386/xen/clock.c head/sys/i386/xen/mp_machdep.c head/sys/kern/kern_clocksource.c Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri May 13 10:36:38 2011 (r221834) +++ head/sys/i386/i386/machdep.c Fri May 13 12:39:37 2011 (r221835) @@ -1351,7 +1351,9 @@ void (*cpu_idle_fn)(int) = cpu_idle_acpi void cpu_idle(int busy) { +#ifndef XEN uint64_t msr; +#endif CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); @@ -1367,34 +1369,32 @@ cpu_idle(int busy) goto out; } } +#endif /* If we have time - switch timers into idle mode. */ if (!busy) { critical_enter(); cpu_idleclock(); } -#endif - /* Apply AMD APIC timer C1E workaround. */ - if (cpu_ident_amdc1e #ifndef XEN - && cpu_disable_deep_sleep -#endif - ) { + /* Apply AMD APIC timer C1E workaround. */ + if (cpu_ident_amdc1e && cpu_disable_deep_sleep) { msr = rdmsr(MSR_AMDK8_IPM); if (msr & AMDK8_CMPHALT) wrmsr(MSR_AMDK8_IPM, msr & ~AMDK8_CMPHALT); } +#endif /* Call main idle method. */ cpu_idle_fn(busy); -#ifndef XEN /* Switch timers mack into active mode. */ if (!busy) { cpu_activeclock(); critical_exit(); } +#ifndef XEN out: #endif CTR2(KTR_SPARE2, "cpu_idle(%d) at %d done", Modified: head/sys/i386/xen/clock.c ============================================================================== --- head/sys/i386/xen/clock.c Fri May 13 10:36:38 2011 (r221834) +++ head/sys/i386/xen/clock.c Fri May 13 12:39:37 2011 (r221835) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -301,38 +302,44 @@ static struct timecounter xen_timecounte 0 /* quality */ }; +static struct eventtimer xen_et; + +struct xen_et_state { + int mode; +#define MODE_STOP 0 +#define MODE_PERIODIC 1 +#define MODE_ONESHOT 2 + int64_t period; + int64_t next; +}; + +static DPCPU_DEFINE(struct xen_et_state, et_state); + static int clkintr(void *arg) { - int64_t delta_cpu, delta; - struct trapframe *frame = (struct trapframe *)arg; + int64_t now; int cpu = smp_processor_id(); struct shadow_time_info *shadow = &per_cpu(shadow_time, cpu); + struct xen_et_state *state = DPCPU_PTR(et_state); do { __get_time_values_from_xen(); - - delta = delta_cpu = - shadow->system_timestamp + get_nsec_offset(shadow); - delta -= processed_system_time; - delta_cpu -= per_cpu(processed_system_time, cpu); - + now = shadow->system_timestamp + get_nsec_offset(shadow); } while (!time_values_up_to_date(cpu)); - - if (unlikely(delta < (int64_t)0) || unlikely(delta_cpu < (int64_t)0)) { - printf("Timer ISR: Time went backwards: %lld\n", delta); - return (FILTER_HANDLED); - } - + /* Process elapsed ticks since last call. */ - while (delta >= NS_PER_TICK) { - delta -= NS_PER_TICK; - processed_system_time += NS_PER_TICK; - per_cpu(processed_system_time, cpu) += NS_PER_TICK; - if (PCPU_GET(cpuid) == 0) - hardclock(TRAPF_USERMODE(frame), TRAPF_PC(frame)); - else - hardclock_cpu(TRAPF_USERMODE(frame)); + processed_system_time = now; + if (state->mode == MODE_PERIODIC) { + while (now >= state->next) { + state->next += state->period; + if (xen_et.et_active) + xen_et.et_event_cb(&xen_et, xen_et.et_arg); + } + HYPERVISOR_set_timer_op(state->next + 50000); + } else if (state->mode == MODE_ONESHOT) { + if (xen_et.et_active) + xen_et.et_event_cb(&xen_et, xen_et.et_arg); } /* * Take synchronised time from Xen once a minute if we're not @@ -484,12 +491,14 @@ DELAY(int n) void timer_restore(void) { + struct xen_et_state *state = DPCPU_PTR(et_state); + /* Get timebases for new environment. */ __get_time_values_from_xen(); /* Reset our own concept of passage of system time. */ processed_system_time = per_cpu(shadow_time, 0).system_timestamp; - per_cpu(processed_system_time, 0) = processed_system_time; + state->next = processed_system_time; } void @@ -503,7 +512,6 @@ startrtclock() /* initialize xen values */ __get_time_values_from_xen(); processed_system_time = per_cpu(shadow_time, 0).system_timestamp; - per_cpu(processed_system_time, 0) = processed_system_time; __cpu_khz = 1000000ULL << 32; info = &HYPERVISOR_shared_info->vcpu_info[0].time; @@ -759,7 +767,49 @@ resettodr() } #endif -static struct vcpu_set_periodic_timer xen_set_periodic_tick; +static int +xen_et_start(struct eventtimer *et, + struct bintime *first, struct bintime *period) +{ + struct xen_et_state *state = DPCPU_PTR(et_state); + struct shadow_time_info *shadow; + int64_t fperiod; + + __get_time_values_from_xen(); + + if (period != NULL) { + state->mode = MODE_PERIODIC; + state->period = (1000000000LL * + (uint32_t)(period->frac >> 32)) >> 32; + if (period->sec != 0) + state->period += 1000000000LL * period->sec; + } else { + state->mode = MODE_ONESHOT; + state->period = 0; + } + if (first != NULL) { + fperiod = (1000000000LL * (uint32_t)(first->frac >> 32)) >> 32; + if (first->sec != 0) + fperiod += 1000000000LL * first->sec; + } else + fperiod = state->period; + + shadow = &per_cpu(shadow_time, smp_processor_id()); + state->next = shadow->system_timestamp + get_nsec_offset(shadow); + state->next += fperiod; + HYPERVISOR_set_timer_op(state->next + 50000); + return (0); +} + +static int +xen_et_stop(struct eventtimer *et) +{ + struct xen_et_state *state = DPCPU_PTR(et_state); + + state->mode = MODE_STOP; + HYPERVISOR_set_timer_op(0); + return (0); +} /* * Start clocks running. @@ -770,56 +820,48 @@ cpu_initclocks(void) unsigned int time_irq; int error; - xen_set_periodic_tick.period_ns = NS_PER_TICK; - - HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, 0, - &xen_set_periodic_tick); - - error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", - clkintr, NULL, NULL, - INTR_TYPE_CLK, &time_irq); + HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, 0, NULL); + error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "cpu0:timer", + clkintr, NULL, NULL, INTR_TYPE_CLK, &time_irq); if (error) panic("failed to register clock interrupt\n"); /* should fast clock be enabled ? */ - + + bzero(&xen_et, sizeof(xen_et)); + xen_et.et_name = "ixen"; + xen_et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | + ET_FLAGS_PERCPU; + xen_et.et_quality = 600; + xen_et.et_frequency = 0; + xen_et.et_min_period.sec = 0; + xen_et.et_min_period.frac = 0x00400000LL << 32; + xen_et.et_max_period.sec = 2; + xen_et.et_max_period.frac = 0; + xen_et.et_start = xen_et_start; + xen_et.et_stop = xen_et_stop; + xen_et.et_priv = NULL; + et_register(&xen_et); + + cpu_initclocks_bsp(); } int ap_cpu_initclocks(int cpu) { + char buf[MAXCOMLEN + 1]; unsigned int time_irq; int error; - xen_set_periodic_tick.period_ns = NS_PER_TICK; - - HYPERVISOR_vcpu_op(VCPUOP_set_periodic_timer, cpu, - &xen_set_periodic_tick); - error = bind_virq_to_irqhandler(VIRQ_TIMER, 0, "clk", - clkintr, NULL, NULL, - INTR_TYPE_CLK, &time_irq); + HYPERVISOR_vcpu_op(VCPUOP_stop_periodic_timer, cpu, NULL); + snprintf(buf, sizeof(buf), "cpu%d:timer", cpu); + error = bind_virq_to_irqhandler(VIRQ_TIMER, cpu, buf, + clkintr, NULL, NULL, INTR_TYPE_CLK, &time_irq); if (error) panic("failed to register clock interrupt\n"); - return (0); } - -void -cpu_startprofclock(void) -{ - - printf("cpu_startprofclock: profiling clock is not supported\n"); -} - -void -cpu_stopprofclock(void) -{ - - printf("cpu_stopprofclock: profiling clock is not supported\n"); -} -#define NSEC_PER_USEC 1000 - static uint32_t xen_get_timecount(struct timecounter *tc) { @@ -842,45 +884,11 @@ get_system_time(int ticks) return processed_system_time + (ticks * NS_PER_TICK); } -/* - * Track behavior of cur_timer->get_offset() functionality in timer_tsc.c - */ - - -/* Convert jiffies to system time. */ -static uint64_t -ticks_to_system_time(int newticks) -{ - int delta; - uint64_t st; - - delta = newticks - ticks; - if (delta < 1) { - /* Triggers in some wrap-around cases, - * but that's okay: - * we just end up with a shorter timeout. */ - st = processed_system_time + NS_PER_TICK; - } else if (((unsigned int)delta >> (BITS_PER_LONG-3)) != 0) { - /* Very long timeout means there is no pending timer. - * We indicate this to Xen by passing zero timeout. */ - st = 0; - } else { - st = processed_system_time + delta * (uint64_t)NS_PER_TICK; - } - - return (st); -} - void idle_block(void) { - uint64_t timeout; - - timeout = ticks_to_system_time(ticks + 1) + NS_PER_TICK/2; - __get_time_values_from_xen(); - PANIC_IF(HYPERVISOR_set_timer_op(timeout) != 0); - HYPERVISOR_sched_op(SCHEDOP_block, 0); + HYPERVISOR_sched_op(SCHEDOP_block, 0); } int @@ -903,6 +911,3 @@ timer_spkr_setfreq(int freq) } - - - Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Fri May 13 10:36:38 2011 (r221834) +++ head/sys/i386/xen/mp_machdep.c Fri May 13 12:39:37 2011 (r221835) @@ -628,8 +628,11 @@ init_secondary(void) while (smp_started == 0) ia32_pause(); - PCPU_SET(curthread, PCPU_GET(idlethread)); + + /* Start per-CPU event timers. */ + cpu_initclocks_ap(); + /* enter the scheduler */ sched_throw(NULL); Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Fri May 13 10:36:38 2011 (r221834) +++ head/sys/kern/kern_clocksource.c Fri May 13 12:39:37 2011 (r221835) @@ -31,9 +31,6 @@ __FBSDID("$FreeBSD$"); * Common routines to manage event timers hardware. */ -/* XEN has own timer routines now. */ -#ifndef XEN - #include "opt_device_polling.h" #include "opt_kdtrace.h" @@ -899,5 +896,3 @@ sysctl_kern_eventtimer_periodic(SYSCTL_H SYSCTL_PROC(_kern_eventtimer, OID_AUTO, periodic, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_eventtimer_periodic, "I", "Enable event timer periodic mode"); - -#endif From owner-svn-src-head@FreeBSD.ORG Fri May 13 12:47:52 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E28D3106566B; Fri, 13 May 2011 12:47:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 984E18FC12; Fri, 13 May 2011 12:47:51 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA17244; Fri, 13 May 2011 15:47:50 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4DCD2875.9040808@FreeBSD.org> Date: Fri, 13 May 2011 15:47:49 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110504 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jung-uk Kim References: <201105091734.p49HY0P3006180@svn.freebsd.org> <4DCBC316.5030209@FreeBSD.org> <201105121239.31340.jkim@FreeBSD.org> In-Reply-To: <201105121239.31340.jkim@FreeBSD.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 12:47:53 -0000 on 12/05/2011 19:39 Jung-uk Kim said the following: > On Thursday 12 May 2011 07:23 am, Andriy Gapon wrote: >> on 09/05/2011 20:34 Jung-uk Kim said the following: >>> Author: jkim >>> Date: Mon May 9 17:34:00 2011 >>> New Revision: 221703 >>> URL: http://svn.freebsd.org/changeset/base/221703 >> >> [snip] >> >> I would to note [again] that I don't like code style of this >> change. >> >>> Modified: head/sys/x86/x86/tsc.c >>> ================================================================= >>> ============= --- head/sys/x86/x86/tsc.c Mon May 9 17:30:25 >>> 2011 (r221702) +++ head/sys/x86/x86/tsc.c Mon May 9 17:34:00 >>> 2011 (r221703) @@ -326,7 +326,73 @@ init_TSC(void) >>> tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY); >>> } >>> >>> -void >>> +#ifdef SMP >>> + >>> +#define TSC_READ(x) \ >>> +static void \ >>> +tsc_read_##x(void *arg) \ >>> +{ \ >>> + uint32_t *tsc = arg; \ >>> + u_int cpu = PCPU_GET(cpuid); \ >>> + \ >>> + tsc[cpu * 3 + x] = rdtsc32(); \ >>> +} >>> +TSC_READ(0) >>> +TSC_READ(1) >>> +TSC_READ(2) >>> +#undef TSC_READ >>> + >>> +#define N 1000 >> >> I don't like macro overuse in the above. >> Especially "N". > > I think duplicating trivial and almost identical functions is more > harmful to many eyes. > > 'N' here is temporary and arbitrary. I think 1,000 is actually > overkill but I wanted to "stress-test" smp_rendezvous(). :-P I guess I need to try to write this in "my way" and see if I would be able to come up with anything more appealing :-) > Now that you found a bug in the function, I can remove N but I want to > keep it for a while. Actually, it was already proven useful, i.e., I > gave a user the following patch: > > -#define N 1000 > +#define N 100 Well, I think this could be a static const variable or a tunable, but not a macro. > and it worked around his problem for now (until you commit the > smp_rendezvous() fix). I need more testers/reviewers for this. >>> +static void >>> +comp_smp_tsc(void *arg) >>> +{ >>> + uint32_t *tsc; >>> + int32_t d1, d2; >>> + u_int cpu = PCPU_GET(cpuid); >>> + u_int i, j, size; >>> + >>> + size = (mp_maxid + 1) * 3; >>> + for (i = 0, tsc = arg; i < N; i++, tsc += size) >>> + CPU_FOREACH(j) { >>> + if (j == cpu) >>> + continue; >>> + d1 = tsc[cpu * 3 + 1] - tsc[j * 3]; >>> + d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1]; >>> + if (d1 <= 0 || d2 <= 0) { >>> + smp_tsc = 0; >>> + return; >>> + } >>> + } >>> +} >>> + >>> +static int >>> +test_smp_tsc(void) >>> +{ >>> + uint32_t *data, *tsc; >>> + u_int i, size; >>> + >>> + if (!smp_tsc && !tsc_is_invariant) >>> + return (-100); >>> + size = (mp_maxid + 1) * 3; >>> + data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); >>> + for (i = 0, tsc = data; i < N; i++, tsc += size) >>> + smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); >> >> I don't like that what is logically a two dimensional array 3 x >> (mp_maxid + 1) is represented as a one-dimensional array with all >> ensuing multiplications by three and other array index >> manipulations. > > (As I said earlier) I agree with you in general but using > two-dimensional array or array of pointers just added more complexity > to the code and it didn't make the code any clearer than I originally > thought. Again, it is just a matter of taste, anyway. ;-) I guess this is the same as above, until I'll try to actually do something I won't be sure whether this could be done any better (for my taste) :-) >>> + smp_tsc = 1; /* XXX */ >>> + smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, >>> + smp_no_rendevous_barrier, data); >>> + free(data, M_TEMP); >>> + if (bootverbose) >>> + printf("SMP: %sed TSC synchronization test\n", >>> + smp_tsc ? "pass" : "fail"); >>> + return (smp_tsc ? 800 : -100); >> >> I still think something higher should be returned here for the >> smp_tsc == true case. It doesn't make sense to go through the >> shenanigans to underrate TSC in the end. > > http://docs.freebsd.org/cgi/mid.cgi?201105091352.49971.jkim > > I thought you wanted a separate commit, didn't you? I wanted HPET and ACPI quality to be changed in a separate commit, but I wanted TSC quality (for good TSC) to be bumped in this commit. >> On a more general note, smp_rendezvous() might not be the best >> mechanism here. In my opinion/understanding, smp_rendezvous() >> provides only the following guarantees: >> - if a setup action is specified, then every CPU executes the setup >> action before any CPU executes the main action >> - if a teardown action is specified, then every CPU executes the >> main action before any CPU executes the teardown action >> >> There are no timing guarantees, only the sequence guarantees. > > That's all I wanted to test, i.e., we only validate whether all TSCs > are in order (and that's all we can do, in fact). Well, not sure about that. E.g. the OpenSolaris code and the code that I derived from it compare difference between measured TSC value with how long it takes for a memory write by one CPU to be noticed by other CPU. Not without some heuristic and assumptions, of course. >> Any timing observations that we may have now are a product of the >> implementation and can change if the implementation change. So the >> newly introduced check may miss systemic differences in TSC values >> between CPUs if they are small enough. But I am not really sure if >> such a small differences would really matter. >> >> Worse case if there is some difference in TSC frequency between >> CPUs (e.g. in different sockets), after a powerup or a reset >> difference between TSC values may be very small, but could grow >> more and more with uptime. Not sure if this is a realistic enough >> scenario, though. > > Actually, I am kinda reluctant to enable smp_tsc by default on recent > CPUs. Although they made all TSCs in sync, it is very very tricky to > make it work in reality, e.g., > > https://patchwork.kernel.org/patch/691712/ I am not sure what is their concern there. TSC is good to be used as timecounter. If they use TSC for performance measurements, then of course they have to use some barriers - this is well known and documented. BTW, newer CPUs provide RDTSCP instruction which could be more convenient there. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri May 13 14:29:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7268106564A; Fri, 13 May 2011 14:29:28 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A781A8FC14; Fri, 13 May 2011 14:29:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DETSeG073385; Fri, 13 May 2011 14:29:28 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DETShX073383; Fri, 13 May 2011 14:29:28 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201105131429.p4DETShX073383@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 13 May 2011 14:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221836 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 14:29:28 -0000 Author: mdf Date: Fri May 13 14:29:28 2011 New Revision: 221836 URL: http://svn.freebsd.org/changeset/base/221836 Log: Correctly use INOUT for the offset/len parameters to vop_allocate. As far as I can tell this is for documentation only at the moment. Modified: head/sys/kern/vnode_if.src Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri May 13 12:39:37 2011 (r221835) +++ head/sys/kern/vnode_if.src Fri May 13 14:29:28 2011 (r221836) @@ -625,6 +625,6 @@ vop_vptocnp { vop_allocate { IN struct vnode *vp; - IN off_t *offset; - IN off_t *len; + INOUT off_t *offset; + INOUT off_t *len; }; From owner-svn-src-head@FreeBSD.ORG Fri May 13 14:33:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D56E106564A; Fri, 13 May 2011 14:33:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5245E8FC16; Fri, 13 May 2011 14:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DEXkXB073506; Fri, 13 May 2011 14:33:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DEXkgJ073502; Fri, 13 May 2011 14:33:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105131433.p4DEXkgJ073502@svn.freebsd.org> From: Adrian Chadd Date: Fri, 13 May 2011 14:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221837 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 14:33:46 -0000 Author: adrian Date: Fri May 13 14:33:45 2011 New Revision: 221837 URL: http://svn.freebsd.org/changeset/base/221837 Log: Only do open loop power control and temperature compensation for the AR9280 based NICs if it's actually enabled. Some of the OLC code was erroneously called during setup and calibration. This may have caused some incorrect behaviour. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri May 13 14:29:28 2011 (r221836) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Fri May 13 14:33:45 2011 (r221837) @@ -492,8 +492,9 @@ ar5416PerCalibrationN(struct ath_hal *ah if (AH5416(ah)->ah_cal_pacal) AH5416(ah)->ah_cal_pacal(ah, AH_FALSE); - /* Do temperature compensation if the chipset needs it */ - AH5416(ah)->ah_olcTempCompensation(ah); + /* Do open-loop temperature compensation if the chipset needs it */ + if (ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) + AH5416(ah)->ah_olcTempCompensation(ah); /* * Get the value from the previous NF cal Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Fri May 13 14:29:28 2011 (r221836) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Fri May 13 14:33:45 2011 (r221837) @@ -202,8 +202,11 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO */ ar5416InitChainMasks(ah); - /* Setup the open-loop temperature compensation if required */ - AH5416(ah)->ah_olcInit(ah); + /* Setup the open-loop power calibration if required */ + if (ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { + AH5416(ah)->ah_olcInit(ah); + AH5416(ah)->ah_olcTempCompensation(ah); + } /* Setup the transmit power values. */ if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Fri May 13 14:29:28 2011 (r221836) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c Fri May 13 14:33:45 2011 (r221837) @@ -43,6 +43,12 @@ ar9280olcInit(struct ath_hal *ah) { uint32_t i; + /* Only do OLC if it's enabled for this chipset */ + if (! ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) + return; + + HALDEBUG(ah, HAL_DEBUG_RESET, "%s: Setting up TX gain tables.\n", __func__); + for (i = 0; i < AR9280_TX_GAIN_TABLE_SIZE; i++) AH9280(ah)->originalGain[i] = MS(OS_REG_READ(ah, AR_PHY_TX_GAIN_TBL1 + i * 4), AR_PHY_TX_GAIN); @@ -126,6 +132,9 @@ ar9280olcTemperatureCompensation(struct int delta, currPDADC, regval; uint8_t hpwr_5g = 0; + if (! ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) + return; + rddata = OS_REG_READ(ah, AR_PHY_TX_PWRCTRL4); currPDADC = MS(rddata, AR_PHY_TX_PWRCTRL_PD_AVG_OUT); From owner-svn-src-head@FreeBSD.ORG Fri May 13 15:06:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF9A106566C; Fri, 13 May 2011 15:06:36 +0000 (UTC) (envelope-from brix@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC208FC14; Fri, 13 May 2011 15:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DF6a0T074269; Fri, 13 May 2011 15:06:36 GMT (envelope-from brix@svn.freebsd.org) Received: (from brix@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DF6ZQY074267; Fri, 13 May 2011 15:06:36 GMT (envelope-from brix@svn.freebsd.org) Message-Id: <201105131506.p4DF6ZQY074267@svn.freebsd.org> From: Henrik Brix Andersen Date: Fri, 13 May 2011 15:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221839 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 15:06:36 -0000 Author: brix (ports committer) Date: Fri May 13 15:06:35 2011 New Revision: 221839 URL: http://svn.freebsd.org/changeset/base/221839 Log: Allow direct children of PCI-ISA bridges to allocate resources from the parent PCI bus. Heavily inspired by jhb@ and a similar implementation present in sys/dev/pci/vga_pci.c. Reviewed by: jhb Approved by: jhb Modified: head/sys/dev/pci/isa_pci.c Modified: head/sys/dev/pci/isa_pci.c ============================================================================== --- head/sys/dev/pci/isa_pci.c Fri May 13 14:57:20 2011 (r221838) +++ head/sys/dev/pci/isa_pci.c Fri May 13 15:06:35 2011 (r221839) @@ -45,12 +45,22 @@ __FBSDID("$FreeBSD$"); #include #include -static int isab_probe(device_t dev); +#include +#include +#include + +static int isab_pci_probe(device_t dev); +static int isab_pci_attach(device_t dev); +static struct resource * isab_pci_alloc_resource(device_t dev, + device_t child, int type, int *rid, u_long start, u_long end, u_long count, + u_int flags); +static int isab_pci_release_resource(device_t dev, device_t child, + int type, int rid, struct resource *r); static device_method_t isab_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, isab_probe), - DEVMETHOD(device_attach, isab_attach), + DEVMETHOD(device_probe, isab_pci_probe), + DEVMETHOD(device_attach, isab_pci_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), @@ -58,8 +68,8 @@ static device_method_t isab_methods[] = /* Bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_alloc_resource, isab_pci_alloc_resource), + DEVMETHOD(bus_release_resource, isab_pci_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), @@ -68,10 +78,19 @@ static device_method_t isab_methods[] = { 0, 0 } }; +struct isab_pci_resource { + struct resource *ip_res; + int ip_refs; +}; + +struct isab_pci_softc { + struct isab_pci_resource isab_pci_res[PCIR_MAX_BAR_0 + 1]; +}; + static driver_t isab_driver = { "isab", isab_methods, - 0, + sizeof(struct isab_pci_softc), }; DRIVER_MODULE(isab, pci, isab_driver, isab_devclass, 0, 0); @@ -81,7 +100,7 @@ DRIVER_MODULE(isab, pci, isab_driver, is * report themselves. */ static int -isab_probe(device_t dev) +isab_pci_probe(device_t dev) { int matched = 0; @@ -139,3 +158,88 @@ isab_probe(device_t dev) } return(ENXIO); } + +static int +isab_pci_attach(device_t dev) +{ + + bus_generic_probe(dev); + return (isab_attach(dev)); +} + +static struct resource * +isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct isab_pci_softc *sc; + int bar; + + if (device_get_parent(child) != dev) + return bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + /* + * For BARs, we cache the resource so that we only allocate it + * from the PCI bus once. + */ + bar = PCI_RID2BAR(*rid); + if (bar < 0 || bar > PCIR_MAX_BAR_0) + return (NULL); + sc = device_get_softc(dev); + if (sc->isab_pci_res[bar].ip_res == NULL) + sc->isab_pci_res[bar].ip_res = bus_alloc_resource(dev, type, + rid, start, end, count, flags); + if (sc->isab_pci_res[bar].ip_res != NULL) + sc->isab_pci_res[bar].ip_refs++; + return (sc->isab_pci_res[bar].ip_res); + } + + return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, + start, end, count, flags)); +} + +static int +isab_pci_release_resource(device_t dev, device_t child, int type, int rid, + struct resource *r) +{ + struct isab_pci_softc *sc; + int bar, error; + + if (device_get_parent(child) != dev) + return bus_generic_release_resource(dev, child, type, rid, r); + + switch (type) { + case SYS_RES_MEMORY: + case SYS_RES_IOPORT: + /* + * For BARs, we release the resource from the PCI bus + * when the last child reference goes away. + */ + bar = PCI_RID2BAR(rid); + if (bar < 0 || bar > PCIR_MAX_BAR_0) + return (EINVAL); + sc = device_get_softc(dev); + if (sc->isab_pci_res[bar].ip_res == NULL) + return (EINVAL); + KASSERT(sc->isab_pci_res[bar].ip_res == r, + ("isa_pci resource mismatch")); + if (sc->isab_pci_res[bar].ip_refs > 1) { + sc->isab_pci_res[bar].ip_refs--; + return (0); + } + KASSERT(sc->isab_pci_res[bar].ip_refs > 0, + ("isa_pci resource reference count underflow")); + error = bus_release_resource(dev, type, rid, r); + if (error == 0) { + sc->isab_pci_res[bar].ip_res = NULL; + sc->isab_pci_res[bar].ip_refs = 0; + } + return (error); + } + + return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, type, + rid, r)); +} From owner-svn-src-head@FreeBSD.ORG Fri May 13 15:49:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB3A6106566B; Fri, 13 May 2011 15:49:23 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA4728FC08; Fri, 13 May 2011 15:49:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DFnNpS075362; Fri, 13 May 2011 15:49:23 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DFnNpu075358; Fri, 13 May 2011 15:49:23 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201105131549.p4DFnNpu075358@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 13 May 2011 15:49:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221843 - in head: share/man/man3 sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 15:49:23 -0000 Author: mdf Date: Fri May 13 15:49:23 2011 New Revision: 221843 URL: http://svn.freebsd.org/changeset/base/221843 Log: Note that the _SWAP operation is supported for all list/queue types. Also place STAILQ_REMOVE_HEAD in alphabetical order. Lastly, document the _SWAP macros. PR: kern/143033 MFC after: 1 week Modified: head/share/man/man3/Makefile head/share/man/man3/queue.3 head/sys/sys/queue.h Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Fri May 13 15:21:31 2011 (r221842) +++ head/share/man/man3/Makefile Fri May 13 15:49:23 2011 (r221843) @@ -53,6 +53,7 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 LIST_INSERT_HEAD.3 \ queue.3 LIST_NEXT.3 \ queue.3 LIST_REMOVE.3 \ + queue.3 LIST_SWAP.3 \ queue.3 SLIST_EMPTY.3 \ queue.3 SLIST_ENTRY.3 \ queue.3 SLIST_FIRST.3 \ @@ -67,6 +68,7 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 SLIST_REMOVE.3 \ queue.3 SLIST_REMOVE_AFTER.3 \ queue.3 SLIST_REMOVE_HEAD.3 \ + queue.3 SLIST_SWAP.3 \ queue.3 STAILQ_CONCAT.3 \ queue.3 STAILQ_EMPTY.3 \ queue.3 STAILQ_ENTRY.3 \ @@ -84,6 +86,7 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 STAILQ_REMOVE.3 \ queue.3 STAILQ_REMOVE_AFTER.3 \ queue.3 STAILQ_REMOVE_HEAD.3 \ + queue.3 STAILQ_SWAP.3 \ queue.3 TAILQ_CONCAT.3 \ queue.3 TAILQ_EMPTY.3 \ queue.3 TAILQ_ENTRY.3 \ @@ -102,7 +105,8 @@ MLINKS+= queue.3 LIST_EMPTY.3 \ queue.3 TAILQ_LAST.3 \ queue.3 TAILQ_NEXT.3 \ queue.3 TAILQ_PREV.3 \ - queue.3 TAILQ_REMOVE.3 + queue.3 TAILQ_REMOVE.3 \ + queue.3 TAILQ_SWAP.3 MLINKS+= stdarg.3 va_arg.3 \ stdarg.3 va_copy.3 \ stdarg.3 va_end.3 \ Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Fri May 13 15:21:31 2011 (r221842) +++ head/share/man/man3/queue.3 Fri May 13 15:49:23 2011 (r221843) @@ -32,7 +32,7 @@ .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd March 24, 2006 +.Dd May 13, 2011 .Dt QUEUE 3 .Os .Sh NAME @@ -50,6 +50,7 @@ .Nm SLIST_REMOVE_AFTER , .Nm SLIST_REMOVE_HEAD , .Nm SLIST_REMOVE , +.Nm SLIST_SWAP , .Nm STAILQ_CONCAT , .Nm STAILQ_EMPTY , .Nm STAILQ_ENTRY , @@ -67,6 +68,7 @@ .Nm STAILQ_REMOVE_AFTER , .Nm STAILQ_REMOVE_HEAD , .Nm STAILQ_REMOVE , +.Nm STAILQ_SWAP , .Nm LIST_EMPTY , .Nm LIST_ENTRY , .Nm LIST_FIRST , @@ -80,6 +82,7 @@ .Nm LIST_INSERT_HEAD , .Nm LIST_NEXT , .Nm LIST_REMOVE , +.Nm LIST_SWAP , .Nm TAILQ_CONCAT , .Nm TAILQ_EMPTY , .Nm TAILQ_ENTRY , @@ -98,7 +101,8 @@ .Nm TAILQ_LAST , .Nm TAILQ_NEXT , .Nm TAILQ_PREV , -.Nm TAILQ_REMOVE +.Nm TAILQ_REMOVE , +.Nm TAILQ_SWAP .Nd implementations of singly-linked lists, singly-linked tail queues, lists and tail queues .Sh SYNOPSIS @@ -118,6 +122,7 @@ lists and tail queues .Fn SLIST_REMOVE_AFTER "TYPE *elm" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME" .Fn SLIST_REMOVE "SLIST_HEAD *head" "TYPE *elm" "TYPE" "SLIST_ENTRY NAME" +.Fn SLIST_SWAP "SLIST_HEAD *head1" "SLIST_HEAD *head2" "SLIST_ENTRY NAME" .\" .Fn STAILQ_CONCAT "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" .Fn STAILQ_EMPTY "STAILQ_HEAD *head" @@ -136,6 +141,7 @@ lists and tail queues .Fn STAILQ_REMOVE_AFTER "STAILQ_HEAD *head" "TYPE *elm" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE_HEAD "STAILQ_HEAD *head" "STAILQ_ENTRY NAME" .Fn STAILQ_REMOVE "STAILQ_HEAD *head" "TYPE *elm" "TYPE" "STAILQ_ENTRY NAME" +.Fn STAILQ_SWAP "STAILQ_HEAD *head1" "STAILQ_HEAD *head2" "STAILQ_ENTRY NAME" .\" .Fn LIST_EMPTY "LIST_HEAD *head" .Fn LIST_ENTRY "TYPE" @@ -150,6 +156,7 @@ lists and tail queues .Fn LIST_INSERT_HEAD "LIST_HEAD *head" "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_NEXT "TYPE *elm" "LIST_ENTRY NAME" .Fn LIST_REMOVE "TYPE *elm" "LIST_ENTRY NAME" +.Fn LIST_SWAP "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .\" .Fn TAILQ_CONCAT "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TAILQ_ENTRY NAME" .Fn TAILQ_EMPTY "TAILQ_HEAD *head" @@ -170,6 +177,7 @@ lists and tail queues .Fn TAILQ_NEXT "TYPE *elm" "TAILQ_ENTRY NAME" .Fn TAILQ_PREV "TYPE *elm" "HEADNAME" "TAILQ_ENTRY NAME" .Fn TAILQ_REMOVE "TAILQ_HEAD *head" "TYPE *elm" "TAILQ_ENTRY NAME" +.Fn TAILQ_SWAP "TAILQ_HEAD *head1" "TAILQ_HEAD *head2" "TYPE" "TAILQ_ENTRY NAME" .\" .Sh DESCRIPTION These macros define and operate on four types of data structures: @@ -184,6 +192,8 @@ Insertion of a new entry after any eleme O(1) removal of an entry from the head of the list. .It Forward traversal through the list. +.It +Swawpping the contents of two lists. .El .Pp Singly-linked lists are the simplest of the four data structures @@ -402,6 +412,13 @@ The macro removes the element .Fa elm from the list. +.Pp +The macro +.Nm SLIST_SWAP +swaps the contents of +.Fa head1 +and +.Fa head2 . .Sh SINGLY-LINKED LIST EXAMPLE .Bd -literal SLIST_HEAD(slisthead, entry) head = @@ -584,6 +601,13 @@ The macro removes the element .Fa elm from the tail queue. +.Pp +The macro +.Nm STAILQ_SWAP +swaps the contents of +.Fa head1 +and +.Fa head2 . .Sh SINGLY-LINKED TAIL QUEUE EXAMPLE .Bd -literal STAILQ_HEAD(stailhead, entry) head = @@ -743,6 +767,13 @@ The macro removes the element .Fa elm from the list. +.Pp +The macro +.Nm LIST_SWAP +swaps the contents of +.Fa head1 +and +.Fa head2 . .Sh LIST EXAMPLE .Bd -literal LIST_HEAD(listhead, entry) head = @@ -942,6 +973,13 @@ The macro removes the element .Fa elm from the tail queue. +.Pp +The macro +.Nm TAILQ_SWAP +swaps the contents of +.Fa head1 +and +.Fa head2 . .Sh TAIL QUEUE EXAMPLE .Bd -literal TAILQ_HEAD(tailhead, entry) head = Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Fri May 13 15:21:31 2011 (r221842) +++ head/sys/sys/queue.h Fri May 13 15:49:23 2011 (r221843) @@ -99,6 +99,7 @@ * _REMOVE_AFTER + - + - * _REMOVE_HEAD + - + - * _REMOVE + + + + + * _SWAP + + + + * */ #ifdef QUEUE_MACRO_DEBUG @@ -307,18 +308,18 @@ struct { \ TRASHIT(*oldnext); \ } while (0) -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - #define STAILQ_REMOVE_AFTER(head, elm, field) do { \ if ((STAILQ_NEXT(elm, field) = \ STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ (head)->stqh_last = &STAILQ_NEXT((elm), field); \ } while (0) +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if ((STAILQ_FIRST((head)) = \ + STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ + (head)->stqh_last = &STAILQ_FIRST((head)); \ +} while (0) + #define STAILQ_SWAP(head1, head2, type) do { \ struct type *swap_first = STAILQ_FIRST(head1); \ struct type **swap_last = (head1)->stqh_last; \ From owner-svn-src-head@FreeBSD.ORG Fri May 13 15:54:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB594106566B; Fri, 13 May 2011 15:54:12 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9348FC18; Fri, 13 May 2011 15:54:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DFsCS9075513; Fri, 13 May 2011 15:54:12 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DFsCnb075511; Fri, 13 May 2011 15:54:12 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201105131554.p4DFsCnb075511@svn.freebsd.org> From: Olivier Houchard Date: Fri, 13 May 2011 15:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221844 - head/sys/arm/arm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 15:54:12 -0000 Author: cognet Date: Fri May 13 15:54:12 2011 New Revision: 221844 URL: http://svn.freebsd.org/changeset/base/221844 Log: In pmap_change_wiring(), use the right argument for pmap_modify_pv(). It only worked because the only consumer calls pmap_change_wiring() to remove the wiring. Modified: head/sys/arm/arm/pmap.c Modified: head/sys/arm/arm/pmap.c ============================================================================== --- head/sys/arm/arm/pmap.c Fri May 13 15:49:23 2011 (r221843) +++ head/sys/arm/arm/pmap.c Fri May 13 15:54:12 2011 (r221844) @@ -3646,7 +3646,7 @@ pmap_change_wiring(pmap_t pmap, vm_offse pte = *ptep; pg = PHYS_TO_VM_PAGE(l2pte_pa(pte)); if (pg) - pmap_modify_pv(pg, pmap, va, PVF_WIRED, wired); + pmap_modify_pv(pg, pmap, va, PVF_WIRED, wired ? PVF_WIRED : 0); vm_page_unlock_queues(); PMAP_UNLOCK(pmap); } From owner-svn-src-head@FreeBSD.ORG Fri May 13 16:29:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BEFE106566B; Fri, 13 May 2011 16:29:57 +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 60C9E8FC0A; Fri, 13 May 2011 16:29:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DGTvkh076277; Fri, 13 May 2011 16:29:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DGTvlF076272; Fri, 13 May 2011 16:29:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201105131629.p4DGTvlF076272@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 13 May 2011 16:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221845 - in head: bin/chmod bin/ls lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 16:29:57 -0000 Author: pluknet Date: Fri May 13 16:29:57 2011 New Revision: 221845 URL: http://svn.freebsd.org/changeset/base/221845 Log: Update sticky(7) cross references. PR: docs/124468 X-MFC with: r218998 Modified: head/bin/chmod/chmod.1 head/bin/ls/ls.1 head/lib/libc/sys/chmod.2 head/lib/libc/sys/stat.2 Modified: head/bin/chmod/chmod.1 ============================================================================== --- head/bin/chmod/chmod.1 Fri May 13 15:54:12 2011 (r221844) +++ head/bin/chmod/chmod.1 Fri May 13 16:29:57 2011 (r221845) @@ -134,7 +134,7 @@ will run with effective gid set to the g See .Xr chmod 2 and -.Xr sticky 8 . +.Xr sticky 7 . .It Li 0400 Allow read by owner. .It Li 0200 @@ -325,10 +325,10 @@ option is non-standard and its use in sc .Xr umask 2 , .Xr fts 3 , .Xr setmode 3 , +.Xr sticky 7 , .Xr symlink 7 , .Xr chown 8 , -.Xr mount 8 , -.Xr sticky 8 +.Xr mount 8 .Sh STANDARDS The .Nm Modified: head/bin/ls/ls.1 ============================================================================== --- head/bin/ls/ls.1 Fri May 13 15:54:12 2011 (r221844) +++ head/bin/ls/ls.1 Fri May 13 16:29:57 2011 (r221845) @@ -459,7 +459,7 @@ but not execute or search permission. (See .Xr chmod 1 or -.Xr sticky 8 . ) +.Xr sticky 7 . ) .It Sy t The sticky bit is set (mode .Li 1000 ) , @@ -467,7 +467,7 @@ and is searchable or executable. (See .Xr chmod 1 or -.Xr sticky 8 . ) +.Xr sticky 7 . ) .El .El .Pp @@ -683,9 +683,9 @@ specification. .Xr strmode 3 , .Xr termcap 5 , .Xr maclabel 7 , +.Xr sticky 7 , .Xr symlink 7 , -.Xr getfmac 8 , -.Xr sticky 8 +.Xr getfmac 8 .Sh STANDARDS With the exception of options .Fl I , g , n Modified: head/lib/libc/sys/chmod.2 ============================================================================== --- head/lib/libc/sys/chmod.2 Fri May 13 15:54:12 2011 (r221844) +++ head/lib/libc/sys/chmod.2 Fri May 13 16:29:57 2011 (r221845) @@ -161,7 +161,7 @@ The sticky bit may be set by any user on a directory which the user owns or has appropriate permissions. For more details of the properties of the sticky bit, see -.Xr sticky 8 . +.Xr sticky 7 . .Pp If mode ISUID (set UID) is set on a directory, and the MNT_SUIDDIR option was used in the mount of the file system, @@ -289,7 +289,7 @@ nor a file descriptor associated with a .Xr chown 2 , .Xr open 2 , .Xr stat 2 , -.Xr sticky 8 +.Xr sticky 7 .Sh STANDARDS The .Fn chmod Modified: head/lib/libc/sys/stat.2 ============================================================================== --- head/lib/libc/sys/stat.2 Fri May 13 15:54:12 2011 (r221844) +++ head/lib/libc/sys/stat.2 Fri May 13 16:29:57 2011 (r221845) @@ -401,8 +401,8 @@ nor a file descriptor associated with a .Xr fhstat 2 , .Xr statfs 2 , .Xr utimes 2 , -.Xr symlink 7 , -.Xr sticky 8 +.Xr sticky 7 , +.Xr symlink 7 .Sh STANDARDS The .Fn stat From owner-svn-src-head@FreeBSD.ORG Fri May 13 16:57:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 89EF4106564A; Fri, 13 May 2011 16:57:48 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Andriy Gapon Date: Fri, 13 May 2011 12:57:31 -0400 User-Agent: KMail/1.6.2 References: <201105091734.p49HY0P3006180@svn.freebsd.org> <201105121239.31340.jkim@FreeBSD.org> <4DCD2875.9040808@FreeBSD.org> In-Reply-To: <4DCD2875.9040808@FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105131257.34009.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 16:57:49 -0000 On Friday 13 May 2011 08:47 am, Andriy Gapon wrote: > on 12/05/2011 19:39 Jung-uk Kim said the following: > > On Thursday 12 May 2011 07:23 am, Andriy Gapon wrote: > >> on 09/05/2011 20:34 Jung-uk Kim said the following: > >>> Author: jkim > >>> Date: Mon May 9 17:34:00 2011 > >>> New Revision: 221703 > >>> URL: http://svn.freebsd.org/changeset/base/221703 > >> > >> [snip] > >> > >> I would to note [again] that I don't like code style of this > >> change. > >> > >>> Modified: head/sys/x86/x86/tsc.c > >>> =============================================================== > >>>== ============= --- head/sys/x86/x86/tsc.c Mon May 9 17:30:25 > >>> 2011 (r221702) +++ head/sys/x86/x86/tsc.c Mon May 9 17:34:00 > >>> 2011 (r221703) @@ -326,7 +326,73 @@ init_TSC(void) > >>> tsc_levels_changed, NULL, EVENTHANDLER_PRI_ANY); > >>> } > >>> > >>> -void > >>> +#ifdef SMP > >>> + > >>> +#define TSC_READ(x) \ > >>> +static void \ > >>> +tsc_read_##x(void *arg) \ > >>> +{ \ > >>> + uint32_t *tsc = arg; \ > >>> + u_int cpu = PCPU_GET(cpuid); \ > >>> + \ > >>> + tsc[cpu * 3 + x] = rdtsc32(); \ > >>> +} > >>> +TSC_READ(0) > >>> +TSC_READ(1) > >>> +TSC_READ(2) > >>> +#undef TSC_READ > >>> + > >>> +#define N 1000 > >> > >> I don't like macro overuse in the above. > >> Especially "N". > > > > I think duplicating trivial and almost identical functions is > > more harmful to many eyes. > > > > 'N' here is temporary and arbitrary. I think 1,000 is actually > > overkill but I wanted to "stress-test" smp_rendezvous(). :-P > > I guess I need to try to write this in "my way" and see if I would > be able to come up with anything more appealing :-) :-) > > Now that you found a bug in the function, I can remove N but I > > want to keep it for a while. Actually, it was already proven > > useful, i.e., I gave a user the following patch: > > > > -#define N 1000 > > +#define N 100 > > Well, I think this could be a static const variable or a tunable, > but not a macro. It will go away as soon as your patch for smp_rendezvous() is committed. > > and it worked around his problem for now (until you commit the > > smp_rendezvous() fix). > > I need more testers/reviewers for this. At least one user reported to me that your patch works fine. :-) > >>> +static void > >>> +comp_smp_tsc(void *arg) > >>> +{ > >>> + uint32_t *tsc; > >>> + int32_t d1, d2; > >>> + u_int cpu = PCPU_GET(cpuid); > >>> + u_int i, j, size; > >>> + > >>> + size = (mp_maxid + 1) * 3; > >>> + for (i = 0, tsc = arg; i < N; i++, tsc += size) > >>> + CPU_FOREACH(j) { > >>> + if (j == cpu) > >>> + continue; > >>> + d1 = tsc[cpu * 3 + 1] - tsc[j * 3]; > >>> + d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1]; > >>> + if (d1 <= 0 || d2 <= 0) { > >>> + smp_tsc = 0; > >>> + return; > >>> + } > >>> + } > >>> +} > >>> + > >>> +static int > >>> +test_smp_tsc(void) > >>> +{ > >>> + uint32_t *data, *tsc; > >>> + u_int i, size; > >>> + > >>> + if (!smp_tsc && !tsc_is_invariant) > >>> + return (-100); > >>> + size = (mp_maxid + 1) * 3; > >>> + data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK); > >>> + for (i = 0, tsc = data; i < N; i++, tsc += size) > >>> + smp_rendezvous(tsc_read_0, tsc_read_1, tsc_read_2, tsc); > >> > >> I don't like that what is logically a two dimensional array 3 x > >> (mp_maxid + 1) is represented as a one-dimensional array with > >> all ensuing multiplications by three and other array index > >> manipulations. > > > > (As I said earlier) I agree with you in general but using > > two-dimensional array or array of pointers just added more > > complexity to the code and it didn't make the code any clearer > > than I originally thought. Again, it is just a matter of taste, > > anyway. ;-) > > I guess this is the same as above, until I'll try to actually do > something I won't be sure whether this could be done any better > (for my taste) :-) Please feel free (and let me know). > >>> + smp_tsc = 1; /* XXX */ > >>> + smp_rendezvous(smp_no_rendevous_barrier, comp_smp_tsc, > >>> + smp_no_rendevous_barrier, data); > >>> + free(data, M_TEMP); > >>> + if (bootverbose) > >>> + printf("SMP: %sed TSC synchronization test\n", > >>> + smp_tsc ? "pass" : "fail"); > >>> + return (smp_tsc ? 800 : -100); > >> > >> I still think something higher should be returned here for the > >> smp_tsc == true case. It doesn't make sense to go through the > >> shenanigans to underrate TSC in the end. > > > > http://docs.freebsd.org/cgi/mid.cgi?201105091352.49971.jkim > > > > I thought you wanted a separate commit, didn't you? > > I wanted HPET and ACPI quality to be changed in a separate commit, > but I wanted TSC quality (for good TSC) to be bumped in this > commit. Oh, I see. However, if we are going to adjust timecounter qualities, I think we should do all at the same time to reduce user confusions. > >> On a more general note, smp_rendezvous() might not be the best > >> mechanism here. In my opinion/understanding, smp_rendezvous() > >> provides only the following guarantees: > >> - if a setup action is specified, then every CPU executes the > >> setup action before any CPU executes the main action > >> - if a teardown action is specified, then every CPU executes the > >> main action before any CPU executes the teardown action > >> > >> There are no timing guarantees, only the sequence guarantees. > > > > That's all I wanted to test, i.e., we only validate whether all > > TSCs are in order (and that's all we can do, in fact). > > Well, not sure about that. > E.g. the OpenSolaris code and the code that I derived from it > compare difference between measured TSC value with how long it > takes for a memory write by one CPU to be noticed by other CPU. > Not without some heuristic and assumptions, of course. You guys keep saying some code derived from OpenSolaris exists to sync. TSCs. Can you let me see it, pretty please? I don't know what else to say. :-( > >> Any timing observations that we may have now are a product of > >> the implementation and can change if the implementation change. > >> So the newly introduced check may miss systemic differences in > >> TSC values between CPUs if they are small enough. But I am not > >> really sure if such a small differences would really matter. > >> > >> Worse case if there is some difference in TSC frequency between > >> CPUs (e.g. in different sockets), after a powerup or a reset > >> difference between TSC values may be very small, but could grow > >> more and more with uptime. Not sure if this is a realistic > >> enough scenario, though. > > > > Actually, I am kinda reluctant to enable smp_tsc by default on > > recent CPUs. Although they made all TSCs in sync, it is very > > very tricky to make it work in reality, e.g., > > > > https://patchwork.kernel.org/patch/691712/ > > I am not sure what is their concern there. > TSC is good to be used as timecounter. *Iff* they are all in sync. and atomically increasing... > If they use TSC for performance measurements, then of course they > have to use some barriers - this is well known and documented. If my understanding is correct, Linux has to make sure the new timer value read from a CPU must be written/read to/from memory in order and all other CPUs must be able see the updated value as their "vsyscall" and/or "vDSO" version of gettimeofday(2) and friends rely on it. Also, the last value read from a CPU is kept in memory and compared with a new value (possibly read from another CPU) to make sure it is incremental. I'd call it a "TSC-safe" timecounter. ;-) Some price to pay when you do timekeeping in user space to avoid syscalls... > BTW, newer CPUs provide RDTSCP instruction which could be more > convenient there. AFAIK, some people wanted to do that but Linus thought RDTSCP is too expensive as it is a serialized instruction. Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Fri May 13 18:28:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA714106564A; Fri, 13 May 2011 18:28:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB2CD8FC17; Fri, 13 May 2011 18:28:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DISPXc078967; Fri, 13 May 2011 18:28:25 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DISPYa078965; Fri, 13 May 2011 18:28:25 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105131828.p4DISPYa078965@svn.freebsd.org> From: Warner Losh Date: Fri, 13 May 2011 18:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221850 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 18:28:25 -0000 Author: imp Date: Fri May 13 18:28:25 2011 New Revision: 221850 URL: http://svn.freebsd.org/changeset/base/221850 Log: Copy symbolic links as files rather than recreating the links. PR: misc/151697 Submitted by: lev@ MFC after: 2 weeks Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:20:24 2011 (r221849) +++ head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:28:25 2011 (r221850) @@ -418,7 +418,7 @@ populate_slice ( ) ( echo "Creating ${dev} with ${dir} (mounting on ${mnt})" newfs_part $dev $mnt $lbl cd ${dir} - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt} + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${mnt} df -i ${mnt} umount ${mnt} ) @@ -674,7 +674,7 @@ cust_allow_ssh_root () ( cust_install_files () ( cd ${NANO_TOOLS}/Files - find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${NANO_WORLDDIR} + find . -print | grep -Ev '/(CVS|\.svn)' | cpio -Ldumpv ${NANO_WORLDDIR} ) ####################################################################### @@ -687,7 +687,7 @@ cust_pkg () ( ( cd ${NANO_PACKAGE_DIR} find ${NANO_PACKAGE_LIST} -print | - cpio -dumpv ${NANO_WORLDDIR}/Pkg + cpio -Ldumpv ${NANO_WORLDDIR}/Pkg ) # Count & report how many we have to install From owner-svn-src-head@FreeBSD.ORG Fri May 13 18:36:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E967B106566C; Fri, 13 May 2011 18:36:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA3758FC15; Fri, 13 May 2011 18:36:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DIaOvK079207; Fri, 13 May 2011 18:36:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DIaOeF079205; Fri, 13 May 2011 18:36:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105131836.p4DIaOeF079205@svn.freebsd.org> From: Warner Losh Date: Fri, 13 May 2011 18:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221851 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 18:36:25 -0000 Author: imp Date: Fri May 13 18:36:24 2011 New Revision: 221851 URL: http://svn.freebsd.org/changeset/base/221851 Log: Implement -f to inhibit copying s1 partition out for speed. (-z not taken from PR, it is no longer needed since we basically always do that now) PR: misc/151698 Submitted by: lev@ Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:28:25 2011 (r221850) +++ head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:36:24 2011 (r221851) @@ -567,8 +567,10 @@ create_i386_diskimage ( ) ( dd if=/dev/${MD} of=${IMG} bs=64k fi - echo "Writing out _.disk.image..." - dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + if do_copyout_partition ; then + echo "Writing out _.disk.image..." + dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k + fi mdconfig -d -u $MD trap - 1 2 15 EXIT @@ -758,8 +760,9 @@ pprint() { usage () { ( - echo "Usage: $0 [-biknqvw] [-c config_file]" + echo "Usage: $0 [-bfiknqvw] [-c config_file]" echo " -b suppress builds (both kernel and world)" + echo " -f suppress code slice extraction" echo " -i suppress disk image build" echo " -k suppress buildkernel" echo " -n add -DNO_CLEAN to buildworld, buildkernel, etc" @@ -778,9 +781,10 @@ do_clean=true do_kernel=true do_world=true do_image=true +do_copyout_partition=true set +e -args=`getopt bc:hiknqvw $*` +args=`getopt bc:fhiknqvw $*` if [ $? -ne 0 ] ; then usage exit 2 @@ -806,6 +810,10 @@ do shift shift ;; + -f) + do_copyout_partition=false + shift + ;; -h) usage ;; From owner-svn-src-head@FreeBSD.ORG Fri May 13 18:46:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18EBE1065670; Fri, 13 May 2011 18:46:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1DC8FC08; Fri, 13 May 2011 18:46:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DIkKk3079434; Fri, 13 May 2011 18:46:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DIkKrv079432; Fri, 13 May 2011 18:46:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105131846.p4DIkKrv079432@svn.freebsd.org> From: Warner Losh Date: Fri, 13 May 2011 18:46:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221852 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 18:46:21 -0000 Author: imp Date: Fri May 13 18:46:20 2011 New Revision: 221852 URL: http://svn.freebsd.org/changeset/base/221852 Log: Add ${} around variable dereference... Submitted by: garrett coopper Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:36:24 2011 (r221851) +++ head/tools/tools/nanobsd/nanobsd.sh Fri May 13 18:46:20 2011 (r221852) @@ -567,7 +567,7 @@ create_i386_diskimage ( ) ( dd if=/dev/${MD} of=${IMG} bs=64k fi - if do_copyout_partition ; then + if ${do_copyout_partition} ; then echo "Writing out _.disk.image..." dd if=/dev/${MD}s1 of=${NANO_DISKIMGDIR}/_.disk.image bs=64k fi From owner-svn-src-head@FreeBSD.ORG Fri May 13 18:48:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F11E106566C; Fri, 13 May 2011 18:48:01 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F66B8FC15; Fri, 13 May 2011 18:48:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DIm1Eu079500; Fri, 13 May 2011 18:48:01 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DIm1j7079495; Fri, 13 May 2011 18:48:01 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201105131848.p4DIm1j7079495@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 13 May 2011 18:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221853 - in head/sys: dev/md dev/null sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 18:48:01 -0000 Author: mdf Date: Fri May 13 18:48:00 2011 New Revision: 221853 URL: http://svn.freebsd.org/changeset/base/221853 Log: Usa a globally visible region of zeros for both /dev/zero and the md device. There are likely other kernel uses of "blob of zeros" than can be converted. Reviewed by: alc MFC after: 1 week Modified: head/sys/dev/md/md.c head/sys/dev/null/null.c head/sys/sys/systm.h head/sys/vm/vm_kern.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Fri May 13 18:46:20 2011 (r221852) +++ head/sys/dev/md/md.c Fri May 13 18:48:00 2011 (r221853) @@ -205,9 +205,6 @@ struct md_s { vm_object_t object; }; -/* Used for BIO_DELETE on MD_VNODE */ -static u_char zero[PAGE_SIZE]; - static struct indir * new_indir(u_int shift) { @@ -560,7 +557,8 @@ mdstart_vnode(struct md_s *sc, struct bi * that the two cases end up having very little in common. */ if (bp->bio_cmd == BIO_DELETE) { - zerosize = sizeof(zero) - (sizeof(zero) % sc->sectorsize); + zerosize = ZERO_REGION_SIZE - + (ZERO_REGION_SIZE % sc->sectorsize); auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = (vm_ooffset_t)bp->bio_offset; @@ -573,7 +571,7 @@ mdstart_vnode(struct md_s *sc, struct bi vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); error = 0; while (auio.uio_offset < end) { - aiov.iov_base = zero; + aiov.iov_base = __DECONST(void *, zero_region); aiov.iov_len = end - auio.uio_offset; if (aiov.iov_len > zerosize) aiov.iov_len = zerosize; Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Fri May 13 18:46:20 2011 (r221852) +++ head/sys/dev/null/null.c Fri May 13 18:48:00 2011 (r221853) @@ -65,8 +65,6 @@ static struct cdevsw zero_cdevsw = { .d_flags = D_MMAP_ANON, }; -static void *zbuf; - /* ARGSUSED */ static int null_write(struct cdev *dev __unused, struct uio *uio, int flags __unused) @@ -95,10 +93,19 @@ null_ioctl(struct cdev *dev __unused, u_ static int zero_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) { + void *zbuf; + ssize_t len; int error = 0; - while (uio->uio_resid > 0 && error == 0) - error = uiomove(zbuf, MIN(uio->uio_resid, PAGE_SIZE), uio); + KASSERT(uio->uio_rw == UIO_READ, + ("Can't be in %s for write", __func__)); + zbuf = __DECONST(void *, zero_region); + while (uio->uio_resid > 0 && error == 0) { + len = uio->uio_resid; + if (len > ZERO_REGION_SIZE) + len = ZERO_REGION_SIZE; + error = uiomove(zbuf, len, uio); + } return (error); } @@ -111,7 +118,6 @@ null_modevent(module_t mod __unused, int case MOD_LOAD: if (bootverbose) printf("null: \n"); - zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); null_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &null_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0666, "null"); zero_dev = make_dev_credf(MAKEDEV_ETERNAL_KLD, &zero_cdevsw, 0, @@ -121,7 +127,6 @@ null_modevent(module_t mod __unused, int case MOD_UNLOAD: destroy_dev(null_dev); destroy_dev(zero_dev); - free(zbuf, M_TEMP); break; case MOD_SHUTDOWN: Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri May 13 18:46:20 2011 (r221852) +++ head/sys/sys/systm.h Fri May 13 18:48:00 2011 (r221853) @@ -125,6 +125,9 @@ extern char static_hints[]; /* by config extern char **kenvp; +extern const void *zero_region; /* address space maps to a zeroed page */ +#define ZERO_REGION_SIZE (2048 * 1024) + /* * General function declarations. */ Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri May 13 18:46:20 2011 (r221852) +++ head/sys/vm/vm_kern.c Fri May 13 18:48:00 2011 (r221853) @@ -91,6 +91,9 @@ vm_map_t exec_map=0; vm_map_t pipe_map; vm_map_t buffer_map=0; +const void *zero_region; +CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0); + /* * kmem_alloc_nofault: * @@ -527,6 +530,35 @@ kmem_free_wakeup(map, addr, size) vm_map_unlock(map); } +static void +kmem_init_zero_region(void) +{ + vm_offset_t addr; + vm_page_t m; + unsigned int i; + int error; + + /* Allocate virtual address space. */ + addr = kmem_alloc_nofault(kernel_map, ZERO_REGION_SIZE); + + /* Allocate a page and zero it. */ + m = vm_page_alloc(NULL, OFF_TO_IDX(addr - VM_MIN_KERNEL_ADDRESS), + VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); + if ((m->flags & PG_ZERO) == 0) + pmap_zero_page(m); + + /* Map the address space to the page. */ + for (i = 0; i < ZERO_REGION_SIZE; i += PAGE_SIZE) + pmap_qenter(addr + i, &m, 1); + + /* Protect it r/o. */ + error = vm_map_protect(kernel_map, addr, addr + ZERO_REGION_SIZE, + VM_PROT_READ, TRUE); + KASSERT(error == 0, ("error=%d", error)); + + zero_region = (const void *)addr; +} + /* * kmem_init: * @@ -555,6 +587,8 @@ kmem_init(start, end) start, VM_PROT_ALL, VM_PROT_ALL, MAP_NOFAULT); /* ... and ending with the completion of the above `insert' */ vm_map_unlock(m); + + kmem_init_zero_region(); } #ifdef DIAGNOSTIC From owner-svn-src-head@FreeBSD.ORG Fri May 13 19:14:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33BF5106564A; Fri, 13 May 2011 19:14:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id C17638FC12; Fri, 13 May 2011 19:14:22 +0000 (UTC) Received: from c122-106-158-76.carlnfd1.nsw.optusnet.com.au (c122-106-158-76.carlnfd1.nsw.optusnet.com.au [122.106.158.76]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p4DJEJPt010667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 May 2011 05:14:20 +1000 Date: Sat, 14 May 2011 05:14:18 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim In-Reply-To: <201105131257.34009.jkim@FreeBSD.org> Message-ID: <20110514041838.S2545@besplex.bde.org> References: <201105091734.p49HY0P3006180@svn.freebsd.org> <201105121239.31340.jkim@FreeBSD.org> <4DCD2875.9040808@FreeBSD.org> <201105131257.34009.jkim@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r221703 - in head/sys: amd64/include i386/include x86/isa x86/x86 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 19:14:23 -0000 On Fri, 13 May 2011, Jung-uk Kim wrote: > On Friday 13 May 2011 08:47 am, Andriy Gapon wrote: >> on 12/05/2011 19:39 Jung-uk Kim said the following: >>> Actually, I am kinda reluctant to enable smp_tsc by default on >>> recent CPUs. Although they made all TSCs in sync, it is very >>> very tricky to make it work in reality, e.g., >>> >>> https://patchwork.kernel.org/patch/691712/ >> >> I am not sure what is their concern there. >> TSC is good to be used as timecounter. > > *Iff* they are all in sync. and atomically increasing... Not even that. rdtsc is non-serializing, so the TSCs causality may be violated by different reordering of rdtsc on different CPUs. Apparently this happens in practice. I think it would not happen for "rdtsc; rdtsc" in a single thread, since the context switch to execute the rdtsc's on different CPUs would take a long time amd would probably execute some serializing instructions. It might happen for clock_gettime() in separate threads where the threads somehow know and depend on the order of the calls. Shared variables seems to be needed for knowing this, and I don't know how the variables could be accessed atomically enough without serializing the rdtsc's. Apart from that, the code might be: thread 1 thread 2 -------- -------- start1 = gen++; start2 = gen++; clock_gettime(...); clock_gettime(...); end1 = gen++; end2 = gen++; We can hope that first clock_gettime() executed entirely before before the second one if end1 < start2. But without any serialization instructions, the rdtsc's aren't guaranteed to execute between the stores to the variables, so knowing the order of the stores tells us nothing about the order of the rdtsc's. >> If they use TSC for performance measurements, then of course they >> have to use some barriers - this is well known and documented. Also for timecounters. > If my understanding is correct, Linux has to make sure the new timer > value read from a CPU must be written/read to/from memory in order > and all other CPUs must be able see the updated value as their > "vsyscall" and/or "vDSO" version of gettimeofday(2) and friends rely > on it. Also, the last value read from a CPU is kept in memory and > compared with a new value (possibly read from another CPU) to make > sure it is incremental. I'd call it a "TSC-safe" timecounter. ;-) > Some price to pay when you do timekeeping in user space to avoid > syscalls... Hmm, timecounter code intentionally doesn't store the last value read to a shared (kernel) variable due to the cost of doing so, although this causes bugs like times read by the "get*()" interfaces being incoherent with times read by the non-"get*()" interfaces. Perhaps the problem is only visible with the userland implementation, since clock_gettime() is too slow to give it via code like the above if it is a syscall (the rdtsc will be in the middle somewhere and there is plently of time for it to complete before the stores in userland). The Linux discussion says that a change optimizes clock_gettime() from 22 ns to 17 ns on Sandybridge. 20 ns is about the time for a single rdtsc. On AthlonXP, the best I've seen for the FreeBSD syscall is about 250 ns (550 cycles), despite rdtsc only taking 12 cycles on AthlonXP (rdtsc takes more like 40-80 cycles on newer CPUs, for the hardware part of its synchronization :-(). Timecounter calls using thr TSC timecounter in the FreeBSD kernel take only about 50 cycles (when rdtsc takes only 12 cycles), but syscalls add a lot. >> BTW, newer CPUs provide RDTSCP instruction which could be more >> convenient there. > > AFAIK, some people wanted to do that but Linus thought RDTSCP is too > expensive as it is a serialized instruction. The whole point of the Linux discussion is to reduce the synchronization that they already have (a couple of fence instructions). Bruce From owner-svn-src-head@FreeBSD.ORG Fri May 13 19:35:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DBA1106566C; Fri, 13 May 2011 19:35:02 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 081B68FC15; Fri, 13 May 2011 19:35:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DJZ1WW080524; Fri, 13 May 2011 19:35:01 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DJZ14Q080511; Fri, 13 May 2011 19:35:01 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201105131935.p4DJZ14Q080511@svn.freebsd.org> From: Matthew D Fleming Date: Fri, 13 May 2011 19:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221855 - in head/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 19:35:02 -0000 Author: mdf Date: Fri May 13 19:35:01 2011 New Revision: 221855 URL: http://svn.freebsd.org/changeset/base/221855 Log: Move the ZERO_REGION_SIZE to a machine-dependent file, as on many architectures (i386, for example) the virtual memory space may be constrained enough that 2MB is a large chunk. Use 64K for arches other than amd64 and ia64, with special handling for sparc64 due to differing hardware. Also commit the comment changes to kmem_init_zero_region() that I missed due to not saving the file. (Darn the unfamiliar development environment). Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you see fit. Requested by: alc MFC after: 1 week MFC with: r221853 Modified: head/sys/amd64/include/vmparam.h head/sys/arm/include/vmparam.h head/sys/dev/md/md.c head/sys/dev/null/null.c head/sys/i386/include/vmparam.h head/sys/ia64/include/vmparam.h head/sys/mips/include/vmparam.h head/sys/powerpc/include/vmparam.h head/sys/sparc64/include/vmparam.h head/sys/sun4v/include/vmparam.h head/sys/sys/systm.h head/sys/vm/vm_kern.c Modified: head/sys/amd64/include/vmparam.h ============================================================================== --- head/sys/amd64/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/amd64/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -212,4 +212,6 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/arm/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -150,4 +150,7 @@ #ifdef ARM_USE_SMALL_ALLOC #define UMA_MD_SMALL_ALLOC #endif /* ARM_USE_SMALL_ALLOC */ + +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Fri May 13 19:18:15 2011 (r221854) +++ head/sys/dev/md/md.c Fri May 13 19:35:01 2011 (r221855) @@ -89,6 +89,8 @@ #include #include +#include + #define MD_MODVER 1 #define MD_SHUTDOWN 0x10000 /* Tell worker thread to terminate. */ Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Fri May 13 19:18:15 2011 (r221854) +++ head/sys/dev/null/null.c Fri May 13 19:35:01 2011 (r221855) @@ -39,7 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include +#include /* For use with destroy_dev(9). */ static struct cdev *null_dev; Modified: head/sys/i386/include/vmparam.h ============================================================================== --- head/sys/i386/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/i386/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -198,4 +198,6 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/ia64/include/vmparam.h ============================================================================== --- head/sys/ia64/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/ia64/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -215,4 +215,6 @@ #define VM_INITIAL_PAGEIN 16 #endif +#define ZERO_REGION_SIZE (2 * 1024 * 1024) /* 2MB */ + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/mips/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -187,4 +187,6 @@ */ #define VM_NFREEORDER 9 +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/powerpc/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -198,4 +198,6 @@ struct pmap_physseg { #endif #endif +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/sparc64/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -240,4 +240,11 @@ extern vm_offset_t vm_max_kernel_address; +/* + * Older sparc64 machines have a virtually indexed L1 data cache of 16KB. + * Consequently, mapping the same physical page multiple times may have + * caching disabled. + */ +#define ZERO_REGION_SIZE PAGE_SIZE + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/sun4v/include/vmparam.h ============================================================================== --- head/sys/sun4v/include/vmparam.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/sun4v/include/vmparam.h Fri May 13 19:35:01 2011 (r221855) @@ -223,4 +223,6 @@ #define UMA_MD_SMALL_ALLOC extern vm_offset_t vm_max_kernel_address; +#define ZERO_REGION_SIZE (64 * 1024) /* 64KB */ + #endif /* !_MACHINE_VMPARAM_H_ */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Fri May 13 19:18:15 2011 (r221854) +++ head/sys/sys/systm.h Fri May 13 19:35:01 2011 (r221855) @@ -126,7 +126,6 @@ extern char static_hints[]; /* by config extern char **kenvp; extern const void *zero_region; /* address space maps to a zeroed page */ -#define ZERO_REGION_SIZE (2048 * 1024) /* * General function declarations. Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri May 13 19:18:15 2011 (r221854) +++ head/sys/vm/vm_kern.c Fri May 13 19:35:01 2011 (r221855) @@ -533,25 +533,22 @@ kmem_free_wakeup(map, addr, size) static void kmem_init_zero_region(void) { - vm_offset_t addr; + vm_offset_t addr, i; vm_page_t m; - unsigned int i; int error; - /* Allocate virtual address space. */ + /* + * Map a single physical page of zeros to a larger virtual range. + * This requires less looping in places that want large amounts of + * zeros, while not using much more physical resources. + */ addr = kmem_alloc_nofault(kernel_map, ZERO_REGION_SIZE); - - /* Allocate a page and zero it. */ m = vm_page_alloc(NULL, OFF_TO_IDX(addr - VM_MIN_KERNEL_ADDRESS), VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | VM_ALLOC_ZERO); if ((m->flags & PG_ZERO) == 0) pmap_zero_page(m); - - /* Map the address space to the page. */ for (i = 0; i < ZERO_REGION_SIZE; i += PAGE_SIZE) pmap_qenter(addr + i, &m, 1); - - /* Protect it r/o. */ error = vm_map_protect(kernel_map, addr, addr + ZERO_REGION_SIZE, VM_PROT_READ, TRUE); KASSERT(error == 0, ("error=%d", error)); From owner-svn-src-head@FreeBSD.ORG Fri May 13 19:40:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73FD5106566B; Fri, 13 May 2011 19:40:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E9FE8FC08; Fri, 13 May 2011 19:40:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DJe27K080657; Fri, 13 May 2011 19:40:02 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DJe25I080655; Fri, 13 May 2011 19:40:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105131940.p4DJe25I080655@svn.freebsd.org> From: Warner Losh Date: Fri, 13 May 2011 19:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221856 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 19:40:02 -0000 Author: imp Date: Fri May 13 19:40:02 2011 New Revision: 221856 URL: http://svn.freebsd.org/changeset/base/221856 Log: If there's no package directory, don't try to install packages from it. Instead, report that 0 packages are reported. PR: misc/140436 Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Fri May 13 19:35:01 2011 (r221855) +++ head/tools/tools/nanobsd/nanobsd.sh Fri May 13 19:40:02 2011 (r221856) @@ -684,6 +684,12 @@ cust_install_files () ( cust_pkg () ( + # If the package directory doesn't exist, we're done. + if [ ! -d ${NANO_PACKAGE_DIR} ]; then + echo "DONE 0 packages" + return 0 + fi + # Copy packages into chroot mkdir -p ${NANO_WORLDDIR}/Pkg ( From owner-svn-src-head@FreeBSD.ORG Fri May 13 19:40:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E881065672; Fri, 13 May 2011 19:40:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE5F8FC16; Fri, 13 May 2011 19:40:18 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4DJeEBZ068530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 May 2011 22:40:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4DJeEwP055951; Fri, 13 May 2011 22:40:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4DJeE8T055950; Fri, 13 May 2011 22:40:14 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 May 2011 22:40:14 +0300 From: Kostik Belousov To: Matthew D Fleming Message-ID: <20110513194014.GZ48734@deviant.kiev.zoral.com.ua> References: <201105131935.p4DJZ14Q080511@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mqRNdCMOlOOulWfi" Content-Disposition: inline In-Reply-To: <201105131935.p4DJZ14Q080511@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221855 - in head/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 19:40:19 -0000 --mqRNdCMOlOOulWfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 13, 2011 at 07:35:01PM +0000, Matthew D Fleming wrote: > Author: mdf > Date: Fri May 13 19:35:01 2011 > New Revision: 221855 > URL: http://svn.freebsd.org/changeset/base/221855 >=20 > Log: > Move the ZERO_REGION_SIZE to a machine-dependent file, as on many > architectures (i386, for example) the virtual memory space may be > constrained enough that 2MB is a large chunk. Use 64K for arches > other than amd64 and ia64, with special handling for sparc64 due to > differing hardware. > =20 > Also commit the comment changes to kmem_init_zero_region() that I > missed due to not saving the file. (Darn the unfamiliar development > environment). > =20 > Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you > see fit. > =20 > Requested by: alc > MFC after: 1 week > MFC with: r221853 Wasting 2MB even on amd64 is not quite good, IMHO. --mqRNdCMOlOOulWfi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3NiR4ACgkQC3+MBN1Mb4jONgCdEuOajh7V/PpGpF9H7k8F2qHg xcoAnj240yZKpNOEvZmQehz9EZGqx04v =wNSm -----END PGP SIGNATURE----- --mqRNdCMOlOOulWfi-- From owner-svn-src-head@FreeBSD.ORG Fri May 13 20:06:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0AC61065673; Fri, 13 May 2011 20:06:05 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh2.mail.rice.edu (mh2.mail.rice.edu [128.42.201.21]) by mx1.freebsd.org (Postfix) with ESMTP id A68088FC12; Fri, 13 May 2011 20:06:05 +0000 (UTC) Received: from mh2.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh2.mail.rice.edu (Postfix) with ESMTP id 4F4AF2909DC; Fri, 13 May 2011 14:46:10 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh2.mail.rice.edu, auth channel Received: from mh2.mail.rice.edu ([127.0.0.1]) by mh2.mail.rice.edu (mh2.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id iTE0OcNTdRAk; Fri, 13 May 2011 14:46:10 -0500 (CDT) Received: from [172.24.99.82] (unknown [192.75.139.249]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh2.mail.rice.edu (Postfix) with ESMTPSA id 8C80D2909DA; Fri, 13 May 2011 14:46:09 -0500 (CDT) Message-ID: <4DCD8A6B.3000204@rice.edu> Date: Fri, 13 May 2011 14:45:47 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Kostik Belousov References: <201105131935.p4DJZ14Q080511@svn.freebsd.org> <20110513194014.GZ48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110513194014.GZ48734@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221855 - in head/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 20:06:05 -0000 On 5/13/2011 2:40 PM, Kostik Belousov wrote: > On Fri, May 13, 2011 at 07:35:01PM +0000, Matthew D Fleming wrote: >> Author: mdf >> Date: Fri May 13 19:35:01 2011 >> New Revision: 221855 >> URL: http://svn.freebsd.org/changeset/base/221855 >> >> Log: >> Move the ZERO_REGION_SIZE to a machine-dependent file, as on many >> architectures (i386, for example) the virtual memory space may be >> constrained enough that 2MB is a large chunk. Use 64K for arches >> other than amd64 and ia64, with special handling for sparc64 due to >> differing hardware. >> >> Also commit the comment changes to kmem_init_zero_region() that I >> missed due to not saving the file. (Darn the unfamiliar development >> environment). >> >> Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you >> see fit. >> >> Requested by: alc >> MFC after: 1 week >> MFC with: r221853 > Wasting 2MB even on amd64 is not quite good, IMHO. It's virtual address space, of which we have 512GB on amd64, and not physical memory. Only one page of physical memory is used. Alan From owner-svn-src-head@FreeBSD.ORG Fri May 13 20:08:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76632106564A; Fri, 13 May 2011 20:08:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E029B8FC13; Fri, 13 May 2011 20:08:00 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4DK7voY070269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 May 2011 23:07:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4DK7u7b056103; Fri, 13 May 2011 23:07:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4DK7uEJ056102; Fri, 13 May 2011 23:07:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 13 May 2011 23:07:56 +0300 From: Kostik Belousov To: Alan Cox Message-ID: <20110513200756.GA48734@deviant.kiev.zoral.com.ua> References: <201105131935.p4DJZ14Q080511@svn.freebsd.org> <20110513194014.GZ48734@deviant.kiev.zoral.com.ua> <4DCD8A6B.3000204@rice.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aQoHefV7R8EJhyq8" Content-Disposition: inline In-Reply-To: <4DCD8A6B.3000204@rice.edu> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221855 - in head/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 20:08:01 -0000 --aQoHefV7R8EJhyq8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 13, 2011 at 02:45:47PM -0500, Alan Cox wrote: > On 5/13/2011 2:40 PM, Kostik Belousov wrote: > >On Fri, May 13, 2011 at 07:35:01PM +0000, Matthew D Fleming wrote: > >>Author: mdf > >>Date: Fri May 13 19:35:01 2011 > >>New Revision: 221855 > >>URL: http://svn.freebsd.org/changeset/base/221855 > >> > >>Log: > >> Move the ZERO_REGION_SIZE to a machine-dependent file, as on many > >> architectures (i386, for example) the virtual memory space may be > >> constrained enough that 2MB is a large chunk. Use 64K for arches > >> other than amd64 and ia64, with special handling for sparc64 due to > >> differing hardware. > >> > >> Also commit the comment changes to kmem_init_zero_region() that I > >> missed due to not saving the file. (Darn the unfamiliar development > >> environment). > >> > >> Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you > >> see fit. > >> > >> Requested by: alc > >> MFC after: 1 week > >> MFC with: r221853 > >Wasting 2MB even on amd64 is not quite good, IMHO. >=20 > It's virtual address space, of which we have 512GB on amd64, and not=20 > physical memory. Only one page of physical memory is used. I should have read the patch more careful. Sorry. --aQoHefV7R8EJhyq8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3Nj5wACgkQC3+MBN1Mb4hnAgCg9H1sf9o7qfsMzmvb58YXlmID LBsAn16fgnDKtouNv1SbV5+/E94im5ci =XKOK -----END PGP SIGNATURE----- --aQoHefV7R8EJhyq8-- From owner-svn-src-head@FreeBSD.ORG Fri May 13 20:41:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62C231065674; Fri, 13 May 2011 20:41:33 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 39CF78FC13; Fri, 13 May 2011 20:41:33 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id AC2462908C5; Fri, 13 May 2011 15:41:32 -0500 (CDT) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id QmoOlDTNXVBq; Fri, 13 May 2011 15:41:32 -0500 (CDT) Received: from [172.24.99.82] (unknown [192.75.139.249]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 488C02908C3; Fri, 13 May 2011 15:41:32 -0500 (CDT) Message-ID: <4DCD9766.4010601@rice.edu> Date: Fri, 13 May 2011 15:41:10 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Matthew D Fleming References: <201105131935.p4DJZ14Q080511@svn.freebsd.org> In-Reply-To: <201105131935.p4DJZ14Q080511@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221855 - in head/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 20:41:33 -0000 On 5/13/2011 2:35 PM, Matthew D Fleming wrote: > Author: mdf > Date: Fri May 13 19:35:01 2011 > New Revision: 221855 > URL: http://svn.freebsd.org/changeset/base/221855 > > Log: > Move the ZERO_REGION_SIZE to a machine-dependent file, as on many > architectures (i386, for example) the virtual memory space may be > constrained enough that 2MB is a large chunk. Use 64K for arches > other than amd64 and ia64, with special handling for sparc64 due to > differing hardware. > > Also commit the comment changes to kmem_init_zero_region() that I > missed due to not saving the file. (Darn the unfamiliar development > environment). > > Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you > see fit. > > Requested by: alc > MFC after: 1 week > MFC with: r221853 I would encourage people on platforms with virtually indexed data caches to do a simple before and after performance test on this change, like "dd if=/dev/zero of=/dev/null bs=64k", just to make sure that there are no performance regressions. Alan From owner-svn-src-head@FreeBSD.ORG Fri May 13 22:35:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5BA1065673; Fri, 13 May 2011 22:35:07 +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 30B308FC08; Fri, 13 May 2011 22:35:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DMZ7bd084266; Fri, 13 May 2011 22:35:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DMZ7BR084264; Fri, 13 May 2011 22:35:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201105132235.p4DMZ7BR084264@svn.freebsd.org> From: Xin LI Date: Fri, 13 May 2011 22:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221860 - head/usr.bin/rpcinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 22:35:07 -0000 Author: delphij Date: Fri May 13 22:35:06 2011 New Revision: 221860 URL: http://svn.freebsd.org/changeset/base/221860 Log: Constify a few string variables. While I'm there, also convert usage() to use a prototype. MFC after: 2 weeks Modified: head/usr.bin/rpcinfo/rpcinfo.c Modified: head/usr.bin/rpcinfo/rpcinfo.c ============================================================================== --- head/usr.bin/rpcinfo/rpcinfo.c Fri May 13 21:25:14 2011 (r221859) +++ head/usr.bin/rpcinfo/rpcinfo.c Fri May 13 22:35:06 2011 (r221860) @@ -128,9 +128,9 @@ struct rpcbdump_short { #ifdef PORTMAP -static void ip_ping(u_short, char *, int, char **); +static void ip_ping(u_short, const char *, int, char **); static CLIENT *clnt_com_create(struct sockaddr_in *, u_long, u_long, int *, - char *); + const char *); static void pmapdump(int, char **); static void get_inet_address(struct sockaddr_in *, char *); #endif @@ -336,7 +336,7 @@ local_rpcb(u_long prog, u_long vers) #ifdef PORTMAP static CLIENT * clnt_com_create(struct sockaddr_in *addr, u_long prog, u_long vers, - int *fdp, char *trans) + int *fdp, const char *trans) { CLIENT *clnt; @@ -369,7 +369,7 @@ clnt_com_create(struct sockaddr_in *addr * version 0 calls succeeds, it tries for MAXVERS call and repeats the same. */ static void -ip_ping(u_short portnum, char *trans, int argc, char **argv) +ip_ping(u_short portnum, const char *trans, int argc, char **argv) { CLIENT *client; int fd = RPC_ANYFD; @@ -594,7 +594,7 @@ reply_proc(void *res, struct netbuf *who { char *uaddr; char hostbuf[NI_MAXHOST]; - char *hostname; + const char *hostname; struct sockaddr *sa = (struct sockaddr *)who->buf; if (getnameinfo(sa, sa->sa_len, hostbuf, NI_MAXHOST, NULL, 0, 0)) { @@ -987,15 +987,15 @@ rpcbgetstat(int argc, char **argv) #define MAXLINE 256 char linebuf[MAXLINE]; char *cp, *lp; - char *pmaphdr[] = { + const char *pmaphdr[] = { "NULL", "SET", "UNSET", "GETPORT", "DUMP", "CALLIT" }; - char *rpcb3hdr[] = { + const char *rpcb3hdr[] = { "NULL", "SET", "UNSET", "GETADDR", "DUMP", "CALLIT", "TIME", "U2T", "T2U" }; - char *rpcb4hdr[] = { + const char *rpcb4hdr[] = { "NULL", "SET", "UNSET", "GETADDR", "DUMP", "CALLIT", "TIME", "U2T", "T2U", "VERADDR", "INDRECT", "GETLIST", "GETSTAT" }; @@ -1455,7 +1455,7 @@ progping(char *netid, int argc, char **a } static void -usage() +usage(void) { fprintf(stderr, "usage: rpcinfo [-m | -s] [host]\n"); #ifdef PORTMAP @@ -1536,7 +1536,7 @@ pstatus(register CLIENT *client, u_long static CLIENT * clnt_rpcbind_create(char *host, int rpcbversnum, struct netbuf **targaddr) { - static char *tlist[3] = { + static const char *tlist[3] = { "circuit_n", "circuit_v", "datagram_v" }; int i; From owner-svn-src-head@FreeBSD.ORG Fri May 13 23:10:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40700106564A; Fri, 13 May 2011 23:10:56 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 305248FC0A; Fri, 13 May 2011 23:10:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4DNAuH7085094; Fri, 13 May 2011 23:10:56 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4DNAu2n085092; Fri, 13 May 2011 23:10:56 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105132310.p4DNAu2n085092@svn.freebsd.org> From: Stanislav Sedov Date: Fri, 13 May 2011 23:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221862 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 23:10:56 -0000 Author: stas Date: Fri May 13 23:10:55 2011 New Revision: 221862 URL: http://svn.freebsd.org/changeset/base/221862 Log: - Bump __FreeBSD_version to note the revision when libprocstat(3) and fuser(1) have been added to the tree. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri May 13 22:48:44 2011 (r221861) +++ head/sys/sys/param.h Fri May 13 23:10:55 2011 (r221862) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900036 /* Master, propagated to newvers */ +#define __FreeBSD_version 900037 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-head@FreeBSD.ORG Sat May 14 01:10:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2EC58106566C; Sat, 14 May 2011 01:10:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E85F8FC08; Sat, 14 May 2011 01:10:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E1AwcK088068; Sat, 14 May 2011 01:10:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E1Awgm088066; Sat, 14 May 2011 01:10:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201105140110.p4E1Awgm088066@svn.freebsd.org> From: John Baldwin Date: Sat, 14 May 2011 01:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221867 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 01:10:58 -0000 Author: jhb Date: Sat May 14 01:10:57 2011 New Revision: 221867 URL: http://svn.freebsd.org/changeset/base/221867 Log: Merge comments about converting directory entries to be more direct and concise. Inspired by: Gleb Kurtsou Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Sat May 14 00:45:35 2011 (r221866) +++ head/sys/fs/ext2fs/ext2_lookup.c Sat May 14 01:10:57 2011 (r221867) @@ -119,17 +119,11 @@ static int ext2_dirbadentry(struct vnode /* * Vnode op for reading directories. * - * The routine below assumes that the on-disk format of a directory - * is the same as that defined by . If the on-disk - * format changes, then it will be necessary to do a conversion - * from the on-disk format that read returns to the format defined - * by . - */ -/* - * this is exactly what we do here - the problem is that the conversion - * will blow up some entries by four bytes, so it can't be done in place. - * This is too bad. Right now the conversion is done entry by entry, the - * converted entry is sent via uiomove. + * This function has to convert directory entries from the on-disk + * format to the format defined by . Unfortunately, the + * conversion will blow up some entries by four bytes, so it can't be + * done in place. Instead, the conversion is done entry by entry and + * the converted entry is sent via uiomove. * * XXX allocate a buffer, convert as many entries as possible, then send * the whole buffer to uiomove From owner-svn-src-head@FreeBSD.ORG Sat May 14 01:41:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B431B1065672; Sat, 14 May 2011 01:41:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3ED28FC14; Sat, 14 May 2011 01:41:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E1fa2Y088657; Sat, 14 May 2011 01:41:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E1faiH088655; Sat, 14 May 2011 01:41:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105140141.p4E1faiH088655@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 01:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221868 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 01:41:36 -0000 Author: adrian Date: Sat May 14 01:41:36 2011 New Revision: 221868 URL: http://svn.freebsd.org/changeset/base/221868 Log: Even though initial calibrations aren't done (yet), add this so we're consistent with the Atheros HAL. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat May 14 01:10:57 2011 (r221867) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat May 14 01:41:36 2011 (r221868) @@ -277,7 +277,7 @@ ar5416InitCal(struct ath_hal *ah, const /* * Enable IQ, ADC Gain, ADC DC Offset Cals */ - if (AR_SREV_SOWL_10_OR_LATER(ah)) { + if (AR_SREV_HOWL(ah) || AR_SREV_SOWL_10_OR_LATER(ah)) { /* Setup all non-periodic, init time only calibrations */ /* XXX: Init DC Offset not working yet */ #if 0 From owner-svn-src-head@FreeBSD.ORG Sat May 14 01:53:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92849106564A; Sat, 14 May 2011 01:53:39 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0ED8FC0A; Sat, 14 May 2011 01:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E1rd2G088949; Sat, 14 May 2011 01:53:39 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E1rdSQ088923; Sat, 14 May 2011 01:53:39 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105140153.p4E1rdSQ088923@svn.freebsd.org> From: Attilio Rao Date: Sat, 14 May 2011 01:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221869 - in head: . gnu/usr.bin/send-pr lib/libc/sparc64/sys lib/libdisk lib/libkvm release/doc/share/sgml share/man/man4 share/man/man5 sys sys/boot sys/boot/common sys/boot/sparc64/l... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 01:53:39 -0000 Author: attilio Date: Sat May 14 01:53:38 2011 New Revision: 221869 URL: http://svn.freebsd.org/changeset/base/221869 Log: Disconnect sun4v architecture from the three. Some files keep the SUN4V tags as a code reference, for the future, if any rewamped sun4v support wants to be added again. Reviewed by: marius Tested by: sbruno Approved by: re Modified: head/Makefile head/Makefile.inc1 head/UPDATING head/gnu/usr.bin/send-pr/categories head/gnu/usr.bin/send-pr/send-pr.1 head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sparc64/sys/__sparc_utrap_gen.S head/lib/libdisk/Makefile head/lib/libkvm/Makefile head/lib/libkvm/kvm_sparc64.c head/release/doc/share/sgml/release.ent head/share/man/man4/ddb.4 head/share/man/man5/src.conf.5 head/sys/Makefile head/sys/boot/Makefile head/sys/boot/common/loader.8 head/sys/boot/sparc64/loader/main.c head/sys/dev/ath/ath_rate/sample/tx_schedules.h head/sys/modules/mem/Makefile head/sys/modules/uart/Makefile head/sys/sparc64/sparc64/autoconf.c head/sys/sparc64/sparc64/genassym.c head/sys/sparc64/sparc64/mem.c head/sys/sys/kdb.h head/usr.sbin/bsdinstall/partedit/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -131,7 +131,7 @@ _MAKE= PATH=${PATH} ${BINMAKE} -f Makefi # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) -_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/sun4v/sparc64/:S/mips/mipsel/} +_TARGET_ARCH= ${TARGET:S/pc98/i386/:S/mips/mipsel/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} _TARGET= ${TARGET_ARCH:C/mips.*e[lb]/mips/:C/armeb/arm/} @@ -323,12 +323,11 @@ toolchains: # existing system is. # .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets) -TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 TARGET_ARCHES_arm?= arm armeb TARGET_ARCHES_mips?= mipsel mipseb mips64el mips64eb mipsn32eb TARGET_ARCHES_powerpc?= powerpc powerpc64 TARGET_ARCHES_pc98?= i386 -TARGET_ARCHES_sun4v?= sparc64 .for target in ${TARGETS} TARGET_ARCHES_${target}?= ${target} .endfor Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sat May 14 01:41:36 2011 (r221868) +++ head/Makefile.inc1 Sat May 14 01:53:38 2011 (r221869) @@ -130,7 +130,7 @@ VERSION!= uname -srp VERSION+= ${OSRELDATE} .endif -KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc powerpc64/powerpc sparc64 sparc64/sun4v +KNOWN_ARCHES?= amd64 arm armeb/arm i386 i386/pc98 ia64 mipsel/mips mipseb/mips mips64el/mips mips64eb/mips mipsn32el/mips mipsn32eb/mips powerpc powerpc64/powerpc sparc64 .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat May 14 01:41:36 2011 (r221868) +++ head/UPDATING Sat May 14 01:53:38 2011 (r221869) @@ -22,6 +22,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110513: + Support for sun4v architecture is officially dropped + 20110430: Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci' into their kernel configurations along with 'device pci'. Modified: head/gnu/usr.bin/send-pr/categories ============================================================================== --- head/gnu/usr.bin/send-pr/categories Sat May 14 01:41:36 2011 (r221868) +++ head/gnu/usr.bin/send-pr/categories Sat May 14 01:53:38 2011 (r221869) @@ -16,7 +16,6 @@ ports powerpc sparc64 standards -sun4v threads usb www Modified: head/gnu/usr.bin/send-pr/send-pr.1 ============================================================================== --- head/gnu/usr.bin/send-pr/send-pr.1 Sat May 14 01:41:36 2011 (r221868) +++ head/gnu/usr.bin/send-pr/send-pr.1 Sat May 14 01:53:38 2011 (r221869) @@ -233,9 +233,6 @@ SPARC processor specific problems. .B standards Standards conformance issues. .TP -.B sun4v -Problems specific to the SPARC sun4v architecture and processors. -.TP .B threads Problems related to threading on FreeBSD. .TP Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Sat May 14 01:41:36 2011 (r221868) +++ head/lib/libc/sparc64/sys/Makefile.inc Sat May 14 01:53:38 2011 (r221869) @@ -11,9 +11,6 @@ SRCS+= __sparc_sigtramp_setup.c \ sigcode.S CFLAGS+= -I${.CURDIR}/sparc64/fpu -.if ${MACHINE} == "sun4v" -CFLAGS+= -DSUN4V -.endif MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction.S Modified: head/lib/libc/sparc64/sys/__sparc_utrap_gen.S ============================================================================== --- head/lib/libc/sparc64/sys/__sparc_utrap_gen.S Sat May 14 01:41:36 2011 (r221868) +++ head/lib/libc/sparc64/sys/__sparc_utrap_gen.S Sat May 14 01:53:38 2011 (r221869) @@ -38,10 +38,6 @@ __FBSDID("$FreeBSD$"); #include "assym.s" ENTRY(__sparc_utrap_gen) -#ifdef SUN4V - save - ta %xcc, ST_FPEMU_CONTEXT -#endif sub %sp, UF_SIZEOF, %sp stx %o0, [%sp + SPOFF + CCFSZ + UF_TYPE] Modified: head/lib/libdisk/Makefile ============================================================================== --- head/lib/libdisk/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/lib/libdisk/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -10,11 +10,7 @@ _open_disk= open_disk.c LIB= disk SRCS= blocks.c ${_change} chunk.c create_chunk.c disk.c ${_open_disk} \ rules.c write_disk.c -.if ${MACHINE} == "sun4v" -SRCS+= write_sparc64_disk.c -.else SRCS+= write_${MACHINE}_disk.c -.endif INCS= libdisk.h Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/lib/libkvm/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -5,10 +5,6 @@ LIB= kvm SHLIBDIR?= /lib CFLAGS+=-DLIBC_SCCS -I${.CURDIR} -.if ${MACHINE} == "sun4v" -CFLAGS+=-DSUN4V -.endif - .if exists(${.CURDIR}/kvm_${MACHINE_ARCH}.c) KVM_ARCH=${MACHINE_ARCH} .else Modified: head/lib/libkvm/kvm_sparc64.c ============================================================================== --- head/lib/libkvm/kvm_sparc64.c Sat May 14 01:41:36 2011 (r221868) +++ head/lib/libkvm/kvm_sparc64.c Sat May 14 01:53:38 2011 (r221869) @@ -188,11 +188,9 @@ fail_vm: int _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { -#if !defined(SUN4V) struct tte tte; off_t tte_off; u_long vpn; -#endif off_t pa_off; u_long pg_off; int rest; @@ -200,7 +198,6 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t pg_off = va & PAGE_MASK; if (va >= VM_MIN_DIRECT_ADDRESS) pa_off = TLB_DIRECT_TO_PHYS(va) & ~PAGE_MASK; -#if !defined(SUN4V) else { vpn = btop(va); tte_off = kd->vmst->vm_tsb_off + @@ -211,7 +208,6 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t goto invalid; pa_off = TTE_GET_PA(&tte); } -#endif rest = PAGE_SIZE - pg_off; pa_off = _kvm_find_off(kd->vmst, pa_off, rest); if (pa_off == KVM_OFF_NOTFOUND) Modified: head/release/doc/share/sgml/release.ent ============================================================================== --- head/release/doc/share/sgml/release.ent Sat May 14 01:41:36 2011 (r221868) +++ head/release/doc/share/sgml/release.ent Sat May 14 01:53:38 2011 (r221869) @@ -57,7 +57,6 @@ - Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Sat May 14 01:41:36 2011 (r221868) +++ head/share/man/man4/ddb.4 Sat May 14 01:53:38 2011 (r221869) @@ -1373,7 +1373,7 @@ The kernel debugger was entered as a res sysctl being set. .It Dv kdb.enter.trapsig The kernel debugger was entered as a result of a trapsig event on the sparc64 -or sun4v platform. +platform. .It Dv kdb.enter.unionfs The kernel debugger was entered as a result of an assertion failure in the union file system. Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat May 14 01:41:36 2011 (r221868) +++ head/share/man/man5/src.conf.5 Sat May 14 01:53:38 2011 (r221869) @@ -257,7 +257,7 @@ When set, it also enforces the following Set to not build the Clang C/C++ compiler. .Pp It is a default setting on -arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc64, sparc64/sparc64 and sun4v/sparc64. +arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. @@ -337,7 +337,7 @@ Set to not build Flattened Device Tree s This includes the device tree compiler (dtc) and libfdt support library. .Pp It is a default setting on -amd64/amd64, i386/i386, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, pc98/i386, powerpc/powerpc64, sparc64/sparc64 and sun4v/sparc64. +amd64/amd64, i386/i386, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb, pc98/i386, powerpc/powerpc64 and sparc64/sparc64. .It Va WITH_FDT .\" from FreeBSD: head/tools/build/options/WITH_FDT 221730 2011-05-10 11:14:40Z ru Set to build Flattened Device Tree support as part of the base system. Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/sys/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -14,7 +14,7 @@ CSCOPEDIRS= boot bsm cam cddl compat con netsmb nfs nfsclient nfsserver nlm opencrypto \ pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR} .if defined(ALL_ARCH) -CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v x86 +CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86 .else CSCOPE_ARCHDIR ?= ${MACHINE} .endif Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/sys/boot/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -13,7 +13,7 @@ SUBDIR+= fdt .endif # Pick the machine-dependent subdir based on the target architecture. -ADIR= ${MACHINE:S/amd64/i386/:S/sun4v/sparc64/:S/powerpc64/powerpc/} +ADIR= ${MACHINE:S/amd64/i386/:S/powerpc64/powerpc/} .if exists(${.CURDIR}/${ADIR}/.) SUBDIR+= ${ADIR} .endif Modified: head/sys/boot/common/loader.8 ============================================================================== --- head/sys/boot/common/loader.8 Sat May 14 01:41:36 2011 (r221868) +++ head/sys/boot/common/loader.8 Sat May 14 01:53:38 2011 (r221869) @@ -597,7 +597,7 @@ Modifies kernel option Limits the amount of KVM reserved for use by the buffer cache, specified in bytes. The default maximum is 200MB on i386, -and 400MB on amd64, sparc64, and sun4v. +and 400MB on amd64 and sparc64. This parameter is used to prevent the buffer cache from eating too much KVM in large-memory machine configurations. Modified: head/sys/boot/sparc64/loader/main.c ============================================================================== --- head/sys/boot/sparc64/loader/main.c Sat May 14 01:41:36 2011 (r221868) +++ head/sys/boot/sparc64/loader/main.c Sat May 14 01:53:38 2011 (r221869) @@ -113,13 +113,11 @@ static int map_phys(int, size_t, vm_offs static void release_phys(vm_offset_t, u_int); static int __elfN(exec)(struct preloaded_file *); static int mmu_mapin_sun4u(vm_offset_t, vm_size_t); -static int mmu_mapin_sun4v(vm_offset_t, vm_size_t); static vm_offset_t init_heap(void); static phandle_t find_bsp_sun4u(phandle_t, uint32_t); const char *cpu_cpuid_prop_sun4u(void); uint32_t cpu_get_mid_sun4u(void); static void tlb_init_sun4u(void); -static void tlb_init_sun4v(void); #ifdef LOADER_DEBUG typedef u_int64_t tte_t; @@ -129,7 +127,6 @@ static void pmap_print_tte_sun4u(tte_t, #endif static struct mmu_ops mmu_ops_sun4u = { tlb_init_sun4u, mmu_mapin_sun4u }; -static struct mmu_ops mmu_ops_sun4v = { tlb_init_sun4v, mmu_mapin_sun4v }; /* sun4u */ struct tlb_entry *dtlb_store; @@ -140,16 +137,6 @@ static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; -/* sun4v */ -static struct tlb_entry *tlb_store; -static int is_sun4v = 0; -/* - * no direct TLB access on sun4v - * we somewhat arbitrarily declare enough - * slots to cover a 4GB AS with 4MB pages - */ -#define SUN4V_TLB_SLOT_MAX (1 << 10) - static vm_offset_t curkva = 0; static vm_offset_t heapva; @@ -568,47 +555,6 @@ mmu_mapin_sun4u(vm_offset_t va, vm_size_ return (0); } -static int -mmu_mapin_sun4v(vm_offset_t va, vm_size_t len) -{ - vm_offset_t pa, mva; - - if (va + len > curkva) - curkva = va + len; - - pa = (vm_offset_t)-1; - len += va & PAGE_MASK_4M; - va &= ~PAGE_MASK_4M; - while (len) { - if ((va >> 22) > SUN4V_TLB_SLOT_MAX) - panic("%s: trying to map more than 4GB", __func__); - if (tlb_store[va >> 22].te_pa == -1) { - /* Allocate a physical page, claim the virtual area */ - if (pa == (vm_offset_t)-1) { - pa = alloc_phys(PAGE_SIZE_4M, PAGE_SIZE_4M); - if (pa == (vm_offset_t)-1) - panic("%s: out of memory", __func__); - mva = claim_virt(va, PAGE_SIZE_4M, 0); - if (mva != va) - panic("%s: can't claim virtual page " - "(wanted %#lx, got %#lx)", - __func__, va, mva); - } - - tlb_store[va >> 22].te_pa = pa; - if (map_phys(-1, PAGE_SIZE_4M, va, pa) == -1) - printf("%s: can't map physical page\n", - __func__); - pa = (vm_offset_t)-1; - } - len -= len > PAGE_SIZE_4M ? PAGE_SIZE_4M : len; - va += PAGE_SIZE_4M; - } - if (pa != (vm_offset_t)-1) - release_phys(pa, PAGE_SIZE_4M); - return (0); -} - static vm_offset_t init_heap(void) { @@ -739,14 +685,6 @@ tlb_init_sun4u(void) panic("%s: can't allocate TLB store", __func__); } -static void -tlb_init_sun4v(void) -{ - - tlb_store = malloc(SUN4V_TLB_SLOT_MAX * sizeof(*tlb_store)); - memset(tlb_store, 0xFF, SUN4V_TLB_SLOT_MAX * sizeof(*tlb_store)); -} - int main(int (*openfirm)(void *)) { @@ -777,14 +715,7 @@ main(int (*openfirm)(void *)) if ((root = OF_peer(0)) == -1) panic("%s: can't get root phandle", __func__); OF_getprop(root, "compatible", compatible, sizeof(compatible)); - if (!strcmp(compatible, "sun4v")) { - printf("\nBooting with sun4v support.\n"); - mmu_ops = &mmu_ops_sun4v; - is_sun4v = 1; - } else { - printf("\nBooting with sun4u support.\n"); - mmu_ops = &mmu_ops_sun4u; - } + mmu_ops = &mmu_ops_sun4u; mmu_ops->tlb_init(); Modified: head/sys/dev/ath/ath_rate/sample/tx_schedules.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/tx_schedules.h Sat May 14 01:41:36 2011 (r221868) +++ head/sys/dev/ath/ath_rate/sample/tx_schedules.h Sat May 14 01:53:38 2011 (r221869) @@ -172,7 +172,7 @@ static const struct txschedule series_ha #undef H #ifdef Q -#undef Q /* sun4v bogosity */ +#undef Q #endif #define Q(_r) \ (((_r) == 1.5) ? 0 : (((_r) ==2.25) ? 1 : (((_r) == 3) ? 2 : \ Modified: head/sys/modules/mem/Makefile ============================================================================== --- head/sys/modules/mem/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/sys/modules/mem/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -14,18 +14,4 @@ SRCS+= amd64_mem.c .endif SRCS+= bus_if.h device_if.h -.if ${MACHINE} == "sun4v" -SRCS+= opt_global.h - -.if defined(KERNBUILDDIR) -MKDEP= -include ${KERNBUILDDIR}/opt_global.h -.else -CFLAGS+= -include opt_global.h -MKDEP= -include opt_global.h - -opt_global.h: - echo "#define SUN4V 1" > ${.TARGET} -.endif -.endif - .include Modified: head/sys/modules/uart/Makefile ============================================================================== --- head/sys/modules/uart/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/sys/modules/uart/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -14,9 +14,7 @@ SRCS= uart_bus_acpi.c ${uart_bus_ebus} u uart_dev_ns8250.c uart_dev_quicc.c uart_dev_sab82532.c \ uart_dev_z8530.c \ uart_if.c uart_if.h uart_subr.c uart_tty.c -.if ${MACHINE} == "sun4v" -SRCS+= uart_cpu_sparc64.c -.elif exists(${.CURDIR}/../../dev/uart/uart_cpu_${MACHINE}.c) +.if exists(${.CURDIR}/../../dev/uart/uart_cpu_${MACHINE}.c) SRCS+= uart_cpu_${MACHINE}.c .endif SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ Modified: head/sys/sparc64/sparc64/autoconf.c ============================================================================== --- head/sys/sparc64/sparc64/autoconf.c Sat May 14 01:41:36 2011 (r221868) +++ head/sys/sparc64/sparc64/autoconf.c Sat May 14 01:53:38 2011 (r221869) @@ -66,9 +66,6 @@ static void configure(void *dummy) { -#ifdef SUN4V - intr_restore_all(0x16); -#endif root_bus_configure(); #ifdef DEV_ISA /* Modified: head/sys/sparc64/sparc64/genassym.c ============================================================================== --- head/sys/sparc64/sparc64/genassym.c Sat May 14 01:41:36 2011 (r221868) +++ head/sys/sparc64/sparc64/genassym.c Sat May 14 01:53:38 2011 (r221869) @@ -45,18 +45,11 @@ __FBSDID("$FreeBSD$"); #ifdef SUN4U #include #endif -#ifdef SUN4V -#include -#endif #include #include #include #include #include -#ifdef SUN4V -#include -#include -#endif #include ASSYM(KERNBASE, KERNBASE); @@ -93,9 +86,6 @@ ASSYM(CSA_TICK, offsetof(struct cpu_star ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); #endif -#ifdef SUN4V -ASSYM(CSA_CPUID, offsetof(struct cpu_start_args, csa_cpuid)); -#endif #endif #ifdef SUN4U @@ -141,20 +131,6 @@ ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); #endif -#ifdef SUN4V -ASSYM(VTD_REF, VTD_REF); -ASSYM(VTD_W, VTD_W); -ASSYM(VTD_SW_W, VTD_SW_W); -ASSYM(VTD_LOCK, VTD_LOCK); - -ASSYM(THE_SHIFT, THE_SHIFT); -ASSYM(PM_HASHSCRATCH, offsetof(struct pmap, pm_hashscratch)); -ASSYM(PM_TSBSCRATCH, offsetof(struct pmap, pm_tsbscratch)); -ASSYM(PM_TSB_RA, offsetof(struct pmap, pm_tsb_ra)); -ASSYM(PM_TLBACTIVE, offsetof(struct pmap, pm_tlbactive)); -ASSYM(HASH_ENTRY_SHIFT, HASH_ENTRY_SHIFT); -#endif - ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); ASSYM(MAXCOMLEN, MAXCOMLEN); @@ -168,35 +144,6 @@ ASSYM(PC_IRFREE, offsetof(struct pcpu, p ASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt)); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); -#ifdef SUN4V -ASSYM(PC_CPU_Q_RA, offsetof(struct pcpu, pc_cpu_q_ra)); -ASSYM(PC_CPU_Q_SIZE, offsetof(struct pcpu, pc_cpu_q_size)); -ASSYM(PC_DEV_Q_RA, offsetof(struct pcpu, pc_dev_q_ra)); -ASSYM(PC_DEV_Q_SIZE, offsetof(struct pcpu, pc_dev_q_size)); - -ASSYM(PC_RQ_BASE, offsetof(struct pcpu, pc_rq_ra)); -ASSYM(PC_RQ_SIZE, offsetof(struct pcpu, pc_rq_size)); -ASSYM(PC_NRQ_BASE, offsetof(struct pcpu, pc_nrq_ra)); -ASSYM(PC_NRQ_SIZE, offsetof(struct pcpu, pc_nrq_size)); -ASSYM(PC_MONDO_DATA, offsetof(struct pcpu, pc_mondo_data)); -ASSYM(PC_MONDO_DATA_RA, offsetof(struct pcpu, pc_mondo_data_ra)); - -ASSYM(PC_KWBUF_FULL, offsetof(struct pcpu, pc_kwbuf_full)); -ASSYM(PC_KWBUF_SP, offsetof(struct pcpu, pc_kwbuf_sp)); -ASSYM(PC_KWBUF, offsetof(struct pcpu, pc_kwbuf)); -ASSYM(PC_PAD, offsetof(struct pcpu, pad)); -ASSYM(PC_PMAP, offsetof(struct pcpu, pc_curpmap)); -ASSYM(PC_TSBWBUF, offsetof(struct pcpu, pc_tsbwbuf)); - -ASSYM(PCB_KSTACK, offsetof(struct pcb, pcb_kstack)); -ASSYM(PCB_TSTATE, offsetof(struct pcb, pcb_tstate)); -ASSYM(PCB_TPC, offsetof(struct pcb, pcb_tpc)); -ASSYM(PCB_TNPC, offsetof(struct pcb, pcb_tnpc)); -ASSYM(PCB_TT, offsetof(struct pcb, pcb_tt)); -ASSYM(PCB_SFAR, offsetof(struct pcb, pcb_sfar)); -ASSYM(PM_TSB_MISS_COUNT, offsetof(struct pmap, pm_tsb_miss_count)); -ASSYM(PM_TSB_CAP_MISS_COUNT, offsetof(struct pmap, pm_tsb_cap_miss_count)); -#endif #ifdef SUN4U ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache)); ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); @@ -298,9 +245,6 @@ ASSYM(TF_TAR, offsetof(struct trapframe, ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); ASSYM(TF_Y, offsetof(struct trapframe, tf_y)); #endif -#ifdef SUN4V -ASSYM(TF_ASI, offsetof(struct trapframe, tf_asi)); -#endif ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Sat May 14 01:41:36 2011 (r221868) +++ head/sys/sparc64/sparc64/mem.c Sat May 14 01:53:38 2011 (r221869) @@ -69,9 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef SUN4V #include -#endif #include #include #include @@ -137,18 +135,14 @@ memrw(struct cdev *dev, struct uio *uio, if (m != NULL) { if (ova == 0) { -#ifndef SUN4V if (dcache_color_ignore == 0) colors = DCACHE_COLORS; -#endif ova = kmem_alloc_wait(kernel_map, PAGE_SIZE * colors); } -#ifndef SUN4V if (colors != 1 && m->md.color != -1) va = ova + m->md.color * PAGE_SIZE; else -#endif va = ova; pmap_qenter(va, &m, 1); error = uiomove((void *)(va + off), cnt, Modified: head/sys/sys/kdb.h ============================================================================== --- head/sys/sys/kdb.h Sat May 14 01:41:36 2011 (r221868) +++ head/sys/sys/kdb.h Sat May 14 01:53:38 2011 (r221869) @@ -101,7 +101,7 @@ extern const char * volatile kdb_why; #define KDB_WHY_CAM "cam" /* CAM has entered debugger. */ #define KDB_WHY_NDIS "ndis" /* NDIS entered debugger. */ #define KDB_WHY_ACPI "acpi" /* ACPI entered debugger. */ -#define KDB_WHY_TRAPSIG "trapsig" /* Sun4v/Sparc fault. */ +#define KDB_WHY_TRAPSIG "trapsig" /* Sparc fault. */ #define KDB_WHY_POWERFAIL "powerfail" /* Powerfail NMI. */ #define KDB_WHY_MAC "mac" /* MAC Framework. */ #define KDB_WHY_POWERPC "powerpc" /* Unhandled powerpc intr. */ Modified: head/usr.sbin/bsdinstall/partedit/Makefile ============================================================================== --- head/usr.sbin/bsdinstall/partedit/Makefile Sat May 14 01:41:36 2011 (r221868) +++ head/usr.sbin/bsdinstall/partedit/Makefile Sat May 14 01:53:38 2011 (r221869) @@ -9,9 +9,6 @@ PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" PARTEDIT_ARCH= x86 .endif -.if ${MACHINE} == "sun4v" -PARTEDIT_ARCH= sparc64 -.endif .if !exists(partedit_${PARTEDIT_ARCH}.c) PARTEDIT_ARCH= generic .endif From owner-svn-src-head@FreeBSD.ORG Sat May 14 01:56:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E74A106566B; Sat, 14 May 2011 01:56:49 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 439108FC16; Sat, 14 May 2011 01:56:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E1unco089052; Sat, 14 May 2011 01:56:49 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E1unPj089051; Sat, 14 May 2011 01:56:49 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201105140156.p4E1unPj089051@svn.freebsd.org> From: Attilio Rao Date: Sat, 14 May 2011 01:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221870 - in head: release/sun4v sys/conf sys/sun4v X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 01:56:49 -0000 Author: attilio Date: Sat May 14 01:56:48 2011 New Revision: 221870 URL: http://svn.freebsd.org/changeset/base/221870 Log: Remove actual files supporting sun4v. Approved by: re Deleted: head/release/sun4v/ head/sys/conf/Makefile.sun4v head/sys/conf/files.sun4v head/sys/conf/options.sun4v head/sys/sun4v/ From owner-svn-src-head@FreeBSD.ORG Sat May 14 03:00:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 537BA1065672; Sat, 14 May 2011 03:00:56 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06C498FC0C; Sat, 14 May 2011 03:00:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E30tgE090586; Sat, 14 May 2011 03:00:55 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E30tGc090583; Sat, 14 May 2011 03:00:55 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201105140300.p4E30tGc090583@svn.freebsd.org> From: Maxim Sobolev Date: Sat, 14 May 2011 03:00:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221873 - head/usr.sbin/newsyslog X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 03:00:56 -0000 Author: sobomax Date: Sat May 14 03:00:55 2011 New Revision: 221873 URL: http://svn.freebsd.org/changeset/base/221873 Log: Add new modifier - "R", when it is specified the path to pid file will be considered as a path to a binary or a shell script to be executed after rotation has been completed instead of sending signal to the process id in that file. Sponsored by: Sippy Software, Inc. From the: FreeBSD hacking lounge at BSDCan Modified: head/usr.sbin/newsyslog/newsyslog.c head/usr.sbin/newsyslog/newsyslog.conf.5 Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Sat May 14 02:28:26 2011 (r221872) +++ head/usr.sbin/newsyslog/newsyslog.c Sat May 14 03:00:55 2011 (r221873) @@ -125,6 +125,7 @@ __FBSDID("$FreeBSD$"); /* process when trimming this file. */ #define CE_CREATE 0x0100 /* Create the log file if it does not exist. */ #define CE_NODUMP 0x0200 /* Set 'nodump' on newly created log file. */ +#define CE_PID2CMD 0x0400 /* Replace PID file with a shell command.*/ #define MIN_PID 5 /* Don't touch pids lower than this */ #define MAX_PID 99999 /* was lower, see /usr/include/sys/proc.h */ @@ -154,7 +155,7 @@ const struct compress_types compress_typ struct conf_entry { STAILQ_ENTRY(conf_entry) cf_nextp; char *log; /* Name of the log */ - char *pid_file; /* PID file */ + char *pid_cmd_file; /* PID or command file */ char *r_reason; /* The reason this file is being rotated */ int firstcreate; /* Creating log for the first time (-C). */ int rotate; /* Non-zero if this file should be rotated */ @@ -178,7 +179,8 @@ struct sigwork_entry { int sw_pidok; /* true if pid value is valid */ pid_t sw_pid; /* the process id from the PID file */ const char *sw_pidtype; /* "daemon" or "process group" */ - char sw_fname[1]; /* file the PID was read from */ + int run_cmd; /* run command or send PID to signal */ + char sw_fname[1]; /* file the PID was read from or shell cmd */ }; struct zipwork_entry { @@ -384,9 +386,9 @@ init_entry(const char *fname, struct con err(1, "strdup for %s", fname); if (src_entry != NULL) { - tempwork->pid_file = NULL; - if (src_entry->pid_file) - tempwork->pid_file = strdup(src_entry->pid_file); + tempwork->pid_cmd_file = NULL; + if (src_entry->pid_cmd_file) + tempwork->pid_cmd_file = strdup(src_entry->pid_cmd_file); tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -406,7 +408,7 @@ init_entry(const char *fname, struct con tempwork->def_cfg = src_entry->def_cfg; } else { /* Initialize as a "do-nothing" entry */ - tempwork->pid_file = NULL; + tempwork->pid_cmd_file = NULL; tempwork->r_reason = NULL; tempwork->firstcreate = 0; tempwork->rotate = 0; @@ -441,9 +443,9 @@ free_entry(struct conf_entry *ent) ent->log = NULL; } - if (ent->pid_file != NULL) { - free(ent->pid_file); - ent->pid_file = NULL; + if (ent->pid_cmd_file != NULL) { + free(ent->pid_cmd_file); + ent->pid_cmd_file = NULL; } if (ent->r_reason != NULL) { @@ -1291,6 +1293,9 @@ no_trimat: case 'n': working->flags |= CE_NOSIGNAL; break; + case 'r': + working->flags |= CE_PID2CMD; + break; case 'u': working->flags |= CE_SIGNALGROUP; break; @@ -1324,10 +1329,10 @@ no_trimat: *parse = '\0'; } - working->pid_file = NULL; + working->pid_cmd_file = NULL; if (q && *q) { if (*q == '/') - working->pid_file = strdup(q); + working->pid_cmd_file = strdup(q); else if (isdigit(*q)) goto got_sig; else @@ -1364,16 +1369,16 @@ no_trimat: if ((working->flags & CE_NOSIGNAL) == CE_NOSIGNAL) { /* * This config-entry specified 'n' for nosignal, - * see if it also specified an explicit pid_file. + * see if it also specified an explicit pid_cmd_file. * This would be a pretty pointless combination. */ - if (working->pid_file != NULL) { + if (working->pid_cmd_file != NULL) { warnx("Ignoring '%s' because flag 'n' was specified in line:\n%s", - working->pid_file, errline); - free(working->pid_file); - working->pid_file = NULL; + working->pid_cmd_file, errline); + free(working->pid_cmd_file); + working->pid_cmd_file = NULL; } - } else if (working->pid_file == NULL) { + } else if (working->pid_cmd_file == NULL) { /* * This entry did not specify the 'n' flag, which * means it should signal syslogd unless it had @@ -1388,7 +1393,7 @@ no_trimat: working->flags &= ~CE_SIGNALGROUP; } if (needroot) - working->pid_file = strdup(path_syslogpid); + working->pid_cmd_file = strdup(path_syslogpid); } /* @@ -1826,7 +1831,7 @@ do_rotate(const struct conf_entry *ent) * multiple log files had to be rotated. */ swork = NULL; - if (ent->pid_file != NULL) + if (ent->pid_cmd_file != NULL) swork = save_sigwork(ent); if (ent->numlogs > 0 && ent->compress > COMPRESS_NONE) { /* @@ -1845,6 +1850,7 @@ do_sigwork(struct sigwork_entry *swork) { struct sigwork_entry *nextsig; int kres, secs; + char *tmp; if (!(swork->sw_pidok) || swork->sw_pid == 0) return; /* no work to do... */ @@ -1887,6 +1893,24 @@ do_sigwork(struct sigwork_entry *swork) return; } + if (swork->run_cmd) { + asprintf(&tmp, "%s %d", swork->sw_fname, swork->sw_signum); + if (tmp == NULL) { + warn("can't allocate memory to run %s", + swork->sw_fname); + return; + } + if (verbose) + printf("Run command: %s\n", tmp); + kres = system(tmp); + if (kres) { + warnx("%s: returned non-zero exit code: %d", + tmp, kres); + } + free(tmp); + return; + } + kres = kill(swork->sw_pid, swork->sw_signum); if (kres != 0) { /* @@ -2016,7 +2040,7 @@ save_sigwork(const struct conf_entry *en sprev = NULL; ndiff = 1; SLIST_FOREACH(stmp, &swhead, sw_nextp) { - ndiff = strcmp(ent->pid_file, stmp->sw_fname); + ndiff = strcmp(ent->pid_cmd_file, stmp->sw_fname); if (ndiff > 0) break; if (ndiff == 0) { @@ -2032,11 +2056,18 @@ save_sigwork(const struct conf_entry *en if (stmp != NULL && ndiff == 0) return (stmp); - tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_file) + 1; + tmpsiz = sizeof(struct sigwork_entry) + strlen(ent->pid_cmd_file) + 1; stmp = malloc(tmpsiz); - set_swpid(stmp, ent); + + stmp->run_cmd = 0; + /* If this is a command to run we just set the flag and run command */ + if (ent->flags & CE_PID2CMD) { + stmp->run_cmd = 1; + } else { + set_swpid(stmp, ent); + } stmp->sw_signum = ent->sig; - strcpy(stmp->sw_fname, ent->pid_file); + strcpy(stmp->sw_fname, ent->pid_cmd_file); if (sprev == NULL) SLIST_INSERT_HEAD(&swhead, stmp, sw_nextp); else @@ -2113,7 +2144,7 @@ set_swpid(struct sigwork_entry *swork, c swork->sw_pidtype = "process-group"; } - f = fopen(ent->pid_file, "r"); + f = fopen(ent->pid_cmd_file, "r"); if (f == NULL) { if (errno == ENOENT && enforcepid == 0) { /* @@ -2124,9 +2155,9 @@ set_swpid(struct sigwork_entry *swork, c * files that the process would have been using. */ swork->sw_pidok = 1; - warnx("pid file doesn't exist: %s", ent->pid_file); + warnx("pid file doesn't exist: %s", ent->pid_cmd_file); } else - warn("can't open pid file: %s", ent->pid_file); + warn("can't open pid file: %s", ent->pid_cmd_file); return; } @@ -2139,9 +2170,9 @@ set_swpid(struct sigwork_entry *swork, c */ if (feof(f) && enforcepid == 0) { swork->sw_pidok = 1; - warnx("pid file is empty: %s", ent->pid_file); + warnx("pid/cmd file is empty: %s", ent->pid_cmd_file); } else - warn("can't read from pid file: %s", ent->pid_file); + warn("can't read from pid file: %s", ent->pid_cmd_file); (void)fclose(f); return; } @@ -2154,10 +2185,10 @@ set_swpid(struct sigwork_entry *swork, c rval = strtol(linep, &endp, 10); if (*endp != '\0' && !isspacech(*endp)) { warnx("pid file does not start with a valid number: %s", - ent->pid_file); + ent->pid_cmd_file); } else if (rval < minok || rval > maxok) { warnx("bad value '%ld' for process number in %s", - rval, ent->pid_file); + rval, ent->pid_cmd_file); if (verbose) warnx("\t(expecting value between %ld and %ld)", minok, maxok); Modified: head/usr.sbin/newsyslog/newsyslog.conf.5 ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.conf.5 Sat May 14 02:28:26 2011 (r221872) +++ head/usr.sbin/newsyslog/newsyslog.conf.5 Sat May 14 03:00:55 2011 (r221873) @@ -301,9 +301,16 @@ log file using .It Cm N indicates that there is no process which needs to be signaled when this log file is rotated. +.It Cm R +if this flag is set the +.Xr newsyslog 8 +will run shell command defined in +.Ar path_to_pid_cmd_file +after rotation instead of trying to send signal to a process id +stored in the file. .It Cm U indicates that the file specified by -.Ar path_to_pid_file +.Ar path_to_pid_cmd_file will contain the ID for a process group instead of a process. This option also requires that the first line in that file be a negative value to distinguish it from a process ID. @@ -319,7 +326,7 @@ can be used as a placeholder to create a .Ar flags field when you need to specify any of the following fields. .El -.It Ar path_to_pid_file +.It Ar path_to_pid_cmd_file This optional field specifies the file name containing a daemon's process ID or to find a group process ID if the .Cm U @@ -340,6 +347,12 @@ switch. This field must start with .Ql / in order to be recognized properly. +When used with the +.Cm R +flag, the file is treated as a path to a binary to be executed +by the +.Xr newsyslog 8 +after rotation instead of sending the signal out. .It Ar signal_number This optional field specifies the signal number that will be sent to the daemon process (or to all processes in a process group, if the From owner-svn-src-head@FreeBSD.ORG Sat May 14 04:02:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BF6A106566B; Sat, 14 May 2011 04:02:57 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E63B18FC0C; Sat, 14 May 2011 04:02:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E42uSv092045; Sat, 14 May 2011 04:02:56 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E42uCr092043; Sat, 14 May 2011 04:02:56 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105140402.p4E42uCr092043@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 14 May 2011 04:02:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221874 - head/usr.bin/fstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 04:02:57 -0000 Author: stas Date: Sat May 14 04:02:56 2011 New Revision: 221874 URL: http://svn.freebsd.org/changeset/base/221874 Log: - Fix several typos [1] - fuser(1) writes usernames to stderr, not stdout [1] - Add history section. Submitted by: Pieter de Goeje [1] Modified: head/usr.bin/fstat/fuser.1 Modified: head/usr.bin/fstat/fuser.1 ============================================================================== --- head/usr.bin/fstat/fuser.1 Sat May 14 03:00:55 2011 (r221873) +++ head/usr.bin/fstat/fuser.1 Sat May 14 04:02:56 2011 (r221874) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2005-2009 Stanislav Sedov +.\" Copyright (c) 2005-2011 Stanislav Sedov .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2009 +.Dd May 13, 2011 .Dt FUSER 1 .Os .Sh NAME @@ -66,7 +66,7 @@ Send signal to reported processes .It Fl m Search through mmapped files too. .It Fl u -Write the user name associated with each process to stdout. +Write the user name associated with each process to stderr. .It Fl M Extract values associated with the name list from the specified core instead of the default @@ -114,9 +114,9 @@ utility returns 0 on successful completi .Sh EXAMPLES The command: .Dq Li "fuser -fu ." -writes to standart output the process IDs of processes that are using the +writes to standard output the process IDs of processes that are using the current directory and writes to stderr an indication of how those processes are -using the direcory and user names associated with the processes that are using +using the directory and user names associated with the processes that are using this directory. .Sh SEE ALSO .Xr fstat 1 , @@ -125,7 +125,7 @@ this directory. .Xr iostat 8 , .Xr pstat 8 , .Xr vmstat 8 -.Sh STANDARTS +.Sh STANDARDS The .Nm utility is expected to conform to @@ -141,6 +141,11 @@ interface the report will be limited to .Nm utility knows about (currently only cd9660, devfs, nfs, ntfs, nwfs, udf, ufs and zfs). +.Sh HISTORY +The +.Nm +utility appeared in +.Fx 9.0 . .Sh AUTHORS The .Nm From owner-svn-src-head@FreeBSD.ORG Sat May 14 04:05:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4521106564A; Sat, 14 May 2011 04:05:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 938F18FC12; Sat, 14 May 2011 04:05:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E45NXo092129; Sat, 14 May 2011 04:05:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E45N6N092127; Sat, 14 May 2011 04:05:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105140405.p4E45N6N092127@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 04:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221875 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 04:05:23 -0000 Author: adrian Date: Sat May 14 04:05:23 2011 New Revision: 221875 URL: http://svn.freebsd.org/changeset/base/221875 Log: Fixes from the Atheros HAL - formatting; update Merlin checks to be consistent. Nothing functional should change with this commit. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat May 14 04:02:56 2011 (r221874) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat May 14 04:05:23 2011 (r221875) @@ -146,7 +146,7 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO /* For chips on which the RTC reset is done, save TSF before it gets cleared */ if (AR_SREV_HOWL(ah) || - (AR_SREV_MERLIN_20_OR_LATER(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))) + (AR_SREV_MERLIN(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))) tsf = ar5212GetTsf64(ah); /* Mark PHY as inactive; marked active in ar5416InitBB() */ @@ -663,7 +663,7 @@ ar5416ChipReset(struct ath_hal *ah, cons /* * Warm reset is optimistic. */ - if (AR_SREV_MERLIN_20_OR_LATER(ah) && + if (AR_SREV_MERLIN(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)) { if (!ar5416SetResetReg(ah, HAL_RESET_POWER_ON)) return AH_FALSE; @@ -1449,7 +1449,7 @@ ar5416SetDefGainValues(struct ath_hal *a if (IS_EEP_MINOR_V3(ah)) { txRxAttenLocal = pModal->txRxAttenCh[i]; - if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { OS_REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, pModal->bswMargin[i]); @@ -1472,7 +1472,7 @@ ar5416SetDefGainValues(struct ath_hal *a } } - if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { OS_REG_RMW_FIELD(ah, AR_PHY_RXGAIN + regChainOffset, AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); @@ -1551,8 +1551,10 @@ ar5416SetBoardValues(struct ath_hal *ah, SM(pModal->iqCalQCh[i], AR_PHY_TIMING_CTRL4_IQCORR_Q_Q_COFF)); /* - * Large signal upgrade. - * XXX update + * Large signal upgrade, + * If 14.3 or later EEPROM, use + * txRxAttenLocal = pModal->txRxAttenCh[i] + * else txRxAttenLocal is fixed value above. */ if ((i == 0) || AR_SREV_5416_V20_OR_LATER(ah)) @@ -1560,7 +1562,7 @@ ar5416SetBoardValues(struct ath_hal *ah, } - if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + if (AR_SREV_MERLIN_10_OR_LATER(ah)) { if (IEEE80211_IS_CHAN_2GHZ(chan)) { OS_A_REG_RMW_FIELD(ah, AR_AN_RF2G1_CH0, AR_AN_RF2G1_CH0_OB, pModal->ob); OS_A_REG_RMW_FIELD(ah, AR_AN_RF2G1_CH0, AR_AN_RF2G1_CH0_DB, pModal->db); @@ -1582,7 +1584,7 @@ ar5416SetBoardValues(struct ath_hal *ah, OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->switchSettling); OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, pModal->adcDesiredSize); - if (! AR_SREV_MERLIN_20_OR_LATER(ah)) + if (! AR_SREV_MERLIN_10_OR_LATER(ah)) OS_REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_PGA, pModal->pgaDesiredSize); OS_REG_WRITE(ah, AR_PHY_RF_CTL4, @@ -1591,7 +1593,8 @@ ar5416SetBoardValues(struct ath_hal *ah, | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAA_ON) | SM(pModal->txFrameToXpaOn, AR_PHY_RF_CTL4_FRAME_XPAB_ON)); - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, pModal->txEndToRxOn); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, + pModal->txEndToRxOn); if (AR_SREV_MERLIN_10_OR_LATER(ah)) { OS_REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, @@ -1607,27 +1610,36 @@ ar5416SetBoardValues(struct ath_hal *ah, /* Minor Version Specific application */ if (IS_EEP_MINOR_V2(ah)) { - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, pModal->txFrameToDataStart); - OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, pModal->txFrameToPaOn); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_DATA_START, + pModal->txFrameToDataStart); + OS_REG_RMW_FIELD(ah, AR_PHY_RF_CTL2, AR_PHY_TX_FRAME_TO_PA_ON, + pModal->txFrameToPaOn); } if (IS_EEP_MINOR_V3(ah) && IEEE80211_IS_CHAN_HT40(chan)) /* Overwrite switch settling with HT40 value */ - OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, pModal->swSettleHt40); + OS_REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, + pModal->swSettleHt40); if (AR_SREV_MERLIN_20_OR_LATER(ah) && EEP_MINOR(ah) >= AR5416_EEP_MINOR_VER_19) OS_REG_RMW_FIELD(ah, AR_PHY_CCK_TX_CTRL, AR_PHY_CCK_TX_CTRL_TX_DAC_SCALE_CCK, pModal->miscBits); if (AR_SREV_MERLIN_20(ah) && EEP_MINOR(ah) >= AR5416_EEP_MINOR_VER_20) { if (IEEE80211_IS_CHAN_2GHZ(chan)) - OS_A_REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, eep->baseEepHeader.dacLpMode); + OS_A_REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, + eep->baseEepHeader.dacLpMode); else if (eep->baseEepHeader.dacHiPwrMode_5G) OS_A_REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, 0); else - OS_A_REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, eep->baseEepHeader.dacLpMode); + OS_A_REG_RMW_FIELD(ah, AR_AN_TOP1, AR_AN_TOP1_DACIPMODE, + eep->baseEepHeader.dacLpMode); + + OS_DELAY(100); - OS_REG_RMW_FIELD(ah, AR_PHY_FRAME_CTL, AR_PHY_FRAME_CTL_TX_CLIP, pModal->miscBits >> 2); - OS_REG_RMW_FIELD(ah, AR_PHY_TX_PWRCTRL9, AR_PHY_TX_DESIRED_SCALE_CCK, eep->baseEepHeader.desiredScaleCCK); + OS_REG_RMW_FIELD(ah, AR_PHY_FRAME_CTL, AR_PHY_FRAME_CTL_TX_CLIP, + pModal->miscBits >> 2); + OS_REG_RMW_FIELD(ah, AR_PHY_TX_PWRCTRL9, AR_PHY_TX_DESIRED_SCALE_CCK, + eep->baseEepHeader.desiredScaleCCK); } return AH_TRUE; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 14 04:02:56 2011 (r221874) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat May 14 04:05:23 2011 (r221875) @@ -99,6 +99,10 @@ ar9280AniSetup(struct ath_hal *ah) ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } +/* XXX shouldn't be here! */ +#define EEP_MINOR(_ah) \ + (AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK) + /* * Attach for an AR9280 part. */ @@ -270,7 +274,8 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s ath_hal_printf(ah, "[ath]: default pwr offset: %d dBm != EEPROM pwr offset: %d dBm; curves will be adjusted.\n", AR5416_PWR_TABLE_OFFSET_DB, (int) pwr_table_offset); - if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + /* XXX check for >= minor ver 17 */ + if (AR_SREV_MERLIN_20(ah)) { /* setup rxgain table */ switch (ath_hal_eepromGet(ah, AR_EEP_RXGAIN_TYPE, AH_NULL)) { case AR5416_EEP_RXGAIN_13dB_BACKOFF: @@ -290,7 +295,9 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s goto bad; /* XXX ? try to continue */ } } - if (AR_SREV_MERLIN_20_OR_LATER(ah)) { + + /* XXX check for >= minor ver 19 */ + if (AR_SREV_MERLIN_20(ah)) { /* setp txgain table */ switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) { case AR5416_EEP_TXGAIN_HIGH_POWER: From owner-svn-src-head@FreeBSD.ORG Sat May 14 04:17:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D48DD106566C; Sat, 14 May 2011 04:17:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4F8F8FC0A; Sat, 14 May 2011 04:17:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E4HGqe092406; Sat, 14 May 2011 04:17:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E4HGIO092404; Sat, 14 May 2011 04:17:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105140417.p4E4HGIO092404@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 04:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221876 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 04:17:16 -0000 Author: adrian Date: Sat May 14 04:17:16 2011 New Revision: 221876 URL: http://svn.freebsd.org/changeset/base/221876 Log: Major fix: when doing open-loop TX power calibration, adjust the correct CCK rates rather than adjusting the first handful. This may have affected some AR9280 based NICs. Minor fix: merlin check update Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat May 14 04:05:23 2011 (r221875) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat May 14 04:17:16 2011 (r221876) @@ -1053,9 +1053,9 @@ ar5416SetTransmitPower(struct ath_hal *a int cck_ofdm_delta = 2; int i; for (i = 0; i < N(adj); i++) { - ratesArray[i] -= cck_ofdm_delta; - if (ratesArray[i] < 0) - ratesArray[i] = 0; + ratesArray[adj[i]] -= cck_ofdm_delta; + if (ratesArray[adj[i]] < 0) + ratesArray[adj[i]] = 0; } } @@ -2430,7 +2430,7 @@ ar5416GetGainBoundariesAndPdadcs(struct /* Find starting index for this pdGain */ if (i == 0) { - if (AR_SREV_MERLIN_20_OR_LATER(ah)) + if (AR_SREV_MERLIN_10_OR_LATER(ah)) ss = (int16_t)(0 - (minPwrT4[i] / 2)); else ss = 0; /* for the first pdGain, start from index 0 */ From owner-svn-src-head@FreeBSD.ORG Sat May 14 04:32:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 980BB1065672; Sat, 14 May 2011 04:32:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88B3E8FC13; Sat, 14 May 2011 04:32:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E4WUWd092813; Sat, 14 May 2011 04:32:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E4WUQm092811; Sat, 14 May 2011 04:32:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201105140432.p4E4WUQm092811@svn.freebsd.org> From: Warner Losh Date: Sat, 14 May 2011 04:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221877 - head/tools/tools/nanobsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 04:32:30 -0000 Author: imp Date: Sat May 14 04:32:30 2011 New Revision: 221877 URL: http://svn.freebsd.org/changeset/base/221877 Log: Restore BOOT2CFG, accidentally removed in r212938. PR: 157020 Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Sat May 14 04:17:16 2011 (r221876) +++ head/tools/tools/nanobsd/nanobsd.sh Sat May 14 04:32:30 2011 (r221877) @@ -660,7 +660,7 @@ cust_comconsole () ( sed -i "" -e '/^ttyv[0-8]/s/ on/ off/' ${NANO_WORLDDIR}/etc/ttys # Tell loader to use serial console early. - echo " -h" > ${NANO_WORLDDIR}/boot.config + echo "${NANO_BOOT2CFG}" > ${NANO_WORLDDIR}/boot.config ) ####################################################################### From owner-svn-src-head@FreeBSD.ORG Sat May 14 05:43:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A90C6106564A; Sat, 14 May 2011 05:43:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98B3E8FC0A; Sat, 14 May 2011 05:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4E5hXQJ094118; Sat, 14 May 2011 05:43:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4E5hXR8094113; Sat, 14 May 2011 05:43:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105140543.p4E5hXR8094113@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 05:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221878 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 05:43:33 -0000 Author: adrian Date: Sat May 14 05:43:33 2011 New Revision: 221878 URL: http://svn.freebsd.org/changeset/base/221878 Log: When disabling RIFS for Sowl (AR9160) and Howl (AR9130), make sure RIFS is totally disabled. The Atheros HAL code does this for Sowl/Howl but not for Owl (AR5416) where RIFS is disabled by default. This seems to quieten the occasional baseband hang I've been seeing with the AR9160 in STA mode under constant heavy traffic load. Obtained from: Atheros Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat May 14 04:32:30 2011 (r221877) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat May 14 05:43:33 2011 (r221878) @@ -199,7 +199,8 @@ extern HAL_STATUS ar5416GetCapability(st extern HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize); -extern HAL_BOOL ar5416SetRifsDelay(struct ath_hal *ah, HAL_BOOL enable); +extern HAL_BOOL ar5416SetRifsDelay(struct ath_hal *ah, + const struct ieee80211_channel *chan, HAL_BOOL enable); extern HAL_BOOL ar5416SetPowerMode(struct ath_hal *ah, HAL_POWER_MODE mode, int setChip); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat May 14 04:32:30 2011 (r221877) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Sat May 14 05:43:33 2011 (r221878) @@ -367,9 +367,18 @@ typedef struct { } hal_mac_hang_check_t; HAL_BOOL -ar5416SetRifsDelay(struct ath_hal *ah, HAL_BOOL enable) +ar5416SetRifsDelay(struct ath_hal *ah, const struct ieee80211_channel *chan, + HAL_BOOL enable) { uint32_t val; + HAL_BOOL is_chan_2g = AH_FALSE; + HAL_BOOL is_ht40 = AH_FALSE; + + if (chan) + is_chan_2g = IEEE80211_IS_CHAN_2GHZ(chan); + + if (chan) + is_ht40 = IEEE80211_IS_CHAN_HT40(chan); /* Only support disabling RIFS delay for now */ HALASSERT(enable == AH_FALSE); @@ -382,6 +391,31 @@ ar5416SetRifsDelay(struct ath_hal *ah, H val &= ~AR_PHY_RIFS_INIT_DELAY; OS_REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val); + /* + * For Owl, RIFS RX parameters are controlled differently; + * it isn't enabled in the inivals by default. + * + * For Sowl/Howl, RIFS RX is enabled in the inivals by default; + * the following code sets them back to non-RIFS values. + * + * For > Sowl/Howl, RIFS RX can be left on by default and so + * this function shouldn't be called. + */ + if ((! AR_SREV_SOWL(ah)) && (! AR_SREV_HOWL(ah))) + return AH_TRUE; + + /* Reset search delay to default values */ + if (is_chan_2g) + if (is_ht40) + OS_REG_WRITE(ah, AR_PHY_SEARCH_START_DELAY, 0x268); + else + OS_REG_WRITE(ah, AR_PHY_SEARCH_START_DELAY, 0x134); + else + if (is_ht40) + OS_REG_WRITE(ah, AR_PHY_SEARCH_START_DELAY, 0x370); + else + OS_REG_WRITE(ah, AR_PHY_SEARCH_START_DELAY, 0x1b8); + return AH_TRUE; } Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat May 14 04:32:30 2011 (r221877) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat May 14 05:43:33 2011 (r221878) @@ -2591,7 +2591,7 @@ ar5416OverrideIni(struct ath_hal *ah, co * hang issues. */ if (AR_SREV_HOWL(ah) || AR_SREV_SOWL(ah)) - (void) ar5416SetRifsDelay(ah, AH_FALSE); + (void) ar5416SetRifsDelay(ah, chan, AH_FALSE); if (!AR_SREV_5416_V20_OR_LATER(ah) || AR_SREV_MERLIN(ah)) return; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Sat May 14 04:32:30 2011 (r221877) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Sat May 14 05:43:33 2011 (r221878) @@ -93,6 +93,8 @@ #define AR9280_PHY_RXGAIN_TXRX_MARGIN 0x001FC000 #define AR9280_PHY_RXGAIN_TXRX_MARGIN_S 14 +#define AR_PHY_SEARCH_START_DELAY 0x9918 /* search start delay */ + #define AR_PHY_EXT_CCA 0x99bc #define AR_PHY_EXT_CCA_CYCPWR_THR1 0x0000FE00 #define AR_PHY_EXT_CCA_CYCPWR_THR1_S 9 From owner-svn-src-head@FreeBSD.ORG Sat May 14 09:12:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C3091065670; Sat, 14 May 2011 09:12:54 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (cl-414.sto-01.se.sixxs.net [IPv6:2001:16d8:ff00:19d::2]) by mx1.freebsd.org (Postfix) with ESMTP id AED208FC0A; Sat, 14 May 2011 09:12:53 +0000 (UTC) Received: from orion.SpringDaemons.com (c-76-102-119-9.hsd1.ca.comcast.net [76.102.119.9]) by mx0.deglitch.com (Postfix) with ESMTPA id 5F9128FC36; Sat, 14 May 2011 13:12:52 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 2EDEE3A770; Sat, 14 May 2011 02:15:24 -0700 (PDT) Date: Sat, 14 May 2011 02:15:23 -0700 From: Stanislav Sedov To: Kostik Belousov Message-Id: <20110514021523.a9be8d81.stas@FreeBSD.org> In-Reply-To: <20110512112640.GQ48734@deviant.kiev.zoral.com.ua> References: <201105121011.p4CABdkM030432@svn.freebsd.org> <20110512112640.GQ48734@deviant.kiev.zoral.com.ua> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Stanislav Sedov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221807 - in head: lib lib/libprocstat lib/libprocstat/zfs lib/libutil sys/kern sys/sys usr.bin/fstat usr.bin/fstat/zfs usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 09:12:54 -0000 On Thu, 12 May 2011 14:26:40 +0300 Kostik Belousov mentioned: > > > > The newly introduced fuser(1) utility also uses this library and > > able to operate via sysctl and kvm backends. > > > > The library is by no means complete (e.g. KVM backend is missing > > vnode name resolution routines, and there're no manpages for the > > library itself) so I plan to improve it further. I'm commiting it > > so it will get wider exposure and review. > > > > We won't be able to MFC this work as it relies on changes in HEAD, > > which was introduced some time ago, that break kernel ABI. OTOH > > we may be able to merge the library with KVM backend if we really > > need it there. > > Could you, please, point out the mentioned ABI changes ? Hi, Kostik! It seems I was wrong and that change was actually introduced in 8.0. It thus makes MFC possible. I don't have immediate plans for this though, but I might do it if there's enough demand and it demonstrates to be stable enough in HEAD. Sorry for being misleading! -- Stanislav Sedov ST4096-RIPE () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments From owner-svn-src-head@FreeBSD.ORG Sat May 14 10:28:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FABE106566B; Sat, 14 May 2011 10:28:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DE93B8FC17; Sat, 14 May 2011 10:28:15 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p4EASBRO040189 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 May 2011 13:28:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p4EASBDK070433; Sat, 14 May 2011 13:28:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p4EASBtA070432; Sat, 14 May 2011 13:28:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 14 May 2011 13:28:11 +0300 From: Kostik Belousov To: Stanislav Sedov Message-ID: <20110514102811.GD48734@deviant.kiev.zoral.com.ua> References: <201105121011.p4CABdkM030432@svn.freebsd.org> <20110512112640.GQ48734@deviant.kiev.zoral.com.ua> <20110514021523.a9be8d81.stas@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QJLNdq7A0R34yxmQ" Content-Disposition: inline In-Reply-To: <20110514021523.a9be8d81.stas@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221807 - in head: lib lib/libprocstat lib/libprocstat/zfs lib/libutil sys/kern sys/sys usr.bin/fstat usr.bin/fstat/zfs usr.bin/procstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 10:28:16 -0000 --QJLNdq7A0R34yxmQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 14, 2011 at 02:15:23AM -0700, Stanislav Sedov wrote: > On Thu, 12 May 2011 14:26:40 +0300 > Kostik Belousov mentioned: >=20 > > > > > > The newly introduced fuser(1) utility also uses this library and > > > able to operate via sysctl and kvm backends. > > > > > > The library is by no means complete (e.g. KVM backend is missing > > > vnode name resolution routines, and there're no manpages for the > > > library itself) so I plan to improve it further. I'm commiting it > > > so it will get wider exposure and review. > > > > > > We won't be able to MFC this work as it relies on changes in HEAD, > > > which was introduced some time ago, that break kernel ABI. OTOH > > > we may be able to merge the library with KVM backend if we really > > > need it there. > >=20 > > Could you, please, point out the mentioned ABI changes ? >=20 > Hi, Kostik! >=20 > It seems I was wrong and that change was actually introduced in 8.0. > It thus makes MFC possible. I don't have immediate plans for this > though, but I might do it if there's enough demand and it demonstrates > to be stable enough in HEAD. I did not worried not about inability to merge the libprocstat. It made me very uncomfortable to see the claim of the ABI skew in the area which I supposed to have stable ABI. Thanks for the clarification. >=20 > Sorry for being misleading! --QJLNdq7A0R34yxmQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3OWTsACgkQC3+MBN1Mb4iwZgCfbx7sIFjAJG9w/6iK9KjYEUOZ yD8AoOOJw9HY6++5J5yiZ2vzKj5YmcDG =nrhe -----END PGP SIGNATURE----- --QJLNdq7A0R34yxmQ-- From owner-svn-src-head@FreeBSD.ORG Sat May 14 10:59:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5256106564A; Sat, 14 May 2011 10:59:09 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AB3158FC1C; Sat, 14 May 2011 10:59:08 +0000 (UTC) Received: by bwz12 with SMTP id 12so3936641bwz.13 for ; Sat, 14 May 2011 03:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to :sender:date:in-reply-to:message-id:user-agent:mime-version :content-type:content-transfer-encoding; bh=SSIq+Y/Jqi5Uy+tDpOe3eQFjdLE+SMpq+Sdq89XwMvA=; b=VYVo1Mvtxq0X7xG+Bjckrak6Uzfo80WyW5Dm88klxDmeMNYHuAaJWDj6VDD3F8jUw8 YT3QfYR7H+mn5UNp3+0Cbg3FCOorYyB8RwNwQj/gQ9er9vc1iKZiY61D7JNSg4YyyMi2 pa446nPmzoHG1ir6DrvGuZKvjevtbZmWQ7E7Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; b=jS/E3J9myeqZOoJOYb42Ep8IAU09MWcBe5GwE6sWq45A/2qEQrhajaKkm/3G9z0Tbw BjYQi00pBVxRQrPXLfUG6ubr9EJzlDYbdMGzcXdiArsUGEIeAq/buDh1jl2yJY2bHwwU 5RtN9JkAjSF0LKR9r974B/hqfCfcbIzxwpLjw= Received: by 10.204.143.129 with SMTP id v1mr662177bku.175.1305369446140; Sat, 14 May 2011 03:37:26 -0700 (PDT) Received: from localhost ([95.69.172.154]) by mx.google.com with ESMTPS id q18sm1854531bka.3.2011.05.14.03.37.21 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2011 03:37:22 -0700 (PDT) From: Mikolaj Golub To: John Baldwin References: <201105022105.p42L5q3j054498@svn.freebsd.org> X-Comment-To: John Baldwin Sender: Mikolaj Golub Date: Sat, 14 May 2011 13:37:19 +0300 In-Reply-To: <201105022105.p42L5q3j054498@svn.freebsd.org> (John Baldwin's message of "Mon, 2 May 2011 21:05:52 +0000 (UTC)") Message-ID: <86pqnlbmao.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221346 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 10:59:09 -0000 Hi, On Mon, 2 May 2011 21:05:52 +0000 (UTC) John Baldwin wrote: JB> Author: jhb JB> Date: Mon May 2 21:05:52 2011 JB> New Revision: 221346 JB> URL: http://svn.freebsd.org/changeset/base/221346 JB> Log: JB> Handle a rare edge case with nearly full TCP receive buffers. If a TCP JB> buffer fills up causing the remote sender to enter into persist mode, but JB> there is still room available in the receive buffer when a window probe JB> arrives (either due to window scaling, or due to the local application JB> very slowing draining data from the receive buffer), then the single byte JB> of data in the window probe is accepted. However, this can cause rcv_nxt JB> to be greater than rcv_adv. This condition will only last until the next JB> ACK packet is pushed out via tcp_output(), and since the previous ACK JB> advertised a zero window, the ACK should be pushed out while the TCP JB> pcb is write-locked. JB> JB> During the window while rcv_nxt is greather than rcv_adv, a few places JB> would compute the remaining receive window via rcv_adv - rcv_nxt. JB> However, this value was then (uint32_t)-1. On a 64 bit machine this JB> could expand to a positive 2^32 - 1 when cast to a long. In particular, JB> when calculating the receive window in tcp_output(), the result would be JB> that the receive window was computed as 2^32 - 1 resulting in advertising JB> a far larger window to the remote peer than actually existed. JB> JB> Fix various places that compute the remaining receive window to either JB> assert that it is not negative (i.e. rcv_nxt <= rcv_adv), or treat the JB> window as full if rcv_nxt is greather than rcv_adv. JB> JB> Reviewed by: bz JB> MFC after: 1 month JB> Modified: JB> head/sys/netinet/tcp_input.c JB> head/sys/netinet/tcp_output.c JB> head/sys/netinet/tcp_timewait.c JB> Modified: head/sys/netinet/tcp_input.c JB> ============================================================================== JB> --- head/sys/netinet/tcp_input.c Mon May 2 21:04:37 2011 (r221345) JB> +++ head/sys/netinet/tcp_input.c Mon May 2 21:05:52 2011 (r221346) JB> @@ -1831,6 +1831,9 @@ tcp_do_segment(struct mbuf *m, struct tc JB> win = sbspace(&so->so_rcv); JB> if (win < 0) JB> win = 0; JB> + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), JB> + ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, JB> + tp->rcv_adv, tp->rcv_nxt)); I am getting this when running tests with HAST (both primary and secondary HAST instances on the same host). HAST is synchronizing data in MAXPHYS (131072 bytes) blocks. The sender splits them on smaller chunks of MAX_SEND_SIZE (32768 bytes), while the receiver receives the whole block calling recv() with MSG_WAITALL option. FreeBSD kopusha.home.net 9.0-CURRENT FreeBSD 9.0-CURRENT #6 r221878: Sat May 14 11:44:42 EEST 2011 root@kopusha.home.net:/usr/obj/usr/src/sys/GENERIC i386 panic: tcp_input negative window: tp 0xc9777ad0 rcv_nxt 1530593650 rcv_adv 1530593651 #0 doadump () at pcpu.h:244 #1 0xc04ddac9 in db_fncall (dummy1=-1063410006, dummy2=0, dummy3=-1, dummy4=0xe67547f0 "\004Huæ") at /usr/src/sys/ddb/db_command.c:548 #2 0xc04ddeff in db_command (last_cmdp=0xc0fcdbfc, cmd_table=0x0, dopager=0) at /usr/src/sys/ddb/db_command.c:445 #3 0xc04ddfb4 in db_command_script (command=0xc0fceb04 "call doadump") at /usr/src/sys/ddb/db_command.c:516 #4 0xc04e2280 in db_script_exec (scriptname=0xe67548fc "kdb.enter.panic", warnifnotfound=Variable "warnifnotfound" is not available. ) at /usr/src/sys/ddb/db_script.c:302 #5 0xc04e2367 in db_script_kdbenter (eventname=0xc0e7d4ee "panic") at /usr/src/sys/ddb/db_script.c:324 #6 0xc04dff98 in db_trap (type=3, code=0) at /usr/src/sys/ddb/db_main.c:228 #7 0xc09da822 in kdb_trap (type=3, code=0, tf=0xe6754a40) at /usr/src/sys/kern/subr_kdb.c:533 #8 0xc0ccc2eb in trap (frame=0xe6754a40) at /usr/src/sys/i386/i386/trap.c:719 #9 0xc0cb4fec in calltrap () at /usr/src/sys/i386/i386/exception.s:168 #10 0xc09da6aa in kdb_enter (why=0xc0e7d4ee "panic", msg=0xc0e7d4ee "panic") at cpufunc.h:71 #11 0xc09a5db4 in panic ( fmt=0xc0ea2d6b "tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u") at /usr/src/sys/kern/kern_shutdown.c:584 #12 0xc0b29cdb in tcp_do_segment (m=0xc9aac800, th=0xc9aac874, so=0xc9e0b680, tp=0xc9777ad0, drop_hdrlen=52, tlen=1, iptos=0 '\0', ti_locked=3) ---Type to continue, or q to quit--- at /usr/src/sys/netinet/tcp_input.c:1834 #13 0xc0b2d309 in tcp_input (m=0xc9aac800, off0=20) at /usr/src/sys/netinet/tcp_input.c:1369 #14 0xc0ac4676 in ip_input (m=0xc9aac800) at /usr/src/sys/netinet/ip_input.c:765 #15 0xc0a6948a in swi_net (arg=0xc1425880) at /usr/src/sys/net/netisr.c:653 #16 0xc097c675 in intr_event_execute_handlers (p=0xc65bf578, ie=0xc6608280) at /usr/src/sys/kern/kern_intr.c:1257 #17 0xc097d559 in ithread_loop (arg=0xc65836a0) at /usr/src/sys/kern/kern_intr.c:1270 #18 0xc0979928 in fork_exit (callout=0xc097d4b0 , arg=0xc65836a0, frame=0xe6754d28) at /usr/src/sys/kern/kern_fork.c:920 #19 0xc0cb5064 in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:275 (kgdb) fr 12 #12 0xc0b29cdb in tcp_do_segment (m=0xc9aac800, th=0xc9aac874, so=0xc9e0b680, tp=0xc9777ad0, drop_hdrlen=52, tlen=1, iptos=0 '\0', ti_locked=3) at /usr/src/sys/netinet/tcp_input.c:1834 1834 KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), (kgdb) p *tp $1 = { t_segq = { lh_first = 0x0 }, t_pspare = {0x0, 0x0}, t_segqlen = 0, t_dupacks = 0, t_timers = 0xc9777cbc, t_inpcb = 0xc8c4cdc0, t_state = 9, t_flags = 525300, t_vnet = 0x0, snd_una = 1602773057, snd_max = 1602773057, snd_nxt = 1602773057, snd_up = 1602773057, snd_wl1 = 1530593650, snd_wl2 = 1602773057, iss = 1602772219, irs = 1499210531, rcv_nxt = 1530593651, rcv_adv = 1530593650, rcv_wnd = 671, ---Type to continue, or q to quit--- rcv_up = 1530593650, snd_wnd = 70872, snd_cwnd = 29510, snd_spare1 = 0, snd_ssthresh = 1073725440, snd_spare2 = 0, snd_recover = 1602773057, t_maxopd = 16344, t_rcvtime = 175861, t_starttime = 171604, t_rtttime = 0, t_rtseq = 1602772220, t_bw_spare1 = 0, t_bw_spare2 = 0, t_rxtcur = 31, t_maxseg = 14336, t_srtt = 56, t_rttvar = 37, t_rxtshift = 0, t_rttmin = 3, t_rttbest = 40, t_rttupdated = 3, max_sndwnd = 71680, ---Type to continue, or q to quit--- t_softerror = 0, t_oobflags = 0 '\0', t_iobc = 0 '\0', snd_scale = 3 '\003', rcv_scale = 3 '\003', request_r_scale = 3 '\003', ts_recent = 175361, ts_recent_age = 175361, ts_offset = 2326744134, last_ack_sent = 1530593651, snd_cwnd_prev = 0, snd_ssthresh_prev = 0, snd_recover_prev = 0, t_sndzerowin = 4, t_badrxtwin = 0, snd_limited = 0 '\0', snd_numholes = 0, snd_holes = { tqh_first = 0x0, tqh_last = 0xc9777bb8 }, snd_fack = 0, rcv_numsacks = 0, ---Type to continue, or q to quit--- sackblks = {{ start = 0, end = 0 }, { start = 0, end = 0 }, { start = 0, end = 0 }, { start = 0, end = 0 }, { start = 0, end = 0 }, { start = 0, end = 0 }}, sack_newdata = 0, sackhint = { nexthole = 0x0, sack_bytes_rexmit = 0, ---Type to continue, or q to quit--- last_sack_ack = 0, ispare = 0, _pad = {0, 0} }, t_rttlow = 0, rfbuf_ts = 175361, rfbuf_cnt = 0, t_tu = 0x0, t_sndrexmitpack = 0, t_rcvoopack = 0, t_toe = 0x0, t_bytes_acked = 0, cc_algo = 0xc0fa6960, ccv = 0xc9777d5c, osd = 0xc9777d74, t_ispare = 0, t_pspare2 = {0x0, 0x0, 0x0, 0x0}, _pad = {0 } } (kgdb) p *so $2 = { so_count = 1, so_type = 1, so_options = 4, so_linger = 0, so_state = 2, so_qstate = 0, so_pcb = 0xc8c4cdc0, so_vnet = 0x0, so_proto = 0xc0fa56a8, so_head = 0x0, so_incomp = { tqh_first = 0x0, tqh_last = 0x0 }, so_comp = { tqh_first = 0x0, tqh_last = 0x0 }, so_list = { tqe_next = 0x0, tqe_prev = 0xc9e0ab88 }, ---Type to continue, or q to quit--- so_qlen = 0, so_incqlen = 0, so_qlimit = 0, so_timeo = 0, so_error = 0, so_sigio = 0x0, so_oobmark = 0, so_aiojobq = { tqh_first = 0x0, tqh_last = 0xc9e0b6cc }, so_rcv = { sb_sel = { si_tdlist = { tqh_first = 0x0, tqh_last = 0x0 }, si_note = { kl_list = { slh_first = 0x0 }, kl_lock = 0xc0970a90 , kl_unlock = 0xc0970ac0 , ---Type to continue, or q to quit--- kl_assert_locked = 0xc0970e10 , kl_assert_unlocked = 0xc0970de0 , kl_lockarg = 0xc9e0b6f8 }, si_mtx = 0x0 }, sb_mtx = { lock_object = { lo_name = 0xc0e84d6b "so_rcv", lo_flags = 16973824, lo_data = 0, lo_witness = 0xc655a618 }, mtx_lock = 4 }, sb_sx = { lock_object = { lo_name = 0xc0e75c2c "so_rcv_sx", lo_flags = 36896768, lo_data = 0, lo_witness = 0xc65634b0 }, sx_lock = 3356203168 ---Type to continue, or q to quit--- }, sb_state = 0, sb_mb = 0xc9aab800, sb_mbtail = 0xc88f0000, sb_lastrecord = 0xc9aab800, sb_sndptr = 0x0, sb_sndptroff = 0, sb_cc = 71010, sb_hiwat = 71680, sb_mbcnt = 85760, sb_mcnt = 23, sb_ccnt = 20, sb_mbmax = 262144, sb_ctl = 0, sb_lowat = 1, sb_timeo = 2000, sb_flags = 2052, sb_upcall = 0, sb_upcallarg = 0x0 }, so_snd = { sb_sel = { si_tdlist = { ---Type to continue, or q to quit--- tqh_first = 0x0, tqh_last = 0x0 }, si_note = { kl_list = { slh_first = 0x0 }, kl_lock = 0xc0970a90 , kl_unlock = 0xc0970ac0 , kl_assert_locked = 0xc0970e10 , kl_assert_unlocked = 0xc0970de0 , kl_lockarg = 0xc9e0b78c }, si_mtx = 0x0 }, sb_mtx = { lock_object = { lo_name = 0xc0e84d64 "so_snd", lo_flags = 16973824, lo_data = 0, lo_witness = 0xc655a5b0 }, mtx_lock = 4 ---Type to continue, or q to quit--- }, sb_sx = { lock_object = { lo_name = 0xc0e75c22 "so_snd_sx", lo_flags = 36896768, lo_data = 0, lo_witness = 0xc6563448 }, sx_lock = 1 }, sb_state = 16, sb_mb = 0x0, sb_mbtail = 0x0, sb_lastrecord = 0x0, sb_sndptr = 0x0, sb_sndptroff = 0, sb_cc = 0, sb_hiwat = 43008, sb_mbcnt = 0, sb_mcnt = 0, sb_ccnt = 0, sb_mbmax = 262144, sb_ctl = 0, ---Type to continue, or q to quit--- sb_lowat = 2048, sb_timeo = 2000, sb_flags = 2048, sb_upcall = 0, sb_upcallarg = 0x0 }, so_cred = 0xc879b700, so_label = 0x0, so_peerlabel = 0x0, so_gencnt = 1987, so_emuldata = 0x0, so_accf = 0x0, so_fibnum = 0, so_user_cookie = 0 } (kgdb) JB> tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); JB> JB> /* Reset receive buffer auto scaling when not in bulk receive mode. */ JB> @@ -2868,7 +2871,10 @@ dodata: /* XXX */ JB> * buffer size. JB> * XXX: Unused. JB> */ JB> - len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt); JB> + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) JB> + len = so->so_rcv.sb_hiwat - (tp->rcv_adv - tp->rcv_nxt); JB> + else JB> + len = so->so_rcv.sb_hiwat; JB> #endif JB> } else { JB> m_freem(m); JB> Modified: head/sys/netinet/tcp_output.c JB> ============================================================================== JB> --- head/sys/netinet/tcp_output.c Mon May 2 21:04:37 2011 (r221345) JB> +++ head/sys/netinet/tcp_output.c Mon May 2 21:05:52 2011 (r221346) JB> @@ -561,15 +561,21 @@ after_sack_rexmit: JB> * taking into account that we are limited by JB> * TCP_MAXWIN << tp->rcv_scale. JB> */ JB> - long adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale) - JB> - (tp->rcv_adv - tp->rcv_nxt); JB> + long adv; JB> + int oldwin; JB> + JB> + adv = min(recwin, (long)TCP_MAXWIN << tp->rcv_scale); JB> + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) { JB> + oldwin = (tp->rcv_adv - tp->rcv_nxt); JB> + adv -= oldwin; JB> + } else JB> + oldwin = 0; JB> JB> /* JB> * If the new window size ends up being the same as the old JB> * size when it is scaled, then don't force a window update. JB> */ JB> - if ((tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale == JB> - (adv + tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale) JB> + if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) JB> goto dontupdate; JB> if (adv >= (long) (2 * tp->t_maxseg)) JB> goto send; JB> @@ -1008,7 +1014,8 @@ send: JB> if (recwin < (long)(so->so_rcv.sb_hiwat / 4) && JB> recwin < (long)tp->t_maxseg) JB> recwin = 0; JB> - if (recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) JB> + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) && JB> + recwin < (long)(tp->rcv_adv - tp->rcv_nxt)) JB> recwin = (long)(tp->rcv_adv - tp->rcv_nxt); JB> if (recwin > (long)TCP_MAXWIN << tp->rcv_scale) JB> recwin = (long)TCP_MAXWIN << tp->rcv_scale; JB> Modified: head/sys/netinet/tcp_timewait.c JB> ============================================================================== JB> --- head/sys/netinet/tcp_timewait.c Mon May 2 21:04:37 2011 (r221345) JB> +++ head/sys/netinet/tcp_timewait.c Mon May 2 21:05:52 2011 (r221346) JB> @@ -242,6 +242,9 @@ tcp_twstart(struct tcpcb *tp) JB> /* JB> * Recover last window size sent. JB> */ JB> + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), JB> + ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, JB> + tp->rcv_adv, tp->rcv_nxt)); JB> tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; JB> JB> /* -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat May 14 11:24:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58C4A106564A; Sat, 14 May 2011 11:24:29 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4618FC15; Sat, 14 May 2011 11:24:27 +0000 (UTC) Received: by bwz12 with SMTP id 12so3948287bwz.13 for ; Sat, 14 May 2011 04:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:references:x-comment-to :sender:date:in-reply-to:message-id:user-agent:mime-version :content-type; bh=iWh/GLCvtaLcRpYhJO/W6ycKXcWozsGPWlsOYfBf37c=; b=nbQoBwtXhxlpTCs3GbUtCoaN1iwFXXmzzKvwVASZTzDQsZGmxGGElzEzbUaHcK2bf+ U8hvj577REcPM0XbCR17lE7Leyfk3ceEmBGe5wazSDc/1C9/GOgbwzPWIbXRCi8DfF1+ KeSGTOE7Zus5gYl107WhEcuAbkUy7f23A+9iY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; b=C2JDlxk7/TANxm0pj8DobpZiylx8CdbP86vughC7MeDa8xOcIGheWDRZ167CU1O47h KVga53IdHJ9F7UQxvjyW0kjfBXLzRrgFTQCUln+WuJ09qEyc6/EMlnK+j19t+9JB7+Ml LetM8LMttzsbd+0vEHVCS1Y3aQFcvoibGvPFU= Received: by 10.204.7.74 with SMTP id c10mr2418994bkc.104.1305372267042; Sat, 14 May 2011 04:24:27 -0700 (PDT) Received: from localhost ([95.69.172.154]) by mx.google.com with ESMTPS id l1sm1869422bkl.13.2011.05.14.04.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2011 04:24:25 -0700 (PDT) From: Mikolaj Golub To: John Baldwin References: <201105022105.p42L5q3j054498@svn.freebsd.org> <86pqnlbmao.fsf@kopusha.home.net> X-Comment-To: Mikolaj Golub Sender: Mikolaj Golub Date: Sat, 14 May 2011 14:24:23 +0300 In-Reply-To: <86pqnlbmao.fsf@kopusha.home.net> (Mikolaj Golub's message of "Sat, 14 May 2011 13:37:19 +0300") Message-ID: <86liy9bk48.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221346 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 11:24:29 -0000 On Sat, 14 May 2011 13:37:19 +0300 Mikolaj Golub wrote to John Baldwin: JB>> + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), JB>> + ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, JB>> + tp->rcv_adv, tp->rcv_nxt)); BTW, the message is printed wrongly because of the wrong order of arguments. It was a bit confusing :) JB>> Modified: head/sys/netinet/tcp_timewait.c JB>> ============================================================================== JB>> --- head/sys/netinet/tcp_timewait.c Mon May 2 21:04:37 2011 (r221345) JB>> +++ head/sys/netinet/tcp_timewait.c Mon May 2 21:05:52 2011 (r221346) JB>> @@ -242,6 +242,9 @@ tcp_twstart(struct tcpcb *tp) JB>> /* JB>> * Recover last window size sent. JB>> */ JB>> + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), JB>> + ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, JB>> + tp->rcv_adv, tp->rcv_nxt)); The same here. JB>> tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; JB>> JB>> /* MG> -- MG> Mikolaj Golub -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat May 14 11:26:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1CF106566B; Sat, 14 May 2011 11:26:01 +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 22CF58FC08; Sat, 14 May 2011 11:26:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EBQ1Ih001960; Sat, 14 May 2011 11:26:01 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EBQ1AQ001958; Sat, 14 May 2011 11:26:01 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201105141126.p4EBQ1AQ001958@svn.freebsd.org> From: Bruce Cran Date: Sat, 14 May 2011 11:26:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221879 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 11:26:01 -0000 Author: brucec Date: Sat May 14 11:26:00 2011 New Revision: 221879 URL: http://svn.freebsd.org/changeset/base/221879 Log: gcc and clang semantics imply certain -mno-* flags when other certain -mno-* flags are also specified. This change makes use of this behaviour and removes unneeded -mno-* flags. Note that clang does not yet enable AVX support for any CPU. However at some point in the future it will and since we definitely want to disable it for the kernel, we might as well add the -mno-avx flag now. Submitted by: arundel Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat May 14 05:43:33 2011 (r221878) +++ head/sys/conf/kern.mk Sat May 14 11:26:00 2011 (r221879) @@ -25,11 +25,21 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wn # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3 and -mno-ssse3 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, +# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# .if ${MACHINE_CPUARCH} == "i386" .if ${CC:T:Mclang} != "clang" -CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 +CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse +.else +CFLAGS+= -mno-aes -mno-avx .endif -CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -mno-mmx -msoft-float INLINE_LIMIT?= 8000 .endif @@ -61,10 +71,23 @@ INLINE_LIMIT?= 15000 # operations inside the kernel itself. These operations are exclusively # reserved for user applications. # +# gcc: +# Setting -mno-mmx implies -mno-3dnow +# Setting -mno-sse implies -mno-sse2, -mno-sse3, -mno-ssse3 and -mfpmath=387 +# +# clang: +# Setting -mno-mmx implies -mno-3dnow, -mno-3dnowa, -mno-sse, -mno-sse2, +# -mno-sse3, -mno-ssse3, -mno-sse41 and -mno-sse42 +# (-mfpmath= is not supported) +# .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -mcmodel=kernel -mno-red-zone \ - -mfpmath=387 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -msoft-float -fno-asynchronous-unwind-tables +.if ${CC:T:Mclang} != "clang" +CFLAGS+= -mno-sse +.else +CFLAGS+= -mno-aes -mno-avx +.endif +CFLAGS+= -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float \ + -fno-asynchronous-unwind-tables INLINE_LIMIT?= 8000 .endif From owner-svn-src-head@FreeBSD.ORG Sat May 14 12:16:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50510106566C; Sat, 14 May 2011 12:16:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40C138FC15; Sat, 14 May 2011 12:16:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ECGAYS003179; Sat, 14 May 2011 12:16:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ECGAtC003177; Sat, 14 May 2011 12:16:10 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201105141216.p4ECGAtC003177@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 14 May 2011 12:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221883 - head/sys/dev/usb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 12:16:10 -0000 Author: hselasky Date: Sat May 14 12:16:09 2011 New Revision: 221883 URL: http://svn.freebsd.org/changeset/base/221883 Log: Add new USB ID's. Submitted by: Jim Bryant MFC after: 3 days Modified: head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sat May 14 12:11:17 2011 (r221882) +++ head/sys/dev/usb/usbdevs Sat May 14 12:16:09 2011 (r221883) @@ -628,6 +628,7 @@ vendor OQO 0x1557 OQO vendor UMEDIA 0x157e U-MEDIA Communications vendor FIBERLINE 0x1582 Fiberline vendor SPARKLAN 0x15a9 SparkLAN +vendor SOUNDGRAPH 0x15c2 Soundgraph, Inc. vendor AMIT2 0x15c5 AMIT vendor SOHOWARE 0x15e8 SOHOware vendor UMAX 0x1606 UMAX Data Systems @@ -3141,6 +3142,10 @@ product SPARKLAN RT2573 0x0004 RT2573 product SPARKLAN RT2870_1 0x0006 RT2870 product SPARKLAN RT3070 0x0010 RT3070 +/* Soundgraph products */ +product SOUNDGRAPH IMON_VFD 0x0044 Antec Veris Elite VFD Panel, Knob, and Remote +product SOUNDGRAPH SSTONE_LC16 0xffdc Silverstone LC16 VFD Panel, Knob, and Remote + /* Speed Dragon Multimedia products */ product SPEEDDRAGON MS3303H 0x110b MS3303H Serial From owner-svn-src-head@FreeBSD.ORG Sat May 14 12:22:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3953A106566C; Sat, 14 May 2011 12:22:59 +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 29F728FC08; Sat, 14 May 2011 12:22:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4ECMxUU003363; Sat, 14 May 2011 12:22:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4ECMxqm003361; Sat, 14 May 2011 12:22:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105141222.p4ECMxqm003361@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 14 May 2011 12:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221884 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 12:22:59 -0000 Author: jilles Date: Sat May 14 12:22:58 2011 New Revision: 221884 URL: http://svn.freebsd.org/changeset/base/221884 Log: network.subr: Use printf(1) builtin for hexprint function. Now that printf(1) is a shell builtin, there is no need to emulate it anymore. The external printf(1) is /usr/bin/printf and therefore may not be available in early boot. It may be faster to use printf directly but the function is useful for compatibility. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sat May 14 12:16:09 2011 (r221883) +++ head/etc/network.subr Sat May 14 12:22:58 2011 (r221884) @@ -1333,38 +1333,14 @@ get_default_if() # Echo decimal number $arg (single digit) in hexadecimal format. hexdigit() { - if [ $1 -lt 10 ]; then - echo $1 - else - case $1 in - 10) echo a ;; - 11) echo b ;; - 12) echo c ;; - 13) echo d ;; - 14) echo e ;; - 15) echo f ;; - esac - fi + printf '%x\n' "$1" } # hexprint arg # Echo decimal number $arg (multiple digits) in hexadecimal format. hexprint() { - local val str dig - val=$1 - str='' - dig=`hexdigit $((${val} & 15))` - str=${dig}${str} - val=$((${val} >> 4)) - - while [ ${val} -gt 0 ]; do - dig=`hexdigit $((${val} & 15))` - str=${dig}${str} - val=$((${val} >> 4)) - done - - echo ${str} + printf '%x\n' "$1" } is_wired_interface() From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:19:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4E18106564A; Sat, 14 May 2011 14:19:30 +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 9B2388FC14; Sat, 14 May 2011 14:19:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EEJU89005764; Sat, 14 May 2011 14:19:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EEJU7D005762; Sat, 14 May 2011 14:19:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201105141419.p4EEJU7D005762@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 14 May 2011 14:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221887 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:19:30 -0000 Author: jilles Date: Sat May 14 14:19:30 2011 New Revision: 221887 URL: http://svn.freebsd.org/changeset/base/221887 Log: sh: Add tests for lines that look like heredoc delimiters but are not. Added: head/tools/regression/bin/sh/parser/heredoc10.0 (contents, props changed) head/tools/regression/bin/sh/parser/heredoc9.0 (contents, props changed) Added: head/tools/regression/bin/sh/parser/heredoc10.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/parser/heredoc10.0 Sat May 14 14:19:30 2011 (r221887) @@ -0,0 +1,49 @@ +# $FreeBSD$ + +# It may be argued that +# x=$(cat < Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA2C8106566B; Sat, 14 May 2011 14:25:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A95A18FC16; Sat, 14 May 2011 14:25:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EEPF73005923; Sat, 14 May 2011 14:25:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EEPFTr005919; Sat, 14 May 2011 14:25:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105141425.p4EEPFTr005919@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 14:25:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221888 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:25:15 -0000 Author: adrian Date: Sat May 14 14:25:15 2011 New Revision: 221888 URL: http://svn.freebsd.org/changeset/base/221888 Log: Import initial EEPROM code for Kite (AR9287). I've tested this locally and it does indeed read and attach to an AR9287 EEPROM. But a lot more code needs to be ported over to the HAL before the AR9287 is functional. I'm importing this separate from the rest of the codebase (and unlinked from the build for now) in case someone wishes to begin fiddling with porting the rest of the code over from Linux ath9k. Obtained from: Linux ath9k Added: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c (contents, props changed) head/sys/dev/ath/ath_hal/ah_eeprom_9287.h (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom.h Sat May 14 14:19:30 2011 (r221887) +++ head/sys/dev/ath/ath_hal/ah_eeprom.h Sat May 14 14:25:15 2011 (r221888) @@ -133,4 +133,5 @@ HAL_STATUS ath_hal_v1EepromAttach(struct HAL_STATUS ath_hal_legacyEepromAttach(struct ath_hal *ah); HAL_STATUS ath_hal_v14EepromAttach(struct ath_hal *ah); HAL_STATUS ath_hal_v4kEepromAttach(struct ath_hal *ah); +HAL_STATUS ath_hal_9287EepromAttach(struct ath_hal *ah); #endif /* _ATH_AH_EEPROM_H_ */ Added: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sat May 14 14:25:15 2011 (r221888) @@ -0,0 +1,405 @@ +/* + * Copyright (c) 2008 Sam Leffler, Errno Consulting + * Copyright (c) 2010 Atheros Communications, Inc. + * + * Permission to use, copy, modify, and/or 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. + * + * $FreeBSD$ + */ +#include "opt_ah.h" + +#include "ah.h" +#include "ah_internal.h" +#include "ah_eeprom_v14.h" +#include "ah_eeprom_9287.h" + +static HAL_STATUS +v9287EepromGet(struct ath_hal *ah, int param, void *val) +{ +#define CHAN_A_IDX 0 +#define CHAN_B_IDX 1 +#define IS_VERS(op, v) ((pBase->version & AR5416_EEP_VER_MINOR_MASK) op (v)) + HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; + const MODAL_EEP_9287_HEADER *pModal = &ee->ee_base.modalHeader; + const BASE_EEP_9287_HEADER *pBase = &ee->ee_base.baseEepHeader; + uint32_t sum; + uint8_t *macaddr; + int i; + + switch (param) { + case AR_EEP_NFTHRESH_2: + *(int16_t *)val = pModal->noiseFloorThreshCh[0]; + return HAL_OK; + case AR_EEP_MACADDR: /* Get MAC Address */ + sum = 0; + macaddr = val; + for (i = 0; i < 6; i++) { + macaddr[i] = pBase->macAddr[i]; + sum += pBase->macAddr[i]; + } + if (sum == 0 || sum == 0xffff*3) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: bad mac address %s\n", + __func__, ath_hal_ether_sprintf(macaddr)); + return HAL_EEBADMAC; + } + return HAL_OK; + case AR_EEP_REGDMN_0: + return pBase->regDmn[0]; + case AR_EEP_REGDMN_1: + return pBase->regDmn[1]; + case AR_EEP_OPCAP: + return pBase->deviceCap; + case AR_EEP_OPMODE: + return pBase->opCapFlags; + case AR_EEP_RFSILENT: + return pBase->rfSilent; +#if 0 + case AR_EEP_OB_5: + return pModal[CHAN_A_IDX].ob; + case AR_EEP_DB_5: + return pModal[CHAN_A_IDX].db; + case AR_EEP_OB_2: + return pModal[CHAN_B_IDX].ob; + case AR_EEP_DB_2: + return pModal[CHAN_B_IDX].db; +#endif + case AR_EEP_TXMASK: + return pBase->txMask; + case AR_EEP_RXMASK: + return pBase->rxMask; +#if 0 + case AR_EEP_RXGAIN_TYPE: + return IS_VERS(>=, AR5416_EEP_MINOR_VER_17) ? + pBase->rxGainType : AR5416_EEP_RXGAIN_ORIG; + case AR_EEP_TXGAIN_TYPE: + return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? + pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; +#endif + case AR_EEP_OL_PWRCTRL: + HALASSERT(val == AH_NULL); + return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; + case AR_EEP_AMODE: + return HAL_EIO; /* no 5GHz for Kiwi */ + case AR_EEP_BMODE: + case AR_EEP_GMODE: + HALASSERT(val == AH_NULL); + return pBase->opCapFlags & AR5416_OPFLAGS_11G ? + HAL_OK : HAL_EIO; + case AR_EEP_32KHZCRYSTAL: + case AR_EEP_COMPRESS: + case AR_EEP_FASTFRAME: /* XXX policy decision, h/w can do it */ + case AR_EEP_WRITEPROTECT: /* NB: no write protect bit */ + HALASSERT(val == AH_NULL); + /* fall thru... */ + case AR_EEP_MAXQCU: /* NB: not in opCapFlags */ + case AR_EEP_KCENTRIES: /* NB: not in opCapFlags */ + return HAL_EIO; + case AR_EEP_AES: + case AR_EEP_BURST: + case AR_EEP_RFKILL: + case AR_EEP_TURBO5DISABLE: + case AR_EEP_TURBO2DISABLE: + HALASSERT(val == AH_NULL); + return HAL_OK; + case AR_EEP_ANTGAINMAX_2: + *(int8_t *) val = ee->ee_antennaGainMax[1]; + return HAL_OK; + case AR_EEP_PWR_TABLE_OFFSET: + *(int8_t *) val = pBase->pwrTableOffset; + return HAL_OK; + default: + HALASSERT(0); + return HAL_EINVAL; + } +#undef IS_VERS +#undef CHAN_A_IDX +#undef CHAN_B_IDX +} + +static HAL_BOOL +v9287EepromSet(struct ath_hal *ah, int param, int v) +{ + HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; + + switch (param) { + case AR_EEP_ANTGAINMAX_2: + ee->ee_antennaGainMax[1] = (int8_t) v; + return HAL_OK; + case AR_EEP_ANTGAINMAX_5: + ee->ee_antennaGainMax[0] = (int8_t) v; + return HAL_OK; + } + return HAL_EINVAL; +} + +static HAL_BOOL +v9287EepromDiag(struct ath_hal *ah, int request, + const void *args, uint32_t argsize, void **result, uint32_t *resultsize) +{ + HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; + + switch (request) { + case HAL_DIAG_EEPROM: + *result = ee; + *resultsize = sizeof(HAL_EEPROM_9287); + return AH_TRUE; + } + return AH_FALSE; +} + +/* Do structure specific swaps if Eeprom format is non native to host */ +static void +eepromSwap(HAL_EEPROM_9287 *ee) +{ + uint32_t integer, i; + uint16_t word; + MODAL_EEP_9287_HEADER *pModal; + + /* convert Base Eep header */ + word = __bswap16(ee->ee_base.baseEepHeader.length); + ee->ee_base.baseEepHeader.length = word; + + word = __bswap16(ee->ee_base.baseEepHeader.checksum); + ee->ee_base.baseEepHeader.checksum = word; + + word = __bswap16(ee->ee_base.baseEepHeader.version); + ee->ee_base.baseEepHeader.version = word; + + word = __bswap16(ee->ee_base.baseEepHeader.regDmn[0]); + ee->ee_base.baseEepHeader.regDmn[0] = word; + + word = __bswap16(ee->ee_base.baseEepHeader.regDmn[1]); + ee->ee_base.baseEepHeader.regDmn[1] = word; + + word = __bswap16(ee->ee_base.baseEepHeader.rfSilent); + ee->ee_base.baseEepHeader.rfSilent = word; + + word = __bswap16(ee->ee_base.baseEepHeader.blueToothOptions); + ee->ee_base.baseEepHeader.blueToothOptions = word; + + word = __bswap16(ee->ee_base.baseEepHeader.deviceCap); + ee->ee_base.baseEepHeader.deviceCap = word; + + /* convert Modal Eep header */ + + /* only 2.4ghz here; so only one modal header entry */ + pModal = &ee->ee_base.modalHeader; + + /* XXX linux/ah_osdep.h only defines __bswap32 for BE */ + integer = __bswap32(pModal->antCtrlCommon); + pModal->antCtrlCommon = integer; + + for (i = 0; i < AR9287_MAX_CHAINS; i++) { + integer = __bswap32(pModal->antCtrlChain[i]); + pModal->antCtrlChain[i] = integer; + } + for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) { + word = __bswap16(pModal->spurChans[i].spurChan); + pModal->spurChans[i].spurChan = word; + } +} + +static uint16_t +v9287EepromGetSpurChan(struct ath_hal *ah, int ix, HAL_BOOL is2GHz) +{ + HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; + + HALASSERT(is2GHz == AH_TRUE); + if (is2GHz != AH_TRUE) + return 0; /* XXX ? */ + + HALASSERT(0 <= ix && ix < AR5416_EEPROM_MODAL_SPURS); + return ee->ee_base.modalHeader.spurChans[ix].spurChan; +} + +/************************************************************************** + * fbin2freq + * + * Get channel value from binary representation held in eeprom + * RETURNS: the frequency in MHz + */ +static uint16_t +fbin2freq(uint8_t fbin, HAL_BOOL is2GHz) +{ + /* + * Reserved value 0xFF provides an empty definition both as + * an fbin and as a frequency - do not convert + */ + if (fbin == AR5416_BCHAN_UNUSED) + return fbin; + return (uint16_t)((is2GHz) ? (2300 + fbin) : (4800 + 5 * fbin)); +} + + +/* + * Copy EEPROM Conformance Testing Limits contents + * into the allocated space + */ +/* USE CTLS from chain zero */ +#define CTL_CHAIN 0 + +static void +v9287EepromReadCTLInfo(struct ath_hal *ah, HAL_EEPROM_9287 *ee) +{ + RD_EDGES_POWER *rep = ee->ee_rdEdgesPower; + int i, j; + + HALASSERT(AR9287_NUM_CTLS <= sizeof(ee->ee_rdEdgesPower)/NUM_EDGES); + + for (i = 0; ee->ee_base.ctlIndex[i] != 0 && i < AR9287_NUM_CTLS; i++) { + for (j = 0; j < NUM_EDGES; j ++) { + /* XXX Confirm this is the right thing to do when an invalid channel is stored */ + if (ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel == AR5416_BCHAN_UNUSED) { + rep[j].rdEdge = 0; + rep[j].twice_rdEdgePower = 0; + rep[j].flag = 0; + } else { + rep[j].rdEdge = fbin2freq( + ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].bChannel, + (ee->ee_base.ctlIndex[i] & CTL_MODE_M) != CTL_11A); + rep[j].twice_rdEdgePower = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_POWER); + rep[j].flag = MS(ee->ee_base.ctlData[i].ctlEdges[CTL_CHAIN][j].tPowerFlag, CAL_CTL_EDGES_FLAG) != 0; + } + } + rep += NUM_EDGES; + } + ee->ee_numCtls = i; + HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM, + "%s Numctls = %u\n",__func__,i); +} + +/* + * Reclaim any EEPROM-related storage. + */ +static void +v9287EepromDetach(struct ath_hal *ah) +{ + HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; + + ath_hal_free(ee); + AH_PRIVATE(ah)->ah_eeprom = AH_NULL; +} + +#define owl_get_eep_ver(_ee) \ + (((_ee)->ee_base.baseEepHeader.version >> 12) & 0xF) +#define owl_get_eep_rev(_ee) \ + (((_ee)->ee_base.baseEepHeader.version) & 0xFFF) + +HAL_STATUS +ath_hal_9287EepromAttach(struct ath_hal *ah) +{ +#define NW(a) (sizeof(a) / sizeof(uint16_t)) + HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; + uint16_t *eep_data, magic; + HAL_BOOL need_swap; + u_int w, off, len; + uint32_t sum; + + HALASSERT(ee == AH_NULL); + + if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s Error reading Eeprom MAGIC\n", __func__); + return HAL_EEREAD; + } + HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n", + __func__, magic); + if (magic != AR5416_EEPROM_MAGIC) { + HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n"); + return HAL_EEMAGIC; + } + + ee = ath_hal_malloc(sizeof(HAL_EEPROM_9287)); + if (ee == AH_NULL) { + /* XXX message */ + return HAL_ENOMEM; + } + + eep_data = (uint16_t *) ee; + for (w = 0; w < NW(struct ar9287_eeprom); w++) { + off = AR9287_EEP_START_LOC + w; + if (!ath_hal_eepromRead(ah, off, &eep_data[w])) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "%s eeprom read error at offset 0x%x\n", + __func__, off); + return HAL_EEREAD; + } + } + /* Convert to eeprom native eeprom endian format */ + if (isBigEndian()) { + for (w = 0; w < NW(HAL_EEPROM_9287); w++) + eep_data[w] = __bswap16(eep_data[w]); + } + + /* + * At this point, we're in the native eeprom endian format + * Now, determine the eeprom endian by looking at byte 26?? + */ + need_swap = ((ee->ee_base.baseEepHeader.eepMisc & AR5416_EEPMISC_BIG_ENDIAN) != 0) ^ isBigEndian(); + if (need_swap) { + HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM, + "Byte swap EEPROM contents.\n"); + len = __bswap16(ee->ee_base.baseEepHeader.length); + } else { + len = ee->ee_base.baseEepHeader.length; + } + len = AH_MIN(len, sizeof(HAL_EEPROM_9287)) / sizeof(uint16_t); + + /* Apply the checksum, done in native eeprom format */ + /* XXX - Need to check to make sure checksum calculation is done + * in the correct endian format. Right now, it seems it would + * cast the raw data to host format and do the calculation, which may + * not be correct as the calculation may need to be done in the native + * eeprom format + */ + sum = 0; + for (w = 0; w < len; w++) + sum ^= eep_data[w]; + /* Check CRC - Attach should fail on a bad checksum */ + if (sum != 0xffff) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "Bad EEPROM checksum 0x%x (Len=%u)\n", sum, len); + return HAL_EEBADSUM; + } + + if (need_swap) + eepromSwap(ee); /* byte swap multi-byte data */ + + /* swap words 0+2 so version is at the front */ + magic = eep_data[0]; + eep_data[0] = eep_data[2]; + eep_data[2] = magic; + + HALDEBUG(ah, HAL_DEBUG_ATTACH | HAL_DEBUG_EEPROM, + "%s Eeprom Version %u.%u\n", __func__, + owl_get_eep_ver(ee), owl_get_eep_rev(ee)); + + /* NB: must be after all byte swapping */ + if (owl_get_eep_ver(ee) != AR5416_EEP_VER) { + HALDEBUG(ah, HAL_DEBUG_ANY, + "Bad EEPROM version 0x%x\n", owl_get_eep_ver(ee)); + return HAL_EEBADSUM; + } + + v9287EepromReadCTLInfo(ah, ee); /* Get CTLs */ + + AH_PRIVATE(ah)->ah_eeprom = ee; + AH_PRIVATE(ah)->ah_eeversion = ee->ee_base.baseEepHeader.version; + AH_PRIVATE(ah)->ah_eepromDetach = v9287EepromDetach; + AH_PRIVATE(ah)->ah_eepromGet = v9287EepromGet; + AH_PRIVATE(ah)->ah_eepromSet = v9287EepromSet; + AH_PRIVATE(ah)->ah_getSpurChan = v9287EepromGetSpurChan; + AH_PRIVATE(ah)->ah_eepromDiag = v9287EepromDiag; + return HAL_OK; +#undef NW +} Added: head/sys/dev/ath/ath_hal/ah_eeprom_9287.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.h Sat May 14 14:25:15 2011 (r221888) @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2008-2009 Atheros Communications Inc. + * + * Permission to use, copy, modify, and/or 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. + * + * $FreeBSD$ + */ + +#ifndef __AH_EEPROM_9287_H__ +#define __AH_EEPROM_9287_H__ + +#define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \ + ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) + +#define AR9287_EEP_VER 0xE +#define AR9287_EEP_VER_MINOR_MASK 0xFFF +#define AR9287_EEP_MINOR_VER_1 0x1 +#define AR9287_EEP_MINOR_VER_2 0x2 +#define AR9287_EEP_MINOR_VER_3 0x3 +#define AR9287_EEP_MINOR_VER AR9287_EEP_MINOR_VER_3 +#define AR9287_EEP_MINOR_VER_b AR9287_EEP_MINOR_VER +#define AR9287_EEP_NO_BACK_VER AR9287_EEP_MINOR_VER_1 + +#define AR9287_EEP_START_LOC 128 +#define AR9287_HTC_EEP_START_LOC 256 +#define AR9287_NUM_2G_CAL_PIERS 3 +#define AR9287_NUM_2G_CCK_TARGET_POWERS 3 +#define AR9287_NUM_2G_20_TARGET_POWERS 3 +#define AR9287_NUM_2G_40_TARGET_POWERS 3 +#define AR9287_NUM_CTLS 12 +#define AR9287_NUM_BAND_EDGES 4 +#define AR9287_PD_GAIN_ICEPTS 1 +#define AR9287_EEPMISC_BIG_ENDIAN 0x01 +#define AR9287_EEPMISC_WOW 0x02 +#define AR9287_MAX_CHAINS 2 +#define AR9287_ANT_16S 32 + +#define AR9287_DATA_SZ 32 + +#define AR9287_PWR_TABLE_OFFSET_DB -5 + +#define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) + +struct base_eep_ar9287_header { + uint16_t version; /* Swapped w/ length; check ah_eeprom_v14.h */ + uint16_t checksum; + uint16_t length; + uint8_t opCapFlags; + uint8_t eepMisc; + uint16_t regDmn[2]; + uint8_t macAddr[6]; + uint8_t rxMask; + uint8_t txMask; + uint16_t rfSilent; + uint16_t blueToothOptions; + uint16_t deviceCap; + uint32_t binBuildNumber; + uint8_t deviceType; + uint8_t openLoopPwrCntl; + int8_t pwrTableOffset; + int8_t tempSensSlope; + int8_t tempSensSlopePalOn; + uint8_t futureBase[29]; +} __packed; + +struct modal_eep_ar9287_header { + uint32_t antCtrlChain[AR9287_MAX_CHAINS]; + uint32_t antCtrlCommon; + int8_t antennaGainCh[AR9287_MAX_CHAINS]; + uint8_t switchSettling; + uint8_t txRxAttenCh[AR9287_MAX_CHAINS]; + uint8_t rxTxMarginCh[AR9287_MAX_CHAINS]; + int8_t adcDesiredSize; + uint8_t txEndToXpaOff; + uint8_t txEndToRxOn; + uint8_t txFrameToXpaOn; + uint8_t thresh62; + int8_t noiseFloorThreshCh[AR9287_MAX_CHAINS]; + uint8_t xpdGain; + uint8_t xpd; + int8_t iqCalICh[AR9287_MAX_CHAINS]; + int8_t iqCalQCh[AR9287_MAX_CHAINS]; + uint8_t pdGainOverlap; + uint8_t xpaBiasLvl; + uint8_t txFrameToDataStart; + uint8_t txFrameToPaOn; + uint8_t ht40PowerIncForPdadc; + uint8_t bswAtten[AR9287_MAX_CHAINS]; + uint8_t bswMargin[AR9287_MAX_CHAINS]; + uint8_t swSettleHt40; + uint8_t version; + uint8_t db1; + uint8_t db2; + uint8_t ob_cck; + uint8_t ob_psk; + uint8_t ob_qam; + uint8_t ob_pal_off; + uint8_t futureModal[30]; + SPUR_CHAN spurChans[AR5416_EEPROM_MODAL_SPURS]; +} __packed; + +struct cal_data_op_loop_ar9287 { + uint8_t pwrPdg[2][5]; + uint8_t vpdPdg[2][5]; + uint8_t pcdac[2][5]; + uint8_t empty[2][5]; +} __packed; + +struct cal_data_per_freq_ar9287 { + uint8_t pwrPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS]; + uint8_t vpdPdg[AR5416_NUM_PD_GAINS][AR9287_PD_GAIN_ICEPTS]; +} __packed; + +union cal_data_per_freq_ar9287_u { + struct cal_data_op_loop_ar9287 calDataOpen; + struct cal_data_per_freq_ar9287 calDataClose; +} __packed; + +struct cal_ctl_data_ar9287 { + CAL_CTL_EDGES ctlEdges[AR9287_MAX_CHAINS][AR9287_NUM_BAND_EDGES]; +} __packed; + +struct ar9287_eeprom { + struct base_eep_ar9287_header baseEepHeader; + uint8_t custData[AR9287_DATA_SZ]; + struct modal_eep_ar9287_header modalHeader; + uint8_t calFreqPier2G[AR9287_NUM_2G_CAL_PIERS]; + union cal_data_per_freq_ar9287_u + calPierData2G[AR9287_MAX_CHAINS][AR9287_NUM_2G_CAL_PIERS]; + CAL_TARGET_POWER_LEG + calTargetPowerCck[AR9287_NUM_2G_CCK_TARGET_POWERS]; + CAL_TARGET_POWER_LEG + calTargetPower2G[AR9287_NUM_2G_20_TARGET_POWERS]; + CAL_TARGET_POWER_HT + calTargetPower2GHT20[AR9287_NUM_2G_20_TARGET_POWERS]; + CAL_TARGET_POWER_HT + calTargetPower2GHT40[AR9287_NUM_2G_40_TARGET_POWERS]; + uint8_t ctlIndex[AR9287_NUM_CTLS]; + struct cal_ctl_data_ar9287 ctlData[AR9287_NUM_CTLS]; + uint8_t padding; +} __packed; + +typedef struct { + struct ar9287_eeprom ee_base; +#define NUM_EDGES 8 + uint16_t ee_numCtls; + RD_EDGES_POWER ee_rdEdgesPower[NUM_EDGES*AR9287_NUM_CTLS]; + /* XXX these are dynamically calculated for use by shared code */ + int8_t ee_antennaGainMax[2]; +} HAL_EEPROM_9287; + +typedef struct modal_eep_ar9287_header MODAL_EEP_9287_HEADER; +typedef struct base_eep_ar9287_header BASE_EEP_9287_HEADER; + + +#endif /* __AH_EEPROM_9287_H__ */ From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:36:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7F241065673; Sat, 14 May 2011 14:36:08 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85A68FC0A; Sat, 14 May 2011 14:36:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EEa8CV006150; Sat, 14 May 2011 14:36:08 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EEa8Tt006148; Sat, 14 May 2011 14:36:08 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201105141436.p4EEa8Tt006148@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 14 May 2011 14:36:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221889 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:36:08 -0000 Author: marcel Date: Sat May 14 14:36:08 2011 New Revision: 221889 URL: http://svn.freebsd.org/changeset/base/221889 Log: Turn ia64_srlz() and ia64_srlz_i() into defines so that the code is still correct when inlining is disabled. Modified: head/sys/ia64/include/ia64_cpu.h Modified: head/sys/ia64/include/ia64_cpu.h ============================================================================== --- head/sys/ia64/include/ia64_cpu.h Sat May 14 14:25:15 2011 (r221888) +++ head/sys/ia64/include/ia64_cpu.h Sat May 14 14:36:08 2011 (r221889) @@ -508,17 +508,14 @@ ia64_enable_highfp(void) __asm __volatile("rsm psr.dfh;; srlz.d"); } -static __inline void -ia64_srlz_d(void) -{ - __asm __volatile("srlz.d"); -} - -static __inline void -ia64_srlz_i(void) -{ - __asm __volatile("srlz.i;;"); -} +/* + * Avoid inline functions for the following so that they still work + * correctly when inlining is not enabled (e.g. -O0). Function calls + * need data serialization after setting psr, which results in a + * hazard. + */ +#define ia64_srlz_d() __asm __volatile("srlz.d") +#define ia64_srlz_i() __asm __volatile("srlz.i;;") #endif /* !LOCORE */ From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:37:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A2F51065672; Sat, 14 May 2011 14:37:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 350E28FC15; Sat, 14 May 2011 14:37:53 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id ADBEA46B2E; Sat, 14 May 2011 10:37:52 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (unknown [192.75.139.253]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 051E78A050; Sat, 14 May 2011 10:37:51 -0400 (EDT) Message-ID: <4DCE93BF.7000803@FreeBSD.org> Date: Sat, 14 May 2011 10:37:51 -0400 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Mikolaj Golub References: <201105022105.p42L5q3j054498@svn.freebsd.org> <86pqnlbmao.fsf@kopusha.home.net> In-Reply-To: <86pqnlbmao.fsf@kopusha.home.net> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sat, 14 May 2011 10:37:52 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221346 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:37:53 -0000 On 5/14/11 6:37 AM, Mikolaj Golub wrote: > Hi, > > On Mon, 2 May 2011 21:05:52 +0000 (UTC) John Baldwin wrote: > > JB> Author: jhb > JB> Date: Mon May 2 21:05:52 2011 > JB> New Revision: 221346 > JB> URL: http://svn.freebsd.org/changeset/base/221346 > > JB> Log: > JB> Handle a rare edge case with nearly full TCP receive buffers. If a TCP > JB> buffer fills up causing the remote sender to enter into persist mode, but > JB> there is still room available in the receive buffer when a window probe > JB> arrives (either due to window scaling, or due to the local application > JB> very slowing draining data from the receive buffer), then the single byte > JB> of data in the window probe is accepted. However, this can cause rcv_nxt > JB> to be greater than rcv_adv. This condition will only last until the next > JB> ACK packet is pushed out via tcp_output(), and since the previous ACK > JB> advertised a zero window, the ACK should be pushed out while the TCP > JB> pcb is write-locked. > JB> > JB> During the window while rcv_nxt is greather than rcv_adv, a few places > JB> would compute the remaining receive window via rcv_adv - rcv_nxt. > JB> However, this value was then (uint32_t)-1. On a 64 bit machine this > JB> could expand to a positive 2^32 - 1 when cast to a long. In particular, > JB> when calculating the receive window in tcp_output(), the result would be > JB> that the receive window was computed as 2^32 - 1 resulting in advertising > JB> a far larger window to the remote peer than actually existed. > JB> > JB> Fix various places that compute the remaining receive window to either > JB> assert that it is not negative (i.e. rcv_nxt<= rcv_adv), or treat the > JB> window as full if rcv_nxt is greather than rcv_adv. > JB> > JB> Reviewed by: bz > JB> MFC after: 1 month > > JB> Modified: > JB> head/sys/netinet/tcp_input.c > JB> head/sys/netinet/tcp_output.c > JB> head/sys/netinet/tcp_timewait.c > > JB> Modified: head/sys/netinet/tcp_input.c > JB> ============================================================================== > JB> --- head/sys/netinet/tcp_input.c Mon May 2 21:04:37 2011 (r221345) > JB> +++ head/sys/netinet/tcp_input.c Mon May 2 21:05:52 2011 (r221346) > JB> @@ -1831,6 +1831,9 @@ tcp_do_segment(struct mbuf *m, struct tc > JB> win = sbspace(&so->so_rcv); > JB> if (win< 0) > JB> win = 0; > JB> + KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), > JB> + ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, > JB> + tp->rcv_adv, tp->rcv_nxt)); > > I am getting this when running tests with HAST (both primary and secondary HAST > instances on the same host). > > HAST is synchronizing data in MAXPHYS (131072 bytes) blocks. The sender splits > them on smaller chunks of MAX_SEND_SIZE (32768 bytes), while the receiver > receives the whole block calling recv() with MSG_WAITALL option. Can you capture a tcpdump (probably easiest to do from the other host)? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:40:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67686106566B; Sat, 14 May 2011 14:40:24 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57F0B8FC08; Sat, 14 May 2011 14:40:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EEeOsb006267; Sat, 14 May 2011 14:40:24 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EEeOCc006265; Sat, 14 May 2011 14:40:24 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201105141440.p4EEeOCc006265@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 14 May 2011 14:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221890 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:40:24 -0000 Author: marcel Date: Sat May 14 14:40:24 2011 New Revision: 221890 URL: http://svn.freebsd.org/changeset/base/221890 Log: Be pedantic: mark the pcpu pointer (= register r13) itself as volatile. Modified: head/sys/ia64/include/pcpu.h Modified: head/sys/ia64/include/pcpu.h ============================================================================== --- head/sys/ia64/include/pcpu.h Sat May 14 14:36:08 2011 (r221889) +++ head/sys/ia64/include/pcpu.h Sat May 14 14:40:24 2011 (r221890) @@ -68,7 +68,7 @@ struct pcpu_md { struct pcpu; -register struct pcpu *pcpup __asm__("r13"); +register struct pcpu * volatile pcpup __asm__("r13"); static __inline __pure2 struct thread * __curthread(void) From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:41:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6078D106566B; Sat, 14 May 2011 14:41:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 512438FC0C; Sat, 14 May 2011 14:41:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EEff57006331; Sat, 14 May 2011 14:41:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EEffX1006328; Sat, 14 May 2011 14:41:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201105141441.p4EEffX1006328@svn.freebsd.org> From: John Baldwin Date: Sat, 14 May 2011 14:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221891 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:41:41 -0000 Author: jhb Date: Sat May 14 14:41:40 2011 New Revision: 221891 URL: http://svn.freebsd.org/changeset/base/221891 Log: Oops, fix order of sequence numbers in KASSERT()'s to catch negative receive windows to match the labels in the panic message. Submitted by: trociny Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat May 14 14:40:24 2011 (r221890) +++ head/sys/netinet/tcp_input.c Sat May 14 14:41:40 2011 (r221891) @@ -1833,7 +1833,7 @@ tcp_do_segment(struct mbuf *m, struct tc win = 0; KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_adv, tp->rcv_nxt)); + tp->rcv_nxt, tp->rcv_adv)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Sat May 14 14:40:24 2011 (r221890) +++ head/sys/netinet/tcp_timewait.c Sat May 14 14:41:40 2011 (r221891) @@ -244,7 +244,7 @@ tcp_twstart(struct tcpcb *tp) */ KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_adv, tp->rcv_nxt)); + tp->rcv_nxt, tp->rcv_adv)); tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; /* From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:47:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E351106566C; Sat, 14 May 2011 14:47:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E8CA8FC12; Sat, 14 May 2011 14:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EElKYi006524; Sat, 14 May 2011 14:47:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EElKKb006522; Sat, 14 May 2011 14:47:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201105141447.p4EElKKb006522@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 14 May 2011 14:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221893 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:47:20 -0000 Author: marcel Date: Sat May 14 14:47:19 2011 New Revision: 221893 URL: http://svn.freebsd.org/changeset/base/221893 Log: Sharpening the saw: o Clobber the register that holds the restart token immediately after crossing the restart point. This prevents false positives (i.e. a nested exception that we don't know can happen and that is being treated as one we know by virtue of a lingering restart token). o Now that the bootstrap kernel stack is free, switch onto it and call trap() for nested traps that we don't know about. In trap we panic() so that we can analyze the condition. Modified: head/sys/ia64/ia64/exception.S Modified: head/sys/ia64/ia64/exception.S ============================================================================== --- head/sys/ia64/ia64/exception.S Sat May 14 14:42:12 2011 (r221892) +++ head/sys/ia64/ia64/exception.S Sat May 14 14:47:19 2011 (r221893) @@ -202,13 +202,13 @@ exception_save_restart: { .mmi st8 [r30]=r19,16 // length st8 [r31]=r0,16 // flags - add r19=16,r19 + add r29=16,r19 // Clobber restart token ;; } { .mmi st8.spill [r30]=sp,16 // sp st8 [r31]=r20,16 // unat - sub sp=r23,r19 + sub sp=r23,r29 ;; } { .mmi @@ -641,7 +641,7 @@ exception_restore_restart: mov r30=ar.bspstore ;; loadrs // load user regs - nop 0 + mov r29=0 // Clobber restart token ;; } { .mmi @@ -1094,22 +1094,26 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) } { .mlx mov r26=ar.bsp - movl r27=kstack + movl r29=kstack ;; } -{ .mmi +{ .mlx mov r28=sp - nop 0 - addl r27=KSTACK_PAGES*PAGE_SIZE-16,r0 + movl r27=kstack_top ;; } { .mmi - mov sp=r27 + add sp=-16,r27 ;; mov r27=ar.bspstore nop 0 ;; } + mov ar.rsc=0 + dep r29=r27,r29,0,9 + ;; + mov ar.bspstore=r29 + ;; CALL(trap, 5, r30) IVT_END(Data_Nested_TLB) From owner-svn-src-head@FreeBSD.ORG Sat May 14 14:55:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2652A1065670; Sat, 14 May 2011 14:55:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16B9E8FC0A; Sat, 14 May 2011 14:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EEtFTJ006712; Sat, 14 May 2011 14:55:15 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EEtFIW006710; Sat, 14 May 2011 14:55:15 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201105141455.p4EEtFIW006710@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 14 May 2011 14:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221894 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 14:55:16 -0000 Author: marcel Date: Sat May 14 14:55:15 2011 New Revision: 221894 URL: http://svn.freebsd.org/changeset/base/221894 Log: Prefer switching the memory stack from user to kernel *before* switching the register stack. While the ordering doesn't matter, it creates an invariant not previously there: the memory stack pointer will always be larger than the register stack pointer. With this invariant in place, it's easier to add instrumentation code that detects a stack overflow because in such a scenario the memory stack pointer and register stack pointers have crossed each other. Aside: basic kernel operation needs about half the stack size (~16K) at most. We have plenty of head room on the kernel stack... Modified: head/sys/ia64/ia64/syscall.S Modified: head/sys/ia64/ia64/syscall.S ============================================================================== --- head/sys/ia64/ia64/syscall.S Sat May 14 14:47:19 2011 (r221893) +++ head/sys/ia64/ia64/syscall.S Sat May 14 14:55:15 2011 (r221894) @@ -239,21 +239,22 @@ ENTRY_NOPROFILE(epc_syscall, 8) ;; } { .mmi - mov ar.bspstore=r15 + mov r13=ar.k4 add r30=-SIZEOF_TRAPFRAME,r14 mov r20=sp ;; } { .mii - mov r13=ar.k4 + mov r21=ar.unat dep r30=0,r30,0,10 ;; add sp=-16,r30 ;; } { .mmi + mov ar.bspstore=r15 + ;; mov ar.rnat=r19 - mov r21=ar.unat add r31=8,r30 ;; } From owner-svn-src-head@FreeBSD.ORG Sat May 14 15:12:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0100106564A; Sat, 14 May 2011 15:12:02 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5D518FC0A; Sat, 14 May 2011 15:12:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EFC2Mq007130; Sat, 14 May 2011 15:12:02 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EFC21O007123; Sat, 14 May 2011 15:12:02 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105141512.p4EFC21O007123@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 15:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221896 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 15:12:02 -0000 Author: adrian Date: Sat May 14 15:12:02 2011 New Revision: 221896 URL: http://svn.freebsd.org/changeset/base/221896 Log: Fix the eeprom set API method to return HAL_STATUS. The code assumed it could return HAL_OK, HAL_EINVAL and other HAL_STATUS types; so it shouldn't be declared as returning HAL_BOOL. This commit was brought to you by the Clang compiler. Submitted by: Matthew Fleming Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c head/sys/dev/ath/ath_hal/ah_eeprom_v1.c head/sys/dev/ath/ath_hal/ah_eeprom_v14.c head/sys/dev/ath/ath_hal/ah_eeprom_v3.c head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom_9287.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sat May 14 15:02:50 2011 (r221895) +++ head/sys/dev/ath/ath_hal/ah_eeprom_9287.c Sat May 14 15:12:02 2011 (r221896) @@ -126,7 +126,7 @@ v9287EepromGet(struct ath_hal *ah, int p #undef CHAN_B_IDX } -static HAL_BOOL +static HAL_STATUS v9287EepromSet(struct ath_hal *ah, int param, int v) { HAL_EEPROM_9287 *ee = AH_PRIVATE(ah)->ah_eeprom; Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v1.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Sat May 14 15:02:50 2011 (r221895) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v1.c Sat May 14 15:12:02 2011 (r221896) @@ -68,7 +68,7 @@ v1EepromGet(struct ath_hal *ah, int para } } -static HAL_BOOL +static HAL_STATUS v1EepromSet(struct ath_hal *ah, int param, int v) { return HAL_EINVAL; Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat May 14 15:02:50 2011 (r221895) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat May 14 15:12:02 2011 (r221896) @@ -148,7 +148,7 @@ v14EepromGet(struct ath_hal *ah, int par #undef CHAN_B_IDX } -static HAL_BOOL +static HAL_STATUS v14EepromSet(struct ath_hal *ah, int param, int v) { HAL_EEPROM_v14 *ee = AH_PRIVATE(ah)->ah_eeprom; Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v3.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v3.c Sat May 14 15:02:50 2011 (r221895) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v3.c Sat May 14 15:12:02 2011 (r221896) @@ -1665,7 +1665,7 @@ legacyEepromGet(struct ath_hal *ah, int return HAL_EINVAL; } -static HAL_BOOL +static HAL_STATUS legacyEepromSet(struct ath_hal *ah, int param, int v) { HAL_EEPROM *ee = AH_PRIVATE(ah)->ah_eeprom; Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Sat May 14 15:02:50 2011 (r221895) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Sat May 14 15:12:02 2011 (r221896) @@ -116,7 +116,7 @@ v4kEepromGet(struct ath_hal *ah, int par #undef CHAN_B_IDX } -static HAL_BOOL +static HAL_STATUS v4kEepromSet(struct ath_hal *ah, int param, int v) { HAL_EEPROM_v4k *ee = AH_PRIVATE(ah)->ah_eeprom; Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Sat May 14 15:02:50 2011 (r221895) +++ head/sys/dev/ath/ath_hal/ah_internal.h Sat May 14 15:12:02 2011 (r221896) @@ -269,7 +269,7 @@ struct ath_hal_private { uint16_t ah_eeversion; /* EEPROM version */ void (*ah_eepromDetach)(struct ath_hal *); HAL_STATUS (*ah_eepromGet)(struct ath_hal *, int, void *); - HAL_BOOL (*ah_eepromSet)(struct ath_hal *, int, int); + HAL_STATUS (*ah_eepromSet)(struct ath_hal *, int, int); uint16_t (*ah_getSpurChan)(struct ath_hal *, int, HAL_BOOL); HAL_BOOL (*ah_eepromDiag)(struct ath_hal *, int request, const void *args, uint32_t argsize, From owner-svn-src-head@FreeBSD.ORG Sat May 14 15:24:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261D81065670; Sat, 14 May 2011 15:24:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1655B8FC17; Sat, 14 May 2011 15:24:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EFOF89007405; Sat, 14 May 2011 15:24:15 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EFOFLs007403; Sat, 14 May 2011 15:24:15 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201105141524.p4EFOFLs007403@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 May 2011 15:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221897 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 15:24:16 -0000 Author: adrian Date: Sat May 14 15:24:15 2011 New Revision: 221897 URL: http://svn.freebsd.org/changeset/base/221897 Log: Fix the Merlin 5ghz fast-clock EEPROM fetch to return the correct value. The eeprom Get method should return HAL_OK if fastclock is enabled in the EEPROM. It was returning the opposite of what it should have. Submitted by: Matthew Fleming Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat May 14 15:12:02 2011 (r221896) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c Sat May 14 15:24:15 2011 (r221897) @@ -84,8 +84,10 @@ v14EepromGet(struct ath_hal *ah, int par return IS_VERS(>=, AR5416_EEP_MINOR_VER_19) ? pBase->txGainType : AR5416_EEP_TXGAIN_ORIG; case AR_EEP_FSTCLK_5G: - return IS_VERS(>, AR5416_EEP_MINOR_VER_16) ? - pBase->fastClk5g : AH_TRUE; + /* 5ghz fastclock is always enabled for Merlin minor <= 16 */ + if (IS_VERS(<=, AR5416_EEP_MINOR_VER_16)) + return HAL_OK; + return pBase->fastClk5g ? HAL_OK : HAL_EIO; case AR_EEP_OL_PWRCTRL: HALASSERT(val == AH_NULL); return pBase->openLoopPwrCntl ? HAL_OK : HAL_EIO; From owner-svn-src-head@FreeBSD.ORG Sat May 14 16:55:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01020106566C; Sat, 14 May 2011 16:55:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4D908FC12; Sat, 14 May 2011 16:55:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EGtO5S009500; Sat, 14 May 2011 16:55:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EGtO34009498; Sat, 14 May 2011 16:55:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105141655.p4EGtO34009498@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 14 May 2011 16:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221898 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 16:55:25 -0000 Author: pjd Date: Sat May 14 16:55:24 2011 New Revision: 221898 URL: http://svn.freebsd.org/changeset/base/221898 Log: When using capsicum to sanbox, still use other methods first, just in case one of them have some problems. Modified: head/sbin/hastd/subr.c Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Sat May 14 15:24:15 2011 (r221897) +++ head/sbin/hastd/subr.c Sat May 14 16:55:24 2011 (r221898) @@ -153,15 +153,7 @@ drop_privs(bool usecapsicum) uid_t ruid, euid, suid; gid_t rgid, egid, sgid; gid_t gidset[1]; - - if (usecapsicum) { - if (cap_enter() == 0) { - pjdlog_debug(1, - "Privileges successfully dropped using capsicum."); - return (0); - } - pjdlog_errno(LOG_WARNING, "Unable to sandbox using capsicum"); - } + bool capsicum; /* * According to getpwnam(3) we have to clear errno before calling the @@ -205,6 +197,16 @@ drop_privs(bool usecapsicum) return (-1); } + capsicum = false; + if (usecapsicum) { + if (cap_enter() == 0) { + capsicum = true; + } else { + pjdlog_errno(LOG_WARNING, + "Unable to sandbox using capsicum"); + } + } + /* * Better be sure that everything succeeded. */ @@ -221,7 +223,8 @@ drop_privs(bool usecapsicum) PJDLOG_VERIFY(gidset[0] == pw->pw_gid); pjdlog_debug(1, - "Privileges successfully dropped using chroot+setgid+setuid."); + "Privileges successfully dropped using %schroot+setgid+setuid.", + capsicum ? "capsicum+" : ""); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat May 14 17:02:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95DDA1065672; Sat, 14 May 2011 17:02:03 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84D288FC0C; Sat, 14 May 2011 17:02:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EH23HL009670; Sat, 14 May 2011 17:02:03 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EH23Ux009664; Sat, 14 May 2011 17:02:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201105141702.p4EH23Ux009664@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 14 May 2011 17:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221899 - in head/sbin: hastctl hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 17:02:03 -0000 Author: pjd Date: Sat May 14 17:02:03 2011 New Revision: 221899 URL: http://svn.freebsd.org/changeset/base/221899 Log: Currently we are unable to use capsicum for the primary worker process, because we need to do ioctl(2)s, which are not permitted in the capability mode. What we do now is to chroot(2) to /var/empty, which restricts access to file system name space and we drop privileges to hast user and hast group. This still allows to access to other name spaces, like list of processes, network and sysvipc. To address that, use jail(2) instead of chroot(2). Using jail(2) will restrict access to process table, network (we use ip-less jails) and sysvipc (if security.jail.sysvipc_allowed is turned off). This provides much better separation. MFC after: 1 week Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/primary.c head/sbin/hastd/secondary.c head/sbin/hastd/subr.c head/sbin/hastd/subr.h Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Sat May 14 16:55:24 2011 (r221898) +++ head/sbin/hastctl/hastctl.c Sat May 14 17:02:03 2011 (r221899) @@ -480,7 +480,7 @@ main(int argc, char *argv[]) cfg->hc_controladdr); } - if (drop_privs(true) != 0) + if (drop_privs(NULL) != 0) exit(EX_CONFIG); /* Send the command to the server... */ Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sat May 14 16:55:24 2011 (r221898) +++ head/sbin/hastd/primary.c Sat May 14 17:02:03 2011 (r221899) @@ -904,7 +904,7 @@ hastd_primary(struct hast_resource *res) init_ggate(res); init_environment(res); - if (drop_privs(true) != 0) { + if (drop_privs(res) != 0) { cleanup(res); exit(EX_CONFIG); } Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Sat May 14 16:55:24 2011 (r221898) +++ head/sbin/hastd/secondary.c Sat May 14 17:02:03 2011 (r221899) @@ -436,7 +436,7 @@ hastd_secondary(struct hast_resource *re init_local(res); init_environment(); - if (drop_privs(true) != 0) + if (drop_privs(res) != 0) exit(EX_CONFIG); pjdlog_info("Privileges successfully dropped."); Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Sat May 14 16:55:24 2011 (r221898) +++ head/sbin/hastd/subr.c Sat May 14 17:02:03 2011 (r221899) @@ -32,9 +32,10 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include #include +#include #include #include @@ -147,13 +148,15 @@ role2str(int role) } int -drop_privs(bool usecapsicum) +drop_privs(struct hast_resource *res) { + char jailhost[sizeof(res->hr_name) * 2]; + struct jail jailst; struct passwd *pw; uid_t ruid, euid, suid; gid_t rgid, egid, sgid; gid_t gidset[1]; - bool capsicum; + bool capsicum, jailed; /* * According to getpwnam(3) we have to clear errno before calling the @@ -173,10 +176,34 @@ drop_privs(bool usecapsicum) return (-1); } } - if (chroot(pw->pw_dir) == -1) { - KEEP_ERRNO(pjdlog_errno(LOG_ERR, - "Unable to change root directory to %s", pw->pw_dir)); - return (-1); + + bzero(&jailst, sizeof(jailst)); + jailst.version = JAIL_API_VERSION; + jailst.path = pw->pw_dir; + if (res == NULL) { + (void)snprintf(jailhost, sizeof(jailhost), "hastctl"); + } else { + (void)snprintf(jailhost, sizeof(jailhost), "hastd: %s (%s)", + res->hr_name, role2str(res->hr_role)); + } + jailst.hostname = jailhost; + jailst.jailname = NULL; + jailst.ip4s = 0; + jailst.ip4 = NULL; + jailst.ip6s = 0; + jailst.ip6 = NULL; + if (jail(&jailst) >= 0) { + jailed = true; + } else { + jailed = false; + pjdlog_errno(LOG_WARNING, + "Unable to jail to directory to %s", pw->pw_dir); + if (chroot(pw->pw_dir) == -1) { + KEEP_ERRNO(pjdlog_errno(LOG_ERR, + "Unable to change root directory to %s", + pw->pw_dir)); + return (-1); + } } PJDLOG_VERIFY(chdir("/") == 0); gidset[0] = pw->pw_gid; @@ -197,15 +224,10 @@ drop_privs(bool usecapsicum) return (-1); } - capsicum = false; - if (usecapsicum) { - if (cap_enter() == 0) { - capsicum = true; - } else { - pjdlog_errno(LOG_WARNING, - "Unable to sandbox using capsicum"); - } - } + if (res == NULL || res->hr_role != HAST_ROLE_PRIMARY) + capsicum = (cap_enter() == 0); + else + capsicum = false; /* * Better be sure that everything succeeded. @@ -223,8 +245,8 @@ drop_privs(bool usecapsicum) PJDLOG_VERIFY(gidset[0] == pw->pw_gid); pjdlog_debug(1, - "Privileges successfully dropped using %schroot+setgid+setuid.", - capsicum ? "capsicum+" : ""); + "Privileges successfully dropped using %s%s+setgid+setuid.", + capsicum ? "capsicum+" : "", jailed ? "jail" : "chroot"); return (0); } Modified: head/sbin/hastd/subr.h ============================================================================== --- head/sbin/hastd/subr.h Sat May 14 16:55:24 2011 (r221898) +++ head/sbin/hastd/subr.h Sat May 14 17:02:03 2011 (r221899) @@ -51,6 +51,6 @@ int snprlcat(char *str, size_t size, con int provinfo(struct hast_resource *res, bool dowrite); const char *role2str(int role); -int drop_privs(bool usecapsicum); +int drop_privs(struct hast_resource *res); #endif /* !_SUBR_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat May 14 17:07:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23EF31065674; Sat, 14 May 2011 17:07:25 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id E18458FC13; Sat, 14 May 2011 17:07:23 +0000 (UTC) Received: by bwz12 with SMTP id 12so4129955bwz.13 for ; Sat, 14 May 2011 10:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:x-comment-to:sender:date:message-id:mime-version :content-type; bh=Q9hQEm9kvnXu5h/XkspjCJNWIF3IX3JJxcPd75Sj4SE=; b=l1hqkCRmPj2WqxgI39s7ARGXBGsy8CiG3YVeAW0ATyzX7ZOjSW7kE7vKGMc1QfvyE9 ILMLlZb5HOeeQgno7H2OHob0x+5fVnc2o53FpF4fyzMxuieD/AH+2CkfD8rqIhMSQ9eN 58+jzp4zmT1teVkqxsfDsbitnbnCHGQJD2QXs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:x-comment-to :sender:date:message-id:mime-version:content-type; b=u0gSIHhB+SF9aW67nRRzE/BWE+hOJuTQEqM0oWu8Nzsd7Du7ObpDAFB/sEbknRK4IL mY7+34lDb3NRwCaI3l9KvQ4+mPxeekopwj7NiEUnhLSBiob9j5t6nGZNCKFrmlzlteX7 M8G3wef9em3rCU+TBZsQfv0AcPMVrN7K0z04I= Received: by 10.204.153.20 with SMTP id i20mr1543715bkw.208.1305392842617; Sat, 14 May 2011 10:07:22 -0700 (PDT) Received: from localhost ([95.69.172.154]) by mx.google.com with ESMTPS id c11sm2007554bkc.14.2011.05.14.10.07.20 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2011 10:07:21 -0700 (PDT) From: Mikolaj Golub To: John Baldwin In-Reply-To: <4DCE93BF.7000803@FreeBSD.org> (John Baldwin's message of "Sat, 14 May 2011 10:37:51 -0400") References: <201105022105.p42L5q3j054498@svn.freebsd.org> <86pqnlbmao.fsf@kopusha.home.net> <4DCE93BF.7000803@FreeBSD.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) X-Comment-To: John Baldwin Sender: Mikolaj Golub Date: Sat, 14 May 2011 20:07:18 +0300 Message-ID: <86boz5fby1.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221346 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 17:07:25 -0000 On Sat, 14 May 2011 10:37:51 -0400 John Baldwin wrote: JB> Can you capture a tcpdump (probably easiest to do from the other host)? I replaced the asserts with log statements to make the host not panic and the captured dump survive. Below are two examples. You can find the raw dump for the first case at http://people.freebsd.org/~trociny/rcv_nxt.dump.1 (65Mb). I have the second one too but it is rather large (290Mb) so I have not uploaded it. May 14 18:37:54 kopusha hastd[4258]: Connection from tcp4://192.168.1.103:54038 to tcp4://192.168.1.103:7772. May 14 18:37:54 kopusha hastd[4258]: Connection from tcp4://192.168.1.103:37712 to tcp4://192.168.1.103:7772. May 14 18:37:54 kopusha hastd[4254]: [test] (primary) Connected to tcp4://kopusha:7772. May 14 18:37:54 kopusha hastd[4254]: [test] (primary) Successfully reconnected to tcp4://kopusha:7772. May 14 18:37:54 kopusha hastd[4254]: [test] (primary) Synchronization started. 512MB to go. * May 14 18:38:15 kopusha kernel: tcp_input negative window: tp 0xc8dfd2b4 rcv_nxt 70085243 rcv_adv 70085242 May 14 18:38:19 kopusha hastd[4254]: [test] (primary) Unable to receive reply header: Operation timed out. May 14 18:38:19 kopusha hastd[4254]: [test] (primary) Disconnected from tcp4://kopusha:7772. May 14 18:38:19 kopusha hastd[4254]: [test] (primary) Unable to write synchronization data: Invalid argument. May 14 18:38:19 kopusha hastd[4254]: [test] (primary) Synchronization interrupted after 25s. 187MB synchronized so far. * May 14 18:38:20 kopusha kernel: tcp_input negative window: tp 0xc8dfd2b4 rcv_nxt 70085244 rcv_adv 70085242 May 14 18:38:24 kopusha hastd[4258]: Connection from tcp4://192.168.1.103:11242 to tcp4://192.168.1.103:7772. 18:37:59.645347 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [.], seq 53762563:53778895, ack 838, win 8859, options [nop,nop,TS val 23012 ecr 1886728700], length 16332 18:37:59.645355 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53762563, win 6891, options [nop,nop,TS val 1886728700 ecr 23012], length 0 18:37:59.645360 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [P.], seq 53778895:53778999, ack 838, win 8859, options [nop,nop,TS val 23012 ecr 1886728700], length 104 18:37:59.645379 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53778999, win 4837, options [nop,nop,TS val 1886728700 ecr 23012], length 0 18:37:59.645398 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [.], seq 53778999:53795331, ack 838, win 8859, options [nop,nop,TS val 23012 ecr 1886728700], length 16332 18:37:59.645418 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [P.], seq 53795331:53805402, ack 838, win 8859, options [nop,nop,TS val 23012 ecr 1886728700], length 10071 18:37:59.645441 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53805402, win 1536, options [nop,nop,TS val 1886728700 ecr 23012], length 0 18:37:59.645444 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [P.], seq 53805402:53811767, ack 838, win 8859, options [nop,nop,TS val 23012 ecr 1886728700], length 6365 18:37:59.739969 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53811767, win 741, options [nop,nop,TS val 1886728710 ecr 23012], length 0 18:38:04.739929 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [.], seq 53811767:53817695, ack 838, win 8859, options [nop,nop,TS val 23522 ecr 1886728710], length 5928 18:38:04.839913 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53817695, win 0, options [nop,nop,TS val 1886729220 ecr 23522], length 0 18:38:09.839927 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [.], seq 53817695:53817696, ack 838, win 8859, options [nop,nop,TS val 24032 ecr 1886729220], length 1 18:38:09.839968 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53817696, win 0, options [nop,nop,TS val 1886729720 ecr 24032], length 0 18:38:14.839923 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [.], seq 53817696:53817697, ack 838, win 8859, options [nop,nop,TS val 24532 ecr 1886729720], length 1 18:38:14.839977 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53817697, win 0, options [nop,nop,TS val 1886730220 ecr 24532], length 0 18:38:19.839933 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [.], seq 53817697:53817698, ack 838, win 8859, options [nop,nop,TS val 25032 ecr 1886730220], length 1 18:38:19.840010 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53817698, win 0, options [nop,nop,TS val 1886730720 ecr 25032], length 0 18:38:24.455025 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [.], ack 53817698, win 8960, options [nop,nop,TS val 1886731181 ecr 25032], length 0 18:38:24.455061 IP 192.168.1.103.54038 > 192.168.1.103.7772: Flags [FP.], seq 53817698:53820133, ack 838, win 8859, options [nop,nop,TS val 25493 ecr 1886731181], length 2435 18:38:24.455276 IP 192.168.1.103.7772 > 192.168.1.103.54038: Flags [R], seq 1895170621, win 0, length 0 May 14 19:14:17 kopusha hastd[6879]: Connection from tcp4://192.168.1.103:19814 to tcp4://192.168.1.103:7772. May 14 19:14:17 kopusha hastd[6879]: Connection from tcp4://192.168.1.103:27111 to tcp4://192.168.1.103:7772. May 14 19:14:17 kopusha hastd[6875]: [test] (primary) Connected to tcp4://kopusha:7772. May 14 19:14:17 kopusha hastd[6875]: [test] (primary) Successfully reconnected to tcp4://kopusha:7772. May 14 19:14:17 kopusha hastd[6875]: [test] (primary) Synchronization started. 512MB to go. May 14 19:14:41 kopusha hastd[6875]: [test] (primary) Synchronization complete. 512MB synchronized in 24s (20MB/sec). May 14 19:15:24 kopusha hastd[6875]: [test] (primary) Unable to receive reply header: Operation timed out. * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369184 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369185 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369186 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369187 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369188 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369189 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369190 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369191 rcv_adv 325369183 * May 14 19:16:30 kopusha kernel: tcp_input negative window: tp 0xc9975ad0 rcv_nxt 325369192 rcv_adv 325369183 May 14 19:16:30 kopusha hastd[6875]: [test] (primary) Unable to send request (Broken pipe): WRITE(81870848, 16384). May 14 19:16:30 kopusha hastd[6875]: [test] (primary) Disconnected from tcp4://kopusha:7772. May 14 19:16:30 kopusha hastd[6879]: Connection from tcp4://192.168.1.103:26315 to tcp4://192.168.1.103:7772. 19:15:03.970985 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 282942005:282958337, ack 838, win 8896, options [nop,nop,TS val 245445 ecr 3738933168], length 16332 19:15:04.069929 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 282958337, win 5031, options [nop,nop,TS val 3738933178 ecr 245445], length 0 19:15:04.069981 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 282958337:282974669, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.070002 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 282974669:282991001, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.070033 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 282991001, win 948, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.070106 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 282991001, win 5443, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.070129 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 282991001:283007333, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.070156 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283007333:283023665, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.070208 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283023665, win 1360, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.072417 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283023665, win 5448, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.072456 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283023665:283039997, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.072478 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [P.], seq 283039997:283045338, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 5341 19:15:04.072498 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283045338, win 2739, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.072949 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283045338, win 8097, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.073225 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [P.], seq 283045338:283045559, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 221 19:15:04.073282 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283045559:283061891, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.073300 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283061891, win 6028, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.073322 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283061891:283078223, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.073340 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [P.], seq 283078223:283078327, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 104 19:15:04.073369 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283078327, win 3973, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:04.075631 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283078327:283094659, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 16332 19:15:04.075708 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283094659:283110111, ack 838, win 8896, options [nop,nop,TS val 245455 ecr 3738933178], length 15452 19:15:04.075736 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110111, win 0, options [nop,nop,TS val 3738933178 ecr 245455], length 0 19:15:09.069925 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110111:283110112, ack 838, win 8896, options [nop,nop,TS val 245955 ecr 3738933178], length 1 19:15:09.069966 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110112, win 0, options [nop,nop,TS val 3738933678 ecr 245955], length 0 19:15:14.069931 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110112:283110113, ack 838, win 8896, options [nop,nop,TS val 246455 ecr 3738933678], length 1 19:15:14.069971 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110113, win 0, options [nop,nop,TS val 3738934178 ecr 246455], length 0 19:15:19.069929 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110113:283110114, ack 838, win 8896, options [nop,nop,TS val 246955 ecr 3738934178], length 1 19:15:19.069970 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110114, win 0, options [nop,nop,TS val 3738934678 ecr 246955], length 0 19:15:24.069943 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110114:283110115, ack 838, win 8896, options [nop,nop,TS val 247455 ecr 3738934678], length 1 19:15:24.069994 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110115, win 0, options [nop,nop,TS val 3738935178 ecr 247455], length 0 19:15:29.069929 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110115:283110116, ack 838, win 8896, options [nop,nop,TS val 247955 ecr 3738935178], length 1 19:15:29.069987 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110116, win 0, options [nop,nop,TS val 3738935678 ecr 247955], length 0 19:15:34.069927 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110116:283110117, ack 838, win 8896, options [nop,nop,TS val 248455 ecr 3738935678], length 1 19:15:34.069971 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110117, win 0, options [nop,nop,TS val 3738936178 ecr 248455], length 0 19:15:39.069931 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110117:283110118, ack 838, win 8896, options [nop,nop,TS val 248955 ecr 3738936178], length 1 19:15:39.069978 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110118, win 0, options [nop,nop,TS val 3738936678 ecr 248955], length 0 19:15:44.069921 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110118:283110119, ack 838, win 8896, options [nop,nop,TS val 249455 ecr 3738936678], length 1 19:15:44.069960 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110119, win 0, options [nop,nop,TS val 3738937178 ecr 249455], length 0 19:15:49.069920 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110119:283110120, ack 838, win 8896, options [nop,nop,TS val 249955 ecr 3738937178], length 1 19:15:49.069974 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110120, win 0, options [nop,nop,TS val 3738937678 ecr 249955], length 0 19:15:54.069928 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110120:283110121, ack 838, win 8896, options [nop,nop,TS val 250455 ecr 3738937678], length 1 19:15:54.069989 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110121, win 0, options [nop,nop,TS val 3738938178 ecr 250455], length 0 19:15:59.069927 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110121:283110122, ack 838, win 8896, options [nop,nop,TS val 250955 ecr 3738938178], length 1 19:15:59.069981 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110122, win 0, options [nop,nop,TS val 3738938678 ecr 250955], length 0 19:16:04.069926 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110122:283110123, ack 838, win 8896, options [nop,nop,TS val 251455 ecr 3738938678], length 1 19:16:04.069992 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110123, win 0, options [nop,nop,TS val 3738939178 ecr 251455], length 0 19:16:09.069921 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110123:283110124, ack 838, win 8896, options [nop,nop,TS val 251955 ecr 3738939178], length 1 19:16:09.069980 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110124, win 0, options [nop,nop,TS val 3738939678 ecr 251955], length 0 19:16:14.069924 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110124:283110125, ack 838, win 8896, options [nop,nop,TS val 252455 ecr 3738939678], length 1 19:16:14.069997 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110125, win 0, options [nop,nop,TS val 3738940178 ecr 252455], length 0 19:16:19.069925 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110125:283110126, ack 838, win 8896, options [nop,nop,TS val 252955 ecr 3738940178], length 1 19:16:19.069996 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110126, win 0, options [nop,nop,TS val 3738940678 ecr 252955], length 0 19:16:24.069924 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110126:283110127, ack 838, win 8896, options [nop,nop,TS val 253455 ecr 3738940678], length 1 19:16:24.069994 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110127, win 0, options [nop,nop,TS val 3738941178 ecr 253455], length 0 19:16:29.069924 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110127:283110128, ack 838, win 8896, options [nop,nop,TS val 253955 ecr 3738941178], length 1 19:16:29.069995 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110128, win 0, options [nop,nop,TS val 3738941678 ecr 253955], length 0 19:16:30.751499 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [.], ack 283110128, win 8960, options [nop,nop,TS val 3738941846 ecr 253955], length 0 19:16:30.751571 IP 192.168.1.103.19814 > 192.168.1.103.7772: Flags [.], seq 283110128:283126460, ack 838, win 8896, options [nop,nop,TS val 254123 ecr 3738941846], length 16332 19:16:30.751649 IP 192.168.1.103.7772 > 192.168.1.103.19814: Flags [R], seq 1092154945, win 0, length 0 -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat May 14 17:44:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01E1B106564A; Sat, 14 May 2011 17:44:13 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5AD58FC0A; Sat, 14 May 2011 17:44:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EHiCaF010488; Sat, 14 May 2011 17:44:12 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EHiCpx010486; Sat, 14 May 2011 17:44:12 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201105141744.p4EHiCpx010486@svn.freebsd.org> From: Colin Percival Date: Sat, 14 May 2011 17:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221900 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 17:44:13 -0000 Author: cperciva Date: Sat May 14 17:44:12 2011 New Revision: 221900 URL: http://svn.freebsd.org/changeset/base/221900 Log: Encourage Ben Laurie to finish getting his commit bit by appointing him as the OpenSSL maintainer. With hat: security-officer Reviewed by: simon (former maintainer) Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sat May 14 17:02:03 2011 (r221899) +++ head/MAINTAINERS Sat May 14 17:44:12 2011 (r221900) @@ -108,7 +108,7 @@ linux emul emulation Please discuss chan bs{diff,patch} cperciva Pre-commit review requested. portsnap cperciva Pre-commit review requested. freebsd-update cperciva Pre-commit review requested. -openssl - No non-upstream commits should be done. +openssl benl Pre-commit review requested. sys/netgraph/bluetooth emax Pre-commit review preferred. lib/libbluetooth emax Pre-commit review preferred. lib/libsdp emax Pre-commit review preferred. From owner-svn-src-head@FreeBSD.ORG Sat May 14 18:22:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9099D1065768; Sat, 14 May 2011 18:22:15 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 503CE8FC0C; Sat, 14 May 2011 18:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EIMFNT011326; Sat, 14 May 2011 18:22:15 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EIMFuB011323; Sat, 14 May 2011 18:22:15 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201105141822.p4EIMFuB011323@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 May 2011 18:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221904 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 18:22:16 -0000 Author: tuexen Date: Sat May 14 18:22:14 2011 New Revision: 221904 URL: http://svn.freebsd.org/changeset/base/221904 Log: Fix the source address selection for boundall sockets when sending INITs to a global IPv4 address having only private IPv4 address. Allow the usage of a private address and make sure that no other private address will be used by the association. Initial work was done by rrs@. MFC after: 1 week. Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat May 14 18:22:08 2011 (r221903) +++ head/sys/netinet/sctp_output.c Sat May 14 18:22:14 2011 (r221904) @@ -2022,7 +2022,8 @@ sctp_add_addr_to_mbuf(struct mbuf *m, st struct mbuf * -sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_scoping *scope, +sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, struct sctp_tcb *stcb, + struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to) { struct sctp_vrf *vrf = NULL; @@ -2056,6 +2057,9 @@ sctp_add_addresses_to_i_ia(struct sctp_i continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifap)) { + continue; + } if (sctp_is_address_in_scope(sctp_ifap, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -2088,6 +2092,9 @@ skip_count: continue; } LIST_FOREACH(sctp_ifap, &sctp_ifnp->ifalist, next_ifa) { + if (sctp_is_addr_restricted(stcb, sctp_ifap)) { + continue; + } if (sctp_is_address_in_scope(sctp_ifap, scope->ipv4_addr_legal, scope->ipv6_addr_legal, @@ -2295,32 +2302,46 @@ sctp_is_ifa_addr_acceptable(struct sctp_ { uint8_t dest_is_global = 0; - /* + /** * Here we determine if its a acceptable address. A acceptable * address means it is the same scope or higher scope but we can * allow for NAT which means its ok to have a global dest and a * private src. - * + * * L = loopback, P = private, G = global - * ----------------------------------------- src | dest | result - * ----------------------------------------- L | L | yes - * ----------------------------------------- P | L | - * yes-v4 no-v6 ----------------------------------------- G | - * L | yes ----------------------------------------- L | - * P | no ----------------------------------------- P | P - * | yes ----------------------------------------- G | P - * | yes - May not work ----------------------------------------- - * L | G | no ----------------------------------------- P - * | G | yes - May not work - * ----------------------------------------- G | G | yes + * ----------------------------------------- + * src | dest | result + * ----------------------------------------- + * L | L | yes + * ----------------------------------------- + * P | L | yes-v4 no-v6 + * ----------------------------------------- + * G | L | yes + * ----------------------------------------- + * L | P | no + * ----------------------------------------- + * P | P | yes + * ----------------------------------------- + * G | P | yes - May not work + * ----------------------------------------- + * L | G | no + * ----------------------------------------- + * P | G | yes - May not work + * ----------------------------------------- + * G | G | yes * ----------------------------------------- */ if (ifa->address.sa.sa_family != fam) { /* forget non matching family */ + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa_fam:%d fam:%d\n", + ifa->address.sa.sa_family, fam); return (NULL); } /* Ok the address may be ok */ + SCTPDBG_ADDR(SCTP_DEBUG_OUTPUT3, &ifa->address.sa); + SCTPDBG(SCTP_DEBUG_OUTPUT3, "dst_is_loop:%d dest_is_priv:%d\n", + dest_is_loop, dest_is_priv); if ((dest_is_loop == 0) && (dest_is_priv == 0)) { dest_is_global = 1; } @@ -2342,12 +2363,19 @@ sctp_is_ifa_addr_acceptable(struct sctp_ * theory be done slicker (it used to be), but this is * straightforward and easier to validate :-) */ + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa->src_is_loop:%d dest_is_priv:%d\n", + ifa->src_is_loop, + dest_is_priv); if ((ifa->src_is_loop == 1) && (dest_is_priv)) { return (NULL); } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "ifa->src_is_loop:%d dest_is_glob:%d\n", + ifa->src_is_loop, + dest_is_global); if ((ifa->src_is_loop == 1) && (dest_is_global)) { return (NULL); } + SCTPDBG(SCTP_DEBUG_OUTPUT3, "address is acceptable\n"); /* its an acceptable address */ return (ifa); } @@ -2854,6 +2882,10 @@ sctp_choose_boundall(struct sctp_inpcb * uint32_t ifn_index; struct sctp_vrf *vrf; +#ifdef INET + int retried = 0; + +#endif /*- * For boundall we can use any address in the association. * If non_asoc_addr_ok is set we can use any address (at least in @@ -2874,6 +2906,7 @@ sctp_choose_boundall(struct sctp_inpcb * ifn = SCTP_GET_IFN_VOID_FROM_ROUTE(ro); ifn_index = SCTP_GET_IF_INDEX_FROM_ROUTE(ro); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifn from route:%p ifn_index:%d\n", ifn, ifn_index); emit_ifn = looked_at = sctp_ifn = sctp_find_ifn(ifn, ifn_index); if (sctp_ifn == NULL) { /* ?? We don't have this guy ?? */ @@ -2982,22 +3015,30 @@ bound_all_plan_b: } atomic_add_int(&sifa->refcount, 1); return (sifa); - } - +#ifdef INET +again_with_private_addresses_allowed: +#endif /* plan_c: do we have an acceptable address on the emit interface */ + sifa = NULL; SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan C: find acceptable on interface\n"); if (emit_ifn == NULL) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Jump to Plan D - no emit_ifn\n"); goto plan_d; } LIST_FOREACH(sctp_ifa, &emit_ifn->ifalist, next_ifa) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "ifa:%p\n", sctp_ifa); if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && - (non_asoc_addr_ok == 0)) + (non_asoc_addr_ok == 0)) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Defer\n"); continue; + } sifa = sctp_is_ifa_addr_acceptable(sctp_ifa, dest_is_loop, dest_is_priv, fam); - if (sifa == NULL) + if (sifa == NULL) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "IFA not acceptable\n"); continue; + } if (stcb) { if (sctp_is_address_in_scope(sifa, stcb->asoc.ipv4_addr_legal, @@ -3006,6 +3047,8 @@ bound_all_plan_b: stcb->asoc.ipv4_local_scope, stcb->asoc.local_scope, stcb->asoc.site_scope, 0) == 0) { + SCTPDBG(SCTP_DEBUG_OUTPUT2, "NOT in scope\n"); + sifa = NULL; continue; } if (((non_asoc_addr_ok == 0) && @@ -3017,11 +3060,15 @@ bound_all_plan_b: * It is restricted for some reason.. * probably not yet added. */ + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Its resticted\n"); + sifa = NULL; continue; } + } else { + printf("Stcb is null - no print\n"); } atomic_add_int(&sifa->refcount, 1); - return (sifa); + goto out; } plan_d: /* @@ -3030,16 +3077,12 @@ plan_d: * out and see if we can find an acceptable address somewhere * amongst all interfaces. */ - SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D\n"); + SCTPDBG(SCTP_DEBUG_OUTPUT2, "Trying Plan D looked_at is %p\n", looked_at); LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { /* wrong base scope */ continue; } - if ((sctp_ifn == looked_at) && looked_at) - /* already looked at this guy */ - continue; - LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && (non_asoc_addr_ok == 0)) @@ -3057,6 +3100,7 @@ plan_d: stcb->asoc.ipv4_local_scope, stcb->asoc.local_scope, stcb->asoc.site_scope, 0) == 0) { + sifa = NULL; continue; } if (((non_asoc_addr_ok == 0) && @@ -3068,19 +3112,81 @@ plan_d: * It is restricted for some * reason.. probably not yet added. */ + sifa = NULL; continue; } } - atomic_add_int(&sifa->refcount, 1); - return (sifa); + goto out; } } - /* - * Ok we can find NO address to source from that is not on our - * restricted list and non_asoc_address is NOT ok, or it is on our - * restricted list. We can't source to it :-( - */ - return (NULL); +#ifdef INET + if ((retried == 0) && (stcb->asoc.ipv4_local_scope == 0)) { + stcb->asoc.ipv4_local_scope = 1; + retried = 1; + goto again_with_private_addresses_allowed; + } else if (retried == 1) { + stcb->asoc.ipv4_local_scope = 0; + } +#endif +out: + if (sifa) { +#ifdef INET + if (retried == 1) { + LIST_FOREACH(sctp_ifn, &vrf->ifnlist, next_ifn) { + if (dest_is_loop == 0 && SCTP_IFN_IS_IFT_LOOP(sctp_ifn)) { + /* wrong base scope */ + continue; + } + LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) { + struct sctp_ifa *tmp_sifa; + + if ((sctp_ifa->localifa_flags & SCTP_ADDR_DEFER_USE) && + (non_asoc_addr_ok == 0)) + continue; + tmp_sifa = sctp_is_ifa_addr_acceptable(sctp_ifa, + dest_is_loop, + dest_is_priv, fam); + if (tmp_sifa == NULL) { + continue; + } + if (tmp_sifa == sifa) { + continue; + } + if (stcb) { + if (sctp_is_address_in_scope(tmp_sifa, + stcb->asoc.ipv4_addr_legal, + stcb->asoc.ipv6_addr_legal, + stcb->asoc.loopback_scope, + stcb->asoc.ipv4_local_scope, + stcb->asoc.local_scope, + stcb->asoc.site_scope, 0) == 0) { + continue; + } + if (((non_asoc_addr_ok == 0) && + (sctp_is_addr_restricted(stcb, tmp_sifa))) || + (non_asoc_addr_ok && + (sctp_is_addr_restricted(stcb, tmp_sifa)) && + (!sctp_is_addr_pending(stcb, tmp_sifa)))) { + /* + * It is restricted + * for some reason.. + * probably not yet + * added. + */ + continue; + } + } + if ((tmp_sifa->address.sin.sin_family == AF_INET) && + (IN4_ISPRIVATE_ADDRESS(&(tmp_sifa->address.sin.sin_addr)))) { + sctp_add_local_addr_restricted(stcb, tmp_sifa); + } + } + } + } + atomic_add_int(&sifa->refcount, 1); + } +#endif + return (sifa); } @@ -3106,7 +3212,7 @@ sctp_source_address_selection(struct sct #endif - /*- + /** * Rules: - Find the route if needed, cache if I can. - Look at * interface address in route, Is it in the bound list. If so we * have the best source. - If not we must rotate amongst the @@ -3509,15 +3615,17 @@ sctp_lowlevel_chunk_output(struct sctp_i ) /* nofragment_flag to tell if IP_DF should be set (IPv4 only) */ { - /* - * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet - * header WITH an SCTPHDR but no IP header, endpoint inp and sa - * structure: - fill in the HMAC digest of any AUTH chunk in the - * packet. - calculate and fill in the SCTP checksum. - prepend an - * IP address header. - if boundall use INADDR_ANY. - if - * boundspecific do source address selection. - set fragmentation - * option for ipV4. - On return from IP output, check/adjust mtu - * size of output interface and smallest_mtu size as well. + /** + * Given a mbuf chain (via SCTP_BUF_NEXT()) that holds a packet header + * WITH an SCTPHDR but no IP header, endpoint inp and sa structure: + * - fill in the HMAC digest of any AUTH chunk in the packet. + * - calculate and fill in the SCTP checksum. + * - prepend an IP address header. + * - if boundall use INADDR_ANY. + * - if boundspecific do source address selection. + * - set fragmentation option for ipV4. + * - On return from IP output, check/adjust mtu size of output + * interface and smallest_mtu size as well. */ /* Will need ifdefs around this */ struct mbuf *o_pak; @@ -4409,7 +4517,7 @@ sctp_send_initiate(struct sctp_inpcb *in scp.local_scope = stcb->asoc.local_scope; scp.site_scope = stcb->asoc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); } /* calulate the size and update pkt header and chunk header */ @@ -5538,7 +5646,7 @@ do_a_abort: scp.ipv4_local_scope = stc.ipv4_scope; scp.local_scope = stc.local_scope; scp.site_scope = stc.site_scope; - m_at = sctp_add_addresses_to_i_ia(inp, &scp, m_at, cnt_inits_to); + m_at = sctp_add_addresses_to_i_ia(inp, stcb, &scp, m_at, cnt_inits_to); } /* tack on the operational error if present */ Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat May 14 18:22:08 2011 (r221903) +++ head/sys/netinet/sctp_output.h Sat May 14 18:22:14 2011 (r221904) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); struct mbuf * sctp_add_addresses_to_i_ia(struct sctp_inpcb *inp, + struct sctp_tcb *stcb, struct sctp_scoping *scope, struct mbuf *m_at, int cnt_inits_to); From owner-svn-src-head@FreeBSD.ORG Sat May 14 19:03:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0B19106564A; Sat, 14 May 2011 19:03:30 +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 CF9A18FC12; Sat, 14 May 2011 19:03:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EJ3Uu9012280; Sat, 14 May 2011 19:03:30 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EJ3U12012278; Sat, 14 May 2011 19:03:30 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105141903.p4EJ3U12012278@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 14 May 2011 19:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221907 - head/games/morse X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 19:03:31 -0000 Author: uqs Date: Sat May 14 19:03:30 2011 New Revision: 221907 URL: http://svn.freebsd.org/changeset/base/221907 Log: morse(6): fix typos and space-before-tabs Modified: head/games/morse/morse.c Modified: head/games/morse/morse.c ============================================================================== --- head/games/morse/morse.c Sat May 14 18:58:26 2011 (r221906) +++ head/games/morse/morse.c Sat May 14 19:03:30 2011 (r221907) @@ -161,20 +161,20 @@ static const struct morsetab iso8859_1ta static const struct morsetab iso8859_7tab[] = { /* - * The greek alphabet; you'll need an 8859-7 font in order + * The Greek alphabet; you'll need an ISO8859-7 font in order * to see the actual characters. * This table does not implement: * - the special sequences for the seven diphthongs, * - the punctuation differences. * Implementing these features would introduce too many * special-cases in the program's main loop. - * The diphtong sequences are: + * The diphthong sequences are: * alpha iota .-.- * alpha upsilon ..-- * epsilon upsilon ---. * eta upsilon ...- - * omikron iota ---.. - * omikron upsilon ..- + * omicron iota ---.. + * omicron upsilon ..- * upsilon iota .--- * The different punctuation symbols are: * ; ..-.- @@ -193,10 +193,10 @@ static const struct morsetab iso8859_7ta {'è', "-.-."}, /* theta */ {'é', ".."}, /* iota */ {'ß', ".."}, /* iota with acute */ - {'ú', ".."}, /* iota with diairesis */ - {'À', ".."}, /* iota with acute and diairesis */ + {'ú', ".."}, /* iota with diaeresis */ + {'À', ".."}, /* iota with acute and diaeresis */ {'ê', "-.-"}, /* kappa */ - {'ë', ".-.."}, /* lamda */ + {'ë', ".-.."}, /* lambda */ {'ì', "--"}, /* mu */ {'í', "-."}, /* nu */ {'î', "-..-"}, /* xi */ @@ -209,8 +209,8 @@ static const struct morsetab iso8859_7ta {'ô', "-"}, /* tau */ {'õ', "-.--"}, /* upsilon */ {'ý', "-.--"}, /* upsilon with acute */ - {'û', "-.--"}, /* upsilon and diairesis */ - {'à', "-.--"}, /* upsilon with acute and diairesis */ + {'û', "-.--"}, /* upsilon and diaeresis */ + {'à', "-.--"}, /* upsilon with acute and diaeresis */ {'ö', "..-."}, /* phi */ {'÷', "----"}, /* chi */ {'ø', "--.-"}, /* psi */ @@ -222,29 +222,29 @@ static const struct morsetab iso8859_7ta static const struct morsetab koi8rtab[] = { /* - * the cyrillic alphabet; you'll need a KOI8R font in order + * The Cyrillic alphabet; you'll need a KOI8-R font in order * to see the actual characters */ - {'Á', ".-"}, /* a */ + {'Á', ".-"}, /* a */ {'Â', "-..."}, /* be */ {'×', ".--"}, /* ve */ {'Ç', "--."}, /* ge */ {'Ä', "-.."}, /* de */ - {'Å', "."}, /* ye */ - {'£', "."}, /* yo, the same as ye */ + {'Å', "."}, /* ye */ + {'£', "."}, /* yo, the same as ye */ {'Ö', "...-"}, /* she */ {'Ú', "--.."}, /* ze */ - {'É', ".."}, /* i */ + {'É', ".."}, /* i */ {'Ê', ".---"}, /* i kratkoye */ {'Ë', "-.-"}, /* ka */ {'Ì', ".-.."}, /* el */ - {'Í', "--"}, /* em */ - {'Î', "-."}, /* en */ + {'Í', "--"}, /* em */ + {'Î', "-."}, /* en */ {'Ï', "---"}, /* o */ {'Ð', ".--."}, /* pe */ {'Ò', ".-."}, /* er */ {'Ó', "..."}, /* es */ - {'Ô', "-"}, /* te */ + {'Ô', "-"}, /* te */ {'Õ', "..-"}, /* u */ {'Æ', "..-."}, /* ef */ {'È', "...."}, /* kha */ @@ -305,9 +305,9 @@ main(int argc, char **argv) while ((ch = getopt(argc, argv, GETOPTOPTS)) != -1) switch ((char) ch) { - case 'c': - cpm = atoi(optarg); - break; + case 'c': + cpm = atoi(optarg); + break; case 'd': device = optarg; break; From owner-svn-src-head@FreeBSD.ORG Sat May 14 19:03:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47BD9106566B; Sat, 14 May 2011 19:03:47 +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 362B38FC0A; Sat, 14 May 2011 19:03:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EJ3lUh012341; Sat, 14 May 2011 19:03:47 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EJ3j8T012330; Sat, 14 May 2011 19:03:45 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105141903.p4EJ3j8T012330@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 14 May 2011 19:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221908 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 19:03:47 -0000 Author: uqs Date: Sat May 14 19:03:45 2011 New Revision: 221908 URL: http://svn.freebsd.org/changeset/base/221908 Log: fortune(6): fix typos and misspellings. While here, drop words in the spelling files that are no longer used anywhere. Speling errors found via: codespell from Lucas De Marchi Modified: head/games/fortune/datfiles/fortunes head/games/fortune/datfiles/fortunes-o.real head/games/fortune/datfiles/fortunes-o.sp.ok head/games/fortune/datfiles/fortunes.sp.ok head/games/fortune/datfiles/freebsd-tips.sp.ok head/games/fortune/datfiles/limerick head/games/fortune/datfiles/limerick.sp.ok head/games/fortune/datfiles/startrek.sp.ok head/games/fortune/datfiles/zippy.sp.ok Modified: head/games/fortune/datfiles/fortunes ============================================================================== --- head/games/fortune/datfiles/fortunes Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/fortunes Sat May 14 19:03:45 2011 (r221908) @@ -10494,13 +10494,13 @@ Anti-trust laws should be approached wit Antonio Antonio Was tired of living alonio He thought he would woo Antonio Antonio -Miss Lucamy Lu, Rode of on his polo ponio +Miss Lucamy Lu, Rode off on his polo ponio Miss Lucamy Lucy Molonio. And found the maid In a bowery shade, Sitting and knitting alonio. Antonio Antonio Said if you will be my ownio -I'll love tou true Oh nonio Antonio +I'll love you true Oh nonio Antonio And buy for you You're far too bleak and bonio An icery creamry conio. And all that I wish You singular fish @@ -10509,7 +10509,7 @@ Antonio Antonio Uttered a dismal moanio And went off and hid Or I'm told that he did -In the Antartical Zonio. +In the Antarctical Zonio. % Antonym, n.: The opposite of the word you're trying to think of. @@ -20232,7 +20232,7 @@ Good-bye. I am leaving because I am bor Goodbye, cool world. % Goose pimples rose all over me, my hair stood on end, my eyes filled with -tears of love and gratitude for this greatest of all conquerers of human +tears of love and gratitude for this greatest of all conquerors of human misery and shame, and my breath came in little gasps. If I had not known that the Leader would have scorned such adulation, I might have fallen to my knees in unashamed worship, but instead I drew myself to attention, raised @@ -25099,7 +25099,7 @@ intellectual enlightenment % IBM: - [Internation Business Machines Corp.] Also known as Itty Bitty + [International Business Machines Corp.] Also known as Itty Bitty Machines or The Lawyer's Friend. The dominant force in computer marketing, having supplied worldwide some 75% of all known hardware and 10% of all software. To protect itself from the litigious envy Modified: head/games/fortune/datfiles/fortunes-o.real ============================================================================== --- head/games/fortune/datfiles/fortunes-o.real Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/fortunes-o.real Sat May 14 19:03:45 2011 (r221908) @@ -7722,7 +7722,7 @@ I wooed a stewed nude in Bermuda, I was lewd, but my God! she was lewder. She said it was crude To be wooed in the nude-- -I persued her, subdued her, and screwed her! +I pursued her, subdued her, and screwed her! % I would like to say, Mister Bunce, I'm a great connoisseur of hot cunts. @@ -9044,7 +9044,7 @@ raped, his house burned, and all his cat distant neighbors about the tragedy, a few of them reported that the only stranger they had seen in the area for weeks was a tall desperado wearing a black hat and a red neckerchief. - The cowboy saddled his fastest horse and set out to find the villian. + The cowboy saddled his fastest horse and set out to find the villain. He searched for months but couldn't catch up with the culprit; in town after dusty town he was told that a man fitting the description had been there but had just departed; usually after some heinous crime. Modified: head/games/fortune/datfiles/fortunes-o.sp.ok ============================================================================== --- head/games/fortune/datfiles/fortunes-o.sp.ok Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/fortunes-o.sp.ok Sat May 14 19:03:45 2011 (r221908) @@ -1121,7 +1121,6 @@ pees penis pere Perelman -persued pestes Peteer Pettigrew @@ -1600,7 +1599,6 @@ vibrators vici Vida vidi -villian virginem Visme viziti Modified: head/games/fortune/datfiles/fortunes.sp.ok ============================================================================== --- head/games/fortune/datfiles/fortunes.sp.ok Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/fortunes.sp.ok Sat May 14 19:03:45 2011 (r221908) @@ -139,7 +139,6 @@ Anouilh ANRS Ansley answerback -Antartic Anthony's Antonym Antrim @@ -375,7 +374,6 @@ Bertolt Besicovitch Beslove Betazoid -bethumped Bette Bevan BEW @@ -468,7 +466,6 @@ booing bookaholic Booker's boola -Boorchi Boorstin bootable Boothe @@ -576,7 +573,6 @@ Bulwer bumperless Bumstead Bungei -BURBULATION Buren Burggoven burgled @@ -623,7 +619,6 @@ Callahan Callahan's Callimachus Camden -Camelia Cameron Camillo Campbell @@ -771,7 +766,6 @@ Churchill's Churchy Chuzzlewit CI -Cianci Ciardi cinched cinema's @@ -806,7 +800,6 @@ Cochran cockamamie Cocteau Cody -Cody's Coevolution cogito Cohen's @@ -826,7 +819,6 @@ Comebacks Commedia Commie CommUNIXque -compuberty computatis Computerdom computerites @@ -1077,8 +1069,6 @@ DJ DMPK Dobb's Dobbs -doberman -doberperson Dobie Doc Docquier @@ -1203,7 +1193,6 @@ EINS Einstein's Eisley Elbert -ELBONICS Eldridge electrocommunications Electrocution @@ -1264,7 +1253,6 @@ Eschenbach Escher esperantisto Esplandian -Esser est estas Estes @@ -1293,7 +1281,6 @@ exhalation exhibitionists EXP expatriated -extemporanea extracurricular Exupery Exxon's @@ -1301,7 +1288,6 @@ eyestalks Eyquem Ezrin FAA -FACISM Factorials Fadiman Fafhrd @@ -1340,7 +1326,6 @@ Fellgett's Felton feminism's Femme -FENDERBERG Fenelon Fenster Ferber @@ -1369,7 +1354,6 @@ fikcio fiks filees filename -Filgoer's filigrees Filkharmonics Fillmore @@ -1398,7 +1382,6 @@ flamewars Flandry Flannagan's Flannery -FLANNISTER Flappity flatfoot flatteries @@ -1410,7 +1393,6 @@ Flon's floppity Florio floss -flouride Flugg's Flummery flutterby @@ -1557,7 +1539,6 @@ Geminis Genderplex Genesereth Genghis -genlock genocide Genter Geritol @@ -1605,7 +1586,6 @@ Giuseppe Glanvill Glaser gleekzorp -GLEEMITES Glegg gleknow Glib's @@ -2013,7 +1993,6 @@ if's ifthen Igmmlptk Ignatowski -ignisecond ihuxw IIc III's @@ -2498,7 +2477,6 @@ Lovin Lowells Lowery's Lowes -Lownes LP LPA LSD @@ -2534,7 +2512,6 @@ Ma's Mabbitt Mabley Macaroons -MacBeth Maccius MacDowell MacDuff @@ -2621,7 +2598,6 @@ Matz's Maud Maud'Dib Maugham -Maughm Maupin Maureens Maurois @@ -2630,7 +2606,6 @@ Maxey Maxson May's Mayorga -Mårten MBAs MBH MC @@ -2687,7 +2662,6 @@ Mendelson mendicants Mengot Menninger -Mensa Menschen Meow meowing @@ -2715,7 +2689,6 @@ Mickos microchips Microcomputing micrometric -Microsystem's Microsystems MicroVAXes midgets @@ -2730,7 +2703,6 @@ milk's Milkbone Millay Milligan -millihelen Millikan Millikan's millions @@ -2763,7 +2735,6 @@ Mitford Mitgong mittengrabben mitts -mittsquinter MITZIE Mix's Miyamoto @@ -2779,7 +2750,6 @@ modifaiing Modula Moebius Mohandas -Mohandis mohmen Moishe Molander @@ -2803,7 +2773,6 @@ Moolah moonshiner's Moore's mopeds -mophobia Moping moralists Mordecai @@ -2832,7 +2801,6 @@ Mt MTA Muad'dib muckest -mucklucks Mudgeeraba Mudhead mudslide @@ -2888,7 +2856,6 @@ nanohenry nanometers Nansen Napoleon's -narcolepulacyi Narnia Nasium's Naso @@ -2909,7 +2876,6 @@ Neantical Nebuchadnezzar Nebuchadnezzar's necesas -necessitious NecroSoft Nehru Neil's @@ -2940,7 +2906,6 @@ NF NFL Ngdanga Niagra -Niccoli Nicklaus Nicol Nicolaides @@ -3165,7 +3130,6 @@ Pearsall PECCATOPHOBIA Pecor's Pedaeration -pediddel Peers's Pegler pelted @@ -3192,7 +3156,6 @@ Personifiers Petaluma Petersons Petr -petribar Petronius Pfeiffer Pfffttt @@ -3204,7 +3167,6 @@ Philips philogyny phoney Phooey -phosflink Picadilly Pickard Pickle's @@ -3246,7 +3208,6 @@ Pocataligo Pocatello Podunk Pohl's -Poincair Poincare's pointy Polanski @@ -3347,7 +3308,6 @@ Pumpernickel punchline punning PUPs -PURPITATION Purshottam PUSHes pushy @@ -3551,7 +3511,6 @@ Saberhagen Sacher's Sadat Saddam -sadoequinecrophilia Saens Safford Safire's @@ -3605,7 +3564,6 @@ Schickele Schieffer schisms schizophrenics -schlattwhapper schlichte schluerfen Schmendrick @@ -3631,7 +3589,6 @@ Scintillae Scott's Scoville SCRBL -SCRIBLINE Scrubb scullery scurries @@ -3784,7 +3741,6 @@ somebody'd something's Sondheim Sooooo -Soren Sorhed sort've sorta @@ -3799,7 +3755,6 @@ SP Spacemen Spaceport spacewar -SPAGMUMPS spake Spam spank @@ -3824,7 +3779,6 @@ springenwerk Springsteen sprites SPSW -SQUATCHO squaws squealers squrooneg @@ -3980,7 +3934,6 @@ teepers telematic telepath teleportation -TELEPRESSION telepsychology tempfile tendrils @@ -4028,7 +3981,6 @@ tinpot Tirith tis Tiselius -Titas tites TLC TM @@ -4060,7 +4012,6 @@ toun Tourbillon Toven trans -transcendant transmogrifiers trapezes Traub @@ -4121,7 +4072,6 @@ TYDFS tyg typefaces Tyroon -tzu Ubi UDA Udall's @@ -4152,7 +4102,6 @@ Unseld untechnician unvoist Updike -upharsen uponst Urey Urho Modified: head/games/fortune/datfiles/freebsd-tips.sp.ok ============================================================================== --- head/games/fortune/datfiles/freebsd-tips.sp.ok Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/freebsd-tips.sp.ok Sat May 14 19:03:45 2011 (r221908) @@ -45,7 +45,6 @@ misc natserv ncal netcat -netscape netstat newfile NICs Modified: head/games/fortune/datfiles/limerick ============================================================================== --- head/games/fortune/datfiles/limerick Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/limerick Sat May 14 19:03:45 2011 (r221908) @@ -260,7 +260,7 @@ And white footgear intended for tennis. % A dulcet-voiced callgirl named Shedd, Who's cultured, well-spoken, well-bred, - Had achieved some reknown + Had achieved some renown For her tone going down-- There's a nice civil tongue in her head. % @@ -307,7 +307,7 @@ Had sex with a virgin named Grace. By bleeding all over his face. % A gay young prince from Morocco -Made love in a manner rococco. +Made love in a manner rococo. He painted his penis To resemble a Venus And flavored his semen with cocoa. Modified: head/games/fortune/datfiles/limerick.sp.ok ============================================================================== --- head/games/fortune/datfiles/limerick.sp.ok Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/limerick.sp.ok Sat May 14 19:03:45 2011 (r221908) @@ -283,6 +283,7 @@ McTavish meanie meanies meany +Mensa mentis midgets minimis @@ -353,11 +354,9 @@ quimmy quints ravished Reims -reknown Resounded retriebrve Rhyll -rococco rogered Salinas Sandem Modified: head/games/fortune/datfiles/startrek.sp.ok ============================================================================== --- head/games/fortune/datfiles/startrek.sp.ok Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/startrek.sp.ok Sat May 14 19:03:45 2011 (r221908) @@ -14,7 +14,6 @@ Corbomite Corby Daystrom Deela -Dehaver Elaan Eleen Eneg Modified: head/games/fortune/datfiles/zippy.sp.ok ============================================================================== --- head/games/fortune/datfiles/zippy.sp.ok Sat May 14 19:03:30 2011 (r221907) +++ head/games/fortune/datfiles/zippy.sp.ok Sat May 14 19:03:45 2011 (r221908) @@ -180,7 +180,7 @@ manicurist matic meatball meltdown -naugahide +naugahyde obstetrician poindexter pre From owner-svn-src-head@FreeBSD.ORG Sat May 14 19:03:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46F0510657B3; Sat, 14 May 2011 19:03:55 +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 35C688FC14; Sat, 14 May 2011 19:03:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EJ3tI6012380; Sat, 14 May 2011 19:03:55 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EJ3tYL012378; Sat, 14 May 2011 19:03:55 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201105141903.p4EJ3tYL012378@svn.freebsd.org> From: Ulrich Spoerlein Date: Sat, 14 May 2011 19:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221909 - head/games/fortune/datfiles X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 19:03:55 -0000 Author: uqs Date: Sat May 14 19:03:54 2011 New Revision: 221909 URL: http://svn.freebsd.org/changeset/base/221909 Log: Convert a file to UTF-8. This only changes a character in the copyright section and will not require UTF-8 for fortune(6). Modified: head/games/fortune/datfiles/gerrold.limerick Modified: head/games/fortune/datfiles/gerrold.limerick ============================================================================== --- head/games/fortune/datfiles/gerrold.limerick Sat May 14 19:03:45 2011 (r221908) +++ head/games/fortune/datfiles/gerrold.limerick Sat May 14 19:03:54 2011 (r221909) @@ -3,7 +3,7 @@ %% Copyright David Gerrold, 1984-2000, all rights reserved, %% used with permission of the author. %% -%%© This is the copyright line. +%%© This is the copyright line. %%Eighty-nine is the year we assign. %% These verses are caroled %% by one David Gerrold. From owner-svn-src-head@FreeBSD.ORG Sat May 14 19:13:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D00C21065670; Sat, 14 May 2011 19:13:44 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (pancho.soaustin.net [76.74.250.40]) by mx1.freebsd.org (Postfix) with ESMTP id B1D978FC15; Sat, 14 May 2011 19:13:44 +0000 (UTC) Received: by mail.soaustin.net (Postfix, from userid 502) id 7E5C55615A; Sat, 14 May 2011 13:56:32 -0500 (CDT) Date: Sat, 14 May 2011 13:56:32 -0500 From: Mark Linimon To: Colin Percival Message-ID: <20110514185632.GA8628@lonesome.com> References: <201105141744.p4EHiCpx010486@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105141744.p4EHiCpx010486@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221900 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 19:13:44 -0000 On Sat, May 14, 2011 at 05:44:12PM +0000, Colin Percival wrote: > Encourage Ben Laurie to finish getting his commit bit by appointing him > as the OpenSSL maintainer. Cool! (both parts) mcl From owner-svn-src-head@FreeBSD.ORG Sat May 14 19:27:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC3D106566B; Sat, 14 May 2011 19:27:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA2E78FC19; Sat, 14 May 2011 19:27:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EJRFvp013026; Sat, 14 May 2011 19:27:15 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EJRF5C013024; Sat, 14 May 2011 19:27:15 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201105141927.p4EJRF5C013024@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 14 May 2011 19:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221911 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 19:27:16 -0000 Author: np Date: Sat May 14 19:27:15 2011 New Revision: 221911 URL: http://svn.freebsd.org/changeset/base/221911 Log: sysctl that displays the absolute queue id of an rxq. Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat May 14 19:20:13 2011 (r221910) +++ head/sys/dev/cxgbe/t4_sge.c Sat May 14 19:27:15 2011 (r221911) @@ -141,6 +141,7 @@ static int handle_sge_egr_update(struct const struct cpl_sge_egr_update *); static int ctrl_tx(struct adapter *, struct sge_ctrlq *, struct mbuf *); +static int sysctl_abs_id(SYSCTL_HANDLER_ARGS); extern void filter_rpl(struct adapter *, const struct cpl_set_tcb_rpl *); @@ -1363,6 +1364,9 @@ alloc_rxq(struct port_info *pi, struct s NULL, "rx queue"); children = SYSCTL_CHILDREN(oid); + SYSCTL_ADD_PROC(&pi->ctx, children, OID_AUTO, "abs_id", + CTLTYPE_INT | CTLFLAG_RD, &rxq->iq.abs_id, 0, sysctl_abs_id, "I", + "absolute id of the queue"); #ifdef INET SYSCTL_ADD_INT(&pi->ctx, children, OID_AUTO, "lro_queued", CTLFLAG_RD, &rxq->lro.lro_queued, 0, NULL); @@ -2733,3 +2737,12 @@ failed: return (rc); } + +static int +sysctl_abs_id(SYSCTL_HANDLER_ARGS) +{ + uint16_t *id = arg1; + int i = *id; + + return sysctl_handle_int(oidp, &i, 0, req); +} From owner-svn-src-head@FreeBSD.ORG Sat May 14 20:31:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DCB5106566C; Sat, 14 May 2011 20:31:05 +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 3D76C8FC14; Sat, 14 May 2011 20:31:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EKV5bp014533; Sat, 14 May 2011 20:31:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EKV5el014531; Sat, 14 May 2011 20:31:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201105142031.p4EKV5el014531@svn.freebsd.org> From: Marius Strobl Date: Sat, 14 May 2011 20:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221913 - head/sys/dev/mii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 20:31:05 -0000 Author: marius Date: Sat May 14 20:31:04 2011 New Revision: 221913 URL: http://svn.freebsd.org/changeset/base/221913 Log: - There's no need for nibbletab to be static, it's const however. - Fix whitespace. Modified: head/sys/dev/mii/mii.c Modified: head/sys/dev/mii/mii.c ============================================================================== --- head/sys/dev/mii/mii.c Sat May 14 19:36:12 2011 (r221912) +++ head/sys/dev/mii/mii.c Sat May 14 20:31:04 2011 (r221913) @@ -552,7 +552,7 @@ mii_down(struct mii_data *mii) static unsigned char mii_bitreverse(unsigned char x) { - static unsigned char nibbletab[16] = { + unsigned const char const nibbletab[16] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; @@ -567,6 +567,6 @@ mii_oui(u_int id1, u_int id2) h = (id1 << 6) | (id2 >> 10); return ((mii_bitreverse(h >> 16) << 16) | - (mii_bitreverse((h >> 8) & 0xff) << 8) | - mii_bitreverse(h & 0xff)); + (mii_bitreverse((h >> 8) & 0xff) << 8) | + mii_bitreverse(h & 0xff)); } From owner-svn-src-head@FreeBSD.ORG Sat May 14 20:43:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54827106564A; Sat, 14 May 2011 20:43:56 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id DAEDA8FC15; Sat, 14 May 2011 20:43:55 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id p4EKhrJi057732; Sat, 14 May 2011 22:43:54 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id p4EKhr2M057731; Sat, 14 May 2011 22:43:53 +0200 (CEST) (envelope-from marius) Date: Sat, 14 May 2011 22:43:53 +0200 From: Marius Strobl To: Alan Cox Message-ID: <20110514204352.GA33899@alchemy.franken.de> References: <201105131935.p4DJZ14Q080511@svn.freebsd.org> <4DCD9766.4010601@rice.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DCD9766.4010601@rice.edu> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Matthew D Fleming , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221855 - in head/sys: amd64/include arm/include dev/md dev/null i386/include ia64/include mips/include powerpc/include sparc64/include sun4v/include sys vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 20:43:56 -0000 On Fri, May 13, 2011 at 03:41:10PM -0500, Alan Cox wrote: > On 5/13/2011 2:35 PM, Matthew D Fleming wrote: > >Author: mdf > >Date: Fri May 13 19:35:01 2011 > >New Revision: 221855 > >URL: http://svn.freebsd.org/changeset/base/221855 > > > >Log: > > Move the ZERO_REGION_SIZE to a machine-dependent file, as on many > > architectures (i386, for example) the virtual memory space may be > > constrained enough that 2MB is a large chunk. Use 64K for arches > > other than amd64 and ia64, with special handling for sparc64 due to > > differing hardware. > > > > Also commit the comment changes to kmem_init_zero_region() that I > > missed due to not saving the file. (Darn the unfamiliar development > > environment). > > > > Arch maintainers, please feel free to adjust ZERO_REGION_SIZE as you > > see fit. > > > > Requested by: alc > > MFC after: 1 week > > MFC with: r221853 > > I would encourage people on platforms with virtually indexed data caches > to do a simple before and after performance test on this change, like > "dd if=/dev/zero of=/dev/null bs=64k", just to make sure that there are > no performance regressions. > Actually, this improved the performance on an old 500MHz USIIe quite a bit, with r221854: v100# dd if=/dev/zero of=/dev/null bs=64k count=100000 100000+0 records in 100000+0 records out 6553600000 bytes transferred in 13.523223 secs (484618204 bytes/sec) with r221855: v100# dd if=/dev/zero of=/dev/null bs=64k count=100000 100000+0 records in 100000+0 records out 6553600000 bytes transferred in 5.235192 secs (1251835639 bytes/sec) Repeated runs vary only marginally in both cases. Marius From owner-svn-src-head@FreeBSD.ORG Sat May 14 22:15:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 304C01065670; Sat, 14 May 2011 22:15:39 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F0918FC08; Sat, 14 May 2011 22:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p4EMFdp2017878; Sat, 14 May 2011 22:15:39 GMT (envelope-from stas@svn.freebsd.org) Received: (from stas@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p4EMFc0q017874; Sat, 14 May 2011 22:15:38 GMT (envelope-from stas@svn.freebsd.org) Message-Id: <201105142215.p4EMFc0q017874@svn.freebsd.org> From: Stanislav Sedov Date: Sat, 14 May 2011 22:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221931 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 May 2011 22:15:39 -0000 Author: stas Date: Sat May 14 22:15:38 2011 New Revision: 221931 URL: http://svn.freebsd.org/changeset/base/221931 Log: - Add symbol versioning to libprocstat. Suggested by: kib Added: head/lib/libprocstat/Symbol.map (contents, props changed) head/lib/libprocstat/Versions.def (contents, props changed) Modified: head/lib/libprocstat/Makefile Modified: head/lib/libprocstat/Makefile ============================================================================== --- head/lib/libprocstat/Makefile Sat May 14 21:44:12 2011 (r221930) +++ head/lib/libprocstat/Makefile Sat May 14 22:15:38 2011 (r221931) @@ -12,6 +12,9 @@ SRCS= cd9660.c \ smbfs.c \ udf.c +VERSION_DEF= ${.CURDIR}/Versions.def +SYMBOL_MAPS= ${.CURDIR}/Symbol.map + INCS= libprocstat.h CFLAGS+= -I. -I${.CURDIR} -D_KVM_VNODE SHLIB_MAJOR= 1 Added: head/lib/libprocstat/Symbol.map ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/Symbol.map Sat May 14 22:15:38 2011 (r221931) @@ -0,0 +1,16 @@ +/* + * $FreeBSD$ + */ +FBSD_1.2 { + procstat_close; + procstat_freefiles; + procstat_freeprocs; + procstat_get_pipe_info; + procstat_get_pts_info; + procstat_get_socket_info; + procstat_get_vnode_info; + procstat_getfiles; + procstat_getprocs; + procstat_open_kvm; + procstat_open_sysctl; +}; Added: head/lib/libprocstat/Versions.def ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libprocstat/Versions.def Sat May 14 22:15:38 2011 (r221931) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# This version was first added to 9.0-current. +FBSD_1.2 { +};