diff --git a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp index 3df867c40d..2ca513cb9e 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp +++ b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp @@ -123,7 +123,7 @@ ATAChannel::ScanBus() } bool devicePresent[fDeviceCount]; - uint32 deviceSignature[fDeviceCount]; + uint16 deviceSignature[fDeviceCount]; status_t result = Reset(devicePresent, deviceSignature); if (result != B_OK) { TRACE_ERROR("resetting the channel failed\n"); @@ -289,7 +289,7 @@ ATAChannel::SelectedDevice() status_t -ATAChannel::Reset(bool *presence, uint32 *signatures) +ATAChannel::Reset(bool *presence, uint16 *signatures) { TRACE_FUNCTION("\n"); @@ -335,8 +335,8 @@ ATAChannel::Reset(bool *presence, uint32 *signatures) } ata_task_file taskFile; - if (_ReadRegs(&taskFile, ATA_MASK_SECTOR_COUNT | ATA_MASK_LBA_LOW - | ATA_MASK_LBA_MID | ATA_MASK_LBA_HIGH | ATA_MASK_ERROR) != B_OK) { + if (_ReadRegs(&taskFile, ATA_MASK_LBA_MID | ATA_MASK_LBA_HIGH + | ATA_MASK_ERROR) != B_OK) { TRACE_ERROR("reading status failed\n"); return B_ERROR; } @@ -357,12 +357,12 @@ ATAChannel::Reset(bool *presence, uint32 *signatures) if (presence != NULL) presence[i] = true; - if (signatures != NULL) { - signatures[i] = taskFile.lba.sector_count - | (((uint32)taskFile.lba.lba_0_7) << 8) - | (((uint32)taskFile.lba.lba_8_15) << 16) - | (((uint32)taskFile.lba.lba_16_23) << 24); - } + uint16 signature = taskFile.lba.lba_8_15 + | (((uint16)taskFile.lba.lba_16_23) << 8); + TRACE_ALWAYS("signature of device %d: 0x%04x\n", i, signature); + + if (signatures != NULL) + signatures[i] = signature; } return B_OK; diff --git a/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h b/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h index 7d9be24eb0..bde085b554 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h +++ b/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h @@ -29,9 +29,9 @@ #define ATA_MAX_DMA_FAILURES 3 #define ATA_STANDARD_TIMEOUT 10 * 1000 * 1000 #define ATA_RELEASE_TIMEOUT 10 * 1000 * 1000 -#define ATA_SIGNATURE_ATA 0x00000101 -#define ATA_SIGNATURE_ATAPI 0xeb140101 -#define ATA_SIGNATURE_SATA 0xc33c0101 +#define ATA_SIGNATURE_ATA 0x0000 +#define ATA_SIGNATURE_ATAPI 0xeb14 +#define ATA_SIGNATURE_SATA 0xc33c #define ATA_SIM_MODULE_NAME "bus_managers/ata/sim/driver_v1" #define ATA_CHANNEL_ID_GENERATOR "ide/channel_id" #define ATA_CHANNEL_ID_ITEM "ide/channel_id" @@ -79,7 +79,7 @@ public: status_t SelectDevice(uint8 index); uint8 SelectedDevice(); - status_t Reset(bool *presence, uint32 *signatures); + status_t Reset(bool *presence, uint16 *signatures); bool UseDMA() { return fUseDMA; };