[SCSI] scsi_transport_sas: add unindexed ports

Some SAS HBAs don't want to go to the trouble of tracking port numbers,
so they'd simply like to say "add this port and give it a number".
This is especially beneficial from the hotplug point of view, since
tracking ports and the available number space can be a real pain.

The current implementation uses an incrementing number per expander to
add the port on.  However, since there can never be more ports than
there are phys, a later implementation will try to be more intelligent
about this.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
James Bottomley
2006-07-02 11:10:18 -05:00
committed by James Bottomley
parent 24f6d2fd31
commit c9fefeb264
2 changed files with 38 additions and 2 deletions

View File

@@ -106,6 +106,7 @@ struct sas_end_device {
struct sas_expander_device {
int level;
int next_port_id;
#define SAS_EXPANDER_VENDOR_ID_LEN 8
char vendor_id[SAS_EXPANDER_VENDOR_ID_LEN+1];
@@ -127,7 +128,7 @@ struct sas_expander_device {
struct sas_port {
struct device dev;
u8 port_identifier;
int port_identifier;
int num_phys;
/* the other end of the link */
@@ -168,6 +169,7 @@ extern void sas_rphy_delete(struct sas_rphy *);
extern int scsi_is_sas_rphy(const struct device *);
struct sas_port *sas_port_alloc(struct device *, int);
struct sas_port *sas_port_alloc_num(struct device *);
int sas_port_add(struct sas_port *);
void sas_port_free(struct sas_port *);
void sas_port_delete(struct sas_port *);