Revert the cargo-culted changes to sata_request.

This reverts commit ffd36865cf3e66a57f5b1c5e938d53bdbd1c9933.

They didn't fix anything, and on some systems it's reported that they
cause boot failures.

Fixes #14272.
This commit is contained in:
Augustin Cavalier 2018-07-16 20:11:59 -04:00
parent dffc3e2353
commit c2dbeb9d31
2 changed files with 6 additions and 13 deletions

View File

@ -1,7 +1,6 @@
/*
* Copyright 2008, Marcus Overhagen. All rights reserved.
* Copyright 2009-2018, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
* Distributed under the terms of the MIT License.
*/
@ -13,9 +12,6 @@
#define FIS_TYPE_REGISTER_HOST_TO_DEVICE 0x27
#define ATA_D_LBA 0x40 /* use LBA addressing */
#define ATA_A_4BIT 0x08 /* 4 head bits */
sata_request::sata_request()
:
@ -64,10 +60,7 @@ sata_request::SetATACommand(uint8 command)
fFis[0] = FIS_TYPE_REGISTER_HOST_TO_DEVICE;
fFis[1] = 0x80;
// This is a command
if (fCcb != NULL)
fFis[1] |= fCcb->target_id & 0x0f;
fFis[2] = command;
fFis[15] = ATA_A_4BIT;
}
@ -78,7 +71,8 @@ sata_request::SetATA28Command(uint8 command, uint32 lba, uint8 sectorCount)
fFis[4] = lba & 0xff;
fFis[5] = (lba >> 8) & 0xff;
fFis[6] = (lba >> 16) & 0xff;
fFis[7] = ATA_D_LBA | ((lba >> 24) & 0x0f);
fFis[7] = 0x40 | ((lba >> 24) & 0x0f);
// device
fFis[12] = sectorCount & 0xff;
}
@ -90,7 +84,8 @@ sata_request::SetATA48Command(uint8 command, uint64 lba, uint16 sectorCount)
fFis[4] = lba & 0xff;
fFis[5] = (lba >> 8) & 0xff;
fFis[6] = (lba >> 16) & 0xff;
fFis[7] = ATA_D_LBA;
fFis[7] = 0x40;
// device
fFis[8] = (lba >> 24) & 0xff;
fFis[9] = (lba >> 32) & 0xff;
fFis[10] = (lba >> 40) & 0xff;
@ -112,7 +107,6 @@ sata_request::SetATAPICommand(size_t transferLength)
{
fIsATAPI = true;
SetATACommand(0xa0);
fFis[7] = ATA_D_LBA;
if (1 /* isPIO */) {
if (transferLength == 0)
transferLength = 2;

View File

@ -1,7 +1,6 @@
/*
* Copyright 2008, Marcus Overhagen. All rights reserved.
* Copyright 2009-2018, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
* Distributed under the terms of the MIT License.
*/
#ifndef _SATA_REQUEST_H
#define _SATA_REQUEST_H