From owner-svn-src-stable-8@FreeBSD.ORG Sun Nov 11 04:07:10 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62B7ADDD; Sun, 11 Nov 2012 04:07:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44B5F8FC0A; Sun, 11 Nov 2012 04:07:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAB47ABl087148; Sun, 11 Nov 2012 04:07:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAB47AMJ087147; Sun, 11 Nov 2012 04:07:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211110407.qAB47AMJ087147@svn.freebsd.org> From: Eitan Adler Date: Sun, 11 Nov 2012 04:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242883 - stable/8/sys/dev/uart X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Nov 2012 04:07:10 -0000 Author: eadler Date: Sun Nov 11 04:07:09 2012 New Revision: 242883 URL: http://svnweb.freebsd.org/changeset/base/242883 Log: MFC r242583: Add support for a few more devices: PNP0510 and FUJ02E5 for a "Wacom Tablet at FuS Lifebook T" PNP0502 and PNP0511 for some other generic devices. PR: kern/173357 Approved by: cperciva (implicit) Modified: stable/8/sys/dev/uart/uart_bus_acpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/uart/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_acpi.c Sun Nov 11 03:26:14 2012 (r242882) +++ stable/8/sys/dev/uart/uart_bus_acpi.c Sun Nov 11 04:07:09 2012 (r242883) @@ -59,7 +59,11 @@ static driver_t uart_acpi_driver = { static struct isa_pnp_id acpi_ns8250_ids[] = { {0x0005d041, "Standard PC COM port"}, /* PNP0500 */ {0x0105d041, "16550A-compatible COM port"}, /* PNP0501 */ + {0x0205d041, "Multiport serial device (non-intelligent 16550)"}, /* PNP0502 */ + {0x1005d041, "Generic IRDA-compatible device"}, /* PNP0510 */ + {0x1105d041, "Generic IRDA-compatible device"}, /* PNP0511 */ {0x04f0235c, "Wacom Tablet PC Screen"}, /* WACF004 */ + {0xe502aa1a, "Wacom Tablet at FuS Lifebook T"}, /* FUJ02E5 */ {0} }; From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 12 07:47:20 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CF6392D0; Mon, 12 Nov 2012 07:47:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B10998FC12; Mon, 12 Nov 2012 07:47:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAC7lKil078348; Mon, 12 Nov 2012 07:47:20 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAC7lJFk078302; Mon, 12 Nov 2012 07:47:19 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211120747.qAC7lJFk078302@svn.freebsd.org> From: Dimitry Andric Date: Mon, 12 Nov 2012 07:47:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242909 - in stable/8/sys: dev/ale dev/ata dev/ata/chipsets dev/ath/ath_hal/ar5212 dev/bge dev/cas dev/dc dev/flash dev/fxp dev/gem dev/lge dev/nge dev/pci dev/re dev/sis dev/ste dev/st... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 07:47:20 -0000 Author: dim Date: Mon Nov 12 07:47:19 2012 New Revision: 242909 URL: http://svnweb.freebsd.org/changeset/base/242909 Log: MFC r242625: Remove duplicate const specifiers in many drivers (I hope I got all of them, please let me know if not). Most of these are of the form: static const struct bzzt_type { [...list of members...] } const bzzt_devs[] = { [...list of initializers...] }; The second const is unnecessary, as arrays cannot be modified anyway, and if the elements are const, the whole thing is const automatically (e.g. it is placed in .rodata). I have verified this does not change the binary output of a full kernel build (except for build timestamps embedded in the object files). Reviewed by: yongari, marius Modified: stable/8/sys/dev/ale/if_ale.c stable/8/sys/dev/ata/ata-card.c stable/8/sys/dev/ata/chipsets/ata-acard.c stable/8/sys/dev/ata/chipsets/ata-acerlabs.c stable/8/sys/dev/ata/chipsets/ata-adaptec.c stable/8/sys/dev/ata/chipsets/ata-amd.c stable/8/sys/dev/ata/chipsets/ata-ati.c stable/8/sys/dev/ata/chipsets/ata-highpoint.c stable/8/sys/dev/ata/chipsets/ata-intel.c stable/8/sys/dev/ata/chipsets/ata-ite.c stable/8/sys/dev/ata/chipsets/ata-jmicron.c stable/8/sys/dev/ata/chipsets/ata-marvell.c stable/8/sys/dev/ata/chipsets/ata-nvidia.c stable/8/sys/dev/ata/chipsets/ata-promise.c stable/8/sys/dev/ata/chipsets/ata-serverworks.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c stable/8/sys/dev/ata/chipsets/ata-sis.c stable/8/sys/dev/ata/chipsets/ata-via.c stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/cas/if_cas.c stable/8/sys/dev/dc/if_dc.c stable/8/sys/dev/flash/at45d.c stable/8/sys/dev/fxp/if_fxp.c stable/8/sys/dev/gem/if_gem_pci.c stable/8/sys/dev/lge/if_lge.c stable/8/sys/dev/nge/if_nge.c stable/8/sys/dev/pci/pci.c stable/8/sys/dev/re/if_re.c stable/8/sys/dev/sis/if_sis.c stable/8/sys/dev/ste/if_ste.c stable/8/sys/dev/stge/if_stge.c stable/8/sys/dev/ti/if_ti.c stable/8/sys/dev/tl/if_tl.c stable/8/sys/dev/vr/if_vr.c stable/8/sys/dev/wb/if_wb.c stable/8/sys/dev/xl/if_xl.c stable/8/sys/pci/if_rl.c stable/8/sys/sparc64/pci/fire.c stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ale/ (props changed) stable/8/sys/dev/ata/ (props changed) stable/8/sys/dev/ath/ (props changed) stable/8/sys/dev/bge/ (props changed) stable/8/sys/dev/cas/ (props changed) stable/8/sys/dev/dc/ (props changed) stable/8/sys/dev/flash/ (props changed) stable/8/sys/dev/fxp/ (props changed) stable/8/sys/dev/gem/ (props changed) stable/8/sys/dev/lge/ (props changed) stable/8/sys/dev/nge/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/dev/re/ (props changed) stable/8/sys/dev/sis/ (props changed) stable/8/sys/dev/ste/ (props changed) stable/8/sys/dev/stge/ (props changed) stable/8/sys/dev/ti/ (props changed) stable/8/sys/dev/tl/ (props changed) stable/8/sys/dev/vr/ (props changed) stable/8/sys/dev/wb/ (props changed) stable/8/sys/dev/xl/ (props changed) stable/8/sys/pci/ (props changed) stable/8/sys/sparc64/ (props changed) Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ale/if_ale.c Mon Nov 12 07:47:19 2012 (r242909) @@ -95,7 +95,7 @@ static const struct ale_dev { uint16_t ale_vendorid; uint16_t ale_deviceid; const char *ale_name; -} const ale_devs[] = { +} ale_devs[] = { { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR81XX, "Atheros AR8121/AR8113/AR8114 PCIe Ethernet" }, }; Modified: stable/8/sys/dev/ata/ata-card.c ============================================================================== --- stable/8/sys/dev/ata/ata-card.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/ata-card.c Mon Nov 12 07:47:19 2012 (r242909) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include "pccarddevs.h" -static const struct pccard_product const ata_pccard_products[] = { +static const struct pccard_product ata_pccard_products[] = { PCMCIA_CARD(FREECOM, PCCARDIDE), PCMCIA_CARD(EXP, EXPMULTIMEDIA), PCMCIA_CARD(IODATA3, CBIDE2), Modified: stable/8/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acard.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-acard.c Mon Nov 12 07:47:19 2012 (r242909) @@ -81,7 +81,7 @@ static int ata_acard_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ATP850R, 0, ATP_OLD, 0x00, ATA_UDMA2, "ATP850" }, { ATA_ATP860A, 0, 0, 0x00, ATA_UDMA4, "ATP860A" }, { ATA_ATP860R, 0, 0, 0x00, ATA_UDMA4, "ATP860R" }, Modified: stable/8/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-acerlabs.c Mon Nov 12 07:47:19 2012 (r242909) @@ -75,7 +75,7 @@ static int ata_ali_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ALI_5289, 0x00, 2, ALI_SATA, ATA_SA150, "M5289" }, { ATA_ALI_5288, 0x00, 4, ALI_SATA, ATA_SA300, "M5288" }, { ATA_ALI_5287, 0x00, 4, ALI_SATA, ATA_SA150, "M5287" }, Modified: stable/8/sys/dev/ata/chipsets/ata-adaptec.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-adaptec.c Mon Nov 12 07:47:19 2012 (r242909) @@ -62,7 +62,7 @@ static int ata_adaptec_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ADAPTEC_1420, 0, 4, MV_60XX, ATA_SA300, "1420SA" }, { ATA_ADAPTEC_1430, 0, 4, MV_7042, ATA_SA300, "1430SA" }, { 0, 0, 0, 0, 0, 0}}; Modified: stable/8/sys/dev/ata/chipsets/ata-amd.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-amd.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-amd.c Mon Nov 12 07:47:19 2012 (r242909) @@ -67,7 +67,7 @@ static int ata_amd_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_AMD756, 0x00, 0x00, 0, ATA_UDMA4, "756" }, { ATA_AMD766, 0x00, AMD_CABLE|AMD_BUG, 0, ATA_UDMA5, "766" }, { ATA_AMD768, 0x00, AMD_CABLE, 0, ATA_UDMA5, "768" }, Modified: stable/8/sys/dev/ata/chipsets/ata-ati.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ati.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-ati.c Mon Nov 12 07:47:19 2012 (r242909) @@ -75,7 +75,7 @@ static int ata_ati_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ATI_IXP200, 0x00, ATI_PATA, 0, ATA_UDMA5, "IXP200" }, { ATA_ATI_IXP300, 0x00, ATI_PATA, 0, ATA_UDMA6, "IXP300" }, { ATA_ATI_IXP300_S1, 0x00, ATI_SATA, SII_BUG, ATA_SA150, "IXP300" }, Modified: stable/8/sys/dev/ata/chipsets/ata-highpoint.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-highpoint.c Mon Nov 12 07:47:19 2012 (r242909) @@ -73,7 +73,7 @@ ata_highpoint_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_HPT374, 0x07, HPT_374, 0, ATA_UDMA6, "HPT374" }, { ATA_HPT372, 0x02, HPT_372, 0, ATA_UDMA6, "HPT372N" }, { ATA_HPT372, 0x01, HPT_372, 0, ATA_UDMA6, "HPT372" }, Modified: stable/8/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-intel.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-intel.c Mon Nov 12 07:47:19 2012 (r242909) @@ -105,7 +105,7 @@ static int ata_intel_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_I82371FB, 0, 0, 2, ATA_WDMA2, "PIIX" }, { ATA_I82371SB, 0, 0, 2, ATA_WDMA2, "PIIX3" }, { ATA_I82371AB, 0, 0, 2, ATA_UDMA2, "PIIX4" }, Modified: stable/8/sys/dev/ata/chipsets/ata-ite.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ite.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-ite.c Mon Nov 12 07:47:19 2012 (r242909) @@ -64,7 +64,7 @@ static int ata_ite_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_IT8213F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8213F" }, { ATA_IT8212F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8212F" }, { ATA_IT8211F, 0x00, 0x00, 0x00, ATA_UDMA6, "IT8211F" }, Modified: stable/8/sys/dev/ata/chipsets/ata-jmicron.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-jmicron.c Mon Nov 12 07:47:19 2012 (r242909) @@ -64,7 +64,7 @@ ata_jmicron_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_JMB360, 0, 1, 0, ATA_SA300, "JMB360" }, { ATA_JMB361, 0, 1, 1, ATA_UDMA6, "JMB361" }, { ATA_JMB362, 0, 2, 0, ATA_SA300, "JMB362" }, Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Mon Nov 12 07:47:19 2012 (r242909) @@ -99,7 +99,7 @@ static int ata_marvell_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_M88SX5040, 0, 4, MV_50XX, ATA_SA150, "88SX5040" }, { ATA_M88SX5041, 0, 4, MV_50XX, ATA_SA150, "88SX5041" }, { ATA_M88SX5080, 0, 8, MV_50XX, ATA_SA150, "88SX5080" }, Modified: stable/8/sys/dev/ata/chipsets/ata-nvidia.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-nvidia.c Mon Nov 12 07:47:19 2012 (r242909) @@ -75,7 +75,7 @@ static int ata_nvidia_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_NFORCE1, 0, 0, 0, ATA_UDMA5, "nForce" }, { ATA_NFORCE2, 0, 0, 0, ATA_UDMA6, "nForce2" }, { ATA_NFORCE2_PRO, 0, 0, 0, ATA_UDMA6, "nForce2 Pro" }, Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Mon Nov 12 07:47:19 2012 (r242909) @@ -130,7 +130,7 @@ ata_promise_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_PDC20246, 0, PR_OLD, 0x00, ATA_UDMA2, "PDC20246" }, { ATA_PDC20262, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20262" }, { ATA_PDC20263, 0, PR_NEW, 0x00, ATA_UDMA4, "PDC20263" }, Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Mon Nov 12 07:47:19 2012 (r242909) @@ -78,7 +78,7 @@ static int ata_serverworks_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_ROSB4, 0x00, SWKS_33, 0, ATA_WDMA2, "ROSB4" }, { ATA_CSB5, 0x92, SWKS_100, 0, ATA_UDMA5, "CSB5" }, { ATA_CSB5, 0x00, SWKS_66, 0, ATA_UDMA4, "CSB5" }, Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Mon Nov 12 07:47:19 2012 (r242909) @@ -87,7 +87,7 @@ static int ata_sii_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_SII3114, 0x00, SII_MEMIO, SII_4CH, ATA_SA150, "3114" }, { ATA_SII3512, 0x02, SII_MEMIO, 0, ATA_SA150, "3512" }, { ATA_SII3112, 0x02, SII_MEMIO, 0, ATA_SA150, "3112" }, Modified: stable/8/sys/dev/ata/chipsets/ata-sis.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-sis.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-sis.c Mon Nov 12 07:47:19 2012 (r242909) @@ -74,7 +74,7 @@ ata_sis_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); const struct ata_chip_id *idx; - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_SIS182, 0x00, SIS_SATA, 0, ATA_SA150, "182" }, /* south */ { ATA_SIS181, 0x00, SIS_SATA, 0, ATA_SA150, "181" }, /* south */ { ATA_SIS180, 0x00, SIS_SATA, 0, ATA_SA150, "180" }, /* south */ Modified: stable/8/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-via.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ata/chipsets/ata-via.c Mon Nov 12 07:47:19 2012 (r242909) @@ -89,7 +89,7 @@ static int ata_via_probe(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); - static const struct ata_chip_id const ids[] = + static const struct ata_chip_id ids[] = {{ ATA_VIA82C586, 0x02, VIA33, 0x00, ATA_UDMA2, "82C586B" }, { ATA_VIA82C586, 0x00, VIA33, 0x00, ATA_WDMA2, "82C586" }, { ATA_VIA82C596, 0x12, VIA66, VIACLK, ATA_UDMA4, "82C596B" }, @@ -113,7 +113,7 @@ ata_via_probe(device_t dev) { ATA_VIAVX855, 0x00, VIA133, 0x00, ATA_UDMA6, "VX855" }, { ATA_VIAVX900, 0x00, VIA133, VIASATA, ATA_SA300, "VX900" }, { 0, 0, 0, 0, 0, 0 }}; - static const struct ata_chip_id const new_ids[] = + static const struct ata_chip_id new_ids[] = {{ ATA_VIA6410, 0x00, 0, 0x00, ATA_UDMA6, "6410" }, { ATA_VIA6420, 0x00, 7, 0x00, ATA_SA150, "6420" }, { ATA_VIA6421, 0x00, 6, VIABAR, ATA_SA150, "6421" }, Modified: stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ath/ath_hal/ar5212/ar5212.h Mon Nov 12 07:47:19 2012 (r242909) @@ -143,7 +143,7 @@ typedef struct RfHalFuncs { int16_t *minPower, int16_t *maxPower, const struct ieee80211_channel *, uint16_t *rfXpdGain); HAL_BOOL (*getChannelMaxMinPower)(struct ath_hal *ah, - const const struct ieee80211_channel *, + const struct ieee80211_channel *, int16_t *maxPow, int16_t *minPow); int16_t (*getNfAdjust)(struct ath_hal *, const HAL_CHANNEL_INTERNAL*); } RF_HAL_FUNCS; Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/bge/if_bge.c Mon Nov 12 07:47:19 2012 (r242909) @@ -139,7 +139,7 @@ MODULE_DEPEND(bge, miibus, 1, 1, 1); static const struct bge_type { uint16_t bge_vid; uint16_t bge_did; -} const bge_devs[] = { +} bge_devs[] = { { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5700 }, { ALTEON_VENDORID, ALTEON_DEVICEID_BCM5701 }, @@ -239,7 +239,7 @@ static const struct bge_type { static const struct bge_vendor { uint16_t v_id; const char *v_name; -} const bge_vendors[] = { +} bge_vendors[] = { { ALTEON_VENDORID, "Alteon" }, { ALTIMA_VENDORID, "Altima" }, { APPLE_VENDORID, "Apple" }, @@ -254,7 +254,7 @@ static const struct bge_vendor { static const struct bge_revision { uint32_t br_chipid; const char *br_name; -} const bge_revisions[] = { +} bge_revisions[] = { { BGE_CHIPID_BCM5700_A0, "BCM5700 A0" }, { BGE_CHIPID_BCM5700_A1, "BCM5700 A1" }, { BGE_CHIPID_BCM5700_B0, "BCM5700 B0" }, @@ -328,7 +328,7 @@ static const struct bge_revision { * Some defaults for major revisions, so that newer steppings * that we don't know about have a shot at working. */ -static const struct bge_revision const bge_majorrevs[] = { +static const struct bge_revision bge_majorrevs[] = { { BGE_ASICREV_BCM5700, "unknown BCM5700" }, { BGE_ASICREV_BCM5701, "unknown BCM5701" }, { BGE_ASICREV_BCM5703, "unknown BCM5703" }, @@ -2786,7 +2786,7 @@ bge_mbox_reorder(struct bge_softc *sc) const uint16_t vendor; const uint16_t device; const char *desc; - } const mbox_reorder_lists[] = { + } mbox_reorder_lists[] = { { 0x1022, 0x7450, "AMD-8131 PCI-X Bridge" }, }; devclass_t pci, pcib; Modified: stable/8/sys/dev/cas/if_cas.c ============================================================================== --- stable/8/sys/dev/cas/if_cas.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/cas/if_cas.c Mon Nov 12 07:47:19 2012 (r242909) @@ -2629,7 +2629,7 @@ static const struct cas_pci_dev { uint8_t cpd_revid; int cpd_variant; const char *cpd_desc; -} const cas_pci_devlist[] = { +} cas_pci_devlist[] = { { 0x0035100b, 0x0, CAS_SATURN, "NS DP83065 Saturn Gigabit Ethernet" }, { 0xabba108e, 0x10, CAS_CASPLUS, "Sun Cassini+ Gigabit Ethernet" }, { 0xabba108e, 0x0, CAS_CAS, "Sun Cassini Gigabit Ethernet" }, Modified: stable/8/sys/dev/dc/if_dc.c ============================================================================== --- stable/8/sys/dev/dc/if_dc.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/dc/if_dc.c Mon Nov 12 07:47:19 2012 (r242909) @@ -150,7 +150,7 @@ MODULE_DEPEND(dc, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct dc_type const dc_devs[] = { +static const struct dc_type dc_devs[] = { { DC_DEVID(DC_VENDORID_DEC, DC_DEVICEID_21143), 0, "Intel 21143 10/100BaseTX" }, { DC_DEVID(DC_VENDORID_DAVICOM, DC_DEVICEID_DM9009), 0, Modified: stable/8/sys/dev/flash/at45d.c ============================================================================== --- stable/8/sys/dev/flash/at45d.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/flash/at45d.c Mon Nov 12 07:47:19 2012 (r242909) @@ -106,7 +106,7 @@ static int at45d_wait_ready(device_t dev * 2^N byte pages. If support for the latter is enabled, the sector offset * has to be reduced by one. */ -static const struct at45d_flash_ident const at45d_flash_devices[] = { +static const struct at45d_flash_ident at45d_flash_devices[] = { { "AT45DB011B", 0x1f2200, 512, 9, 264, 256 }, { "AT45DB021B", 0x1f2300, 1024, 9, 264, 256 }, { "AT45DB041x", 0x1f2400, 2028, 9, 264, 256 }, Modified: stable/8/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/8/sys/dev/fxp/if_fxp.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/fxp/if_fxp.c Mon Nov 12 07:47:19 2012 (r242909) @@ -111,7 +111,7 @@ static int tx_threshold = 64; * * See struct fxp_cb_config for the bit definitions. */ -static const u_char const fxp_cb_config_template[] = { +static const u_char fxp_cb_config_template[] = { 0x0, 0x0, /* cb_status */ 0x0, 0x0, /* cb_command */ 0x0, 0x0, 0x0, 0x0, /* link_addr */ @@ -155,7 +155,7 @@ static const u_char const fxp_cb_config_ * particular variants, but we don't currently differentiate between * them. */ -static const struct fxp_ident const fxp_ident_table[] = { +static const struct fxp_ident fxp_ident_table[] = { { 0x1029, -1, 0, "Intel 82559 PCI/CardBus Pro/100" }, { 0x1030, -1, 0, "Intel 82559 Pro/100 Ethernet" }, { 0x1031, -1, 3, "Intel 82801CAM (ICH3) Pro/100 VE Ethernet" }, @@ -3052,7 +3052,7 @@ static const struct ucode { int length; u_short int_delay_offset; u_short bundle_max_offset; -} const ucode_table[] = { +} ucode_table[] = { { FXP_REV_82558_A4, UCODE(fxp_ucode_d101a), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82558_B0, UCODE(fxp_ucode_d101b0), D101_CPUSAVER_DWORD, 0 }, { FXP_REV_82559_A0, UCODE(fxp_ucode_d101ma), Modified: stable/8/sys/dev/gem/if_gem_pci.c ============================================================================== --- stable/8/sys/dev/gem/if_gem_pci.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/gem/if_gem_pci.c Mon Nov 12 07:47:19 2012 (r242909) @@ -104,7 +104,7 @@ static const struct gem_pci_dev { uint32_t gpd_devid; int gpd_variant; const char *gpd_desc; -} const gem_pci_devlist[] = { +} gem_pci_devlist[] = { { 0x1101108e, GEM_SUN_ERI, "Sun ERI 10/100 Ethernet" }, { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet" }, { 0x0021106b, GEM_APPLE_GMAC, "Apple UniNorth GMAC Ethernet" }, Modified: stable/8/sys/dev/lge/if_lge.c ============================================================================== --- stable/8/sys/dev/lge/if_lge.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/lge/if_lge.c Mon Nov 12 07:47:19 2012 (r242909) @@ -110,7 +110,7 @@ __FBSDID("$FreeBSD$"); /* * Various supported device vendors/types and their names. */ -static const struct lge_type const lge_devs[] = { +static const struct lge_type lge_devs[] = { { LGE_VENDORID, LGE_DEVICEID, "Level 1 Gigabit Ethernet" }, { 0, 0, NULL } }; Modified: stable/8/sys/dev/nge/if_nge.c ============================================================================== --- stable/8/sys/dev/nge/if_nge.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/nge/if_nge.c Mon Nov 12 07:47:19 2012 (r242909) @@ -139,7 +139,7 @@ MODULE_DEPEND(nge, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct nge_type const nge_devs[] = { +static const struct nge_type nge_devs[] = { { NGE_VENDORID, NGE_DEVICEID, "National Semiconductor Gigabit Ethernet" }, { 0, 0, NULL } Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/pci/pci.c Mon Nov 12 07:47:19 2012 (r242909) @@ -216,7 +216,7 @@ struct pci_quirk { int arg2; }; -static const struct pci_quirk const pci_quirks[] = { +static const struct pci_quirk pci_quirks[] = { /* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, Modified: stable/8/sys/dev/re/if_re.c ============================================================================== --- stable/8/sys/dev/re/if_re.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/re/if_re.c Mon Nov 12 07:47:19 2012 (r242909) @@ -171,7 +171,7 @@ TUNABLE_INT("hw.re.prefer_iomap", &prefe /* * Various supported device vendors/types and their names. */ -static const struct rl_type const re_devs[] = { +static const struct rl_type re_devs[] = { { DLINK_VENDORID, DLINK_DEVICEID_528T, 0, "D-Link DGE-528(T) Gigabit Ethernet Adapter" }, { DLINK_VENDORID, DLINK_DEVICEID_530T_REVC, 0, @@ -194,7 +194,7 @@ static const struct rl_type const re_dev "US Robotics 997902 (RTL8169S) Gigabit Ethernet" } }; -static const struct rl_hwrev const re_hwrevs[] = { +static const struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8139, RL_8139, "", RL_MTU }, { RL_HWREV_8139A, RL_8139, "A", RL_MTU }, { RL_HWREV_8139AG, RL_8139, "A-G", RL_MTU }, Modified: stable/8/sys/dev/sis/if_sis.c ============================================================================== --- stable/8/sys/dev/sis/if_sis.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/sis/if_sis.c Mon Nov 12 07:47:19 2012 (r242909) @@ -127,7 +127,7 @@ MODULE_DEPEND(sis, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct sis_type const sis_devs[] = { +static const struct sis_type sis_devs[] = { { SIS_VENDORID, SIS_DEVICEID_900, "SiS 900 10/100BaseTX" }, { SIS_VENDORID, SIS_DEVICEID_7016, "SiS 7016 10/100BaseTX" }, { NS_VENDORID, NS_DEVICEID_DP83815, "NatSemi DP8381[56] 10/100BaseTX" }, Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ste/if_ste.c Mon Nov 12 07:47:19 2012 (r242909) @@ -85,7 +85,7 @@ MODULE_DEPEND(ste, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct ste_type const ste_devs[] = { +static const struct ste_type ste_devs[] = { { ST_VENDORID, ST_DEVICEID_ST201_1, "Sundance ST201 10/100BaseTX" }, { ST_VENDORID, ST_DEVICEID_ST201_2, "Sundance ST201 10/100BaseTX" }, { DL_VENDORID, DL_DEVICEID_DL10050, "D-Link DL10050 10/100BaseTX" }, Modified: stable/8/sys/dev/stge/if_stge.c ============================================================================== --- stable/8/sys/dev/stge/if_stge.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/stge/if_stge.c Mon Nov 12 07:47:19 2012 (r242909) @@ -98,7 +98,7 @@ static const struct stge_product { uint16_t stge_vendorid; uint16_t stge_deviceid; const char *stge_name; -} const stge_products[] = { +} stge_products[] = { { VENDOR_SUNDANCETI, DEVICEID_SUNDANCETI_ST1023, "Sundance ST-1023 Gigabit Ethernet" }, Modified: stable/8/sys/dev/ti/if_ti.c ============================================================================== --- stable/8/sys/dev/ti/if_ti.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/ti/if_ti.c Mon Nov 12 07:47:19 2012 (r242909) @@ -145,7 +145,7 @@ typedef enum { * Various supported device vendors/types and their names. */ -static const struct ti_type const ti_devs[] = { +static const struct ti_type ti_devs[] = { { ALT_VENDORID, ALT_DEVICEID_ACENIC, "Alteon AceNIC 1000baseSX Gigabit Ethernet" }, { ALT_VENDORID, ALT_DEVICEID_ACENIC_COPPER, Modified: stable/8/sys/dev/tl/if_tl.c ============================================================================== --- stable/8/sys/dev/tl/if_tl.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/tl/if_tl.c Mon Nov 12 07:47:19 2012 (r242909) @@ -229,7 +229,7 @@ MODULE_DEPEND(tl, miibus, 1, 1, 1); * Various supported device vendors/types and their names. */ -static const struct tl_type const tl_devs[] = { +static const struct tl_type tl_devs[] = { { TI_VENDORID, TI_DEVICEID_THUNDERLAN, "Texas Instruments ThunderLAN" }, { COMPAQ_VENDORID, COMPAQ_DEVICEID_NETEL_10, Modified: stable/8/sys/dev/vr/if_vr.c ============================================================================== --- stable/8/sys/dev/vr/if_vr.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/vr/if_vr.c Mon Nov 12 07:47:19 2012 (r242909) @@ -119,7 +119,7 @@ static const struct vr_type { u_int16_t vr_did; int vr_quirks; const char *vr_name; -} const vr_devs[] = { +} vr_devs[] = { { VIA_VENDORID, VIA_DEVICEID_RHINE, VR_Q_NEEDALIGN, "VIA VT3043 Rhine I 10/100BaseTX" }, @@ -199,7 +199,7 @@ static const struct vr_tx_threshold_tabl int tx_cfg; int bcr_cfg; int value; -} const vr_tx_threshold_tables[] = { +} vr_tx_threshold_tables[] = { { VR_TXTHRESH_64BYTES, VR_BCR1_TXTHRESH64BYTES, 64 }, { VR_TXTHRESH_128BYTES, VR_BCR1_TXTHRESH128BYTES, 128 }, { VR_TXTHRESH_256BYTES, VR_BCR1_TXTHRESH256BYTES, 256 }, Modified: stable/8/sys/dev/wb/if_wb.c ============================================================================== --- stable/8/sys/dev/wb/if_wb.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/wb/if_wb.c Mon Nov 12 07:47:19 2012 (r242909) @@ -130,7 +130,7 @@ MODULE_DEPEND(wb, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct wb_type const wb_devs[] = { +static const struct wb_type wb_devs[] = { { WB_VENDORID, WB_DEVICEID_840F, "Winbond W89C840F 10/100BaseTX" }, { CP_VENDORID, CP_DEVICEID_RL100, Modified: stable/8/sys/dev/xl/if_xl.c ============================================================================== --- stable/8/sys/dev/xl/if_xl.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/dev/xl/if_xl.c Mon Nov 12 07:47:19 2012 (r242909) @@ -161,7 +161,7 @@ MODULE_DEPEND(xl, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct xl_type const xl_devs[] = { +static const struct xl_type xl_devs[] = { { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT, "3Com 3c900-TPO Etherlink XL" }, { TC_VENDORID, TC_DEVICEID_BOOMERANG_10BT_COMBO, Modified: stable/8/sys/pci/if_rl.c ============================================================================== --- stable/8/sys/pci/if_rl.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/pci/if_rl.c Mon Nov 12 07:47:19 2012 (r242909) @@ -131,7 +131,7 @@ MODULE_DEPEND(rl, miibus, 1, 1, 1); /* * Various supported device vendors/types and their names. */ -static const struct rl_type const rl_devs[] = { +static const struct rl_type rl_devs[] = { { RT_VENDORID, RT_DEVICEID_8129, RL_8129, "RealTek 8129 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8139, RL_8139, Modified: stable/8/sys/sparc64/pci/fire.c ============================================================================== --- stable/8/sys/sparc64/pci/fire.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/sparc64/pci/fire.c Mon Nov 12 07:47:19 2012 (r242909) @@ -249,7 +249,7 @@ struct fire_desc { const char *fd_name; }; -static const struct fire_desc const fire_compats[] = { +static const struct fire_desc fire_compats[] = { { "pciex108e,80f0", FIRE_MODE_FIRE, "Fire" }, #if 0 { "pciex108e,80f8", FIRE_MODE_OBERON, "Oberon" }, Modified: stable/8/sys/sparc64/pci/psycho.c ============================================================================== --- stable/8/sys/sparc64/pci/psycho.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/sparc64/pci/psycho.c Mon Nov 12 07:47:19 2012 (r242909) @@ -222,14 +222,14 @@ struct psycho_desc { const char *pd_name; }; -static const struct psycho_desc const psycho_compats[] = { +static const struct psycho_desc psycho_compats[] = { { "pci108e,8000", PSYCHO_MODE_PSYCHO, "Psycho compatible" }, { "pci108e,a000", PSYCHO_MODE_SABRE, "Sabre compatible" }, { "pci108e,a001", PSYCHO_MODE_SABRE, "Hummingbird compatible" }, { NULL, 0, NULL } }; -static const struct psycho_desc const psycho_models[] = { +static const struct psycho_desc psycho_models[] = { { "SUNW,psycho", PSYCHO_MODE_PSYCHO, "Psycho" }, { "SUNW,sabre", PSYCHO_MODE_SABRE, "Sabre" }, { NULL, 0, NULL } Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Mon Nov 12 07:34:05 2012 (r242908) +++ stable/8/sys/sparc64/pci/schizo.c Mon Nov 12 07:47:19 2012 (r242909) @@ -229,7 +229,7 @@ struct schizo_desc { const char *sd_name; }; -static const struct schizo_desc const schizo_compats[] = { +static const struct schizo_desc schizo_compats[] = { { "pci108e,8001", SCHIZO_MODE_SCZ, "Schizo" }, #if 0 { "pci108e,8002", SCHIZO_MODE_XMS, "XMITS" }, From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 12 14:05:41 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 487638F0; Mon, 12 Nov 2012 14:05:41 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D25B8FC08; Mon, 12 Nov 2012 14:05:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACE5fAV028933; Mon, 12 Nov 2012 14:05:41 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACE5fXX028931; Mon, 12 Nov 2012 14:05:41 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211121405.qACE5fXX028931@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 12 Nov 2012 14:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242915 - stable/8/sys/dev/acpi_support X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 14:05:41 -0000 Author: bapt Date: Mon Nov 12 14:05:40 2012 New Revision: 242915 URL: http://svnweb.freebsd.org/changeset/base/242915 Log: add support for newer Lenovo ThinkPads to acpi_ibm PR: kern/164538 Submitted by: Pierre Imai Modified: stable/8/sys/dev/acpi_support/acpi_ibm.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/acpi_support/ (props changed) Modified: stable/8/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- stable/8/sys/dev/acpi_support/acpi_ibm.c Mon Nov 12 14:04:57 2012 (r242914) +++ stable/8/sys/dev/acpi_support/acpi_ibm.c Mon Nov 12 14:05:40 2012 (r242915) @@ -290,7 +290,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0068", NULL}; +static char *ibm_ids[] = {"IBM0068", "LEN0068", NULL}; static void ibm_led(void *softc, int onoff) From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 12 14:14:01 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA450C03; Mon, 12 Nov 2012 14:14:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9E8F58FC08; Mon, 12 Nov 2012 14:14:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACEE1QY030887; Mon, 12 Nov 2012 14:14:01 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACEE1Pf030886; Mon, 12 Nov 2012 14:14:01 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211121414.qACEE1Pf030886@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 12 Nov 2012 14:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242917 - stable/8/usr.sbin/pw X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 14:14:01 -0000 Author: bapt Date: Mon Nov 12 14:14:01 2012 New Revision: 242917 URL: http://svnweb.freebsd.org/changeset/base/242917 Log: Remove useless atoi(3), previous strspn(3) makes sure that a_name->val is a number. This also allow pw user show to work as expected. PR: bin/172112 Submitted by: Ilya A. Arkhipov Modified: stable/8/usr.sbin/pw/pw_user.c Directory Properties: stable/8/usr.sbin/pw/ (props changed) Modified: stable/8/usr.sbin/pw/pw_user.c ============================================================================== --- stable/8/usr.sbin/pw/pw_user.c Mon Nov 12 14:13:49 2012 (r242916) +++ stable/8/usr.sbin/pw/pw_user.c Mon Nov 12 14:14:01 2012 (r242917) @@ -322,7 +322,7 @@ pw_user(struct userconf * cnf, int mode, */ if (mode != M_ADD && pwd == NULL && strspn(a_name->val, "0123456789") == strlen(a_name->val) - && atoi(a_name->val) > 0) { /* Assume uid */ + && *a_name->val) { (a_uid = a_name)->ch = 'u'; a_name = NULL; } From owner-svn-src-stable-8@FreeBSD.ORG Mon Nov 12 20:48:52 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD300D5A; Mon, 12 Nov 2012 20:48:52 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 768678FC08; Mon, 12 Nov 2012 20:48:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qACKmq2k002466; Mon, 12 Nov 2012 20:48:52 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qACKmq2T002464; Mon, 12 Nov 2012 20:48:52 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201211122048.qACKmq2T002464@svn.freebsd.org> From: Edwin Groothuis Date: Mon, 12 Nov 2012 20:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242930 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 20:48:52 -0000 Author: edwin Date: Mon Nov 12 20:48:52 2012 New Revision: 242930 URL: http://svnweb.freebsd.org/changeset/base/242930 Log: Merge of current of 242925, tzdata2012i - Cuba is changing back to Standard Time on 4 November 2012. Modified: stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/northamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Mon Nov 12 20:47:35 2012 (r242929) +++ stable/8/share/zoneinfo/asia Mon Nov 12 20:48:52 2012 (r242930) @@ -1204,7 +1204,7 @@ Rule Zion 2012 only - Sep 23 2:00 0 S # past, approved sending the proposed June 2011 changes to the Time # Decree Law back to the Knesset for second and third (final) votes # before the upcoming elections on Jan. 22, 2013. Hence, although the -# changes are not yet law, they are expected to be so before Februray 2013. +# changes are not yet law, they are expected to be so before February 2013. # # As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. # DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Mon Nov 12 20:47:35 2012 (r242929) +++ stable/8/share/zoneinfo/northamerica Mon Nov 12 20:48:52 2012 (r242930) @@ -2797,6 +2797,13 @@ Zone America/Costa_Rica -5:36:20 - LMT 1 # http://www.timeanddate.com/news/time/cuba-starts-dst-2012.html # +# From Steffen Thorsen (2012-11-03): +# Radio Reloj and many other sources report that Cuba is changing back +# to standard time on 2012-11-04: +# http://www.radioreloj.cu/index.php/noticias-radio-reloj/36-nacionales/9961-regira-horario-normal-en-cuba-desde-el-domingo-cuatro-de-noviembre +# From Paul Eggert (2012-11-03): +# For now, assume the future rule is first Sunday in November. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Cuba 1928 only - Jun 10 0:00 1:00 D Rule Cuba 1928 only - Oct 10 0:00 0 S @@ -2834,7 +2841,7 @@ Rule Cuba 2009 2010 - Mar Sun>=8 0:00s 1 Rule Cuba 2011 only - Mar Sun>=15 0:00s 1:00 D Rule Cuba 2011 only - Nov 13 0:00s 0 S Rule Cuba 2012 only - Apr 1 0:00s 1:00 D -Rule Cuba 2012 max - Oct lastSun 0:00s 0 S +Rule Cuba 2012 max - Nov Sun>=1 0:00s 0 S Rule Cuba 2013 max - Mar Sun>=8 0:00s 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 06:12:27 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0893CABE; Tue, 13 Nov 2012 06:12:27 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFB388FC15; Tue, 13 Nov 2012 06:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAD6CQf1095887; Tue, 13 Nov 2012 06:12:26 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAD6CQfT095884; Tue, 13 Nov 2012 06:12:26 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201211130612.qAD6CQfT095884@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 13 Nov 2012 06:12:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242950 - in stable/8: sys/dev/filemon tools/regression/filemon X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 06:12:27 -0000 Author: obrien Date: Tue Nov 13 06:12:26 2012 New Revision: 242950 URL: http://svnweb.freebsd.org/changeset/base/242950 Log: MF9: MFC: r242137: Iterate rather than use recursion. We can blow out the kernel stack if there is a long chain of fork(2)s. Added: stable/8/tools/regression/filemon/timed-forkb.c - copied unchanged from r242142, stable/9/tools/regression/filemon/timed-forkb.c Modified: stable/8/sys/dev/filemon/filemon_wrapper.c stable/8/tools/regression/filemon/Makefile Directory Properties: stable/8/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/tools/ (props changed) Modified: stable/8/sys/dev/filemon/filemon_wrapper.c ============================================================================== --- stable/8/sys/dev/filemon/filemon_wrapper.c Tue Nov 13 06:07:13 2012 (r242949) +++ stable/8/sys/dev/filemon/filemon_wrapper.c Tue Nov 13 06:12:26 2012 (r242950) @@ -82,15 +82,14 @@ filemon_pid_check(struct proc *p) { struct filemon *filemon; - TAILQ_FOREACH(filemon, &filemons_inuse, link) { - if (p->p_pid == filemon->pid) - return (filemon); + while (p->p_pptr) { + TAILQ_FOREACH(filemon, &filemons_inuse, link) { + if (p->p_pid == filemon->pid) + return (filemon); + } + p = p->p_pptr; } - - if (p->p_pptr == NULL) - return (NULL); - - return (filemon_pid_check(p->p_pptr)); + return (NULL); } static void Modified: stable/8/tools/regression/filemon/Makefile ============================================================================== --- stable/8/tools/regression/filemon/Makefile Tue Nov 13 06:07:13 2012 (r242949) +++ stable/8/tools/regression/filemon/Makefile Tue Nov 13 06:12:26 2012 (r242950) @@ -1,15 +1,33 @@ # $FreeBSD$ -PROG= filemontest +BINS= \ + filemontest \ + timed-forkb + +bins: filemontest timed-forkb +all: bins NO_MAN= WARNS?= 6 CFLAGS+= -I${.CURDIR}/../../../sys +# Should be "WITHOUT_CTF=" below, but stupid infastrurture fails: +# "/usr/share/mk/bsd.own.mk", line 489: WITH_CTF and WITHOUT_CTF can't both be set. +WITHOUT_CDDL= + +CLEANFILES+= ${BINS} + +tests: bins + kldstat | grep filemon + ${MAKE} test + ./timed-forkb + @echo "filemon(4) tests passed." + # Cannot use .OBJDIR -- 'filemontest' expects 'test_script.sh' in . -test: ${PROG} clean-test -.for BIN in ${PROG} ${PROG}32 +#FILEMONTEST32= filemontest32 +test: filemontest clean-test +.for BIN in filemontest ${FILEMONTEST32} cd ${.CURDIR} ; \ for A in 1 2 3 4 5 6 7 8 9 0; do \ for B in 1 2 3 4 5 6 7 8 9 0; do \ Copied: stable/8/tools/regression/filemon/timed-forkb.c (from r242142, stable/9/tools/regression/filemon/timed-forkb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/filemon/timed-forkb.c Tue Nov 13 06:12:26 2012 (r242950, copy of r242142, stable/9/tools/regression/filemon/timed-forkb.c) @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2012 David O'Brien + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SLEEP +#define SLEEP 20 /* seconds */ +#endif + +int verbose; + +static void +usage(void) +{ + fprintf(stderr, "usage: %s\n", getprogname()); + fprintf(stderr, "\t\t-n : length of fork(2) chain\n"); + fprintf(stderr, "\t\t-t : limit run-time seconds\n"); + exit(1); + /* NOTREACHED */ +} + +void term(int); +void +term(int signum) +{ + + if (getpid() == getpgrp() || verbose) { + fprintf(stderr, + "pid %d pgroup %d (ppid %d): Received SIGTERM(%d), exiting...\n", + getpid(), getpgrp(), getppid(), signum); + } + exit(1); +} + +void angel_of_mercy(int); +void +angel_of_mercy(int sig __unused) +{ + + signal(SIGALRM, SIG_IGN); /* ignore this signal */ + printf("Master process: alarmed waking up\n"); + killpg(0, SIGTERM); + return; +} + +int bombing_run(unsigned, int); +int +bombing_run(unsigned chainlen, int stime) +{ + struct rusage ru; + pid_t pid, cpid; + int status; + + if (chainlen) { + switch (pid = fork()) { + case -1: + errx(1, "%s: can't fork", __func__); + + case 0: + /* This is the code the child runs. */ + bombing_run(--chainlen, stime); + break; + + default: + /* This is the code the parent runs. */ + if (getpid() == getpgrp()) { + signal(SIGALRM, angel_of_mercy); + alarm(stime); // time for bombing run... + cpid = wait4(pid, &status, 0, &ru); + alarm(0); + printf( + "Cleanly shutting down - pid %d pgroup %d (ppid %d)\n", + getpid(), getpgrp(), getppid()); + } else { + cpid = wait4(pid, &status, 0, &ru); + } + } + } + + return 0; +} + +int +main(int argc, char *argv[]) +{ + time_t start /*,tvec*/; + char *endptr, *ctm; + size_t len; + int nflag, tflag; + int ch, k, maxprocperuid; + + (void)signal(SIGTERM, term); + + nflag = 0; + tflag = SLEEP; + + start = time(NULL); + ctm = ctime(&start); + ctm[24] = '\0'; // see: man 3 ctime + fprintf(stderr, "*** fork() generation started on \"%s\" ***\n", ctm); + + while ((ch = getopt(argc, argv, "n:t:v")) != -1) + switch (ch) { + case 'n': + nflag = strtol(optarg, &endptr, 10); + if (nflag <= 0 || *endptr != '\0') + errx(1, "illegal number, -n argument -- %s", + optarg); + break; + case 't': + tflag = strtol(optarg, &endptr, 10); + if (tflag <= 0 || *endptr != '\0') + errx(1, "illegal number, -t argument -- %s", + optarg); + break; + case 'v': + ++verbose; + break; + default: + usage(); + } + argv += optind; + + if (!nflag) { + len = sizeof(maxprocperuid); + k = sysctlbyname("kern.maxprocperuid", &maxprocperuid, &len, + NULL, 0); + assert(k != ENOMEM); + /* Try to allow a shell to still be started. */ + nflag = maxprocperuid - 10; + } + + // Ensure a unique process group to make killing all children easier. + setpgrp(0,0); + printf(" pid %d pgroup %d (ppid %d), %d fork chain over %d sec\n", + getpid(), getpgrp(), getppid(), nflag - 1, tflag); + + return bombing_run(nflag, tflag); +} From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 16:59:43 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E01FBAA; Tue, 13 Nov 2012 16:59:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 06CC28FC08; Tue, 13 Nov 2012 16:59:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADGxg9k083582; Tue, 13 Nov 2012 16:59:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADGxgGL083580; Tue, 13 Nov 2012 16:59:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211131659.qADGxgGL083580@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 13 Nov 2012 16:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242983 - in stable/8/sys/dev: sound/usb usb usb/quirk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 16:59:43 -0000 Author: hselasky Date: Tue Nov 13 16:59:42 2012 New Revision: 242983 URL: http://svnweb.freebsd.org/changeset/base/242983 Log: MFC r242127, r240078, r240609, r241988, r242129, r242223, r242438, r242453, r242455 and r242458: Add full support for Fast Track Ultra 8R from M-audio. Implement support for USB Audio v2.0. Remove some redundant USB audio v1.0 debug data. Use lsusb instead. Implement support for the so-called USB feedback endpoint for USB audio devices. Export all mixer nodes into dev.pcm.X.mixer.Y sysctl nodes. Fix a memory leak of mixer data at USB audio device detach. PR: usb/171254 Modified: stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/sound/usb/uaudioreg.h stable/8/sys/dev/usb/quirk/usb_quirk.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/usb/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Tue Nov 13 16:48:52 2012 (r242982) +++ stable/8/sys/dev/sound/usb/uaudio.c Tue Nov 13 16:59:42 2012 (r242983) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uaudio_debug #include @@ -115,22 +116,39 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def #endif #define UAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ -#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ -#define UAUDIO_RECURSE_LIMIT 24 /* rounds */ +#define UAUDIO_NCHANBUFS 2 /* number of outstanding request */ +#define UAUDIO_RECURSE_LIMIT 255 /* rounds */ #define MAKE_WORD(h,l) (((h) << 8) | (l)) #define BIT_TEST(bm,bno) (((bm)[(bno) / 8] >> (7 - ((bno) % 8))) & 1) #define UAUDIO_MAX_CHAN(x) (x) +union uaudio_asid { + const struct usb_audio_streaming_interface_descriptor *v1; + const struct usb_audio20_streaming_interface_descriptor *v2; +}; + +union uaudio_asf1d { + const struct usb_audio_streaming_type1_descriptor *v1; + const struct usb_audio20_streaming_type1_descriptor *v2; +}; + +union uaudio_sed { + const struct usb_audio_streaming_endpoint_descriptor *v1; + const struct usb_audio20_streaming_endpoint_descriptor *v2; +}; + struct uaudio_mixer_node { + const char *name; + int32_t minval; int32_t maxval; -#define MIX_MAX_CHAN 8 +#define MIX_MAX_CHAN 16 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ uint32_t mul; uint32_t ctl; - uint16_t wData[MIX_MAX_CHAN]; /* using nchan */ + int wData[MIX_MAX_CHAN]; /* using nchan */ uint16_t wIndex; uint8_t update[(MIX_MAX_CHAN + 7) / 8]; @@ -149,6 +167,9 @@ struct uaudio_mixer_node { #define MAX_SELECTOR_INPUT_PIN 256 uint8_t slctrtype[MAX_SELECTOR_INPUT_PIN]; uint8_t class; + uint8_t val_default; + + uint8_t desc[64]; struct uaudio_mixer_node *next; }; @@ -161,12 +182,10 @@ struct uaudio_chan { struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; - struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb_audio_streaming_interface_descriptor *p_asid; - const struct usb_audio_streaming_type1_descriptor *p_asf1d; - const struct usb_audio_streaming_endpoint_descriptor *p_sed; + struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1]; + union uaudio_asf1d p_asf1d; + union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; - const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -192,6 +211,13 @@ struct uaudio_chan { uint8_t valid; uint8_t iface_index; uint8_t iface_alt_index; + uint8_t channels; + + uint8_t last_sync_time; + uint8_t last_sync_state; +#define UAUDIO_SYNC_NONE 0 +#define UAUDIO_SYNC_MORE 1 +#define UAUDIO_SYNC_LESS 2 }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -242,13 +268,23 @@ struct umidi_chan { uint8_t single_command; }; +struct uaudio_search_result { + uint8_t bit_input[(256 + 7) / 8]; + uint8_t bit_output[(256 + 7) / 8]; + uint8_t recurse_level; + uint8_t id_max; + uint8_t is_input; +}; + struct uaudio_softc { struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan; struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; + struct uaudio_search_result sc_mixer_clocks; + struct mtx *sc_mixer_lock; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; struct uaudio_mixer_node *sc_mixer_root; @@ -273,24 +309,28 @@ struct uaudio_softc { uint8_t sc_uq_au_vendor_class:1; }; -struct uaudio_search_result { - uint8_t bit_input[(256 + 7) / 8]; - uint8_t bit_output[(256 + 7) / 8]; - uint8_t bit_visited[(256 + 7) / 8]; - uint8_t recurse_level; - uint8_t id_max; -}; - struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb_audio_input_terminal *it; - const struct usb_audio_output_terminal *ot; - const struct usb_audio_mixer_unit_0 *mu; - const struct usb_audio_selector_unit *su; - const struct usb_audio_feature_unit *fu; - const struct usb_audio_processing_unit_0 *pu; - const struct usb_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it_v1; + const struct usb_audio_output_terminal *ot_v1; + const struct usb_audio_mixer_unit_0 *mu_v1; + const struct usb_audio_selector_unit *su_v1; + const struct usb_audio_feature_unit *fu_v1; + const struct usb_audio_processing_unit_0 *pu_v1; + const struct usb_audio_extension_unit_0 *eu_v1; + const struct usb_audio20_clock_source_unit *csrc_v2; + const struct usb_audio20_clock_selector_unit_0 *csel_v2; + const struct usb_audio20_clock_multiplier_unit *cmul_v2; + const struct usb_audio20_input_terminal *it_v2; + const struct usb_audio20_output_terminal *ot_v2; + const struct usb_audio20_mixer_unit_0 *mu_v2; + const struct usb_audio20_selector_unit *su_v2; + const struct usb_audio20_feature_unit *fu_v2; + const struct usb_audio20_sample_rate_unit *ru_v2; + const struct usb_audio20_processing_unit_0 *pu_v2; + const struct usb_audio20_extension_unit_0 *eu_v2; + const struct usb_audio20_effect_unit *ef_v2; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -303,7 +343,7 @@ struct uaudio_format { const char *description; }; -static const struct uaudio_format uaudio_formats[] = { +static const struct uaudio_format uaudio10_formats[] = { {UA_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, {UA_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, @@ -321,6 +361,24 @@ static const struct uaudio_format uaudio {0, 0, 0, NULL} }; +static const struct uaudio_format uaudio20_formats[] = { + + {UA20_FMT_PCM, 8, AFMT_S8, "8-bit S-LE PCM"}, + {UA20_FMT_PCM, 16, AFMT_S16_LE, "16-bit S-LE PCM"}, + {UA20_FMT_PCM, 24, AFMT_S24_LE, "24-bit S-LE PCM"}, + {UA20_FMT_PCM, 32, AFMT_S32_LE, "32-bit S-LE PCM"}, + + {UA20_FMT_PCM8, 8, AFMT_U8, "8-bit U-LE PCM"}, + {UA20_FMT_PCM8, 16, AFMT_U16_LE, "16-bit U-LE PCM"}, + {UA20_FMT_PCM8, 24, AFMT_U24_LE, "24-bit U-LE PCM"}, + {UA20_FMT_PCM8, 32, AFMT_U32_LE, "32-bit U-LE PCM"}, + + {UA20_FMT_ALAW, 8, AFMT_A_LAW, "8-bit A-Law"}, + {UA20_FMT_MULAW, 8, AFMT_MU_LAW, "8-bit mu-Law"}, + + {0, 0, 0, NULL} +}; + #define UAC_OUTPUT 0 #define UAC_INPUT 1 #define UAC_EQUAL 2 @@ -341,23 +399,23 @@ static device_attach_t uaudio_attach; static device_detach_t uaudio_detach; static usb_callback_t uaudio_chan_play_callback; +static usb_callback_t uaudio_chan_play_sync_callback; static usb_callback_t uaudio_chan_record_callback; +static usb_callback_t uaudio_chan_record_sync_callback; static usb_callback_t uaudio_mixer_write_cfg_callback; static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; -static void uaudio_chan_fill_info_sub(struct uaudio_softc *, - struct usb_device *, uint32_t, uint8_t, uint8_t); -static void uaudio_chan_fill_info(struct uaudio_softc *, - struct usb_device *); -static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_ctl(struct uaudio_softc *, - struct uaudio_mixer_node *); -static void uaudio_mixer_add_input(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); -static void uaudio_mixer_add_output(struct uaudio_softc *, - const struct uaudio_terminal_node *, int); +/* ==== USB mixer ==== */ + +static int uaudio_mixer_sysctl_handler(SYSCTL_HANDLER_ARGS); +static void uaudio_mixer_ctl_free(struct uaudio_softc *); +static void uaudio_mixer_register_sysctl(struct uaudio_softc *, device_t); +static void uaudio_mixer_reload_all(struct uaudio_softc *); +static void uaudio_mixer_controls_create_ftu(struct uaudio_softc *); + +/* ==== USB audio v1.0 ==== */ + static void uaudio_mixer_add_mixer(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_selector(struct uaudio_softc *, @@ -378,25 +436,56 @@ static uint16_t uaudio_mixer_determine_c struct uaudio_mixer_node *); static uint16_t uaudio_mixer_feature_name(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); -static const struct uaudio_terminal_node *uaudio_mixer_get_input( - const struct uaudio_terminal_node *, uint8_t); -static const struct uaudio_terminal_node *uaudio_mixer_get_output( - const struct uaudio_terminal_node *, uint8_t); static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *, const uint8_t *, uint8_t, struct uaudio_search_result *); -static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, - uint8_t, uint8_t, struct uaudio_search_result *); +static const void *uaudio_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); +static int uaudio_mixer_get(struct usb_device *, uint16_t, uint8_t, + struct uaudio_mixer_node *); + +/* ==== USB audio v2.0 ==== */ + +static void uaudio20_mixer_add_mixer(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_selector(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static void uaudio20_mixer_add_feature(struct uaudio_softc *, + const struct uaudio_terminal_node *, int); +static struct usb_audio20_cluster uaudio20_mixer_get_cluster(uint8_t, + const struct uaudio_terminal_node *); +static uint16_t uaudio20_mixer_determine_class(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static uint16_t uaudio20_mixer_feature_name(const struct uaudio_terminal_node *, + struct uaudio_mixer_node *); +static void uaudio20_mixer_find_inputs_sub(struct uaudio_terminal_node *, + const uint8_t *, uint8_t, struct uaudio_search_result *); +static const void *uaudio20_mixer_verify_desc(const void *, uint32_t); +static usb_error_t uaudio20_set_speed(struct usb_device *, uint8_t, + uint8_t, uint32_t); + +/* USB audio v1.0 and v2.0 */ + +static void uaudio_chan_fill_info_sub(struct uaudio_softc *, + struct usb_device *, uint32_t, uint8_t, uint8_t); +static void uaudio_chan_fill_info(struct uaudio_softc *, + struct usb_device *); +static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *, + struct uaudio_mixer_node *); +static void uaudio_mixer_add_ctl(struct uaudio_softc *, + struct uaudio_mixer_node *); static void uaudio_mixer_fill_info(struct uaudio_softc *, struct usb_device *, void *); -static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t, - struct uaudio_mixer_node *); static void uaudio_mixer_ctl_set(struct uaudio_softc *, struct uaudio_mixer_node *, uint8_t, int32_t val); -static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t); static int uaudio_mixer_signext(uint8_t, int); static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val); -static const void *uaudio_mixer_verify_desc(const void *, uint32_t); static void uaudio_mixer_init(struct uaudio_softc *); +static const struct uaudio_terminal_node *uaudio_mixer_get_input( + const struct uaudio_terminal_node *, uint8_t); +static const struct uaudio_terminal_node *uaudio_mixer_get_output( + const struct uaudio_terminal_node *, uint8_t); +static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *, + uint8_t, uint8_t, struct uaudio_search_result *); static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t); static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *); static void umidi_start_read(struct usb_fifo *); @@ -413,13 +502,10 @@ static int umidi_detach(device_t dev); #ifdef USB_DEBUG static void uaudio_chan_dump_ep_desc( const usb_endpoint_descriptor_audio_t *); -static void uaudio_mixer_dump_cluster(uint8_t, - const struct uaudio_terminal_node *); -static const char *uaudio_mixer_get_terminal_name(uint16_t); #endif static const struct usb_config - uaudio_cfg_record[UAUDIO_NCHANBUFS] = { + uaudio_cfg_record[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -439,10 +525,20 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_sync_callback, + }, }; static const struct usb_config - uaudio_cfg_play[UAUDIO_NCHANBUFS] = { + uaudio_cfg_play[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -462,6 +558,16 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_sync_callback, + }, }; static const struct usb_config @@ -555,7 +661,8 @@ uaudio_probe(device_t dev) /* lookup non-standard device */ if (uaa->info.bInterfaceClass != UICLASS_AUDIO) { - if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0) + if (uaa->info.bInterfaceClass != UICLASS_VENDOR || + usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS) == 0) return (ENXIO); } @@ -614,30 +721,43 @@ uaudio_attach(device_t dev) id = usbd_get_interface_descriptor(uaa->iface); - uaudio_chan_fill_info(sc, uaa->device); - + /* must fill mixer info before channel info */ uaudio_mixer_fill_info(sc, uaa->device, id); + /* fill channel info */ + uaudio_chan_fill_info(sc, uaa->device); + DPRINTF("audio rev %d.%02x\n", sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); + if (sc->sc_mixer_count == 0) { + if (uaa->info.idVendor == USB_VENDOR_MAUDIO && + (uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA || + uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA8R)) { + DPRINTF("Generating mixer descriptors\n"); + uaudio_mixer_controls_create_ftu(sc); + } + } + DPRINTF("%d mixer controls\n", sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", sc->sc_play_chan.sample_rate, - sc->sc_play_chan.p_asf1d->bNrChannels, + sc->sc_play_chan.channels, sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format, " + "2x8ms buffer.\n", sc->sc_rec_chan.sample_rate, - sc->sc_rec_chan.p_asf1d->bNrChannels, + sc->sc_rec_chan.channels, sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); @@ -679,6 +799,10 @@ uaudio_attach(device_t dev) DPRINTF("child attach failed\n"); goto detach; } + + /* reload all mixer settings */ + uaudio_mixer_reload_all(sc); + return (0); /* success */ detach: @@ -714,9 +838,8 @@ uaudio_attach_sub(device_t dev, kobj_cla */ uaudio_pcm_setflags(dev, SD_F_SOFTPCMVOL); } - if (mixer_init(dev, mixer_class, sc)) { + if (mixer_init(dev, mixer_class, sc)) goto detach; - } sc->sc_mixer_init = 1; snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); @@ -738,6 +861,8 @@ uaudio_attach_sub(device_t dev, kobj_cla } pcm_setstatus(dev, status); + uaudio_mixer_register_sysctl(sc, dev); + return (0); /* success */ detach: @@ -779,9 +904,9 @@ uaudio_detach(device_t dev) * any. */ if (sc->sc_play_chan.valid) - usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); if (sc->sc_rec_chan.valid) - usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); @@ -791,6 +916,10 @@ uaudio_detach(device_t dev) umidi_detach(dev); + /* free mixer data */ + + uaudio_mixer_ctl_free(sc); + return (0); } @@ -857,28 +986,88 @@ uaudio_record_fix_fs(usb_endpoint_descri } } +static usb_error_t +uaudio20_check_rate(struct usb_device *udev, uint8_t iface_no, + uint8_t clockid, uint32_t rate) +{ + struct usb_device_request req; + usb_error_t error; + uint8_t data[255]; + uint16_t actlen; + uint16_t rates; + uint16_t x; + + DPRINTFN(6, "ifaceno=%d clockid=%d rate=%u\n", + iface_no, clockid, rate); + + req.bmRequestType = UT_READ_CLASS_INTERFACE; + req.bRequest = UA20_CS_RANGE; + USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); + USETW2(req.wIndex, clockid, iface_no); + USETW(req.wLength, 255); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = data[0] | (data[1] << 8); + actlen = (actlen - 2) / 12; + + if (rates > actlen) { + DPRINTF("Too many rates\n"); + rates = actlen; + } + + for (x = 0; x != rates; x++) { + uint32_t min = UGETDW(data + 2 + (12 * x)); + uint32_t max = UGETDW(data + 6 + (12 * x)); + uint32_t res = UGETDW(data + 10 + (12 * x)); + + if (res == 0) { + DPRINTF("Zero residue\n"); + res = 1; + } + + if (min > max) { + DPRINTF("Swapped max and min\n"); + uint32_t temp; + temp = min; + min = max; + max = temp; + } + + if (rate >= min && rate <= max && + (((rate - min) % res) == 0)) { + return (0); + } + } + return (USB_ERR_INVAL); +} + static void uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb_audio_streaming_interface_descriptor *asid = NULL; - const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + union uaudio_asid asid = { NULL }; + union uaudio_asf1d asf1d = { NULL }; + union uaudio_sed sed = { NULL }; usb_endpoint_descriptor_audio_t *ed1 = NULL; - const usb_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_control_descriptor *acdp = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; - const struct uaudio_format *p_fmt; + const struct uaudio_format *p_fmt = NULL; struct uaudio_chan *chan; uint16_t curidx = 0xFFFF; uint16_t lastidx = 0xFFFF; uint16_t alt_index = 0; - uint16_t wFormat; + uint16_t audio_rev = 0; + uint16_t x; uint8_t ep_dir; uint8_t bChannels; uint8_t bBitResolution; - uint8_t x; uint8_t audio_if = 0; uint8_t uma_if_class; @@ -923,171 +1112,264 @@ uaudio_chan_fill_info_sub(struct uaudio_ sc->sc_midi_chan.valid = 1; } } - asid = NULL; - asf1d = NULL; + asid.v1 = NULL; + asf1d.v1 = NULL; ed1 = NULL; - ed2 = NULL; - sed = NULL; + sed.v1 = NULL; } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + + if (audio_if == 0) { + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); + } + + /* + * Don't collect any USB audio descriptors if + * this is not an USB audio stream interface. + */ + continue; + } + + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*asid))) { - if (asid == NULL) { - asid = (void *)desc; + (asid.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asid.v2)) { + asid.v2 = (void *)desc; + } + } else { + if (desc->bLength >= sizeof(*asid.v1)) { + asid.v1 = (void *)desc; + } } } - if ((desc->bDescriptorType == UDESC_CS_INTERFACE) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && (desc->bDescriptorSubtype == FORMAT_TYPE) && - (desc->bLength >= sizeof(*asf1d))) { - if (asf1d == NULL) { - asf1d = (void *)desc; - if (asf1d->bFormatType != FORMAT_TYPE_I) { - DPRINTFN(11, "ignored bFormatType = %d\n", - asf1d->bFormatType); - asf1d = NULL; - continue; - } - if (asf1d->bLength < (sizeof(*asf1d) + - ((asf1d->bSamFreqType == 0) ? 6 : - (asf1d->bSamFreqType * 3)))) { - DPRINTFN(11, "'asf1d' descriptor is too short\n"); - asf1d = NULL; - continue; + (asf1d.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*asf1d.v2)) + asf1d.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*asf1d.v1)) { + asf1d.v1 = (void *)desc; + + if (asf1d.v1->bFormatType != FORMAT_TYPE_I) { + DPRINTFN(11, "ignored bFormatType = %d\n", + asf1d.v1->bFormatType); + asf1d.v1 = NULL; + continue; + } + if (desc->bLength < (sizeof(*asf1d.v1) + + ((asf1d.v1->bSamFreqType == 0) ? 6 : + (asf1d.v1->bSamFreqType * 3)))) { + DPRINTFN(11, "invalid descriptor, " + "too short\n"); + asf1d.v1 = NULL; + continue; + } } } } if ((desc->bDescriptorType == UDESC_ENDPOINT) && - (desc->bLength >= UEP_MINSIZE)) { - if (ed1 == NULL) { - ed1 = (void *)desc; - if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { - ed1 = NULL; - } + (desc->bLength >= UEP_MINSIZE) && + (ed1 == NULL)) { + ed1 = (void *)desc; + if (UE_GET_XFERTYPE(ed1->bmAttributes) != UE_ISOCHRONOUS) { + ed1 = NULL; + continue; } } - if ((desc->bDescriptorType == UDESC_CS_ENDPOINT) && + if ((acdp != NULL) && + (desc->bDescriptorType == UDESC_CS_ENDPOINT) && (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bLength >= sizeof(*sed))) { - if (sed == NULL) { - sed = (void *)desc; + (sed.v1 == NULL)) { + if (audio_rev >= UAUDIO_VERSION_30) { + /* FALLTHROUGH */ + } else if (audio_rev >= UAUDIO_VERSION_20) { + if (desc->bLength >= sizeof(*sed.v2)) + sed.v2 = (void *)desc; + } else { + if (desc->bLength >= sizeof(*sed.v1)) + sed.v1 = (void *)desc; } } - if (audio_if && asid && asf1d && ed1 && sed) { + if (asid.v1 == NULL || asf1d.v1 == NULL || + ed1 == NULL || sed.v1 == NULL) { + /* need more descriptors */ + continue; + } + + ep_dir = UE_GET_DIR(ed1->bEndpointAddress); - ep_dir = UE_GET_DIR(ed1->bEndpointAddress); + /* We ignore sync endpoint information until further. */ - /* We ignore sync endpoint information until further. */ + if (audio_rev >= UAUDIO_VERSION_30) { + goto next_ep; + } else if (audio_rev >= UAUDIO_VERSION_20) { - wFormat = UGETW(asid->wFormatTag); - bChannels = UAUDIO_MAX_CHAN(asf1d->bNrChannels); - bBitResolution = asf1d->bBitResolution; + uint32_t dwFormat; + uint8_t bSubslotSize; - if (asf1d->bSamFreqType == 0) { + dwFormat = UGETDW(asid.v2->bmFormats); + bChannels = asid.v2->bNrChannels; + bBitResolution = asf1d.v2->bBitResolution; + bSubslotSize = asf1d.v2->bSubslotSize; + + if (bBitResolution != (bSubslotSize * 8)) { + DPRINTF("Invalid bSubslotSize\n"); + goto next_ep; + } + + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + + for (p_fmt = uaudio20_formats; + p_fmt->wFormat != 0; p_fmt++) { + if ((p_fmt->wFormat & dwFormat) && + (p_fmt->bPrecision == bBitResolution)) + break; + } + + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; + } + + for (x = 0; x != 256; x++) { + if (ep_dir == UE_DIR_OUT) { + if (!(sc->sc_mixer_clocks.bit_output[x / 8] & + (1 << (x % 8)))) { + continue; + } + } else { + if (!(sc->sc_mixer_clocks.bit_input[x / 8] & + (1 << (x % 8)))) { + continue; + } + } + + DPRINTF("Checking clock ID=%d\n", x); + + if (uaudio20_check_rate(udev, + sc->sc_mixer_iface_no, x, rate)) { + DPRINTF("Unsupported sampling " + "rate, id=%d\n", x); + goto next_ep; + } + } + } else { + uint16_t wFormat; + + wFormat = UGETW(asid.v1->wFormatTag); + bChannels = UAUDIO_MAX_CHAN(asf1d.v1->bNrChannels); + bBitResolution = asf1d.v1->bBitResolution; + + if (asf1d.v1->bSamFreqType == 0) { DPRINTFN(16, "Sample rate: %d-%dHz\n", - UA_SAMP_LO(asf1d), UA_SAMP_HI(asf1d)); + UA_SAMP_LO(asf1d.v1), + UA_SAMP_HI(asf1d.v1)); - if ((rate >= UA_SAMP_LO(asf1d)) && - (rate <= UA_SAMP_HI(asf1d))) { + if ((rate >= UA_SAMP_LO(asf1d.v1)) && + (rate <= UA_SAMP_HI(asf1d.v1))) goto found_rate; - } } else { - for (x = 0; x < asf1d->bSamFreqType; x++) { + for (x = 0; x < asf1d.v1->bSamFreqType; x++) { DPRINTFN(16, "Sample rate = %dHz\n", - UA_GETSAMP(asf1d, x)); + UA_GETSAMP(asf1d.v1, x)); - if (rate == UA_GETSAMP(asf1d, x)) { + if (rate == UA_GETSAMP(asf1d.v1, x)) goto found_rate; - } } } - - audio_if = 0; - continue; + goto next_ep; found_rate: - - for (p_fmt = uaudio_formats; - p_fmt->wFormat; - p_fmt++) { + for (p_fmt = uaudio10_formats; + p_fmt->wFormat != 0; p_fmt++) { if ((p_fmt->wFormat == wFormat) && - (p_fmt->bPrecision == bBitResolution)) { - goto found_format; - } + (p_fmt->bPrecision == bBitResolution)) + break; + } + if (p_fmt->wFormat == 0) { + DPRINTF("Unsupported audio format\n"); + goto next_ep; } - audio_if = 0; - continue; - - found_format: - - if ((bChannels == channels) && - (bBitResolution == bit_resolution)) { + if ((bChannels != channels) || + (bBitResolution != bit_resolution)) { + DPRINTF("Wrong number of channels\n"); + goto next_ep; + } + } - chan = (ep_dir == UE_DIR_IN) ? - &sc->sc_rec_chan : - &sc->sc_play_chan; + chan = (ep_dir == UE_DIR_IN) ? + &sc->sc_rec_chan : &sc->sc_play_chan; - if ((chan->valid == 0) && usbd_get_iface(udev, curidx)) { + if (chan->valid != 0 || + usbd_get_iface(udev, curidx) == NULL) { + DPRINTF("Channel already exists or " + "interface is not valid\n"); + goto next_ep; + } - chan->valid = 1; + chan->valid = 1; #ifdef USB_DEBUG - uaudio_chan_dump_ep_desc(ed1); - uaudio_chan_dump_ep_desc(ed2); - - if (sed->bmAttributes & UA_SED_FREQ_CONTROL) { - DPRINTFN(2, "FREQ_CONTROL\n"); - } - if (sed->bmAttributes & UA_SED_PITCH_CONTROL) { - DPRINTFN(2, "PITCH_CONTROL\n"); - } + uaudio_chan_dump_ep_desc(ed1); #endif - DPRINTF("Sample rate = %dHz, channels = %d, " - "bits = %d, format = %s\n", rate, channels, - bit_resolution, p_fmt->description); - - chan->sample_rate = rate; - chan->p_asid = asid; - chan->p_asf1d = asf1d; - chan->p_ed1 = ed1; - chan->p_ed2 = ed2; - chan->p_fmt = p_fmt; - chan->p_sed = sed; - chan->iface_index = curidx; - chan->iface_alt_index = alt_index; - - if (ep_dir == UE_DIR_IN) - chan->usb_cfg = - uaudio_cfg_record; - else - chan->usb_cfg = - uaudio_cfg_play; - - chan->sample_size = (( - UAUDIO_MAX_CHAN(chan->p_asf1d->bNrChannels) * - chan->p_asf1d->bBitResolution) / 8); - - if (ep_dir == UE_DIR_IN && - usbd_get_speed(udev) == USB_SPEED_FULL) { - uaudio_record_fix_fs(ed1, - chan->sample_size * (rate / 1000), - chan->sample_size * (rate / 4000)); - } + DPRINTF("Sample rate = %dHz, channels = %d, " + "bits = %d, format = %s\n", rate, channels, + bit_resolution, p_fmt->description); + + chan->sample_rate = rate; + chan->p_asf1d = asf1d; + chan->p_ed1 = ed1; + chan->p_fmt = p_fmt; + chan->p_sed = sed; + chan->iface_index = curidx; + chan->iface_alt_index = alt_index; - if (sc->sc_sndstat_valid) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %d/%dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - asf1d->bNrChannels, asf1d->bBitResolution, - asf1d->bSubFrameSize * 8, - p_fmt->description, rate); - } - } - } - audio_if = 0; - continue; - } + if (ep_dir == UE_DIR_IN) + chan->usb_cfg = uaudio_cfg_record; + else + chan->usb_cfg = uaudio_cfg_play; + + chan->sample_size = (UAUDIO_MAX_CHAN(channels) * + p_fmt->bPrecision) / 8; + chan->channels = channels; + + if (ep_dir == UE_DIR_IN && + usbd_get_speed(udev) == USB_SPEED_FULL) { + uaudio_record_fix_fs(ed1, + chan->sample_size * (rate / 1000), + chan->sample_size * (rate / 4000)); + } + + if (sc->sc_sndstat_valid != 0) { + sbuf_printf(&sc->sc_sndstat, "\n\t" + "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", + curidx, alt_index, + (ep_dir == UE_DIR_IN) ? "input" : "output", + channels, p_fmt->bPrecision, + p_fmt->description, rate); + } + + next_ep: + sed.v1 = NULL; + ed1 = NULL; } } @@ -1137,7 +1419,7 @@ uaudio_chan_fill_info(struct uaudio_soft * disable surround setups on FULL-speed USB * by default */ - channels = 2; + channels = 4; break; default: channels = 16; @@ -1177,72 +1459,186 @@ done: } static void -uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) +uaudio_chan_play_sync_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; - uint32_t total; - uint32_t blockcount; - uint32_t n; - uint32_t offset; + uint8_t buf[4]; + uint64_t temp; + int len; int actlen; - int sumlen; - - usbd_xfer_status(xfer, &actlen, &sumlen, NULL, NULL); + int nframes; - if (ch->end == ch->start) { - DPRINTF("no buffer!\n"); - return; - } + usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: -tr_transferred: - if (actlen < sumlen) { - DPRINTF("short transfer, " - "%d of %d bytes\n", actlen, sumlen); - } - chn_intr(ch->pcm_ch); - case USB_ST_SETUP: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 17:01:59 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93115D74; Tue, 13 Nov 2012 17:01:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DAFC8FC12; Tue, 13 Nov 2012 17:01:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADH1xiF084042; Tue, 13 Nov 2012 17:01:59 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADH1xMQ084040; Tue, 13 Nov 2012 17:01:59 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211131701.qADH1xMQ084040@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 13 Nov 2012 17:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242984 - stable/8/sys/dev/usb/net X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 17:01:59 -0000 Author: hselasky Date: Tue Nov 13 17:01:58 2012 New Revision: 242984 URL: http://svnweb.freebsd.org/changeset/base/242984 Log: MFC r238466 and r242777: Implement non-PHY support in the udav driver. Modified: stable/8/sys/dev/usb/net/if_udav.c stable/8/sys/dev/usb/net/if_udavreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_udav.c ============================================================================== --- stable/8/sys/dev/usb/net/if_udav.c Tue Nov 13 16:59:42 2012 (r242983) +++ stable/8/sys/dev/usb/net/if_udav.c Tue Nov 13 17:01:58 2012 (r242984) @@ -181,6 +181,15 @@ static const struct usb_ether_methods ud .ue_mii_sts = udav_ifmedia_status, }; +static const struct usb_ether_methods udav_ue_methods_nophy = { + .ue_attach_post = udav_attach_post, + .ue_start = udav_start, + .ue_init = udav_init, + .ue_stop = udav_stop, + .ue_setmulti = udav_setmulti, + .ue_setpromisc = udav_setpromisc, +}; + #ifdef USB_DEBUG static int udav_debug = 0; @@ -206,7 +215,8 @@ static const STRUCT_USB_HOST_ID udav_dev {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, /* Kontron AG USB Ethernet */ {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, + UDAV_FLAG_NO_PHY)}, }; static void @@ -259,11 +269,20 @@ udav_attach(device_t dev) goto detach; } + /* + * The JP1082 has an unusable PHY and provides no link information. + */ + if (sc->sc_flags & UDAV_FLAG_NO_PHY) { + ue->ue_methods = &udav_ue_methods_nophy; + sc->sc_flags |= UDAV_FLAG_LINK; + } else { + ue->ue_methods = &udav_ue_methods; + } + ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; ue->ue_mtx = &sc->sc_mtx; - ue->ue_methods = &udav_ue_methods; error = uether_ifattach(ue); if (error) { @@ -712,7 +731,8 @@ udav_stop(struct usb_ether *ue) UDAV_LOCK_ASSERT(sc, MA_OWNED); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - sc->sc_flags &= ~UDAV_FLAG_LINK; + if (!(sc->sc_flags & UDAV_FLAG_NO_PHY)) + sc->sc_flags &= ~UDAV_FLAG_LINK; /* * stop all the transfers, if not already stopped: Modified: stable/8/sys/dev/usb/net/if_udavreg.h ============================================================================== --- stable/8/sys/dev/usb/net/if_udavreg.h Tue Nov 13 16:59:42 2012 (r242983) +++ stable/8/sys/dev/usb/net/if_udavreg.h Tue Nov 13 17:01:58 2012 (r242984) @@ -159,6 +159,7 @@ struct udav_softc { int sc_flags; #define UDAV_FLAG_LINK 0x0001 #define UDAV_FLAG_EXT_PHY 0x0040 +#define UDAV_FLAG_NO_PHY 0x0080 }; #define UDAV_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 17:04:45 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 708B2F12; Tue, 13 Nov 2012 17:04:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55CF28FC15; Tue, 13 Nov 2012 17:04:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADH4jbD084515; Tue, 13 Nov 2012 17:04:45 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADH4jUx084510; Tue, 13 Nov 2012 17:04:45 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211131704.qADH4jUx084510@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 13 Nov 2012 17:04:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242985 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 17:04:45 -0000 Author: hselasky Date: Tue Nov 13 17:04:44 2012 New Revision: 242985 URL: http://svnweb.freebsd.org/changeset/base/242985 Log: MFC r238551 and r239617: Add support for Intel Panther/Lynx Point XHCI port routing. Modified: stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/controller/xhci.h stable/8/sys/dev/usb/controller/xhci_pci.c stable/8/sys/dev/usb/controller/xhcireg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Tue Nov 13 17:01:58 2012 (r242984) +++ stable/8/sys/dev/usb/controller/xhci.c Tue Nov 13 17:04:44 2012 (r242985) @@ -84,14 +84,17 @@ __FBSDID("$FreeBSD$"); ((uint8_t *)&(((struct xhci_softc *)0)->sc_bus)))) #ifdef USB_DEBUG -static int xhcidebug = 0; +static int xhcidebug; +static int xhciroute; SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, &xhcidebug, 0, "Debug level"); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); - +TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif #define XHCI_INTR_ENDPT 1 @@ -177,6 +180,16 @@ xhci_dump_device(struct xhci_softc *sc, } #endif +uint32_t +xhci_get_port_route(void) +{ +#ifdef USB_DEBUG + return (0xFFFFFFFFU ^ ((uint32_t)xhciroute)); +#else + return (0xFFFFFFFFU); +#endif +} + static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { Modified: stable/8/sys/dev/usb/controller/xhci.h ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.h Tue Nov 13 17:01:58 2012 (r242984) +++ stable/8/sys/dev/usb/controller/xhci.h Tue Nov 13 17:04:44 2012 (r242985) @@ -490,6 +490,7 @@ struct xhci_softc { /* prototypes */ +uint32_t xhci_get_port_route(void); usb_error_t xhci_halt_controller(struct xhci_softc *); usb_error_t xhci_init(struct xhci_softc *, device_t); usb_error_t xhci_start_controller(struct xhci_softc *); Modified: stable/8/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci_pci.c Tue Nov 13 17:01:58 2012 (r242984) +++ stable/8/sys/dev/usb/controller/xhci_pci.c Tue Nov 13 17:04:44 2012 (r242985) @@ -101,6 +101,8 @@ xhci_pci_match(device_t self) case 0x1e318086: return ("Intel Panther Point USB 3.0 controller"); + case 0x8c318086: + return ("Intel Lynx Point USB 3.0 controller"); default: break; @@ -245,6 +247,7 @@ static int xhci_pci_take_controller(device_t self) { struct xhci_softc *sc = device_get_softc(self); + uint32_t device_id = pci_get_devid(self); uint32_t cparams; uint32_t eecp; uint32_t eec; @@ -285,5 +288,13 @@ xhci_pci_take_controller(device_t self) usb_pause_mtx(NULL, hz / 100); /* wait 10ms */ } } + + /* On Intel chipsets reroute ports from EHCI to XHCI controller. */ + if (device_id == 0x1e318086 /* Panther Point */ || + device_id == 0x8c318086 /* Lynx Point */) { + uint32_t temp = xhci_get_port_route(); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + } return (0); } Modified: stable/8/sys/dev/usb/controller/xhcireg.h ============================================================================== --- stable/8/sys/dev/usb/controller/xhcireg.h Tue Nov 13 17:01:58 2012 (r242984) +++ stable/8/sys/dev/usb/controller/xhcireg.h Tue Nov 13 17:04:44 2012 (r242985) @@ -34,6 +34,9 @@ #define PCI_USB_REV_3_0 0x30 /* USB 3.0 */ #define PCI_XHCI_FLADJ 0x61 /* RW frame length adjust */ +#define PCI_XHCI_INTEL_XUSB2PR 0xD0 /* Intel USB2 Port Routing */ +#define PCI_XHCI_INTEL_USB3_PSSEN 0xD8 /* Intel USB3 Port SuperSpeed Enable */ + /* XHCI capability registers */ #define XHCI_CAPLENGTH 0x00 /* RO capability */ #define XHCI_RESERVED 0x01 /* Reserved */ From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 17:11:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFB061C5; Tue, 13 Nov 2012 17:11:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A27448FC08; Tue, 13 Nov 2012 17:11:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADHBbj4085590; Tue, 13 Nov 2012 17:11:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADHBaNQ085570; Tue, 13 Nov 2012 17:11:36 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211131711.qADHBaNQ085570@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 13 Nov 2012 17:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242986 - in stable/8/sys/dev/usb: . controller input serial storage wlan X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 17:11:37 -0000 Author: hselasky Date: Tue Nov 13 17:11:36 2012 New Revision: 242986 URL: http://svnweb.freebsd.org/changeset/base/242986 Log: MFC r240750, r241987 and r242126: Add missing CTLFLAG_TUN flag to tunable sysctls in the USB stack. Adjust timing parameters of FULL/LOW/HIGH speed USB enumeration and make these timing parameters tunable. This patch will fix enumeration with some USB devices. Fix a typo. Modified: stable/8/sys/dev/usb/controller/ehci.c stable/8/sys/dev/usb/controller/ohci.c stable/8/sys/dev/usb/controller/uhci.c stable/8/sys/dev/usb/controller/usb_controller.c stable/8/sys/dev/usb/controller/xhci.c stable/8/sys/dev/usb/input/ukbd.c stable/8/sys/dev/usb/serial/usb_serial.c stable/8/sys/dev/usb/storage/umass.c stable/8/sys/dev/usb/usb.h stable/8/sys/dev/usb/usb_debug.c stable/8/sys/dev/usb/usb_debug.h stable/8/sys/dev/usb/usb_dev.c stable/8/sys/dev/usb/usb_device.c stable/8/sys/dev/usb/usb_generic.c stable/8/sys/dev/usb/usb_hub.c stable/8/sys/dev/usb/usb_process.c stable/8/sys/dev/usb/usb_request.c stable/8/sys/dev/usb/wlan/if_uath.c stable/8/sys/dev/usb/wlan/if_upgt.c stable/8/sys/dev/usb/wlan/if_urtw.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/ehci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ehci.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/controller/ehci.c Tue Nov 13 17:11:36 2012 (r242986) @@ -95,20 +95,20 @@ static int ehciiaadbug = 0; static int ehcilostintrbug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ehcidebug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW, - &ehcinohighspeed, 0, "Disable High Speed USB"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW, - &ehciiaadbug, 0, "Enable doorbell bug workaround"); -SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW, - &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); - TUNABLE_INT("hw.usb.ehci.debug", &ehcidebug); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RW | CTLFLAG_TUN, + &ehcinohighspeed, 0, "Disable High Speed USB"); TUNABLE_INT("hw.usb.ehci.no_hs", &ehcinohighspeed); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, iaadbug, CTLFLAG_RW | CTLFLAG_TUN, + &ehciiaadbug, 0, "Enable doorbell bug workaround"); TUNABLE_INT("hw.usb.ehci.iaadbug", &ehciiaadbug); +SYSCTL_INT(_hw_usb_ehci, OID_AUTO, lostintrbug, CTLFLAG_RW | CTLFLAG_TUN, + &ehcilostintrbug, 0, "Enable lost interrupt bug workaround"); TUNABLE_INT("hw.usb.ehci.lostintrbug", &ehcilostintrbug); + static void ehci_dump_regs(ehci_softc_t *sc); static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh); @@ -3369,7 +3369,7 @@ ehci_roothub_exec(struct usb_device *ude /* Wait for reset to complete. */ usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); /* Terminate reset sequence. */ if (!(sc->sc_flags & EHCI_SCFLG_NORESTERM)) Modified: stable/8/sys/dev/usb/controller/ohci.c ============================================================================== --- stable/8/sys/dev/usb/controller/ohci.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/controller/ohci.c Tue Nov 13 17:11:36 2012 (r242986) @@ -81,9 +81,8 @@ __FBSDID("$FreeBSD$"); static int ohcidebug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci"); -SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ohcidebug, 0, "ohci debug level"); - TUNABLE_INT("hw.usb.ohci.debug", &ohcidebug); static void ohci_dumpregs(ohci_softc_t *); @@ -2344,7 +2343,7 @@ ohci_roothub_exec(struct usb_device *ude for (v = 0;; v++) { if (v < 12) { usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); if ((OREAD4(sc, port) & UPS_RESET) == 0) { break; Modified: stable/8/sys/dev/usb/controller/uhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/uhci.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/controller/uhci.c Tue Nov 13 17:11:36 2012 (r242986) @@ -86,12 +86,11 @@ static int uhcidebug = 0; static int uhcinoloop = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhcidebug, 0, "uhci debug level"); -SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW, - &uhcinoloop, 0, "uhci noloop"); - TUNABLE_INT("hw.usb.uhci.debug", &uhcidebug); +SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RW | CTLFLAG_TUN, + &uhcinoloop, 0, "uhci noloop"); TUNABLE_INT("hw.usb.uhci.loop", &uhcinoloop); static void uhci_dumpregs(uhci_softc_t *sc); @@ -2393,7 +2392,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ UWRITE2(sc, port, x | UHCI_PORTSC_PR); usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_ROOT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_root_reset_delay)); DPRINTFN(4, "uhci port %d reset, status0 = 0x%04x\n", index, UREAD2(sc, port)); @@ -2421,7 +2420,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_ for (lim = 0; lim < 12; lim++) { usb_pause_mtx(&sc->sc_bus.bus_mtx, - USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); + USB_MS_TO_TICKS(usb_port_reset_delay)); x = UREAD2(sc, port); Modified: stable/8/sys/dev/usb/controller/usb_controller.c ============================================================================== --- stable/8/sys/dev/usb/controller/usb_controller.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/controller/usb_controller.c Tue Nov 13 17:11:36 2012 (r242986) @@ -86,7 +86,7 @@ SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug static int usb_no_boot_wait = 0; TUNABLE_INT("hw.usb.no_boot_wait", &usb_no_boot_wait); -SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RDTUN, &usb_no_boot_wait, 0, +SYSCTL_INT(_hw_usb, OID_AUTO, no_boot_wait, CTLFLAG_RD|CTLFLAG_TUN, &usb_no_boot_wait, 0, "No USB device enumerate waiting at boot."); static int usb_no_suspend_wait = 0; Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/controller/xhci.c Tue Nov 13 17:11:36 2012 (r242986) @@ -88,12 +88,11 @@ static int xhcidebug; static int xhciroute; SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI"); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &xhcidebug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW, - &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); - TUNABLE_INT("hw.usb.xhci.debug", &xhcidebug); +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, xhci_port_route, CTLFLAG_RW | CTLFLAG_TUN, + &xhciroute, 0, "Routing bitmap for switching EHCI ports to XHCI controller"); TUNABLE_INT("hw.usb.xhci.xhci_port_route", &xhciroute); #endif Modified: stable/8/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/8/sys/dev/usb/input/ukbd.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/input/ukbd.c Tue Nov 13 17:11:36 2012 (r242986) @@ -94,12 +94,11 @@ static int ukbd_debug = 0; static int ukbd_no_leds = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB ukbd"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ukbd_debug, 0, "Debug level"); -SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW, - &ukbd_no_leds, 0, "Disables setting of keyboard leds"); - TUNABLE_INT("hw.usb.ukbd.debug", &ukbd_debug); +SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RW | CTLFLAG_TUN, + &ukbd_no_leds, 0, "Disables setting of keyboard leds"); TUNABLE_INT("hw.usb.ukbd.no_leds", &ukbd_no_leds); #endif Modified: stable/8/sys/dev/usb/serial/usb_serial.c ============================================================================== --- stable/8/sys/dev/usb/serial/usb_serial.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/serial/usb_serial.c Tue Nov 13 17:11:36 2012 (r242986) @@ -127,13 +127,13 @@ static int ucom_cons_baud = 9600; static struct ucom_softc *ucom_cons_softc = NULL; TUNABLE_INT("hw.usb.ucom.cons_unit", &ucom_cons_unit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_unit, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_unit, 0, "console unit number"); TUNABLE_INT("hw.usb.ucom.cons_subunit", &ucom_cons_subunit); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_subunit, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_subunit, 0, "console subunit number"); TUNABLE_INT("hw.usb.ucom.cons_baud", &ucom_cons_baud); -SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, cons_baud, CTLFLAG_RW | CTLFLAG_TUN, &ucom_cons_baud, 0, "console baud rate"); static usb_proc_callback_t ucom_cfg_start_transfers; Modified: stable/8/sys/dev/usb/storage/umass.c ============================================================================== --- stable/8/sys/dev/usb/storage/umass.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/storage/umass.c Tue Nov 13 17:11:36 2012 (r242986) @@ -174,9 +174,8 @@ __FBSDID("$FreeBSD$"); static int umass_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass"); -SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &umass_debug, 0, "umass debug level"); - TUNABLE_INT("hw.usb.umass.debug", &umass_debug); #else #define DIF(...) do { } while (0) Modified: stable/8/sys/dev/usb/usb.h ============================================================================== --- stable/8/sys/dev/usb/usb.h Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb.h Tue Nov 13 17:11:36 2012 (r242986) @@ -93,31 +93,29 @@ MALLOC_DECLARE(M_USBHC); #define USB_POWER_MODE_SUSPEND 3 /* force suspend */ #define USB_POWER_MODE_RESUME 4 /* force resume */ -#if 0 /* These are the values from the USB specification. */ -#define USB_PORT_RESET_DELAY 10 /* ms */ -#define USB_PORT_ROOT_RESET_DELAY 50 /* ms */ -#define USB_PORT_RESET_RECOVERY 10 /* ms */ -#define USB_PORT_POWERUP_DELAY 100 /* ms */ -#define USB_PORT_RESUME_DELAY 20 /* ms */ -#define USB_SET_ADDRESS_SETTLE 2 /* ms */ -#define USB_RESUME_DELAY (20*5) /* ms */ -#define USB_RESUME_WAIT 10 /* ms */ -#define USB_RESUME_RECOVERY 10 /* ms */ -#define USB_EXTRA_POWER_UP_TIME 0 /* ms */ -#else +#define USB_PORT_RESET_DELAY_SPEC 10 /* ms */ +#define USB_PORT_ROOT_RESET_DELAY_SPEC 50 /* ms */ +#define USB_PORT_RESET_RECOVERY_SPEC 10 /* ms */ +#define USB_PORT_POWERUP_DELAY_SPEC 100 /* ms */ +#define USB_PORT_RESUME_DELAY_SPEC 20 /* ms */ +#define USB_SET_ADDRESS_SETTLE_SPEC 2 /* ms */ +#define USB_RESUME_DELAY_SPEC (20*5) /* ms */ +#define USB_RESUME_WAIT_SPEC 10 /* ms */ +#define USB_RESUME_RECOVERY_SPEC 10 /* ms */ +#define USB_EXTRA_POWER_UP_TIME_SPEC 0 /* ms */ + /* Allow for marginal and non-conforming devices. */ -#define USB_PORT_RESET_DELAY 50 /* ms */ -#define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ -#define USB_PORT_RESET_RECOVERY 250 /* ms */ -#define USB_PORT_POWERUP_DELAY 300 /* ms */ -#define USB_PORT_RESUME_DELAY (20*2) /* ms */ -#define USB_SET_ADDRESS_SETTLE 10 /* ms */ -#define USB_RESUME_DELAY (50*5) /* ms */ -#define USB_RESUME_WAIT 50 /* ms */ -#define USB_RESUME_RECOVERY 50 /* ms */ -#define USB_EXTRA_POWER_UP_TIME 20 /* ms */ -#endif +#define USB_PORT_RESET_DELAY 50 /* ms */ +#define USB_PORT_ROOT_RESET_DELAY 250 /* ms */ +#define USB_PORT_RESET_RECOVERY 250 /* ms */ +#define USB_PORT_POWERUP_DELAY 300 /* ms */ +#define USB_PORT_RESUME_DELAY (20*2) /* ms */ +#define USB_SET_ADDRESS_SETTLE 10 /* ms */ +#define USB_RESUME_DELAY (50*5) /* ms */ +#define USB_RESUME_WAIT 50 /* ms */ +#define USB_RESUME_RECOVERY 50 /* ms */ +#define USB_EXTRA_POWER_UP_TIME 20 /* ms */ #define USB_MIN_POWER 100 /* mA */ #define USB_MAX_POWER 500 /* mA */ Modified: stable/8/sys/dev/usb/usb_debug.c ============================================================================== --- stable/8/sys/dev/usb/usb_debug.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_debug.c Tue Nov 13 17:11:36 2012 (r242986) @@ -63,11 +63,59 @@ int usb_debug = 0; SYSCTL_NODE(_hw, OID_AUTO, usb, CTLFLAG_RW, 0, "USB debugging"); -SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.debug", &usb_debug); +#ifdef USB_DEBUG +/* + * Sysctls to modify timings/delays + */ +static SYSCTL_NODE(_hw_usb, OID_AUTO, timings, CTLFLAG_RW, 0, "Timings"); +static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS); + +TUNABLE_INT("hw.usb.timings.port_reset_delay", (int *)&usb_port_reset_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_reset_delay, sizeof(usb_port_reset_delay), + usb_timings_sysctl_handler, "IU", "Port Reset Delay"); +TUNABLE_INT("hw.usb.timings.port_root_reset_delay", (int *)&usb_port_root_reset_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_root_reset_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_root_reset_delay, sizeof(usb_port_root_reset_delay), + usb_timings_sysctl_handler, "IU", "Root Port Reset Delay"); +TUNABLE_INT("hw.usb.timings.port_reset_recovery", (int *)&usb_port_reset_recovery); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_reset_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_reset_recovery, sizeof(usb_port_reset_recovery), + usb_timings_sysctl_handler, "IU", "Port Reset Recovery"); +TUNABLE_INT("hw.usb.timings.port_powerup_delay", (int *)&usb_port_powerup_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_powerup_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_powerup_delay, sizeof(usb_port_powerup_delay), + usb_timings_sysctl_handler, "IU", "Port PowerUp Delay"); +TUNABLE_INT("hw.usb.timings.port_resume_delay", (int *)&usb_port_resume_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, port_resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_port_resume_delay, sizeof(usb_port_resume_delay), + usb_timings_sysctl_handler, "IU", "Port Resume Delay"); +TUNABLE_INT("hw.usb.timings.set_address_settle", (int *)&usb_set_address_settle); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, set_address_settle, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_set_address_settle, sizeof(usb_set_address_settle), + usb_timings_sysctl_handler, "IU", "Set Address Settle"); +TUNABLE_INT("hw.usb.timings.resume_delay", (int *)&usb_resume_delay); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_delay, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_delay, sizeof(usb_resume_delay), + usb_timings_sysctl_handler, "IU", "Resume Delay"); +TUNABLE_INT("hw.usb.timings.resume_wait", (int *)&usb_resume_wait); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_wait, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_wait, sizeof(usb_resume_wait), + usb_timings_sysctl_handler, "IU", "Resume Wait"); +TUNABLE_INT("hw.usb.timings.resume_recovery", (int *)&usb_resume_recovery); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, resume_recovery, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_resume_recovery, sizeof(usb_resume_recovery), + usb_timings_sysctl_handler, "IU", "Resume Recovery"); +TUNABLE_INT("hw.usb.timings.extra_power_up_time", (int *)&usb_extra_power_up_time); +SYSCTL_PROC(_hw_usb_timings, OID_AUTO, extra_power_up_time, CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_TUN, + &usb_extra_power_up_time, sizeof(usb_extra_power_up_time), + usb_timings_sysctl_handler, "IU", "Extra PowerUp Time"); +#endif + /*------------------------------------------------------------------------* * usb_dump_iface * @@ -174,3 +222,87 @@ usb_dump_xfer(struct usb_xfer *xfer) xfer->endpoint->edesc->bEndpointAddress, xfer->endpoint->edesc->bmAttributes); } + +#ifdef USB_DEBUG +unsigned int usb_port_reset_delay = USB_PORT_RESET_DELAY; +unsigned int usb_port_root_reset_delay = USB_PORT_ROOT_RESET_DELAY; +unsigned int usb_port_reset_recovery = USB_PORT_RESET_RECOVERY; +unsigned int usb_port_powerup_delay = USB_PORT_POWERUP_DELAY; +unsigned int usb_port_resume_delay = USB_PORT_RESUME_DELAY; +unsigned int usb_set_address_settle = USB_SET_ADDRESS_SETTLE; +unsigned int usb_resume_delay = USB_RESUME_DELAY; +unsigned int usb_resume_wait = USB_RESUME_WAIT; +unsigned int usb_resume_recovery = USB_RESUME_RECOVERY; +unsigned int usb_extra_power_up_time = USB_EXTRA_POWER_UP_TIME; + +/*------------------------------------------------------------------------* + * usb_timings_sysctl_handler + * + * This function updates timings variables, adjusting them where necessary. + *------------------------------------------------------------------------*/ +static int usb_timings_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + int error = 0; + unsigned int val; + + /* + * Attempt to get a coherent snapshot by making a copy of the data. + */ + if (arg1) + val = *(unsigned int *)arg1; + else + val = arg2; + error = SYSCTL_OUT(req, &val, sizeof(int)); + if (error || !req->newptr) + return (error); + + if (!arg1) + return EPERM; + + error = SYSCTL_IN(req, &val, sizeof(unsigned int)); + if (error) + return (error); + + /* + * Now make sure the values are decent, and certainly no lower than + * what the USB spec prescribes. + */ + unsigned int *p = (unsigned int *)arg1; + if (p == &usb_port_reset_delay) { + if (val < USB_PORT_RESET_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_root_reset_delay) { + if (val < USB_PORT_ROOT_RESET_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_reset_recovery) { + if (val < USB_PORT_RESET_RECOVERY_SPEC) + return (EINVAL); + } else if (p == &usb_port_powerup_delay) { + if (val < USB_PORT_POWERUP_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_port_resume_delay) { + if (val < USB_PORT_RESUME_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_set_address_settle) { + if (val < USB_SET_ADDRESS_SETTLE_SPEC) + return (EINVAL); + } else if (p == &usb_resume_delay) { + if (val < USB_RESUME_DELAY_SPEC) + return (EINVAL); + } else if (p == &usb_resume_wait) { + if (val < USB_RESUME_WAIT_SPEC) + return (EINVAL); + } else if (p == &usb_resume_recovery) { + if (val < USB_RESUME_RECOVERY_SPEC) + return (EINVAL); + } else if (p == &usb_extra_power_up_time) { + if (val < USB_EXTRA_POWER_UP_TIME_SPEC) + return (EINVAL); + } else { + /* noop */ + } + + *p = val; + return 0; +} +#endif Modified: stable/8/sys/dev/usb/usb_debug.h ============================================================================== --- stable/8/sys/dev/usb/usb_debug.h Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_debug.h Tue Nov 13 17:11:36 2012 (r242986) @@ -59,4 +59,28 @@ void usb_dump_queue(struct usb_endpoint void usb_dump_endpoint(struct usb_endpoint *ep); void usb_dump_xfer(struct usb_xfer *xfer); +#ifdef USB_DEBUG +extern unsigned int usb_port_reset_delay; +extern unsigned int usb_port_root_reset_delay; +extern unsigned int usb_port_reset_recovery; +extern unsigned int usb_port_powerup_delay; +extern unsigned int usb_port_resume_delay; +extern unsigned int usb_set_address_settle; +extern unsigned int usb_resume_delay; +extern unsigned int usb_resume_wait; +extern unsigned int usb_resume_recovery; +extern unsigned int usb_extra_power_up_time; +#else +#define usb_port_reset_delay USB_PORT_RESET_DELAY +#define usb_port_root_reset_delay USB_PORT_ROOT_RESET_DELAY +#define usb_port_reset_recovery USB_PORT_RESET_RECOVERY +#define usb_port_powerup_delay USB_PORT_POWERUP_DELAY +#define usb_port_resume_delay USB_PORT_RESUME_DELAY +#define usb_set_address_settle USB_SET_ADDRESS_SETTLE +#define usb_resume_delay USB_RESUME_DELAY +#define usb_resume_wait USB_RESUME_WAIT +#define usb_resume_recovery USB_RESUME_RECOVERY +#define usb_extra_power_up_time USB_EXTRA_POWER_UP_TIME +#endif + #endif /* _USB_DEBUG_H_ */ Modified: stable/8/sys/dev/usb/usb_dev.c ============================================================================== --- stable/8/sys/dev/usb/usb_dev.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_dev.c Tue Nov 13 17:11:36 2012 (r242986) @@ -82,9 +82,8 @@ static int usb_fifo_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, dev, CTLFLAG_RW, 0, "USB device"); -SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_fifo_debug, 0, "Debug Level"); - TUNABLE_INT("hw.usb.dev.debug", &usb_fifo_debug); #endif Modified: stable/8/sys/dev/usb/usb_device.c ============================================================================== --- stable/8/sys/dev/usb/usb_device.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_device.c Tue Nov 13 17:11:36 2012 (r242986) @@ -111,7 +111,7 @@ static void usb_cdev_free(struct usb_dev int usb_template = 0; TUNABLE_INT("hw.usb.usb_template", &usb_template); -SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, template, CTLFLAG_RW | CTLFLAG_TUN, &usb_template, 0, "Selected USB device side template"); /* English is default language */ @@ -120,11 +120,11 @@ static int usb_lang_id = 0x0009; static int usb_lang_mask = 0x00FF; TUNABLE_INT("hw.usb.usb_lang_id", &usb_lang_id); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_id, CTLFLAG_RW | CTLFLAG_TUN, &usb_lang_id, 0, "Preferred USB language ID"); TUNABLE_INT("hw.usb.usb_lang_mask", &usb_lang_mask); -SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW, +SYSCTL_INT(_hw_usb, OID_AUTO, usb_lang_mask, CTLFLAG_RW | CTLFLAG_TUN, &usb_lang_mask, 0, "Preferred USB language mask"); static const char* statestr[USB_STATE_MAX] = { Modified: stable/8/sys/dev/usb/usb_generic.c ============================================================================== --- stable/8/sys/dev/usb/usb_generic.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_generic.c Tue Nov 13 17:11:36 2012 (r242986) @@ -127,9 +127,8 @@ struct usb_fifo_methods usb_ugen_methods static int ugen_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, ugen, CTLFLAG_RW, 0, "USB generic"); -SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW, &ugen_debug, +SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &ugen_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.ugen.debug", &ugen_debug); #endif Modified: stable/8/sys/dev/usb/usb_hub.c ============================================================================== --- stable/8/sys/dev/usb/usb_hub.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_hub.c Tue Nov 13 17:11:36 2012 (r242986) @@ -77,9 +77,8 @@ static int uhub_debug = 0; SYSCTL_NODE(_hw_usb, OID_AUTO, uhub, CTLFLAG_RW, 0, "USB HUB"); -SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW, &uhub_debug, 0, +SYSCTL_INT(_hw_usb_uhub, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uhub_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.uhub.debug", &uhub_debug); #endif @@ -415,7 +414,7 @@ repeat: /* wait for maximum device power up time */ usb_pause_mtx(NULL, - USB_MS_TO_TICKS(USB_PORT_POWERUP_DELAY)); + USB_MS_TO_TICKS(usb_port_powerup_delay)); /* reset port, which implies enabling it */ @@ -979,7 +978,7 @@ uhub_attach(device_t dev) /* get power delay */ pwrdly = ((hubdesc20.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); + usb_extra_power_up_time); /* get complete HUB descriptor */ if (nports >= 8) { @@ -1024,7 +1023,7 @@ uhub_attach(device_t dev) /* get power delay */ pwrdly = ((hubdesc30.bPwrOn2PwrGood * UHD_PWRON_FACTOR) + - USB_EXTRA_POWER_UP_TIME); + usb_extra_power_up_time); /* get complete HUB descriptor */ if (nports >= 8) { @@ -1053,7 +1052,7 @@ uhub_attach(device_t dev) /* default number of ports */ nports = 1; /* default power delay */ - pwrdly = ((10 * UHD_PWRON_FACTOR) + USB_EXTRA_POWER_UP_TIME); + pwrdly = ((10 * UHD_PWRON_FACTOR) + usb_extra_power_up_time); break; } if (nports == 0) { @@ -2261,7 +2260,7 @@ usb_dev_resume_peer(struct usb_device *u } /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, USB_MS_TO_TICKS(usb_port_resume_delay)); if (bus->methods->device_resume != NULL) { /* resume USB device on the USB controller */ @@ -2414,7 +2413,7 @@ repeat: NULL, udev->port_no, UHF_PORT_SUSPEND); /* resume settle time */ - usb_pause_mtx(NULL, USB_MS_TO_TICKS(USB_PORT_RESUME_DELAY)); + usb_pause_mtx(NULL, USB_MS_TO_TICKS(usb_port_resume_delay)); } DPRINTF("Suspend was cancelled!\n"); return; Modified: stable/8/sys/dev/usb/usb_process.c ============================================================================== --- stable/8/sys/dev/usb/usb_process.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_process.c Tue Nov 13 17:11:36 2012 (r242986) @@ -86,9 +86,8 @@ static int usb_pcount; static int usb_proc_debug; SYSCTL_NODE(_hw_usb, OID_AUTO, proc, CTLFLAG_RW, 0, "USB process"); -SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW, &usb_proc_debug, 0, +SYSCTL_INT(_hw_usb_proc, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &usb_proc_debug, 0, "Debug level"); - TUNABLE_INT("hw.usb.proc.debug", &usb_proc_debug); #endif Modified: stable/8/sys/dev/usb/usb_request.c ============================================================================== --- stable/8/sys/dev/usb/usb_request.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/usb_request.c Tue Nov 13 17:11:36 2012 (r242986) @@ -73,21 +73,13 @@ SYSCTL_INT(_hw_usb, OID_AUTO, no_cs_fail &usb_no_cs_fail, 0, "USB clear stall failures are ignored, if set"); #ifdef USB_DEBUG -static int usb_pr_poll_delay = USB_PORT_RESET_DELAY; -static int usb_pr_recovery_delay = USB_PORT_RESET_RECOVERY; - -SYSCTL_INT(_hw_usb, OID_AUTO, pr_poll_delay, CTLFLAG_RW, - &usb_pr_poll_delay, 0, "USB port reset poll delay in ms"); -SYSCTL_INT(_hw_usb, OID_AUTO, pr_recovery_delay, CTLFLAG_RW, - &usb_pr_recovery_delay, 0, "USB port reset recovery delay in ms"); - #ifdef USB_REQ_DEBUG /* The following structures are used in connection to fault injection. */ struct usb_ctrl_debug { int bus_index; /* target bus */ int dev_index; /* target address */ int ds_fail; /* fail data stage */ - int ss_fail; /* fail data stage */ + int ss_fail; /* fail status stage */ int ds_delay; /* data stage delay in ms */ int ss_delay; /* status stage delay in ms */ int bmRequestType_value; @@ -788,12 +780,6 @@ usbd_req_reset_port(struct usb_device *u uint16_t status; uint16_t change; -#ifdef USB_DEBUG - uint16_t pr_poll_delay; - uint16_t pr_recovery_delay; - -#endif - DPRINTF("\n"); /* clear any leftover port reset changes first */ @@ -808,29 +794,12 @@ usbd_req_reset_port(struct usb_device *u if (err) goto done; #ifdef USB_DEBUG - /* range check input parameters */ - pr_poll_delay = usb_pr_poll_delay; - if (pr_poll_delay < 1) { - pr_poll_delay = 1; - } else if (pr_poll_delay > 1000) { - pr_poll_delay = 1000; - } - pr_recovery_delay = usb_pr_recovery_delay; - if (pr_recovery_delay > 1000) { - pr_recovery_delay = 1000; - } #endif n = 0; while (1) { -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); - n += pr_poll_delay; -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - n += USB_PORT_RESET_DELAY; -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_delay)); + n += usb_port_reset_delay; err = usbd_req_get_port_status(udev, mtx, &ps, port); if (err) goto done; @@ -872,13 +841,8 @@ usbd_req_reset_port(struct usb_device *u err = USB_ERR_TIMEOUT; goto done; } -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_recovery)); done: DPRINTFN(2, "port %d reset returning error=%s\n", @@ -909,12 +873,6 @@ usbd_req_warm_reset_port(struct usb_devi uint16_t status; uint16_t change; -#ifdef USB_DEBUG - uint16_t pr_poll_delay; - uint16_t pr_recovery_delay; - -#endif - DPRINTF("\n"); err = usbd_req_get_port_status(udev, mtx, &ps, port); @@ -944,30 +902,11 @@ usbd_req_warm_reset_port(struct usb_devi if (err) goto done; -#ifdef USB_DEBUG - /* range check input parameters */ - pr_poll_delay = usb_pr_poll_delay; - if (pr_poll_delay < 1) { - pr_poll_delay = 1; - } else if (pr_poll_delay > 1000) { - pr_poll_delay = 1000; - } - pr_recovery_delay = usb_pr_recovery_delay; - if (pr_recovery_delay > 1000) { - pr_recovery_delay = 1000; - } -#endif n = 0; while (1) { -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); - n += pr_poll_delay; -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_DELAY)); - n += USB_PORT_RESET_DELAY; -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_delay)); + n += usb_port_reset_delay; err = usbd_req_get_port_status(udev, mtx, &ps, port); if (err) goto done; @@ -1001,13 +940,8 @@ usbd_req_warm_reset_port(struct usb_devi err = USB_ERR_TIMEOUT; goto done; } -#ifdef USB_DEBUG - /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_recovery_delay)); -#else /* wait for the device to recover from reset */ - usb_pause_mtx(mtx, USB_MS_TO_TICKS(USB_PORT_RESET_RECOVERY)); -#endif + usb_pause_mtx(mtx, USB_MS_TO_TICKS(usb_port_reset_recovery)); done: DPRINTFN(2, "port %d warm reset returning error=%s\n", @@ -1566,7 +1500,7 @@ usbd_req_set_address(struct usb_device * done: /* allow device time to set new address */ usb_pause_mtx(mtx, - USB_MS_TO_TICKS(USB_SET_ADDRESS_SETTLE)); + USB_MS_TO_TICKS(usb_set_address_settle)); return (err); } Modified: stable/8/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_uath.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/wlan/if_uath.c Tue Nov 13 17:11:36 2012 (r242986) @@ -114,7 +114,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, uath, CTLFLAG_RW, 0, "USB Atheros"); static int uath_countrycode = CTRY_DEFAULT; /* country code */ -SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW, &uath_countrycode, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, countrycode, CTLFLAG_RW | CTLFLAG_TUN, &uath_countrycode, 0, "country code"); TUNABLE_INT("hw.usb.uath.countrycode", &uath_countrycode); static int uath_regdomain = 0; /* regulatory domain */ @@ -123,7 +123,7 @@ SYSCTL_INT(_hw_usb_uath, OID_AUTO, regdo #ifdef UATH_DEBUG int uath_debug = 0; -SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW, &uath_debug, 0, +SYSCTL_INT(_hw_usb_uath, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &uath_debug, 0, "uath debug level"); TUNABLE_INT("hw.usb.uath.debug", &uath_debug); enum { Modified: stable/8/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_upgt.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/wlan/if_upgt.c Tue Nov 13 17:11:36 2012 (r242986) @@ -75,7 +75,7 @@ SYSCTL_NODE(_hw, OID_AUTO, upgt, CTLFLAG #ifdef UPGT_DEBUG int upgt_debug = 0; -SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW, &upgt_debug, +SYSCTL_INT(_hw_upgt, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &upgt_debug, 0, "control debugging printfs"); TUNABLE_INT("hw.upgt.debug", &upgt_debug); enum { Modified: stable/8/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/8/sys/dev/usb/wlan/if_urtw.c Tue Nov 13 17:04:44 2012 (r242985) +++ stable/8/sys/dev/usb/wlan/if_urtw.c Tue Nov 13 17:11:36 2012 (r242986) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(_hw_usb, OID_AUTO, urtw, CTLFLAG_RW, 0, "USB Realtek 8187L"); #ifdef URTW_DEBUG int urtw_debug = 0; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW, &urtw_debug, 0, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, debug, CTLFLAG_RW | CTLFLAG_TUN, &urtw_debug, 0, "control debugging printfs"); TUNABLE_INT("hw.usb.urtw.debug", &urtw_debug); enum { @@ -89,7 +89,7 @@ enum { } while (0) #endif static int urtw_preamble_mode = URTW_PREAMBLE_MODE_LONG; -SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW, +SYSCTL_INT(_hw_usb_urtw, OID_AUTO, preamble_mode, CTLFLAG_RW | CTLFLAG_TUN, &urtw_preamble_mode, 0, "set the preable mode (long or short)"); TUNABLE_INT("hw.usb.urtw.preamble_mode", &urtw_preamble_mode); From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 17:16:04 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6AE624DC; Tue, 13 Nov 2012 17:16:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB538FC13; Tue, 13 Nov 2012 17:16:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADHG4X0086223; Tue, 13 Nov 2012 17:16:04 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADHG4IT086219; Tue, 13 Nov 2012 17:16:04 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211131716.qADHG4IT086219@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 13 Nov 2012 17:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242987 - stable/8/sys/dev/usb/template X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 17:16:04 -0000 Author: hselasky Date: Tue Nov 13 17:16:03 2012 New Revision: 242987 URL: http://svnweb.freebsd.org/changeset/base/242987 Log: MFC 228304: Correct some bInterval USB template descriptor values. Modified: stable/8/sys/dev/usb/template/usb_template.c stable/8/sys/dev/usb/template/usb_template_kbd.c stable/8/sys/dev/usb/template/usb_template_modem.c stable/8/sys/dev/usb/template/usb_template_mouse.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/template/usb_template.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template.c Tue Nov 13 17:11:36 2012 (r242986) +++ stable/8/sys/dev/usb/template/usb_template.c Tue Nov 13 17:16:03 2012 (r242987) @@ -260,7 +260,7 @@ usb_make_endpoint_desc(struct usb_temp_s ed->bInterval = 1; /* 1 ms */ break; default: - ed->bInterval = 8; /* 8*125 us */ + ed->bInterval = 4; /* 1 ms */ break; } break; Modified: stable/8/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template_kbd.c Tue Nov 13 17:11:36 2012 (r242986) +++ stable/8/sys/dev/usb/template/usb_template_kbd.c Tue Nov 13 17:16:03 2012 (r242987) @@ -89,9 +89,9 @@ static const struct usb_temp_packet_size }; static const struct usb_temp_interval keyboard_intr_interval = { - .bInterval[USB_SPEED_LOW] = 2, /* ms */ - .bInterval[USB_SPEED_FULL] = 2, - .bInterval[USB_SPEED_HIGH] = 2 * 8, + .bInterval[USB_SPEED_LOW] = 2, /* 2 ms */ + .bInterval[USB_SPEED_FULL] = 2, /* 2 ms */ + .bInterval[USB_SPEED_HIGH] = 5, /* 2 ms */ }; /* The following HID descriptor was dumped from a HP keyboard. */ Modified: stable/8/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template_modem.c Tue Nov 13 17:11:36 2012 (r242986) +++ stable/8/sys/dev/usb/template/usb_template_modem.c Tue Nov 13 17:16:03 2012 (r242987) @@ -98,9 +98,9 @@ static const struct usb_temp_packet_size }; static const struct usb_temp_interval modem_intr_interval = { - .bInterval[USB_SPEED_LOW] = 10, - .bInterval[USB_SPEED_FULL] = 10, - .bInterval[USB_SPEED_HIGH] = 10 * 8, + .bInterval[USB_SPEED_LOW] = 8, /* 8ms */ + .bInterval[USB_SPEED_FULL] = 8, /* 8ms */ + .bInterval[USB_SPEED_HIGH] = 7, /* 8ms */ }; static const struct usb_temp_endpoint_desc modem_ep_0 = { Modified: stable/8/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- stable/8/sys/dev/usb/template/usb_template_mouse.c Tue Nov 13 17:11:36 2012 (r242986) +++ stable/8/sys/dev/usb/template/usb_template_mouse.c Tue Nov 13 17:16:03 2012 (r242987) @@ -101,9 +101,9 @@ static const struct usb_temp_packet_size }; static const struct usb_temp_interval mouse_intr_interval = { - .bInterval[USB_SPEED_LOW] = 2, - .bInterval[USB_SPEED_FULL] = 2, - .bInterval[USB_SPEED_HIGH] = 2 * 8, + .bInterval[USB_SPEED_LOW] = 2, /* 2ms */ + .bInterval[USB_SPEED_FULL] = 2, /* 2ms */ + .bInterval[USB_SPEED_HIGH] = 5, /* 2ms */ }; static const struct usb_temp_endpoint_desc mouse_ep_0 = { From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 19:20:58 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C6888D9; Tue, 13 Nov 2012 19:20:58 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0E408FC13; Tue, 13 Nov 2012 19:20:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADJKvLT005004; Tue, 13 Nov 2012 19:20:57 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADJKvgP005002; Tue, 13 Nov 2012 19:20:57 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201211131920.qADJKvgP005002@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 13 Nov 2012 19:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r242991 - stable/8/libexec/atrun X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 19:20:58 -0000 Author: mjg Date: Tue Nov 13 19:20:57 2012 New Revision: 242991 URL: http://svnweb.freebsd.org/changeset/base/242991 Log: MFC r242372: atrun(8): scale default load average limit with the number of CPUs Previously atrun refused to run jobs if load average was not below fixed limit of 1.5. PR: 173175 Approved by: trasz (mentor) Modified: stable/8/libexec/atrun/atrun.c stable/8/libexec/atrun/atrun.man Directory Properties: stable/8/libexec/atrun/ (props changed) Modified: stable/8/libexec/atrun/atrun.c ============================================================================== --- stable/8/libexec/atrun/atrun.c Tue Nov 13 19:17:21 2012 (r242990) +++ stable/8/libexec/atrun/atrun.c Tue Nov 13 19:20:57 2012 (r242991) @@ -33,6 +33,9 @@ static const char rcsid[] = #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -461,7 +464,12 @@ main(int argc, char *argv[]) gid_t batch_gid; int c; int run_batch; +#ifdef __FreeBSD__ + size_t ncpu, ncpusz; + double load_avg = -1; +#else double load_avg = LOADAVG_MX; +#endif /* We don't need root privileges all the time; running under uid and gid daemon * is fine. @@ -479,8 +487,10 @@ main(int argc, char *argv[]) case 'l': if (sscanf(optarg, "%lf", &load_avg) != 1) perr("garbled option -l"); +#ifndef __FreeBSD__ if (load_avg <= 0.) load_avg = LOADAVG_MX; +#endif break; case 'd': @@ -496,6 +506,15 @@ main(int argc, char *argv[]) if (chdir(ATJOB_DIR) != 0) perr("cannot change to %s", ATJOB_DIR); +#ifdef __FreeBSD__ + if (load_avg <= 0.) { + ncpusz = sizeof(size_t); + if (sysctlbyname("hw.ncpu", &ncpu, &ncpusz, NULL, 0) < 0) + ncpu = 1; + load_avg = LOADAVG_MX * ncpu; + } +#endif + /* Main loop. Open spool directory for reading and look over all the * files in there. If the filename indicates that the job should be run * and the x bit is set, fork off a child which sets its user and group Modified: stable/8/libexec/atrun/atrun.man ============================================================================== --- stable/8/libexec/atrun/atrun.man Tue Nov 13 19:17:21 2012 (r242990) +++ stable/8/libexec/atrun/atrun.man Tue Nov 13 19:20:57 2012 (r242991) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 17, 2007 +.Dd October 30, 2012 .Dt ATRUN 8 .Os .Sh NAME @@ -45,7 +45,7 @@ e.g., locked out or expired. .Bl -tag -width indent .It Fl l Ar load_avg Specify a limiting load factor, over which batch jobs should -not be run, instead of the compiled in default of 1.5. +not be run, instead of the default of 1.5 * number of active CPUs. .It Fl d Debug; print error messages to standard error instead of using .Xr syslog 3 . From owner-svn-src-stable-8@FreeBSD.ORG Tue Nov 13 21:20:30 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2E16D79; Tue, 13 Nov 2012 21:20:30 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A7D1F8FC12; Tue, 13 Nov 2012 21:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qADLKUSd023860; Tue, 13 Nov 2012 21:20:30 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qADLKUaF023854; Tue, 13 Nov 2012 21:20:30 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201211132120.qADLKUaF023854@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 13 Nov 2012 21:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243006 - stable/8/share/zoneinfo X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 21:20:31 -0000 Author: edwin Date: Tue Nov 13 21:20:30 2012 New Revision: 243006 URL: http://svnweb.freebsd.org/changeset/base/243006 Log: Merge of current of tzdata2012j - Libya went to Standard Time on 10 November 2012 Modified: stable/8/share/zoneinfo/africa stable/8/share/zoneinfo/asia stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/northamerica stable/8/share/zoneinfo/southamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/africa ============================================================================== --- stable/8/share/zoneinfo/africa Tue Nov 13 21:15:11 2012 (r243005) +++ stable/8/share/zoneinfo/africa Tue Nov 13 21:20:30 2012 (r243006) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # @@ -424,6 +424,20 @@ Zone Africa/Monrovia -0:43:08 - LMT 1882 # Libya +# From Even Scharning (2012-11-10): +# Libya set their time one hour back at 02:00 on Saturday November 10. +# http://www.libyaherald.com/2012/11/04/clocks-to-go-back-an-hour-on-saturday/ +# Here is an official source [in Arabic]: http://ls.ly/fb6Yc +# +# Steffen Thorsen forwarded a translation (2012-11-10) in +# http://mm.icann.org/pipermail/tz/2012-November/018451.html +# +# From Tim Parenti (2012-11-11): +# Treat the 2012-11-10 change as a zone change from UTC+2 to UTC+1. +# The DST rules planned for 2013 and onward roughly mirror those of Europe +# (either two days before them or five days after them, so as to fall on +# lastFri instead of lastSun). + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Libya 1951 only - Oct 14 2:00 1:00 S Rule Libya 1952 only - Jan 1 0:00 0 - @@ -438,17 +452,21 @@ Rule Libya 1986 only - Apr 4 0:00 1:00 Rule Libya 1986 only - Oct 3 0:00 0 - Rule Libya 1987 1989 - Apr 1 0:00 1:00 S Rule Libya 1987 1989 - Oct 1 0:00 0 - +Rule Libya 1997 only - Apr 4 0:00 1:00 S +Rule Libya 1997 only - Oct 4 0:00 0 - +Rule Libya 2013 max - Mar lastFri 1:00 1:00 S +Rule Libya 2013 max - Oct lastFri 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Tripoli 0:52:44 - LMT 1920 1:00 Libya CE%sT 1959 2:00 - EET 1982 1:00 Libya CE%sT 1990 May 4 -# The following entries are from Shanks & Pottenger; +# The 1996 and 1997 entries are from Shanks & Pottenger; # the IATA SSIM data contain some obvious errors. 2:00 - EET 1996 Sep 30 - 1:00 - CET 1997 Apr 4 - 1:00 1:00 CEST 1997 Oct 4 - 2:00 - EET + 1:00 Libya CE%sT 1997 Oct 4 + 2:00 - EET 2012 Nov 10 2:00 + 1:00 Libya CE%sT # Madagascar # Zone NAME GMTOFF RULES FORMAT [UNTIL] Modified: stable/8/share/zoneinfo/asia ============================================================================== --- stable/8/share/zoneinfo/asia Tue Nov 13 21:15:11 2012 (r243005) +++ stable/8/share/zoneinfo/asia Tue Nov 13 21:20:30 2012 (r243006) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # @@ -1199,7 +1199,6 @@ Rule Zion 2012 only - Mar Fri>=26 2:00 1 Rule Zion 2012 only - Sep 23 2:00 0 S # From Ephraim Silverberg (2012-10-18): - # Yesterday, the Interior Ministry Committee, after more than a year # past, approved sending the proposed June 2011 changes to the Time # Decree Law back to the Knesset for second and third (final) votes @@ -1212,6 +1211,10 @@ Rule Zion 2012 only - Sep 23 2:00 0 S # later (i.e. at 02:00 the first Monday after October 2). # [Rosh Hashana holidays are factored in until 2100.] +# From Ephraim Silverberg (2012-11-05): +# The Knesset passed today (in second and final readings) the amendment to the +# Time Decree Law making the changes ... law. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S @@ -2049,8 +2052,7 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # occurred before our cutoff date of 1970. # However, as we get more information, we may need to add entries # for parts of the West Bank as they transitioned from Israel's rules -# to Palestine's rules. If you have more info about this, please -# send it to tz@elsie.nci.nih.gov for incorporation into future editions. +# to Palestine's rules. # From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time, # forwarded by Ephraim Silverberg: Modified: stable/8/share/zoneinfo/australasia ============================================================================== --- stable/8/share/zoneinfo/australasia Tue Nov 13 21:15:11 2012 (r243005) +++ stable/8/share/zoneinfo/australasia Tue Nov 13 21:20:30 2012 (r243006) @@ -780,7 +780,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # A good source for time zone historical data outside the U.S. is Modified: stable/8/share/zoneinfo/europe ============================================================================== --- stable/8/share/zoneinfo/europe Tue Nov 13 21:15:11 2012 (r243005) +++ stable/8/share/zoneinfo/europe Tue Nov 13 21:20:30 2012 (r243006) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # A good source for time zone historical data outside the U.S. is Modified: stable/8/share/zoneinfo/northamerica ============================================================================== --- stable/8/share/zoneinfo/northamerica Tue Nov 13 21:15:11 2012 (r243005) +++ stable/8/share/zoneinfo/northamerica Tue Nov 13 21:20:30 2012 (r243006) @@ -6,7 +6,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (1999-03-22): # A reliable and entertaining source about time zones is Modified: stable/8/share/zoneinfo/southamerica ============================================================================== --- stable/8/share/zoneinfo/southamerica Tue Nov 13 21:15:11 2012 (r243005) +++ stable/8/share/zoneinfo/southamerica Tue Nov 13 21:20:30 2012 (r243006) @@ -4,7 +4,7 @@ # This data is by no means authoritative; if you think you know better, # go ahead and edit the file (and please send any changes to -# tz@elsie.nci.nih.gov for general use in the future). +# tz@iana.org for general use in the future). # From Paul Eggert (2006-03-22): # A good source for time zone historical data outside the U.S. is From owner-svn-src-stable-8@FreeBSD.ORG Wed Nov 14 00:34:10 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1795218; Wed, 14 Nov 2012 00:34:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9501C8FC12; Wed, 14 Nov 2012 00:34:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAE0YAV5054878; Wed, 14 Nov 2012 00:34:10 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAE0YANh054875; Wed, 14 Nov 2012 00:34:10 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211140034.qAE0YANh054875@svn.freebsd.org> From: Eitan Adler Date: Wed, 14 Nov 2012 00:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243009 - stable/8/sys/dev/puc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Nov 2012 00:34:10 -0000 Author: eadler Date: Wed Nov 14 00:34:10 2012 New Revision: 243009 URL: http://svnweb.freebsd.org/changeset/base/243009 Log: MFC r242814: Add support for Advantech PCI-1602 RS-485/RS-422 serial card PR: kern/169726 Approved by: cperciva (implicit) Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/puc/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Tue Nov 13 22:35:31 2012 (r243008) +++ stable/8/sys/dev/puc/pucdata.c Wed Nov 14 00:34:10 2012 (r243009) @@ -630,6 +630,12 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_8S, 0x10, 0, -1, }, + { 0x13fe, 0x1600, 0x1602, 0x0002, + "Advantech PCI-1602", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, + { 0x1407, 0x0100, 0xffff, 0, "Lava Computers Dual Serial", DEFAULT_RCLK, From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 05:34:15 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 637496E0; Thu, 15 Nov 2012 05:34:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 403438FC0C; Thu, 15 Nov 2012 05:34:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5YFho026326; Thu, 15 Nov 2012 05:34:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5YFKD026325; Thu, 15 Nov 2012 05:34:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150534.qAF5YFKD026325@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243057 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:34:15 -0000 Author: mav Date: Thu Nov 15 05:34:14 2012 New Revision: 243057 URL: http://svnweb.freebsd.org/changeset/base/243057 Log: MFC r242314: Make GEOM RAID more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync to shutdown_post_sync stage to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. Modified: stable/8/sys/geom/raid/g_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/g_raid.c ============================================================================== --- stable/8/sys/geom/raid/g_raid.c Thu Nov 15 05:33:14 2012 (r243056) +++ stable/8/sys/geom/raid/g_raid.c Thu Nov 15 05:34:14 2012 (r243057) @@ -107,8 +107,9 @@ LIST_HEAD(, g_raid_tr_class) g_raid_tr_c LIST_HEAD(, g_raid_volume) g_raid_volumes = LIST_HEAD_INITIALIZER(g_raid_volumes); -static eventhandler_tag g_raid_pre_sync = NULL; +static eventhandler_tag g_raid_post_sync = NULL; static int g_raid_started = 0; +static int g_raid_shutdown = 0; static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -878,7 +879,7 @@ g_raid_orphan(struct g_consumer *cp) G_RAID_EVENT_DISK); } -static int +static void g_raid_clean(struct g_raid_volume *vol, int acw) { struct g_raid_softc *sc; @@ -889,22 +890,21 @@ g_raid_clean(struct g_raid_volume *vol, sx_assert(&sc->sc_lock, SX_XLOCKED); // if ((sc->sc_flags & G_RAID_DEVICE_FLAG_NOFAILSYNC) != 0) -// return (0); +// return; if (!vol->v_dirty) - return (0); + return; if (vol->v_writes > 0) - return (0); + return; if (acw > 0 || (acw == -1 && vol->v_provider != NULL && vol->v_provider->acw > 0)) { timeout = g_raid_clean_time - (time_uptime - vol->v_last_write); - if (timeout > 0) - return (timeout); + if (!g_raid_shutdown && timeout > 0) + return; } vol->v_dirty = 0; G_RAID_DEBUG1(1, sc, "Volume %s marked as clean.", vol->v_name); g_raid_write_metadata(sc, vol, NULL, NULL); - return (0); } static void @@ -1517,8 +1517,7 @@ process: g_raid_disk_done_request(bp); } else if (rv == EWOULDBLOCK) { TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { - if (vol->v_writes == 0 && vol->v_dirty) - g_raid_clean(vol, -1); + g_raid_clean(vol, -1); if (bioq_first(&vol->v_inflight) == NULL && vol->v_tr) { t.tv_sec = g_raid_idle_threshold / 1000000; @@ -1780,7 +1779,7 @@ g_raid_access(struct g_provider *pp, int error = ENXIO; goto out; } - if (dcw == 0 && vol->v_dirty) + if (dcw == 0) g_raid_clean(vol, dcw); vol->v_provider_open += acr + acw + ace; /* Handle delayed node destruction. */ @@ -2376,21 +2375,25 @@ g_raid_dumpconf(struct sbuf *sb, const c } static void -g_raid_shutdown_pre_sync(void *arg, int howto) +g_raid_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; struct g_raid_softc *sc; + struct g_raid_volume *vol; int error; mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) + g_raid_clean(vol, -1); g_cancel_event(sc); error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); if (error != 0) @@ -2405,9 +2408,9 @@ static void g_raid_init(struct g_class *mp) { - g_raid_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid_pre_sync == NULL) + g_raid_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid_post_sync == NULL) G_RAID_DEBUG(0, "Warning! Cannot register shutdown event."); g_raid_started = 1; } @@ -2416,8 +2419,8 @@ static void g_raid_fini(struct g_class *mp) { - if (g_raid_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid_pre_sync); + if (g_raid_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid_post_sync); g_raid_started = 0; } From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 05:46:03 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66586A02; Thu, 15 Nov 2012 05:46:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40E558FC13; Thu, 15 Nov 2012 05:46:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5k3Nj027788; Thu, 15 Nov 2012 05:46:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5k3kg027785; Thu, 15 Nov 2012 05:46:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150546.qAF5k3kg027785@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243059 - stable/8/lib/libusbhid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:46:03 -0000 Author: mav Date: Thu Nov 15 05:46:02 2012 New Revision: 243059 URL: http://svnweb.freebsd.org/changeset/base/243059 Log: MFC r240762: Restore handling of the third argument (id) of hid_start_parse(), same as it is done in NetBSD/OpenBSD, and as it was here before r205728. I personally think this API or its implementation is incorrect, as it is not correct to filter collections based on report ID, as they are orthogonal in general case, but I see no harm from supporting this feature. PR: usb/171810 Modified: stable/8/lib/libusbhid/descr.c stable/8/lib/libusbhid/parse.c stable/8/lib/libusbhid/usbhid.3 Directory Properties: stable/8/lib/libusbhid/ (props changed) Modified: stable/8/lib/libusbhid/descr.c ============================================================================== --- stable/8/lib/libusbhid/descr.c Thu Nov 15 05:44:44 2012 (r243058) +++ stable/8/lib/libusbhid/descr.c Thu Nov 15 05:46:02 2012 (r243059) @@ -68,7 +68,7 @@ hid_get_report_id(int fd) if ((rep = hid_get_report_desc(fd)) == NULL) goto use_ioctl; kindset = 1 << hid_input | 1 << hid_output | 1 << hid_feature; - for (d = hid_start_parse(rep, kindset, 0); hid_get_item(d, &h); ) { + for (d = hid_start_parse(rep, kindset, -1); hid_get_item(d, &h); ) { /* Return the first report ID we met. */ if (h.report_ID != 0) { temp = h.report_ID; Modified: stable/8/lib/libusbhid/parse.c ============================================================================== --- stable/8/lib/libusbhid/parse.c Thu Nov 15 05:44:44 2012 (r243058) +++ stable/8/lib/libusbhid/parse.c Thu Nov 15 05:46:02 2012 (r243059) @@ -70,6 +70,7 @@ struct hid_data { uint8_t iusage; /* current "usages_min/max" index */ uint8_t ousage; /* current "usages_min/max" offset */ uint8_t susage; /* usage set flags */ + int32_t reportid; /* requested report ID */ }; /*------------------------------------------------------------------------* @@ -149,7 +150,7 @@ hid_switch_rid(struct hid_data *s, struc * hid_start_parse *------------------------------------------------------------------------*/ hid_data_t -hid_start_parse(report_desc_t d, int kindset, int id __unused) +hid_start_parse(report_desc_t d, int kindset, int id) { struct hid_data *s; @@ -158,6 +159,7 @@ hid_start_parse(report_desc_t d, int kin s->start = s->p = d->data; s->end = d->data + d->size; s->kindset = kindset; + s->reportid = id; return (s); } @@ -207,8 +209,8 @@ hid_get_byte(struct hid_data *s, const u /*------------------------------------------------------------------------* * hid_get_item *------------------------------------------------------------------------*/ -int -hid_get_item(hid_data_t s, hid_item_t *h) +static int +hid_get_item_raw(hid_data_t s, hid_item_t *h) { hid_item_t *c; unsigned int bTag, bType, bSize; @@ -509,6 +511,19 @@ hid_get_item(hid_data_t s, hid_item_t *h } int +hid_get_item(hid_data_t s, hid_item_t *h) +{ + int r; + + for (;;) { + r = hid_get_item_raw(s, h); + if (r <= 0 || s->reportid == -1 || h->report_ID == s->reportid) + break; + } + return (r); +} + +int hid_report_size(report_desc_t r, enum hid_kind k, int id) { struct hid_data *d; @@ -523,7 +538,7 @@ hid_report_size(report_desc_t r, enum hi memset(&h, 0, sizeof h); for (d = hid_start_parse(r, 1 << k, id); hid_get_item(d, &h); ) { - if ((h.report_ID == id || id < 0) && h.kind == k) { + if (h.kind == k) { /* compute minimum */ if (lpos > h.pos) lpos = h.pos; Modified: stable/8/lib/libusbhid/usbhid.3 ============================================================================== --- stable/8/lib/libusbhid/usbhid.3 Thu Nov 15 05:44:44 2012 (r243058) +++ stable/8/lib/libusbhid/usbhid.3 Thu Nov 15 05:46:02 2012 (r243059) @@ -144,16 +144,15 @@ fails it will return .Ss Descriptor Parsing Functions To parse the report descriptor the .Fn hid_start_parse -function should be called with a report descriptor and a set that -describes which items that are interesting. +function should be called with a report descriptor, a set that +describes which items that are interesting, and the desired report +ID (or -1 to obtain items of all report IDs). The set is obtained by OR-ing together values .Fa "(1 << k)" where .Fa k is an item of type .Vt hid_kind_t . -The report ID (if present) is given by -.Fa id . The function returns .Dv NULL if the initialization fails, otherwise an opaque value to be used From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 05:55:31 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3E661EAA; Thu, 15 Nov 2012 05:55:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 226B58FC0C; Thu, 15 Nov 2012 05:55:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5tVhx029382; Thu, 15 Nov 2012 05:55:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5tUdv029375; Thu, 15 Nov 2012 05:55:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150555.qAF5tUdv029375@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243061 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:55:31 -0000 Author: mav Date: Thu Nov 15 05:55:30 2012 New Revision: 243061 URL: http://svnweb.freebsd.org/changeset/base/243061 Log: MFC r242352: Print card and subsystem IDs in verbose logs to help to identify system. Hide some less useful messages under debug. Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c stable/8/sys/dev/sound/pci/hda/hdaa.h stable/8/sys/dev/sound/pci/hda/hdaa_patches.c stable/8/sys/dev/sound/pci/hda/hdac.c stable/8/sys/dev/sound/pci/hda/hdac.h stable/8/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:54:18 2012 (r243060) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:55:30 2012 (r243061) @@ -6243,6 +6243,10 @@ hdaa_attach(device_t dev) devinfo->endnode = devinfo->startnode + devinfo->nodecnt; HDA_BOOTVERBOSE( + device_printf(dev, "Subsystem ID: 0x%08x\n", + hda_get_subsystem_id(dev)); + ); + HDA_BOOTHVERBOSE( device_printf(dev, "Audio Function Group at nid=%d: %d subnodes %d-%d\n", nid, devinfo->nodecnt, Modified: stable/8/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.h Thu Nov 15 05:54:18 2012 (r243060) +++ stable/8/sys/dev/sound/pci/hda/hdaa.h Thu Nov 15 05:55:30 2012 (r243061) @@ -260,7 +260,7 @@ struct hdaa_chan { (((uint32_t)hda_get_vendor_id(devinfo->dev) << 16) + \ hda_get_device_id(devinfo->dev)) -#define hdaa_subvendor_id(devinfo) \ +#define hdaa_card_id(devinfo) \ (((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \ hda_get_subvendor_id(devinfo->dev)) Modified: stable/8/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 05:54:18 2012 (r243060) +++ stable/8/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 05:55:30 2012 (r243061) @@ -139,7 +139,7 @@ hdac_pin_patch(struct hdaa_widget *w) config = orig = w->wclass.pin.config; id = hdaa_codec_id(w->devinfo); - subid = hdaa_subvendor_id(w->devinfo); + subid = hdaa_card_id(w->devinfo); /* XXX: Old patches require complete review. * Now they may create more problem then solve due to @@ -392,7 +392,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo) int i; id = hdaa_codec_id(devinfo); - subid = hdaa_subvendor_id(devinfo); + subid = hdaa_card_id(devinfo); /* * Quirks @@ -594,7 +594,7 @@ hdaa_patch_direct(struct hdaa_devinfo *d uint32_t id, subid, val; id = hdaa_codec_id(devinfo); - subid = hdaa_subvendor_id(devinfo); + subid = hdaa_card_id(devinfo); switch (id) { case HDA_CODEC_VT1708S_0: Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Thu Nov 15 05:54:18 2012 (r243060) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Thu Nov 15 05:55:30 2012 (r243061) @@ -1074,6 +1074,8 @@ hdac_attach(device_t dev) sc = device_get_softc(dev); HDA_BOOTVERBOSE( + device_printf(dev, "PCI card vendor: 0x%04x, device: 0x%04x\n", + pci_get_subvendor(dev), pci_get_subdevice(dev)); device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); ); Modified: stable/8/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.h Thu Nov 15 05:54:18 2012 (r243060) +++ stable/8/sys/dev/sound/pci/hda/hdac.h Thu Nov 15 05:55:30 2012 (r243061) @@ -666,6 +666,7 @@ HDA_ACCESSOR(revision_id, REVISION_ID, u HDA_ACCESSOR(stepping_id, STEPPING_ID, uint8_t); HDA_ACCESSOR(subvendor_id, SUBVENDOR_ID, uint16_t); HDA_ACCESSOR(subdevice_id, SUBDEVICE_ID, uint16_t); +HDA_ACCESSOR(subsystem_id, SUBSYSTEM_ID, uint32_t); HDA_ACCESSOR(node_type, NODE_TYPE, uint8_t); HDA_ACCESSOR(dma_nocache, DMA_NOCACHE, uint8_t); Modified: stable/8/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdacc.c Thu Nov 15 05:54:18 2012 (r243060) +++ stable/8/sys/dev/sound/pci/hda/hdacc.c Thu Nov 15 05:55:30 2012 (r243061) @@ -422,7 +422,7 @@ hdacc_attach(device_t dev) startnode = HDA_PARAM_SUB_NODE_COUNT_START(subnode); endnode = startnode + codec->fgcnt; - HDA_BOOTVERBOSE( + HDA_BOOTHVERBOSE( device_printf(dev, "Root Node at nid=0: %d subnodes %d-%d\n", HDA_PARAM_SUB_NODE_COUNT_TOTAL(subnode), @@ -506,6 +506,10 @@ hdacc_probe_nomatch(device_t dev, device fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO ? "Audio" : (fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_MODEM ? "Modem" : "Unknown"), fg->nid, device_get_nameunit(dev)); + HDA_BOOTVERBOSE( + device_printf(dev, "Subsystem ID: 0x%08x\n", + hda_get_subsystem_id(dev)); + ); HDA_BOOTHVERBOSE( device_printf(dev, "Power down FG nid=%d to the D3 state...\n", fg->nid); From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 05:58:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE2091FA; Thu, 15 Nov 2012 05:58:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A25D78FC08; Thu, 15 Nov 2012 05:58:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF5wboT029755; Thu, 15 Nov 2012 05:58:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF5wbkD029754; Thu, 15 Nov 2012 05:58:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150558.qAF5wbkD029754@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 05:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243063 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 05:58:37 -0000 Author: mav Date: Thu Nov 15 05:58:37 2012 New Revision: 243063 URL: http://svnweb.freebsd.org/changeset/base/243063 Log: MFC r242357: Set all pins initial connection status to unknown (2) and then update it with the real value in regular way if sensing is supported. This fixes minor inconsistency when playback redirection appeared in undefined state on boot if headphones were not connected. Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:57:20 2012 (r243062) +++ stable/8/sys/dev/sound/pci/hda/hdaa.c Thu Nov 15 05:58:37 2012 (r243063) @@ -400,7 +400,7 @@ hdaa_presence_handler(struct hdaa_widget struct hdaa_devinfo *devinfo = w->devinfo; struct hdaa_audio_as *as; uint32_t res; - int connected; + int connected, old; if (w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) @@ -414,19 +414,22 @@ hdaa_presence_handler(struct hdaa_widget connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; if (devinfo->quirks & HDAA_QUIRK_SENSEINV) connected = !connected; - if (connected == w->wclass.pin.connected) + old = w->wclass.pin.connected; + if (connected == old) return; w->wclass.pin.connected = connected; HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", - w->nid, res, !w->wclass.pin.connected ? "dis" : ""); + if (connected || old != 2) { + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", + w->nid, res, !connected ? "dis" : ""); + } ); as = &devinfo->as[w->bindas]; if (as->hpredir >= 0 && as->pins[15] == w->nid) hdaa_hpredir_handler(w); - if (as->dir == HDAA_CTL_IN) + if (as->dir == HDAA_CTL_IN && old != 2) hdaa_autorecsrc_handler(as, w); } @@ -1151,6 +1154,7 @@ hdaa_widget_parse(struct hdaa_widget *w) HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP)); w->wclass.pin.ctrl = hda_command(dev, HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid)); + w->wclass.pin.connected = 2; if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) { w->param.eapdbtl = hda_command(dev, HDA_CMD_GET_EAPD_BTL_ENABLE(0, nid)); @@ -1238,10 +1242,6 @@ hdaa_widget_postprocess(struct hdaa_widg } strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); - - if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || - (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) - w->wclass.pin.connected = 2; } } From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 06:04:39 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C40BE674; Thu, 15 Nov 2012 06:04:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F8768FC08; Thu, 15 Nov 2012 06:04:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAF64dO2030920; Thu, 15 Nov 2012 06:04:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAF64d1L030918; Thu, 15 Nov 2012 06:04:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211150604.qAF64d1L030918@svn.freebsd.org> From: Alexander Motin Date: Thu, 15 Nov 2012 06:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243065 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 06:04:39 -0000 Author: mav Date: Thu Nov 15 06:04:39 2012 New Revision: 243065 URL: http://svnweb.freebsd.org/changeset/base/243065 Log: MFC r242417: ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker if unused in that configuration mixer at NID 15 is muted. Probably CODEC incorrectly reports its internal connections. Hide that muter from the driver to avoid muting and make built-in speaker work. There are several different CODECs sharing this ID and I have not enough information about them and the bug to implement more universal solution. Modified: stable/8/sys/dev/sound/pci/hda/hdaa_patches.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 06:03:14 2012 (r243064) +++ stable/8/sys/dev/sound/pci/hda/hdaa_patches.c Thu Nov 15 06:04:39 2012 (r243065) @@ -541,6 +541,21 @@ hdaa_patch(struct hdaa_devinfo *devinfo) if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_ALC269: + /* + * ASUS EeePC 1001px has strange variant of ALC269 CODEC, + * that mutes speaker if unused mixer at NID 15 is muted. + * Probably CODEC incorrectly reports internal connections. + * Hide that muter from the driver. There are several CODECs + * sharing this ID and I have not enough information about + * them to implement more universal solution. + */ + if (subid == 0x84371043) { + w = hdaa_widget_get(devinfo, 15); + if (w != NULL) + w->param.inamp_cap = 0; + } + break; case HDA_CODEC_CX20582: case HDA_CODEC_CX20583: case HDA_CODEC_CX20584: From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 15:49:37 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9092045F; Thu, 15 Nov 2012 15:49:37 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 751508FC12; Thu, 15 Nov 2012 15:49:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFFnbLZ010799; Thu, 15 Nov 2012 15:49:37 GMT (envelope-from n_hibma@svn.freebsd.org) Received: (from n_hibma@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFFnbdG010798; Thu, 15 Nov 2012 15:49:37 GMT (envelope-from n_hibma@svn.freebsd.org) Message-Id: <201211151549.qAFFnbdG010798@svn.freebsd.org> From: Nick Hibma Date: Thu, 15 Nov 2012 15:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243087 - stable/8/etc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 15:49:37 -0000 Author: n_hibma Date: Thu Nov 15 15:49:37 2012 New Revision: 243087 URL: http://svnweb.freebsd.org/changeset/base/243087 Log: MFC 242784: Not only load pccard_ether settings, also load network settings. This is only a problem when a /etc/rc.conf.d/network file is being used. PR: conf/160373 Submitted by: n_hibma Modified: stable/8/etc/pccard_ether Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/pccard_ether ============================================================================== --- stable/8/etc/pccard_ether Thu Nov 15 15:48:40 2012 (r243086) +++ stable/8/etc/pccard_ether Thu Nov 15 15:49:37 2012 (r243087) @@ -123,4 +123,5 @@ else fi load_rc_config pccard_ether +load_rc_config network run_rc_command $args From owner-svn-src-stable-8@FreeBSD.ORG Thu Nov 15 18:05:35 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 269C4987; Thu, 15 Nov 2012 18:05:35 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9908FC17; Thu, 15 Nov 2012 18:05:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAFI5YIW032582; Thu, 15 Nov 2012 18:05:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAFI5Ytp032581; Thu, 15 Nov 2012 18:05:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211151805.qAFI5Ytp032581@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 15 Nov 2012 18:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243093 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Nov 2012 18:05:35 -0000 Author: bapt Date: Thu Nov 15 18:05:34 2012 New Revision: 243093 URL: http://svnweb.freebsd.org/changeset/base/243093 Log: MFC r243022: small style fix Modified: stable/8/sys/kern/kern_prot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_prot.c ============================================================================== --- stable/8/sys/kern/kern_prot.c Thu Nov 15 18:05:30 2012 (r243092) +++ stable/8/sys/kern/kern_prot.c Thu Nov 15 18:05:34 2012 (r243093) @@ -2066,7 +2066,7 @@ getlogin(struct thread *td, struct getlo SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); error = copyout(login, uap->namebuf, uap->namelen); - return(error); + return (error); } /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 16 02:55:05 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CE4972A; Fri, 16 Nov 2012 02:55:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E42368FC0C; Fri, 16 Nov 2012 02:55:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG2t3HQ003351; Fri, 16 Nov 2012 02:55:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG2t3m2003344; Fri, 16 Nov 2012 02:55:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160255.qAG2t3m2003344@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 02:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243120 - in stable/8: share/man/man4 sys/dev/ahci sys/dev/ata sys/dev/ata/chipsets X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 02:55:05 -0000 Author: mav Date: Fri Nov 16 02:55:03 2012 New Revision: 243120 URL: http://svnweb.freebsd.org/changeset/base/243120 Log: MFC r232380: Fix names of some Marvell SATA chips. It looks like chips with proprietary interface supported by mvs(4) are 88SX, while AHCI-like chips are 88SE. PR: kern/165271 Modified: stable/8/share/man/man4/ahci.4 stable/8/share/man/man4/ata.4 stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-marvell.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ahci/ (props changed) stable/8/sys/dev/ata/ (props changed) Modified: stable/8/share/man/man4/ahci.4 ============================================================================== --- stable/8/share/man/man4/ahci.4 Fri Nov 16 02:53:03 2012 (r243119) +++ stable/8/share/man/man4/ahci.4 Fri Nov 16 02:55:03 2012 (r243120) @@ -148,7 +148,7 @@ subclass 6 (SATA) and programming interf .Pp Also, in cooperation with atamarvell and atajmicron drivers of ata(4), it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, -such as JMicron JMB36x and Marvell 88SX61xx. +such as JMicron JMB36x and Marvell 88SE61xx. .Sh FILES .Bl -tag -width /dev/led/ahcich*.locate .It Pa /dev/led/ahcich*.act Modified: stable/8/share/man/man4/ata.4 ============================================================================== --- stable/8/share/man/man4/ata.4 Fri Nov 16 02:53:03 2012 (r243119) +++ stable/8/share/man/man4/ata.4 Fri Nov 16 02:55:03 2012 (r243120) @@ -161,8 +161,8 @@ IT8211F, IT8212F, IT8213F. .It JMicron: JMB360, JMB361, JMB363, JMB365, JMB366, JMB368. .It Marvell -88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SX6101, -88SX6102, 88SX6111, 88SX6121, 88SX6141, 88SX6145, 88SX7042. +88SX5040, 88SX5041, 88SX5080, 88SX5081, 88SX6041, 88SX6042, 88SX6081, 88SE6101, +88SE6102, 88SE6111, 88SE6121, 88SE6141, 88SE6145, 88SX7042. .It National: SC1100. .It NetCell: Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Fri Nov 16 02:53:03 2012 (r243119) +++ stable/8/sys/dev/ahci/ahci.c Fri Nov 16 02:55:03 2012 (r243120) @@ -188,13 +188,13 @@ static struct { {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, {0x2368197b, 0x00, "JMicron JMB368", AHCI_Q_NOFORCE}, - {0x611111ab, 0x00, "Marvell 88SX6111", AHCI_Q_NOFORCE | AHCI_Q_1CH | + {0x611111ab, 0x00, "Marvell 88SE6111", AHCI_Q_NOFORCE | AHCI_Q_1CH | AHCI_Q_EDGEIS}, - {0x612111ab, 0x00, "Marvell 88SX6121", AHCI_Q_NOFORCE | AHCI_Q_2CH | + {0x612111ab, 0x00, "Marvell 88SE6121", AHCI_Q_NOFORCE | AHCI_Q_2CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x614111ab, 0x00, "Marvell 88SX6141", AHCI_Q_NOFORCE | AHCI_Q_4CH | + {0x614111ab, 0x00, "Marvell 88SE6141", AHCI_Q_NOFORCE | AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, - {0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | + {0x614511ab, 0x00, "Marvell 88SE6145", AHCI_Q_NOFORCE | AHCI_Q_4CH | AHCI_Q_EDGEIS | AHCI_Q_NONCQ | AHCI_Q_NOCOUNT}, {0x91201b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_NOBSYRES}, {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES|AHCI_Q_ALTSIG}, Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Fri Nov 16 02:53:03 2012 (r243119) +++ stable/8/sys/dev/ata/ata-pci.h Fri Nov 16 02:55:03 2012 (r243120) @@ -281,12 +281,12 @@ struct ata_pci_controller { #define ATA_M88SX6042 0x604211ab #define ATA_M88SX6081 0x608111ab #define ATA_M88SX7042 0x704211ab -#define ATA_M88SX6101 0x610111ab -#define ATA_M88SX6102 0x610211ab -#define ATA_M88SX6111 0x611111ab -#define ATA_M88SX6121 0x612111ab -#define ATA_M88SX6141 0x614111ab -#define ATA_M88SX6145 0x614511ab +#define ATA_M88SE6101 0x610111ab +#define ATA_M88SE6102 0x610211ab +#define ATA_M88SE6111 0x611111ab +#define ATA_M88SE6121 0x612111ab +#define ATA_M88SE6141 0x614111ab +#define ATA_M88SE6145 0x614511ab #define ATA_MARVELL2_ID 0x1b4b #define ATA_MICRON_ID 0x1042 Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Fri Nov 16 02:53:03 2012 (r243119) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Fri Nov 16 02:55:03 2012 (r243120) @@ -180,12 +180,12 @@ ata_ahci_chipinit(device_t dev) ctlr->ichannels = ATA_INL(ctlr->r_res2, ATA_AHCI_PI); ctlr->channels = MAX(flsl(ctlr->ichannels), (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_NPMASK) + 1); - if (pci_get_devid(dev) == ATA_M88SX6111) + if (pci_get_devid(dev) == ATA_M88SE6111) ctlr->channels = 1; - else if (pci_get_devid(dev) == ATA_M88SX6121) + else if (pci_get_devid(dev) == ATA_M88SE6121) ctlr->channels = 2; - else if (pci_get_devid(dev) == ATA_M88SX6141 || - pci_get_devid(dev) == ATA_M88SX6145) + else if (pci_get_devid(dev) == ATA_M88SE6141 || + pci_get_devid(dev) == ATA_M88SE6145) ctlr->channels = 4; ctlr->reset = ata_ahci_reset; Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Fri Nov 16 02:53:03 2012 (r243119) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Fri Nov 16 02:55:03 2012 (r243120) @@ -108,12 +108,12 @@ ata_marvell_probe(device_t dev) { ATA_M88SX6042, 0, 4, MV_6042, ATA_SA300, "88SX6042" }, { ATA_M88SX6081, 0, 8, MV_60XX, ATA_SA300, "88SX6081" }, { ATA_M88SX7042, 0, 4, MV_7042, ATA_SA300, "88SX7042" }, - { ATA_M88SX6101, 0, 0, MV_61XX, ATA_UDMA6, "88SX6101" }, - { ATA_M88SX6102, 0, 0, MV_61XX, ATA_UDMA6, "88SX6102" }, - { ATA_M88SX6111, 0, 1, MV_61XX, ATA_UDMA6, "88SX6111" }, - { ATA_M88SX6121, 0, 2, MV_61XX, ATA_UDMA6, "88SX6121" }, - { ATA_M88SX6141, 0, 4, MV_61XX, ATA_UDMA6, "88SX6141" }, - { ATA_M88SX6145, 0, 4, MV_61XX, ATA_UDMA6, "88SX6145" }, + { ATA_M88SE6101, 0, 0, MV_61XX, ATA_UDMA6, "88SE6101" }, + { ATA_M88SE6102, 0, 0, MV_61XX, ATA_UDMA6, "88SE6102" }, + { ATA_M88SE6111, 0, 1, MV_61XX, ATA_UDMA6, "88SE6111" }, + { ATA_M88SE6121, 0, 2, MV_61XX, ATA_UDMA6, "88SE6121" }, + { ATA_M88SE6141, 0, 4, MV_61XX, ATA_UDMA6, "88SE6141" }, + { ATA_M88SE6145, 0, 4, MV_61XX, ATA_UDMA6, "88SE6145" }, { 0x91a41b4b, 0, 0, MV_91XX, ATA_UDMA6, "88SE912x" }, { 0, 0, 0, 0, 0, 0}}; From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 16 03:02:08 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13116D1C; Fri, 16 Nov 2012 03:02:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E237F8FC12; Fri, 16 Nov 2012 03:02:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG32723004974; Fri, 16 Nov 2012 03:02:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG327mK004970; Fri, 16 Nov 2012 03:02:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160302.qAG327mK004970@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 03:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243124 - in stable/8: share/man/man4 sys/dev/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 03:02:08 -0000 Author: mav Date: Fri Nov 16 03:02:07 2012 New Revision: 243124 URL: http://svnweb.freebsd.org/changeset/base/243124 Log: MFC r241144, r241160: Implement SATA revision (speed) control for legacy SATA controller for both boot (via loader tunables) and run-time (via `camcontrol negotiate`). Tested to work at least on NVIDIA MCP55 chipset. Modified: stable/8/share/man/man4/ata.4 stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/ata-sata.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ata/ (props changed) Modified: stable/8/share/man/man4/ata.4 ============================================================================== --- stable/8/share/man/man4/ata.4 Fri Nov 16 03:00:25 2012 (r243123) +++ stable/8/share/man/man4/ata.4 Fri Nov 16 03:02:07 2012 (r243124) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2012 +.Dd October 3, 2012 .Dt ATA 4 .Os .Sh NAME @@ -108,7 +108,7 @@ can cause data loss on power failures an set to 1 to allow Message Signalled Interrupts (MSI) to be used by specified PCI ATA controller, if supported. .It Va hint.ata.X.devX.mode -limits initial ATA mode for specified device on specified channel. +limits the initial ATA mode for the specified device on the specified channel. .It Va hint.ata.X.mode limits initial ATA mode for every device on specified channel. .It Va hint.ata.X.pm_level @@ -126,6 +126,12 @@ host initiates PARTIAL PM state transiti host initiates SLUMBER PM state transition every time port becomes idle. .El Modes 2 and 3 are implemented only for AHCI driver now. +.It Va hint.ata. Ns Ar X Ns Va .dev Ns Ar X Ns Va .sata_rev +limits the initial SATA revision (speed) for the specified device +on the specified channel. +Values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. +.It Va hint.ata. Ns Ar X Ns Va .sata_rev +Same, but for every device on the specified channel. .El .Sh DESCRIPTION The Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Fri Nov 16 03:00:25 2012 (r243123) +++ stable/8/sys/dev/ata/ata-all.c Fri Nov 16 03:02:07 2012 (r243124) @@ -171,6 +171,15 @@ ata_attach(device_t dev) TASK_INIT(&ch->conntask, 0, ata_conn_event, dev); #ifdef ATA_CAM for (i = 0; i < 16; i++) { + ch->user[i].revision = 0; + snprintf(buf, sizeof(buf), "dev%d.sata_rev", i); + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), buf, &mode) != 0 && + resource_int_value(device_get_name(dev), + device_get_unit(dev), "sata_rev", &mode) != 0) + mode = -1; + if (mode >= 0) + ch->user[i].revision = mode; ch->user[i].mode = 0; snprintf(buf, sizeof(buf), "dev%d.mode", i); if (resource_string_value(device_get_name(dev), Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Fri Nov 16 03:00:25 2012 (r243123) +++ stable/8/sys/dev/ata/ata-all.h Fri Nov 16 03:02:07 2012 (r243124) @@ -142,6 +142,7 @@ #define ATA_SC_SPD_NO_SPEED 0x00000000 #define ATA_SC_SPD_SPEED_GEN1 0x00000010 #define ATA_SC_SPD_SPEED_GEN2 0x00000020 +#define ATA_SC_SPD_SPEED_GEN3 0x00000040 #define ATA_SC_IPM_MASK 0x00000f00 #define ATA_SC_IPM_NONE 0x00000000 Modified: stable/8/sys/dev/ata/ata-sata.c ============================================================================== --- stable/8/sys/dev/ata/ata-sata.c Fri Nov 16 03:00:25 2012 (r243123) +++ stable/8/sys/dev/ata/ata-sata.c Fri Nov 16 03:02:07 2012 (r243124) @@ -152,8 +152,16 @@ int ata_sata_phy_reset(device_t dev, int port, int quick) { struct ata_channel *ch = device_get_softc(dev); - int loop, retry; - uint32_t val; + int loop, retry, sata_rev; + uint32_t val, val1; + +#ifdef ATA_CAM + sata_rev = ch->user[port < 0 ? 0 : port].revision; + if (sata_rev > 0) + quick = 0; +#else + sata_rev = 0; +#endif if (quick) { if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) @@ -173,9 +181,18 @@ ata_sata_phy_reset(device_t dev, int por device_printf(dev, "p%d: hard reset ...\n", port); } } + if (sata_rev == 1) + val1 = ATA_SC_SPD_SPEED_GEN1; + else if (sata_rev == 2) + val1 = ATA_SC_SPD_SPEED_GEN2; + else if (sata_rev == 3) + val1 = ATA_SC_SPD_SPEED_GEN3; + else + val1 = 0; for (retry = 0; retry < 10; retry++) { for (loop = 0; loop < 10; loop++) { - if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET)) + if (ata_sata_scr_write(ch, port, ATA_SCONTROL, ATA_SC_DET_RESET | + val1 | ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER)) goto fail; ata_udelay(100); if (ata_sata_scr_read(ch, port, ATA_SCONTROL, &val)) @@ -186,7 +203,7 @@ ata_sata_phy_reset(device_t dev, int por ata_udelay(5000); for (loop = 0; loop < 10; loop++) { if (ata_sata_scr_write(ch, port, ATA_SCONTROL, - ATA_SC_DET_IDLE | ((ch->pm_level > 0) ? 0 : + ATA_SC_DET_IDLE | val1 | ((ch->pm_level > 0) ? 0 : ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))) goto fail; ata_udelay(100); From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 16 03:05:28 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CB96123; Fri, 16 Nov 2012 03:05:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 40EDC8FC14; Fri, 16 Nov 2012 03:05:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG35S9f005600; Fri, 16 Nov 2012 03:05:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG35S1d005594; Fri, 16 Nov 2012 03:05:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160305.qAG35S1d005594@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 03:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243126 - in stable/8/sys/dev/ata: . chipsets X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 03:05:28 -0000 Author: mav Date: Fri Nov 16 03:05:27 2012 New Revision: 243126 URL: http://svnweb.freebsd.org/changeset/base/243126 Log: MFC r242156: Implement CAM_ATAIO_NEEDRESULT (fetching full set of result registers) for ata(4) driver in ATA_CAM mode. That slighty improves error reporting and also should fix `smartctl -l scterc /dev/adaX` operation. Modified: stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/ata/ata-lowlevel.c stable/8/sys/dev/ata/chipsets/ata-ahci.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ata/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Fri Nov 16 03:04:30 2012 (r243125) +++ stable/8/sys/dev/ata/ata-all.c Fri Nov 16 03:05:27 2012 (r243126) @@ -1491,6 +1491,8 @@ ata_cam_begin_transaction(device_t dev, request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) | ((uint64_t)ccb->ataio.cmd.lba_mid << 8) | (uint64_t)ccb->ataio.cmd.lba_low; + if (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT) + request->flags |= ATA_R_NEEDRESULT; if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && ccb->ataio.cmd.flags & CAM_ATAIO_DMA) request->flags |= ATA_R_DMA; Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Fri Nov 16 03:04:30 2012 (r243125) +++ stable/8/sys/dev/ata/ata-all.h Fri Nov 16 03:05:27 2012 (r243126) @@ -397,6 +397,7 @@ struct ata_request { #define ATA_R_REQUEUE 0x00000400 #define ATA_R_THREAD 0x00000800 #define ATA_R_DIRECT 0x00001000 +#define ATA_R_NEEDRESULT 0x00002000 #define ATA_R_ATAPI16 0x00010000 #define ATA_R_ATAPI_INTR 0x00020000 Modified: stable/8/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/8/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:04:30 2012 (r243125) +++ stable/8/sys/dev/ata/ata-lowlevel.c Fri Nov 16 03:05:27 2012 (r243126) @@ -116,6 +116,7 @@ ata_begin_transaction(struct ata_request } while (request->status & ATA_S_BUSY && timeout--); if (request->status & ATA_S_ERROR) request->error = ATA_IDX_INB(ch, ATA_ERROR); + ch->hw.tf_read(request); goto begin_finished; } @@ -253,8 +254,9 @@ ata_end_transaction(struct ata_request * if (request->flags & ATA_R_TIMEOUT) goto end_finished; - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { ch->hw.tf_read(request); } @@ -332,6 +334,12 @@ ata_end_transaction(struct ata_request * else if (!(request->flags & ATA_R_TIMEOUT)) request->donecount = request->bytecount; + /* Read back registers to the request struct. */ + if ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT))) { + ch->hw.tf_read(request); + } + /* release SG list etc */ ch->dma.unload(request); Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-ahci.c Fri Nov 16 03:04:30 2012 (r243125) +++ stable/8/sys/dev/ata/chipsets/ata-ahci.c Fri Nov 16 03:05:27 2012 (r243126) @@ -555,8 +555,10 @@ ata_ahci_end_transaction(struct ata_requ if (request->status & ATA_S_ERROR) request->error = tf_data >> 8; - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->flags & ATA_R_ATAPI) == 0 && + ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40; request->u.ata.count = fis[12] | ((u_int16_t)fis[13] << 8); Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Fri Nov 16 03:04:30 2012 (r243125) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Fri Nov 16 03:05:27 2012 (r243126) @@ -658,8 +658,10 @@ ata_siiprb_end_transaction(struct ata_re } } - /* on control commands read back registers to the request struct */ - if (request->flags & ATA_R_CONTROL) { + /* Read back registers to the request struct. */ + if ((request->flags & ATA_R_ATAPI) == 0 && + ((request->status & ATA_S_ERROR) || + (request->flags & (ATA_R_CONTROL | ATA_R_NEEDRESULT)))) { request->u.ata.count = prb->fis[12] | ((u_int16_t)prb->fis[13] << 8); request->u.ata.lba = prb->fis[4] | ((u_int64_t)prb->fis[5] << 8) | ((u_int64_t)prb->fis[6] << 16); From owner-svn-src-stable-8@FreeBSD.ORG Fri Nov 16 03:08:24 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 90BC3434; Fri, 16 Nov 2012 03:08:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5BAB38FC0C; Fri, 16 Nov 2012 03:08:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAG38OFD006145; Fri, 16 Nov 2012 03:08:24 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAG38Odp006144; Fri, 16 Nov 2012 03:08:24 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211160308.qAG38Odp006144@svn.freebsd.org> From: Alexander Motin Date: Fri, 16 Nov 2012 03:08:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243128 - stable/8/sys/dev/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 03:08:24 -0000 Author: mav Date: Fri Nov 16 03:08:23 2012 New Revision: 243128 URL: http://svnweb.freebsd.org/changeset/base/243128 Log: MFC r242422: Only four specific ATA PIO commands transfer several sectors per DRQ block (interrupt). All other ATA PIO commands transfer one sector or 512 bytes at one time. Hardcode these exceptions in ata(4) with ATA_CAM option. This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Modified: stable/8/sys/dev/ata/ata-all.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ata/ (props changed) Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Fri Nov 16 03:07:27 2012 (r243127) +++ stable/8/sys/dev/ata/ata-all.c Fri Nov 16 03:08:23 2012 (r243128) @@ -1500,6 +1500,14 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + if (ccb->ataio.cmd.command == ATA_READ_MUL || + ccb->ataio.cmd.command == ATA_READ_MUL48 || + ccb->ataio.cmd.command == ATA_WRITE_MUL || + ccb->ataio.cmd.command == ATA_WRITE_MUL48) { + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); + } else + request->transfersize = min(request->bytecount, 512); } else { request->data = ccb->csio.data_ptr; request->bytecount = ccb->csio.dxfer_len; @@ -1516,9 +1524,9 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); } - request->transfersize = min(request->bytecount, - ch->curr[ccb->ccb_h.target_id].bytecount); request->retries = 0; request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); From owner-svn-src-stable-8@FreeBSD.ORG Sat Nov 17 23:39:36 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCA1C84F; Sat, 17 Nov 2012 23:39:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B15168FC0C; Sat, 17 Nov 2012 23:39:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAHNdanb008188; Sat, 17 Nov 2012 23:39:36 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAHNdaaa008187; Sat, 17 Nov 2012 23:39:36 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211172339.qAHNdaaa008187@svn.freebsd.org> From: Dimitry Andric Date: Sat, 17 Nov 2012 23:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r243199 - stable/8/sys/dev/aic7xxx/aicasm X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Nov 2012 23:39:36 -0000 Author: dim Date: Sat Nov 17 23:39:36 2012 New Revision: 243199 URL: http://svnweb.freebsd.org/changeset/base/243199 Log: MFC r243037: Fix a bug in aicasm_gram.y, noted by a newer clang 3.2 snapshot: it compared an enum scope_type against a yacc-generated define, so the condition would always be false. Modified: stable/8/sys/dev/aic7xxx/aicasm/aicasm_gram.y Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/aic7xxx/ (props changed) Modified: stable/8/sys/dev/aic7xxx/aicasm/aicasm_gram.y ============================================================================== --- stable/8/sys/dev/aic7xxx/aicasm/aicasm_gram.y Sat Nov 17 23:34:10 2012 (r243198) +++ stable/8/sys/dev/aic7xxx/aicasm/aicasm_gram.y Sat Nov 17 23:39:36 2012 (r243199) @@ -1081,7 +1081,7 @@ conditional: last_scope = TAILQ_LAST(&scope_context->inner_scope, scope_tailq); if (last_scope == NULL - || last_scope->type == T_ELSE) { + || last_scope->type == SCOPE_ELSE) { stop("'else if' without leading 'if'", EX_DATAERR); /* NOTREACHED */