Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32745
b: refs/heads/master
c: a0e1b6e
h: refs/heads/master
i:
  32743: 15ebb00
v: v3
  • Loading branch information
James Bottomley authored and James Bottomley committed Jul 12, 2006
1 parent b9a30e9 commit 223e062
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 631c228cd09bd5b93090fa60bd9803ec14aa0586
refs/heads/master: a0e1b6ef3b851fe6f1dcc259432e83de79ce5e7f
20 changes: 20 additions & 0 deletions trunk/drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
*/
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/scsi/scsi_transport_sas.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ struct sas_port {

int port_identifier;
int num_phys;
/* port flags */
unsigned int is_backlink:1;

/* the other end of the link */
struct sas_rphy *rphy;
Expand Down Expand Up @@ -175,6 +177,7 @@ void sas_port_free(struct sas_port *);
void sas_port_delete(struct sas_port *);
void sas_port_add_phy(struct sas_port *, struct sas_phy *);
void sas_port_delete_phy(struct sas_port *, struct sas_phy *);
void sas_port_mark_backlink(struct sas_port *);
int scsi_is_sas_port(const struct device *);

extern struct scsi_transport_template *
Expand Down

0 comments on commit 223e062

Please sign in to comment.