diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2006-07-09 13:38:19 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-07-12 09:03:20 -0400 |
commit | a0e1b6ef3b851fe6f1dcc259432e83de79ce5e7f (patch) | |
tree | 4e62bf64d66e2a07cdad6480441a2a443246e3cb /drivers/scsi/scsi_transport_sas.c | |
parent | 631c228cd09bd5b93090fa60bd9803ec14aa0586 (diff) |
[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>
Diffstat (limited to 'drivers/scsi/scsi_transport_sas.c')
-rw-r--r-- | drivers/scsi/scsi_transport_sas.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 9bb4e37a1a61..7871bc25fafb 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c | |||
@@ -692,6 +692,13 @@ void sas_port_delete(struct sas_port *port) | |||
692 | } | 692 | } |
693 | mutex_unlock(&port->phy_list_mutex); | 693 | mutex_unlock(&port->phy_list_mutex); |
694 | 694 | ||
695 | if (port->is_backlink) { | ||
696 | struct device *parent = port->dev.parent; | ||
697 | |||
698 | sysfs_remove_link(&port->dev.kobj, parent->bus_id); | ||
699 | port->is_backlink = 0; | ||
700 | } | ||
701 | |||
695 | transport_remove_device(dev); | 702 | transport_remove_device(dev); |
696 | device_del(dev); | 703 | device_del(dev); |
697 | transport_destroy_device(dev); | 704 | transport_destroy_device(dev); |
@@ -767,6 +774,19 @@ void sas_port_delete_phy(struct sas_port *port, struct sas_phy *phy) | |||
767 | } | 774 | } |
768 | EXPORT_SYMBOL(sas_port_delete_phy); | 775 | EXPORT_SYMBOL(sas_port_delete_phy); |
769 | 776 | ||
777 | void sas_port_mark_backlink(struct sas_port *port) | ||
778 | { | ||
779 | struct device *parent = port->dev.parent->parent->parent; | ||
780 | |||
781 | if (port->is_backlink) | ||
782 | return; | ||
783 | port->is_backlink = 1; | ||
784 | sysfs_create_link(&port->dev.kobj, &parent->kobj, | ||
785 | parent->bus_id); | ||
786 | |||
787 | } | ||
788 | EXPORT_SYMBOL(sas_port_mark_backlink); | ||
789 | |||
770 | /* | 790 | /* |
771 | * SAS remote PHY attributes. | 791 | * SAS remote PHY attributes. |
772 | */ | 792 | */ |