Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254478
b: refs/heads/master
c: ed30c27
h: refs/heads/master
v: v3
  • Loading branch information
Edmund Nadolski authored and Dan Williams committed Jul 3, 2011
1 parent 89104d0 commit 307b9fe
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 79 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9286a1959ce7f3df3c1a8e33eb9b210078318dc8
refs/heads/master: ed30c275dd9fc5c603081144db5df3110f258534
5 changes: 0 additions & 5 deletions trunk/drivers/scsi/isci/core/scic_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,6 @@ enum sci_status scic_controller_complete_io(
struct scic_sds_remote_device *remote_device,
struct scic_sds_request *io_request);

enum sci_status scic_controller_get_port_handle(
struct scic_sds_controller *controller,
u8 port_index,
struct scic_sds_port **port_handle);

enum sci_status scic_controller_get_phy_handle(
struct scic_sds_controller *controller,
u8 phy_index,
Expand Down
30 changes: 0 additions & 30 deletions trunk/drivers/scsi/isci/core/scic_sds_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,36 +2154,6 @@ enum sci_task_status scic_controller_start_task(
return status;
}

/**
* scic_controller_get_port_handle() - This method simply provides the user
* with a unique handle for a given SAS/SATA core port index.
* @controller: This parameter represents the handle to the controller object
* from which to retrieve a port (SAS or SATA) handle.
* @port_index: This parameter specifies the port index in the controller for
* which to retrieve the port handle. 0 <= port_index < maximum number of
* phys.
* @port_handle: This parameter specifies the retrieved port handle to be
* provided to the caller.
*
* Indicate if the retrieval of the port handle was successful. SCI_SUCCESS
* This value is returned if the retrieval was successful.
* SCI_FAILURE_INVALID_PORT This value is returned if the supplied port id is
* not in the supported range.
*/
enum sci_status scic_controller_get_port_handle(
struct scic_sds_controller *scic,
u8 port_index,
struct scic_sds_port **port_handle)
{
if (port_index < scic->logical_port_entries) {
*port_handle = &scic->port_table[port_index];

return SCI_SUCCESS;
}

return SCI_FAILURE_INVALID_PORT;
}

/**
* scic_controller_get_phy_handle() - This method simply provides the user with
* a unique handle for a given SAS/SATA phy index/identifier.
Expand Down
31 changes: 12 additions & 19 deletions trunk/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,10 @@ static s32 sci_sas_address_compare(
* NULL if there is no matching port for the phy.
*/
static struct scic_sds_port *scic_sds_port_configuration_agent_find_port(
struct scic_sds_controller *controller,
struct scic_sds_controller *scic,
struct scic_sds_phy *phy)
{
u8 port_index;
struct scic_sds_port *port_handle;
u8 i;
struct sci_sas_address port_sas_address;
struct sci_sas_address port_attached_device_address;
struct sci_sas_address phy_sas_address;
Expand All @@ -136,24 +135,20 @@ static struct scic_sds_port *scic_sds_port_configuration_agent_find_port(
/*
* Since this phy can be a member of a wide port check to see if one or
* more phys match the sent and received SAS address as this phy in which
* case it should participate in the same port. */
* case it should participate in the same port.
*/
scic_sds_phy_get_sas_address(phy, &phy_sas_address);
scic_sds_phy_get_attached_sas_address(phy, &phy_attached_device_address);

for (port_index = 0; port_index < SCI_MAX_PORTS; port_index++) {
if (scic_controller_get_port_handle(controller, port_index, &port_handle) == SCI_SUCCESS) {
struct scic_sds_port *port = (struct scic_sds_port *)port_handle;
for (i = 0; i < scic->logical_port_entries; i++) {
struct scic_sds_port *port = &scic->port_table[i];

scic_sds_port_get_sas_address(port, &port_sas_address);
scic_sds_port_get_attached_sas_address(port, &port_attached_device_address);
scic_sds_port_get_sas_address(port, &port_sas_address);
scic_sds_port_get_attached_sas_address(port, &port_attached_device_address);

if (
(sci_sas_address_compare(port_sas_address, phy_sas_address) == 0)
&& (sci_sas_address_compare(port_attached_device_address, phy_attached_device_address) == 0)
) {
return port;
}
}
if ((sci_sas_address_compare(port_sas_address, phy_sas_address) == 0) &&
(sci_sas_address_compare(port_attached_device_address, phy_attached_device_address) == 0))
return port;
}

return NULL;
Expand Down Expand Up @@ -568,7 +563,6 @@ static void scic_sds_apc_agent_configure_ports(
u8 port_index;
enum sci_status status;
struct scic_sds_port *port;
struct scic_sds_port *port_handle;
enum SCIC_SDS_APC_ACTIVITY apc_activity = SCIC_SDS_APC_SKIP_PHY;

port = scic_sds_port_configuration_agent_find_port(controller, phy);
Expand All @@ -590,9 +584,8 @@ static void scic_sds_apc_agent_configure_ports(
port_index <= port_agent->phy_valid_port_range[phy->phy_index].max_index;
port_index++
) {
scic_controller_get_port_handle(controller, port_index, &port_handle);

port = (struct scic_sds_port *)port_handle;
port = &controller->port_table[port_index];

/* First we must make sure that this PHY can be added to this Port. */
if (scic_sds_port_is_valid_phy_assignment(port, phy->phy_index)) {
Expand Down
37 changes: 13 additions & 24 deletions trunk/drivers/scsi/isci/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,31 +76,20 @@ static void isci_port_change_state(



/**
* isci_port_init() - This function initializes the given isci_port object.
* @isci_port: This parameter specifies the port object to be initialized.
* @isci_host: This parameter specifies parent controller object for the port.
* @index: This parameter specifies which SCU port the isci_port associates
* with. Generally, SCU port 0 relates to isci_port 0, etc.
*
*/
void isci_port_init(
struct isci_port *isci_port,
struct isci_host *isci_host,
int index)
void isci_port_init(struct isci_port *iport, struct isci_host *ihost, int index)
{
struct scic_sds_port *scic_port;

INIT_LIST_HEAD(&isci_port->remote_dev_list);
INIT_LIST_HEAD(&isci_port->domain_dev_list);
spin_lock_init(&isci_port->state_lock);
init_completion(&isci_port->start_complete);
isci_port->isci_host = isci_host;
isci_port_change_state(isci_port, isci_freed);

(void)scic_controller_get_port_handle(&isci_host->sci, index, &scic_port);
isci_port->sci_port_handle = scic_port;
scic_port->iport = isci_port;
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;
}


Expand Down

0 comments on commit 307b9fe

Please sign in to comment.