diff options
author | mav <mav@FreeBSD.org> | 2009-02-21 23:46:34 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2009-02-21 23:46:34 +0000 |
commit | 3bc203445d13de73865f2a266cf25b88c21359d1 (patch) | |
tree | 6c8d31c72ab618f76e5e7e45af43175840fd97a1 | |
parent | 5ac2ce847105aadabcb9ca278a5347a7757cb4f7 (diff) | |
download | FreeBSD-src-3bc203445d13de73865f2a266cf25b88c21359d1.zip FreeBSD-src-3bc203445d13de73865f2a266cf25b88c21359d1.tar.gz |
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.
-rw-r--r-- | sys/dev/ata/ata-sata.c | 6 | ||||
-rw-r--r-- | sys/dev/ata/chipsets/ata-ahci.c | 8 | ||||
-rw-r--r-- | sys/dev/ata/chipsets/ata-promise.c | 8 | ||||
-rw-r--r-- | sys/dev/ata/chipsets/ata-siliconimage.c | 8 |
4 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/ata/ata-sata.c b/sys/dev/ata/ata-sata.c index 559ed1e..642a94e 100644 --- a/sys/dev/ata/ata-sata.c +++ b/sys/dev/ata/ata-sata.c @@ -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; } diff --git a/sys/dev/ata/chipsets/ata-ahci.c b/sys/dev/ata/chipsets/ata-ahci.c index bb1587b..9eef722 100644 --- a/sys/dev/ata/chipsets/ata-ahci.c +++ b/sys/dev/ata/chipsets/ata-ahci.c @@ -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 */ diff --git a/sys/dev/ata/chipsets/ata-promise.c b/sys/dev/ata/chipsets/ata-promise.c index 261e0be..0d36c5b 100644 --- a/sys/dev/ata/chipsets/ata-promise.c +++ b/sys/dev/ata/chipsets/ata-promise.c @@ -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 */ diff --git a/sys/dev/ata/chipsets/ata-siliconimage.c b/sys/dev/ata/chipsets/ata-siliconimage.c index 5fe08be..5c12125 100644 --- a/sys/dev/ata/chipsets/ata-siliconimage.c +++ b/sys/dev/ata/chipsets/ata-siliconimage.c @@ -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: |