diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-05-07 10:11:43 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:04:47 -0700 |
commit | e531381e2f8a68b8737c63c7bb890ad80b2470bd (patch) | |
tree | b3f4deb3286269fa62e5c2ff94338dab4743f2c9 /drivers/scsi/isci/port.c | |
parent | 4b33981ade7cf723f3f32809e34192376c9a10f8 (diff) | |
download | linux-e531381e2f8a68b8737c63c7bb890ad80b2470bd.tar.bz2 |
isci: unify port data structures
Make scic_sds_port a member of isci_port and merge their lifetimes which
means removing the port table from scic_sds_controller in favor of the
one at the isci_host level. Merge ihost->sas_ports into ihost->ports.
_
Reported-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/port.c')
-rw-r--r-- | drivers/scsi/isci/port.c | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c index 5e87fedb5676..35e2e517f671 100644 --- a/drivers/scsi/isci/port.c +++ b/drivers/scsi/isci/port.c @@ -70,29 +70,30 @@ #include "request.h" #include "core/scic_sds_controller.h" -static void isci_port_change_state( - struct isci_port *isci_port, - enum isci_status status); +static void isci_port_change_state(struct isci_port *iport, enum isci_status status) +{ + unsigned long flags; + dev_dbg(&iport->isci_host->pdev->dev, + "%s: iport = %p, state = 0x%x\n", + __func__, iport, status); + /* XXX pointless lock */ + spin_lock_irqsave(&iport->state_lock, flags); + iport->status = status; + spin_unlock_irqrestore(&iport->state_lock, flags); +} void isci_port_init(struct isci_port *iport, struct isci_host *ihost, int index) { - struct scic_sds_port *sci_port; - INIT_LIST_HEAD(&iport->remote_dev_list); INIT_LIST_HEAD(&iport->domain_dev_list); spin_lock_init(&iport->state_lock); init_completion(&iport->start_complete); iport->isci_host = ihost; isci_port_change_state(iport, isci_freed); - - sci_port = &ihost->sci.port_table[index]; - iport->sci_port_handle = sci_port; - sci_port->iport = iport; } - /** * isci_port_get_state() - This function gets the status of the port object. * @isci_port: This parameter points to the isci_port object @@ -105,21 +106,6 @@ enum isci_status isci_port_get_state( return isci_port->status; } -static void isci_port_change_state( - struct isci_port *isci_port, - enum isci_status status) -{ - unsigned long flags; - - dev_dbg(&isci_port->isci_host->pdev->dev, - "%s: isci_port = %p, state = 0x%x\n", - __func__, isci_port, status); - - spin_lock_irqsave(&isci_port->state_lock, flags); - isci_port->status = status; - spin_unlock_irqrestore(&isci_port->state_lock, flags); -} - void isci_port_bc_change_received(struct isci_host *ihost, struct scic_sds_port *sci_port, struct scic_sds_phy *sci_phy) @@ -140,7 +126,7 @@ void isci_port_link_up(struct isci_host *isci_host, unsigned long flags; struct scic_port_properties properties; struct isci_phy *isci_phy = sci_phy_to_iphy(phy); - struct isci_port *isci_port = port->iport; + struct isci_port *isci_port = sci_port_to_iport(port); unsigned long success = true; BUG_ON(isci_phy->isci_port != NULL); @@ -346,8 +332,7 @@ int isci_port_perform_hard_reset(struct isci_host *ihost, struct isci_port *ipor spin_lock_irqsave(&ihost->scic_lock, flags); #define ISCI_PORT_RESET_TIMEOUT SCIC_SDS_SIGNATURE_FIS_TIMEOUT - status = scic_port_hard_reset(iport->sci_port_handle, - ISCI_PORT_RESET_TIMEOUT); + status = scic_port_hard_reset(&iport->sci, ISCI_PORT_RESET_TIMEOUT); spin_unlock_irqrestore(&ihost->scic_lock, flags); |