From c2dbeb9d3139900a801aafbd5cb407a925a44dc5 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 16 Jul 2018 20:11:59 -0400 Subject: [PATCH] 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. --- .../kernel/busses/scsi/ahci/sata_request.cpp | 16 +++++----------- .../kernel/busses/scsi/ahci/sata_request.h | 3 +-- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp b/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp index 65d22917e3..9e06dceab6 100644 --- a/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp +++ b/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp @@ -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; diff --git a/src/add-ons/kernel/busses/scsi/ahci/sata_request.h b/src/add-ons/kernel/busses/scsi/ahci/sata_request.h index 5e6afad1ed..5686530fa0 100644 --- a/src/add-ons/kernel/busses/scsi/ahci/sata_request.h +++ b/src/add-ons/kernel/busses/scsi/ahci/sata_request.h @@ -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