[PATCH] scsi: Add helper functions to set target ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch adds 3 helper functions to set the initial target id, expander
id and port id numbers.

The ARC/HBA1000 product line  exposes RAID drives on bus number 0 and
sas transport HBA drives use bus 0 as well. We wanted to differentiate
between the RAID and HBA targets when the adapter in mixed mode (both RAID
and HBA are exposed). Since the number of RAID drives we support is
limited to 64 we wanted to block the first 64 targets and then add the
sas enabled HBA drives from target id 64.

Unfortunately the current sas transport implementation does not allow
changing of the next_target_id value (used by rphy to add drives), since
it is not exposed directly to the driver.

One way around this is to add helper functions to explicitly set the
next_target_id and others.

I still have to submit the sas transport aacraid support patches, but
I wanted to send this out to get comments and any other changes if
required.

Signed-off-by: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@xxxxxxxxxxxxx>
---
 0 files changed

diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 5006a656e16a..a6ef5520cb66 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -294,6 +294,31 @@ static void sas_bsg_remove(struct Scsi_Host *shost, struct sas_rphy *rphy)
 	bsg_unregister_queue(q);
 }
 
+void sas_set_initial_target_id(struct Scsi_Host *shost, u32 target_id)
+{
+	struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
+
+	sas_host->next_target_id = target_id;
+}
+EXPORT_SYMBOL(sas_set_initial_target_id);
+
+void sas_set_initial_expander_id(struct Scsi_Host *shost, u32 expander_id)
+{
+	struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
+
+	sas_host->next_expander_id = expander_id;
+}
+EXPORT_SYMBOL(sas_set_initial_expander_id);
+
+void sas_set_initial_port_id(struct Scsi_Host *shost, u32 port_id)
+{
+	struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
+
+	sas_host->next_port_id = port_id;
+}
+EXPORT_SYMBOL(sas_set_initial_port_id);
+
+
 /*
  * SAS host attributes
  */
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 73d870918939..6917eee7bc24 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -179,6 +179,9 @@ struct sas_function_template {
 	int (*smp_handler)(struct Scsi_Host *, struct sas_rphy *, struct request *);
 };
 
+void sas_set_initial_target_id(struct Scsi_Host *shost, u32 target_id);
+void sas_set_initial_expander_id(struct Scsi_Host *shost, u32 expander_id);
+void sas_set_initial_port_id(struct Scsi_Host *shost, u32 port_id);
 
 void sas_remove_children(struct device *);
 extern void sas_remove_host(struct Scsi_Host *);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux