Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1654308

[PATCH v3 05/23] scsi: hisi_sas: relocate sata_done_v2_hw()

From John Garry <john.garry@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v3 05/23] scsi: hisi_sas: relocate sata_done_v2_hw()
Date 2017-05-31 16:20 +0200
Message-ID <tNcDF-5Wy-45@gated-at.bofh.it> (permalink)
References <tNctY-5S4-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Xiang Chen <chenxiang66@hisilicon.com>

Relocate get_ata_protocol() to a common location, as future hw
versions will require it.
Also rename with "hisi_sas_" prefix for consistency.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas.h       |  2 ++
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 15 +++++++++++++++
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 18 ++----------------
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index 8ed1199..f2d69cd 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -358,6 +358,8 @@ struct hisi_sas_command_table_ssp {
 
 extern u8 hisi_sas_get_ata_protocol(u8 cmd, int direction);
 extern struct hisi_sas_port *to_hisi_sas_port(struct asd_sas_port *sas_port);
+extern void hisi_sas_sata_done(struct sas_task *task,
+			    struct hisi_sas_slot *slot);
 extern int hisi_sas_probe(struct platform_device *pdev,
 			  const struct hisi_sas_hw *ops);
 extern int hisi_sas_remove(struct platform_device *pdev);
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index f71590c..88ace7c 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -88,6 +88,21 @@ u8 hisi_sas_get_ata_protocol(u8 cmd, int direction)
 }
 EXPORT_SYMBOL_GPL(hisi_sas_get_ata_protocol);
 
+void hisi_sas_sata_done(struct sas_task *task,
+			    struct hisi_sas_slot *slot)
+{
+	struct task_status_struct *ts = &task->task_status;
+	struct ata_task_resp *resp = (struct ata_task_resp *)ts->buf;
+	struct dev_to_host_fis *d2h = slot->status_buffer +
+				      sizeof(struct hisi_sas_err_record);
+
+	resp->frame_len = sizeof(struct dev_to_host_fis);
+	memcpy(&resp->ending_fis[0], d2h, sizeof(struct dev_to_host_fis));
+
+	ts->buf_valid_size = sizeof(*resp);
+}
+EXPORT_SYMBOL_GPL(hisi_sas_sata_done);
+
 static struct hisi_hba *dev_to_hisi_hba(struct domain_device *device)
 {
 	return device->port->ha->lldd_ha;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index d9314c4..fdd7019 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -1683,20 +1683,6 @@ static int prep_ssp_v2_hw(struct hisi_hba *hisi_hba,
 	return 0;
 }
 
-static void sata_done_v2_hw(struct hisi_hba *hisi_hba, struct sas_task *task,
-			    struct hisi_sas_slot *slot)
-{
-	struct task_status_struct *ts = &task->task_status;
-	struct ata_task_resp *resp = (struct ata_task_resp *)ts->buf;
-	struct dev_to_host_fis *d2h = slot->status_buffer +
-				      sizeof(struct hisi_sas_err_record);
-
-	resp->frame_len = sizeof(struct dev_to_host_fis);
-	memcpy(&resp->ending_fis[0], d2h, sizeof(struct dev_to_host_fis));
-
-	ts->buf_valid_size = sizeof(*resp);
-}
-
 #define TRANS_TX_ERR	0
 #define TRANS_RX_ERR	1
 #define DMA_TX_ERR		2
@@ -2189,7 +2175,7 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba,
 			break;
 		}
 		}
-		sata_done_v2_hw(hisi_hba, task, slot);
+		hisi_sas_sata_done(task, slot);
 	}
 		break;
 	default:
@@ -2317,7 +2303,7 @@ static void slot_err_v2_hw(struct hisi_hba *hisi_hba,
 	case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP:
 	{
 		ts->stat = SAM_STAT_GOOD;
-		sata_done_v2_hw(hisi_hba, task, slot);
+		hisi_sas_sata_done(task, slot);
 		break;
 	}
 	default:
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v3 00/23] hisi_sas: hip08 support John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
  [PATCH v3 12/23] scsi: hisi_sas: add v3 hw PHY init John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
  [PATCH v3 08/23] scsi: hisi_sas: create hisi_sas_get_fw_info() John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
  [PATCH v3 19/23] scsi: hisi_sas: add v3 code to send internal abort command John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
  [PATCH v3 14/23] scsi: hisi_sas: add v3 cq interrupt handler John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
    Re: [PATCH v3 14/23] scsi: hisi_sas: add v3 cq interrupt handler Christoph Hellwig <hch@infradead.org> - 2017-06-01 07:50 +0200
      Re: [PATCH v3 14/23] scsi: hisi_sas: add v3 cq interrupt handler John Garry <john.garry@huawei.com> - 2017-06-01 12:50 +0200
  [PATCH v3 15/23] scsi: hisi_sas: add v3 code to send SSP frame John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
  [PATCH v3 10/23] scsi: hisi_sas: add initialisation for v3 pci-based controller John Garry <john.garry@huawei.com> - 2017-05-31 16:10 +0200
  [PATCH v3 11/23] scsi: hisi_sas: add v3 hw init John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 21/23] scsi: hisi_sas: Add v3 code to support ECC and AXI bus fatal error John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 02/23] scsi: hisi_sas: define hisi_sas_device.device_id as int John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 09/23] scsi: hisi_sas: add skeleton v3 hw driver John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 06/23] scsi: hisi_sas: relocate get_ncq_tag_v2_hw() John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 07/23] scsi: hisi_sas: add pci_dev in hisi_hba struct John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 03/23] scsi: hisi_sas: optimise the usage of hisi_hba.lock John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 01/23] scsi: hisi_sas: fix timeout check in hisi_sas_internal_task_abort() John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 16/23] scsi: hisi_sas: add v3 code to send SMP frame John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 04/23] scsi: hisi_sas: relocate get_ata_protocol() John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 23/23] scsi: hisi_sas: modify internal abort dev flow for v3 hw John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200
  [PATCH v3 05/23] scsi: hisi_sas: relocate sata_done_v2_hw() John Garry <john.garry@huawei.com> - 2017-05-31 16:20 +0200

csiph-web