[SCSI] scsi_transport_sas: add expander backlink

This patch adds the ability to add a backlink to a particular port.  The
idea is to represent properly ports on expanders that are used
specifically for linking to the parent device in the topology.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
James Bottomley
2006-07-09 12:38:19 -05:00
committed by James Bottomley
parent 631c228cd0
commit a0e1b6ef3b
2 changed files with 23 additions and 0 deletions

View File

@@ -692,6 +692,13 @@ void sas_port_delete(struct sas_port *port)
}
mutex_unlock(&port->phy_list_mutex);
if (port->is_backlink) {
struct device *parent = port->dev.parent;
sysfs_remove_link(&port->dev.kobj, parent->bus_id);
port->is_backlink = 0;
}
transport_remove_device(dev);
device_del(dev);
transport_destroy_device(dev);
@@ -767,6 +774,19 @@ void sas_port_delete_phy(struct sas_port *port, struct sas_phy *phy)
}
EXPORT_SYMBOL(sas_port_delete_phy);
void sas_port_mark_backlink(struct sas_port *port)
{
struct device *parent = port->dev.parent->parent->parent;
if (port->is_backlink)
return;
port->is_backlink = 1;
sysfs_create_link(&port->dev.kobj, &parent->kobj,
parent->bus_id);
}
EXPORT_SYMBOL(sas_port_mark_backlink);
/*
* SAS remote PHY attributes.
*/