From owner-svn-src-head@FreeBSD.ORG Sat Feb 21 23:46:34 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBEEB106564A; Sat, 21 Feb 2009 23:46:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA51C8FC08; Sat, 21 Feb 2009 23:46:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n1LNkY37078582; Sat, 21 Feb 2009 23:46:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n1LNkYnH078578; Sat, 21 Feb 2009 23:46:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200902212346.n1LNkYnH078578@svn.freebsd.org> From: Alexander Motin Date: Sat, 21 Feb 2009 23:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r188906 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Feb 2009 23:46:35 -0000 Author: mav Date: Sat Feb 21 23:46:34 2009 New Revision: 188906 URL: http://svn.freebsd.org/changeset/base/188906 Log: Use only higher half of device signature to identify device type. Some devices return incorrect values in lower part confusing detection, while higher part itself gives enough information for proper detetion. Modified: head/sys/dev/ata/ata-sata.c head/sys/dev/ata/chipsets/ata-ahci.c head/sys/dev/ata/chipsets/ata-promise.c head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/ata-sata.c ============================================================================== --- head/sys/dev/ata/ata-sata.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/ata-sata.c Sat Feb 21 23:46:34 2009 (r188906) @@ -295,11 +295,11 @@ ata_pm_identify(device_t dev) device_printf(dev, "p%d: SIGNATURE=%08x\n", port, signature); /* figure out whats there */ - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices |= (ATA_ATA_MASTER << port); continue; - case 0xeb140101: + case 0xeb14: ch->devices |= (ATA_ATAPI_MASTER << port); continue; } Modified: head/sys/dev/ata/chipsets/ata-ahci.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:46:34 2009 (r188906) @@ -754,15 +754,15 @@ ata_ahci_reset(device_t dev) if (bootverbose) device_printf(dev, "SIGNATURE: %08x\n", signature); - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices = ATA_ATA_MASTER; break; - case 0x96690101: + case 0x9669: ch->devices = ATA_PORTMULTIPLIER; ata_pm_identify(dev); break; - case 0xeb140101: + case 0xeb14: ch->devices = ATA_ATAPI_MASTER; break; default: /* SOS XXX */ Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/chipsets/ata-promise.c Sat Feb 21 23:46:34 2009 (r188906) @@ -808,15 +808,15 @@ ata_promise_mio_reset(device_t dev) if (1 | bootverbose) device_printf(dev, "SIGNATURE: %08x\n", signature); - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices = ATA_ATA_MASTER; break; - case 0x96690101: + case 0x9669: ch->devices = ATA_PORTMULTIPLIER; ata_pm_identify(dev); break; - case 0xeb140101: + case 0xeb14: ch->devices = ATA_ATAPI_MASTER; break; default: /* SOS XXX */ Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Feb 21 23:42:28 2009 (r188905) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Feb 21 23:46:34 2009 (r188906) @@ -849,17 +849,17 @@ ata_siiprb_reset(device_t dev) device_printf(dev, "SIGNATURE=%08x\n", signature); /* figure out whats there */ - switch (signature) { - case 0x00000101: + switch (signature >> 16) { + case 0x0000: ch->devices = ATA_ATA_MASTER; break; - case 0x96690101: + case 0x9669: ch->devices = ATA_PORTMULTIPLIER; ATA_OUTL(ctlr->r_res2, 0x1000 + offset, 0x2000); /* enable PM support */ //SOS XXX need to clear all PM status and interrupts!!!! ata_pm_identify(dev); break; - case 0xeb140101: + case 0xeb14: ch->devices = ATA_ATAPI_MASTER; break; default: