Skip to content

Commit

Permalink
isci: merge sata.[ch] into request.c
Browse files Browse the repository at this point in the history
Undo some needless separation.

Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
djbw committed Jul 3, 2011
1 parent 34a9915 commit 16ba770
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 378 deletions.
2 changes: 1 addition & 1 deletion drivers/scsi/isci/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
obj-$(CONFIG_SCSI_ISCI) += isci.o
isci-objs := init.o phy.o request.o sata.o \
isci-objs := init.o phy.o request.o \
remote_device.o port.o \
host.o task.o probe_roms.o \
remote_node_context.o \
Expand Down
71 changes: 39 additions & 32 deletions drivers/scsi/isci/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "isci.h"
#include "task.h"
#include "request.h"
#include "sata.h"
#include "scu_completion_codes.h"
#include "scu_event_codes.h"
#include "sas.h"
Expand Down Expand Up @@ -1092,16 +1091,6 @@ smp_request_await_tc_event(struct isci_request *ireq,
return SCI_SUCCESS;
}

void sci_stp_io_request_set_ncq_tag(struct isci_request *ireq,
u16 ncq_tag)
{
/**
* @note This could be made to return an error to the user if the user
* attempts to set the NCQ tag in the wrong state.
*/
ireq->tc->type.stp.ncq_tag = ncq_tag;
}

static struct scu_sgl_element *pio_sgl_next(struct isci_stp_request *stp_req)
{
struct scu_sgl_element *sgl;
Expand Down Expand Up @@ -2410,6 +2399,29 @@ static void isci_task_save_for_upper_layer_completion(
}
}

static void isci_request_process_stp_response(struct sas_task *task,
void *response_buffer)
{
struct dev_to_host_fis *d2h_reg_fis = response_buffer;
struct task_status_struct *ts = &task->task_status;
struct ata_task_resp *resp = (void *)&ts->buf[0];

resp->frame_len = le16_to_cpu(*(__le16 *)(response_buffer + 6));
memcpy(&resp->ending_fis[0], response_buffer + 16, 24);
ts->buf_valid_size = sizeof(*resp);

/**
* If the device fault bit is set in the status register, then
* set the sense data and return.
*/
if (d2h_reg_fis->status & ATA_DF)
ts->stat = SAS_PROTO_RESPONSE;
else
ts->stat = SAM_STAT_GOOD;

ts->resp = SAS_TASK_COMPLETE;
}

static void isci_request_io_request_complete(struct isci_host *ihost,
struct isci_request *request,
enum sci_io_status completion_status)
Expand Down Expand Up @@ -2985,34 +2997,29 @@ static enum sci_status isci_request_ssp_request_construct(
return status;
}

static enum sci_status isci_request_stp_request_construct(
struct isci_request *request)
static enum sci_status isci_request_stp_request_construct(struct isci_request *ireq)
{
struct sas_task *task = isci_request_access_task(request);
struct sas_task *task = isci_request_access_task(ireq);
struct host_to_dev_fis *fis = &ireq->stp.cmd;
struct ata_queued_cmd *qc = task->uldd_task;
enum sci_status status;
struct host_to_dev_fis *register_fis;

dev_dbg(&request->isci_host->pdev->dev,
"%s: request = %p\n",
dev_dbg(&ireq->isci_host->pdev->dev,
"%s: ireq = %p\n",
__func__,
request);

/* Get the host_to_dev_fis from the core and copy
* the fis from the task into it.
*/
register_fis = isci_sata_task_to_fis_copy(task);
ireq);

status = sci_io_request_construct_basic_sata(request);
memcpy(fis, &task->ata_task.fis, sizeof(struct host_to_dev_fis));
if (!task->ata_task.device_control_reg_update)
fis->flags |= 0x80;
fis->flags &= 0xF0;

/* Set the ncq tag in the fis, from the queue
* command in the task.
*/
if (isci_sata_is_task_ncq(task)) {
status = sci_io_request_construct_basic_sata(ireq);

isci_sata_set_ncq_tag(
register_fis,
task
);
if (qc && (qc->tf.command == ATA_CMD_FPDMA_WRITE ||
qc->tf.command == ATA_CMD_FPDMA_READ)) {
fis->sector_count = qc->tag << 3;
ireq->tc->type.stp.ncq_tag = qc->tag;
}

return status;
Expand Down
2 changes: 0 additions & 2 deletions drivers/scsi/isci/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,6 @@ enum sci_status
sci_task_request_construct_ssp(struct isci_request *ireq);
enum sci_status
sci_task_request_construct_sata(struct isci_request *ireq);
void
sci_stp_io_request_set_ncq_tag(struct isci_request *ireq, u16 ncq_tag);
void sci_smp_request_copy_response(struct isci_request *ireq);

static inline int isci_task_is_ncq_recovery(struct sas_task *task)
Expand Down
232 changes: 0 additions & 232 deletions drivers/scsi/isci/sata.c

This file was deleted.

Loading

0 comments on commit 16ba770

Please sign in to comment.