From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 01:00:41 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD9CC106566C; Sun, 20 Dec 2009 01:00: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 CAFBA8FC0A; Sun, 20 Dec 2009 01:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK10fNr048263; Sun, 20 Dec 2009 01:00:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK10fFV048255; Sun, 20 Dec 2009 01:00:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912200100.nBK10fFV048255@svn.freebsd.org> From: Andriy Gapon Date: Sun, 20 Dec 2009 01:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200742 - in stable/7/sys: amd64/amd64 amd64/include i386/i386 i386/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 01:00:42 -0000 Author: avg Date: Sun Dec 20 01:00:41 2009 New Revision: 200742 URL: http://svn.freebsd.org/changeset/base/200742 Log: MFC r197070: Consolidate CPUID to CPU family/model macros for amd64 and i386 This is to fix breakage caused by r200064. I do this MFC instead of just fixing r200064 to reduce difference from head and make things easier for future MFCs. Original change is by jkim. Pointy hat to: avg Modified: stable/7/sys/amd64/amd64/identcpu.c stable/7/sys/amd64/amd64/initcpu.c stable/7/sys/amd64/amd64/msi.c stable/7/sys/amd64/include/specialreg.h stable/7/sys/i386/i386/identcpu.c stable/7/sys/i386/i386/msi.c stable/7/sys/i386/include/specialreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/identcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/identcpu.c Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/amd64/amd64/identcpu.c Sun Dec 20 01:00:41 2009 (r200742) @@ -371,21 +371,21 @@ printcpuinfo(void) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - AMD64_CPU_FAMILY(cpu_id) >= 0x10 || + CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) tsc_is_invariant = 1; break; case CPU_VENDOR_INTEL: if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - (AMD64_CPU_FAMILY(cpu_id) == 0x6 && - AMD64_CPU_MODEL(cpu_id) >= 0xe) || - (AMD64_CPU_FAMILY(cpu_id) == 0xf && - AMD64_CPU_MODEL(cpu_id) >= 0x3)) + (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xe) || + (CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) >= 0x3)) tsc_is_invariant = 1; break; case CPU_VENDOR_CENTAUR: - if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && - AMD64_CPU_MODEL(cpu_id) >= 0xf && + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf && (rdmsr(0x1203) & 0x100000000ULL) == 0) tsc_is_invariant = 1; break; @@ -638,8 +638,8 @@ print_AMD_info(void) * impratical at this stage, print out a warning string if the broken * model and family are identified. */ - if (AMD64_CPU_FAMILY(cpu_id) == 0xf && - AMD64_CPU_MODEL(cpu_id) >= 0x20 && AMD64_CPU_MODEL(cpu_id) <= 0x3f) + if (CPUID_TO_FAMILY(cpu_id) == 0xf && + CPUID_TO_MODEL(cpu_id) >= 0x20 && CPUID_TO_MODEL(cpu_id) <= 0x3f) printf("WARNING: This architecture revision has known SMP " "hardware bugs which may cause random instability\n"); } Modified: stable/7/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/7/sys/amd64/amd64/initcpu.c Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/amd64/amd64/initcpu.c Sun Dec 20 01:00:41 2009 (r200742) @@ -153,7 +153,7 @@ initializecpu(void) pg_nx = PG_NX; } if (cpu_vendor_id == CPU_VENDOR_CENTAUR && - AMD64_CPU_FAMILY(cpu_id) == 0x6 && - AMD64_CPU_MODEL(cpu_id) >= 0xf) + CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf) init_via(); } Modified: stable/7/sys/amd64/amd64/msi.c ============================================================================== --- stable/7/sys/amd64/amd64/msi.c Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/amd64/amd64/msi.c Sun Dec 20 01:00:41 2009 (r200742) @@ -218,8 +218,8 @@ msi_init(void) case CPU_VENDOR_AMD: break; case CPU_VENDOR_CENTAUR: - if (AMD64_CPU_FAMILY(cpu_id) == 0x6 && - AMD64_CPU_MODEL(cpu_id) >= 0xf) + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf) break; /* FALLTHROUGH */ default: Modified: stable/7/sys/amd64/include/specialreg.h ============================================================================== --- stable/7/sys/amd64/include/specialreg.h Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/amd64/include/specialreg.h Sun Dec 20 01:00:41 2009 (r200742) @@ -169,10 +169,10 @@ #define CPUID_FAMILY 0x00000f00 #define CPUID_EXT_MODEL 0x000f0000 #define CPUID_EXT_FAMILY 0x0ff00000 -#define AMD64_CPU_MODEL(id) \ +#define CPUID_TO_MODEL(id) \ ((((id) & CPUID_MODEL) >> 4) | \ (((id) & CPUID_EXT_MODEL) >> 12)) -#define AMD64_CPU_FAMILY(id) \ +#define CPUID_TO_FAMILY(id) \ ((((id) & CPUID_FAMILY) >> 8) + \ (((id) & CPUID_EXT_FAMILY) >> 20)) Modified: stable/7/sys/i386/i386/identcpu.c ============================================================================== --- stable/7/sys/i386/i386/identcpu.c Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/i386/i386/identcpu.c Sun Dec 20 01:00:41 2009 (r200742) @@ -859,7 +859,7 @@ printcpuinfo(void) switch (cpu_vendor_id) { case CPU_VENDOR_AMD: if ((amd_pminfo & AMDPM_TSC_INVARIANT) || - I386_CPU_FAMILY(cpu_id) >= 0x10 || + CPUID_TO_FAMILY(cpu_id) >= 0x10 || cpu_id == 0x60fb2) tsc_is_invariant = 1; break; @@ -868,8 +868,8 @@ printcpuinfo(void) tsc_is_invariant = 1; break; case CPU_VENDOR_CENTAUR: - if (I386_CPU_FAMILY(cpu_id) == 0x6 && - I386_CPU_MODEL(cpu_id) >= 0xf && + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf && (rdmsr(0x1203) & 0x100000000ULL) == 0) tsc_is_invariant = 1; break; @@ -1123,8 +1123,8 @@ finishidentcpu(void) * XXX This is only done on the BSP package. */ if (cpu_vendor_id == CPU_VENDOR_INTEL && cpu_high > 0 && cpu_high < 4 && - ((I386_CPU_FAMILY(cpu_id) == 0xf && I386_CPU_MODEL(cpu_id) >= 0x3) || - (I386_CPU_FAMILY(cpu_id) == 0x6 && I386_CPU_MODEL(cpu_id) >= 0xe))) { + ((CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x3) || + (CPUID_TO_FAMILY(cpu_id) == 0x6 && CPUID_TO_MODEL(cpu_id) >= 0xe))) { uint64_t msr; msr = rdmsr(MSR_IA32_MISC_ENABLE); if ((msr & 0x400000ULL) != 0) { @@ -1331,8 +1331,8 @@ print_AMD_info(void) * impratical at this stage, print out a warning string if the broken * model and family are identified. */ - if (I386_CPU_FAMILY(cpu_id) == 0xf && I386_CPU_MODEL(cpu_id) >= 0x20 && - I386_CPU_MODEL(cpu_id) <= 0x3f) + if (CPUID_TO_FAMILY(cpu_id) == 0xf && CPUID_TO_MODEL(cpu_id) >= 0x20 && + CPUID_TO_MODEL(cpu_id) <= 0x3f) printf("WARNING: This architecture revision has known SMP " "hardware bugs which may cause random instability\n"); } Modified: stable/7/sys/i386/i386/msi.c ============================================================================== --- stable/7/sys/i386/i386/msi.c Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/i386/i386/msi.c Sun Dec 20 01:00:41 2009 (r200742) @@ -218,8 +218,8 @@ msi_init(void) case CPU_VENDOR_AMD: break; case CPU_VENDOR_CENTAUR: - if (I386_CPU_FAMILY(cpu_id) == 0x6 && - I386_CPU_MODEL(cpu_id) >= 0xf) + if (CPUID_TO_FAMILY(cpu_id) == 0x6 && + CPUID_TO_MODEL(cpu_id) >= 0xf) break; /* FALLTHROUGH */ default: Modified: stable/7/sys/i386/include/specialreg.h ============================================================================== --- stable/7/sys/i386/include/specialreg.h Sat Dec 19 20:50:48 2009 (r200741) +++ stable/7/sys/i386/include/specialreg.h Sun Dec 20 01:00:41 2009 (r200742) @@ -166,11 +166,11 @@ #define CPUID_FAMILY 0x00000f00 #define CPUID_EXT_MODEL 0x000f0000 #define CPUID_EXT_FAMILY 0x0ff00000 -#define I386_CPU_MODEL(id) \ +#define CPUID_TO_MODEL(id) \ ((((id) & CPUID_MODEL) >> 4) | \ ((((id) & CPUID_FAMILY) >= 0x600) ? \ (((id) & CPUID_EXT_MODEL) >> 12) : 0)) -#define I386_CPU_FAMILY(id) \ +#define CPUID_TO_FAMILY(id) \ ((((id) & CPUID_FAMILY) >> 8) + \ ((((id) & CPUID_FAMILY) == 0xf00) ? \ (((id) & CPUID_EXT_FAMILY) >> 20) : 0)) From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 01:38:01 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A604F106566C; Sun, 20 Dec 2009 01:38:01 +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 9449B8FC0C; Sun, 20 Dec 2009 01:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK1c1Np049038; Sun, 20 Dec 2009 01:38:01 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK1c1e8049035; Sun, 20 Dec 2009 01:38:01 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912200138.nBK1c1e8049035@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Dec 2009 01:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200744 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 01:38:01 -0000 Author: marius Date: Sun Dec 20 01:38:01 2009 New Revision: 200744 URL: http://svn.freebsd.org/changeset/base/200744 Log: MFC: r200481 Specify the capability and media bits of the capabilities page in native, i.e. big-endian, format and convert as appropriate like we also do with the multibyte fields of the other pages. This fixes the output of acd_describe() to match reality on big-endian machines without breaking it on little-endian ones. While at it, also convert the remaining multibyte fields of the pages read although they are currently unused for consistency and in order to prevent possible similar bugs in the future. Modified: stable/8/sys/dev/ata/atapi-cd.c stable/8/sys/dev/ata/atapi-cd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/atapi-cd.c ============================================================================== --- stable/8/sys/dev/ata/atapi-cd.c Sun Dec 20 01:34:12 2009 (r200743) +++ stable/8/sys/dev/ata/atapi-cd.c Sun Dec 20 01:38:01 2009 (r200744) @@ -1206,6 +1206,7 @@ acd_read_track_info(device_t dev, int32_ if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), ATA_R_READ, 30))) return error; + info->data_length = ntohs(info->data_length); info->track_start_addr = ntohl(info->track_start_addr); info->next_writeable_addr = ntohl(info->next_writeable_addr); info->free_blocks = ntohl(info->free_blocks); @@ -1644,12 +1645,17 @@ acd_get_cap(device_t dev) for (count = 0 ; count < 5 ; count++) { if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), ATA_R_READ | ATA_R_QUIET, 5)) { + cdp->cap.data_length = ntohs(cdp->cap.data_length); + cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); + cdp->cap.media = ntohs(cdp->cap.media); + cdp->cap.capabilities = ntohs(cdp->cap.capabilities); cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); + cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); + cdp->cap.buf_size = ntohs(cdp->cap.buf_size); cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed),177); - cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); - cdp->cap.buf_size = ntohs(cdp->cap.buf_size); + cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); } } } Modified: stable/8/sys/dev/ata/atapi-cd.h ============================================================================== --- stable/8/sys/dev/ata/atapi-cd.h Sun Dec 20 01:34:12 2009 (r200743) +++ stable/8/sys/dev/ata/atapi-cd.h Sun Dec 20 01:38:01 2009 (r200744) @@ -112,34 +112,34 @@ struct cappage { u_int8_t param_len; u_int16_t media; -#define MST_READ_CDR 0x0001 -#define MST_READ_CDRW 0x0002 -#define MST_READ_PACKET 0x0004 -#define MST_READ_DVDROM 0x0008 -#define MST_READ_DVDR 0x0010 -#define MST_READ_DVDRAM 0x0020 -#define MST_WRITE_CDR 0x0100 -#define MST_WRITE_CDRW 0x0200 -#define MST_WRITE_TEST 0x0400 -#define MST_WRITE_DVDR 0x1000 -#define MST_WRITE_DVDRAM 0x2000 +#define MST_READ_CDR 0x0100 +#define MST_READ_CDRW 0x0200 +#define MST_READ_PACKET 0x0400 +#define MST_READ_DVDROM 0x0800 +#define MST_READ_DVDR 0x1000 +#define MST_READ_DVDRAM 0x2000 +#define MST_WRITE_CDR 0x0001 +#define MST_WRITE_CDRW 0x0002 +#define MST_WRITE_TEST 0x0004 +#define MST_WRITE_DVDR 0x0010 +#define MST_WRITE_DVDRAM 0x0020 u_int16_t capabilities; -#define MST_AUDIO_PLAY 0x0001 -#define MST_COMPOSITE 0x0002 -#define MST_AUDIO_P1 0x0004 -#define MST_AUDIO_P2 0x0008 -#define MST_MODE2_f1 0x0010 -#define MST_MODE2_f2 0x0020 -#define MST_MULTISESSION 0x0040 -#define MST_BURNPROOF 0x0080 -#define MST_READ_CDDA 0x0100 -#define MST_CDDA_STREAM 0x0200 -#define MST_COMBINED_RW 0x0400 -#define MST_CORRECTED_RW 0x0800 -#define MST_SUPPORT_C2 0x1000 -#define MST_ISRC 0x2000 -#define MST_UPC 0x4000 +#define MST_AUDIO_PLAY 0x0100 +#define MST_COMPOSITE 0x0200 +#define MST_AUDIO_P1 0x0400 +#define MST_AUDIO_P2 0x0800 +#define MST_MODE2_f1 0x1000 +#define MST_MODE2_f2 0x2000 +#define MST_MULTISESSION 0x4000 +#define MST_BURNPROOF 0x8000 +#define MST_READ_CDDA 0x0001 +#define MST_CDDA_STREAM 0x0002 +#define MST_COMBINED_RW 0x0004 +#define MST_CORRECTED_RW 0x0008 +#define MST_SUPPORT_C2 0x0010 +#define MST_ISRC 0x0020 +#define MST_UPC 0x0040 u_int8_t mechanism; #define MST_LOCKABLE 0x01 From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 01:38:21 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E68CE106568B; Sun, 20 Dec 2009 01:38:21 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D52628FC16; Sun, 20 Dec 2009 01:38:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK1cLf5049085; Sun, 20 Dec 2009 01:38:21 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK1cLuk049082; Sun, 20 Dec 2009 01:38:21 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912200138.nBK1cLuk049082@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Dec 2009 01:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200745 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 01:38:22 -0000 Author: marius Date: Sun Dec 20 01:38:21 2009 New Revision: 200745 URL: http://svn.freebsd.org/changeset/base/200745 Log: MFC: r200481 Specify the capability and media bits of the capabilities page in native, i.e. big-endian, format and convert as appropriate like we also do with the multibyte fields of the other pages. This fixes the output of acd_describe() to match reality on big-endian machines without breaking it on little-endian ones. While at it, also convert the remaining multibyte fields of the pages read although they are currently unused for consistency and in order to prevent possible similar bugs in the future. Modified: stable/7/sys/dev/ata/atapi-cd.c stable/7/sys/dev/ata/atapi-cd.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/atapi-cd.c ============================================================================== --- stable/7/sys/dev/ata/atapi-cd.c Sun Dec 20 01:38:01 2009 (r200744) +++ stable/7/sys/dev/ata/atapi-cd.c Sun Dec 20 01:38:21 2009 (r200745) @@ -1211,6 +1211,7 @@ acd_read_track_info(device_t dev, int32_ if ((error = ata_atapicmd(dev, ccb, (caddr_t)info, sizeof(*info), ATA_R_READ, 30))) return error; + info->data_length = ntohs(info->data_length); info->track_start_addr = ntohl(info->track_start_addr); info->next_writeable_addr = ntohl(info->next_writeable_addr); info->free_blocks = ntohl(info->free_blocks); @@ -1649,12 +1650,17 @@ acd_get_cap(device_t dev) for (count = 0 ; count < 5 ; count++) { if (!ata_atapicmd(dev, ccb, (caddr_t)&cdp->cap, sizeof(cdp->cap), ATA_R_READ | ATA_R_QUIET, 5)) { + cdp->cap.data_length = ntohs(cdp->cap.data_length); + cdp->cap.blk_desc_len = ntohs(cdp->cap.blk_desc_len); + cdp->cap.media = ntohs(cdp->cap.media); + cdp->cap.capabilities = ntohs(cdp->cap.capabilities); cdp->cap.max_read_speed = ntohs(cdp->cap.max_read_speed); + cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); + cdp->cap.buf_size = ntohs(cdp->cap.buf_size); cdp->cap.cur_read_speed = ntohs(cdp->cap.cur_read_speed); cdp->cap.max_write_speed = ntohs(cdp->cap.max_write_speed); cdp->cap.cur_write_speed = max(ntohs(cdp->cap.cur_write_speed),177); - cdp->cap.max_vol_levels = ntohs(cdp->cap.max_vol_levels); - cdp->cap.buf_size = ntohs(cdp->cap.buf_size); + cdp->cap.copy_protect_rev = ntohs(cdp->cap.copy_protect_rev); } } } Modified: stable/7/sys/dev/ata/atapi-cd.h ============================================================================== --- stable/7/sys/dev/ata/atapi-cd.h Sun Dec 20 01:38:01 2009 (r200744) +++ stable/7/sys/dev/ata/atapi-cd.h Sun Dec 20 01:38:21 2009 (r200745) @@ -112,34 +112,34 @@ struct cappage { u_int8_t param_len; u_int16_t media; -#define MST_READ_CDR 0x0001 -#define MST_READ_CDRW 0x0002 -#define MST_READ_PACKET 0x0004 -#define MST_READ_DVDROM 0x0008 -#define MST_READ_DVDR 0x0010 -#define MST_READ_DVDRAM 0x0020 -#define MST_WRITE_CDR 0x0100 -#define MST_WRITE_CDRW 0x0200 -#define MST_WRITE_TEST 0x0400 -#define MST_WRITE_DVDR 0x1000 -#define MST_WRITE_DVDRAM 0x2000 +#define MST_READ_CDR 0x0100 +#define MST_READ_CDRW 0x0200 +#define MST_READ_PACKET 0x0400 +#define MST_READ_DVDROM 0x0800 +#define MST_READ_DVDR 0x1000 +#define MST_READ_DVDRAM 0x2000 +#define MST_WRITE_CDR 0x0001 +#define MST_WRITE_CDRW 0x0002 +#define MST_WRITE_TEST 0x0004 +#define MST_WRITE_DVDR 0x0010 +#define MST_WRITE_DVDRAM 0x0020 u_int16_t capabilities; -#define MST_AUDIO_PLAY 0x0001 -#define MST_COMPOSITE 0x0002 -#define MST_AUDIO_P1 0x0004 -#define MST_AUDIO_P2 0x0008 -#define MST_MODE2_f1 0x0010 -#define MST_MODE2_f2 0x0020 -#define MST_MULTISESSION 0x0040 -#define MST_BURNPROOF 0x0080 -#define MST_READ_CDDA 0x0100 -#define MST_CDDA_STREAM 0x0200 -#define MST_COMBINED_RW 0x0400 -#define MST_CORRECTED_RW 0x0800 -#define MST_SUPPORT_C2 0x1000 -#define MST_ISRC 0x2000 -#define MST_UPC 0x4000 +#define MST_AUDIO_PLAY 0x0100 +#define MST_COMPOSITE 0x0200 +#define MST_AUDIO_P1 0x0400 +#define MST_AUDIO_P2 0x0800 +#define MST_MODE2_f1 0x1000 +#define MST_MODE2_f2 0x2000 +#define MST_MULTISESSION 0x4000 +#define MST_BURNPROOF 0x8000 +#define MST_READ_CDDA 0x0001 +#define MST_CDDA_STREAM 0x0002 +#define MST_COMBINED_RW 0x0004 +#define MST_CORRECTED_RW 0x0008 +#define MST_SUPPORT_C2 0x0010 +#define MST_ISRC 0x0020 +#define MST_UPC 0x0040 u_int8_t mechanism; #define MST_LOCKABLE 0x01 From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 01:44:47 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E73491065696; Sun, 20 Dec 2009 01:44: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 BD5C78FC13; Sun, 20 Dec 2009 01:44:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK1ilOp049273; Sun, 20 Dec 2009 01:44:47 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK1ilb3049271; Sun, 20 Dec 2009 01:44:47 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912200144.nBK1ilb3049271@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Dec 2009 01:44:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200746 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 01:44:48 -0000 Author: marius Date: Sun Dec 20 01:44:47 2009 New Revision: 200746 URL: http://svn.freebsd.org/changeset/base/200746 Log: MFC: r200482, r200485 o Properly support M5229 revision 0xc7 and 0xc8: - These revisions no longer have cable detection capability. - The UDMA support bit of register 0x4b has been dropped without an replacement. - According to Linux it's crucial for working ATAPI DMA support to also set the reserved bit 1 of regsiter 0x53 with these revisions. o Only set ATA_CHECKS_CABLE for chip versions that actually support cable detection, i.e. neither for ALI_OLD nor for ALI_NEW revisions >= 0xc7. Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 20 01:38:21 2009 (r200745) +++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Sun Dec 20 01:44:47 2009 (r200746) @@ -141,11 +141,14 @@ ata_ali_chipinit(device_t dev) /* use device interrupt as byte count end */ pci_write_config(dev, 0x4a, pci_read_config(dev, 0x4a, 1) | 0x20, 1); - /* enable cable detection and UDMA support on newer chips */ - pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | 0x09, 1); - - /* enable ATAPI UDMA mode */ - pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | 0x01, 1); + /* enable cable detection and UDMA support on revisions < 0xc7 */ + if (ctlr->chip->chiprev < 0xc7) + pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | + 0x09, 1); + + /* enable ATAPI UDMA mode (even if we are going to do PIO) */ + pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | + (ctlr->chip->chiprev >= 0xc7 ? 0x03 : 0x01), 1); /* only chips with revision > 0xc4 can do 48bit DMA */ if (ctlr->chip->chiprev <= 0xc4) @@ -177,7 +180,8 @@ ata_ali_ch_attach(device_t dev) if (ata_pci_ch_attach(dev)) return ENXIO; - ch->flags |= ATA_CHECKS_CABLE; + if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) + ch->flags |= ATA_CHECKS_CABLE; /* older chips can't do 48bit DMA transfers */ if (ctlr->chip->chiprev <= 0xc4) ch->flags |= ATA_NO_48BIT_DMA; @@ -276,7 +280,7 @@ ata_ali_setmode(device_t dev, int target mode = min(mode, ctlr->chip->max_dma); - if (ctlr->chip->cfg2 & ALI_NEW) { + if (ctlr->chip->cfg2 & ALI_NEW && ctlr->chip->chiprev < 0xc7) { if (mode > ATA_UDMA2 && pci_read_config(parent, 0x4a, 1) & (1 << ch->unit)) { ata_print_cable(dev, "controller"); From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 01:46:24 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C40C1065695; Sun, 20 Dec 2009 01:46:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C89B8FC17; Sun, 20 Dec 2009 01:46:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK1kNJm049343; Sun, 20 Dec 2009 01:46:23 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK1kNjA049341; Sun, 20 Dec 2009 01:46:23 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912200146.nBK1kNjA049341@svn.freebsd.org> From: Marius Strobl Date: Sun, 20 Dec 2009 01:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200747 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 01:46:24 -0000 Author: marius Date: Sun Dec 20 01:46:23 2009 New Revision: 200747 URL: http://svn.freebsd.org/changeset/base/200747 Log: MFC: r200482 Properly support M5229 revision 0xc7 and 0xc8: - These revisions no longer have cable detection capability. - The UDMA support bit of register 0x4b has been dropped without an replacement. - According to Linux it's crucial for working ATAPI DMA support to also set the reserved bit 1 of regsiter 0x53 with these revisions. Modified: stable/7/sys/dev/ata/ata-chipset.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-chipset.c ============================================================================== --- stable/7/sys/dev/ata/ata-chipset.c Sun Dec 20 01:44:47 2009 (r200746) +++ stable/7/sys/dev/ata/ata-chipset.c Sun Dec 20 01:46:23 2009 (r200747) @@ -1135,11 +1135,14 @@ ata_ali_chipinit(device_t dev) /* use device interrupt as byte count end */ pci_write_config(dev, 0x4a, pci_read_config(dev, 0x4a, 1) | 0x20, 1); - /* enable cable detection and UDMA support on newer chips */ - pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | 0x09, 1); - - /* enable ATAPI UDMA mode */ - pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | 0x01, 1); + /* enable cable detection and UDMA support on revisions < 0xc7 */ + if (ctlr->chip->chiprev < 0xc7) + pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | + 0x09, 1); + + /* enable ATAPI UDMA mode (even if we are going to do PIO) */ + pci_write_config(dev, 0x53, pci_read_config(dev, 0x53, 1) | + (ctlr->chip->chiprev >= 0xc7 ? 0x03 : 0x01), 1); /* only chips with revision > 0xc4 can do 48bit DMA */ if (ctlr->chip->chiprev <= 0xc4) @@ -1263,7 +1266,7 @@ ata_ali_setmode(device_t dev, int mode) mode = ata_limit_mode(dev, mode, ctlr->chip->max_dma); - if (ctlr->chip->cfg2 & ALINEW) { + if (ctlr->chip->cfg2 & ALINEW && ctlr->chip->chiprev < 0xc7) { if (mode > ATA_UDMA2 && pci_read_config(gparent, 0x4a, 1) & (1 << ch->unit)) { ata_print_cable(dev, "controller"); From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 02:35:11 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A960106574C; Sun, 20 Dec 2009 02:35:11 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2914F8FC13; Sun, 20 Dec 2009 02:35:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK2ZBvo050360; Sun, 20 Dec 2009 02:35:11 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK2ZBbj050358; Sun, 20 Dec 2009 02:35:11 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <200912200235.nBK2ZBbj050358@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 20 Dec 2009 02:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200748 - stable/8/gnu/lib/libgcov X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 02:35:11 -0000 Author: kan Date: Sun Dec 20 02:35:10 2009 New Revision: 200748 URL: http://svn.freebsd.org/changeset/base/200748 Log: MFC r198471. Log: Compile libgcov without stack protection. It can be linked into both static and dynamic binaries compiled with or without stack protection and should not depend on libssp_nonshared.a symbols. Discussed with: kib PR: bin/139052 Modified: stable/8/gnu/lib/libgcov/Makefile Modified: stable/8/gnu/lib/libgcov/Makefile ============================================================================== --- stable/8/gnu/lib/libgcov/Makefile Sun Dec 20 01:46:23 2009 (r200747) +++ stable/8/gnu/lib/libgcov/Makefile Sun Dec 20 02:35:10 2009 (r200748) @@ -2,6 +2,7 @@ NO_PROFILE= .include +MK_SSP= no .include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt" GCCDIR= ${.CURDIR}/../../../contrib/gcc From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 04:45:33 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FF7B1065672; Sun, 20 Dec 2009 04:45:32 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE8A78FC08; Sun, 20 Dec 2009 04:45:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK4jWS5053060; Sun, 20 Dec 2009 04:45:32 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK4jWua053058; Sun, 20 Dec 2009 04:45:32 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200912200445.nBK4jWua053058@svn.freebsd.org> From: Jamie Gritton Date: Sun, 20 Dec 2009 04:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200749 - stable/8/usr.sbin/jls X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 04:45:33 -0000 Author: jamie Date: Sun Dec 20 04:45:32 2009 New Revision: 200749 URL: http://svn.freebsd.org/changeset/base/200749 Log: MFC r200449: Don't free jail parameter values after printing them - jail_param_get expects them to be there for the next jail in the list. PR: bin/141359 Modified: stable/8/usr.sbin/jls/jls.c Directory Properties: stable/8/usr.sbin/jls/ (props changed) Modified: stable/8/usr.sbin/jls/jls.c ============================================================================== --- stable/8/usr.sbin/jls/jls.c Sun Dec 20 02:35:10 2009 (r200748) +++ stable/8/usr.sbin/jls/jls.c Sun Dec 20 04:45:32 2009 (r200749) @@ -425,11 +425,6 @@ print_jail(int pflags, int jflags) if (params[i].jp_flags & JP_USER) free(param_values[i]); } - for (i = 0; i < nparams; i++) - if (!(params[i].jp_flags & JP_RAWVALUE)) { - free(params[i].jp_value); - params[i].jp_value = NULL; - } return (jid); } From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 04:49:29 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 629D5106566C; Sun, 20 Dec 2009 04:49:29 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5214A8FC12; Sun, 20 Dec 2009 04:49:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBK4nT3G053203; Sun, 20 Dec 2009 04:49:29 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBK4nTOE053201; Sun, 20 Dec 2009 04:49:29 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <200912200449.nBK4nTOE053201@svn.freebsd.org> From: Jamie Gritton Date: Sun, 20 Dec 2009 04:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200750 - stable/8/lib/libjail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 04:49:29 -0000 Author: jamie Date: Sun Dec 20 04:49:29 2009 New Revision: 200750 URL: http://svn.freebsd.org/changeset/base/200750 Log: MFC r200623: Add a null pointer check so "name" can be used as a key parameter in jailparam_get. PR: bin/141692 Submitted by: delphij Modified: stable/8/lib/libjail/jail.c Directory Properties: stable/8/lib/libjail/ (props changed) Modified: stable/8/lib/libjail/jail.c ============================================================================== --- stable/8/lib/libjail/jail.c Sun Dec 20 04:45:32 2009 (r200749) +++ stable/8/lib/libjail/jail.c Sun Dec 20 04:49:29 2009 (r200750) @@ -532,7 +532,7 @@ jailparam_get(struct jailparam *jp, unsi } jp_key = jp_lastjid ? jp_lastjid : jp_jid && jp_jid->jp_valuelen == sizeof(int) && - *(int *)jp_jid->jp_value ? jp_jid : jp_name; + jp_jid->jp_value && *(int *)jp_jid->jp_value ? jp_jid : jp_name; if (jp_key == NULL || jp_key->jp_value == NULL) { strlcpy(jail_errmsg, "no jail specified", JAIL_ERRMSGLEN); errno = ENOENT; From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 05:19:07 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092121065679; Sun, 20 Dec 2009 05:19:07 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mx1.freebsd.org (Postfix) with ESMTP id CCC9E8FC08; Sun, 20 Dec 2009 05:19:06 +0000 (UTC) Received: by pwi15 with SMTP id 15so2885976pwi.3 for ; Sat, 19 Dec 2009 21:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6IzMWc3/6WpsJzVdwFclH3o5u83Y3dtFgiXjrGdgW3k=; b=nrPuPHW6x0qDs2LCdH9m44Ucu/x0D1KdBkaluzfh3DJQcgE288BfLJ/rYVilW77joK T/8hS6Hc1XZiNONYhsJgZV4jTjzJuL4dRTRl3NBXt/WhRw1cQZsRSxxjPODhrZJdPgFI KVoAVHLJ3SZCZ/ZiJfJBCZJH60aVpolSXYDm4= 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:content-transfer-encoding; b=pn/pd5NCbkXHTNeEYHSvsTAQk8PrU5mcDmCLV+E5309GnsTDaB1liWfxCGVXvEteQ+ eJ7Zw12Jai/O+8s4y0n58hiuWxY9In3SALIXxdRYRZqntkRzActYrTurEg79PSccKhkH Ac3t25sukSHZdltsRPONB7c4BVl4Ypb8AYbwM= MIME-Version: 1.0 Received: by 10.115.117.9 with SMTP id u9mr3830363wam.172.1261285019770; Sat, 19 Dec 2009 20:56:59 -0800 (PST) In-Reply-To: <200912200449.nBK4nTOE053201@svn.freebsd.org> References: <200912200449.nBK4nTOE053201@svn.freebsd.org> Date: Sat, 19 Dec 2009 20:56:59 -0800 Message-ID: From: Xin LI To: Jamie Gritton Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200750 - stable/8/lib/libjail X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 05:19:07 -0000 On Sat, Dec 19, 2009 at 8:49 PM, Jamie Gritton wrote: > Author: jamie > Date: Sun Dec 20 04:49:29 2009 > New Revision: 200750 > URL: http://svn.freebsd.org/changeset/base/200750 > > Log: > =C2=A0MFC r200623: > > =C2=A0 =C2=A0Add a null pointer check so "name" can be used as a key para= meter in > =C2=A0 =C2=A0jailparam_get. > > =C2=A0PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bin/141692 > =C2=A0Submitted by: delphij Thanks! Cheers, --=20 Xin LI http://www.delphij.net From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 10:40:14 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070581065676; Sun, 20 Dec 2009 10:40:14 +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 9EF2B8FC0C; Sun, 20 Dec 2009 10:40:12 +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 MAA12282; Sun, 20 Dec 2009 12:40:09 +0200 (EET) (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 1NMJCr-0007j7-D6; Sun, 20 Dec 2009 12:40:09 +0200 Message-ID: <4B2DFEA5.6000706@freebsd.org> Date: Sun, 20 Dec 2009 12:38:29 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.23 (X11/20091128) MIME-Version: 1.0 To: jhell References: <200912191045.nBJAjvfc030388@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r200714 - in stable/7/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 10:40:14 -0000 on 19/12/2009 21:19 jhell said the following: > [FYI] > Following errors are being generated on stable/7 i386 "Intel" based > machine. If more information is needed, let me know. > > cc1: warnings being treated as errors > /usr/src/sys/i386/i386/mca.c: In function 'mca_init': > /usr/src/sys/i386/i386/mca.c:510: warning: implicit declaration of > function 'CPUID_TO_FAMILY' > /usr/src/sys/i386/i386/mca.c:510: warning: nested extern declaration of > 'CPUID_TO_FAMILY' > /usr/src/sys/i386/i386/mca.c:511: warning: implicit declaration of > function 'CPUID_TO_MODEL' > /usr/src/sys/i386/i386/mca.c:511: warning: nested extern declaration of > 'CPUID_TO_MODEL' > *** Error code 1 Thank you for the information! Unfortunately, I took a shortcut during the MFC of what I thought was an almost trivial change and didn't realize that I was breaking the build. Should be fixed with r200742. -- Andriy Gapon From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 18:57:43 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6B81065670; Sun, 20 Dec 2009 18:57:43 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C4358FC1B; Sun, 20 Dec 2009 18:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBKIvha1072359; Sun, 20 Dec 2009 18:57:43 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBKIvhW6072357; Sun, 20 Dec 2009 18:57:43 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <200912201857.nBKIvhW6072357@svn.freebsd.org> From: Sean Farley Date: Sun, 20 Dec 2009 18:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200757 - stable/8/lib/libusb X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 18:57:43 -0000 Author: scf Date: Sun Dec 20 18:57:43 2009 New Revision: 200757 URL: http://svn.freebsd.org/changeset/base/200757 Log: Merge from head to stable/8: r200424: Fix libusb_open_device_with_vid_pid() to return a NULL if no device is found instead of the last device in its search list. Reviewed by: thompsa Modified: stable/8/lib/libusb/libusb10.c Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Sun Dec 20 18:53:34 2009 (r200756) +++ stable/8/lib/libusb/libusb10.c Sun Dec 20 18:57:43 2009 (r200757) @@ -379,8 +379,6 @@ libusb_open_device_with_vid_pid(libusb_c if ((i = libusb_get_device_list(ctx, &devs)) < 0) return (NULL); - pdev = NULL; - for (j = 0; j < i; j++) { pdev = devs[j]->os_priv; pdesc = libusb20_dev_get_device_desc(pdev); @@ -396,6 +394,8 @@ libusb_open_device_with_vid_pid(libusb_c break; } } + if (j == i) + pdev = NULL; libusb_free_device_list(devs, 1); DPRINTF(ctx, LIBUSB_DEBUG_FUNCTION, "libusb_open_device_width_vid_pid leave"); From owner-svn-src-stable@FreeBSD.ORG Sun Dec 20 20:51:20 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BC4D106566C; Sun, 20 Dec 2009 20:51: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 4A4218FC14; Sun, 20 Dec 2009 20:51:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBKKpKK7074657; Sun, 20 Dec 2009 20:51:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBKKpKEv074655; Sun, 20 Dec 2009 20:51:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912202051.nBKKpKEv074655@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Dec 2009 20:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200760 - stable/8/bin/sh X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Dec 2009 20:51:20 -0000 Author: jilles Date: Sun Dec 20 20:51:20 2009 New Revision: 200760 URL: http://svn.freebsd.org/changeset/base/200760 Log: MFC r198173: sh: show more info about syntax errors in command substitution: the line number where the command substitution started. This applies to both the $() and `` forms but is most useful for `` because the other line number is relative to the enclosed text there. (For older versions, -v can be used as a workaround.) Modified: stable/8/bin/sh/parser.c Directory Properties: stable/8/bin/sh/ (props changed) Modified: stable/8/bin/sh/parser.c ============================================================================== --- stable/8/bin/sh/parser.c Sun Dec 20 19:45:46 2009 (r200759) +++ stable/8/bin/sh/parser.c Sun Dec 20 20:51:20 2009 (r200760) @@ -1310,6 +1310,7 @@ parsebackq: { struct jmploc *const savehandler = handler; int savelen; int saveprompt; + const int bq_startlinno = plinno; savepbq = parsebackquote; if (setjmp(jmploc.loc)) { @@ -1317,6 +1318,10 @@ parsebackq: { ckfree(str); parsebackquote = 0; handler = savehandler; + if (exception == EXERROR) { + startlinno = bq_startlinno; + synerror("Error in command substitution"); + } longjmp(handler->loc, 1); } INTOFF; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 05:58:55 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56FA1065676; Mon, 21 Dec 2009 05:58:55 +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 A30A48FC18; Mon, 21 Dec 2009 05:58:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBL5wtB0085524; Mon, 21 Dec 2009 05:58:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBL5wt3V085518; Mon, 21 Dec 2009 05:58:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912210558.nBL5wt3V085518@svn.freebsd.org> From: Andriy Gapon Date: Mon, 21 Dec 2009 05:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200765 - in stable/8/sys: amd64/conf conf dev/amdsbwd i386/conf modules modules/amdsbwd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 05:58:55 -0000 Author: avg Date: Mon Dec 21 05:58:55 2009 New Revision: 200765 URL: http://svn.freebsd.org/changeset/base/200765 Log: MFC r199969: amdsbwd: new driver for AMD SB600/SB7xx watchdog timer Added: stable/8/sys/dev/amdsbwd/ - copied from r199969, head/sys/dev/amdsbwd/ stable/8/sys/modules/amdsbwd/ - copied from r199969, head/sys/modules/amdsbwd/ Modified: stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Mon Dec 21 03:28:05 2009 (r200764) +++ stable/8/sys/amd64/conf/NOTES Mon Dec 21 05:58:55 2009 (r200765) @@ -385,8 +385,10 @@ device asmc # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer +# amdsbwd: AMD SB7xx watchdog timer # device ichwd +device amdsbwd # # Temperature sensors: Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Mon Dec 21 03:28:05 2009 (r200764) +++ stable/8/sys/conf/files.amd64 Mon Dec 21 05:58:55 2009 (r200765) @@ -151,6 +151,7 @@ dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp dev/agp/agp_intel.c optional agp dev/agp/agp_via.c optional agp +dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Mon Dec 21 03:28:05 2009 (r200764) +++ stable/8/sys/conf/files.i386 Mon Dec 21 05:58:55 2009 (r200765) @@ -127,6 +127,7 @@ dev/agp/agp_nvidia.c optional agp dev/agp/agp_sis.c optional agp dev/agp/agp_via.c optional agp dev/aic/aic_isa.c optional aic isa +dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/asmc/asmc.c optional asmc isa Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Mon Dec 21 03:28:05 2009 (r200764) +++ stable/8/sys/i386/conf/NOTES Mon Dec 21 05:58:55 2009 (r200765) @@ -779,8 +779,10 @@ hint.pcf.0.irq="5" # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer +# amdsbwd: AMD SB7xx watchdog timer # device ichwd +device amdsbwd # # Temperature sensors: Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Mon Dec 21 03:28:05 2009 (r200764) +++ stable/8/sys/modules/Makefile Mon Dec 21 05:58:55 2009 (r200765) @@ -21,6 +21,7 @@ SUBDIR= ${_3dfx} \ alc \ ale \ ${_amd} \ + ${_amdsbwd} \ ${_amdtemp} \ amr \ ${_an} \ @@ -413,6 +414,7 @@ _zfs= zfs _aac= aac _acpi= acpi _ahb= ahb +_amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc @@ -468,6 +470,7 @@ _aac= aac _acpi= acpi _agp= agp _an= an +_amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 06:24:45 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED3C91065672; Mon, 21 Dec 2009 06:24:44 +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 DB03E8FC17; Mon, 21 Dec 2009 06:24:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBL6OiLw086124; Mon, 21 Dec 2009 06:24:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBL6OiR9086118; Mon, 21 Dec 2009 06:24:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912210624.nBL6OiR9086118@svn.freebsd.org> From: Andriy Gapon Date: Mon, 21 Dec 2009 06:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200766 - in stable/7/sys: amd64/conf conf dev/amdsbwd i386/conf modules modules/amdsbwd X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 06:24:45 -0000 Author: avg Date: Mon Dec 21 06:24:44 2009 New Revision: 200766 URL: http://svn.freebsd.org/changeset/base/200766 Log: MFC r199969: amdsbwd: new driver for AMD SB600/SB7xx watchdog timer Added: stable/7/sys/dev/amdsbwd/ - copied from r199969, head/sys/dev/amdsbwd/ stable/7/sys/modules/amdsbwd/ - copied from r199969, head/sys/modules/amdsbwd/ Modified: stable/7/sys/amd64/conf/NOTES stable/7/sys/conf/files.amd64 stable/7/sys/conf/files.i386 stable/7/sys/i386/conf/NOTES stable/7/sys/modules/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/NOTES ============================================================================== --- stable/7/sys/amd64/conf/NOTES Mon Dec 21 05:58:55 2009 (r200765) +++ stable/7/sys/amd64/conf/NOTES Mon Dec 21 06:24:44 2009 (r200766) @@ -449,8 +449,10 @@ device xrpu # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer +# amdsbwd: AMD SB7xx watchdog timer # device ichwd +device amdsbwd # # Temperature sensors: Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Mon Dec 21 05:58:55 2009 (r200765) +++ stable/7/sys/conf/files.amd64 Mon Dec 21 06:24:44 2009 (r200766) @@ -135,6 +135,7 @@ crypto/via/padlock.c optional padlock crypto/via/padlock_cipher.c optional padlock crypto/via/padlock_hash.c optional padlock dev/acpica/acpi_if.m standard +dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/atkbdc/atkbd.c optional atkbd atkbdc Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Mon Dec 21 05:58:55 2009 (r200765) +++ stable/7/sys/conf/files.i386 Mon Dec 21 06:24:44 2009 (r200766) @@ -131,6 +131,7 @@ crypto/via/padlock_cipher.c optional pad crypto/via/padlock_hash.c optional padlock dev/advansys/adv_isa.c optional adv isa dev/aic/aic_isa.c optional aic isa +dev/amdsbwd/amdsbwd.c optional amdsbwd dev/amdtemp/amdtemp.c optional amdtemp dev/arcmsr/arcmsr.c optional arcmsr pci dev/ar/if_ar.c optional ar Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Mon Dec 21 05:58:55 2009 (r200765) +++ stable/7/sys/i386/conf/NOTES Mon Dec 21 06:24:44 2009 (r200766) @@ -863,8 +863,10 @@ hint.pcf.0.irq="5" # Hardware watchdog timers: # # ichwd: Intel ICH watchdog timer +# amdsbwd: AMD SB7xx watchdog timer # device ichwd +device amdsbwd # # Temperature sensors: Modified: stable/7/sys/modules/Makefile ============================================================================== --- stable/7/sys/modules/Makefile Mon Dec 21 05:58:55 2009 (r200765) +++ stable/7/sys/modules/Makefile Mon Dec 21 06:24:44 2009 (r200766) @@ -19,6 +19,7 @@ SUBDIR= ${_3dfx} \ alc \ ale \ ${_amd} \ + ${_amdsbwd} \ ${_amdtemp} \ amr \ ${_an} \ @@ -459,6 +460,7 @@ _zfs= zfs _aac= aac _acpi= acpi _ahb= ahb +_amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _arl= arl @@ -513,6 +515,7 @@ _aac= aac _acpi= acpi _agp= agp _an= an +_amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _cardbus= cardbus From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 11:06:42 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424E41065693; Mon, 21 Dec 2009 11:06:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 311BB8FC1D; Mon, 21 Dec 2009 11:06:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLB6gV8025946; Mon, 21 Dec 2009 11:06:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLB6gRQ025945; Mon, 21 Dec 2009 11:06:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912211106.nBLB6gRQ025945@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 21 Dec 2009 11:06:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200768 - stable/8/sys/compat/linux X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 11:06:42 -0000 Author: kib Date: Mon Dec 21 11:06:41 2009 New Revision: 200768 URL: http://svn.freebsd.org/changeset/base/200768 Log: MFC r200667: Return earlier from linux_do_tkill() when supplied signal number is 0. Modified: stable/8/sys/compat/linux/linux_signal.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/compat/linux/linux_signal.c ============================================================================== --- stable/8/sys/compat/linux/linux_signal.c Mon Dec 21 10:01:03 2009 (r200767) +++ stable/8/sys/compat/linux/linux_signal.c Mon Dec 21 11:06:41 2009 (r200768) @@ -565,7 +565,7 @@ linux_do_tkill(struct thread *td, l_int AUDIT_ARG_PROCESS(p); error = p_cansignal(td, p, signum); - if (error) + if (error != 0 || signum == 0) goto out; error = ESRCH; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 13:53:36 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81973106566B; Mon, 21 Dec 2009 13:53:36 +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 56C668FC15; Mon, 21 Dec 2009 13:53:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLDraDO029600; Mon, 21 Dec 2009 13:53:36 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLDrZ8x029599; Mon, 21 Dec 2009 13:53:35 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912211353.nBLDrZ8x029599@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 21 Dec 2009 13:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200772 - in stable: 7/sys/dev/ipmi 8/sys/dev/ipmi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 13:53:36 -0000 Author: ru Date: Mon Dec 21 13:53:33 2009 New Revision: 200772 URL: http://svn.freebsd.org/changeset/base/200772 Log: MFC r200666: Fixed incorrect watchdog timeout setting. PR: kern/130512 Modified: stable/8/sys/dev/ipmi/ipmi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/dev/ipmi/ipmi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/8/sys/dev/ipmi/ipmi.c Mon Dec 21 12:32:13 2009 (r200771) +++ stable/8/sys/dev/ipmi/ipmi.c Mon Dec 21 13:53:33 2009 (r200772) @@ -588,12 +588,15 @@ ipmi_polled_enqueue_request(struct ipmi_ * Watchdog event handler. */ -static void -ipmi_set_watchdog(struct ipmi_softc *sc, int sec) +static int +ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) { struct ipmi_request *req; int error; + if (sec > 0xffff / 10) + return (EINVAL); + req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_SET_WDOG, 6, 0); @@ -604,7 +607,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, req->ir_request[2] = 0; req->ir_request[3] = 0; /* Timer use */ req->ir_request[4] = (sec * 10) & 0xff; - req->ir_request[5] = (sec * 10) / 2550; + req->ir_request[5] = (sec * 10) >> 8; } else { req->ir_request[0] = IPMI_SET_WD_TIMER_SMS_OS; req->ir_request[1] = 0; @@ -617,8 +620,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, error = ipmi_submit_driver_request(sc, req, 0); if (error) device_printf(sc->ipmi_dev, "Failed to set watchdog\n"); - - if (error == 0 && sec) { + else if (sec) { ipmi_free_request(req); req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), @@ -631,6 +633,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, } ipmi_free_request(req); + return (error); /* dump_watchdog(sc); */ @@ -641,14 +644,22 @@ ipmi_wd_event(void *arg, unsigned int cm { struct ipmi_softc *sc = arg; unsigned int timeout; + int e; cmd &= WD_INTERVAL; if (cmd > 0 && cmd <= 63) { - timeout = ((uint64_t)1 << cmd) / 1800000000; - ipmi_set_watchdog(sc, timeout); - *error = 0; + timeout = ((uint64_t)1 << cmd) / 1000000000; + if (timeout == 0) + timeout = 1; + e = ipmi_set_watchdog(sc, timeout); + if (e == 0) + *error = 0; + else + (void)ipmi_set_watchdog(sc, 0); } else { - ipmi_set_watchdog(sc, 0); + e = ipmi_set_watchdog(sc, 0); + if (e != 0 && cmd == 0) + *error = EOPNOTSUPP; } } From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 13:53:36 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4BD91065670; Mon, 21 Dec 2009 13:53:36 +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 99FEF8FC18; Mon, 21 Dec 2009 13:53:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLDrajX029606; Mon, 21 Dec 2009 13:53:36 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLDranv029604; Mon, 21 Dec 2009 13:53:36 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <200912211353.nBLDranv029604@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 21 Dec 2009 13:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200772 - in stable: 7/sys/dev/ipmi 8/sys/dev/ipmi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 13:53:36 -0000 Author: ru Date: Mon Dec 21 13:53:33 2009 New Revision: 200772 URL: http://svn.freebsd.org/changeset/base/200772 Log: MFC r200666: Fixed incorrect watchdog timeout setting. PR: kern/130512 Modified: stable/7/sys/dev/ipmi/ipmi.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/ipmi/ipmi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/7/sys/dev/ipmi/ipmi.c ============================================================================== --- stable/7/sys/dev/ipmi/ipmi.c Mon Dec 21 12:32:13 2009 (r200771) +++ stable/7/sys/dev/ipmi/ipmi.c Mon Dec 21 13:53:33 2009 (r200772) @@ -588,12 +588,15 @@ ipmi_polled_enqueue_request(struct ipmi_ * Watchdog event handler. */ -static void -ipmi_set_watchdog(struct ipmi_softc *sc, int sec) +static int +ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) { struct ipmi_request *req; int error; + if (sec > 0xffff / 10) + return (EINVAL); + req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_SET_WDOG, 6, 0); @@ -604,7 +607,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, req->ir_request[2] = 0; req->ir_request[3] = 0; /* Timer use */ req->ir_request[4] = (sec * 10) & 0xff; - req->ir_request[5] = (sec * 10) / 2550; + req->ir_request[5] = (sec * 10) >> 8; } else { req->ir_request[0] = IPMI_SET_WD_TIMER_SMS_OS; req->ir_request[1] = 0; @@ -617,8 +620,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, error = ipmi_submit_driver_request(sc, req, 0); if (error) device_printf(sc->ipmi_dev, "Failed to set watchdog\n"); - - if (error == 0 && sec) { + else if (sec) { ipmi_free_request(req); req = ipmi_alloc_driver_request(IPMI_ADDR(IPMI_APP_REQUEST, 0), @@ -631,6 +633,7 @@ ipmi_set_watchdog(struct ipmi_softc *sc, } ipmi_free_request(req); + return (error); /* dump_watchdog(sc); */ @@ -641,14 +644,22 @@ ipmi_wd_event(void *arg, unsigned int cm { struct ipmi_softc *sc = arg; unsigned int timeout; + int e; cmd &= WD_INTERVAL; if (cmd > 0 && cmd <= 63) { - timeout = ((uint64_t)1 << cmd) / 1800000000; - ipmi_set_watchdog(sc, timeout); - *error = 0; + timeout = ((uint64_t)1 << cmd) / 1000000000; + if (timeout == 0) + timeout = 1; + e = ipmi_set_watchdog(sc, timeout); + if (e == 0) + *error = 0; + else + (void)ipmi_set_watchdog(sc, 0); } else { - ipmi_set_watchdog(sc, 0); + e = ipmi_set_watchdog(sc, 0); + if (e != 0 && cmd == 0) + *error = EOPNOTSUPP; } } From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 14:03:41 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3694C1065670; Mon, 21 Dec 2009 14:03: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 246388FC12; Mon, 21 Dec 2009 14:03:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLE3eAW029948; Mon, 21 Dec 2009 14:03:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLE3eWT029946; Mon, 21 Dec 2009 14:03:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <200912211403.nBLE3eWT029946@svn.freebsd.org> From: Andriy Gapon Date: Mon, 21 Dec 2009 14:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200773 - in stable/7/sys: conf i386/cpufreq modules/cpufreq X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 14:03:41 -0000 Author: avg Date: Mon Dec 21 14:03:40 2009 New Revision: 200773 URL: http://svn.freebsd.org/changeset/base/200773 Log: MFC r190501,190521,192029: Add support for Phenom (Family 10h) to cpufreq. This also has changes from r197070 (earlier partial MFC). Added: stable/7/sys/i386/cpufreq/hwpstate.c - copied, changed from r190501, head/sys/i386/cpufreq/hwpstate.c Modified: stable/7/sys/conf/files.amd64 stable/7/sys/conf/files.i386 stable/7/sys/modules/cpufreq/Makefile Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/files.amd64 ============================================================================== --- stable/7/sys/conf/files.amd64 Mon Dec 21 13:53:33 2009 (r200772) +++ stable/7/sys/conf/files.amd64 Mon Dec 21 14:03:40 2009 (r200773) @@ -272,6 +272,7 @@ i386/bios/smbios.c optional smbios i386/bios/vpd.c optional vpd i386/cpufreq/powernow.c optional cpufreq i386/cpufreq/est.c optional cpufreq +i386/cpufreq/hwpstate.c optional cpufreq i386/cpufreq/p4tcc.c optional cpufreq # libkern/memset.c standard Modified: stable/7/sys/conf/files.i386 ============================================================================== --- stable/7/sys/conf/files.i386 Mon Dec 21 13:53:33 2009 (r200772) +++ stable/7/sys/conf/files.i386 Mon Dec 21 14:03:40 2009 (r200773) @@ -251,6 +251,7 @@ i386/bios/smapi_bios.S optional smapi i386/bios/smbios.c optional smbios i386/bios/vpd.c optional vpd i386/cpufreq/est.c optional cpufreq +i386/cpufreq/hwpstate.c optional cpufreq i386/cpufreq/p4tcc.c optional cpufreq i386/cpufreq/powernow.c optional cpufreq i386/cpufreq/smist.c optional cpufreq Copied and modified: stable/7/sys/i386/cpufreq/hwpstate.c (from r190501, head/sys/i386/cpufreq/hwpstate.c) ============================================================================== --- head/sys/i386/cpufreq/hwpstate.c Sat Mar 28 08:54:47 2009 (r190501, copy source) +++ stable/7/sys/i386/cpufreq/hwpstate.c Mon Dec 21 14:03:40 2009 (r200773) @@ -8,7 +8,7 @@ * Copyright (c) 2008-2009 Gen Otsuji * * This code is depending on kern_cpu.c, est.c, powernow.c, p4tcc.c, smist.c - * in various parts. The authors of these files are + * in various parts. The authors of these files are Nate Lawson, * Colin Percival, Bruno Durcot, and FUKUDA Nobuhiko. * This code contains patches by Michael Reifenberger and Norikatsu Shigemura. * Thank you. @@ -82,12 +82,6 @@ __FBSDID("$FreeBSD$"); #define AMD_10H_11H_CUR_DID(msr) (((msr) >> 6) & 0x07) #define AMD_10H_11H_CUR_FID(msr) ((msr) & 0x3F) -#if defined(__amd64__) -#define CPU_FAMILY(id) AMD64_CPU_FAMILY(id) -#elif defined(__i386__) -#define CPU_FAMILY(id) I386_CPU_FAMILY(id) -#endif - #define HWPSTATE_DEBUG(dev, msg...) \ do{ \ if(hwpstate_verbose) \ @@ -161,7 +155,6 @@ DRIVER_MODULE(hwpstate, cpu, hwpstate_dr static int hwpstate_goto_pstate(device_t dev, int pstate) { - struct hwpstate_softc *sc; struct pcpu *pc; int i; uint64_t msr; @@ -170,7 +163,6 @@ hwpstate_goto_pstate(device_t dev, int p int id = pstate; int error; - sc = device_get_softc(dev); /* get the current pstate limit */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); limit = AMD_10H_11H_GET_PSTATE_LIMIT(msr); @@ -299,12 +291,11 @@ hwpstate_type(device_t dev, int *type) static void hwpstate_identify(driver_t *driver, device_t parent) { - device_t child; if (device_find_child(parent, "hwpstate", -1) != NULL) return; - if (cpu_vendor_id != CPU_VENDOR_AMD || CPU_FAMILY(cpu_id) < 0x10) + if (cpu_vendor_id != CPU_VENDOR_AMD || CPUID_TO_FAMILY(cpu_id) < 0x10) return; /* @@ -318,7 +309,7 @@ hwpstate_identify(driver_t *driver, devi if (resource_disabled("hwpstate", 0)) return; - if ((child = BUS_ADD_CHILD(parent, 10, "hwpstate", -1)) == NULL) + if (BUS_ADD_CHILD(parent, 10, "hwpstate", -1) == NULL) device_printf(parent, "hwpstate: add child failed\n"); } @@ -407,7 +398,7 @@ hwpstate_get_info_from_msr(device_t dev) uint64_t msr; int family, i, fid, did; - family = CPU_FAMILY(cpu_id); + family = CPUID_TO_FAMILY(cpu_id); sc = device_get_softc(dev); /* Get pstate count */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); Modified: stable/7/sys/modules/cpufreq/Makefile ============================================================================== --- stable/7/sys/modules/cpufreq/Makefile Mon Dec 21 13:53:33 2009 (r200772) +++ stable/7/sys/modules/cpufreq/Makefile Mon Dec 21 14:03:40 2009 (r200773) @@ -12,7 +12,7 @@ SRCS+= bus_if.h cpufreq_if.h device_if.h CFLAGS+= -I${.CURDIR}/../../contrib/dev/acpica SRCS+= acpi_if.h opt_acpi.h -SRCS+= est.c p4tcc.c powernow.c +SRCS+= est.c hwpstate.c p4tcc.c powernow.c .endif .if ${MACHINE} == "i386" From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:07:16 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E67C106566B; Mon, 21 Dec 2009 18:07:16 +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 EF65F8FC2A; Mon, 21 Dec 2009 18:07:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLI7F3Q035594; Mon, 21 Dec 2009 18:07:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLI7FI7035590; Mon, 21 Dec 2009 18:07:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211807.nBLI7FI7035590@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200783 - stable/8/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:07:16 -0000 Author: yongari Date: Mon Dec 21 18:07:15 2009 New Revision: 200783 URL: http://svn.freebsd.org/changeset/base/200783 Log: MFC r199548: Remove complex macros that were used to compute bits values. Although these macros may have its own strength, its complex definition make hard to read the code. Approved by: delphij Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etreg.h stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Mon Dec 21 17:55:10 2009 (r200782) +++ stable/8/sys/dev/et/if_et.c Mon Dec 21 18:07:15 2009 (r200783) @@ -404,8 +404,8 @@ et_miibus_readreg(device_t dev, int phy, /* Stop any pending operations */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - val = __SHIFTIN(phy, ET_MII_ADDR_PHY) | - __SHIFTIN(reg, ET_MII_ADDR_REG); + val = (phy << ET_MII_ADDR_PHY_SHIFT) & ET_MII_ADDR_PHY_MASK; + val |= (reg << ET_MII_ADDR_REG_SHIFT) & ET_MII_ADDR_REG_MASK; CSR_WRITE_4(sc, ET_MII_ADDR, val); /* Start reading */ @@ -429,7 +429,7 @@ et_miibus_readreg(device_t dev, int phy, #undef NRETRY val = CSR_READ_4(sc, ET_MII_STAT); - ret = __SHIFTOUT(val, ET_MII_STAT_VALUE); + ret = val & ET_MII_STAT_VALUE_MASK; back: /* Make sure that the current operation is stopped */ @@ -447,12 +447,13 @@ et_miibus_writereg(device_t dev, int phy /* Stop any pending operations */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - val = __SHIFTIN(phy, ET_MII_ADDR_PHY) | - __SHIFTIN(reg, ET_MII_ADDR_REG); + val = (phy << ET_MII_ADDR_PHY_SHIFT) & ET_MII_ADDR_PHY_MASK; + val |= (reg << ET_MII_ADDR_REG_SHIFT) & ET_MII_ADDR_REG_MASK; CSR_WRITE_4(sc, ET_MII_ADDR, val); /* Start writing */ - CSR_WRITE_4(sc, ET_MII_CTRL, __SHIFTIN(val0, ET_MII_CTRL_VALUE)); + CSR_WRITE_4(sc, ET_MII_CTRL, + (val0 << ET_MII_CTRL_VALUE_SHIFT) & ET_MII_CTRL_VALUE_MASK); #define NRETRY 100 @@ -601,8 +602,13 @@ et_bus_config(device_t dev) /* * Set L0s and L1 latency timer to 2us */ - val = ET_PCIV_L0S_LATENCY(2) | ET_PCIV_L1_LATENCY(2); - pci_write_config(dev, ET_PCIR_L0S_L1_LATENCY, val, 1); + val = pci_read_config(dev, ET_PCIR_L0S_L1_LATENCY, 4); + val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); + /* L0s exit latency : 2us */ + val |= 0x00005000; + /* L1 exit latency : 2us */ + val |= 0x00028000; + pci_write_config(dev, ET_PCIR_L0S_L1_LATENCY, val, 4); /* * Set max read request size to 2048 bytes @@ -1021,10 +1027,10 @@ et_chip_attach(struct et_softc *sc) /* * Setup half duplex mode */ - val = __SHIFTIN(10, ET_MAC_HDX_ALT_BEB_TRUNC) | - __SHIFTIN(15, ET_MAC_HDX_REXMIT_MAX) | - __SHIFTIN(55, ET_MAC_HDX_COLLWIN) | - ET_MAC_HDX_EXC_DEFER; + val = (10 << ET_MAC_HDX_ALT_BEB_TRUNC_SHIFT) | + (15 << ET_MAC_HDX_REXMIT_MAX_SHIFT) | + (55 << ET_MAC_HDX_COLLWIN_SHIFT) | + ET_MAC_HDX_EXC_DEFER; CSR_WRITE_4(sc, ET_MAC_HDX, val); /* Clear MAC control */ @@ -1655,19 +1661,19 @@ et_init_mac(struct et_softc *sc) /* * Setup inter packet gap */ - val = __SHIFTIN(56, ET_IPG_NONB2B_1) | - __SHIFTIN(88, ET_IPG_NONB2B_2) | - __SHIFTIN(80, ET_IPG_MINIFG) | - __SHIFTIN(96, ET_IPG_B2B); + val = (56 << ET_IPG_NONB2B_1_SHIFT) | + (88 << ET_IPG_NONB2B_2_SHIFT) | + (80 << ET_IPG_MINIFG_SHIFT) | + (96 << ET_IPG_B2B_SHIFT); CSR_WRITE_4(sc, ET_IPG, val); /* * Setup half duplex mode */ - val = __SHIFTIN(10, ET_MAC_HDX_ALT_BEB_TRUNC) | - __SHIFTIN(15, ET_MAC_HDX_REXMIT_MAX) | - __SHIFTIN(55, ET_MAC_HDX_COLLWIN) | - ET_MAC_HDX_EXC_DEFER; + val = (10 << ET_MAC_HDX_ALT_BEB_TRUNC_SHIFT) | + (15 << ET_MAC_HDX_REXMIT_MAX_SHIFT) | + (55 << ET_MAC_HDX_COLLWIN_SHIFT) | + ET_MAC_HDX_EXC_DEFER; CSR_WRITE_4(sc, ET_MAC_HDX, val); /* Clear MAC control */ @@ -1738,7 +1744,7 @@ et_init_rxmac(struct et_softc *sc) * since this is the size of the PCI-Express TLP's * that the ET1310 uses. */ - val = __SHIFTIN(ET_RXMAC_SEGSZ(256), ET_RXMAC_MC_SEGSZ_MAX) | + val = (ET_RXMAC_SEGSZ(256) & ET_RXMAC_MC_SEGSZ_MAX_MASK) | ET_RXMAC_MC_SEGSZ_ENABLE; } else { val = 0; @@ -1761,7 +1767,9 @@ et_init_rxmac(struct et_softc *sc) /* * Configure runt filtering (may not work on certain chip generation) */ - val = __SHIFTIN(ETHER_MIN_LEN, ET_PKTFILT_MINLEN) | ET_PKTFILT_FRAG; + val = (ETHER_MIN_LEN << ET_PKTFILT_MINLEN_SHIFT) & + ET_PKTFILT_MINLEN_MASK; + val |= ET_PKTFILT_FRAG; CSR_WRITE_4(sc, ET_PKTFILT, val); /* Enable RX MAC but leave WOL disabled */ @@ -1793,11 +1801,9 @@ et_start_rxdma(struct et_softc *sc) { uint32_t val = 0; - val |= __SHIFTIN(sc->sc_rx_data[0].rbd_bufsize, - ET_RXDMA_CTRL_RING0_SIZE) | + val |= (sc->sc_rx_data[0].rbd_bufsize & ET_RXDMA_CTRL_RING0_SIZE_MASK) | ET_RXDMA_CTRL_RING0_ENABLE; - val |= __SHIFTIN(sc->sc_rx_data[1].rbd_bufsize, - ET_RXDMA_CTRL_RING1_SIZE) | + val |= (sc->sc_rx_data[1].rbd_bufsize & ET_RXDMA_CTRL_RING1_SIZE_MASK) | ET_RXDMA_CTRL_RING1_ENABLE; CSR_WRITE_4(sc, ET_RXDMA_CTRL, val); @@ -1892,7 +1898,8 @@ et_rxeof(struct et_softc *sc) rxs_stat_ring = rxsd->rxsd_status->rxs_stat_ring; rxst_wrap = (rxs_stat_ring & ET_RXS_STATRING_WRAP) ? 1 : 0; - rxst_index = __SHIFTOUT(rxs_stat_ring, ET_RXS_STATRING_INDEX); + rxst_index = (rxs_stat_ring & ET_RXS_STATRING_INDEX_MASK) >> + ET_RXS_STATRING_INDEX_SHIFT; while (rxst_index != rxst_ring->rsr_index || rxst_wrap != rxst_ring->rsr_wrap) { @@ -1906,16 +1913,18 @@ et_rxeof(struct et_softc *sc) MPASS(rxst_ring->rsr_index < ET_RX_NSTAT); st = &rxst_ring->rsr_stat[rxst_ring->rsr_index]; - buflen = __SHIFTOUT(st->rxst_info2, ET_RXST_INFO2_LEN); - buf_idx = __SHIFTOUT(st->rxst_info2, ET_RXST_INFO2_BUFIDX); - ring_idx = __SHIFTOUT(st->rxst_info2, ET_RXST_INFO2_RINGIDX); + buflen = (st->rxst_info2 & ET_RXST_INFO2_LEN_MASK) >> + ET_RXST_INFO2_LEN_SHIFT; + buf_idx = (st->rxst_info2 & ET_RXST_INFO2_BUFIDX_MASK) >> + ET_RXST_INFO2_BUFIDX_SHIFT; + ring_idx = (st->rxst_info2 & ET_RXST_INFO2_RINGIDX_MASK) >> + ET_RXST_INFO2_RINGIDX_SHIFT; if (++rxst_ring->rsr_index == ET_RX_NSTAT) { rxst_ring->rsr_index = 0; rxst_ring->rsr_wrap ^= 1; } - rxstat_pos = __SHIFTIN(rxst_ring->rsr_index, - ET_RXSTAT_POS_INDEX); + rxstat_pos = rxst_ring->rsr_index & ET_RXSTAT_POS_INDEX_MASK; if (rxst_ring->rsr_wrap) rxstat_pos |= ET_RXSTAT_POS_WRAP; CSR_WRITE_4(sc, ET_RXSTAT_POS, rxstat_pos); @@ -1968,7 +1977,7 @@ et_rxeof(struct et_softc *sc) rx_ring->rr_index = 0; rx_ring->rr_wrap ^= 1; } - rxring_pos = __SHIFTIN(rx_ring->rr_index, ET_RX_RING_POS_INDEX); + rxring_pos = rx_ring->rr_index & ET_RX_RING_POS_INDEX_MASK; if (rx_ring->rr_wrap) rxring_pos |= ET_RX_RING_POS_WRAP; CSR_WRITE_4(sc, rx_ring->rr_posreg, rxring_pos); @@ -2056,7 +2065,7 @@ et_encap(struct et_softc *sc, struct mbu td = &tx_ring->tr_desc[idx]; td->td_addr_hi = ET_ADDR_HI(segs[i].ds_addr); td->td_addr_lo = ET_ADDR_LO(segs[i].ds_addr); - td->td_ctrl1 = __SHIFTIN(segs[i].ds_len, ET_TDCTRL1_LEN); + td->td_ctrl1 = segs[i].ds_len & ET_TDCTRL1_LEN_MASK; if (i == ctx.nsegs - 1) { /* Last frag */ td->td_ctrl2 = last_td_ctrl2; @@ -2083,8 +2092,7 @@ et_encap(struct et_softc *sc, struct mbu bus_dmamap_sync(tx_ring->tr_dtag, tx_ring->tr_dmap, BUS_DMASYNC_PREWRITE); - tx_ready_pos = __SHIFTIN(tx_ring->tr_ready_index, - ET_TX_READY_POS_INDEX); + tx_ready_pos = tx_ring->tr_ready_index & ET_TX_READY_POS_INDEX_MASK; if (tx_ring->tr_ready_wrap) tx_ready_pos |= ET_TX_READY_POS_WRAP; CSR_WRITE_4(sc, ET_TX_READY_POS, tx_ready_pos); @@ -2119,7 +2127,7 @@ et_txeof(struct et_softc *sc) return; tx_done = CSR_READ_4(sc, ET_TX_DONE_POS); - end = __SHIFTOUT(tx_done, ET_TX_DONE_POS_INDEX); + end = tx_done & ET_TX_DONE_POS_INDEX_MASK; wrap = (tx_done & ET_TX_DONE_POS_WRAP) ? 1 : 0; while (tbd->tbd_start_index != end || tbd->tbd_start_wrap != wrap) { @@ -2352,7 +2360,8 @@ et_setmedia(struct et_softc *sc) cfg2 &= ~(ET_MAC_CFG2_MODE_MII | ET_MAC_CFG2_MODE_GMII | ET_MAC_CFG2_FDX | ET_MAC_CFG2_BIGFRM); cfg2 |= ET_MAC_CFG2_LENCHK | ET_MAC_CFG2_CRC | ET_MAC_CFG2_PADCRC | - __SHIFTIN(7, ET_MAC_CFG2_PREAMBLE_LEN); + ((7 << ET_MAC_CFG2_PREAMBLE_LEN_SHIFT) & + ET_MAC_CFG2_PREAMBLE_LEN_MASK); ctrl = CSR_READ_4(sc, ET_MAC_CTRL); ctrl &= ~(ET_MAC_CTRL_GHDX | ET_MAC_CTRL_MODE_MII); @@ -2384,7 +2393,7 @@ et_setup_rxdesc(struct et_rxbuf_data *rb desc->rd_addr_hi = ET_ADDR_HI(paddr); desc->rd_addr_lo = ET_ADDR_LO(paddr); - desc->rd_ctrl = __SHIFTIN(buf_idx, ET_RDCTRL_BUFIDX); + desc->rd_ctrl = buf_idx & ET_RDCTRL_BUFIDX_MASK; bus_dmamap_sync(rx_ring->rr_dtag, rx_ring->rr_dmap, BUS_DMASYNC_PREWRITE); Modified: stable/8/sys/dev/et/if_etreg.h ============================================================================== --- stable/8/sys/dev/et/if_etreg.h Mon Dec 21 17:55:10 2009 (r200782) +++ stable/8/sys/dev/et/if_etreg.h Mon Dec 21 18:07:15 2009 (r200783) @@ -73,50 +73,6 @@ #ifndef _IF_ETREG_H #define _IF_ETREG_H -/* - * __BIT(n): Return a bitmask with bit n set, where the least - * significant bit is bit 0. - * - * __BITS(m, n): Return a bitmask with bits m through n, inclusive, - * set. It does not matter whether m>n or m<=n. The - * least significant bit is bit 0. - * - * A "bitfield" is a span of consecutive bits defined by a bitmask, - * where 1s select the bits in the bitfield. __SHIFTIN, __SHIFTOUT, - * and __SHIFTOUT_MASK help read and write bitfields from device - * registers. - * - * __SHIFTIN(v, mask): Left-shift bits `v' into the bitfield - * defined by `mask', and return them. No - * side-effects. - * - * __SHIFTOUT(v, mask): Extract and return the bitfield selected - * by `mask' from `v', right-shifting the - * bits so that the rightmost selected bit - * is at bit 0. No side-effects. - * - * __SHIFTOUT_MASK(mask): Right-shift the bits in `mask' so that - * the rightmost non-zero bit is at bit - * 0. This is useful for finding the - * greatest unsigned value that a bitfield - * can hold. No side-effects. Note that - * __SHIFTOUT_MASK(m) = __SHIFTOUT(m, m). - */ - -/* __BIT(n): nth bit, where __BIT(0) == 0x1. */ -#define __BIT(__n) (((__n) == 32) ? 0 : ((uint32_t)1 << (__n))) - -/* __BITS(m, n): bits m through n, m < n. */ -#define __BITS(__m, __n) \ - ((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1)) - -/* Find least significant bit that is set */ -#define __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask)) - -#define __SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask)) -#define __SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask)) -#define __SHIFTOUT_MASK(__mask) __SHIFTOUT((__mask), (__mask)) - #define ET_MEM_TXSIZE_EX 182 #define ET_MEM_RXSIZE_MIN 608 #define ET_MEM_RXSIZE_DEFAULT 11216 @@ -159,10 +115,6 @@ #define ET_PCIV_REPLAY_TIMER_256 (1248 + ET_REPLAY_TIMER_RX_L0S_ADJ) #define ET_PCIR_L0S_L1_LATENCY 0xcf -#define ET_PCIM_L0S_LATENCY __BITS(2, 0) -#define ET_PCIM_L1_LATENCY __BITS(5, 3) -#define ET_PCIV_L0S_LATENCY(l) __SHIFTIN((l) - 1, ET_PCIM_L0S_LATENCY) -#define ET_PCIV_L1_LATENCY(l) __SHIFTIN((l) - 1, ET_PCIM_L1_LATENCY) /* * CSR @@ -176,22 +128,22 @@ #define ET_QUEUE_ADDR_END ET_QUEUE_ADDR(ET_MEM_SIZE) #define ET_PM 0x0010 -#define ET_PM_SYSCLK_GATE __BIT(3) -#define ET_PM_TXCLK_GATE __BIT(4) -#define ET_PM_RXCLK_GATE __BIT(5) +#define ET_PM_SYSCLK_GATE 0x00000008 +#define ET_PM_TXCLK_GATE 0x00000010 +#define ET_PM_RXCLK_GATE 0x00000020 #define ET_INTR_STATUS 0x0018 #define ET_INTR_MASK 0x001c #define ET_SWRST 0x0028 -#define ET_SWRST_TXDMA __BIT(0) -#define ET_SWRST_RXDMA __BIT(1) -#define ET_SWRST_TXMAC __BIT(2) -#define ET_SWRST_RXMAC __BIT(3) -#define ET_SWRST_MAC __BIT(4) -#define ET_SWRST_MAC_STAT __BIT(5) -#define ET_SWRST_MMC __BIT(6) -#define ET_SWRST_SELFCLR_DISABLE __BIT(31) +#define ET_SWRST_TXDMA 0x00000001 +#define ET_SWRST_RXDMA 0x00000002 +#define ET_SWRST_TXMAC 0x00000004 +#define ET_SWRST_RXMAC 0x00000008 +#define ET_SWRST_MAC 0x00000010 +#define ET_SWRST_MAC_STAT 0x00000020 +#define ET_SWRST_MMC 0x00000040 +#define ET_SWRST_SELFCLR_DISABLE 0x80000000 #define ET_MSI_CFG 0x0030 @@ -200,9 +152,9 @@ #define ET_TIMER 0x0038 #define ET_TXDMA_CTRL 0x1000 -#define ET_TXDMA_CTRL_HALT __BIT(0) -#define ET_TXDMA_CTRL_CACHE_THR __BITS(7, 4) -#define ET_TXDMA_CTRL_SINGLE_EPKT __BIT(8) /* ??? */ +#define ET_TXDMA_CTRL_HALT 0x00000001 +#define ET_TXDMA_CTRL_CACHE_THR_MASK 0x000000F0 +#define ET_TXDMA_CTRL_SINGLE_EPKT 0x00000100 /* ??? */ #define ET_TX_RING_HI 0x1004 #define ET_TX_RING_LO 0x1008 @@ -212,28 +164,28 @@ #define ET_TX_STATUS_LO 0x1020 #define ET_TX_READY_POS 0x1024 -#define ET_TX_READY_POS_INDEX __BITS(9, 0) -#define ET_TX_READY_POS_WRAP __BIT(10) +#define ET_TX_READY_POS_INDEX_MASK 0x000003FF +#define ET_TX_READY_POS_WRAP 0x00000400 #define ET_TX_DONE_POS 0x1060 -#define ET_TX_DONE_POS_INDEX __BITS(9, 0) -#define ET_TX_DONE_POS_WRAP __BIT(10) +#define ET_TX_DONE_POS_INDEX_MASK 0x0000003FF +#define ET_TX_DONE_POS_WRAP 0x000000400 #define ET_RXDMA_CTRL 0x2000 -#define ET_RXDMA_CTRL_HALT __BIT(0) -#define ET_RXDMA_CTRL_RING0_SIZE __BITS(9, 8) -#define ET_RXDMA_CTRL_RING0_128 0 /* 127 */ -#define ET_RXDMA_CTRL_RING0_256 1 /* 255 */ -#define ET_RXDMA_CTRL_RING0_512 2 /* 511 */ -#define ET_RXDMA_CTRL_RING0_1024 3 /* 1023 */ -#define ET_RXDMA_CTRL_RING0_ENABLE __BIT(10) -#define ET_RXDMA_CTRL_RING1_SIZE __BITS(12, 11) -#define ET_RXDMA_CTRL_RING1_2048 0 /* 2047 */ -#define ET_RXDMA_CTRL_RING1_4096 1 /* 4095 */ -#define ET_RXDMA_CTRL_RING1_8192 2 /* 8191 */ -#define ET_RXDMA_CTRL_RING1_16384 3 /* 16383 (9022?) */ -#define ET_RXDMA_CTRL_RING1_ENABLE __BIT(13) -#define ET_RXDMA_CTRL_HALTED __BIT(17) +#define ET_RXDMA_CTRL_HALT 0x00000001 +#define ET_RXDMA_CTRL_RING0_SIZE_MASK 0x00000300 +#define ET_RXDMA_CTRL_RING0_128 0x00000000 /* 127 */ +#define ET_RXDMA_CTRL_RING0_256 0x00000100 /* 255 */ +#define ET_RXDMA_CTRL_RING0_512 0x00000200 /* 511 */ +#define ET_RXDMA_CTRL_RING0_1024 0x00000300 /* 1023 */ +#define ET_RXDMA_CTRL_RING0_ENABLE 0x00000400 +#define ET_RXDMA_CTRL_RING1_SIZE_MASK 0x00001800 +#define ET_RXDMA_CTRL_RING1_2048 0x00000000 /* 2047 */ +#define ET_RXDMA_CTRL_RING1_4096 0x00000800 /* 4095 */ +#define ET_RXDMA_CTRL_RING1_8192 0x00001000 /* 8191 */ +#define ET_RXDMA_CTRL_RING1_16384 0x00001800 /* 16383 (9022?) */ +#define ET_RXDMA_CTRL_RING1_ENABLE 0x00002000 +#define ET_RXDMA_CTRL_HALTED 0x00020000 #define ET_RX_STATUS_LO 0x2004 #define ET_RX_STATUS_HI 0x2008 @@ -246,8 +198,8 @@ #define ET_RXSTAT_CNT 0x2028 #define ET_RXSTAT_POS 0x2030 -#define ET_RXSTAT_POS_INDEX __BITS(11, 0) -#define ET_RXSTAT_POS_WRAP __BIT(12) +#define ET_RXSTAT_POS_INDEX_MASK 0x00000FFF +#define ET_RXSTAT_POS_WRAP 0x00001000 #define ET_RXSTAT_MINCNT 0x2038 @@ -256,8 +208,8 @@ #define ET_RX_RING0_CNT 0x2044 #define ET_RX_RING0_POS 0x204c -#define ET_RX_RING0_POS_INDEX __BITS(9, 0) -#define ET_RX_RING0_POS_WRAP __BIT(10) +#define ET_RX_RING0_POS_INDEX_MASK 0x000003FF +#define ET_RX_RING0_POS_WRAP 0x00000400 #define ET_RX_RING0_MINCNT 0x2054 @@ -266,21 +218,21 @@ #define ET_RX_RING1_CNT 0x2060 #define ET_RX_RING1_POS 0x2068 -#define ET_RX_RING1_POS_INDEX __BITS(9, 0) -#define ET_RX_RING1_POS_WRAP __BIT(10) +#define ET_RX_RING1_POS_INDEX 0x000003FF +#define ET_RX_RING1_POS_WRAP 0x00000400 #define ET_RX_RING1_MINCNT 0x2070 #define ET_TXMAC_CTRL 0x3000 -#define ET_TXMAC_CTRL_ENABLE __BIT(0) -#define ET_TXMAC_CTRL_FC_DISABLE __BIT(3) +#define ET_TXMAC_CTRL_ENABLE 0x00000001 +#define ET_TXMAC_CTRL_FC_DISABLE 0x00000008 #define ET_TXMAC_FLOWCTRL 0x3010 #define ET_RXMAC_CTRL 0x4000 -#define ET_RXMAC_CTRL_ENABLE __BIT(0) -#define ET_RXMAC_CTRL_NO_PKTFILT __BIT(2) -#define ET_RXMAC_CTRL_WOL_DISABLE __BIT(3) +#define ET_RXMAC_CTRL_ENABLE 0x00000001 +#define ET_RXMAC_CTRL_NO_PKTFILT 0x00000004 +#define ET_RXMAC_CTRL_WOL_DISABLE 0x00000008 #define ET_WOL_CRC 0x4004 #define ET_WOL_SA_LO 0x4010 @@ -294,16 +246,17 @@ #define ET_MULTI_HASH 0x4074 #define ET_PKTFILT 0x4084 -#define ET_PKTFILT_BCAST __BIT(0) -#define ET_PKTFILT_MCAST __BIT(1) -#define ET_PKTFILT_UCAST __BIT(2) -#define ET_PKTFILT_FRAG __BIT(3) -#define ET_PKTFILT_MINLEN __BITS(22, 16) +#define ET_PKTFILT_BCAST 0x00000001 +#define ET_PKTFILT_MCAST 0x00000002 +#define ET_PKTFILT_UCAST 0x00000004 +#define ET_PKTFILT_FRAG 0x00000008 +#define ET_PKTFILT_MINLEN_MASK 0x007F0000 +#define ET_PKTFILT_MINLEN_SHIFT 16 #define ET_RXMAC_MC_SEGSZ 0x4088 -#define ET_RXMAC_MC_SEGSZ_ENABLE __BIT(0) -#define ET_RXMAC_MC_SEGSZ_FC __BIT(1) -#define ET_RXMAC_MC_SEGSZ_MAX __BITS(9, 2) +#define ET_RXMAC_MC_SEGSZ_ENABLE 0x00000001 +#define ET_RXMAC_MC_SEGSZ_FC 0x00000002 +#define ET_RXMAC_MC_SEGSZ_MAX_MASK 0x000003FC #define ET_RXMAC_SEGSZ(segsz) ((segsz) / ET_MEM_UNIT) #define ET_RXMAC_CUT_THRU_FRMLEN 8074 @@ -311,110 +264,121 @@ #define ET_RXMAC_SPACE_AVL 0x4094 #define ET_RXMAC_MGT 0x4098 -#define ET_RXMAC_MGT_PASS_ECRC __BIT(4) -#define ET_RXMAC_MGT_PASS_ELEN __BIT(5) -#define ET_RXMAC_MGT_PASS_ETRUNC __BIT(16) -#define ET_RXMAC_MGT_CHECK_PKT __BIT(17) +#define ET_RXMAC_MGT_PASS_ECRC 0x00000010 +#define ET_RXMAC_MGT_PASS_ELEN 0x00000020 +#define ET_RXMAC_MGT_PASS_ETRUNC 0x00010000 +#define ET_RXMAC_MGT_CHECK_PKT 0x00020000 #define ET_MAC_CFG1 0x5000 -#define ET_MAC_CFG1_TXEN __BIT(0) -#define ET_MAC_CFG1_SYNC_TXEN __BIT(1) -#define ET_MAC_CFG1_RXEN __BIT(2) -#define ET_MAC_CFG1_SYNC_RXEN __BIT(3) -#define ET_MAC_CFG1_TXFLOW __BIT(4) -#define ET_MAC_CFG1_RXFLOW __BIT(5) -#define ET_MAC_CFG1_LOOPBACK __BIT(8) -#define ET_MAC_CFG1_RST_TXFUNC __BIT(16) -#define ET_MAC_CFG1_RST_RXFUNC __BIT(17) -#define ET_MAC_CFG1_RST_TXMC __BIT(18) -#define ET_MAC_CFG1_RST_RXMC __BIT(19) -#define ET_MAC_CFG1_SIM_RST __BIT(30) -#define ET_MAC_CFG1_SOFT_RST __BIT(31) +#define ET_MAC_CFG1_TXEN 0x00000001 +#define ET_MAC_CFG1_SYNC_TXEN 0x00000002 +#define ET_MAC_CFG1_RXEN 0x00000004 +#define ET_MAC_CFG1_SYNC_RXEN 0x00000008 +#define ET_MAC_CFG1_TXFLOW 0x00000010 +#define ET_MAC_CFG1_RXFLOW 0x00000020 +#define ET_MAC_CFG1_LOOPBACK 0x00000100 +#define ET_MAC_CFG1_RST_TXFUNC 0x00010000 +#define ET_MAC_CFG1_RST_RXFUNC 0x00020000 +#define ET_MAC_CFG1_RST_TXMC 0x00040000 +#define ET_MAC_CFG1_RST_RXMC 0x00080000 +#define ET_MAC_CFG1_SIM_RST 0x40000000 +#define ET_MAC_CFG1_SOFT_RST 0x80000000 #define ET_MAC_CFG2 0x5004 -#define ET_MAC_CFG2_FDX __BIT(0) -#define ET_MAC_CFG2_CRC __BIT(1) -#define ET_MAC_CFG2_PADCRC __BIT(2) -#define ET_MAC_CFG2_LENCHK __BIT(4) -#define ET_MAC_CFG2_BIGFRM __BIT(5) -#define ET_MAC_CFG2_MODE_MII __BIT(8) -#define ET_MAC_CFG2_MODE_GMII __BIT(9) -#define ET_MAC_CFG2_PREAMBLE_LEN __BITS(15, 12) +#define ET_MAC_CFG2_FDX 0x00000001 +#define ET_MAC_CFG2_CRC 0x00000002 +#define ET_MAC_CFG2_PADCRC 0x00000004 +#define ET_MAC_CFG2_LENCHK 0x00000010 +#define ET_MAC_CFG2_BIGFRM 0x00000020 +#define ET_MAC_CFG2_MODE_MII 0x00000100 +#define ET_MAC_CFG2_MODE_GMII 0x00000200 +#define ET_MAC_CFG2_PREAMBLE_LEN_MASK 0x0000F000 +#define ET_MAC_CFG2_PREAMBLE_LEN_SHIFT 12 #define ET_IPG 0x5008 -#define ET_IPG_B2B __BITS(6, 0) -#define ET_IPG_MINIFG __BITS(15, 8) -#define ET_IPG_NONB2B_2 __BITS(22, 16) -#define ET_IPG_NONB2B_1 __BITS(30, 24) +#define ET_IPG_B2B_MASK 0x0000007F +#define ET_IPG_MINIFG_MASK 0x0000FF00 +#define ET_IPG_NONB2B_2_MASK 0x007F0000 +#define ET_IPG_NONB2B_1_MASK 0x7F000000 +#define ET_IPG_B2B_SHIFT 0 +#define ET_IPG_MINIFG_SHIFT 8 +#define ET_IPG_NONB2B_2_SHIFT 16 +#define ET_IPG_NONB2B_1_SHIFT 24 #define ET_MAC_HDX 0x500c -#define ET_MAC_HDX_COLLWIN __BITS(9, 0) -#define ET_MAC_HDX_REXMIT_MAX __BITS(15, 12) -#define ET_MAC_HDX_EXC_DEFER __BIT(16) -#define ET_MAC_HDX_NOBACKOFF __BIT(17) -#define ET_MAC_HDX_BP_NOBACKOFF __BIT(18) -#define ET_MAC_HDX_ALT_BEB __BIT(19) -#define ET_MAC_HDX_ALT_BEB_TRUNC __BITS(23, 20) +#define ET_MAC_HDX_COLLWIN_MASK 0x000003FF +#define ET_MAC_HDX_REXMIT_MAX_MASK 0x0000F000 +#define ET_MAC_HDX_EXC_DEFER 0x00010000 +#define ET_MAC_HDX_NOBACKOFF 0x00020000 +#define ET_MAC_HDX_BP_NOBACKOFF 0x00040000 +#define ET_MAC_HDX_ALT_BEB 0x00080000 +#define ET_MAC_HDX_ALT_BEB_TRUNC_MASK 0x00F00000 +#define ET_MAC_HDX_COLLWIN_SHIFT 0 +#define ET_MAC_HDX_REXMIT_MAX_SHIFT 12 +#define ET_MAC_HDX_ALT_BEB_TRUNC_SHIFT 20 #define ET_MAX_FRMLEN 0x5010 #define ET_MII_CFG 0x5020 -#define ET_MII_CFG_CLKRST __BITS(2, 0) -#define ET_MII_CFG_PREAMBLE_SUP __BIT(4) -#define ET_MII_CFG_SCAN_AUTOINC __BIT(5) -#define ET_MII_CFG_RST __BIT(31) +#define ET_MII_CFG_CLKRST 0x00000007 +#define ET_MII_CFG_PREAMBLE_SUP 0x00000010 +#define ET_MII_CFG_SCAN_AUTOINC 0x00000020 +#define ET_MII_CFG_RST 0x80000000 #define ET_MII_CMD 0x5024 -#define ET_MII_CMD_READ __BIT(0) +#define ET_MII_CMD_READ 0x00000001 #define ET_MII_ADDR 0x5028 -#define ET_MII_ADDR_REG __BITS(4, 0) -#define ET_MII_ADDR_PHY __BITS(12, 8) +#define ET_MII_ADDR_REG_MASK 0x0000001F +#define ET_MII_ADDR_PHY_MASK 0x00001F00 +#define ET_MII_ADDR_REG_SHIFT 0 +#define ET_MII_ADDR_PHY_SHIFT 8 #define ET_MII_CTRL 0x502c -#define ET_MII_CTRL_VALUE __BITS(15, 0) +#define ET_MII_CTRL_VALUE_MASK 0x0000FFFF +#define ET_MII_CTRL_VALUE_SHIFT 0 #define ET_MII_STAT 0x5030 -#define ET_MII_STAT_VALUE __BITS(15, 0) +#define ET_MII_STAT_VALUE_MASK 0x0000FFFF #define ET_MII_IND 0x5034 -#define ET_MII_IND_BUSY __BIT(0) -#define ET_MII_IND_INVALID __BIT(2) +#define ET_MII_IND_BUSY 0x00000001 +#define ET_MII_IND_INVALID 0x00000004 #define ET_MAC_CTRL 0x5038 -#define ET_MAC_CTRL_MODE_MII __BIT(24) -#define ET_MAC_CTRL_LHDX __BIT(25) -#define ET_MAC_CTRL_GHDX __BIT(26) +#define ET_MAC_CTRL_MODE_MII 0x01000000 +#define ET_MAC_CTRL_LHDX 0x02000000 +#define ET_MAC_CTRL_GHDX 0x04000000 #define ET_MAC_ADDR1 0x5040 #define ET_MAC_ADDR2 0x5044 #define ET_MMC_CTRL 0x7000 -#define ET_MMC_CTRL_ENABLE __BIT(0) -#define ET_MMC_CTRL_ARB_DISABLE __BIT(1) -#define ET_MMC_CTRL_RXMAC_DISABLE __BIT(2) -#define ET_MMC_CTRL_TXMAC_DISABLE __BIT(3) -#define ET_MMC_CTRL_TXDMA_DISABLE __BIT(4) -#define ET_MMC_CTRL_RXDMA_DISABLE __BIT(5) -#define ET_MMC_CTRL_FORCE_CE __BIT(6) +#define ET_MMC_CTRL_ENABLE 0x00000001 +#define ET_MMC_CTRL_ARB_DISABLE 0x00000002 +#define ET_MMC_CTRL_RXMAC_DISABLE 0x00000004 +#define ET_MMC_CTRL_TXMAC_DISABLE 0x00000008 +#define ET_MMC_CTRL_TXDMA_DISABLE 0x00000010 +#define ET_MMC_CTRL_RXDMA_DISABLE 0x00000020 +#define ET_MMC_CTRL_FORCE_CE 0x00000040 /* * Interrupts */ -#define ET_INTR_TXEOF __BIT(3) -#define ET_INTR_TXDMA_ERROR __BIT(4) -#define ET_INTR_RXEOF __BIT(5) -#define ET_INTR_RXRING0_LOW __BIT(6) -#define ET_INTR_RXRING1_LOW __BIT(7) -#define ET_INTR_RXSTAT_LOW __BIT(8) -#define ET_INTR_RXDMA_ERROR __BIT(9) -#define ET_INTR_TIMER __BIT(14) -#define ET_INTR_WOL __BIT(15) -#define ET_INTR_PHY __BIT(16) -#define ET_INTR_TXMAC __BIT(17) -#define ET_INTR_RXMAC __BIT(18) -#define ET_INTR_MAC_STATS __BIT(19) -#define ET_INTR_SLAVE_TO __BIT(20) +#define ET_INTR_TXEOF 0x00000008 +#define ET_INTR_TXDMA_ERROR 0x00000010 +#define ET_INTR_RXEOF 0x00000020 +#define ET_INTR_RXRING0_LOW 0x00000040 +#define ET_INTR_RXRING1_LOW 0x00000080 +#define ET_INTR_RXSTAT_LOW 0x00000100 +#define ET_INTR_RXDMA_ERROR 0x00000200 +#define ET_INTR_TIMER 0x00004000 +#define ET_INTR_WOL 0x00008000 +#define ET_INTR_PHY 0x00010000 +#define ET_INTR_TXMAC 0x00020000 +#define ET_INTR_RXMAC 0x00040000 +#define ET_INTR_MAC_STATS 0x00080000 +#define ET_INTR_SLAVE_TO 0x00100000 #define ET_INTRS (ET_INTR_TXEOF | \ ET_INTR_RXEOF | \ @@ -423,8 +387,8 @@ /* * RX ring position uses same layout */ -#define ET_RX_RING_POS_INDEX __BITS(9, 0) -#define ET_RX_RING_POS_WRAP __BIT(10) +#define ET_RX_RING_POS_INDEX_MASK 0x000003FF +#define ET_RX_RING_POS_WRAP 0x00000400 /* * PCI IDs Modified: stable/8/sys/dev/et/if_etvar.h ============================================================================== --- stable/8/sys/dev/et/if_etvar.h Mon Dec 21 17:55:10 2009 (r200782) +++ stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:07:15 2009 (r200783) @@ -106,11 +106,11 @@ struct et_txdesc { uint32_t td_ctrl2; /* ET_TDCTRL2_ */ } __packed; -#define ET_TDCTRL1_LEN __BITS(15, 0) +#define ET_TDCTRL1_LEN_MASK 0x0000FFFF -#define ET_TDCTRL2_LAST_FRAG __BIT(0) -#define ET_TDCTRL2_FIRST_FRAG __BIT(1) -#define ET_TDCTRL2_INTR __BIT(2) +#define ET_TDCTRL2_LAST_FRAG 0x00000001 +#define ET_TDCTRL2_FIRST_FRAG 0x00000002 +#define ET_TDCTRL2_INTR 0x00000004 struct et_rxdesc { uint32_t rd_addr_lo; @@ -118,24 +118,28 @@ struct et_rxdesc { uint32_t rd_ctrl; /* ET_RDCTRL_ */ } __packed; -#define ET_RDCTRL_BUFIDX __BITS(9, 0) +#define ET_RDCTRL_BUFIDX_MASK 0x000003FF struct et_rxstat { uint32_t rxst_info1; uint32_t rxst_info2; /* ET_RXST_INFO2_ */ } __packed; -#define ET_RXST_INFO2_LEN __BITS(15, 0) -#define ET_RXST_INFO2_BUFIDX __BITS(25, 16) -#define ET_RXST_INFO2_RINGIDX __BITS(27, 26) +#define ET_RXST_INFO2_LEN_MASK 0x0000FFFF +#define ET_RXST_INFO2_LEN_SHIFT 0 +#define ET_RXST_INFO2_BUFIDX_MASK 0x03FF0000 +#define ET_RXST_INFO2_BUFIDX_SHIFT 16 +#define ET_RXST_INFO2_RINGIDX_MASK 0x0C000000 +#define ET_RXST_INFO2_RINGIDX_SHIFT 26 struct et_rxstatus { uint32_t rxs_ring; uint32_t rxs_stat_ring; /* ET_RXS_STATRING_ */ } __packed; -#define ET_RXS_STATRING_INDEX __BITS(27, 16) -#define ET_RXS_STATRING_WRAP __BIT(28) +#define ET_RXS_STATRING_INDEX_MASK 0x0FFF0000 +#define ET_RXS_STATRING_INDEX_SHIFT 16 +#define ET_RXS_STATRING_WRAP 0x10000000 struct et_dmamap_ctx { int nsegs; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:09:41 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB7461065694; Mon, 21 Dec 2009 18:09:41 +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 C853A8FC20; Mon, 21 Dec 2009 18:09:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLI9fqn035684; Mon, 21 Dec 2009 18:09:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLI9fYZ035680; Mon, 21 Dec 2009 18:09:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211809.nBLI9fYZ035680@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:09:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200784 - stable/7/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:09:42 -0000 Author: yongari Date: Mon Dec 21 18:09:41 2009 New Revision: 200784 URL: http://svn.freebsd.org/changeset/base/200784 Log: MFC r199548: Remove complex macros that were used to compute bits values. Although these macros may have its own strength, its complex definition make hard to read the code. Approved by: delphij Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etreg.h stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Mon Dec 21 18:07:15 2009 (r200783) +++ stable/7/sys/dev/et/if_et.c Mon Dec 21 18:09:41 2009 (r200784) @@ -404,8 +404,8 @@ et_miibus_readreg(device_t dev, int phy, /* Stop any pending operations */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - val = __SHIFTIN(phy, ET_MII_ADDR_PHY) | - __SHIFTIN(reg, ET_MII_ADDR_REG); + val = (phy << ET_MII_ADDR_PHY_SHIFT) & ET_MII_ADDR_PHY_MASK; + val |= (reg << ET_MII_ADDR_REG_SHIFT) & ET_MII_ADDR_REG_MASK; CSR_WRITE_4(sc, ET_MII_ADDR, val); /* Start reading */ @@ -429,7 +429,7 @@ et_miibus_readreg(device_t dev, int phy, #undef NRETRY val = CSR_READ_4(sc, ET_MII_STAT); - ret = __SHIFTOUT(val, ET_MII_STAT_VALUE); + ret = val & ET_MII_STAT_VALUE_MASK; back: /* Make sure that the current operation is stopped */ @@ -447,12 +447,13 @@ et_miibus_writereg(device_t dev, int phy /* Stop any pending operations */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - val = __SHIFTIN(phy, ET_MII_ADDR_PHY) | - __SHIFTIN(reg, ET_MII_ADDR_REG); + val = (phy << ET_MII_ADDR_PHY_SHIFT) & ET_MII_ADDR_PHY_MASK; + val |= (reg << ET_MII_ADDR_REG_SHIFT) & ET_MII_ADDR_REG_MASK; CSR_WRITE_4(sc, ET_MII_ADDR, val); /* Start writing */ - CSR_WRITE_4(sc, ET_MII_CTRL, __SHIFTIN(val0, ET_MII_CTRL_VALUE)); + CSR_WRITE_4(sc, ET_MII_CTRL, + (val0 << ET_MII_CTRL_VALUE_SHIFT) & ET_MII_CTRL_VALUE_MASK); #define NRETRY 100 @@ -601,8 +602,13 @@ et_bus_config(device_t dev) /* * Set L0s and L1 latency timer to 2us */ - val = ET_PCIV_L0S_LATENCY(2) | ET_PCIV_L1_LATENCY(2); - pci_write_config(dev, ET_PCIR_L0S_L1_LATENCY, val, 1); + val = pci_read_config(dev, ET_PCIR_L0S_L1_LATENCY, 4); + val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); + /* L0s exit latency : 2us */ + val |= 0x00005000; + /* L1 exit latency : 2us */ + val |= 0x00028000; + pci_write_config(dev, ET_PCIR_L0S_L1_LATENCY, val, 4); /* * Set max read request size to 2048 bytes @@ -1021,10 +1027,10 @@ et_chip_attach(struct et_softc *sc) /* * Setup half duplex mode */ - val = __SHIFTIN(10, ET_MAC_HDX_ALT_BEB_TRUNC) | - __SHIFTIN(15, ET_MAC_HDX_REXMIT_MAX) | - __SHIFTIN(55, ET_MAC_HDX_COLLWIN) | - ET_MAC_HDX_EXC_DEFER; + val = (10 << ET_MAC_HDX_ALT_BEB_TRUNC_SHIFT) | + (15 << ET_MAC_HDX_REXMIT_MAX_SHIFT) | + (55 << ET_MAC_HDX_COLLWIN_SHIFT) | + ET_MAC_HDX_EXC_DEFER; CSR_WRITE_4(sc, ET_MAC_HDX, val); /* Clear MAC control */ @@ -1655,19 +1661,19 @@ et_init_mac(struct et_softc *sc) /* * Setup inter packet gap */ - val = __SHIFTIN(56, ET_IPG_NONB2B_1) | - __SHIFTIN(88, ET_IPG_NONB2B_2) | - __SHIFTIN(80, ET_IPG_MINIFG) | - __SHIFTIN(96, ET_IPG_B2B); + val = (56 << ET_IPG_NONB2B_1_SHIFT) | + (88 << ET_IPG_NONB2B_2_SHIFT) | + (80 << ET_IPG_MINIFG_SHIFT) | + (96 << ET_IPG_B2B_SHIFT); CSR_WRITE_4(sc, ET_IPG, val); /* * Setup half duplex mode */ - val = __SHIFTIN(10, ET_MAC_HDX_ALT_BEB_TRUNC) | - __SHIFTIN(15, ET_MAC_HDX_REXMIT_MAX) | - __SHIFTIN(55, ET_MAC_HDX_COLLWIN) | - ET_MAC_HDX_EXC_DEFER; + val = (10 << ET_MAC_HDX_ALT_BEB_TRUNC_SHIFT) | + (15 << ET_MAC_HDX_REXMIT_MAX_SHIFT) | + (55 << ET_MAC_HDX_COLLWIN_SHIFT) | + ET_MAC_HDX_EXC_DEFER; CSR_WRITE_4(sc, ET_MAC_HDX, val); /* Clear MAC control */ @@ -1738,7 +1744,7 @@ et_init_rxmac(struct et_softc *sc) * since this is the size of the PCI-Express TLP's * that the ET1310 uses. */ - val = __SHIFTIN(ET_RXMAC_SEGSZ(256), ET_RXMAC_MC_SEGSZ_MAX) | + val = (ET_RXMAC_SEGSZ(256) & ET_RXMAC_MC_SEGSZ_MAX_MASK) | ET_RXMAC_MC_SEGSZ_ENABLE; } else { val = 0; @@ -1761,7 +1767,9 @@ et_init_rxmac(struct et_softc *sc) /* * Configure runt filtering (may not work on certain chip generation) */ - val = __SHIFTIN(ETHER_MIN_LEN, ET_PKTFILT_MINLEN) | ET_PKTFILT_FRAG; + val = (ETHER_MIN_LEN << ET_PKTFILT_MINLEN_SHIFT) & + ET_PKTFILT_MINLEN_MASK; + val |= ET_PKTFILT_FRAG; CSR_WRITE_4(sc, ET_PKTFILT, val); /* Enable RX MAC but leave WOL disabled */ @@ -1793,11 +1801,9 @@ et_start_rxdma(struct et_softc *sc) { uint32_t val = 0; - val |= __SHIFTIN(sc->sc_rx_data[0].rbd_bufsize, - ET_RXDMA_CTRL_RING0_SIZE) | + val |= (sc->sc_rx_data[0].rbd_bufsize & ET_RXDMA_CTRL_RING0_SIZE_MASK) | ET_RXDMA_CTRL_RING0_ENABLE; - val |= __SHIFTIN(sc->sc_rx_data[1].rbd_bufsize, - ET_RXDMA_CTRL_RING1_SIZE) | + val |= (sc->sc_rx_data[1].rbd_bufsize & ET_RXDMA_CTRL_RING1_SIZE_MASK) | ET_RXDMA_CTRL_RING1_ENABLE; CSR_WRITE_4(sc, ET_RXDMA_CTRL, val); @@ -1892,7 +1898,8 @@ et_rxeof(struct et_softc *sc) rxs_stat_ring = rxsd->rxsd_status->rxs_stat_ring; rxst_wrap = (rxs_stat_ring & ET_RXS_STATRING_WRAP) ? 1 : 0; - rxst_index = __SHIFTOUT(rxs_stat_ring, ET_RXS_STATRING_INDEX); + rxst_index = (rxs_stat_ring & ET_RXS_STATRING_INDEX_MASK) >> + ET_RXS_STATRING_INDEX_SHIFT; while (rxst_index != rxst_ring->rsr_index || rxst_wrap != rxst_ring->rsr_wrap) { @@ -1906,16 +1913,18 @@ et_rxeof(struct et_softc *sc) MPASS(rxst_ring->rsr_index < ET_RX_NSTAT); st = &rxst_ring->rsr_stat[rxst_ring->rsr_index]; - buflen = __SHIFTOUT(st->rxst_info2, ET_RXST_INFO2_LEN); - buf_idx = __SHIFTOUT(st->rxst_info2, ET_RXST_INFO2_BUFIDX); - ring_idx = __SHIFTOUT(st->rxst_info2, ET_RXST_INFO2_RINGIDX); + buflen = (st->rxst_info2 & ET_RXST_INFO2_LEN_MASK) >> + ET_RXST_INFO2_LEN_SHIFT; + buf_idx = (st->rxst_info2 & ET_RXST_INFO2_BUFIDX_MASK) >> + ET_RXST_INFO2_BUFIDX_SHIFT; + ring_idx = (st->rxst_info2 & ET_RXST_INFO2_RINGIDX_MASK) >> + ET_RXST_INFO2_RINGIDX_SHIFT; if (++rxst_ring->rsr_index == ET_RX_NSTAT) { rxst_ring->rsr_index = 0; rxst_ring->rsr_wrap ^= 1; } - rxstat_pos = __SHIFTIN(rxst_ring->rsr_index, - ET_RXSTAT_POS_INDEX); + rxstat_pos = rxst_ring->rsr_index & ET_RXSTAT_POS_INDEX_MASK; if (rxst_ring->rsr_wrap) rxstat_pos |= ET_RXSTAT_POS_WRAP; CSR_WRITE_4(sc, ET_RXSTAT_POS, rxstat_pos); @@ -1968,7 +1977,7 @@ et_rxeof(struct et_softc *sc) rx_ring->rr_index = 0; rx_ring->rr_wrap ^= 1; } - rxring_pos = __SHIFTIN(rx_ring->rr_index, ET_RX_RING_POS_INDEX); + rxring_pos = rx_ring->rr_index & ET_RX_RING_POS_INDEX_MASK; if (rx_ring->rr_wrap) rxring_pos |= ET_RX_RING_POS_WRAP; CSR_WRITE_4(sc, rx_ring->rr_posreg, rxring_pos); @@ -2056,7 +2065,7 @@ et_encap(struct et_softc *sc, struct mbu td = &tx_ring->tr_desc[idx]; td->td_addr_hi = ET_ADDR_HI(segs[i].ds_addr); td->td_addr_lo = ET_ADDR_LO(segs[i].ds_addr); - td->td_ctrl1 = __SHIFTIN(segs[i].ds_len, ET_TDCTRL1_LEN); + td->td_ctrl1 = segs[i].ds_len & ET_TDCTRL1_LEN_MASK; if (i == ctx.nsegs - 1) { /* Last frag */ td->td_ctrl2 = last_td_ctrl2; @@ -2083,8 +2092,7 @@ et_encap(struct et_softc *sc, struct mbu bus_dmamap_sync(tx_ring->tr_dtag, tx_ring->tr_dmap, BUS_DMASYNC_PREWRITE); - tx_ready_pos = __SHIFTIN(tx_ring->tr_ready_index, - ET_TX_READY_POS_INDEX); + tx_ready_pos = tx_ring->tr_ready_index & ET_TX_READY_POS_INDEX_MASK; if (tx_ring->tr_ready_wrap) tx_ready_pos |= ET_TX_READY_POS_WRAP; CSR_WRITE_4(sc, ET_TX_READY_POS, tx_ready_pos); @@ -2119,7 +2127,7 @@ et_txeof(struct et_softc *sc) return; tx_done = CSR_READ_4(sc, ET_TX_DONE_POS); - end = __SHIFTOUT(tx_done, ET_TX_DONE_POS_INDEX); + end = tx_done & ET_TX_DONE_POS_INDEX_MASK; wrap = (tx_done & ET_TX_DONE_POS_WRAP) ? 1 : 0; while (tbd->tbd_start_index != end || tbd->tbd_start_wrap != wrap) { @@ -2352,7 +2360,8 @@ et_setmedia(struct et_softc *sc) cfg2 &= ~(ET_MAC_CFG2_MODE_MII | ET_MAC_CFG2_MODE_GMII | ET_MAC_CFG2_FDX | ET_MAC_CFG2_BIGFRM); cfg2 |= ET_MAC_CFG2_LENCHK | ET_MAC_CFG2_CRC | ET_MAC_CFG2_PADCRC | - __SHIFTIN(7, ET_MAC_CFG2_PREAMBLE_LEN); + ((7 << ET_MAC_CFG2_PREAMBLE_LEN_SHIFT) & + ET_MAC_CFG2_PREAMBLE_LEN_MASK); ctrl = CSR_READ_4(sc, ET_MAC_CTRL); ctrl &= ~(ET_MAC_CTRL_GHDX | ET_MAC_CTRL_MODE_MII); @@ -2384,7 +2393,7 @@ et_setup_rxdesc(struct et_rxbuf_data *rb desc->rd_addr_hi = ET_ADDR_HI(paddr); desc->rd_addr_lo = ET_ADDR_LO(paddr); - desc->rd_ctrl = __SHIFTIN(buf_idx, ET_RDCTRL_BUFIDX); + desc->rd_ctrl = buf_idx & ET_RDCTRL_BUFIDX_MASK; bus_dmamap_sync(rx_ring->rr_dtag, rx_ring->rr_dmap, BUS_DMASYNC_PREWRITE); Modified: stable/7/sys/dev/et/if_etreg.h ============================================================================== --- stable/7/sys/dev/et/if_etreg.h Mon Dec 21 18:07:15 2009 (r200783) +++ stable/7/sys/dev/et/if_etreg.h Mon Dec 21 18:09:41 2009 (r200784) @@ -73,50 +73,6 @@ #ifndef _IF_ETREG_H #define _IF_ETREG_H -/* - * __BIT(n): Return a bitmask with bit n set, where the least - * significant bit is bit 0. - * - * __BITS(m, n): Return a bitmask with bits m through n, inclusive, - * set. It does not matter whether m>n or m<=n. The - * least significant bit is bit 0. - * - * A "bitfield" is a span of consecutive bits defined by a bitmask, - * where 1s select the bits in the bitfield. __SHIFTIN, __SHIFTOUT, - * and __SHIFTOUT_MASK help read and write bitfields from device - * registers. - * - * __SHIFTIN(v, mask): Left-shift bits `v' into the bitfield - * defined by `mask', and return them. No - * side-effects. - * - * __SHIFTOUT(v, mask): Extract and return the bitfield selected - * by `mask' from `v', right-shifting the - * bits so that the rightmost selected bit - * is at bit 0. No side-effects. - * - * __SHIFTOUT_MASK(mask): Right-shift the bits in `mask' so that - * the rightmost non-zero bit is at bit - * 0. This is useful for finding the - * greatest unsigned value that a bitfield - * can hold. No side-effects. Note that - * __SHIFTOUT_MASK(m) = __SHIFTOUT(m, m). - */ - -/* __BIT(n): nth bit, where __BIT(0) == 0x1. */ -#define __BIT(__n) (((__n) == 32) ? 0 : ((uint32_t)1 << (__n))) - -/* __BITS(m, n): bits m through n, m < n. */ -#define __BITS(__m, __n) \ - ((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1)) - -/* Find least significant bit that is set */ -#define __LOWEST_SET_BIT(__mask) ((((__mask) - 1) & (__mask)) ^ (__mask)) - -#define __SHIFTOUT(__x, __mask) (((__x) & (__mask)) / __LOWEST_SET_BIT(__mask)) -#define __SHIFTIN(__x, __mask) ((__x) * __LOWEST_SET_BIT(__mask)) -#define __SHIFTOUT_MASK(__mask) __SHIFTOUT((__mask), (__mask)) - #define ET_MEM_TXSIZE_EX 182 #define ET_MEM_RXSIZE_MIN 608 #define ET_MEM_RXSIZE_DEFAULT 11216 @@ -159,10 +115,6 @@ #define ET_PCIV_REPLAY_TIMER_256 (1248 + ET_REPLAY_TIMER_RX_L0S_ADJ) #define ET_PCIR_L0S_L1_LATENCY 0xcf -#define ET_PCIM_L0S_LATENCY __BITS(2, 0) -#define ET_PCIM_L1_LATENCY __BITS(5, 3) -#define ET_PCIV_L0S_LATENCY(l) __SHIFTIN((l) - 1, ET_PCIM_L0S_LATENCY) -#define ET_PCIV_L1_LATENCY(l) __SHIFTIN((l) - 1, ET_PCIM_L1_LATENCY) /* * CSR @@ -176,22 +128,22 @@ #define ET_QUEUE_ADDR_END ET_QUEUE_ADDR(ET_MEM_SIZE) #define ET_PM 0x0010 -#define ET_PM_SYSCLK_GATE __BIT(3) -#define ET_PM_TXCLK_GATE __BIT(4) -#define ET_PM_RXCLK_GATE __BIT(5) +#define ET_PM_SYSCLK_GATE 0x00000008 +#define ET_PM_TXCLK_GATE 0x00000010 +#define ET_PM_RXCLK_GATE 0x00000020 #define ET_INTR_STATUS 0x0018 #define ET_INTR_MASK 0x001c #define ET_SWRST 0x0028 -#define ET_SWRST_TXDMA __BIT(0) -#define ET_SWRST_RXDMA __BIT(1) -#define ET_SWRST_TXMAC __BIT(2) -#define ET_SWRST_RXMAC __BIT(3) -#define ET_SWRST_MAC __BIT(4) -#define ET_SWRST_MAC_STAT __BIT(5) -#define ET_SWRST_MMC __BIT(6) -#define ET_SWRST_SELFCLR_DISABLE __BIT(31) +#define ET_SWRST_TXDMA 0x00000001 +#define ET_SWRST_RXDMA 0x00000002 +#define ET_SWRST_TXMAC 0x00000004 +#define ET_SWRST_RXMAC 0x00000008 +#define ET_SWRST_MAC 0x00000010 +#define ET_SWRST_MAC_STAT 0x00000020 +#define ET_SWRST_MMC 0x00000040 +#define ET_SWRST_SELFCLR_DISABLE 0x80000000 #define ET_MSI_CFG 0x0030 @@ -200,9 +152,9 @@ #define ET_TIMER 0x0038 #define ET_TXDMA_CTRL 0x1000 -#define ET_TXDMA_CTRL_HALT __BIT(0) -#define ET_TXDMA_CTRL_CACHE_THR __BITS(7, 4) -#define ET_TXDMA_CTRL_SINGLE_EPKT __BIT(8) /* ??? */ +#define ET_TXDMA_CTRL_HALT 0x00000001 +#define ET_TXDMA_CTRL_CACHE_THR_MASK 0x000000F0 +#define ET_TXDMA_CTRL_SINGLE_EPKT 0x00000100 /* ??? */ #define ET_TX_RING_HI 0x1004 #define ET_TX_RING_LO 0x1008 @@ -212,28 +164,28 @@ #define ET_TX_STATUS_LO 0x1020 #define ET_TX_READY_POS 0x1024 -#define ET_TX_READY_POS_INDEX __BITS(9, 0) -#define ET_TX_READY_POS_WRAP __BIT(10) +#define ET_TX_READY_POS_INDEX_MASK 0x000003FF +#define ET_TX_READY_POS_WRAP 0x00000400 #define ET_TX_DONE_POS 0x1060 -#define ET_TX_DONE_POS_INDEX __BITS(9, 0) -#define ET_TX_DONE_POS_WRAP __BIT(10) +#define ET_TX_DONE_POS_INDEX_MASK 0x0000003FF +#define ET_TX_DONE_POS_WRAP 0x000000400 #define ET_RXDMA_CTRL 0x2000 -#define ET_RXDMA_CTRL_HALT __BIT(0) -#define ET_RXDMA_CTRL_RING0_SIZE __BITS(9, 8) -#define ET_RXDMA_CTRL_RING0_128 0 /* 127 */ -#define ET_RXDMA_CTRL_RING0_256 1 /* 255 */ -#define ET_RXDMA_CTRL_RING0_512 2 /* 511 */ -#define ET_RXDMA_CTRL_RING0_1024 3 /* 1023 */ -#define ET_RXDMA_CTRL_RING0_ENABLE __BIT(10) -#define ET_RXDMA_CTRL_RING1_SIZE __BITS(12, 11) -#define ET_RXDMA_CTRL_RING1_2048 0 /* 2047 */ -#define ET_RXDMA_CTRL_RING1_4096 1 /* 4095 */ -#define ET_RXDMA_CTRL_RING1_8192 2 /* 8191 */ -#define ET_RXDMA_CTRL_RING1_16384 3 /* 16383 (9022?) */ -#define ET_RXDMA_CTRL_RING1_ENABLE __BIT(13) -#define ET_RXDMA_CTRL_HALTED __BIT(17) +#define ET_RXDMA_CTRL_HALT 0x00000001 +#define ET_RXDMA_CTRL_RING0_SIZE_MASK 0x00000300 +#define ET_RXDMA_CTRL_RING0_128 0x00000000 /* 127 */ +#define ET_RXDMA_CTRL_RING0_256 0x00000100 /* 255 */ +#define ET_RXDMA_CTRL_RING0_512 0x00000200 /* 511 */ +#define ET_RXDMA_CTRL_RING0_1024 0x00000300 /* 1023 */ +#define ET_RXDMA_CTRL_RING0_ENABLE 0x00000400 +#define ET_RXDMA_CTRL_RING1_SIZE_MASK 0x00001800 +#define ET_RXDMA_CTRL_RING1_2048 0x00000000 /* 2047 */ +#define ET_RXDMA_CTRL_RING1_4096 0x00000800 /* 4095 */ +#define ET_RXDMA_CTRL_RING1_8192 0x00001000 /* 8191 */ +#define ET_RXDMA_CTRL_RING1_16384 0x00001800 /* 16383 (9022?) */ +#define ET_RXDMA_CTRL_RING1_ENABLE 0x00002000 +#define ET_RXDMA_CTRL_HALTED 0x00020000 #define ET_RX_STATUS_LO 0x2004 #define ET_RX_STATUS_HI 0x2008 @@ -246,8 +198,8 @@ #define ET_RXSTAT_CNT 0x2028 #define ET_RXSTAT_POS 0x2030 -#define ET_RXSTAT_POS_INDEX __BITS(11, 0) -#define ET_RXSTAT_POS_WRAP __BIT(12) +#define ET_RXSTAT_POS_INDEX_MASK 0x00000FFF +#define ET_RXSTAT_POS_WRAP 0x00001000 #define ET_RXSTAT_MINCNT 0x2038 @@ -256,8 +208,8 @@ #define ET_RX_RING0_CNT 0x2044 #define ET_RX_RING0_POS 0x204c -#define ET_RX_RING0_POS_INDEX __BITS(9, 0) -#define ET_RX_RING0_POS_WRAP __BIT(10) +#define ET_RX_RING0_POS_INDEX_MASK 0x000003FF +#define ET_RX_RING0_POS_WRAP 0x00000400 #define ET_RX_RING0_MINCNT 0x2054 @@ -266,21 +218,21 @@ #define ET_RX_RING1_CNT 0x2060 #define ET_RX_RING1_POS 0x2068 -#define ET_RX_RING1_POS_INDEX __BITS(9, 0) -#define ET_RX_RING1_POS_WRAP __BIT(10) +#define ET_RX_RING1_POS_INDEX 0x000003FF +#define ET_RX_RING1_POS_WRAP 0x00000400 #define ET_RX_RING1_MINCNT 0x2070 #define ET_TXMAC_CTRL 0x3000 -#define ET_TXMAC_CTRL_ENABLE __BIT(0) -#define ET_TXMAC_CTRL_FC_DISABLE __BIT(3) +#define ET_TXMAC_CTRL_ENABLE 0x00000001 +#define ET_TXMAC_CTRL_FC_DISABLE 0x00000008 #define ET_TXMAC_FLOWCTRL 0x3010 #define ET_RXMAC_CTRL 0x4000 -#define ET_RXMAC_CTRL_ENABLE __BIT(0) -#define ET_RXMAC_CTRL_NO_PKTFILT __BIT(2) -#define ET_RXMAC_CTRL_WOL_DISABLE __BIT(3) +#define ET_RXMAC_CTRL_ENABLE 0x00000001 +#define ET_RXMAC_CTRL_NO_PKTFILT 0x00000004 +#define ET_RXMAC_CTRL_WOL_DISABLE 0x00000008 #define ET_WOL_CRC 0x4004 #define ET_WOL_SA_LO 0x4010 @@ -294,16 +246,17 @@ #define ET_MULTI_HASH 0x4074 #define ET_PKTFILT 0x4084 -#define ET_PKTFILT_BCAST __BIT(0) -#define ET_PKTFILT_MCAST __BIT(1) -#define ET_PKTFILT_UCAST __BIT(2) -#define ET_PKTFILT_FRAG __BIT(3) -#define ET_PKTFILT_MINLEN __BITS(22, 16) +#define ET_PKTFILT_BCAST 0x00000001 +#define ET_PKTFILT_MCAST 0x00000002 +#define ET_PKTFILT_UCAST 0x00000004 +#define ET_PKTFILT_FRAG 0x00000008 +#define ET_PKTFILT_MINLEN_MASK 0x007F0000 +#define ET_PKTFILT_MINLEN_SHIFT 16 #define ET_RXMAC_MC_SEGSZ 0x4088 -#define ET_RXMAC_MC_SEGSZ_ENABLE __BIT(0) -#define ET_RXMAC_MC_SEGSZ_FC __BIT(1) -#define ET_RXMAC_MC_SEGSZ_MAX __BITS(9, 2) +#define ET_RXMAC_MC_SEGSZ_ENABLE 0x00000001 +#define ET_RXMAC_MC_SEGSZ_FC 0x00000002 +#define ET_RXMAC_MC_SEGSZ_MAX_MASK 0x000003FC #define ET_RXMAC_SEGSZ(segsz) ((segsz) / ET_MEM_UNIT) #define ET_RXMAC_CUT_THRU_FRMLEN 8074 @@ -311,110 +264,121 @@ #define ET_RXMAC_SPACE_AVL 0x4094 #define ET_RXMAC_MGT 0x4098 -#define ET_RXMAC_MGT_PASS_ECRC __BIT(4) -#define ET_RXMAC_MGT_PASS_ELEN __BIT(5) -#define ET_RXMAC_MGT_PASS_ETRUNC __BIT(16) -#define ET_RXMAC_MGT_CHECK_PKT __BIT(17) +#define ET_RXMAC_MGT_PASS_ECRC 0x00000010 +#define ET_RXMAC_MGT_PASS_ELEN 0x00000020 +#define ET_RXMAC_MGT_PASS_ETRUNC 0x00010000 +#define ET_RXMAC_MGT_CHECK_PKT 0x00020000 #define ET_MAC_CFG1 0x5000 -#define ET_MAC_CFG1_TXEN __BIT(0) -#define ET_MAC_CFG1_SYNC_TXEN __BIT(1) -#define ET_MAC_CFG1_RXEN __BIT(2) -#define ET_MAC_CFG1_SYNC_RXEN __BIT(3) -#define ET_MAC_CFG1_TXFLOW __BIT(4) -#define ET_MAC_CFG1_RXFLOW __BIT(5) -#define ET_MAC_CFG1_LOOPBACK __BIT(8) -#define ET_MAC_CFG1_RST_TXFUNC __BIT(16) -#define ET_MAC_CFG1_RST_RXFUNC __BIT(17) -#define ET_MAC_CFG1_RST_TXMC __BIT(18) -#define ET_MAC_CFG1_RST_RXMC __BIT(19) -#define ET_MAC_CFG1_SIM_RST __BIT(30) -#define ET_MAC_CFG1_SOFT_RST __BIT(31) +#define ET_MAC_CFG1_TXEN 0x00000001 +#define ET_MAC_CFG1_SYNC_TXEN 0x00000002 +#define ET_MAC_CFG1_RXEN 0x00000004 +#define ET_MAC_CFG1_SYNC_RXEN 0x00000008 +#define ET_MAC_CFG1_TXFLOW 0x00000010 +#define ET_MAC_CFG1_RXFLOW 0x00000020 +#define ET_MAC_CFG1_LOOPBACK 0x00000100 +#define ET_MAC_CFG1_RST_TXFUNC 0x00010000 +#define ET_MAC_CFG1_RST_RXFUNC 0x00020000 +#define ET_MAC_CFG1_RST_TXMC 0x00040000 +#define ET_MAC_CFG1_RST_RXMC 0x00080000 +#define ET_MAC_CFG1_SIM_RST 0x40000000 +#define ET_MAC_CFG1_SOFT_RST 0x80000000 #define ET_MAC_CFG2 0x5004 -#define ET_MAC_CFG2_FDX __BIT(0) -#define ET_MAC_CFG2_CRC __BIT(1) -#define ET_MAC_CFG2_PADCRC __BIT(2) -#define ET_MAC_CFG2_LENCHK __BIT(4) -#define ET_MAC_CFG2_BIGFRM __BIT(5) -#define ET_MAC_CFG2_MODE_MII __BIT(8) -#define ET_MAC_CFG2_MODE_GMII __BIT(9) -#define ET_MAC_CFG2_PREAMBLE_LEN __BITS(15, 12) +#define ET_MAC_CFG2_FDX 0x00000001 +#define ET_MAC_CFG2_CRC 0x00000002 +#define ET_MAC_CFG2_PADCRC 0x00000004 +#define ET_MAC_CFG2_LENCHK 0x00000010 +#define ET_MAC_CFG2_BIGFRM 0x00000020 +#define ET_MAC_CFG2_MODE_MII 0x00000100 +#define ET_MAC_CFG2_MODE_GMII 0x00000200 +#define ET_MAC_CFG2_PREAMBLE_LEN_MASK 0x0000F000 +#define ET_MAC_CFG2_PREAMBLE_LEN_SHIFT 12 #define ET_IPG 0x5008 -#define ET_IPG_B2B __BITS(6, 0) -#define ET_IPG_MINIFG __BITS(15, 8) -#define ET_IPG_NONB2B_2 __BITS(22, 16) -#define ET_IPG_NONB2B_1 __BITS(30, 24) +#define ET_IPG_B2B_MASK 0x0000007F +#define ET_IPG_MINIFG_MASK 0x0000FF00 +#define ET_IPG_NONB2B_2_MASK 0x007F0000 +#define ET_IPG_NONB2B_1_MASK 0x7F000000 +#define ET_IPG_B2B_SHIFT 0 +#define ET_IPG_MINIFG_SHIFT 8 +#define ET_IPG_NONB2B_2_SHIFT 16 +#define ET_IPG_NONB2B_1_SHIFT 24 #define ET_MAC_HDX 0x500c -#define ET_MAC_HDX_COLLWIN __BITS(9, 0) -#define ET_MAC_HDX_REXMIT_MAX __BITS(15, 12) -#define ET_MAC_HDX_EXC_DEFER __BIT(16) -#define ET_MAC_HDX_NOBACKOFF __BIT(17) -#define ET_MAC_HDX_BP_NOBACKOFF __BIT(18) -#define ET_MAC_HDX_ALT_BEB __BIT(19) -#define ET_MAC_HDX_ALT_BEB_TRUNC __BITS(23, 20) +#define ET_MAC_HDX_COLLWIN_MASK 0x000003FF +#define ET_MAC_HDX_REXMIT_MAX_MASK 0x0000F000 +#define ET_MAC_HDX_EXC_DEFER 0x00010000 +#define ET_MAC_HDX_NOBACKOFF 0x00020000 +#define ET_MAC_HDX_BP_NOBACKOFF 0x00040000 +#define ET_MAC_HDX_ALT_BEB 0x00080000 +#define ET_MAC_HDX_ALT_BEB_TRUNC_MASK 0x00F00000 +#define ET_MAC_HDX_COLLWIN_SHIFT 0 +#define ET_MAC_HDX_REXMIT_MAX_SHIFT 12 +#define ET_MAC_HDX_ALT_BEB_TRUNC_SHIFT 20 #define ET_MAX_FRMLEN 0x5010 #define ET_MII_CFG 0x5020 -#define ET_MII_CFG_CLKRST __BITS(2, 0) -#define ET_MII_CFG_PREAMBLE_SUP __BIT(4) -#define ET_MII_CFG_SCAN_AUTOINC __BIT(5) -#define ET_MII_CFG_RST __BIT(31) +#define ET_MII_CFG_CLKRST 0x00000007 +#define ET_MII_CFG_PREAMBLE_SUP 0x00000010 +#define ET_MII_CFG_SCAN_AUTOINC 0x00000020 +#define ET_MII_CFG_RST 0x80000000 #define ET_MII_CMD 0x5024 -#define ET_MII_CMD_READ __BIT(0) +#define ET_MII_CMD_READ 0x00000001 #define ET_MII_ADDR 0x5028 -#define ET_MII_ADDR_REG __BITS(4, 0) -#define ET_MII_ADDR_PHY __BITS(12, 8) +#define ET_MII_ADDR_REG_MASK 0x0000001F +#define ET_MII_ADDR_PHY_MASK 0x00001F00 +#define ET_MII_ADDR_REG_SHIFT 0 +#define ET_MII_ADDR_PHY_SHIFT 8 #define ET_MII_CTRL 0x502c -#define ET_MII_CTRL_VALUE __BITS(15, 0) +#define ET_MII_CTRL_VALUE_MASK 0x0000FFFF +#define ET_MII_CTRL_VALUE_SHIFT 0 #define ET_MII_STAT 0x5030 -#define ET_MII_STAT_VALUE __BITS(15, 0) +#define ET_MII_STAT_VALUE_MASK 0x0000FFFF #define ET_MII_IND 0x5034 -#define ET_MII_IND_BUSY __BIT(0) -#define ET_MII_IND_INVALID __BIT(2) +#define ET_MII_IND_BUSY 0x00000001 +#define ET_MII_IND_INVALID 0x00000004 #define ET_MAC_CTRL 0x5038 -#define ET_MAC_CTRL_MODE_MII __BIT(24) -#define ET_MAC_CTRL_LHDX __BIT(25) -#define ET_MAC_CTRL_GHDX __BIT(26) +#define ET_MAC_CTRL_MODE_MII 0x01000000 +#define ET_MAC_CTRL_LHDX 0x02000000 +#define ET_MAC_CTRL_GHDX 0x04000000 #define ET_MAC_ADDR1 0x5040 #define ET_MAC_ADDR2 0x5044 #define ET_MMC_CTRL 0x7000 -#define ET_MMC_CTRL_ENABLE __BIT(0) -#define ET_MMC_CTRL_ARB_DISABLE __BIT(1) -#define ET_MMC_CTRL_RXMAC_DISABLE __BIT(2) -#define ET_MMC_CTRL_TXMAC_DISABLE __BIT(3) -#define ET_MMC_CTRL_TXDMA_DISABLE __BIT(4) -#define ET_MMC_CTRL_RXDMA_DISABLE __BIT(5) -#define ET_MMC_CTRL_FORCE_CE __BIT(6) +#define ET_MMC_CTRL_ENABLE 0x00000001 +#define ET_MMC_CTRL_ARB_DISABLE 0x00000002 +#define ET_MMC_CTRL_RXMAC_DISABLE 0x00000004 +#define ET_MMC_CTRL_TXMAC_DISABLE 0x00000008 +#define ET_MMC_CTRL_TXDMA_DISABLE 0x00000010 +#define ET_MMC_CTRL_RXDMA_DISABLE 0x00000020 +#define ET_MMC_CTRL_FORCE_CE 0x00000040 /* * Interrupts */ -#define ET_INTR_TXEOF __BIT(3) -#define ET_INTR_TXDMA_ERROR __BIT(4) -#define ET_INTR_RXEOF __BIT(5) -#define ET_INTR_RXRING0_LOW __BIT(6) -#define ET_INTR_RXRING1_LOW __BIT(7) -#define ET_INTR_RXSTAT_LOW __BIT(8) -#define ET_INTR_RXDMA_ERROR __BIT(9) -#define ET_INTR_TIMER __BIT(14) -#define ET_INTR_WOL __BIT(15) -#define ET_INTR_PHY __BIT(16) -#define ET_INTR_TXMAC __BIT(17) -#define ET_INTR_RXMAC __BIT(18) -#define ET_INTR_MAC_STATS __BIT(19) -#define ET_INTR_SLAVE_TO __BIT(20) +#define ET_INTR_TXEOF 0x00000008 +#define ET_INTR_TXDMA_ERROR 0x00000010 +#define ET_INTR_RXEOF 0x00000020 +#define ET_INTR_RXRING0_LOW 0x00000040 +#define ET_INTR_RXRING1_LOW 0x00000080 +#define ET_INTR_RXSTAT_LOW 0x00000100 +#define ET_INTR_RXDMA_ERROR 0x00000200 +#define ET_INTR_TIMER 0x00004000 +#define ET_INTR_WOL 0x00008000 +#define ET_INTR_PHY 0x00010000 +#define ET_INTR_TXMAC 0x00020000 +#define ET_INTR_RXMAC 0x00040000 +#define ET_INTR_MAC_STATS 0x00080000 +#define ET_INTR_SLAVE_TO 0x00100000 #define ET_INTRS (ET_INTR_TXEOF | \ ET_INTR_RXEOF | \ @@ -423,8 +387,8 @@ /* * RX ring position uses same layout */ -#define ET_RX_RING_POS_INDEX __BITS(9, 0) -#define ET_RX_RING_POS_WRAP __BIT(10) +#define ET_RX_RING_POS_INDEX_MASK 0x000003FF +#define ET_RX_RING_POS_WRAP 0x00000400 /* * PCI IDs Modified: stable/7/sys/dev/et/if_etvar.h ============================================================================== --- stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:07:15 2009 (r200783) +++ stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:09:41 2009 (r200784) @@ -106,11 +106,11 @@ struct et_txdesc { uint32_t td_ctrl2; /* ET_TDCTRL2_ */ } __packed; -#define ET_TDCTRL1_LEN __BITS(15, 0) +#define ET_TDCTRL1_LEN_MASK 0x0000FFFF -#define ET_TDCTRL2_LAST_FRAG __BIT(0) -#define ET_TDCTRL2_FIRST_FRAG __BIT(1) -#define ET_TDCTRL2_INTR __BIT(2) +#define ET_TDCTRL2_LAST_FRAG 0x00000001 +#define ET_TDCTRL2_FIRST_FRAG 0x00000002 +#define ET_TDCTRL2_INTR 0x00000004 struct et_rxdesc { uint32_t rd_addr_lo; @@ -118,24 +118,28 @@ struct et_rxdesc { uint32_t rd_ctrl; /* ET_RDCTRL_ */ } __packed; -#define ET_RDCTRL_BUFIDX __BITS(9, 0) +#define ET_RDCTRL_BUFIDX_MASK 0x000003FF struct et_rxstat { uint32_t rxst_info1; uint32_t rxst_info2; /* ET_RXST_INFO2_ */ } __packed; -#define ET_RXST_INFO2_LEN __BITS(15, 0) -#define ET_RXST_INFO2_BUFIDX __BITS(25, 16) -#define ET_RXST_INFO2_RINGIDX __BITS(27, 26) +#define ET_RXST_INFO2_LEN_MASK 0x0000FFFF +#define ET_RXST_INFO2_LEN_SHIFT 0 +#define ET_RXST_INFO2_BUFIDX_MASK 0x03FF0000 +#define ET_RXST_INFO2_BUFIDX_SHIFT 16 +#define ET_RXST_INFO2_RINGIDX_MASK 0x0C000000 +#define ET_RXST_INFO2_RINGIDX_SHIFT 26 struct et_rxstatus { uint32_t rxs_ring; uint32_t rxs_stat_ring; /* ET_RXS_STATRING_ */ } __packed; -#define ET_RXS_STATRING_INDEX __BITS(27, 16) -#define ET_RXS_STATRING_WRAP __BIT(28) +#define ET_RXS_STATRING_INDEX_MASK 0x0FFF0000 +#define ET_RXS_STATRING_INDEX_SHIFT 16 +#define ET_RXS_STATRING_WRAP 0x10000000 struct et_dmamap_ctx { int nsegs; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:16:08 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 390911065693; Mon, 21 Dec 2009 18:16:08 +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 26EA88FC0C; Mon, 21 Dec 2009 18:16:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIG8EA035890; Mon, 21 Dec 2009 18:16:08 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIG8AE035887; Mon, 21 Dec 2009 18:16:08 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211816.nBLIG8AE035887@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200785 - stable/8/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:16:08 -0000 Author: yongari Date: Mon Dec 21 18:16:07 2009 New Revision: 200785 URL: http://svn.freebsd.org/changeset/base/200785 Log: MFC r199550-199552: r199550: Remove support code for FreeBSD 6.x versions. r199551: Destroy driver mutex in device detach. r199552: Add MSI support. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Mon Dec 21 18:09:41 2009 (r200784) +++ stable/8/sys/dev/et/if_et.c Mon Dec 21 18:16:07 2009 (r200785) @@ -76,6 +76,10 @@ MODULE_DEPEND(et, pci, 1, 1, 1); MODULE_DEPEND(et, ether, 1, 1, 1); MODULE_DEPEND(et, miibus, 1, 1, 1); +/* Tunables. */ +static int msi_disable = 0; +TUNABLE_INT("hw.re.msi_disable", &msi_disable); + static int et_probe(device_t); static int et_attach(device_t); static int et_detach(device_t); @@ -230,7 +234,7 @@ et_attach(device_t dev) struct et_softc *sc; struct ifnet *ifp; uint8_t eaddr[ETHER_ADDR_LEN]; - int error; + int cap, error, msic; sc = device_get_softc(dev); sc->dev = dev; @@ -268,13 +272,38 @@ et_attach(device_t dev) sc->sc_mem_bt = rman_get_bustag(sc->sc_mem_res); sc->sc_mem_bh = rman_get_bushandle(sc->sc_mem_res); + msic = 0; + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + sc->sc_expcap = cap; + sc->sc_flags |= ET_FLAG_PCIE; + msic = pci_msi_count(dev); + if (bootverbose) + device_printf(dev, "MSI count : %d\n", msic); + } + if (msic > 0 && msi_disable == 0) { + msic = 1; + if (pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { + device_printf(dev, "Using %d MSI message\n", + msic); + sc->sc_flags |= ET_FLAG_MSI; + } else + pci_release_msi(dev); + } + } + /* * Allocate IRQ */ - sc->sc_irq_rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->sc_irq_rid, - RF_SHAREABLE | RF_ACTIVE); + if ((sc->sc_flags & ET_FLAG_MSI) == 0) { + sc->sc_irq_rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, RF_SHAREABLE | RF_ACTIVE); + } else { + sc->sc_irq_rid = 1; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, RF_ACTIVE); + } if (sc->sc_irq_res == NULL) { device_printf(dev, "can't allocate irq\n"); error = ENXIO; @@ -322,14 +351,8 @@ et_attach(device_t dev) ether_ifattach(ifp, eaddr); callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); -#if __FreeBSD_version > 700030 - error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, et_intr, sc, &sc->sc_irq_handle); -#else error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, - et_intr, sc, &sc->sc_irq_handle); -#endif - + NULL, et_intr, sc, &sc->sc_irq_handle); if (error) { ether_ifdetach(ifp); device_printf(dev, "can't setup intr\n"); @@ -368,6 +391,8 @@ et_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_irq_res); } + if ((sc->sc_flags & ET_FLAG_MSI) != 0) + pci_release_msi(dev); if (sc->sc_mem_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, @@ -378,7 +403,8 @@ et_detach(device_t dev) if_free(sc->ifp); et_dma_free(dev); - /* XXX Destroy lock here */ + + mtx_destroy(&sc->sc_mtx); return 0; } @@ -1437,7 +1463,8 @@ et_chip_init(struct et_softc *sc) CSR_WRITE_4(sc, ET_LOOPBACK, 0); /* Clear MSI configure */ - CSR_WRITE_4(sc, ET_MSI_CFG, 0); + if ((sc->sc_flags & ET_FLAG_MSI) == 0) + CSR_WRITE_4(sc, ET_MSI_CFG, 0); /* Disable timer */ CSR_WRITE_4(sc, ET_TIMER, 0); Modified: stable/8/sys/dev/et/if_etvar.h ============================================================================== --- stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:09:41 2009 (r200784) +++ stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:16:07 2009 (r200785) @@ -238,6 +238,7 @@ struct et_softc { struct arpcom arpcom; int sc_if_flags; uint32_t sc_flags; /* ET_FLAG_ */ + int sc_expcap; int sc_mem_rid; @@ -277,7 +278,9 @@ struct et_softc { #define ET_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define ET_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) -#define ET_FLAG_TXRX_ENABLED 0x1 -#define ET_FLAG_JUMBO 0x2 +#define ET_FLAG_PCIE 0x0001 +#define ET_FLAG_MSI 0x0002 +#define ET_FLAG_TXRX_ENABLED 0x0100 +#define ET_FLAG_JUMBO 0x0200 #endif /* !_IF_ETVAR_H */ From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:18:10 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC9B106566C; Mon, 21 Dec 2009 18:18:10 +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 6B6D38FC13; Mon, 21 Dec 2009 18:18:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIIAA6036007; Mon, 21 Dec 2009 18:18:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIIAgk036004; Mon, 21 Dec 2009 18:18:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211818.nBLIIAgk036004@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200786 - stable/7/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:18:10 -0000 Author: yongari Date: Mon Dec 21 18:18:10 2009 New Revision: 200786 URL: http://svn.freebsd.org/changeset/base/200786 Log: MFC r199550-199552: r199550: Remove support code for FreeBSD 6.x versions. r199551: Destroy driver mutex in device detach. r199552: Add MSI support. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Mon Dec 21 18:16:07 2009 (r200785) +++ stable/7/sys/dev/et/if_et.c Mon Dec 21 18:18:10 2009 (r200786) @@ -76,6 +76,10 @@ MODULE_DEPEND(et, pci, 1, 1, 1); MODULE_DEPEND(et, ether, 1, 1, 1); MODULE_DEPEND(et, miibus, 1, 1, 1); +/* Tunables. */ +static int msi_disable = 0; +TUNABLE_INT("hw.re.msi_disable", &msi_disable); + static int et_probe(device_t); static int et_attach(device_t); static int et_detach(device_t); @@ -230,7 +234,7 @@ et_attach(device_t dev) struct et_softc *sc; struct ifnet *ifp; uint8_t eaddr[ETHER_ADDR_LEN]; - int error; + int cap, error, msic; sc = device_get_softc(dev); sc->dev = dev; @@ -268,13 +272,38 @@ et_attach(device_t dev) sc->sc_mem_bt = rman_get_bustag(sc->sc_mem_res); sc->sc_mem_bh = rman_get_bushandle(sc->sc_mem_res); + msic = 0; + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { + sc->sc_expcap = cap; + sc->sc_flags |= ET_FLAG_PCIE; + msic = pci_msi_count(dev); + if (bootverbose) + device_printf(dev, "MSI count : %d\n", msic); + } + if (msic > 0 && msi_disable == 0) { + msic = 1; + if (pci_alloc_msi(dev, &msic) == 0) { + if (msic == 1) { + device_printf(dev, "Using %d MSI message\n", + msic); + sc->sc_flags |= ET_FLAG_MSI; + } else + pci_release_msi(dev); + } + } + /* * Allocate IRQ */ - sc->sc_irq_rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->sc_irq_rid, - RF_SHAREABLE | RF_ACTIVE); + if ((sc->sc_flags & ET_FLAG_MSI) == 0) { + sc->sc_irq_rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, RF_SHAREABLE | RF_ACTIVE); + } else { + sc->sc_irq_rid = 1; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, RF_ACTIVE); + } if (sc->sc_irq_res == NULL) { device_printf(dev, "can't allocate irq\n"); error = ENXIO; @@ -322,14 +351,8 @@ et_attach(device_t dev) ether_ifattach(ifp, eaddr); callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); -#if __FreeBSD_version > 700030 - error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, et_intr, sc, &sc->sc_irq_handle); -#else error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_NET | INTR_MPSAFE, - et_intr, sc, &sc->sc_irq_handle); -#endif - + NULL, et_intr, sc, &sc->sc_irq_handle); if (error) { ether_ifdetach(ifp); device_printf(dev, "can't setup intr\n"); @@ -368,6 +391,8 @@ et_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, sc->sc_irq_res); } + if ((sc->sc_flags & ET_FLAG_MSI) != 0) + pci_release_msi(dev); if (sc->sc_mem_res != NULL) { bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, @@ -378,7 +403,8 @@ et_detach(device_t dev) if_free(sc->ifp); et_dma_free(dev); - /* XXX Destroy lock here */ + + mtx_destroy(&sc->sc_mtx); return 0; } @@ -1437,7 +1463,8 @@ et_chip_init(struct et_softc *sc) CSR_WRITE_4(sc, ET_LOOPBACK, 0); /* Clear MSI configure */ - CSR_WRITE_4(sc, ET_MSI_CFG, 0); + if ((sc->sc_flags & ET_FLAG_MSI) == 0) + CSR_WRITE_4(sc, ET_MSI_CFG, 0); /* Disable timer */ CSR_WRITE_4(sc, ET_TIMER, 0); Modified: stable/7/sys/dev/et/if_etvar.h ============================================================================== --- stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:16:07 2009 (r200785) +++ stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:18:10 2009 (r200786) @@ -238,6 +238,7 @@ struct et_softc { struct arpcom arpcom; int sc_if_flags; uint32_t sc_flags; /* ET_FLAG_ */ + int sc_expcap; int sc_mem_rid; @@ -277,7 +278,9 @@ struct et_softc { #define ET_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) #define ET_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) -#define ET_FLAG_TXRX_ENABLED 0x1 -#define ET_FLAG_JUMBO 0x2 +#define ET_FLAG_PCIE 0x0001 +#define ET_FLAG_MSI 0x0002 +#define ET_FLAG_TXRX_ENABLED 0x0100 +#define ET_FLAG_JUMBO 0x0200 #endif /* !_IF_ETVAR_H */ From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:28:37 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD1F11065672; Mon, 21 Dec 2009 18:28:37 +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 B97F68FC12; Mon, 21 Dec 2009 18:28:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLISbCv036300; Mon, 21 Dec 2009 18:28:37 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLISbId036296; Mon, 21 Dec 2009 18:28:37 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211828.nBLISbId036296@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200787 - stable/8/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:28:37 -0000 Author: yongari Date: Mon Dec 21 18:28:37 2009 New Revision: 200787 URL: http://svn.freebsd.org/changeset/base/200787 Log: MFC r199553,199556 r199553: Remove extra spce at the EOL. r199556: style(9) Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etreg.h stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Mon Dec 21 18:18:10 2009 (r200786) +++ stable/8/sys/dev/et/if_et.c Mon Dec 21 18:28:37 2009 (r200787) @@ -222,10 +222,10 @@ et_probe(device_t dev) for (d = et_devices; d->desc != NULL; ++d) { if (vid == d->vid && did == d->did) { device_set_desc(dev, d->desc); - return 0; + return (0); } } - return ENXIO; + return (ENXIO); } static int @@ -267,7 +267,7 @@ et_attach(device_t dev) &sc->sc_mem_rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { device_printf(dev, "can't allocate IO memory\n"); - return ENXIO; + return (ENXIO); } sc->sc_mem_bt = rman_get_bustag(sc->sc_mem_res); sc->sc_mem_bh = rman_get_bushandle(sc->sc_mem_res); @@ -361,10 +361,10 @@ et_attach(device_t dev) et_add_sysctls(sc); - return 0; + return (0); fail: et_detach(dev); - return error; + return (error); } static int @@ -406,7 +406,7 @@ et_detach(device_t dev) mtx_destroy(&sc->sc_mtx); - return 0; + return (0); } static int @@ -417,7 +417,7 @@ et_shutdown(device_t dev) ET_LOCK(sc); et_stop(sc); ET_UNLOCK(sc); - return 0; + return (0); } static int @@ -460,7 +460,7 @@ et_miibus_readreg(device_t dev, int phy, back: /* Make sure that the current operation is stopped */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - return ret; + return (ret); } static int @@ -499,7 +499,7 @@ et_miibus_writereg(device_t dev, int phy /* Make sure that the current operation is stopped */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - return 0; + return (0); } static void @@ -522,7 +522,7 @@ et_ifmedia_upd_locked(struct ifnet *ifp) } mii_mediachg(mii); - return 0; + return (0); } static int @@ -535,7 +535,7 @@ et_ifmedia_upd(struct ifnet *ifp) res = et_ifmedia_upd_locked(ifp); ET_UNLOCK(sc); - return res; + return (res); } static void @@ -590,7 +590,7 @@ et_bus_config(device_t dev) val = pci_read_config(dev, ET_PCIR_EEPROM_STATUS, 1); if (val & ET_PCIM_EEPROM_STATUS_ERROR) { device_printf(dev, "EEPROM status error 0x%02x\n", val); - return ENXIO; + return (ENXIO); } /* TODO: LED */ @@ -644,7 +644,7 @@ et_bus_config(device_t dev) val |= ET_PCIV_DEVICE_CTRL_RRSZ_2K; pci_write_config(dev, ET_PCIR_DEVICE_CTRL, val, 2); - return 0; + return (0); } static void @@ -716,7 +716,7 @@ et_dma_alloc(device_t dev) 0, NULL, NULL, &sc->sc_dtag); if (error) { device_printf(dev, "can't create DMA tag\n"); - return error; + return (error); } /* @@ -727,7 +727,7 @@ et_dma_alloc(device_t dev) &tx_ring->tr_paddr, &tx_ring->tr_dmap); if (error) { device_printf(dev, "can't create TX ring DMA stuffs\n"); - return error; + return (error); } /* @@ -738,7 +738,7 @@ et_dma_alloc(device_t dev) &txsd->txsd_paddr, &txsd->txsd_dmap); if (error) { device_printf(dev, "can't create TX status DMA stuffs\n"); - return error; + return (error); } /* @@ -758,7 +758,7 @@ et_dma_alloc(device_t dev) if (error) { device_printf(dev, "can't create DMA stuffs for " "the %d RX ring\n", i); - return error; + return (error); } rx_ring->rr_posreg = rx_ring_posreg[i]; } @@ -772,7 +772,7 @@ et_dma_alloc(device_t dev) &rxst_ring->rsr_paddr, &rxst_ring->rsr_dmap); if (error) { device_printf(dev, "can't create RX stat ring DMA stuffs\n"); - return error; + return (error); } /* @@ -784,7 +784,7 @@ et_dma_alloc(device_t dev) &rxsd->rxsd_paddr, &rxsd->rxsd_dmap); if (error) { device_printf(dev, "can't create RX status DMA stuffs\n"); - return error; + return (error); } /* @@ -792,9 +792,9 @@ et_dma_alloc(device_t dev) */ error = et_dma_mbuf_create(dev); if (error) - return error; + return (error); - return 0; + return (0); } static void @@ -873,7 +873,7 @@ et_dma_mbuf_create(device_t dev) BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_mbuf_dtag); if (error) { device_printf(dev, "can't create mbuf DMA tag\n"); - return error; + return (error); } /* @@ -884,7 +884,7 @@ et_dma_mbuf_create(device_t dev) device_printf(dev, "can't create spare mbuf DMA map\n"); bus_dma_tag_destroy(sc->sc_mbuf_dtag); sc->sc_mbuf_dtag = NULL; - return error; + return (error); } /* @@ -903,7 +903,7 @@ et_dma_mbuf_create(device_t dev) "for %d RX ring\n", j, i); rx_done[i] = j; et_dma_mbuf_destroy(dev, 0, rx_done); - return error; + return (error); } } rx_done[i] = ET_RX_NDESC; @@ -922,11 +922,11 @@ et_dma_mbuf_create(device_t dev) device_printf(dev, "can't create %d TX mbuf " "DMA map\n", i); et_dma_mbuf_destroy(dev, i, rx_done); - return error; + return (error); } } - return 0; + return (0); } static void @@ -991,7 +991,7 @@ et_dma_mem_create(device_t dev, bus_size 0, NULL, NULL, dtag); if (error) { device_printf(dev, "can't create DMA tag\n"); - return error; + return (error); } error = bus_dmamem_alloc(*dtag, addr, BUS_DMA_WAITOK | BUS_DMA_ZERO, @@ -1000,7 +1000,7 @@ et_dma_mem_create(device_t dev, bus_size device_printf(dev, "can't allocate DMA mem\n"); bus_dma_tag_destroy(*dtag); *dtag = NULL; - return error; + return (error); } error = bus_dmamap_load(*dtag, *dmap, *addr, size, @@ -1010,9 +1010,9 @@ et_dma_mem_create(device_t dev, bus_size bus_dmamem_free(*dtag, *addr, *dmap); bus_dma_tag_destroy(*dtag); *dtag = NULL; - return error; + return (error); } - return 0; + return (0); } static void @@ -1230,7 +1230,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, error = ether_ioctl(ifp, cmd, data); break; } - return error; + return (error); } static void @@ -1309,9 +1309,9 @@ et_stop_rxdma(struct et_softc *sc) DELAY(5); if ((CSR_READ_4(sc, ET_RXDMA_CTRL) & ET_RXDMA_CTRL_HALTED) == 0) { if_printf(sc->ifp, "can't stop RX DMA engine\n"); - return ETIMEDOUT; + return (ETIMEDOUT); } - return 0; + return (0); } static int @@ -1319,7 +1319,7 @@ et_stop_txdma(struct et_softc *sc) { CSR_WRITE_4(sc, ET_TXDMA_CTRL, ET_TXDMA_CTRL_HALT | ET_TXDMA_CTRL_SINGLE_EPKT); - return 0; + return (0); } static void @@ -1358,7 +1358,7 @@ et_free_rx_ring(struct et_softc *sc) struct et_rxbuf *rb = &rbd->rbd_buf[i]; if (rb->rb_mbuf != NULL) { - bus_dmamap_unload(sc->sc_mbuf_dtag, + bus_dmamap_unload(sc->sc_mbuf_dtag, rb->rb_dmap); m_freem(rb->rb_mbuf); rb->rb_mbuf = NULL; @@ -1484,14 +1484,14 @@ et_chip_init(struct et_softc *sc) /* Initialize RX DMA engine */ error = et_init_rxdma(sc); if (error) - return error; + return (error); /* Initialize TX DMA engine */ error = et_init_txdma(sc); if (error) - return error; + return (error); - return 0; + return (0); } static int @@ -1512,7 +1512,7 @@ et_init_tx_ring(struct et_softc *sc) bzero(txsd->txsd_status, sizeof(uint32_t)); bus_dmamap_sync(txsd->txsd_dtag, txsd->txsd_dmap, BUS_DMASYNC_PREWRITE); - return 0; + return (0); } static int @@ -1531,7 +1531,7 @@ et_init_rx_ring(struct et_softc *sc) if (error) { if_printf(sc->ifp, "%d ring %d buf, " "newbuf failed: %d\n", n, i, error); - return error; + return (error); } } } @@ -1544,7 +1544,7 @@ et_init_rx_ring(struct et_softc *sc) bus_dmamap_sync(rxst_ring->rsr_dtag, rxst_ring->rsr_dmap, BUS_DMASYNC_PREWRITE); - return 0; + return (0); } static void @@ -1578,7 +1578,7 @@ et_init_rxdma(struct et_softc *sc) error = et_stop_rxdma(sc); if (error) { if_printf(sc->ifp, "can't init RX DMA engine\n"); - return error; + return (error); } /* @@ -1634,7 +1634,7 @@ et_init_rxdma(struct et_softc *sc) CSR_WRITE_4(sc, ET_RX_INTR_NPKTS, sc->sc_rx_intr_npkts); CSR_WRITE_4(sc, ET_RX_INTR_DELAY, sc->sc_rx_intr_delay); - return 0; + return (0); } static int @@ -1647,7 +1647,7 @@ et_init_txdma(struct et_softc *sc) error = et_stop_txdma(sc); if (error) { if_printf(sc->ifp, "can't init TX DMA engine\n"); - return error; + return (error); } /* @@ -1669,7 +1669,7 @@ et_init_txdma(struct et_softc *sc) tx_ring->tr_ready_index = 0; tx_ring->tr_ready_wrap = 0; - return 0; + return (0); } static void @@ -1839,16 +1839,16 @@ et_start_rxdma(struct et_softc *sc) if (CSR_READ_4(sc, ET_RXDMA_CTRL) & ET_RXDMA_CTRL_HALTED) { if_printf(sc->ifp, "can't start RX DMA engine\n"); - return ETIMEDOUT; + return (ETIMEDOUT); } - return 0; + return (0); } static int et_start_txdma(struct et_softc *sc) { CSR_WRITE_4(sc, ET_TXDMA_CTRL, ET_TXDMA_CTRL_SINGLE_EPKT); - return 0; + return (0); } static int @@ -1881,7 +1881,7 @@ et_enable_txrx(struct et_softc *sc, int } if (i == NRETRY) { if_printf(ifp, "can't enable RX/TX\n"); - return 0; + return (0); } sc->sc_flags |= ET_FLAG_TXRX_ENABLED; @@ -1892,13 +1892,13 @@ et_enable_txrx(struct et_softc *sc, int */ error = et_start_rxdma(sc); if (error) - return error; + return (error); error = et_start_txdma(sc); if (error) - return error; + return (error); - return 0; + return (0); } static void @@ -2130,7 +2130,7 @@ back: m_freem(m); *m0 = NULL; } - return error; + return (error); } static void @@ -2218,13 +2218,13 @@ et_tick(void *xsc) static int et_newbuf_cluster(struct et_rxbuf_data *rbd, int buf_idx, int init) { - return et_newbuf(rbd, buf_idx, init, MCLBYTES); + return (et_newbuf(rbd, buf_idx, init, MCLBYTES)); } static int et_newbuf_hdr(struct et_rxbuf_data *rbd, int buf_idx, int init) { - return et_newbuf(rbd, buf_idx, init, MHLEN); + return (et_newbuf(rbd, buf_idx, init, MHLEN)); } static int @@ -2248,7 +2248,7 @@ et_newbuf(struct et_rxbuf_data *rbd, int if (init) { if_printf(sc->ifp, "m_getl failed, size %d\n", len0); - return error; + return (error); } else { goto back; } @@ -2275,7 +2275,7 @@ et_newbuf(struct et_rxbuf_data *rbd, int if (init) { if_printf(sc->ifp, "can't load RX mbuf\n"); - return error; + return (error); } else { goto back; } @@ -2299,7 +2299,7 @@ et_newbuf(struct et_rxbuf_data *rbd, int error = 0; back: et_setup_rxdesc(rbd, buf_idx, rb->rb_paddr); - return error; + return (error); } /* @@ -2349,7 +2349,7 @@ et_sysctl_rx_intr_npkts(SYSCTL_HANDLER_A sc->sc_rx_intr_npkts = v; } back: - return error; + return (error); } static int @@ -2374,7 +2374,7 @@ et_sysctl_rx_intr_delay(SYSCTL_HANDLER_A sc->sc_rx_intr_delay = v; } back: - return error; + return (error); } static void Modified: stable/8/sys/dev/et/if_etreg.h ============================================================================== --- stable/8/sys/dev/et/if_etreg.h Mon Dec 21 18:18:10 2009 (r200786) +++ stable/8/sys/dev/et/if_etreg.h Mon Dec 21 18:28:37 2009 (r200787) @@ -1,13 +1,13 @@ /*- * Copyright (c) 2007 The DragonFly Project. All rights reserved. - * + * * This code is derived from software contributed to The DragonFly Project * by Sepherosa Ziehau - * + * * 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 @@ -17,7 +17,7 @@ * 3. Neither the name of The DragonFly Project nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific, prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -30,7 +30,7 @@ * 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. - * + * * $DragonFly: src/sys/dev/netif/et/if_etreg.h,v 1.3 2007/10/23 14:28:42 sephe Exp $ * $FreeBSD$ */ Modified: stable/8/sys/dev/et/if_etvar.h ============================================================================== --- stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:18:10 2009 (r200786) +++ stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:28:37 2009 (r200787) @@ -1,13 +1,13 @@ /*- * Copyright (c) 2007 The DragonFly Project. All rights reserved. - * + * * This code is derived from software contributed to The DragonFly Project * by Sepherosa Ziehau - * + * * 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 @@ -17,7 +17,7 @@ * 3. Neither the name of The DragonFly Project nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific, prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -30,7 +30,7 @@ * 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. - * + * * $DragonFly: src/sys/dev/netif/et/if_etvar.h,v 1.4 2007/10/23 14:28:42 sephe Exp $ * $FreeBSD$ */ @@ -40,7 +40,7 @@ /* DragonFly compatibility */ #define EVL_ENCAPLEN ETHER_VLAN_ENCAP_LEN - + /* * Allocate the right type of mbuf for the desired total length. */ From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:30:25 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 447CB1065672; Mon, 21 Dec 2009 18:30:25 +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 317248FC14; Mon, 21 Dec 2009 18:30:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIUPDo036406; Mon, 21 Dec 2009 18:30:25 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIUPq4036402; Mon, 21 Dec 2009 18:30:25 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211830.nBLIUPq4036402@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200788 - stable/7/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:30:25 -0000 Author: yongari Date: Mon Dec 21 18:30:24 2009 New Revision: 200788 URL: http://svn.freebsd.org/changeset/base/200788 Log: MFC r199553,199556 r199553: Remove extra spce at the EOL. r199556: style(9) Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etreg.h stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Mon Dec 21 18:28:37 2009 (r200787) +++ stable/7/sys/dev/et/if_et.c Mon Dec 21 18:30:24 2009 (r200788) @@ -222,10 +222,10 @@ et_probe(device_t dev) for (d = et_devices; d->desc != NULL; ++d) { if (vid == d->vid && did == d->did) { device_set_desc(dev, d->desc); - return 0; + return (0); } } - return ENXIO; + return (ENXIO); } static int @@ -267,7 +267,7 @@ et_attach(device_t dev) &sc->sc_mem_rid, RF_ACTIVE); if (sc->sc_mem_res == NULL) { device_printf(dev, "can't allocate IO memory\n"); - return ENXIO; + return (ENXIO); } sc->sc_mem_bt = rman_get_bustag(sc->sc_mem_res); sc->sc_mem_bh = rman_get_bushandle(sc->sc_mem_res); @@ -361,10 +361,10 @@ et_attach(device_t dev) et_add_sysctls(sc); - return 0; + return (0); fail: et_detach(dev); - return error; + return (error); } static int @@ -406,7 +406,7 @@ et_detach(device_t dev) mtx_destroy(&sc->sc_mtx); - return 0; + return (0); } static int @@ -417,7 +417,7 @@ et_shutdown(device_t dev) ET_LOCK(sc); et_stop(sc); ET_UNLOCK(sc); - return 0; + return (0); } static int @@ -460,7 +460,7 @@ et_miibus_readreg(device_t dev, int phy, back: /* Make sure that the current operation is stopped */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - return ret; + return (ret); } static int @@ -499,7 +499,7 @@ et_miibus_writereg(device_t dev, int phy /* Make sure that the current operation is stopped */ CSR_WRITE_4(sc, ET_MII_CMD, 0); - return 0; + return (0); } static void @@ -522,7 +522,7 @@ et_ifmedia_upd_locked(struct ifnet *ifp) } mii_mediachg(mii); - return 0; + return (0); } static int @@ -535,7 +535,7 @@ et_ifmedia_upd(struct ifnet *ifp) res = et_ifmedia_upd_locked(ifp); ET_UNLOCK(sc); - return res; + return (res); } static void @@ -590,7 +590,7 @@ et_bus_config(device_t dev) val = pci_read_config(dev, ET_PCIR_EEPROM_STATUS, 1); if (val & ET_PCIM_EEPROM_STATUS_ERROR) { device_printf(dev, "EEPROM status error 0x%02x\n", val); - return ENXIO; + return (ENXIO); } /* TODO: LED */ @@ -644,7 +644,7 @@ et_bus_config(device_t dev) val |= ET_PCIV_DEVICE_CTRL_RRSZ_2K; pci_write_config(dev, ET_PCIR_DEVICE_CTRL, val, 2); - return 0; + return (0); } static void @@ -716,7 +716,7 @@ et_dma_alloc(device_t dev) 0, NULL, NULL, &sc->sc_dtag); if (error) { device_printf(dev, "can't create DMA tag\n"); - return error; + return (error); } /* @@ -727,7 +727,7 @@ et_dma_alloc(device_t dev) &tx_ring->tr_paddr, &tx_ring->tr_dmap); if (error) { device_printf(dev, "can't create TX ring DMA stuffs\n"); - return error; + return (error); } /* @@ -738,7 +738,7 @@ et_dma_alloc(device_t dev) &txsd->txsd_paddr, &txsd->txsd_dmap); if (error) { device_printf(dev, "can't create TX status DMA stuffs\n"); - return error; + return (error); } /* @@ -758,7 +758,7 @@ et_dma_alloc(device_t dev) if (error) { device_printf(dev, "can't create DMA stuffs for " "the %d RX ring\n", i); - return error; + return (error); } rx_ring->rr_posreg = rx_ring_posreg[i]; } @@ -772,7 +772,7 @@ et_dma_alloc(device_t dev) &rxst_ring->rsr_paddr, &rxst_ring->rsr_dmap); if (error) { device_printf(dev, "can't create RX stat ring DMA stuffs\n"); - return error; + return (error); } /* @@ -784,7 +784,7 @@ et_dma_alloc(device_t dev) &rxsd->rxsd_paddr, &rxsd->rxsd_dmap); if (error) { device_printf(dev, "can't create RX status DMA stuffs\n"); - return error; + return (error); } /* @@ -792,9 +792,9 @@ et_dma_alloc(device_t dev) */ error = et_dma_mbuf_create(dev); if (error) - return error; + return (error); - return 0; + return (0); } static void @@ -873,7 +873,7 @@ et_dma_mbuf_create(device_t dev) BUS_DMA_ALLOCNOW, NULL, NULL, &sc->sc_mbuf_dtag); if (error) { device_printf(dev, "can't create mbuf DMA tag\n"); - return error; + return (error); } /* @@ -884,7 +884,7 @@ et_dma_mbuf_create(device_t dev) device_printf(dev, "can't create spare mbuf DMA map\n"); bus_dma_tag_destroy(sc->sc_mbuf_dtag); sc->sc_mbuf_dtag = NULL; - return error; + return (error); } /* @@ -903,7 +903,7 @@ et_dma_mbuf_create(device_t dev) "for %d RX ring\n", j, i); rx_done[i] = j; et_dma_mbuf_destroy(dev, 0, rx_done); - return error; + return (error); } } rx_done[i] = ET_RX_NDESC; @@ -922,11 +922,11 @@ et_dma_mbuf_create(device_t dev) device_printf(dev, "can't create %d TX mbuf " "DMA map\n", i); et_dma_mbuf_destroy(dev, i, rx_done); - return error; + return (error); } } - return 0; + return (0); } static void @@ -991,7 +991,7 @@ et_dma_mem_create(device_t dev, bus_size 0, NULL, NULL, dtag); if (error) { device_printf(dev, "can't create DMA tag\n"); - return error; + return (error); } error = bus_dmamem_alloc(*dtag, addr, BUS_DMA_WAITOK | BUS_DMA_ZERO, @@ -1000,7 +1000,7 @@ et_dma_mem_create(device_t dev, bus_size device_printf(dev, "can't allocate DMA mem\n"); bus_dma_tag_destroy(*dtag); *dtag = NULL; - return error; + return (error); } error = bus_dmamap_load(*dtag, *dmap, *addr, size, @@ -1010,9 +1010,9 @@ et_dma_mem_create(device_t dev, bus_size bus_dmamem_free(*dtag, *addr, *dmap); bus_dma_tag_destroy(*dtag); *dtag = NULL; - return error; + return (error); } - return 0; + return (0); } static void @@ -1230,7 +1230,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, error = ether_ioctl(ifp, cmd, data); break; } - return error; + return (error); } static void @@ -1309,9 +1309,9 @@ et_stop_rxdma(struct et_softc *sc) DELAY(5); if ((CSR_READ_4(sc, ET_RXDMA_CTRL) & ET_RXDMA_CTRL_HALTED) == 0) { if_printf(sc->ifp, "can't stop RX DMA engine\n"); - return ETIMEDOUT; + return (ETIMEDOUT); } - return 0; + return (0); } static int @@ -1319,7 +1319,7 @@ et_stop_txdma(struct et_softc *sc) { CSR_WRITE_4(sc, ET_TXDMA_CTRL, ET_TXDMA_CTRL_HALT | ET_TXDMA_CTRL_SINGLE_EPKT); - return 0; + return (0); } static void @@ -1358,7 +1358,7 @@ et_free_rx_ring(struct et_softc *sc) struct et_rxbuf *rb = &rbd->rbd_buf[i]; if (rb->rb_mbuf != NULL) { - bus_dmamap_unload(sc->sc_mbuf_dtag, + bus_dmamap_unload(sc->sc_mbuf_dtag, rb->rb_dmap); m_freem(rb->rb_mbuf); rb->rb_mbuf = NULL; @@ -1484,14 +1484,14 @@ et_chip_init(struct et_softc *sc) /* Initialize RX DMA engine */ error = et_init_rxdma(sc); if (error) - return error; + return (error); /* Initialize TX DMA engine */ error = et_init_txdma(sc); if (error) - return error; + return (error); - return 0; + return (0); } static int @@ -1512,7 +1512,7 @@ et_init_tx_ring(struct et_softc *sc) bzero(txsd->txsd_status, sizeof(uint32_t)); bus_dmamap_sync(txsd->txsd_dtag, txsd->txsd_dmap, BUS_DMASYNC_PREWRITE); - return 0; + return (0); } static int @@ -1531,7 +1531,7 @@ et_init_rx_ring(struct et_softc *sc) if (error) { if_printf(sc->ifp, "%d ring %d buf, " "newbuf failed: %d\n", n, i, error); - return error; + return (error); } } } @@ -1544,7 +1544,7 @@ et_init_rx_ring(struct et_softc *sc) bus_dmamap_sync(rxst_ring->rsr_dtag, rxst_ring->rsr_dmap, BUS_DMASYNC_PREWRITE); - return 0; + return (0); } static void @@ -1578,7 +1578,7 @@ et_init_rxdma(struct et_softc *sc) error = et_stop_rxdma(sc); if (error) { if_printf(sc->ifp, "can't init RX DMA engine\n"); - return error; + return (error); } /* @@ -1634,7 +1634,7 @@ et_init_rxdma(struct et_softc *sc) CSR_WRITE_4(sc, ET_RX_INTR_NPKTS, sc->sc_rx_intr_npkts); CSR_WRITE_4(sc, ET_RX_INTR_DELAY, sc->sc_rx_intr_delay); - return 0; + return (0); } static int @@ -1647,7 +1647,7 @@ et_init_txdma(struct et_softc *sc) error = et_stop_txdma(sc); if (error) { if_printf(sc->ifp, "can't init TX DMA engine\n"); - return error; + return (error); } /* @@ -1669,7 +1669,7 @@ et_init_txdma(struct et_softc *sc) tx_ring->tr_ready_index = 0; tx_ring->tr_ready_wrap = 0; - return 0; + return (0); } static void @@ -1839,16 +1839,16 @@ et_start_rxdma(struct et_softc *sc) if (CSR_READ_4(sc, ET_RXDMA_CTRL) & ET_RXDMA_CTRL_HALTED) { if_printf(sc->ifp, "can't start RX DMA engine\n"); - return ETIMEDOUT; + return (ETIMEDOUT); } - return 0; + return (0); } static int et_start_txdma(struct et_softc *sc) { CSR_WRITE_4(sc, ET_TXDMA_CTRL, ET_TXDMA_CTRL_SINGLE_EPKT); - return 0; + return (0); } static int @@ -1881,7 +1881,7 @@ et_enable_txrx(struct et_softc *sc, int } if (i == NRETRY) { if_printf(ifp, "can't enable RX/TX\n"); - return 0; + return (0); } sc->sc_flags |= ET_FLAG_TXRX_ENABLED; @@ -1892,13 +1892,13 @@ et_enable_txrx(struct et_softc *sc, int */ error = et_start_rxdma(sc); if (error) - return error; + return (error); error = et_start_txdma(sc); if (error) - return error; + return (error); - return 0; + return (0); } static void @@ -2130,7 +2130,7 @@ back: m_freem(m); *m0 = NULL; } - return error; + return (error); } static void @@ -2218,13 +2218,13 @@ et_tick(void *xsc) static int et_newbuf_cluster(struct et_rxbuf_data *rbd, int buf_idx, int init) { - return et_newbuf(rbd, buf_idx, init, MCLBYTES); + return (et_newbuf(rbd, buf_idx, init, MCLBYTES)); } static int et_newbuf_hdr(struct et_rxbuf_data *rbd, int buf_idx, int init) { - return et_newbuf(rbd, buf_idx, init, MHLEN); + return (et_newbuf(rbd, buf_idx, init, MHLEN)); } static int @@ -2248,7 +2248,7 @@ et_newbuf(struct et_rxbuf_data *rbd, int if (init) { if_printf(sc->ifp, "m_getl failed, size %d\n", len0); - return error; + return (error); } else { goto back; } @@ -2275,7 +2275,7 @@ et_newbuf(struct et_rxbuf_data *rbd, int if (init) { if_printf(sc->ifp, "can't load RX mbuf\n"); - return error; + return (error); } else { goto back; } @@ -2299,7 +2299,7 @@ et_newbuf(struct et_rxbuf_data *rbd, int error = 0; back: et_setup_rxdesc(rbd, buf_idx, rb->rb_paddr); - return error; + return (error); } /* @@ -2349,7 +2349,7 @@ et_sysctl_rx_intr_npkts(SYSCTL_HANDLER_A sc->sc_rx_intr_npkts = v; } back: - return error; + return (error); } static int @@ -2374,7 +2374,7 @@ et_sysctl_rx_intr_delay(SYSCTL_HANDLER_A sc->sc_rx_intr_delay = v; } back: - return error; + return (error); } static void Modified: stable/7/sys/dev/et/if_etreg.h ============================================================================== --- stable/7/sys/dev/et/if_etreg.h Mon Dec 21 18:28:37 2009 (r200787) +++ stable/7/sys/dev/et/if_etreg.h Mon Dec 21 18:30:24 2009 (r200788) @@ -1,13 +1,13 @@ /*- * Copyright (c) 2007 The DragonFly Project. All rights reserved. - * + * * This code is derived from software contributed to The DragonFly Project * by Sepherosa Ziehau - * + * * 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 @@ -17,7 +17,7 @@ * 3. Neither the name of The DragonFly Project nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific, prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -30,7 +30,7 @@ * 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. - * + * * $DragonFly: src/sys/dev/netif/et/if_etreg.h,v 1.3 2007/10/23 14:28:42 sephe Exp $ * $FreeBSD$ */ Modified: stable/7/sys/dev/et/if_etvar.h ============================================================================== --- stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:28:37 2009 (r200787) +++ stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:30:24 2009 (r200788) @@ -1,13 +1,13 @@ /*- * Copyright (c) 2007 The DragonFly Project. All rights reserved. - * + * * This code is derived from software contributed to The DragonFly Project * by Sepherosa Ziehau - * + * * 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 @@ -17,7 +17,7 @@ * 3. Neither the name of The DragonFly Project nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific, prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -30,7 +30,7 @@ * 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. - * + * * $DragonFly: src/sys/dev/netif/et/if_etvar.h,v 1.4 2007/10/23 14:28:42 sephe Exp $ * $FreeBSD$ */ @@ -40,7 +40,7 @@ /* DragonFly compatibility */ #define EVL_ENCAPLEN ETHER_VLAN_ENCAP_LEN - + /* * Allocate the right type of mbuf for the desired total length. */ From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:34:19 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E05A106566B; Mon, 21 Dec 2009 18:34:19 +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 2B7928FC08; Mon, 21 Dec 2009 18:34:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIYJ5v036561; Mon, 21 Dec 2009 18:34:19 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIYJWq036558; Mon, 21 Dec 2009 18:34:19 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211834.nBLIYJWq036558@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200789 - stable/8/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:34:19 -0000 Author: yongari Date: Mon Dec 21 18:34:18 2009 New Revision: 200789 URL: http://svn.freebsd.org/changeset/base/200789 Log: MFC r199558,199561 r199558: Use bus_{read,write}_4 rather than bus_space_{read,write}_4. r199561: Use capability pointer to access PCIe registers rather than directly access them at fixed address. Frequently the register offset could be changed if additional PCI capabilities are added to controller. One odd thing is ET_PCIR_L0S_L1_LATENCY register. I think it's PCIe link capabilities register but the location of the register does not match with PCIe capability pointer + offset. I'm not sure it's shadow register of PCIe link capabilities register. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Mon Dec 21 18:30:24 2009 (r200788) +++ stable/8/sys/dev/et/if_et.c Mon Dec 21 18:34:18 2009 (r200789) @@ -142,7 +142,7 @@ static int et_stop_rxdma(struct et_softc static int et_stop_txdma(struct et_softc *); static int et_enable_txrx(struct et_softc *, int); static void et_reset(struct et_softc *); -static int et_bus_config(device_t); +static int et_bus_config(struct et_softc *); static void et_get_eaddr(device_t, uint8_t[]); static void et_setmulti(struct et_softc *); static void et_tick(void *); @@ -269,8 +269,6 @@ et_attach(device_t dev) device_printf(dev, "can't allocate IO memory\n"); return (ENXIO); } - sc->sc_mem_bt = rman_get_bustag(sc->sc_mem_res); - sc->sc_mem_bh = rman_get_bushandle(sc->sc_mem_res); msic = 0; if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { @@ -310,7 +308,7 @@ et_attach(device_t dev) goto fail; } - error = et_bus_config(dev); + error = et_bus_config(sc); if (error) goto fail; @@ -577,7 +575,7 @@ et_stop(struct et_softc *sc) } static int -et_bus_config(device_t dev) +et_bus_config(struct et_softc *sc) { uint32_t val, max_plsz; uint16_t ack_latency, replay_timer; @@ -586,21 +584,25 @@ et_bus_config(device_t dev) * Test whether EEPROM is valid * NOTE: Read twice to get the correct value */ - pci_read_config(dev, ET_PCIR_EEPROM_STATUS, 1); - val = pci_read_config(dev, ET_PCIR_EEPROM_STATUS, 1); + pci_read_config(sc->dev, ET_PCIR_EEPROM_STATUS, 1); + val = pci_read_config(sc->dev, ET_PCIR_EEPROM_STATUS, 1); if (val & ET_PCIM_EEPROM_STATUS_ERROR) { - device_printf(dev, "EEPROM status error 0x%02x\n", val); + device_printf(sc->dev, "EEPROM status error 0x%02x\n", val); return (ENXIO); } /* TODO: LED */ + if ((sc->sc_flags & ET_FLAG_PCIE) == 0) + return (0); + /* * Configure ACK latency and replay timer according to * max playload size */ - val = pci_read_config(dev, ET_PCIR_DEVICE_CAPS, 4); - max_plsz = val & ET_PCIM_DEVICE_CAPS_MAX_PLSZ; + val = pci_read_config(sc->dev, + sc->sc_expcap + PCIR_EXPRESS_DEVICE_CAP, 4); + max_plsz = val & PCIM_EXP_CAP_MAX_PAYLOAD; switch (max_plsz) { case ET_PCIV_DEVICE_CAPS_PLSZ_128: @@ -614,35 +616,39 @@ et_bus_config(device_t dev) break; default: - ack_latency = pci_read_config(dev, ET_PCIR_ACK_LATENCY, 2); - replay_timer = pci_read_config(dev, ET_PCIR_REPLAY_TIMER, 2); - device_printf(dev, "ack latency %u, replay timer %u\n", + ack_latency = pci_read_config(sc->dev, ET_PCIR_ACK_LATENCY, 2); + replay_timer = pci_read_config(sc->dev, + ET_PCIR_REPLAY_TIMER, 2); + device_printf(sc->dev, "ack latency %u, replay timer %u\n", ack_latency, replay_timer); break; } if (ack_latency != 0) { - pci_write_config(dev, ET_PCIR_ACK_LATENCY, ack_latency, 2); - pci_write_config(dev, ET_PCIR_REPLAY_TIMER, replay_timer, 2); + pci_write_config(sc->dev, ET_PCIR_ACK_LATENCY, ack_latency, 2); + pci_write_config(sc->dev, ET_PCIR_REPLAY_TIMER, replay_timer, + 2); } /* * Set L0s and L1 latency timer to 2us */ - val = pci_read_config(dev, ET_PCIR_L0S_L1_LATENCY, 4); + val = pci_read_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, 4); val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); /* L0s exit latency : 2us */ val |= 0x00005000; /* L1 exit latency : 2us */ val |= 0x00028000; - pci_write_config(dev, ET_PCIR_L0S_L1_LATENCY, val, 4); + pci_write_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, val, 4); /* * Set max read request size to 2048 bytes */ - val = pci_read_config(dev, ET_PCIR_DEVICE_CTRL, 2); - val &= ~ET_PCIM_DEVICE_CTRL_MAX_RRSZ; + val = pci_read_config(sc->dev, + sc->sc_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; val |= ET_PCIV_DEVICE_CTRL_RRSZ_2K; - pci_write_config(dev, ET_PCIR_DEVICE_CTRL, val, 2); + pci_write_config(sc->dev, + sc->sc_expcap + PCIR_EXPRESS_DEVICE_CTL, val, 2); return (0); } Modified: stable/8/sys/dev/et/if_etvar.h ============================================================================== --- stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:30:24 2009 (r200788) +++ stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:34:18 2009 (r200789) @@ -92,9 +92,9 @@ m_getl(int len, int how, int type, int f #define ET_JUMBO_MEM_SIZE (ET_JSLOTS * ET_JLEN) #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4((sc)->sc_mem_bt, (sc)->sc_mem_bh, (reg), (val)) + bus_write_4((sc)->sc_mem_res, (reg), (val)) #define CSR_READ_4(sc, reg) \ - bus_space_read_4((sc)->sc_mem_bt, (sc)->sc_mem_bh, (reg)) + bus_read_4((sc)->sc_mem_res, (reg)) #define ET_ADDR_HI(addr) ((uint64_t) (addr) >> 32) #define ET_ADDR_LO(addr) ((uint64_t) (addr) & 0xffffffff) @@ -229,8 +229,6 @@ struct et_softc { device_t dev; struct mtx sc_mtx; device_t sc_miibus; - bus_space_handle_t sc_mem_bh; - bus_space_tag_t sc_mem_bt; void *sc_irq_handle; struct resource *sc_irq_res; struct resource *sc_mem_res; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:36:15 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9A19106566B; Mon, 21 Dec 2009 18:36:15 +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 A74778FC12; Mon, 21 Dec 2009 18:36:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIaFdv036667; Mon, 21 Dec 2009 18:36:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIaFKI036664; Mon, 21 Dec 2009 18:36:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211836.nBLIaFKI036664@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:36:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200790 - stable/7/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:36:15 -0000 Author: yongari Date: Mon Dec 21 18:36:15 2009 New Revision: 200790 URL: http://svn.freebsd.org/changeset/base/200790 Log: MFC r199558,199561 r199558: Use bus_{read,write}_4 rather than bus_space_{read,write}_4. r199561: Use capability pointer to access PCIe registers rather than directly access them at fixed address. Frequently the register offset could be changed if additional PCI capabilities are added to controller. One odd thing is ET_PCIR_L0S_L1_LATENCY register. I think it's PCIe link capabilities register but the location of the register does not match with PCIe capability pointer + offset. I'm not sure it's shadow register of PCIe link capabilities register. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Mon Dec 21 18:34:18 2009 (r200789) +++ stable/7/sys/dev/et/if_et.c Mon Dec 21 18:36:15 2009 (r200790) @@ -142,7 +142,7 @@ static int et_stop_rxdma(struct et_softc static int et_stop_txdma(struct et_softc *); static int et_enable_txrx(struct et_softc *, int); static void et_reset(struct et_softc *); -static int et_bus_config(device_t); +static int et_bus_config(struct et_softc *); static void et_get_eaddr(device_t, uint8_t[]); static void et_setmulti(struct et_softc *); static void et_tick(void *); @@ -269,8 +269,6 @@ et_attach(device_t dev) device_printf(dev, "can't allocate IO memory\n"); return (ENXIO); } - sc->sc_mem_bt = rman_get_bustag(sc->sc_mem_res); - sc->sc_mem_bh = rman_get_bushandle(sc->sc_mem_res); msic = 0; if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) == 0) { @@ -310,7 +308,7 @@ et_attach(device_t dev) goto fail; } - error = et_bus_config(dev); + error = et_bus_config(sc); if (error) goto fail; @@ -577,7 +575,7 @@ et_stop(struct et_softc *sc) } static int -et_bus_config(device_t dev) +et_bus_config(struct et_softc *sc) { uint32_t val, max_plsz; uint16_t ack_latency, replay_timer; @@ -586,21 +584,25 @@ et_bus_config(device_t dev) * Test whether EEPROM is valid * NOTE: Read twice to get the correct value */ - pci_read_config(dev, ET_PCIR_EEPROM_STATUS, 1); - val = pci_read_config(dev, ET_PCIR_EEPROM_STATUS, 1); + pci_read_config(sc->dev, ET_PCIR_EEPROM_STATUS, 1); + val = pci_read_config(sc->dev, ET_PCIR_EEPROM_STATUS, 1); if (val & ET_PCIM_EEPROM_STATUS_ERROR) { - device_printf(dev, "EEPROM status error 0x%02x\n", val); + device_printf(sc->dev, "EEPROM status error 0x%02x\n", val); return (ENXIO); } /* TODO: LED */ + if ((sc->sc_flags & ET_FLAG_PCIE) == 0) + return (0); + /* * Configure ACK latency and replay timer according to * max playload size */ - val = pci_read_config(dev, ET_PCIR_DEVICE_CAPS, 4); - max_plsz = val & ET_PCIM_DEVICE_CAPS_MAX_PLSZ; + val = pci_read_config(sc->dev, + sc->sc_expcap + PCIR_EXPRESS_DEVICE_CAP, 4); + max_plsz = val & PCIM_EXP_CAP_MAX_PAYLOAD; switch (max_plsz) { case ET_PCIV_DEVICE_CAPS_PLSZ_128: @@ -614,35 +616,39 @@ et_bus_config(device_t dev) break; default: - ack_latency = pci_read_config(dev, ET_PCIR_ACK_LATENCY, 2); - replay_timer = pci_read_config(dev, ET_PCIR_REPLAY_TIMER, 2); - device_printf(dev, "ack latency %u, replay timer %u\n", + ack_latency = pci_read_config(sc->dev, ET_PCIR_ACK_LATENCY, 2); + replay_timer = pci_read_config(sc->dev, + ET_PCIR_REPLAY_TIMER, 2); + device_printf(sc->dev, "ack latency %u, replay timer %u\n", ack_latency, replay_timer); break; } if (ack_latency != 0) { - pci_write_config(dev, ET_PCIR_ACK_LATENCY, ack_latency, 2); - pci_write_config(dev, ET_PCIR_REPLAY_TIMER, replay_timer, 2); + pci_write_config(sc->dev, ET_PCIR_ACK_LATENCY, ack_latency, 2); + pci_write_config(sc->dev, ET_PCIR_REPLAY_TIMER, replay_timer, + 2); } /* * Set L0s and L1 latency timer to 2us */ - val = pci_read_config(dev, ET_PCIR_L0S_L1_LATENCY, 4); + val = pci_read_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, 4); val &= ~(PCIM_LINK_CAP_L0S_EXIT | PCIM_LINK_CAP_L1_EXIT); /* L0s exit latency : 2us */ val |= 0x00005000; /* L1 exit latency : 2us */ val |= 0x00028000; - pci_write_config(dev, ET_PCIR_L0S_L1_LATENCY, val, 4); + pci_write_config(sc->dev, ET_PCIR_L0S_L1_LATENCY, val, 4); /* * Set max read request size to 2048 bytes */ - val = pci_read_config(dev, ET_PCIR_DEVICE_CTRL, 2); - val &= ~ET_PCIM_DEVICE_CTRL_MAX_RRSZ; + val = pci_read_config(sc->dev, + sc->sc_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; val |= ET_PCIV_DEVICE_CTRL_RRSZ_2K; - pci_write_config(dev, ET_PCIR_DEVICE_CTRL, val, 2); + pci_write_config(sc->dev, + sc->sc_expcap + PCIR_EXPRESS_DEVICE_CTL, val, 2); return (0); } Modified: stable/7/sys/dev/et/if_etvar.h ============================================================================== --- stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:34:18 2009 (r200789) +++ stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:36:15 2009 (r200790) @@ -92,9 +92,9 @@ m_getl(int len, int how, int type, int f #define ET_JUMBO_MEM_SIZE (ET_JSLOTS * ET_JLEN) #define CSR_WRITE_4(sc, reg, val) \ - bus_space_write_4((sc)->sc_mem_bt, (sc)->sc_mem_bh, (reg), (val)) + bus_write_4((sc)->sc_mem_res, (reg), (val)) #define CSR_READ_4(sc, reg) \ - bus_space_read_4((sc)->sc_mem_bt, (sc)->sc_mem_bh, (reg)) + bus_read_4((sc)->sc_mem_res, (reg)) #define ET_ADDR_HI(addr) ((uint64_t) (addr) >> 32) #define ET_ADDR_LO(addr) ((uint64_t) (addr) & 0xffffffff) @@ -229,8 +229,6 @@ struct et_softc { device_t dev; struct mtx sc_mtx; device_t sc_miibus; - bus_space_handle_t sc_mem_bh; - bus_space_tag_t sc_mem_bt; void *sc_irq_handle; struct resource *sc_irq_res; struct resource *sc_mem_res; From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:52:39 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5432E106568B; Mon, 21 Dec 2009 18:52:39 +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 416A08FC08; Mon, 21 Dec 2009 18:52:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIqdlN037151; Mon, 21 Dec 2009 18:52:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIqdrO037148; Mon, 21 Dec 2009 18:52:39 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211852.nBLIqdrO037148@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200791 - stable/8/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:52:39 -0000 Author: yongari Date: Mon Dec 21 18:52:38 2009 New Revision: 200791 URL: http://svn.freebsd.org/changeset/base/200791 Log: MFC r199563,199608-199613 r199563: Fix copy & paste error and remove extra space before colon. r199608: Remove unnecessary structure packing. r199609: Add initial endianness support. It seems the controller supports both big-endian and little-endian format in descriptors for Rx path but I couldn't find equivalent feature in Tx path. So just stick to little-endian for now. r199610: Because we know received bytes including CRC there is no reason to call m_adj(9). The controller also seems to have a capability to strip CRC bytes but I failed to activate this feature except for loopback traffic. r199611: Add IPv4/TCP/UDP Tx checksum offloading support. It seems the controller also has support for IP/TCP checksum offloading for Rx path. But I failed to find to way to enable Rx MAC to compute the checksum of received frames. r199612: Add __FBSDID. r199613: Only Tx checksum offloading is supported now. Remove experimental code sneaked in r199611. Modified: stable/8/sys/dev/et/if_et.c stable/8/sys/dev/et/if_etvar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/et/if_et.c ============================================================================== --- stable/8/sys/dev/et/if_et.c Mon Dec 21 18:36:15 2009 (r200790) +++ stable/8/sys/dev/et/if_et.c Mon Dec 21 18:52:38 2009 (r200791) @@ -32,9 +32,11 @@ * SUCH DAMAGE. * * $DragonFly: src/sys/dev/netif/et/if_et.c,v 1.10 2008/05/18 07:47:14 sephe Exp $ - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -78,7 +80,9 @@ MODULE_DEPEND(et, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; -TUNABLE_INT("hw.re.msi_disable", &msi_disable); +TUNABLE_INT("hw.et.msi_disable", &msi_disable); + +#define ET_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) static int et_probe(device_t); static int et_attach(device_t); @@ -276,7 +280,7 @@ et_attach(device_t dev) sc->sc_flags |= ET_FLAG_PCIE; msic = pci_msi_count(dev); if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI count: %d\n", msic); } if (msic > 0 && msi_disable == 0) { msic = 1; @@ -332,7 +336,7 @@ et_attach(device_t dev) ifp->if_ioctl = et_ioctl; ifp->if_start = et_start; ifp->if_mtu = ETHERMTU; - ifp->if_capabilities = IFCAP_VLAN_MTU; + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC); IFQ_SET_READY(&ifp->if_snd); @@ -1175,7 +1179,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, struct et_softc *sc = ifp->if_softc; struct mii_data *mii = device_get_softc(sc->sc_miibus); struct ifreq *ifr = (struct ifreq *)data; - int error = 0, max_framelen; + int error = 0, mask, max_framelen; /* XXX LOCKSUSED */ switch (cmd) { @@ -1232,6 +1236,20 @@ et_ioctl(struct ifnet *ifp, u_long cmd, } break; + case SIOCSIFCAP: + ET_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_TXCSUM) != 0 && + (IFCAP_TXCSUM & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((IFCAP_TXCSUM & ifp->if_capenable) != 0) + ifp->if_hwassist |= ET_CSUM_FEATURES; + else + ifp->if_hwassist &= ~ET_CSUM_FEATURES; + } + ET_UNLOCK(sc); + break; + default: error = ether_ioctl(ifp, cmd, data); break; @@ -1913,7 +1931,7 @@ et_rxeof(struct et_softc *sc) struct ifnet *ifp; struct et_rxstatus_data *rxsd; struct et_rxstat_ring *rxst_ring; - uint32_t rxs_stat_ring; + uint32_t rxs_stat_ring, rxst_info2; int rxst_wrap, rxst_index; ET_LOCK_ASSERT(sc); @@ -1929,7 +1947,7 @@ et_rxeof(struct et_softc *sc) bus_dmamap_sync(rxst_ring->rsr_dtag, rxst_ring->rsr_dmap, BUS_DMASYNC_POSTREAD); - rxs_stat_ring = rxsd->rxsd_status->rxs_stat_ring; + rxs_stat_ring = le32toh(rxsd->rxsd_status->rxs_stat_ring); rxst_wrap = (rxs_stat_ring & ET_RXS_STATRING_WRAP) ? 1 : 0; rxst_index = (rxs_stat_ring & ET_RXS_STATRING_INDEX_MASK) >> ET_RXS_STATRING_INDEX_SHIFT; @@ -1945,12 +1963,12 @@ et_rxeof(struct et_softc *sc) MPASS(rxst_ring->rsr_index < ET_RX_NSTAT); st = &rxst_ring->rsr_stat[rxst_ring->rsr_index]; - - buflen = (st->rxst_info2 & ET_RXST_INFO2_LEN_MASK) >> + rxst_info2 = le32toh(st->rxst_info2); + buflen = (rxst_info2 & ET_RXST_INFO2_LEN_MASK) >> ET_RXST_INFO2_LEN_SHIFT; - buf_idx = (st->rxst_info2 & ET_RXST_INFO2_BUFIDX_MASK) >> + buf_idx = (rxst_info2 & ET_RXST_INFO2_BUFIDX_MASK) >> ET_RXST_INFO2_BUFIDX_SHIFT; - ring_idx = (st->rxst_info2 & ET_RXST_INFO2_RINGIDX_MASK) >> + ring_idx = (rxst_info2 & ET_RXST_INFO2_RINGIDX_MASK) >> ET_RXST_INFO2_RINGIDX_SHIFT; if (++rxst_ring->rsr_index == ET_RX_NSTAT) { @@ -1982,11 +2000,9 @@ et_rxeof(struct et_softc *sc) m = NULL; ifp->if_ierrors++; } else { - m->m_pkthdr.len = m->m_len = buflen; + m->m_pkthdr.len = m->m_len = + buflen - ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; - - m_adj(m, -ETHER_CRC_LEN); - ifp->if_ipackets++; ET_UNLOCK(sc); ifp->if_input(ifp, m); @@ -2028,7 +2044,7 @@ et_encap(struct et_softc *sc, struct mbu struct et_txdesc *td; bus_dmamap_t map; int error, maxsegs, first_idx, last_idx, i; - uint32_t tx_ready_pos, last_td_ctrl2; + uint32_t csum_flags, tx_ready_pos, last_td_ctrl2; maxsegs = ET_TX_NDESC - tbd->tbd_used; if (maxsegs > ET_NSEG_MAX) @@ -2090,20 +2106,29 @@ et_encap(struct et_softc *sc, struct mbu last_td_ctrl2 |= ET_TDCTRL2_INTR; } + csum_flags = 0; + if ((m->m_pkthdr.csum_flags & ET_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) + csum_flags |= ET_TDCTRL2_CSUM_IP; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + csum_flags |= ET_TDCTRL2_CSUM_UDP; + else if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) + csum_flags |= ET_TDCTRL2_CSUM_TCP; + } last_idx = -1; for (i = 0; i < ctx.nsegs; ++i) { int idx; idx = (first_idx + i) % ET_TX_NDESC; td = &tx_ring->tr_desc[idx]; - td->td_addr_hi = ET_ADDR_HI(segs[i].ds_addr); - td->td_addr_lo = ET_ADDR_LO(segs[i].ds_addr); - td->td_ctrl1 = segs[i].ds_len & ET_TDCTRL1_LEN_MASK; - + td->td_addr_hi = htole32(ET_ADDR_HI(segs[i].ds_addr)); + td->td_addr_lo = htole32(ET_ADDR_LO(segs[i].ds_addr)); + td->td_ctrl1 = htole32(segs[i].ds_len & ET_TDCTRL1_LEN_MASK); if (i == ctx.nsegs - 1) { /* Last frag */ - td->td_ctrl2 = last_td_ctrl2; + td->td_ctrl2 = htole32(last_td_ctrl2 | csum_flags); last_idx = idx; - } + } else + td->td_ctrl2 = htole32(csum_flags); MPASS(tx_ring->tr_ready_index < ET_TX_NDESC); if (++tx_ring->tr_ready_index == ET_TX_NDESC) { @@ -2112,7 +2137,7 @@ et_encap(struct et_softc *sc, struct mbu } } td = &tx_ring->tr_desc[first_idx]; - td->td_ctrl2 |= ET_TDCTRL2_FIRST_FRAG; /* First frag */ + td->td_ctrl2 |= htole32(ET_TDCTRL2_FIRST_FRAG); /* First frag */ MPASS(last_idx >= 0); tbd->tbd_buf[first_idx].tb_dmap = tbd->tbd_buf[last_idx].tb_dmap; @@ -2424,9 +2449,9 @@ et_setup_rxdesc(struct et_rxbuf_data *rb MPASS(buf_idx < ET_RX_NDESC); desc = &rx_ring->rr_desc[buf_idx]; - desc->rd_addr_hi = ET_ADDR_HI(paddr); - desc->rd_addr_lo = ET_ADDR_LO(paddr); - desc->rd_ctrl = buf_idx & ET_RDCTRL_BUFIDX_MASK; + desc->rd_addr_hi = htole32(ET_ADDR_HI(paddr)); + desc->rd_addr_lo = htole32(ET_ADDR_LO(paddr)); + desc->rd_ctrl = htole32(buf_idx & ET_RDCTRL_BUFIDX_MASK); bus_dmamap_sync(rx_ring->rr_dtag, rx_ring->rr_dmap, BUS_DMASYNC_PREWRITE); Modified: stable/8/sys/dev/et/if_etvar.h ============================================================================== --- stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:36:15 2009 (r200790) +++ stable/8/sys/dev/et/if_etvar.h Mon Dec 21 18:52:38 2009 (r200791) @@ -104,26 +104,38 @@ struct et_txdesc { uint32_t td_addr_lo; uint32_t td_ctrl1; /* ET_TDCTRL1_ */ uint32_t td_ctrl2; /* ET_TDCTRL2_ */ -} __packed; +}; #define ET_TDCTRL1_LEN_MASK 0x0000FFFF #define ET_TDCTRL2_LAST_FRAG 0x00000001 #define ET_TDCTRL2_FIRST_FRAG 0x00000002 #define ET_TDCTRL2_INTR 0x00000004 +#define ET_TDCTRL2_CTRL_WORD 0x00000008 +#define ET_TDCTRL2_HDX_BACKP 0x00000010 +#define ET_TDCTRL2_XMIT_PAUSE 0x00000020 +#define ET_TDCTRL2_FRAME_ERR 0x00000040 +#define ET_TDCTRL2_NO_CRC 0x00000080 +#define ET_TDCTRL2_MAC_OVRRD 0x00000100 +#define ET_TDCTRL2_PAD_PACKET 0x00000200 +#define ET_TDCTRL2_JUMBO_PACKET 0x00000400 +#define ET_TDCTRL2_INS_VLAN 0x00000800 +#define ET_TDCTRL2_CSUM_IP 0x00001000 +#define ET_TDCTRL2_CSUM_TCP 0x00002000 +#define ET_TDCTRL2_CSUM_UDP 0x00004000 struct et_rxdesc { uint32_t rd_addr_lo; uint32_t rd_addr_hi; uint32_t rd_ctrl; /* ET_RDCTRL_ */ -} __packed; +}; #define ET_RDCTRL_BUFIDX_MASK 0x000003FF struct et_rxstat { uint32_t rxst_info1; uint32_t rxst_info2; /* ET_RXST_INFO2_ */ -} __packed; +}; #define ET_RXST_INFO2_LEN_MASK 0x0000FFFF #define ET_RXST_INFO2_LEN_SHIFT 0 @@ -135,7 +147,7 @@ struct et_rxstat { struct et_rxstatus { uint32_t rxs_ring; uint32_t rxs_stat_ring; /* ET_RXS_STATRING_ */ -} __packed; +}; #define ET_RXS_STATRING_INDEX_MASK 0x0FFF0000 #define ET_RXS_STATRING_INDEX_SHIFT 16 From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 18:56:55 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8EC3106568B; Mon, 21 Dec 2009 18:56:55 +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 D66568FC16; Mon, 21 Dec 2009 18:56:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLIutBX037354; Mon, 21 Dec 2009 18:56:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLIutit037351; Mon, 21 Dec 2009 18:56:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200912211856.nBLIutit037351@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 21 Dec 2009 18:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200792 - stable/7/sys/dev/et X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 18:56:56 -0000 Author: yongari Date: Mon Dec 21 18:56:55 2009 New Revision: 200792 URL: http://svn.freebsd.org/changeset/base/200792 Log: MFC r199563,199608-199613 r199563: Fix copy & paste error and remove extra space before colon. r199608: Remove unnecessary structure packing. r199609: Add initial endianness support. It seems the controller supports both big-endian and little-endian format in descriptors for Rx path but I couldn't find equivalent feature in Tx path. So just stick to little-endian for now. r199610: Because we know received bytes including CRC there is no reason to call m_adj(9). The controller also seems to have a capability to strip CRC bytes but I failed to activate this feature except for loopback traffic. r199611: Add IPv4/TCP/UDP Tx checksum offloading support. It seems the controller also has support for IP/TCP checksum offloading for Rx path. But I failed to find to way to enable Rx MAC to compute the checksum of received frames. r199612: Add __FBSDID. r199613: Only Tx checksum offloading is supported now. Remove experimental code sneaked in r199611. Modified: stable/7/sys/dev/et/if_et.c stable/7/sys/dev/et/if_etvar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/et/if_et.c ============================================================================== --- stable/7/sys/dev/et/if_et.c Mon Dec 21 18:52:38 2009 (r200791) +++ stable/7/sys/dev/et/if_et.c Mon Dec 21 18:56:55 2009 (r200792) @@ -32,9 +32,11 @@ * SUCH DAMAGE. * * $DragonFly: src/sys/dev/netif/et/if_et.c,v 1.10 2008/05/18 07:47:14 sephe Exp $ - * $FreeBSD$ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -78,7 +80,9 @@ MODULE_DEPEND(et, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; -TUNABLE_INT("hw.re.msi_disable", &msi_disable); +TUNABLE_INT("hw.et.msi_disable", &msi_disable); + +#define ET_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) static int et_probe(device_t); static int et_attach(device_t); @@ -276,7 +280,7 @@ et_attach(device_t dev) sc->sc_flags |= ET_FLAG_PCIE; msic = pci_msi_count(dev); if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI count: %d\n", msic); } if (msic > 0 && msi_disable == 0) { msic = 1; @@ -332,7 +336,7 @@ et_attach(device_t dev) ifp->if_ioctl = et_ioctl; ifp->if_start = et_start; ifp->if_mtu = ETHERMTU; - ifp->if_capabilities = IFCAP_VLAN_MTU; + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; IFQ_SET_MAXLEN(&ifp->if_snd, ET_TX_NDESC); IFQ_SET_READY(&ifp->if_snd); @@ -1175,7 +1179,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, struct et_softc *sc = ifp->if_softc; struct mii_data *mii = device_get_softc(sc->sc_miibus); struct ifreq *ifr = (struct ifreq *)data; - int error = 0, max_framelen; + int error = 0, mask, max_framelen; /* XXX LOCKSUSED */ switch (cmd) { @@ -1232,6 +1236,20 @@ et_ioctl(struct ifnet *ifp, u_long cmd, } break; + case SIOCSIFCAP: + ET_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_TXCSUM) != 0 && + (IFCAP_TXCSUM & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((IFCAP_TXCSUM & ifp->if_capenable) != 0) + ifp->if_hwassist |= ET_CSUM_FEATURES; + else + ifp->if_hwassist &= ~ET_CSUM_FEATURES; + } + ET_UNLOCK(sc); + break; + default: error = ether_ioctl(ifp, cmd, data); break; @@ -1913,7 +1931,7 @@ et_rxeof(struct et_softc *sc) struct ifnet *ifp; struct et_rxstatus_data *rxsd; struct et_rxstat_ring *rxst_ring; - uint32_t rxs_stat_ring; + uint32_t rxs_stat_ring, rxst_info2; int rxst_wrap, rxst_index; ET_LOCK_ASSERT(sc); @@ -1929,7 +1947,7 @@ et_rxeof(struct et_softc *sc) bus_dmamap_sync(rxst_ring->rsr_dtag, rxst_ring->rsr_dmap, BUS_DMASYNC_POSTREAD); - rxs_stat_ring = rxsd->rxsd_status->rxs_stat_ring; + rxs_stat_ring = le32toh(rxsd->rxsd_status->rxs_stat_ring); rxst_wrap = (rxs_stat_ring & ET_RXS_STATRING_WRAP) ? 1 : 0; rxst_index = (rxs_stat_ring & ET_RXS_STATRING_INDEX_MASK) >> ET_RXS_STATRING_INDEX_SHIFT; @@ -1945,12 +1963,12 @@ et_rxeof(struct et_softc *sc) MPASS(rxst_ring->rsr_index < ET_RX_NSTAT); st = &rxst_ring->rsr_stat[rxst_ring->rsr_index]; - - buflen = (st->rxst_info2 & ET_RXST_INFO2_LEN_MASK) >> + rxst_info2 = le32toh(st->rxst_info2); + buflen = (rxst_info2 & ET_RXST_INFO2_LEN_MASK) >> ET_RXST_INFO2_LEN_SHIFT; - buf_idx = (st->rxst_info2 & ET_RXST_INFO2_BUFIDX_MASK) >> + buf_idx = (rxst_info2 & ET_RXST_INFO2_BUFIDX_MASK) >> ET_RXST_INFO2_BUFIDX_SHIFT; - ring_idx = (st->rxst_info2 & ET_RXST_INFO2_RINGIDX_MASK) >> + ring_idx = (rxst_info2 & ET_RXST_INFO2_RINGIDX_MASK) >> ET_RXST_INFO2_RINGIDX_SHIFT; if (++rxst_ring->rsr_index == ET_RX_NSTAT) { @@ -1982,11 +2000,9 @@ et_rxeof(struct et_softc *sc) m = NULL; ifp->if_ierrors++; } else { - m->m_pkthdr.len = m->m_len = buflen; + m->m_pkthdr.len = m->m_len = + buflen - ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; - - m_adj(m, -ETHER_CRC_LEN); - ifp->if_ipackets++; ET_UNLOCK(sc); ifp->if_input(ifp, m); @@ -2028,7 +2044,7 @@ et_encap(struct et_softc *sc, struct mbu struct et_txdesc *td; bus_dmamap_t map; int error, maxsegs, first_idx, last_idx, i; - uint32_t tx_ready_pos, last_td_ctrl2; + uint32_t csum_flags, tx_ready_pos, last_td_ctrl2; maxsegs = ET_TX_NDESC - tbd->tbd_used; if (maxsegs > ET_NSEG_MAX) @@ -2090,20 +2106,29 @@ et_encap(struct et_softc *sc, struct mbu last_td_ctrl2 |= ET_TDCTRL2_INTR; } + csum_flags = 0; + if ((m->m_pkthdr.csum_flags & ET_CSUM_FEATURES) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0) + csum_flags |= ET_TDCTRL2_CSUM_IP; + if ((m->m_pkthdr.csum_flags & CSUM_UDP) != 0) + csum_flags |= ET_TDCTRL2_CSUM_UDP; + else if ((m->m_pkthdr.csum_flags & CSUM_TCP) != 0) + csum_flags |= ET_TDCTRL2_CSUM_TCP; + } last_idx = -1; for (i = 0; i < ctx.nsegs; ++i) { int idx; idx = (first_idx + i) % ET_TX_NDESC; td = &tx_ring->tr_desc[idx]; - td->td_addr_hi = ET_ADDR_HI(segs[i].ds_addr); - td->td_addr_lo = ET_ADDR_LO(segs[i].ds_addr); - td->td_ctrl1 = segs[i].ds_len & ET_TDCTRL1_LEN_MASK; - + td->td_addr_hi = htole32(ET_ADDR_HI(segs[i].ds_addr)); + td->td_addr_lo = htole32(ET_ADDR_LO(segs[i].ds_addr)); + td->td_ctrl1 = htole32(segs[i].ds_len & ET_TDCTRL1_LEN_MASK); if (i == ctx.nsegs - 1) { /* Last frag */ - td->td_ctrl2 = last_td_ctrl2; + td->td_ctrl2 = htole32(last_td_ctrl2 | csum_flags); last_idx = idx; - } + } else + td->td_ctrl2 = htole32(csum_flags); MPASS(tx_ring->tr_ready_index < ET_TX_NDESC); if (++tx_ring->tr_ready_index == ET_TX_NDESC) { @@ -2112,7 +2137,7 @@ et_encap(struct et_softc *sc, struct mbu } } td = &tx_ring->tr_desc[first_idx]; - td->td_ctrl2 |= ET_TDCTRL2_FIRST_FRAG; /* First frag */ + td->td_ctrl2 |= htole32(ET_TDCTRL2_FIRST_FRAG); /* First frag */ MPASS(last_idx >= 0); tbd->tbd_buf[first_idx].tb_dmap = tbd->tbd_buf[last_idx].tb_dmap; @@ -2424,9 +2449,9 @@ et_setup_rxdesc(struct et_rxbuf_data *rb MPASS(buf_idx < ET_RX_NDESC); desc = &rx_ring->rr_desc[buf_idx]; - desc->rd_addr_hi = ET_ADDR_HI(paddr); - desc->rd_addr_lo = ET_ADDR_LO(paddr); - desc->rd_ctrl = buf_idx & ET_RDCTRL_BUFIDX_MASK; + desc->rd_addr_hi = htole32(ET_ADDR_HI(paddr)); + desc->rd_addr_lo = htole32(ET_ADDR_LO(paddr)); + desc->rd_ctrl = htole32(buf_idx & ET_RDCTRL_BUFIDX_MASK); bus_dmamap_sync(rx_ring->rr_dtag, rx_ring->rr_dmap, BUS_DMASYNC_PREWRITE); Modified: stable/7/sys/dev/et/if_etvar.h ============================================================================== --- stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:52:38 2009 (r200791) +++ stable/7/sys/dev/et/if_etvar.h Mon Dec 21 18:56:55 2009 (r200792) @@ -104,26 +104,38 @@ struct et_txdesc { uint32_t td_addr_lo; uint32_t td_ctrl1; /* ET_TDCTRL1_ */ uint32_t td_ctrl2; /* ET_TDCTRL2_ */ -} __packed; +}; #define ET_TDCTRL1_LEN_MASK 0x0000FFFF #define ET_TDCTRL2_LAST_FRAG 0x00000001 #define ET_TDCTRL2_FIRST_FRAG 0x00000002 #define ET_TDCTRL2_INTR 0x00000004 +#define ET_TDCTRL2_CTRL_WORD 0x00000008 +#define ET_TDCTRL2_HDX_BACKP 0x00000010 +#define ET_TDCTRL2_XMIT_PAUSE 0x00000020 +#define ET_TDCTRL2_FRAME_ERR 0x00000040 +#define ET_TDCTRL2_NO_CRC 0x00000080 +#define ET_TDCTRL2_MAC_OVRRD 0x00000100 +#define ET_TDCTRL2_PAD_PACKET 0x00000200 +#define ET_TDCTRL2_JUMBO_PACKET 0x00000400 +#define ET_TDCTRL2_INS_VLAN 0x00000800 +#define ET_TDCTRL2_CSUM_IP 0x00001000 +#define ET_TDCTRL2_CSUM_TCP 0x00002000 +#define ET_TDCTRL2_CSUM_UDP 0x00004000 struct et_rxdesc { uint32_t rd_addr_lo; uint32_t rd_addr_hi; uint32_t rd_ctrl; /* ET_RDCTRL_ */ -} __packed; +}; #define ET_RDCTRL_BUFIDX_MASK 0x000003FF struct et_rxstat { uint32_t rxst_info1; uint32_t rxst_info2; /* ET_RXST_INFO2_ */ -} __packed; +}; #define ET_RXST_INFO2_LEN_MASK 0x0000FFFF #define ET_RXST_INFO2_LEN_SHIFT 0 @@ -135,7 +147,7 @@ struct et_rxstat { struct et_rxstatus { uint32_t rxs_ring; uint32_t rxs_stat_ring; /* ET_RXS_STATRING_ */ -} __packed; +}; #define ET_RXS_STATRING_INDEX_MASK 0x0FFF0000 #define ET_RXS_STATRING_INDEX_SHIFT 16 From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 20:17:35 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360981065679; Mon, 21 Dec 2009 20:17:35 +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 23BCC8FC1A; Mon, 21 Dec 2009 20:17:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBLKHZgb039638; Mon, 21 Dec 2009 20:17:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBLKHZQo039636; Mon, 21 Dec 2009 20:17:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200912212017.nBLKHZQo039636@svn.freebsd.org> From: Marius Strobl Date: Mon, 21 Dec 2009 20:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200807 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 20:17:35 -0000 Author: marius Date: Mon Dec 21 20:17:34 2009 New Revision: 200807 URL: http://svn.freebsd.org/changeset/base/200807 Log: MFC: r200544 Set ATA_CHECKS_CABLE when appropriate. Reviewed by: mav Modified: stable/8/sys/dev/ata/chipsets/ata-amd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-amd.c Mon Dec 21 20:12:01 2009 (r200806) +++ stable/8/sys/dev/ata/chipsets/ata-amd.c Mon Dec 21 20:17:34 2009 (r200807) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include /* local prototypes */ +static int ata_amd_ch_attach(device_t dev); static int ata_amd_chipinit(device_t dev); static int ata_amd_setmode(device_t dev, int target, int mode); @@ -59,7 +60,6 @@ static int ata_amd_setmode(device_t dev, #define AMD_BUG 0x01 #define AMD_CABLE 0x02 - /* * American Micro Devices (AMD) chipset support functions */ @@ -100,6 +100,7 @@ ata_amd_chipinit(device_t dev) else pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1); + ctlr->ch_attach = ata_amd_ch_attach; ctlr->setmode = ata_amd_setmode; return 0; } @@ -137,4 +138,19 @@ ata_amd_setmode(device_t dev, int target return (mode); } +static int +ata_amd_ch_attach(device_t dev) +{ + struct ata_pci_controller *ctlr; + struct ata_channel *ch; + int error; + + ctlr = device_get_softc(device_get_parent(dev)); + ch = device_get_softc(dev); + error = ata_pci_ch_attach(dev); + if (ctlr->chip->cfg1 & AMD_CABLE) + ch->flags |= ATA_CHECKS_CABLE; + return (error); +} + ATA_DECLARE_DRIVER(ata_amd); From owner-svn-src-stable@FreeBSD.ORG Mon Dec 21 21:08:12 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F1AA106566C; Mon, 21 Dec 2009 21:08:12 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-bw0-f213.google.com (mail-bw0-f213.google.com [209.85.218.213]) by mx1.freebsd.org (Postfix) with ESMTP id 31AB18FC14; Mon, 21 Dec 2009 21:08:10 +0000 (UTC) Received: by bwz5 with SMTP id 5so3760674bwz.3 for ; Mon, 21 Dec 2009 13:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=b5mlTSZfMT7+yAIpzWKzi+T9h2k1f8cHCJMnx/blbeE=; b=JL6SIIjXJcOeoofwZXpCP/+u5u0e1BPha2j4aMhsdt6UiVM/pwKSl8PpfSKTDcwN6i dq3eovK7f/FcQSlzmFe5/xZq3DxAvaDq22+EE6prRDn5CyLPKVHlNFvQYldfEbEFi7na 0qyrttAMSMfq3YzHEQtzIcZ8uwVsR0suWzNbw= 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=BiZKs8VGVEwByNAqbZbEhkHjEl+iOR54q0GNmvAD3YLPUrVxmVP4+IsyqmKY2G16Sf tNL/dknDI7XXIqMovLwsBIGuC/GIsZjdkH2l/4EkJueaL7vnAoaOPNon4iqlKoYd8D6r cwZUl76gLR2IILSH0ZgJZp4tOUjf9hEB6HUcw= MIME-Version: 1.0 Received: by 10.204.35.139 with SMTP id p11mr5095003bkd.178.1261429689323; Mon, 21 Dec 2009 13:08:09 -0800 (PST) In-Reply-To: <200912212017.nBLKHZQo039636@svn.freebsd.org> References: <200912212017.nBLKHZQo039636@svn.freebsd.org> Date: Mon, 21 Dec 2009 22:08:08 +0100 Message-ID: <6101e8c40912211308r38c95d6w2d63402cc5c06ef6@mail.gmail.com> From: Oliver Pinter To: Marius Strobl Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r200807 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2009 21:08:12 -0000 typo in this line: * American Micro Devices (AMD) chipset support functions 's/American/Advanced/g' http://en.wikipedia.org/wiki/Advanced_Micro_Devices On 12/21/09, Marius Strobl wrote: > Author: marius > Date: Mon Dec 21 20:17:34 2009 > New Revision: 200807 > URL: http://svn.freebsd.org/changeset/base/200807 > > Log: > MFC: r200544 > > Set ATA_CHECKS_CABLE when appropriate. > > Reviewed by: mav > > Modified: > stable/8/sys/dev/ata/chipsets/ata-amd.c > Directory Properties: > stable/8/sys/ (props changed) > stable/8/sys/amd64/include/xen/ (props changed) > stable/8/sys/cddl/contrib/opensolaris/ (props changed) > stable/8/sys/contrib/dev/acpica/ (props changed) > stable/8/sys/contrib/pf/ (props changed) > stable/8/sys/dev/xen/xenpci/ (props changed) > > Modified: stable/8/sys/dev/ata/chipsets/ata-amd.c > ============================================================================== > --- stable/8/sys/dev/ata/chipsets/ata-amd.c Mon Dec 21 20:12:01 > 2009 (r200806) > +++ stable/8/sys/dev/ata/chipsets/ata-amd.c Mon Dec 21 20:17:34 > 2009 (r200807) > @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); > #include > > /* local prototypes */ > +static int ata_amd_ch_attach(device_t dev); > static int ata_amd_chipinit(device_t dev); > static int ata_amd_setmode(device_t dev, int target, int mode); > > @@ -59,7 +60,6 @@ static int ata_amd_setmode(device_t dev, > #define AMD_BUG 0x01 > #define AMD_CABLE 0x02 > > - > /* > * American Micro Devices (AMD) chipset support functions > */ > @@ -100,6 +100,7 @@ ata_amd_chipinit(device_t dev) > else > pci_write_config(dev, 0x41, pci_read_config(dev, 0x41, 1) | 0xf0, 1); > > + ctlr->ch_attach = ata_amd_ch_attach; > ctlr->setmode = ata_amd_setmode; > return 0; > } > @@ -137,4 +138,19 @@ ata_amd_setmode(device_t dev, int target > return (mode); > } > > +static int > +ata_amd_ch_attach(device_t dev) > +{ > + struct ata_pci_controller *ctlr; > + struct ata_channel *ch; > + int error; > + > + ctlr = device_get_softc(device_get_parent(dev)); > + ch = device_get_softc(dev); > + error = ata_pci_ch_attach(dev); > + if (ctlr->chip->cfg1 & AMD_CABLE) > + ch->flags |= ATA_CHECKS_CABLE; > + return (error); > +} > + > ATA_DECLARE_DRIVER(ata_amd); > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 13:45:29 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D92EC1065693; Tue, 22 Dec 2009 13:45:29 +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 C7C6D8FC15; Tue, 22 Dec 2009 13:45:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMDjTQH065451; Tue, 22 Dec 2009 13:45:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMDjTX4065449; Tue, 22 Dec 2009 13:45:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912221345.nBMDjTX4065449@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 22 Dec 2009 13:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200836 - stable/8/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 13:45:30 -0000 Author: jilles Date: Tue Dec 22 13:45:29 2009 New Revision: 200836 URL: http://svn.freebsd.org/changeset/base/200836 Log: MFC r200589: cpuset(2): fix a typo and a markup error in the man page Modified: stable/8/lib/libc/sys/cpuset.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/sys/cpuset.2 ============================================================================== --- stable/8/lib/libc/sys/cpuset.2 Tue Dec 22 11:21:03 2009 (r200835) +++ stable/8/lib/libc/sys/cpuset.2 Tue Dec 22 13:45:29 2009 (r200836) @@ -96,7 +96,7 @@ The .Fa which argument may have the following values: .Bl -column CPU_WHICH_CPUSET -offset indent -.It Dv CPU_WHICH_TID Ta "id is lpwid_t (thread id)" +.It Dv CPU_WHICH_TID Ta "id is lwpid_t (thread id)" .It Dv CPU_WHICH_PID Ta "id is pid_t (process id)" .It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)" .It Dv CPU_WHICH_IRQ Ta "id is an irq number" @@ -209,7 +209,7 @@ The calling process did not have the cre operation. .It Bq Er ENFILE There was no free -.Fn cpusetid_t +.Ft cpusetid_t for allocation. .El .Sh SEE ALSO From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 13:49:37 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3BF2106566B; Tue, 22 Dec 2009 13:49:37 +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 C23C18FC19; Tue, 22 Dec 2009 13:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMDnb3e065589; Tue, 22 Dec 2009 13:49:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMDnbVQ065587; Tue, 22 Dec 2009 13:49:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912221349.nBMDnbVQ065587@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 22 Dec 2009 13:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200837 - stable/7/lib/libc/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 13:49:37 -0000 Author: jilles Date: Tue Dec 22 13:49:37 2009 New Revision: 200837 URL: http://svn.freebsd.org/changeset/base/200837 Log: MFC r200589: cpuset(2): fix a typo and a markup error in the man page Modified: stable/7/lib/libc/sys/cpuset.2 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/sys/cpuset.2 ============================================================================== --- stable/7/lib/libc/sys/cpuset.2 Tue Dec 22 13:45:29 2009 (r200836) +++ stable/7/lib/libc/sys/cpuset.2 Tue Dec 22 13:49:37 2009 (r200837) @@ -96,7 +96,7 @@ The .Fa which argument may have the following values: .Bl -column CPU_WHICH_CPUSET -offset indent -.It Dv CPU_WHICH_TID Ta "id is lpwid_t (thread id)" +.It Dv CPU_WHICH_TID Ta "id is lwpid_t (thread id)" .It Dv CPU_WHICH_PID Ta "id is pid_t (process id)" .It Dv CPU_WHICH_CPUSET Ta "id is a cpusetid_t (cpuset id)" .It Dv CPU_WHICH_IRQ Ta "id is an irq number" @@ -209,7 +209,7 @@ The calling process did not have the cre operation. .It Bq Er ENFILE There was no free -.Fn cpusetid_t +.Ft cpusetid_t for allocation. .El .Sh SEE ALSO From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 14:13:13 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55FA7106568D; Tue, 22 Dec 2009 14:13:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 441B38FC29; Tue, 22 Dec 2009 14:13:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMEDDnG066248; Tue, 22 Dec 2009 14:13:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMEDDrp066246; Tue, 22 Dec 2009 14:13:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912221413.nBMEDDrp066246@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Dec 2009 14:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200839 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 14:13:13 -0000 Author: kib Date: Tue Dec 22 14:13:13 2009 New Revision: 200839 URL: http://svn.freebsd.org/changeset/base/200839 Log: MFC r190883: Update comment, fix spacing. MFC r190885: Change the way the mapping of the ELF objects is constructed, by first mapping PROT_NONE anonymous memory over the whole range, and then mapping the segments of the object over it. MFC r195743: Only perform .bss mapping and cleaning operations when segment file size is not equal to its memory size. Tested by: Mykola Dzham Modified: stable/7/libexec/rtld-elf/map_object.c Directory Properties: stable/7/libexec/rtld-elf/ (props changed) Modified: stable/7/libexec/rtld-elf/map_object.c ============================================================================== --- stable/7/libexec/rtld-elf/map_object.c Tue Dec 22 13:53:34 2009 (r200838) +++ stable/7/libexec/rtld-elf/map_object.c Tue Dec 22 14:13:13 2009 (r200839) @@ -91,8 +91,7 @@ map_object(int fd, const char *path, con /* * Scan the program header entries, and save key information. * - * We rely on there being exactly two load segments, text and data, - * in that order. + * We expect that the loadable segments are ordered by load address. */ phdr = (Elf_Phdr *) ((char *)hdr + hdr->e_phoff); phsize = hdr->e_phnum * sizeof (phdr[0]); @@ -153,8 +152,8 @@ map_object(int fd, const char *path, con mapsize = base_vlimit - base_vaddr; base_addr = hdr->e_type == ET_EXEC ? (caddr_t) base_vaddr : NULL; - mapbase = mmap(base_addr, mapsize, convert_prot(segs[0]->p_flags), - convert_flags(segs[0]->p_flags), fd, base_offset); + mapbase = mmap(base_addr, mapsize, PROT_NONE, MAP_ANON | MAP_PRIVATE | + MAP_NOCORE, -1, 0); if (mapbase == (caddr_t) -1) { _rtld_error("%s: mmap of entire address space failed: %s", path, strerror(errno)); @@ -167,7 +166,7 @@ map_object(int fd, const char *path, con return NULL; } - for (i = 0; i <= nsegs; i++) { + for (i = 0; i <= nsegs; i++) { /* Overlay the segment onto the proper region. */ data_offset = trunc_page(segs[i]->p_offset); data_vaddr = trunc_page(segs[i]->p_vaddr); @@ -175,45 +174,49 @@ map_object(int fd, const char *path, con data_addr = mapbase + (data_vaddr - base_vaddr); data_prot = convert_prot(segs[i]->p_flags); data_flags = convert_flags(segs[i]->p_flags) | MAP_FIXED; - /* Do not call mmap on the first segment - this is redundant */ - if (i && mmap(data_addr, data_vlimit - data_vaddr, data_prot, + if (mmap(data_addr, data_vlimit - data_vaddr, data_prot, data_flags, fd, data_offset) == (caddr_t) -1) { _rtld_error("%s: mmap of data failed: %s", path, strerror(errno)); return NULL; } - /* Clear any BSS in the last page of the segment. */ - clear_vaddr = segs[i]->p_vaddr + segs[i]->p_filesz; - clear_addr = mapbase + (clear_vaddr - base_vaddr); - clear_page = mapbase + (trunc_page(clear_vaddr) - base_vaddr); - if ((nclear = data_vlimit - clear_vaddr) > 0) { - /* Make sure the end of the segment is writable */ - if ((data_prot & PROT_WRITE) == 0 && - -1 == mprotect(clear_page, PAGE_SIZE, data_prot|PROT_WRITE)) { + /* Do BSS setup */ + if (segs[i]->p_filesz != segs[i]->p_memsz) { + + /* Clear any BSS in the last page of the segment. */ + clear_vaddr = segs[i]->p_vaddr + segs[i]->p_filesz; + clear_addr = mapbase + (clear_vaddr - base_vaddr); + clear_page = mapbase + (trunc_page(clear_vaddr) - base_vaddr); + + if ((nclear = data_vlimit - clear_vaddr) > 0) { + /* Make sure the end of the segment is writable */ + if ((data_prot & PROT_WRITE) == 0 && -1 == + mprotect(clear_page, PAGE_SIZE, data_prot|PROT_WRITE)) { _rtld_error("%s: mprotect failed: %s", path, strerror(errno)); return NULL; - } + } - memset(clear_addr, 0, nclear); + memset(clear_addr, 0, nclear); - /* Reset the data protection back */ - if ((data_prot & PROT_WRITE) == 0) - mprotect(clear_page, PAGE_SIZE, data_prot); - } + /* Reset the data protection back */ + if ((data_prot & PROT_WRITE) == 0) + mprotect(clear_page, PAGE_SIZE, data_prot); + } - /* Overlay the BSS segment onto the proper region. */ - bss_vaddr = data_vlimit; - bss_vlimit = round_page(segs[i]->p_vaddr + segs[i]->p_memsz); - bss_addr = mapbase + (bss_vaddr - base_vaddr); - if (bss_vlimit > bss_vaddr) { /* There is something to do */ - if (mmap(bss_addr, bss_vlimit - bss_vaddr, data_prot, - MAP_PRIVATE|MAP_FIXED|MAP_ANON, -1, 0) == (caddr_t) -1) { - _rtld_error("%s: mmap of bss failed: %s", path, + /* Overlay the BSS segment onto the proper region. */ + bss_vaddr = data_vlimit; + bss_vlimit = round_page(segs[i]->p_vaddr + segs[i]->p_memsz); + bss_addr = mapbase + (bss_vaddr - base_vaddr); + if (bss_vlimit > bss_vaddr) { /* There is something to do */ + if (mprotect(bss_addr, bss_vlimit - bss_vaddr, data_prot) == -1) { + _rtld_error("%s: mprotect of bss failed: %s", path, strerror(errno)); - return NULL; + return NULL; + } } } + if (phdr_vaddr == 0 && data_offset <= hdr->e_phoff && (data_vlimit - data_vaddr + data_offset) >= (hdr->e_phoff + hdr->e_phnum * sizeof (Elf_Phdr))) { From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 14:58:24 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484E71065670; Tue, 22 Dec 2009 14:58:24 +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 36A6E8FC1D; Tue, 22 Dec 2009 14:58:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMEwOS4067258; Tue, 22 Dec 2009 14:58:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMEwObT067256; Tue, 22 Dec 2009 14:58:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912221458.nBMEwObT067256@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Dec 2009 14:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200841 - stable/8/sys/i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 14:58:24 -0000 Author: jhb Date: Tue Dec 22 14:58:23 2009 New Revision: 200841 URL: http://svn.freebsd.org/changeset/base/200841 Log: MFC 200514: Remove comment claiming that building acpi into the kernel is deprecated. Modified: stable/8/sys/i386/conf/NOTES Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Tue Dec 22 14:21:08 2009 (r200840) +++ stable/8/sys/i386/conf/NOTES Tue Dec 22 14:58:23 2009 (r200841) @@ -463,9 +463,6 @@ device tdfx_linux # Enable Linuxulator # kernel environment variables to select initial debugging levels for the # Intel ACPICA code. (Note that the Intel code must also have USE_DEBUGGER # defined when it is built). -# -# Note that building ACPI into the kernel is deprecated; the module is -# normally loaded automatically by the loader. device acpi options ACPI_DEBUG From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 14:58:44 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 833B310656C1; Tue, 22 Dec 2009 14:58:44 +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 71FBB8FC1C; Tue, 22 Dec 2009 14:58:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMEwiFg067299; Tue, 22 Dec 2009 14:58:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMEwioW067297; Tue, 22 Dec 2009 14:58:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200912221458.nBMEwioW067297@svn.freebsd.org> From: John Baldwin Date: Tue, 22 Dec 2009 14:58:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200842 - stable/7/sys/i386/conf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 14:58:44 -0000 Author: jhb Date: Tue Dec 22 14:58:44 2009 New Revision: 200842 URL: http://svn.freebsd.org/changeset/base/200842 Log: MFC 200514: Remove comment claiming that building acpi into the kernel is deprecated. Modified: stable/7/sys/i386/conf/NOTES Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/i386/conf/NOTES ============================================================================== --- stable/7/sys/i386/conf/NOTES Tue Dec 22 14:58:23 2009 (r200841) +++ stable/7/sys/i386/conf/NOTES Tue Dec 22 14:58:44 2009 (r200842) @@ -510,9 +510,6 @@ device tdfx_linux # Enable Linuxulator # defined when it is built). # # ACPI_NO_SEMAPHORES makes the AcpiOs*Semaphore routines a no-op. -# -# Note that building ACPI into the kernel is deprecated; the module is -# normally loaded automatically by the loader. device acpi options ACPI_DEBUG From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 19:51:50 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F6C21065692; Tue, 22 Dec 2009 19:51:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4E38FC13; Tue, 22 Dec 2009 19:51:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMJpoLW073910; Tue, 22 Dec 2009 19:51:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMJpojJ073900; Tue, 22 Dec 2009 19:51:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912221951.nBMJpojJ073900@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Dec 2009 19:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200858 - in stable/7/sys: amd64/include arm/include compat/svr4 i386/include ia64/include kern powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 19:51:50 -0000 Author: kib Date: Tue Dec 22 19:51:49 2009 New Revision: 200858 URL: http://svn.freebsd.org/changeset/base/200858 Log: MFC r186212 (by imp): AT_DEBUG and AT_BRK were OBE like 10 years ago, so retire them. MFC r186225: Remove two remnant uses of AT_DEBUG. Modified: stable/7/sys/amd64/include/elf.h stable/7/sys/arm/include/elf.h stable/7/sys/compat/svr4/svr4_sysvec.c stable/7/sys/i386/include/elf.h stable/7/sys/ia64/include/elf.h stable/7/sys/kern/imgact_elf.c stable/7/sys/powerpc/include/elf.h stable/7/sys/sparc64/include/elf.h stable/7/sys/sun4v/include/elf.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/include/elf.h ============================================================================== --- stable/7/sys/amd64/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/amd64/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -81,18 +81,6 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ - -/* - * The following non-standard values are used for passing information - * from John Polstra's testbed program to the dynamic linker. These - * are expected to go away soon. - * - * Unfortunately, these overlap the Linux non-standard values, so they - * must not be used in the same context. - */ -#define AT_BRK 10 /* Starting point for sbrk and brk. */ -#define AT_DEBUG 11 /* Debugging level. */ - /* * The following non-standard values are used in Linux ELF binaries. */ Modified: stable/7/sys/arm/include/elf.h ============================================================================== --- stable/7/sys/arm/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/arm/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -70,10 +70,6 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ - -#define AT_BRK 10 /* Starting point for sbrk and brk. */ -#define AT_DEBUG 11 /* Debugging level. */ - #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ Modified: stable/7/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/7/sys/compat/svr4/svr4_sysvec.c Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/compat/svr4/svr4_sysvec.c Tue Dec 22 19:51:49 2009 (r200858) @@ -222,8 +222,6 @@ svr4_fixup(register_t **stack_base, stru args = (Elf32_Auxargs *)imgp->auxargs; pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2); - if (args->trace) - AUXARGS_ENTRY(pos, AT_DEBUG, 1); if (args->execfd != -1) AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); Modified: stable/7/sys/i386/include/elf.h ============================================================================== --- stable/7/sys/i386/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/i386/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -84,18 +84,6 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ - -/* - * The following non-standard values are used for passing information - * from John Polstra's testbed program to the dynamic linker. These - * are expected to go away soon. - * - * Unfortunately, these overlap the Linux non-standard values, so they - * must not be used in the same context. - */ -#define AT_BRK 10 /* Starting point for sbrk and brk. */ -#define AT_DEBUG 11 /* Debugging level. */ - /* * The following non-standard values are used in Linux ELF binaries. */ Modified: stable/7/sys/ia64/include/elf.h ============================================================================== --- stable/7/sys/ia64/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/ia64/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -82,18 +82,6 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ - -/* - * The following non-standard values are used for passing information - * from John Polstra's testbed program to the dynamic linker. These - * are expected to go away soon. - * - * Unfortunately, these overlap the Linux non-standard values, so they - * must not be used in the same context. - */ -#define AT_BRK 10 /* Starting point for sbrk and brk. */ -#define AT_DEBUG 11 /* Debugging level. */ - /* * The following non-standard values are used in Linux ELF binaries. */ Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/kern/imgact_elf.c Tue Dec 22 19:51:49 2009 (r200858) @@ -943,9 +943,6 @@ __elfN(freebsd_fixup)(register_t **stack base = (Elf_Addr *)*stack_base; pos = base + (imgp->args->argc + imgp->args->envc + 2); - if (args->trace) { - AUXARGS_ENTRY(pos, AT_DEBUG, 1); - } if (args->execfd != -1) { AUXARGS_ENTRY(pos, AT_EXECFD, args->execfd); } Modified: stable/7/sys/powerpc/include/elf.h ============================================================================== --- stable/7/sys/powerpc/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/powerpc/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -80,9 +80,6 @@ __ElfType(Auxinfo); #define AT_COUNT 13 /* Count of defined aux entry types. */ -/* Used in John Polstra's testbed stuff. */ -#define AT_DEBUG 14 /* Debugging level. */ - /* * Relocation types. */ Modified: stable/7/sys/sparc64/include/elf.h ============================================================================== --- stable/7/sys/sparc64/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/sparc64/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -78,18 +78,6 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ - -/* - * The following non-standard values are used for passing information - * from John Polstra's testbed program to the dynamic linker. These - * are expected to go away soon. - * - * Unfortunately, these overlap the Linux non-standard values, so they - * must not be used in the same context. - */ -#define T_BRK 10 /* Starting point for sbrk and brk. */ -#define AT_DEBUG 11 /* Debugging level. */ - /* * The following non-standard values are used in Linux ELF binaries. */ Modified: stable/7/sys/sun4v/include/elf.h ============================================================================== --- stable/7/sys/sun4v/include/elf.h Tue Dec 22 19:48:06 2009 (r200857) +++ stable/7/sys/sun4v/include/elf.h Tue Dec 22 19:51:49 2009 (r200858) @@ -78,18 +78,6 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ - -/* - * The following non-standard values are used for passing information - * from John Polstra's testbed program to the dynamic linker. These - * are expected to go away soon. - * - * Unfortunately, these overlap the Linux non-standard values, so they - * must not be used in the same context. - */ -#define T_BRK 10 /* Starting point for sbrk and brk. */ -#define AT_DEBUG 11 /* Debugging level. */ - /* * The following non-standard values are used in Linux ELF binaries. */ From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 19:54:11 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E149A106568B; Tue, 22 Dec 2009 19:54:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D074B8FC1F; Tue, 22 Dec 2009 19:54:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMJsBce074038; Tue, 22 Dec 2009 19:54:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMJsBbS074036; Tue, 22 Dec 2009 19:54:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912221954.nBMJsBbS074036@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Dec 2009 19:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200859 - stable/7/sys/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 19:54:12 -0000 Author: kib Date: Tue Dec 22 19:54:11 2009 New Revision: 200859 URL: http://svn.freebsd.org/changeset/base/200859 Log: MFC r189925: Add some definitions for the DT_FLAGS_1 tag flags. Modified: stable/7/sys/sys/elf_common.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/sys/elf_common.h ============================================================================== --- stable/7/sys/sys/elf_common.h Tue Dec 22 19:51:49 2009 (r200858) +++ stable/7/sys/sys/elf_common.h Tue Dec 22 19:54:11 2009 (r200859) @@ -398,6 +398,11 @@ typedef struct { executable contains code using a static thread-local storage scheme. */ +/* Values for DT_FLAGS_1 */ +#define DF_1_BIND_NOW 0x00000001 /* Same as DF_BIND_NOW */ +#define DF_1_GLOBAL 0x00000002 /* Set the RTLD_GLOBAL for object */ +#define DF_1_ORIGIN 0x00000080 /* Process $ORIGIN */ + /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ #define NT_FPREGSET 2 /* Floating point registers. */ From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 19:56:36 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A4E1065692; Tue, 22 Dec 2009 19:56:36 +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 06BC88FC24; Tue, 22 Dec 2009 19:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMJuZFE074150; Tue, 22 Dec 2009 19:56:35 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMJuZLN074146; Tue, 22 Dec 2009 19:56:35 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912221956.nBMJuZLN074146@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Dec 2009 19:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200860 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 19:56:36 -0000 Author: mav Date: Tue Dec 22 19:56:35 2009 New Revision: 200860 URL: http://svn.freebsd.org/changeset/base/200860 Log: MFC r200218: - Cleanup kernel messages, mostly PMP. - Took references on devices, while PMP reinitializes them, to not let them go and distort freeze reference counting. Modified: stable/8/sys/cam/ata/ata_all.c stable/8/sys/cam/ata/ata_pmp.c stable/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Tue Dec 22 19:54:11 2009 (r200859) +++ stable/8/sys/cam/ata/ata_all.c Tue Dec 22 19:56:35 2009 (r200860) @@ -256,8 +256,10 @@ ata_print_ident(struct ata_params *ident sizeof(product)); cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision), sizeof(revision)); - printf("<%s %s> ATA/ATAPI-%d", - product, revision, ata_version(ident_data->version_major)); + printf("<%s %s> %s-%d", + product, revision, + (ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA", + ata_version(ident_data->version_major)); if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) { if (ident_data->satacapabilities & ATA_SATA_GEN3) printf(" SATA 3.x"); Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Tue Dec 22 19:54:11 2009 (r200859) +++ stable/8/sys/cam/ata/ata_pmp.c Tue Dec 22 19:56:35 2009 (r200860) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -176,8 +177,8 @@ pmpfreeze(struct cam_periph *periph, int if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), i, 0) == CAM_REQ_CMP) { -printf("PMP freeze: %d\n", i); softc->frozen |= (1 << i); + xpt_acquire_device(dpath->device); cam_freeze_devq(dpath); xpt_free_path(dpath); } @@ -198,9 +199,9 @@ pmprelease(struct cam_periph *periph, in if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), i, 0) == CAM_REQ_CMP) { -printf("PMP release: %d\n", i); softc->frozen &= ~(1 << i); cam_release_devq(dpath, 0, 0, 0, FALSE); + xpt_release_device(dpath->device); xpt_free_path(dpath); } } @@ -228,6 +229,7 @@ pmponinvalidate(struct cam_periph *perip xpt_free_path(dpath); } } + pmprelease(periph, -1); xpt_print(periph->path, "lost device\n"); } @@ -459,8 +461,6 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_write_cmd(ataio, 2, softc->pm_step, (softc->found & (1 << softc->pm_step)) ? 0 : 1); -printf("PM RESET %d%s\n", softc->pm_step, - (softc->found & (1 << softc->pm_step)) ? " skipping" : ""); break; case PMP_STATE_CONNECT: cam_fill_ataio(ataio, @@ -584,7 +584,9 @@ pmpdone(struct cam_periph *periph, union if (softc->pm_pid == 0x57231095 || softc->pm_pid == 0x57331095 || softc->pm_pid == 0x57341095 || softc->pm_pid == 0x57441095) softc->pm_ports--; - printf("PM ports: %d\n", softc->pm_ports); + printf("%s%d: %d fan-out ports\n", + periph->periph_name, periph->unit_number, + softc->pm_ports); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -606,7 +608,6 @@ pmpdone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/5, /*getcount_only*/0); - printf("PM reset done\n"); softc->state = PMP_STATE_CONNECT; } xpt_release_ccb(done_ccb); @@ -623,7 +624,6 @@ pmpdone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/10, /*getcount_only*/0); - printf("PM connect done\n"); softc->state = PMP_STATE_CHECK; } xpt_release_ccb(done_ccb); @@ -635,7 +635,11 @@ pmpdone(struct cam_periph *periph, union (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; if ((res & 0xf0f) == 0x103 && (res & 0x0f0) != 0) { - printf("PM status: %d - %08x\n", softc->pm_step, res); + if (bootverbose) { + printf("%s%d: port %d status: %08x\n", + periph->periph_name, periph->unit_number, + softc->pm_step, res); + } /* Report device speed. */ if (xpt_create_path(&dpath, periph, xpt_path_path_id(periph->path), @@ -661,7 +665,11 @@ pmpdone(struct cam_periph *periph, union /*getcount_only*/0); softc->pm_try++; } else { - printf("PM status: %d - %08x\n", softc->pm_step, res); + if (bootverbose) { + printf("%s%d: port %d status: %08x\n", + periph->periph_name, periph->unit_number, + softc->pm_step, res); + } softc->found &= ~(1 << softc->pm_step); if (xpt_create_path(&dpath, periph, done_ccb->ccb_h.path_id, Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Tue Dec 22 19:54:11 2009 (r200859) +++ stable/8/sys/cam/ata/ata_xpt.c Tue Dec 22 19:56:35 2009 (r200860) @@ -729,7 +729,8 @@ noerror: { int sign = (done_ccb->ataio.res.lba_high << 8) + done_ccb->ataio.res.lba_mid; - xpt_print(path, "SIGNATURE: %04x\n", sign); + if (bootverbose) + xpt_print(path, "SIGNATURE: %04x\n", sign); if (sign == 0x0000 && done_ccb->ccb_h.target_id != 15) { path->device->protocol = PROTO_ATA; @@ -921,7 +922,6 @@ noerror: (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; ((uint32_t *)ident_buf)[0] = softc->pm_pid; - printf("PM Product ID: %08x\n", softc->pm_pid); snprintf(ident_buf->model, sizeof(ident_buf->model), "Port Multiplier %08x", softc->pm_pid); PROBE_SET_ACTION(softc, PROBE_PM_PRV); @@ -934,7 +934,6 @@ noerror: (done_ccb->ataio.res.lba_low << 8) + done_ccb->ataio.res.sector_count; ((uint32_t *)ident_buf)[1] = softc->pm_prv; - printf("PM Revision: %08x\n", softc->pm_prv); snprintf(ident_buf->revision, sizeof(ident_buf->revision), "%04x", softc->pm_prv); path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 19:59:02 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00DA1106568B; Tue, 22 Dec 2009 19:59:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E12648FC21; Tue, 22 Dec 2009 19:59:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMJx1Mp074299; Tue, 22 Dec 2009 19:59:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMJx17i074291; Tue, 22 Dec 2009 19:59:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912221959.nBMJx17i074291@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Dec 2009 19:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200861 - in stable/7/sys: amd64/include arm/include i386/include ia64/include powerpc/include sparc64/include sun4v/include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 19:59:02 -0000 Author: kib Date: Tue Dec 22 19:59:01 2009 New Revision: 200861 URL: http://svn.freebsd.org/changeset/base/200861 Log: MFC r189926: Add AT_EXECPATH ELF auxinfo entry type. Modified: stable/7/sys/amd64/include/elf.h stable/7/sys/arm/include/elf.h stable/7/sys/i386/include/elf.h stable/7/sys/ia64/include/elf.h stable/7/sys/powerpc/include/elf.h stable/7/sys/sparc64/include/elf.h stable/7/sys/sun4v/include/elf.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/include/elf.h ============================================================================== --- stable/7/sys/amd64/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/amd64/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -81,16 +81,14 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* * Relocation types. Modified: stable/7/sys/arm/include/elf.h ============================================================================== --- stable/7/sys/arm/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/arm/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -75,8 +75,9 @@ __ElfType(Auxinfo); #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ #define R_ARM_COUNT 33 /* Count of defined relocation types. */ Modified: stable/7/sys/i386/include/elf.h ============================================================================== --- stable/7/sys/i386/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/i386/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -84,16 +84,14 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* * Relocation types. Modified: stable/7/sys/ia64/include/elf.h ============================================================================== --- stable/7/sys/ia64/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/ia64/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -82,16 +82,14 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused for i386). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* * Values for e_flags. Modified: stable/7/sys/powerpc/include/elf.h ============================================================================== --- stable/7/sys/powerpc/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/powerpc/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -77,8 +77,9 @@ __ElfType(Auxinfo); #define AT_DCACHEBSIZE 10 /* Data cache block size for the processor. */ #define AT_ICACHEBSIZE 11 /* Instruction cache block size for the uP. */ #define AT_UCACHEBSIZE 12 /* Cache block size, or `0' if cache not unified. */ +#define AT_EXECPATH 13 /* Path to the executable. */ -#define AT_COUNT 13 /* Count of defined aux entry types. */ +#define AT_COUNT 14 /* Count of defined aux entry types. */ /* * Relocation types. Modified: stable/7/sys/sparc64/include/elf.h ============================================================================== --- stable/7/sys/sparc64/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/sparc64/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -78,16 +78,14 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 Modified: stable/7/sys/sun4v/include/elf.h ============================================================================== --- stable/7/sys/sun4v/include/elf.h Tue Dec 22 19:56:35 2009 (r200860) +++ stable/7/sys/sun4v/include/elf.h Tue Dec 22 19:59:01 2009 (r200861) @@ -78,16 +78,14 @@ __ElfType(Auxinfo); #define AT_BASE 7 /* Interpreter's base address. */ #define AT_FLAGS 8 /* Flags (unused). */ #define AT_ENTRY 9 /* Where interpreter should transfer control. */ -/* - * The following non-standard values are used in Linux ELF binaries. - */ #define AT_NOTELF 10 /* Program is not ELF ?? */ #define AT_UID 11 /* Real uid. */ #define AT_EUID 12 /* Effective uid. */ #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ +#define AT_EXECPATH 15 /* Path to the executable. */ -#define AT_COUNT 15 /* Count of defined aux entry types. */ +#define AT_COUNT 16 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:00:20 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E8F106568B; Tue, 22 Dec 2009 20:00:20 +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 B5B0B8FC25; Tue, 22 Dec 2009 20:00:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMK0Kd7074402; Tue, 22 Dec 2009 20:00:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMK0KMr074400; Tue, 22 Dec 2009 20:00:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912222000.nBMK0KMr074400@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Dec 2009 20:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200862 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:00:20 -0000 Author: mav Date: Tue Dec 22 20:00:20 2009 New Revision: 200862 URL: http://svn.freebsd.org/changeset/base/200862 Log: MFC r200414: CFA support doesn't exclude FLUSH support. Modified: stable/8/sys/dev/ata/ata-disk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ata/ata-disk.c ============================================================================== --- stable/8/sys/dev/ata/ata-disk.c Tue Dec 22 19:59:01 2009 (r200861) +++ stable/8/sys/dev/ata/ata-disk.c Tue Dec 22 20:00:20 2009 (r200862) @@ -136,10 +136,10 @@ ad_attach(device_t dev) adp->disk->d_fwheads = adp->heads; adp->disk->d_unit = device_get_unit(dev); if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) - adp->disk->d_flags = DISKFLAG_CANFLUSHCACHE; + adp->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((atadev->param.support.command2 & ATA_SUPPORT_CFA) || atadev->param.config == ATA_PROTO_CFA) - adp->disk->d_flags = DISKFLAG_CANDELETE; + adp->disk->d_flags |= DISKFLAG_CANDELETE; strlcpy(adp->disk->d_ident, atadev->param.serial, sizeof(adp->disk->d_ident)); disk_create(adp->disk, DISK_VERSION); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:02:07 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40F6F106566C; Tue, 22 Dec 2009 20:02:07 +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 EC1228FC3B; Tue, 22 Dec 2009 20:02:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMK26q8074512; Tue, 22 Dec 2009 20:02:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMK26r3074510; Tue, 22 Dec 2009 20:02:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912222002.nBMK26r3074510@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Dec 2009 20:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200863 - stable/7/sys/dev/ata X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:02:07 -0000 Author: mav Date: Tue Dec 22 20:02:06 2009 New Revision: 200863 URL: http://svn.freebsd.org/changeset/base/200863 Log: MFC r200414: CFA support doesn't exclude FLUSH support. Modified: stable/7/sys/dev/ata/ata-disk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ata/ata-disk.c ============================================================================== --- stable/7/sys/dev/ata/ata-disk.c Tue Dec 22 20:00:20 2009 (r200862) +++ stable/7/sys/dev/ata/ata-disk.c Tue Dec 22 20:02:06 2009 (r200863) @@ -161,10 +161,10 @@ ad_attach(device_t dev) adp->disk->d_fwheads = adp->heads; adp->disk->d_unit = device_get_unit(dev); if (atadev->param.support.command2 & ATA_SUPPORT_FLUSHCACHE) - adp->disk->d_flags = DISKFLAG_CANFLUSHCACHE; + adp->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if ((atadev->param.support.command2 & ATA_SUPPORT_CFA) || atadev->param.config == ATA_PROTO_CFA) - adp->disk->d_flags = DISKFLAG_CANDELETE; + adp->disk->d_flags |= DISKFLAG_CANDELETE; snprintf(adp->disk->d_ident, sizeof(adp->disk->d_ident), "ad:%s", atadev->param.serial); disk_create(adp->disk, DISK_VERSION); From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:05:09 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0CE6106566C; Tue, 22 Dec 2009 20:05:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEB228FC2E; Tue, 22 Dec 2009 20:05:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMK59sR074621; Tue, 22 Dec 2009 20:05:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMK59on074616; Tue, 22 Dec 2009 20:05:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912222005.nBMK59on074616@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Dec 2009 20:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200864 - in stable/7/sys: compat/ia32 kern sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:05:09 -0000 Author: kib Date: Tue Dec 22 20:05:09 2009 New Revision: 200864 URL: http://svn.freebsd.org/changeset/base/200864 Log: MFC r189927: Supply AT_EXECPATH auxinfo entry to the interpreter, both for native and compat32 binaries. Note that the merge was edited due to fexecve(2) support not present in stable/7. Tested by: bms, Mykola Dzham Modified: stable/7/sys/compat/ia32/ia32_sysvec.c stable/7/sys/kern/imgact_elf.c stable/7/sys/kern/kern_exec.c stable/7/sys/sys/imgact.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/compat/ia32/ia32_sysvec.c ============================================================================== --- stable/7/sys/compat/ia32/ia32_sysvec.c Tue Dec 22 20:02:06 2009 (r200863) +++ stable/7/sys/compat/ia32/ia32_sysvec.c Tue Dec 22 20:05:09 2009 (r200864) @@ -203,15 +203,21 @@ ia32_copyout_strings(struct image_params char *stringp, *destp; u_int32_t *stack_base; struct freebsd32_ps_strings *arginfo; + size_t execpath_len; int szsigcode; /* * Calculate string base and vector table pointers. * Also deal with signal trampoline code for this exec type. */ + if (imgp->execpath != NULL && imgp->auxargs != NULL) + execpath_len = strlen(imgp->execpath) + 1; + else + execpath_len = 0; arginfo = (struct freebsd32_ps_strings *)FREEBSD32_PS_STRINGS; szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - + roundup(execpath_len, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* @@ -222,6 +228,15 @@ ia32_copyout_strings(struct image_params ((caddr_t)arginfo - szsigcode), szsigcode); /* + * Copy the image path for the rtld. + */ + if (execpath_len != 0) { + imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; + copyout(imgp->execpath, (void *)imgp->execpathp, + execpath_len); + } + + /* * If we have a valid auxargs ptr, prepare some room * on the stack. */ @@ -237,9 +252,9 @@ ia32_copyout_strings(struct image_params * the arg and env vector sets,and imgp->auxarg_size is room * for argument of Runtime loader. */ - vectp = (u_int32_t *) (destp - (imgp->args->argc + imgp->args->envc + 2 + - imgp->auxarg_size) * sizeof(u_int32_t)); - + vectp = (u_int32_t *) (destp - (imgp->args->argc + + imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * + sizeof(u_int32_t)); } else /* * The '+ 2' is for the null pointers at the end of each of Modified: stable/7/sys/kern/imgact_elf.c ============================================================================== --- stable/7/sys/kern/imgact_elf.c Tue Dec 22 20:02:06 2009 (r200863) +++ stable/7/sys/kern/imgact_elf.c Tue Dec 22 20:05:09 2009 (r200864) @@ -953,6 +953,8 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_FLAGS, args->flags); AUXARGS_ENTRY(pos, AT_ENTRY, args->entry); AUXARGS_ENTRY(pos, AT_BASE, args->base); + if (imgp->execpathp != 0) + AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp); AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); Modified: stable/7/sys/kern/kern_exec.c ============================================================================== --- stable/7/sys/kern/kern_exec.c Tue Dec 22 20:02:06 2009 (r200863) +++ stable/7/sys/kern/kern_exec.c Tue Dec 22 20:05:09 2009 (r200864) @@ -360,6 +360,8 @@ do_execve(td, args, mac_p) imgp->ps_strings = 0; imgp->auxarg_size = 0; imgp->args = args; + imgp->execpath = imgp->freepath = NULL; + imgp->execpathp = 0; #ifdef MAC error = mac_execve_enter(imgp, mac_p); @@ -486,6 +488,10 @@ interpret: * of the sv_copyout_strings/sv_fixup operations require the vnode. */ VOP_UNLOCK(imgp->vp, 0, td); + + if (imgp->auxargs != NULL) + vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath); + /* * Copy out strings (args and env) and initialize stack base */ @@ -814,6 +820,8 @@ exec_fail_dealloc: if (imgp->object != NULL) vm_object_deallocate(imgp->object); + free(imgp->freepath, M_TEMP); + if (error == 0) { /* * Stop the process here if its stop event mask has @@ -1125,18 +1133,24 @@ exec_copyout_strings(imgp) register_t *stack_base; struct ps_strings *arginfo; struct proc *p; + size_t execpath_len; int szsigcode; /* * Calculate string base and vector table pointers. * Also deal with signal trampoline code for this exec type. */ + if (imgp->execpath != NULL && imgp->auxargs != NULL) + execpath_len = strlen(imgp->execpath) + 1; + else + execpath_len = 0; p = imgp->proc; szsigcode = 0; arginfo = (struct ps_strings *)p->p_sysent->sv_psstrings; if (p->p_sysent->sv_szsigcode != NULL) szsigcode = *(p->p_sysent->sv_szsigcode); destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - + roundup(execpath_len, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* @@ -1147,6 +1161,15 @@ exec_copyout_strings(imgp) szsigcode), szsigcode); /* + * Copy the image path for the rtld. + */ + if (execpath_len != 0) { + imgp->execpathp = (uintptr_t)arginfo - szsigcode - execpath_len; + copyout(imgp->execpath, (void *)imgp->execpathp, + execpath_len); + } + + /* * If we have a valid auxargs ptr, prepare some room * on the stack. */ @@ -1163,9 +1186,8 @@ exec_copyout_strings(imgp) * for argument of Runtime loader. */ vectp = (char **)(destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size) * + imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * sizeof(char *)); - } else { /* * The '+ 2' is for the null pointers at the end of each of Modified: stable/7/sys/sys/imgact.h ============================================================================== --- stable/7/sys/sys/imgact.h Tue Dec 22 20:02:06 2009 (r200863) +++ stable/7/sys/sys/imgact.h Tue Dec 22 20:05:09 2009 (r200864) @@ -65,6 +65,9 @@ struct image_params { size_t auxarg_size; struct image_args *args; /* system call arguments */ struct sysentvec *sysent; /* system entry vector */ + char *execpath; + unsigned long execpathp; + char *freepath; }; #ifdef _KERNEL From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:17:04 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 316F61065670; Tue, 22 Dec 2009 20:17:04 +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 1FC848FC12; Tue, 22 Dec 2009 20:17:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMKH4Bd075134; Tue, 22 Dec 2009 20:17:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMKH3GS075132; Tue, 22 Dec 2009 20:17:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912222017.nBMKH3GS075132@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Dec 2009 20:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200866 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:17:04 -0000 Author: mav Date: Tue Dec 22 20:17:03 2009 New Revision: 200866 URL: http://svn.freebsd.org/changeset/base/200866 Log: MFC r200375: Add one more set of codec IDs. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Tue Dec 22 20:11:56 2009 (r200865) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Tue Dec 22 20:17:03 2009 (r200866) @@ -610,6 +610,7 @@ static const struct { #define CIRRUSLOGIC_VENDORID 0x1013 #define HDA_CODEC_CS4206 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206) #define HDA_CODEC_CS4207 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207) +#define HDA_CODEC_CSXXXX HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0xffff) /* Realtek */ #define REALTEK_VENDORID 0x10ec @@ -683,7 +684,9 @@ static const struct { #define HDA_CODEC_IDT92HD700D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7639) #define HDA_CODEC_IDT92HD206X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7645) #define HDA_CODEC_IDT92HD206D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7646) +#define HDA_CODEC_CXD9872RDK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7661) #define HDA_CODEC_STAC9872AK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7662) +#define HDA_CODEC_CXD9872AKD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7664) #define HDA_CODEC_STAC9221 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7680) #define HDA_CODEC_STAC922XD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681) #define HDA_CODEC_STAC9221_A2 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7682) @@ -731,6 +734,7 @@ static const struct { #define HDA_CODEC_CX20549 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045) #define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047) #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) +#define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -846,6 +850,8 @@ static const struct { { HDA_CODEC_AD1988B, "Analog Devices AD1988B" }, { HDA_CODEC_AD1989B, "Analog Devices AD1989B" }, { HDA_CODEC_CMI9880, "CMedia CMI9880" }, + { HDA_CODEC_CXD9872RDK, "Sigmatel CXD9872RD/K" }, + { HDA_CODEC_CXD9872AKD, "Sigmatel CXD9872AKD" }, { HDA_CODEC_STAC9200D, "Sigmatel STAC9200D" }, { HDA_CODEC_STAC9204X, "Sigmatel STAC9204X" }, { HDA_CODEC_STAC9204D, "Sigmatel STAC9204D" }, @@ -900,6 +906,7 @@ static const struct { { HDA_CODEC_CX20549, "Conexant CX20549 (Venice)" }, { HDA_CODEC_CX20551, "Conexant CX20551 (Waikiki)" }, { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, + { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -965,6 +972,7 @@ static const struct { /* Unknown codec */ { HDA_CODEC_ALCXXXX, "Realtek (Unknown)" }, { HDA_CODEC_ADXXXX, "Analog Devices (Unknown)" }, + { HDA_CODEC_CSXXXX, "Cirrus Logic (Unknown)" }, { HDA_CODEC_CMIXXXX, "CMedia (Unknown)" }, { HDA_CODEC_STACXXXX, "Sigmatel (Unknown)" }, { HDA_CODEC_SIIXXXX, "Silicon Image (Unknown)" }, From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:20:51 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0BF0106566C; Tue, 22 Dec 2009 20:20:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE81D8FC14; Tue, 22 Dec 2009 20:20:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMKKpKi075324; Tue, 22 Dec 2009 20:20:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMKKpeH075320; Tue, 22 Dec 2009 20:20:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200912222020.nBMKKpeH075320@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 22 Dec 2009 20:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200867 - stable/7/libexec/rtld-elf X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:20:52 -0000 Author: kib Date: Tue Dec 22 20:20:51 2009 New Revision: 200867 URL: http://svn.freebsd.org/changeset/base/200867 Log: MFC r189959: Implement the dynamic string token substitution in the rpath and soneeded pathes. MFC r190505: Do not dereference NULL pointer. MFC r199828: Flag controlling origin expansion in DT_FLAGS is DF_ORIGIN, not DF_1_ORIGIN. Merge requested by: bms Tested by: bms, Mykola Dzham Modified: stable/7/libexec/rtld-elf/map_object.c stable/7/libexec/rtld-elf/rtld.c stable/7/libexec/rtld-elf/rtld.h Directory Properties: stable/7/libexec/rtld-elf/ (props changed) Modified: stable/7/libexec/rtld-elf/map_object.c ============================================================================== --- stable/7/libexec/rtld-elf/map_object.c Tue Dec 22 20:17:03 2009 (r200866) +++ stable/7/libexec/rtld-elf/map_object.c Tue Dec 22 20:20:51 2009 (r200867) @@ -351,6 +351,8 @@ obj_free(Obj_Entry *obj) free(obj->vertab); if (obj->origin_path) free(obj->origin_path); + if (obj->z_origin) + free(obj->rpath); if (obj->priv) free(obj->priv); if (obj->path) Modified: stable/7/libexec/rtld-elf/rtld.c ============================================================================== --- stable/7/libexec/rtld-elf/rtld.c Tue Dec 22 20:17:03 2009 (r200866) +++ stable/7/libexec/rtld-elf/rtld.c Tue Dec 22 20:20:51 2009 (r200867) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -118,6 +119,7 @@ static void objlist_remove_unref(Objlist static void *path_enumerate(const char *, path_enum_proc, void *); static int relocate_objects(Obj_Entry *, bool, Obj_Entry *); static int rtld_dirname(const char *, char *); +static int rtld_dirname_abs(const char *, char *); static void rtld_exit(void); static char *search_library_path(const char *, const char *); static const void **get_program_var_addr(const char *); @@ -134,6 +136,9 @@ static void unlink_object(Obj_Entry *); static void unload_object(Obj_Entry *); static void unref_dag(Obj_Entry *); static void ref_dag(Obj_Entry *); +static int origin_subst_one(char **res, const char *real, const char *kw, + const char *subst, char *may_free); +static char *origin_subst(const char *real, const char *origin_path); static int rtld_verify_versions(const Objlist *); static int rtld_verify_object_versions(Obj_Entry *); static void object_add_name(Obj_Entry *, const char *); @@ -419,7 +424,25 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ die(); } - obj_main->path = xstrdup(argv0); + if (aux_info[AT_EXECPATH] != 0) { + char *kexecpath; + char buf[MAXPATHLEN]; + + kexecpath = aux_info[AT_EXECPATH]->a_un.a_ptr; + dbg("AT_EXECPATH %p %s", kexecpath, kexecpath); + if (kexecpath[0] == '/') + obj_main->path = kexecpath; + else if (getcwd(buf, sizeof(buf)) == NULL || + strlcat(buf, "/", sizeof(buf)) >= sizeof(buf) || + strlcat(buf, kexecpath, sizeof(buf)) >= sizeof(buf)) + obj_main->path = xstrdup(argv0); + else + obj_main->path = xstrdup(buf); + } else { + dbg("No AT_EXECPATH"); + obj_main->path = xstrdup(argv0); + } + dbg("obj_main path %s", obj_main->path); obj_main->mainprog = true; /* @@ -621,6 +644,83 @@ basename(const char *name) return p != NULL ? p + 1 : name; } +static struct utsname uts; + +static int +origin_subst_one(char **res, const char *real, const char *kw, const char *subst, + char *may_free) +{ + const char *p, *p1; + char *res1; + int subst_len; + int kw_len; + + res1 = *res = NULL; + p = real; + subst_len = kw_len = 0; + for (;;) { + p1 = strstr(p, kw); + if (p1 != NULL) { + if (subst_len == 0) { + subst_len = strlen(subst); + kw_len = strlen(kw); + } + if (*res == NULL) { + *res = xmalloc(PATH_MAX); + res1 = *res; + } + if ((res1 - *res) + subst_len + (p1 - p) >= PATH_MAX) { + _rtld_error("Substitution of %s in %s cannot be performed", + kw, real); + if (may_free != NULL) + free(may_free); + free(res); + return (false); + } + memcpy(res1, p, p1 - p); + res1 += p1 - p; + memcpy(res1, subst, subst_len); + res1 += subst_len; + p = p1 + kw_len; + } else { + if (*res == NULL) { + if (may_free != NULL) + *res = may_free; + else + *res = xstrdup(real); + return (true); + } + *res1 = '\0'; + if (may_free != NULL) + free(may_free); + if (strlcat(res1, p, PATH_MAX - (res1 - *res)) >= PATH_MAX) { + free(res); + return (false); + } + return (true); + } + } +} + +static char * +origin_subst(const char *real, const char *origin_path) +{ + char *res1, *res2, *res3, *res4; + + if (uts.sysname[0] == '\0') { + if (uname(&uts) != 0) { + _rtld_error("utsname failed: %d", errno); + return (NULL); + } + } + if (!origin_subst_one(&res1, real, "$ORIGIN", origin_path, NULL) || + !origin_subst_one(&res2, res1, "$OSNAME", uts.sysname, res1) || + !origin_subst_one(&res3, res2, "$OSREL", uts.release, res2) || + !origin_subst_one(&res4, res3, "$PLATFORM", uts.machine, res3)) + return (NULL); + return (res4); +} + static void die(void) { @@ -790,11 +890,8 @@ digest_dynamic(Obj_Entry *obj, int early break; case DT_FLAGS: - if (dynp->d_un.d_val & DF_ORIGIN) { - obj->origin_path = xmalloc(PATH_MAX); - if (rtld_dirname(obj->path, obj->origin_path) == -1) - die(); - } + if ((dynp->d_un.d_val & DF_ORIGIN) && trust) + obj->z_origin = true; if (dynp->d_un.d_val & DF_SYMBOLIC) obj->symbolic = true; if (dynp->d_un.d_val & DF_TEXTREL) @@ -805,6 +902,15 @@ digest_dynamic(Obj_Entry *obj, int early ; break; + case DT_FLAGS_1: + if ((dynp->d_un.d_val & DF_1_ORIGIN) && trust) + obj->z_origin = true; + if (dynp->d_un.d_val & DF_1_GLOBAL) + /* XXX */; + if (dynp->d_un.d_val & DF_1_BIND_NOW) + obj->bind_now = true; + break; + default: if (!early) { dbg("Ignoring d_tag %ld = %#lx", (long)dynp->d_tag, @@ -823,8 +929,17 @@ digest_dynamic(Obj_Entry *obj, int early obj->pltrelsize = 0; } - if (dyn_rpath != NULL) - obj->rpath = obj->strtab + dyn_rpath->d_un.d_val; + if (obj->z_origin && obj->origin_path == NULL) { + obj->origin_path = xmalloc(PATH_MAX); + if (rtld_dirname_abs(obj->path, obj->origin_path) == -1) + die(); + } + + if (dyn_rpath != NULL) { + obj->rpath = (char *)obj->strtab + dyn_rpath->d_un.d_val; + if (obj->z_origin) + obj->rpath = origin_subst(obj->rpath, obj->origin_path); + } if (dyn_soname != NULL) object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val); @@ -982,7 +1097,10 @@ find_library(const char *xname, const Ob xname); return NULL; } - return xstrdup(xname); + if (refobj != NULL && refobj->z_origin) + return origin_subst(xname, refobj->origin_path); + else + return xstrdup(xname); } if (libmap_disable || (refobj == NULL) || @@ -2295,6 +2413,23 @@ rtld_dirname(const char *path, char *bna return (0); } +static int +rtld_dirname_abs(const char *path, char *base) +{ + char base_rel[PATH_MAX]; + + if (rtld_dirname(path, base) == -1) + return (-1); + if (base[0] == '/') + return (0); + if (getcwd(base_rel, sizeof(base_rel)) == NULL || + strlcat(base_rel, "/", sizeof(base_rel)) >= sizeof(base_rel) || + strlcat(base_rel, base, sizeof(base_rel)) >= sizeof(base_rel)) + return (-1); + strcpy(base, base_rel); + return (0); +} + static void linkmap_add(Obj_Entry *obj) { Modified: stable/7/libexec/rtld-elf/rtld.h ============================================================================== --- stable/7/libexec/rtld-elf/rtld.h Tue Dec 22 20:17:03 2009 (r200866) +++ stable/7/libexec/rtld-elf/rtld.h Tue Dec 22 20:20:51 2009 (r200867) @@ -190,7 +190,7 @@ typedef struct Struct_Obj_Entry { const Elf_Hashelt *chains; /* Hash table chain array */ unsigned long nchains; /* Number of chains */ - const char *rpath; /* Search path specified in object */ + char *rpath; /* Search path specified in object */ Needed_Entry *needed; /* Shared objects needed by this one (%) */ STAILQ_HEAD(, Struct_Name_Entry) names; /* List of names for this object we @@ -211,6 +211,7 @@ typedef struct Struct_Obj_Entry { bool init_done : 1; /* Already have added object to init list */ bool tls_done : 1; /* Already allocated offset for static TLS */ bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ + bool z_origin : 1; /* Process rpath and soname tokens */ struct link_map linkmap; /* for GDB and dlinfo() */ Objlist dldags; /* Object belongs to these dlopened DAGs (%) */ From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:24:07 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00EC31065670; Tue, 22 Dec 2009 20:24:07 +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 A33BF8FC0A; Tue, 22 Dec 2009 20:24:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMKO6qm075460; Tue, 22 Dec 2009 20:24:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMKO64K075458; Tue, 22 Dec 2009 20:24:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912222024.nBMKO64K075458@svn.freebsd.org> From: Alexander Motin Date: Tue, 22 Dec 2009 20:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200868 - stable/7/sys/dev/sound/pci/hda X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:24:07 -0000 Author: mav Date: Tue Dec 22 20:24:06 2009 New Revision: 200868 URL: http://svn.freebsd.org/changeset/base/200868 Log: MFC r200375: Add one more set of codec IDs. Modified: stable/7/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/7/sys/dev/sound/pci/hda/hdac.c Tue Dec 22 20:20:51 2009 (r200867) +++ stable/7/sys/dev/sound/pci/hda/hdac.c Tue Dec 22 20:24:06 2009 (r200868) @@ -606,6 +606,7 @@ static const struct { #define CIRRUSLOGIC_VENDORID 0x1013 #define HDA_CODEC_CS4206 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206) #define HDA_CODEC_CS4207 HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207) +#define HDA_CODEC_CSXXXX HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0xffff) /* Realtek */ #define REALTEK_VENDORID 0x10ec @@ -679,7 +680,9 @@ static const struct { #define HDA_CODEC_IDT92HD700D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7639) #define HDA_CODEC_IDT92HD206X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7645) #define HDA_CODEC_IDT92HD206D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7646) +#define HDA_CODEC_CXD9872RDK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7661) #define HDA_CODEC_STAC9872AK HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7662) +#define HDA_CODEC_CXD9872AKD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7664) #define HDA_CODEC_STAC9221 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7680) #define HDA_CODEC_STAC922XD HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681) #define HDA_CODEC_STAC9221_A2 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7682) @@ -727,6 +730,7 @@ static const struct { #define HDA_CODEC_CX20549 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045) #define HDA_CODEC_CX20551 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047) #define HDA_CODEC_CX20561 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051) +#define HDA_CODEC_CX20582 HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066) #define HDA_CODEC_CXXXXX HDA_CODEC_CONSTRUCT(CONEXANT, 0xffff) /* VIA */ @@ -842,6 +846,8 @@ static const struct { { HDA_CODEC_AD1988B, "Analog Devices AD1988B" }, { HDA_CODEC_AD1989B, "Analog Devices AD1989B" }, { HDA_CODEC_CMI9880, "CMedia CMI9880" }, + { HDA_CODEC_CXD9872RDK, "Sigmatel CXD9872RD/K" }, + { HDA_CODEC_CXD9872AKD, "Sigmatel CXD9872AKD" }, { HDA_CODEC_STAC9200D, "Sigmatel STAC9200D" }, { HDA_CODEC_STAC9204X, "Sigmatel STAC9204X" }, { HDA_CODEC_STAC9204D, "Sigmatel STAC9204D" }, @@ -896,6 +902,7 @@ static const struct { { HDA_CODEC_CX20549, "Conexant CX20549 (Venice)" }, { HDA_CODEC_CX20551, "Conexant CX20551 (Waikiki)" }, { HDA_CODEC_CX20561, "Conexant CX20561 (Hermosa)" }, + { HDA_CODEC_CX20582, "Conexant CX20582 (Pebble)" }, { HDA_CODEC_VT1708_8, "VIA VT1708_8" }, { HDA_CODEC_VT1708_9, "VIA VT1708_9" }, { HDA_CODEC_VT1708_A, "VIA VT1708_A" }, @@ -961,6 +968,7 @@ static const struct { /* Unknown codec */ { HDA_CODEC_ALCXXXX, "Realtek (Unknown)" }, { HDA_CODEC_ADXXXX, "Analog Devices (Unknown)" }, + { HDA_CODEC_CSXXXX, "Cirrus Logic (Unknown)" }, { HDA_CODEC_CMIXXXX, "CMedia (Unknown)" }, { HDA_CODEC_STACXXXX, "Sigmatel (Unknown)" }, { HDA_CODEC_SIIXXXX, "Silicon Image (Unknown)" }, From owner-svn-src-stable@FreeBSD.ORG Tue Dec 22 20:33:28 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31BAD10656C0; Tue, 22 Dec 2009 20:33:28 +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 2091E8FC13; Tue, 22 Dec 2009 20:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBMKXS7m075761; Tue, 22 Dec 2009 20:33:28 GMT (envelope-from bms@svn.freebsd.org) Received: (from bms@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBMKXSdE075759; Tue, 22 Dec 2009 20:33:28 GMT (envelope-from bms@svn.freebsd.org) Message-Id: <200912222033.nBMKXSdE075759@svn.freebsd.org> From: Bruce M Simpson Date: Tue, 22 Dec 2009 20:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200869 - stable/8/sys/netinet6 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Dec 2009 20:33:28 -0000 Author: bms Date: Tue Dec 22 20:33:27 2009 New Revision: 200869 URL: http://svn.freebsd.org/changeset/base/200869 Log: MFC r200572: Add missing #include . Submitted by: Hideki Yamamoto Modified: stable/8/sys/netinet6/mld6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet6/mld6.c ============================================================================== --- stable/8/sys/netinet6/mld6.c Tue Dec 22 20:24:06 2009 (r200868) +++ stable/8/sys/netinet6/mld6.c Tue Dec 22 20:33:27 2009 (r200869) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-stable@FreeBSD.ORG Wed Dec 23 11:35:26 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A2E4106566B; Wed, 23 Dec 2009 11:35:26 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 391FA8FC14; Wed, 23 Dec 2009 11:35:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBNBZQR7096794; Wed, 23 Dec 2009 11:35:26 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBNBZQci096792; Wed, 23 Dec 2009 11:35:26 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200912231135.nBNBZQci096792@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 23 Dec 2009 11:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200895 - stable/8/sys/dev/fdc X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2009 11:35:26 -0000 Author: jh Date: Wed Dec 23 11:35:25 2009 New Revision: 200895 URL: http://svn.freebsd.org/changeset/base/200895 Log: MFC r198520, r198857: fdc(4) module unload fixes PR: kern/104079 Approved by: trasz (mentor) Modified: stable/8/sys/dev/fdc/fdc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/fdc/fdc.c ============================================================================== --- stable/8/sys/dev/fdc/fdc.c Wed Dec 23 08:22:48 2009 (r200894) +++ stable/8/sys/dev/fdc/fdc.c Wed Dec 23 11:35:25 2009 (r200895) @@ -1734,6 +1734,10 @@ fdc_detach(device_t dev) if ((error = bus_generic_detach(dev))) return (error); + if (fdc->fdc_intr) + bus_teardown_intr(dev, fdc->res_irq, fdc->fdc_intr); + fdc->fdc_intr = NULL; + /* kill worker thread */ mtx_lock(&fdc->fdc_mtx); fdc->flags |= FDC_KTHREAD_EXIT; @@ -2031,15 +2035,22 @@ fd_attach(device_t dev) return (0); } +static void +fd_detach_geom(void *arg, int flag) +{ + struct fd_data *fd = arg; + + g_topology_assert(); + g_wither_geom(fd->fd_geom, ENXIO); +} + static int fd_detach(device_t dev) { struct fd_data *fd; fd = device_get_softc(dev); - g_topology_lock(); - g_wither_geom(fd->fd_geom, ENXIO); - g_topology_unlock(); + g_waitfor_event(fd_detach_geom, fd, M_WAITOK, NULL); while (device_get_state(dev) == DS_BUSY) tsleep(fd, PZERO, "fdd", hz/10); callout_drain(&fd->toffhandle); @@ -2068,8 +2079,7 @@ static int fdc_modevent(module_t mod, int type, void *data) { - g_modevent(NULL, type, &g_fd_class); - return (0); + return (g_modevent(NULL, type, &g_fd_class)); } DRIVER_MODULE(fd, fdc, fd_driver, fd_devclass, fdc_modevent, 0); From owner-svn-src-stable@FreeBSD.ORG Wed Dec 23 16:30:41 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 396EF1065679; Wed, 23 Dec 2009 16:30:40 +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 B14E08FC0A; Wed, 23 Dec 2009 16:30:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBNGUdmx003212; Wed, 23 Dec 2009 16:30:39 GMT (envelope-from bcr@svn.freebsd.org) Received: (from bcr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBNGUdml003210; Wed, 23 Dec 2009 16:30:39 GMT (envelope-from bcr@svn.freebsd.org) Message-Id: <200912231630.nBNGUdml003210@svn.freebsd.org> From: Benedict Reuschling Date: Wed, 23 Dec 2009 16:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200903 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2009 16:30:41 -0000 Author: bcr (doc committer) Date: Wed Dec 23 16:30:39 2009 New Revision: 200903 URL: http://svn.freebsd.org/changeset/base/200903 Log: MFC r200731: Reference the correct man page for firmware(9). PR: docs/140986 Submitted by: Glen Barber (glen dot j dot barber at gmail dot com) Reviewed by: sam Approved by: sam, jkois (mentor) Modified: stable/8/share/man/man4/mwlfw.4 Modified: stable/8/share/man/man4/mwlfw.4 ============================================================================== --- stable/8/share/man/man4/mwlfw.4 Wed Dec 23 15:22:50 2009 (r200902) +++ stable/8/share/man/man4/mwlfw.4 Wed Dec 23 16:30:39 2009 (r200903) @@ -49,4 +49,4 @@ It may be statically linked into the kernel, or loaded as a module. .Sh SEE ALSO .Xr mwl 4 , -.Xr firmware 8 +.Xr firmware 9 From owner-svn-src-stable@FreeBSD.ORG Wed Dec 23 22:59:04 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C4D4106568B; Wed, 23 Dec 2009 22:59:04 +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 19FE28FC13; Wed, 23 Dec 2009 22:59:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBNMx4qA011881; Wed, 23 Dec 2009 22:59:04 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBNMx3Ix011879; Wed, 23 Dec 2009 22:59:03 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912232259.nBNMx3Ix011879@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 23 Dec 2009 22:59:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200927 - in stable/8/bin: . pwait X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Dec 2009 22:59:04 -0000 Author: jilles Date: Wed Dec 23 22:59:03 2009 New Revision: 200927 URL: http://svn.freebsd.org/changeset/base/200927 Log: MFC r199458: Add pwait utility, which waits for any process to terminate. This is similar to the Solaris utility of the same name. Some use cases: * rc.subr's wait_for_pids * interactive use, e.g. to shut down the computer when some task is done even if the task is already running Added: stable/8/bin/pwait/ - copied from r199458, head/bin/pwait/ Modified: stable/8/bin/Makefile Directory Properties: stable/8/bin/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/sh/ (props changed) Modified: stable/8/bin/Makefile ============================================================================== --- stable/8/bin/Makefile Wed Dec 23 22:31:43 2009 (r200926) +++ stable/8/bin/Makefile Wed Dec 23 22:59:03 2009 (r200927) @@ -27,6 +27,7 @@ SUBDIR= cat \ pax \ pkill \ ps \ + pwait \ pwd \ ${_rcp} \ realpath \ From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 01:28:26 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACEF8106566B; Thu, 24 Dec 2009 01:28:26 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 813748FC19; Thu, 24 Dec 2009 01:28:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBO1SQt4015086; Thu, 24 Dec 2009 01:28:26 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBO1SQHk015083; Thu, 24 Dec 2009 01:28:26 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <200912240128.nBO1SQHk015083@svn.freebsd.org> From: Edwin Groothuis Date: Thu, 24 Dec 2009 01:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200931 - stable/8/usr.bin/calendar/calendars X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 01:28:26 -0000 Author: edwin Date: Thu Dec 24 01:28:26 2009 New Revision: 200931 URL: http://svn.freebsd.org/changeset/base/200931 Log: MFC of r200650, r200624 Add Australian, New Zealand and Ukraian calendars to the "all" target". Nationalise Easter -> Pasen in calendar.dutch Modified: stable/8/usr.bin/calendar/calendars/calendar.all stable/8/usr.bin/calendar/calendars/calendar.dutch Directory Properties: stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/calendar/calendars/calendar.freebsd (props changed) Modified: stable/8/usr.bin/calendar/calendars/calendar.all ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.all Thu Dec 24 00:43:44 2009 (r200930) +++ stable/8/usr.bin/calendar/calendars/calendar.all Thu Dec 24 01:28:26 2009 (r200931) @@ -8,13 +8,16 @@ #define _calendar_all_ #include +#include #include #include #include #include #include -#include +#include #include +#include +#include #include #endif /* !_calendar_all_ */ Modified: stable/8/usr.bin/calendar/calendars/calendar.dutch ============================================================================== --- stable/8/usr.bin/calendar/calendars/calendar.dutch Thu Dec 24 00:43:44 2009 (r200930) +++ stable/8/usr.bin/calendar/calendars/calendar.dutch Thu Dec 24 01:28:26 2009 (r200931) @@ -5,6 +5,7 @@ */ LANG=nl_NL.ISO8859-15 +Easter=Pasen /* * Feestdagen @@ -32,21 +33,21 @@ LANG=nl_NL.ISO8859-15 /* * Pasen gerelateerd */ -Easter-50 Carnaval -Easter-49 Carnaval -Easter-48 Carnaval -Easter-47 Carnaval (Vastenavond) -Easter-46 Aswoensdag -Easter-7 Palmzondag -Easter-3 Witte Donderdag -Easter-2 Goede vrijdag -Easter-1 Stille zaterdag -Easter Eerste paasdag -Easter+1 Tweede paasdag -Easter+39 Hemelvaartsdag -Easter+49 Eerste Pinksterdag -Easter+50 Tweede Pinksterdag -Easter+56 Trinitatis +Pasen-50 Carnaval +Pasen-49 Carnaval +Pasen-48 Carnaval +Pasen-47 Carnaval (Vastenavond) +Pasen-46 Aswoensdag +Pasen-7 Palmzondag +Pasen-3 Witte Donderdag +Pasen-2 Goede vrijdag +Pasen-1 Stille zaterdag +Pasen Eerste paasdag +Pasen+1 Tweede paasdag +Pasen+39 Hemelvaartsdag +Pasen+49 Eerste Pinksterdag +Pasen+50 Tweede Pinksterdag +Pasen+56 Trinitatis /* * Misc From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 12:19:52 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF98E1065692; Thu, 24 Dec 2009 12:19:52 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B449F8FC0C; Thu, 24 Dec 2009 12:19:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOCJq9H029991; Thu, 24 Dec 2009 12:19:52 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOCJqbf029988; Thu, 24 Dec 2009 12:19:52 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912241219.nBOCJqbf029988@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 24 Dec 2009 12:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200936 - in stable/8/sys/boot: i386/libi386 pc98/libpc98 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 12:19:53 -0000 Author: nyan Date: Thu Dec 24 12:19:52 2009 New Revision: 200936 URL: http://svn.freebsd.org/changeset/base/200936 Log: MFC: revision 200631 Fix debug messages of bd_io(). Modified: stable/8/sys/boot/i386/libi386/biosdisk.c stable/8/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/8/sys/boot/i386/libi386/biosdisk.c Thu Dec 24 12:17:22 2009 (r200935) +++ stable/8/sys/boot/i386/libi386/biosdisk.c Thu Dec 24 12:19:52 2009 (r200936) @@ -1266,11 +1266,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } Modified: stable/8/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/8/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 12:17:22 2009 (r200935) +++ stable/8/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 12:19:52 2009 (r200936) @@ -906,11 +906,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 12:26:14 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48BDD1065694; Thu, 24 Dec 2009 12:26:14 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D7968FC08; Thu, 24 Dec 2009 12:26:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOCQEZU030172; Thu, 24 Dec 2009 12:26:14 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOCQDwS030169; Thu, 24 Dec 2009 12:26:13 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912241226.nBOCQDwS030169@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 24 Dec 2009 12:26:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200937 - in stable/7/sys/boot: i386/libi386 pc98/libpc98 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 12:26:14 -0000 Author: nyan Date: Thu Dec 24 12:26:13 2009 New Revision: 200937 URL: http://svn.freebsd.org/changeset/base/200937 Log: MFC: revision 200631 Fix debug messages of bd_io(). Modified: stable/7/sys/boot/i386/libi386/biosdisk.c stable/7/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/7/sys/boot/i386/libi386/biosdisk.c Thu Dec 24 12:19:52 2009 (r200936) +++ stable/7/sys/boot/i386/libi386/biosdisk.c Thu Dec 24 12:26:13 2009 (r200937) @@ -1274,11 +1274,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } Modified: stable/7/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/7/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 12:19:52 2009 (r200936) +++ stable/7/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 12:26:13 2009 (r200937) @@ -846,11 +846,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 12:31:27 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BB1A106566C; Thu, 24 Dec 2009 12:31:27 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60BA78FC0A; Thu, 24 Dec 2009 12:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOCVR5R030388; Thu, 24 Dec 2009 12:31:27 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOCVRrS030385; Thu, 24 Dec 2009 12:31:27 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <200912241231.nBOCVRrS030385@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 24 Dec 2009 12:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200939 - in stable/6/sys/boot: i386/libi386 pc98/libpc98 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 12:31:27 -0000 Author: nyan Date: Thu Dec 24 12:31:27 2009 New Revision: 200939 URL: http://svn.freebsd.org/changeset/base/200939 Log: MFC: revision 200631 Fix debug messages of bd_io(). Modified: stable/6/sys/boot/i386/libi386/biosdisk.c stable/6/sys/boot/pc98/libpc98/biosdisk.c Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- stable/6/sys/boot/i386/libi386/biosdisk.c Thu Dec 24 12:27:22 2009 (r200938) +++ stable/6/sys/boot/i386/libi386/biosdisk.c Thu Dec 24 12:31:27 2009 (r200939) @@ -1268,11 +1268,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } Modified: stable/6/sys/boot/pc98/libpc98/biosdisk.c ============================================================================== --- stable/6/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 12:27:22 2009 (r200938) +++ stable/6/sys/boot/pc98/libpc98/biosdisk.c Thu Dec 24 12:31:27 2009 (r200939) @@ -846,11 +846,11 @@ bd_io(struct open_disk *od, daddr_t dblk } if (write) - DEBUG("%d sectors from %lld to %p (0x%x) %s", x, dblk, p, VTOP(p), - result ? "failed" : "ok"); + DEBUG("Write %d sector(s) from %p (0x%x) to %lld %s", x, + p, VTOP(p), dblk, result ? "failed" : "ok"); else - DEBUG("%d sectors from %p (0x%x) to %lld %s", x, p, VTOP(p), dblk, - result ? "failed" : "ok"); + DEBUG("Read %d sector(s) from %lld to %p (0x%x) %s", x, + dblk, p, VTOP(p), result ? "failed" : "ok"); if (result) { return(-1); } From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 20:29:58 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CEA3D106566B; Thu, 24 Dec 2009 20:29:58 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCF8C8FC18; Thu, 24 Dec 2009 20:29:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOKTw73040383; Thu, 24 Dec 2009 20:29:58 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOKTwaX040381; Thu, 24 Dec 2009 20:29:58 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200912242029.nBOKTwaX040381@svn.freebsd.org> From: Peter Pentchev Date: Thu, 24 Dec 2009 20:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200960 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 20:29:58 -0000 Author: roam (doc,ports committer) Date: Thu Dec 24 20:29:58 2009 New Revision: 200960 URL: http://svn.freebsd.org/changeset/base/200960 Log: MFC r199863: Fix the cross-reference to sctp_opt_info in the text - section 3, not 2. PR: 140938 Submitted by: Bruce Cran Modified: stable/8/share/man/man4/sctp.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/sctp.4 ============================================================================== --- stable/8/share/man/man4/sctp.4 Thu Dec 24 19:06:13 2009 (r200959) +++ stable/8/share/man/man4/sctp.4 Thu Dec 24 20:29:58 2009 (r200960) @@ -179,7 +179,7 @@ supports a number of socket options whic and tested with .Xr getsockopt 2 or -.Xr sctp_opt_info 2 : +.Xr sctp_opt_info 3 : .Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" .It Dv SCTP_NODELAY Under most circumstances, From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 20:31:27 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 448721065679; Thu, 24 Dec 2009 20:31:27 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 331B18FC17; Thu, 24 Dec 2009 20:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOKVRMP040464; Thu, 24 Dec 2009 20:31:27 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOKVRKN040462; Thu, 24 Dec 2009 20:31:27 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200912242031.nBOKVRKN040462@svn.freebsd.org> From: Peter Pentchev Date: Thu, 24 Dec 2009 20:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200961 - stable/7/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 20:31:27 -0000 Author: roam (doc,ports committer) Date: Thu Dec 24 20:31:26 2009 New Revision: 200961 URL: http://svn.freebsd.org/changeset/base/200961 Log: MFC r199863: Fix the cross-reference to sctp_opt_info in the text - section 3, not 2. PR: 140938 Submitted by: Bruce Cran Modified: stable/7/share/man/man4/sctp.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/sctp.4 ============================================================================== --- stable/7/share/man/man4/sctp.4 Thu Dec 24 20:29:58 2009 (r200960) +++ stable/7/share/man/man4/sctp.4 Thu Dec 24 20:31:26 2009 (r200961) @@ -179,7 +179,7 @@ supports a number of socket options whic and tested with .Xr getsockopt 2 or -.Xr sctp_opt_info 2 : +.Xr sctp_opt_info 3 : .Bl -tag -width ".Dv SCTP_SET_PEER_PRIMARY_ADDR" .It Dv SCTP_NODELAY Under most circumstances, From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 20:35:01 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABA8106566B; Thu, 24 Dec 2009 20:35:01 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D92A28FC0A; Thu, 24 Dec 2009 20:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOKZ16U040598; Thu, 24 Dec 2009 20:35:01 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOKZ15N040596; Thu, 24 Dec 2009 20:35:01 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200912242035.nBOKZ15N040596@svn.freebsd.org> From: Peter Pentchev Date: Thu, 24 Dec 2009 20:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200962 - stable/8/lib/libc/locale X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 20:35:02 -0000 Author: roam (doc,ports committer) Date: Thu Dec 24 20:35:01 2009 New Revision: 200962 URL: http://svn.freebsd.org/changeset/base/200962 Log: MFC r199244: Fix the grammar in the isgraph(3) description, almost as per the PR. PR: 140455 Submitted by: Jeremy Huddleston Modified: stable/8/lib/libc/locale/isgraph.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/locale/isgraph.3 ============================================================================== --- stable/8/lib/libc/locale/isgraph.3 Thu Dec 24 20:31:26 2009 (r200961) +++ stable/8/lib/libc/locale/isgraph.3 Thu Dec 24 20:35:01 2009 (r200962) @@ -50,7 +50,7 @@ The function tests for any printing character except space .Pq Ql "\ " and other -locale specific space-like characters. +locale-specific space-like characters. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 20:35:41 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DACF0106566B; Thu, 24 Dec 2009 20:35:41 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C98E28FC1A; Thu, 24 Dec 2009 20:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOKZftJ040665; Thu, 24 Dec 2009 20:35:41 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOKZfUx040663; Thu, 24 Dec 2009 20:35:41 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200912242035.nBOKZfUx040663@svn.freebsd.org> From: Peter Pentchev Date: Thu, 24 Dec 2009 20:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200963 - stable/7/lib/libc/locale X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 20:35:42 -0000 Author: roam (doc,ports committer) Date: Thu Dec 24 20:35:41 2009 New Revision: 200963 URL: http://svn.freebsd.org/changeset/base/200963 Log: MFC r199244: Fix the grammar in the isgraph(3) description, almost as per the PR. PR: 140455 Submitted by: Jeremy Huddleston Modified: stable/7/lib/libc/locale/isgraph.3 Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/locale/isgraph.3 ============================================================================== --- stable/7/lib/libc/locale/isgraph.3 Thu Dec 24 20:35:01 2009 (r200962) +++ stable/7/lib/libc/locale/isgraph.3 Thu Dec 24 20:35:41 2009 (r200963) @@ -50,7 +50,7 @@ The function tests for any printing character except space .Pq Ql "\ " and other -locale specific space-like characters. +locale-specific space-like characters. The value of the argument must be representable as an .Vt "unsigned char" or the value of From owner-svn-src-stable@FreeBSD.ORG Thu Dec 24 20:36:38 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C63E106566B; Thu, 24 Dec 2009 20:36:38 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B0258FC0C; Thu, 24 Dec 2009 20:36:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOKacw8040731; Thu, 24 Dec 2009 20:36:38 GMT (envelope-from roam@svn.freebsd.org) Received: (from roam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOKabMv040729; Thu, 24 Dec 2009 20:36:37 GMT (envelope-from roam@svn.freebsd.org) Message-Id: <200912242036.nBOKabMv040729@svn.freebsd.org> From: Peter Pentchev Date: Thu, 24 Dec 2009 20:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200964 - stable/6/lib/libc/locale X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 20:36:38 -0000 Author: roam (doc,ports committer) Date: Thu Dec 24 20:36:37 2009 New Revision: 200964 URL: http://svn.freebsd.org/changeset/base/200964 Log: MFC r199244: Fix the grammar in the isgraph(3) description, almost as per the PR. PR: 140455 Submitted by: Jeremy Huddleston Modified: stable/6/lib/libc/locale/isgraph.3 Directory Properties: stable/6/lib/libc/ (props changed) Modified: stable/6/lib/libc/locale/isgraph.3 ============================================================================== --- stable/6/lib/libc/locale/isgraph.3 Thu Dec 24 20:35:41 2009 (r200963) +++ stable/6/lib/libc/locale/isgraph.3 Thu Dec 24 20:36:37 2009 (r200964) @@ -54,7 +54,7 @@ The function tests for any printing character except space .Pq Ql "\ " and other -locale specific space-like characters. +locale-specific space-like characters. For single C .Va char Ns s locales (see From owner-svn-src-stable@FreeBSD.ORG Fri Dec 25 08:06:36 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E30B1065670; Fri, 25 Dec 2009 08:06:36 +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 2C02B8FC12; Fri, 25 Dec 2009 08:06:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBP86apE054121; Fri, 25 Dec 2009 08:06:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBP86a2i054119; Fri, 25 Dec 2009 08:06:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912250806.nBP86a2i054119@svn.freebsd.org> From: Alexander Motin Date: Fri, 25 Dec 2009 08:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200978 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 08:06:36 -0000 Author: mav Date: Fri Dec 25 08:06:35 2009 New Revision: 200978 URL: http://svn.freebsd.org/changeset/base/200978 Log: MFC r200668: Remove duplicate devstat_start_transaction_bio() call. It is already called from geom_disk. Dulicate call causes wrong queue depth and busy accounting. Modified: stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Fri Dec 25 07:59:31 2009 (r200977) +++ stable/8/sys/cam/scsi/scsi_cd.c Fri Dec 25 08:06:35 2009 (r200978) @@ -1464,8 +1464,6 @@ cdstart(struct cam_periph *periph, union } else { bioq_remove(&softc->bio_queue, bp); - devstat_start_transaction_bio(softc->disk->d_devstat, bp); - scsi_read_write(&start_ccb->csio, /*retries*/cd_retry_count, /* cbfcnp */ cddone, From owner-svn-src-stable@FreeBSD.ORG Fri Dec 25 21:28:16 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A4B6106568F; Fri, 25 Dec 2009 21:28:16 +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 78BFE8FC15; Fri, 25 Dec 2009 21:28:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBPLSGi7072013; Fri, 25 Dec 2009 21:28:16 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBPLSGik072011; Fri, 25 Dec 2009 21:28:16 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <200912252128.nBPLSGik072011@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 25 Dec 2009 21:28:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201002 - in stable/7/bin: . pwait X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Dec 2009 21:28:16 -0000 Author: jilles Date: Fri Dec 25 21:28:16 2009 New Revision: 201002 URL: http://svn.freebsd.org/changeset/base/201002 Log: MFC r199458: Add pwait utility, which waits for any process to terminate. This is similar to the Solaris utility of the same name. Some use cases: * rc.subr's wait_for_pids * interactive use, e.g. to shut down the computer when some task is done even if the task is already running Added: stable/7/bin/pwait/ - copied from r199458, head/bin/pwait/ Modified: stable/7/bin/Makefile Directory Properties: stable/7/bin/ (props changed) stable/7/bin/chflags/ (props changed) stable/7/bin/chio/ (props changed) stable/7/bin/cp/ (props changed) stable/7/bin/csh/ (props changed) stable/7/bin/dd/ (props changed) stable/7/bin/df/ (props changed) stable/7/bin/ln/ (props changed) stable/7/bin/pax/ (props changed) stable/7/bin/ps/ (props changed) stable/7/bin/rm/ (props changed) stable/7/bin/sh/ (props changed) Modified: stable/7/bin/Makefile ============================================================================== --- stable/7/bin/Makefile Fri Dec 25 21:14:34 2009 (r201001) +++ stable/7/bin/Makefile Fri Dec 25 21:28:16 2009 (r201002) @@ -26,6 +26,7 @@ SUBDIR= cat \ mv \ pax \ ps \ + pwait \ pwd \ ${_rcp} \ realpath \ From owner-svn-src-stable@FreeBSD.ORG Sat Dec 26 04:29:38 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 931AF1065676; Sat, 26 Dec 2009 04:29:38 +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 807918FC08; Sat, 26 Dec 2009 04:29:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBQ4Tcso082001; Sat, 26 Dec 2009 04:29:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBQ4TcpX081996; Sat, 26 Dec 2009 04:29:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912260429.nBQ4TcpX081996@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Dec 2009 04:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201013 - in stable/8/sys/ia64: ia64 include X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 04:29:38 -0000 Author: marcel Date: Sat Dec 26 04:29:38 2009 New Revision: 201013 URL: http://svn.freebsd.org/changeset/base/201013 Log: MFC rev 200889: Export the bus, cpu and itc frequencies under the hw.freq sysctl node. Modified: stable/8/sys/ia64/ia64/clock.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/include/clock.h stable/8/sys/ia64/include/md_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/ia64/ia64/clock.c ============================================================================== --- stable/8/sys/ia64/ia64/clock.c Sat Dec 26 02:56:58 2009 (r201012) +++ stable/8/sys/ia64/ia64/clock.c Sat Dec 26 04:29:38 2009 (r201013) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include uint64_t ia64_clock_reload; @@ -78,15 +79,15 @@ pcpu_initclock(void) void cpu_initclocks() { + u_long itc_freq; - if (itc_frequency == 0) - panic("Unknown clock frequency"); + itc_freq = (u_long)ia64_itc_freq() * 1000000ul; stathz = hz; - ia64_clock_reload = (itc_frequency + hz/2) / hz; + ia64_clock_reload = (itc_freq + hz/2) / hz; #ifndef SMP - ia64_timecounter.tc_frequency = itc_frequency; + ia64_timecounter.tc_frequency = itc_freq; tc_init(&ia64_timecounter); #endif Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sat Dec 26 02:56:58 2009 (r201012) +++ stable/8/sys/ia64/ia64/machdep.c Sat Dec 26 04:29:38 2009 (r201013) @@ -101,11 +101,21 @@ __FBSDID("$FreeBSD$"); #include +SYSCTL_NODE(_hw, OID_AUTO, freq, CTLFLAG_RD, 0, ""); SYSCTL_NODE(_machdep, OID_AUTO, cpu, CTLFLAG_RD, 0, ""); -u_int64_t processor_frequency; -u_int64_t bus_frequency; -u_int64_t itc_frequency; +static u_int bus_freq; +SYSCTL_UINT(_hw_freq, OID_AUTO, bus, CTLFLAG_RD, &bus_freq, 0, + "Bus clock frequency"); + +static u_int cpu_freq; +SYSCTL_UINT(_hw_freq, OID_AUTO, cpu, CTLFLAG_RD, &cpu_freq, 0, + "CPU clock frequency"); + +static u_int itc_freq; +SYSCTL_UINT(_hw_freq, OID_AUTO, itc, CTLFLAG_RD, &itc_freq, 0, + "ITC frequency"); + int cold = 1; u_int64_t pa_bootinfo; @@ -203,9 +213,7 @@ identifycpu(void) * (i.e. the clock frequency) to identify those. * Allow for roughly 1% error margin. */ - tmp = processor_frequency >> 7; - if ((processor_frequency - tmp) < 1*Ghz && - (processor_frequency + tmp) >= 1*Ghz) + if (cpu_freq > 990 && cpu_freq < 1010) model_name = "Deerfield"; else model_name = "Madison"; @@ -232,11 +240,8 @@ identifycpu(void) features = ia64_get_cpuid(4); printf("CPU: %s (", model_name); - if (processor_frequency) { - printf("%ld.%02ld-Mhz ", - (processor_frequency + 4999) / Mhz, - ((processor_frequency + 4999) / (Mhz/100)) % 100); - } + if (cpu_freq) + printf("%u Mhz ", cpu_freq); printf("%s)\n", family_name); printf(" Origin = \"%s\" Revision = %d\n", vendor, revision); printf(" Features = 0x%b\n", (u_int32_t) features, @@ -396,7 +401,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - *rate = processor_frequency; + *rate = (u_long)cpu_freq * 1000000ul; return (0); } @@ -600,6 +605,15 @@ map_gateway_page(void) ia64_set_k5(VM_MAX_ADDRESS); } +static u_int +freq_ratio(u_long base, u_long ratio) +{ + u_long f; + + f = (base * (ratio >> 32)) / (ratio & 0xfffffffful); + return ((f + 500000) / 1000000); +} + static void calculate_frequencies(void) { @@ -622,15 +636,9 @@ calculate_frequencies(void) pal.pal_result[2] >> 32, pal.pal_result[2] & ((1L << 32) - 1)); } - processor_frequency = - sal.sal_result[0] * (pal.pal_result[0] >> 32) - / (pal.pal_result[0] & ((1L << 32) - 1)); - bus_frequency = - sal.sal_result[0] * (pal.pal_result[1] >> 32) - / (pal.pal_result[1] & ((1L << 32) - 1)); - itc_frequency = - sal.sal_result[0] * (pal.pal_result[2] >> 32) - / (pal.pal_result[2] & ((1L << 32) - 1)); + cpu_freq = freq_ratio(sal.sal_result[0], pal.pal_result[0]); + bus_freq = freq_ratio(sal.sal_result[0], pal.pal_result[1]); + itc_freq = freq_ratio(sal.sal_result[0], pal.pal_result[2]); } } @@ -971,6 +979,13 @@ bzero(void *buf, size_t len) } } +u_int +ia64_itc_freq(void) +{ + + return (itc_freq); +} + void DELAY(int n) { @@ -979,7 +994,7 @@ DELAY(int n) sched_pin(); start = ia64_get_itc(); - end = start + (itc_frequency * n) / 1000000; + end = start + itc_freq * n; /* printf("DELAY from 0x%lx to 0x%lx\n", start, end); */ do { now = ia64_get_itc(); Modified: stable/8/sys/ia64/include/clock.h ============================================================================== --- stable/8/sys/ia64/include/clock.h Sat Dec 26 02:56:58 2009 (r201012) +++ stable/8/sys/ia64/include/clock.h Sat Dec 26 04:29:38 2009 (r201013) @@ -14,7 +14,6 @@ #define CLOCK_VECTOR 254 extern uint64_t ia64_clock_reload; -extern uint64_t itc_frequency; #endif Modified: stable/8/sys/ia64/include/md_var.h ============================================================================== --- stable/8/sys/ia64/include/md_var.h Sat Dec 26 02:56:58 2009 (r201012) +++ stable/8/sys/ia64/include/md_var.h Sat Dec 26 04:29:38 2009 (r201013) @@ -90,6 +90,7 @@ int ia64_highfp_enable(struct thread *, int ia64_highfp_save(struct thread *); int ia64_highfp_save_ipi(void); struct ia64_init_return ia64_init(void); +u_int ia64_itc_freq(void); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); void interrupt(struct trapframe *); From owner-svn-src-stable@FreeBSD.ORG Sat Dec 26 04:31:18 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B27751065697; Sat, 26 Dec 2009 04:31:18 +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 A0ED48FC14; Sat, 26 Dec 2009 04:31:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBQ4VIDF082089; Sat, 26 Dec 2009 04:31:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBQ4VIjb082087; Sat, 26 Dec 2009 04:31:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <200912260431.nBQ4VIjb082087@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Dec 2009 04:31:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201014 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 04:31:18 -0000 Author: marcel Date: Sat Dec 26 04:31:18 2009 New Revision: 201014 URL: http://svn.freebsd.org/changeset/base/201014 Log: MFC rev 200891: Calculate the average CPU clock frequency and export that through the hw.freq.cpu sysctl variable. Modified: stable/8/sys/sparc64/sparc64/identcpu.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sparc64/sparc64/identcpu.c ============================================================================== --- stable/8/sys/sparc64/sparc64/identcpu.c Sat Dec 26 04:29:38 2009 (r201013) +++ stable/8/sys/sparc64/sparc64/identcpu.c Sat Dec 26 04:31:18 2009 (r201014) @@ -27,6 +27,13 @@ static char cpu_model[128]; SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, "Machine model"); +SYSCTL_NODE(_hw, OID_AUTO, freq, CTLFLAG_RD, 0, ""); + +static u_int cpu_count; +static u_int cpu_freq; +SYSCTL_UINT(_hw_freq, OID_AUTO, cpu, CTLFLAG_RD, &cpu_freq, 0, + "CPU clock frequency"); + int cpu_impl; void @@ -104,4 +111,11 @@ cpu_identify(u_long vers, u_int freq, u_ printf(" mask=0x%lx maxtl=%ld maxwin=%ld\n", VER_MASK(vers), VER_MAXTL(vers), VER_MAXWIN(vers)); } + + /* + * Calculate the average CPU frequency. + */ + freq = (freq + 500000ul) / 1000000ul; + cpu_freq = (cpu_freq * cpu_count + freq) / (cpu_count + 1); + cpu_count++; } From owner-svn-src-stable@FreeBSD.ORG Sat Dec 26 18:23:22 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F977106568D; Sat, 26 Dec 2009 18:23:22 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DED98FC0A; Sat, 26 Dec 2009 18:23:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBQINL3C017463; Sat, 26 Dec 2009 18:23:21 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBQINLIe017461; Sat, 26 Dec 2009 18:23:21 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912261823.nBQINLIe017461@svn.freebsd.org> From: Rui Paulo Date: Sat, 26 Dec 2009 18:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201025 - stable/8/sys/dev/mwl X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 18:23:22 -0000 Author: rpaulo Date: Sat Dec 26 18:23:21 2009 New Revision: 201025 URL: http://svn.freebsd.org/changeset/base/201025 Log: MFC r198366: Don't use BUS_DMA_ALLOCNOW as that causes the attachment to fail on Cambria boards. Modified: stable/8/sys/dev/mwl/if_mwl_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mwl/if_mwl_pci.c ============================================================================== --- stable/8/sys/dev/mwl/if_mwl_pci.c Sat Dec 26 18:03:16 2009 (r201024) +++ stable/8/sys/dev/mwl/if_mwl_pci.c Sat Dec 26 18:23:21 2009 (r201025) @@ -204,7 +204,7 @@ mwl_pci_attach(device_t dev) BUS_SPACE_MAXADDR, /* maxsize */ MWL_TXDESC, /* nsegments */ BUS_SPACE_MAXADDR, /* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ + 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ &sc->sc_dmat)) { From owner-svn-src-stable@FreeBSD.ORG Sat Dec 26 18:25:53 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 109521065694; Sat, 26 Dec 2009 18:25:53 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F333F8FC24; Sat, 26 Dec 2009 18:25:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBQIPqfS017555; Sat, 26 Dec 2009 18:25:52 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBQIPq7u017553; Sat, 26 Dec 2009 18:25:52 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <200912261825.nBQIPq7u017553@svn.freebsd.org> From: Rui Paulo Date: Sat, 26 Dec 2009 18:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201026 - stable/8/sys/dev/if_ndis X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 18:25:53 -0000 Author: rpaulo Date: Sat Dec 26 18:25:52 2009 New Revision: 201026 URL: http://svn.freebsd.org/changeset/base/201026 Log: MFC r200524: Pass all IEs to net80211. PR: 141376 Submitted by: Paul Modified: stable/8/sys/dev/if_ndis/if_ndis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis.c Sat Dec 26 18:23:21 2009 (r201025) +++ stable/8/sys/dev/if_ndis/if_ndis.c Sat Dec 26 18:25:52 2009 (r201026) @@ -3355,24 +3355,11 @@ ndis_scan_results(struct ndis_softc *sc) efrm = frm + wb->nwbx_ielen; if (efrm - frm < 12) goto done; - sp.tstamp = frm; - frm += 8; - sp.bintval = le16toh(*(uint16_t *)frm); - frm += 2; - sp.capinfo = le16toh(*(uint16_t *)frm); - frm += 2; - - /* Grab variable length ies */ - while (efrm - frm > 1) { - if (efrm - frm < frm[1] + 2) - break; - switch (*frm) { - case IEEE80211_ELEMID_RSN: - sp.rsn = frm; - break; - } - frm += frm[1] + 2; - } + sp.tstamp = frm; frm += 8; + sp.bintval = le16toh(*(uint16_t *)frm); frm += 2; + sp.capinfo = le16toh(*(uint16_t *)frm); frm += 2; + sp.ies = frm; + sp.ies_len = efrm - frm; } done: DPRINTF(("scan: bssid %s chan %dMHz (%d/%d) rssi %d\n", From owner-svn-src-stable@FreeBSD.ORG Sat Dec 26 20:52:47 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCC841065672; Sat, 26 Dec 2009 20:52:47 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAF1B8FC12; Sat, 26 Dec 2009 20:52:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBQKqlq3021006; Sat, 26 Dec 2009 20:52:47 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBQKqlhj021004; Sat, 26 Dec 2009 20:52:47 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <200912262052.nBQKqlhj021004@svn.freebsd.org> From: Maxim Konovalov Date: Sat, 26 Dec 2009 20:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201030 - stable/8/share/man/man4 X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Dec 2009 20:52:47 -0000 Author: maxim Date: Sat Dec 26 20:52:47 2009 New Revision: 201030 URL: http://svn.freebsd.org/changeset/base/201030 Log: MFC r197799: fix typo. Modified: stable/8/share/man/man4/de.4 (contents, props changed) Modified: stable/8/share/man/man4/de.4 ============================================================================== --- stable/8/share/man/man4/de.4 Sat Dec 26 19:15:15 2009 (r201029) +++ stable/8/share/man/man4/de.4 Sat Dec 26 20:52:47 2009 (r201030) @@ -88,7 +88,7 @@ setup utility and are not changeable. .Pp Use the .Xr ifconfig 8 -command an in particular the +command and in particular the .Fl m flag to list the supported media types for your particular card. .Pp