Revert the cargo-culted changes to sata_request.

This reverts commit ffd36865cf.

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
@@ -1,7 +1,6 @@
/* /*
* Copyright 2008, Marcus Overhagen. All rights reserved. * 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 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() sata_request::sata_request()
: :
@@ -64,10 +60,7 @@ sata_request::SetATACommand(uint8 command)
fFis[0] = FIS_TYPE_REGISTER_HOST_TO_DEVICE; fFis[0] = FIS_TYPE_REGISTER_HOST_TO_DEVICE;
fFis[1] = 0x80; fFis[1] = 0x80;
// This is a command // This is a command
if (fCcb != NULL)
fFis[1] |= fCcb->target_id & 0x0f;
fFis[2] = command; 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[4] = lba & 0xff;
fFis[5] = (lba >> 8) & 0xff; fFis[5] = (lba >> 8) & 0xff;
fFis[6] = (lba >> 16) & 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; fFis[12] = sectorCount & 0xff;
} }
@@ -90,7 +84,8 @@ sata_request::SetATA48Command(uint8 command, uint64 lba, uint16 sectorCount)
fFis[4] = lba & 0xff; fFis[4] = lba & 0xff;
fFis[5] = (lba >> 8) & 0xff; fFis[5] = (lba >> 8) & 0xff;
fFis[6] = (lba >> 16) & 0xff; fFis[6] = (lba >> 16) & 0xff;
fFis[7] = ATA_D_LBA; fFis[7] = 0x40;
// device
fFis[8] = (lba >> 24) & 0xff; fFis[8] = (lba >> 24) & 0xff;
fFis[9] = (lba >> 32) & 0xff; fFis[9] = (lba >> 32) & 0xff;
fFis[10] = (lba >> 40) & 0xff; fFis[10] = (lba >> 40) & 0xff;
@@ -112,7 +107,6 @@ sata_request::SetATAPICommand(size_t transferLength)
{ {
fIsATAPI = true; fIsATAPI = true;
SetATACommand(0xa0); SetATACommand(0xa0);
fFis[7] = ATA_D_LBA;
if (1 /* isPIO */) { if (1 /* isPIO */) {
if (transferLength == 0) if (transferLength == 0)
transferLength = 2; transferLength = 2;
@@ -1,7 +1,6 @@
/* /*
* Copyright 2008, Marcus Overhagen. All rights reserved. * 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 #ifndef _SATA_REQUEST_H
#define _SATA_REQUEST_H #define _SATA_REQUEST_H