diff options
author | Dave Jiang <dave.jiang@intel.com> | 2011-05-04 15:02:03 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:04:46 -0700 |
commit | e76d6180da436edf2cc3538cbed1f5b02b614613 (patch) | |
tree | 24892fa998bfb575eb71ab2fff7016fad3d423a9 /drivers/scsi/isci/sata.c | |
parent | f2f300806fe186a6c45020a444667755edcce672 (diff) |
isci: Convert ATA defines to Linux native defines
* Removing all intel_sata and intel_ata defines
* Removing the usage of SAT_PROTOCOL_*. We can get everything from sas_task
* Moved SATA FIS types to local sas.h. These defines will have to go
into include/scsi/sas.h eventually.
* Added offsets for SATA FIS header in order to grab the values
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/sata.c')
-rw-r--r-- | drivers/scsi/isci/sata.c | 75 |
1 files changed, 1 insertions, 74 deletions
diff --git a/drivers/scsi/isci/sata.c b/drivers/scsi/isci/sata.c index 08374505832..a08fcf51190 100644 --- a/drivers/scsi/isci/sata.c +++ b/drivers/scsi/isci/sata.c @@ -61,11 +61,6 @@ #include "task.h" #include "request.h" #include "sata.h" -#include "intel_sat.h" -#include "intel_ata.h" - -static u8 isci_sata_get_management_task_protocol(struct isci_tmf *tmf); - /** * isci_sata_task_to_fis_copy() - This function gets the host_to_dev_fis from @@ -158,7 +153,7 @@ void isci_request_process_stp_response(struct sas_task *task, * If the device fault bit is set in the status register, then * set the sense data and return. */ - if (d2h_reg_fis->status & ATA_STATUS_REG_DEVICE_FAULT_BIT) + if (d2h_reg_fis->status & ATA_DF) ts->stat = SAS_PROTO_RESPONSE; else ts->stat = SAM_STAT_GOOD; @@ -166,74 +161,6 @@ void isci_request_process_stp_response(struct sas_task *task, ts->resp = SAS_TASK_COMPLETE; } -/** - * isci_sata_get_sat_protocol() - retrieve the sat protocol for the request - * @isci_request: ata request - * - * Note: temporary implementation until expert mode removes the callback - * - */ -u8 isci_sata_get_sat_protocol(struct isci_request *isci_request) -{ - struct sas_task *task; - struct domain_device *dev; - - dev_dbg(&isci_request->isci_host->pdev->dev, - "%s: isci_request = %p, ttype = %d\n", - __func__, isci_request, isci_request->ttype); - - if (tmf_task == isci_request->ttype) { - struct isci_tmf *tmf = isci_request_access_tmf(isci_request); - - return isci_sata_get_management_task_protocol(tmf); - } - - task = isci_request_access_task(isci_request); - dev = task->dev; - - if (!sas_protocol_ata(task->task_proto)) { - WARN(1, "unhandled task protocol\n"); - return SAT_PROTOCOL_NON_DATA; - } - - if (task->data_dir == DMA_NONE) - return SAT_PROTOCOL_NON_DATA; - - /* the "_IN" protocol types are equivalent to their "_OUT" - * analogs as far as the core is concerned - */ - if (dev->sata_dev.command_set == ATAPI_COMMAND_SET) { - if (task->ata_task.dma_xfer) - return SAT_PROTOCOL_PACKET_DMA_DATA_IN; - else - return SAT_PROTOCOL_PACKET_PIO_DATA_IN; - } - - if (task->ata_task.use_ncq) - return SAT_PROTOCOL_FPDMA; - - if (task->ata_task.dma_xfer) - return SAT_PROTOCOL_UDMA_DATA_IN; - else - return SAT_PROTOCOL_PIO_DATA_IN; -} - -static u8 isci_sata_get_management_task_protocol( - struct isci_tmf *tmf) -{ - u8 ret = 0; - - pr_warn("tmf = %p, func = %d\n", tmf, tmf->tmf_code); - - if ((tmf->tmf_code == isci_tmf_sata_srst_high) || - (tmf->tmf_code == isci_tmf_sata_srst_low)) { - pr_warn("%s: tmf->tmf_code == TMF_LU_RESET\n", __func__); - ret = SAT_PROTOCOL_SOFT_RESET; - } - - return ret; -} - enum sci_status isci_sata_management_task_request_build( struct isci_request *isci_request) { |