pqi_sas_port
struct pqi_sas_port *sas_port;
struct pqi_sas_port *parent_port;
switch (pqi_sas_port->device->device_type) {
static struct sas_rphy *pqi_sas_rphy_alloc(struct pqi_sas_port *pqi_sas_port)
if (pqi_sas_port->device && pqi_sas_port->device->is_expander_smp_device)
return sas_expander_alloc(pqi_sas_port->port,
return sas_end_device_alloc(pqi_sas_port->port);
static struct pqi_sas_port *pqi_alloc_sas_port(
struct pqi_sas_port *pqi_sas_port;
pqi_sas_port = kzalloc_obj(*pqi_sas_port);
if (!pqi_sas_port)
INIT_LIST_HEAD(&pqi_sas_port->phy_list_head);
pqi_sas_port->parent_node = pqi_sas_node;
pqi_sas_port->port = port;
pqi_sas_port->sas_address = sas_address;
pqi_sas_port->device = device;
list_add_tail(&pqi_sas_port->port_list_entry,
return pqi_sas_port;
kfree(pqi_sas_port);
static void pqi_free_sas_port(struct pqi_sas_port *pqi_sas_port)
&pqi_sas_port->phy_list_head, phy_list_entry)
sas_port_delete(pqi_sas_port->port);
list_del(&pqi_sas_port->port_list_entry);
kfree(pqi_sas_port);
struct pqi_sas_port *pqi_sas_port;
struct pqi_sas_port *next;
static struct pqi_sas_phy *pqi_alloc_sas_phy(struct pqi_sas_port *pqi_sas_port)
list_for_each_entry_safe(pqi_sas_port, next,
pqi_free_sas_port(pqi_sas_port);
struct pqi_sas_port *pqi_sas_port;
pqi_sas_port = pqi_alloc_sas_port(pqi_sas_node,
if (!pqi_sas_port) {
pqi_sas_phy = pqi_alloc_sas_phy(pqi_sas_port);
pqi_free_sas_port(pqi_sas_port);
struct pqi_sas_port *pqi_sas_port;
pqi_sas_port = pqi_alloc_sas_port(pqi_sas_node,
if (!pqi_sas_port)
rphy = pqi_sas_rphy_alloc(pqi_sas_port);
phy = sas_phy_alloc(pqi_sas_port->parent_node->parent_dev,
pqi_sas_port->rphy = rphy;
device->sas_port = pqi_sas_port;
rc = pqi_sas_port_add_rphy(pqi_sas_port, rphy);
pqi_sas_port->next_phy_index);
pqi_free_sas_port(pqi_sas_port);
pqi_sas_port->next_phy_index++;
pqi_sas_phy->parent_port = pqi_sas_port;
struct pqi_sas_port *pqi_sas_port;
pqi_sas_port = pqi_sas_phy->parent_port;
identify->sas_address = pqi_sas_port->sas_address;
sas_port_add_phy(pqi_sas_port->port, pqi_sas_phy->phy);
&pqi_sas_port->phy_list_head);
static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port,
identify->sas_address = pqi_sas_port->sas_address;
identify->phy_identifier = pqi_sas_port->device->phy_id;