public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@us.ibm.com>
To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: alexisb@us.ibm.com
Subject: [PATCH 15/15] sas_ata: Make this a module separate from libsas
Date: Fri, 17 Nov 2006 13:08:33 -0800	[thread overview]
Message-ID: <20061117210833.17052.41537.stgit@localhost.localdomain> (raw)
In-Reply-To: <20061117210737.17052.67041.stgit@localhost.localdomain>


Break out sas_ata as a free-standing module that provides a SATA
Translation Layer (SATL) for libsas.  This patch requires the libsas
SATL registration patch; the changes to sas_ata itself are rather
minor.

Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
---

 drivers/scsi/libsas/Makefile  |    5 +++--
 drivers/scsi/libsas/sas_ata.c |   34 ++++++++++++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/libsas/Makefile b/drivers/scsi/libsas/Makefile
index 6383eb5..5e95902 100644
--- a/drivers/scsi/libsas/Makefile
+++ b/drivers/scsi/libsas/Makefile
@@ -33,5 +33,6 @@ libsas-y +=  sas_init.o     \
 		sas_dump.o     \
 		sas_discover.o \
 		sas_expander.o \
-		sas_scsi_host.o \
-		sas_ata.o
+		sas_scsi_host.o
+
+obj-$(CONFIG_SCSI_SAS_SATL) += sas_ata.o
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 7338775..bfaee88 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -398,8 +398,8 @@ static struct ata_port_info sata_port_in
 	.port_ops = &sas_sata_ops
 };
 
-int sas_ata_init_host_and_port(struct domain_device *found_dev,
-			       struct scsi_target *starget)
+static int sas_ata_init_host_and_port(struct domain_device *found_dev,
+				      struct scsi_target *starget)
 {
 	struct Scsi_Host *shost = dev_to_shost(&starget->dev);
 	struct sas_ha_struct *ha = SHOST_TO_SAS_HA(shost);
@@ -424,3 +424,33 @@ int sas_ata_init_host_and_port(struct do
 
 	return 0;
 }
+
+/* Module initialization */
+static struct satl_operations sas_ata_ops = {
+	.owner			= THIS_MODULE,
+	.init_target		= sas_ata_init_host_and_port,
+	.queuecommand		= ata_sas_queuecmd,
+	.ioctl			= ata_scsi_ioctl,
+	.configure_port		= ata_sas_slave_configure,
+	.deactivate_port	= ata_port_disable,
+	.destroy_port		= ata_sas_port_destroy,
+	.init_port		= ata_sas_port_init
+};
+
+static int __init sas_ata_init(void)
+{
+	return sas_register_satl(&sas_ata_ops);
+}
+
+static void __exit sas_ata_exit(void)
+{
+	sas_unregister_satl(&sas_ata_ops);
+}
+
+module_init(sas_ata_init);
+module_exit(sas_ata_exit);
+
+MODULE_AUTHOR("Darrick Wong <djwong@us.ibm.com>");
+MODULE_DESCRIPTION("libata SATL for SAS");
+MODULE_LICENSE("GPL v2");
+MODULE_VERSION("1.0");

  parent reply	other threads:[~2006-11-17 21:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-17 21:07 [PATCH 00/15] Roll-up of my libsas, aic94xx and sas_ata patches Darrick J. Wong
2006-11-17 21:07 ` [PATCH 01/15] aic94xx: Handle REQ_DEVICE_RESET Darrick J. Wong
2006-11-17 21:07 ` [PATCH 02/15] libsas: Clean up rphys/port dev list after a discovery error Darrick J. Wong
2006-11-17 21:07 ` [PATCH 03/15] aic94xx: Delete ascb timers when freeing queues Darrick J. Wong
2006-11-17 21:07 ` [PATCH 04/15] libsas: Don't give scsi_cmnds to the EH if they never made it to the SAS LLDD or have already returned Darrick J. Wong
2006-11-25  6:58   ` [PATCH v2] " Darrick J. Wong
2006-11-25 19:02     ` James Bottomley
2006-11-17 21:07 ` [PATCH 05/15] libsas: Add a sysfs knob to enable/disable a phy Darrick J. Wong
2006-11-17 21:07 ` [PATCH 06/15] sas_ata: Require CONFIG_ATA in Kconfig Darrick J. Wong
2006-11-17 21:08 ` [PATCH 07/15] sas_ata: Satisfy libata qc function locking requirements Darrick J. Wong
2006-11-17 21:08 ` [PATCH 08/15] sas_ata: sas_ata_qc_issue should return AC_ERR_* Darrick J. Wong
2006-11-17 21:08 ` [PATCH 09/15] sas_ata: ata_post_internal should abort the sas_task Darrick J. Wong
2006-11-17 21:08 ` [PATCH 10/15] aic94xx: Don't call pci_map_sg for already-mapped scatterlists Darrick J. Wong
2006-11-17 21:08 ` [PATCH 11/15] sas_ata: Don't copy aic94xx's sactive to ata_port Darrick J. Wong
2006-11-17 21:08 ` [PATCH 12/15] sas_ata: Implement sata phy control Darrick J. Wong
2006-11-17 21:08 ` [PATCH 13/15] sas_ata: Implement a libata error handler Darrick J. Wong
2006-11-17 21:08 ` [PATCH 14/15] libsas: Provide a generic SATL registration function Darrick J. Wong
2006-11-17 21:08 ` Darrick J. Wong [this message]
2006-11-21  1:16 ` [PATCH 00/15] Roll-up of my libsas, aic94xx and sas_ata patches Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061117210833.17052.41537.stgit@localhost.localdomain \
    --to=djwong@us.ibm.com \
    --cc=alexisb@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox