Lines Matching refs:mr_sas_port
594 struct mpi3mr_sas_port *mr_sas_port, in mpi3mr_delete_sas_phy() argument
597 u64 sas_address = mr_sas_port->remote_identify.sas_address; in mpi3mr_delete_sas_phy()
604 mr_sas_port->num_phys--; in mpi3mr_delete_sas_phy()
605 mr_sas_port->phy_mask &= ~(1 << mr_sas_phy->phy_id); in mpi3mr_delete_sas_phy()
606 if (mr_sas_port->lowest_phy == mr_sas_phy->phy_id) in mpi3mr_delete_sas_phy()
607 mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1; in mpi3mr_delete_sas_phy()
608 sas_port_delete_phy(mr_sas_port->port, mr_sas_phy->phy); in mpi3mr_delete_sas_phy()
621 struct mpi3mr_sas_port *mr_sas_port, in mpi3mr_add_sas_phy() argument
624 u64 sas_address = mr_sas_port->remote_identify.sas_address; in mpi3mr_add_sas_phy()
630 list_add_tail(&mr_sas_phy->port_siblings, &mr_sas_port->phy_list); in mpi3mr_add_sas_phy()
631 mr_sas_port->num_phys++; in mpi3mr_add_sas_phy()
632 mr_sas_port->phy_mask |= (1 << mr_sas_phy->phy_id); in mpi3mr_add_sas_phy()
633 if (mr_sas_phy->phy_id < mr_sas_port->lowest_phy) in mpi3mr_add_sas_phy()
634 mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1; in mpi3mr_add_sas_phy()
635 sas_port_add_phy(mr_sas_port->port, mr_sas_phy->phy); in mpi3mr_add_sas_phy()
654 struct mpi3mr_sas_port *mr_sas_port; in mpi3mr_add_phy_to_an_existing_port() local
663 list_for_each_entry(mr_sas_port, &mr_sas_node->sas_port_list, in mpi3mr_add_phy_to_an_existing_port()
665 if (mr_sas_port->remote_identify.sas_address != in mpi3mr_add_phy_to_an_existing_port()
668 if (mr_sas_port->hba_port != hba_port) in mpi3mr_add_phy_to_an_existing_port()
670 list_for_each_entry(srch_phy, &mr_sas_port->phy_list, in mpi3mr_add_phy_to_an_existing_port()
675 mpi3mr_add_sas_phy(mrioc, mr_sas_port, mr_sas_phy); in mpi3mr_add_phy_to_an_existing_port()
688 struct mpi3mr_sas_port *mr_sas_port) in mpi3mr_delete_sas_port() argument
690 u64 sas_address = mr_sas_port->remote_identify.sas_address; in mpi3mr_delete_sas_port()
691 struct mpi3mr_hba_port *hba_port = mr_sas_port->hba_port; in mpi3mr_delete_sas_port()
693 mr_sas_port->remote_identify.device_type; in mpi3mr_delete_sas_port()
695 dev_info(&mr_sas_port->port->dev, in mpi3mr_delete_sas_port()
719 struct mpi3mr_sas_port *mr_sas_port, *next; in mpi3mr_del_phy_from_an_existing_port() local
725 list_for_each_entry_safe(mr_sas_port, next, &mr_sas_node->sas_port_list, in mpi3mr_del_phy_from_an_existing_port()
727 list_for_each_entry(srch_phy, &mr_sas_port->phy_list, in mpi3mr_del_phy_from_an_existing_port()
731 if ((mr_sas_port->num_phys == 1) && in mpi3mr_del_phy_from_an_existing_port()
733 mpi3mr_delete_sas_port(mrioc, mr_sas_port); in mpi3mr_del_phy_from_an_existing_port()
735 mpi3mr_delete_sas_phy(mrioc, mr_sas_port, in mpi3mr_del_phy_from_an_existing_port()
1310 struct mpi3mr_sas_port *mr_sas_port; in mpi3mr_sas_port_add() local
1324 mr_sas_port = kzalloc(sizeof(struct mpi3mr_sas_port), GFP_KERNEL); in mpi3mr_sas_port_add()
1325 if (!mr_sas_port) in mpi3mr_sas_port_add()
1328 INIT_LIST_HEAD(&mr_sas_port->port_list); in mpi3mr_sas_port_add()
1329 INIT_LIST_HEAD(&mr_sas_port->phy_list); in mpi3mr_sas_port_add()
1342 &mr_sas_port->remote_identify))) { in mpi3mr_sas_port_add()
1348 if (mr_sas_port->remote_identify.device_type == SAS_PHY_UNUSED) { in mpi3mr_sas_port_add()
1354 mr_sas_port->hba_port = hba_port; in mpi3mr_sas_port_add()
1356 mr_sas_port->remote_identify.sas_address, hba_port); in mpi3mr_sas_port_add()
1360 mr_sas_port->remote_identify.sas_address) || in mpi3mr_sas_port_add()
1364 &mr_sas_port->phy_list); in mpi3mr_sas_port_add()
1365 mr_sas_port->num_phys++; in mpi3mr_sas_port_add()
1366 mr_sas_port->phy_mask |= (1 << i); in mpi3mr_sas_port_add()
1369 if (!mr_sas_port->num_phys) { in mpi3mr_sas_port_add()
1375 mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1; in mpi3mr_sas_port_add()
1377 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) { in mpi3mr_sas_port_add()
1379 mr_sas_port->remote_identify.sas_address, in mpi3mr_sas_port_add()
1380 mr_sas_port->hba_port); in mpi3mr_sas_port_add()
1403 list_for_each_entry(mr_sas_phy, &mr_sas_port->phy_list, in mpi3mr_sas_port_add()
1409 mr_sas_port->remote_identify.sas_address, in mpi3mr_sas_port_add()
1416 mr_sas_port->port = port; in mpi3mr_sas_port_add()
1417 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) { in mpi3mr_sas_port_add()
1422 mr_sas_port->remote_identify.device_type); in mpi3mr_sas_port_add()
1424 rphy->identify = mr_sas_port->remote_identify; in mpi3mr_sas_port_add()
1433 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) { in mpi3mr_sas_port_add()
1442 mr_sas_port->remote_identify.sas_address); in mpi3mr_sas_port_add()
1444 mr_sas_port->rphy = rphy; in mpi3mr_sas_port_add()
1446 list_add_tail(&mr_sas_port->port_list, &mr_sas_node->sas_port_list); in mpi3mr_sas_port_add()
1456 if (mr_sas_port->remote_identify.device_type == in mpi3mr_sas_port_add()
1458 mr_sas_port->remote_identify.device_type == in mpi3mr_sas_port_add()
1461 mr_sas_port->remote_identify.sas_address, in mpi3mr_sas_port_add()
1464 return mr_sas_port; in mpi3mr_sas_port_add()
1467 list_for_each_entry_safe(mr_sas_phy, next, &mr_sas_port->phy_list, in mpi3mr_sas_port_add()
1470 kfree(mr_sas_port); in mpi3mr_sas_port_add()
1491 struct mpi3mr_sas_port *mr_sas_port, *next; in mpi3mr_sas_port_remove() local
1507 list_for_each_entry_safe(mr_sas_port, next, &mr_sas_node->sas_port_list, in mpi3mr_sas_port_remove()
1509 if (mr_sas_port->remote_identify.sas_address != sas_address) in mpi3mr_sas_port_remove()
1511 if (mr_sas_port->hba_port != hba_port) in mpi3mr_sas_port_remove()
1514 list_del(&mr_sas_port->port_list); in mpi3mr_sas_port_remove()
1551 &mr_sas_port->phy_list, port_siblings) { in mpi3mr_sas_port_remove()
1554 dev_info(&mr_sas_port->port->dev, in mpi3mr_sas_port_remove()
1557 mr_sas_port->remote_identify.sas_address, in mpi3mr_sas_port_remove()
1561 sas_port_delete_phy(mr_sas_port->port, in mpi3mr_sas_port_remove()
1566 sas_port_delete(mr_sas_port->port); in mpi3mr_sas_port_remove()
1576 kfree(mr_sas_port); in mpi3mr_sas_port_remove()
1611 struct mpi3mr_sas_port *mr_sas_port) in mpi3mr_update_mr_sas_port() argument
1619 mr_sas_port->marked_responding = 1; in mpi3mr_update_mr_sas_port()
1621 dev_info(&mr_sas_port->port->dev, in mpi3mr_update_mr_sas_port()
1623 mr_sas_port->remote_identify.sas_address, in mpi3mr_update_mr_sas_port()
1624 mr_sas_port->hba_port->port_id, mr_sas_port->phy_mask, in mpi3mr_update_mr_sas_port()
1627 mr_sas_port->hba_port->port_id = h_port->iounit_port_id; in mpi3mr_update_mr_sas_port()
1628 mr_sas_port->hba_port->flags &= ~MPI3MR_HBA_PORT_FLAG_DIRTY; in mpi3mr_update_mr_sas_port()
1631 phy_mask_xor = mr_sas_port->phy_mask ^ h_port->phy_mask; in mpi3mr_update_mr_sas_port()
1633 phys_to_be_removed = mr_sas_port->phy_mask & phy_mask_xor; in mpi3mr_update_mr_sas_port()
1647 mr_sas_port->remote_identify.sas_address, in mpi3mr_update_mr_sas_port()
1648 mr_sas_port->hba_port); in mpi3mr_update_mr_sas_port()
1680 struct mpi3mr_sas_port *mr_sas_port; in mpi3mr_refresh_sas_ports() local
1742 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list, in mpi3mr_refresh_sas_ports()
1746 mr_sas_port->hba_port->port_id, in mpi3mr_refresh_sas_ports()
1747 mr_sas_port->remote_identify.sas_address, in mpi3mr_refresh_sas_ports()
1748 mr_sas_port->phy_mask, mr_sas_port->lowest_phy); in mpi3mr_refresh_sas_ports()
1750 mr_sas_port = NULL; in mpi3mr_refresh_sas_ports()
1761 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list, in mpi3mr_refresh_sas_ports()
1763 mr_sas_port->marked_responding = 0; in mpi3mr_refresh_sas_ports()
1764 mr_sas_port->hba_port->flags |= MPI3MR_HBA_PORT_FLAG_DIRTY; in mpi3mr_refresh_sas_ports()
1769 mr_sas_port = NULL; in mpi3mr_refresh_sas_ports()
1770 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list, in mpi3mr_refresh_sas_ports()
1772 if (mr_sas_port->marked_responding) in mpi3mr_refresh_sas_ports()
1774 if (h_port[i].sas_address != mr_sas_port->remote_identify.sas_address) in mpi3mr_refresh_sas_ports()
1776 if (h_port[i].lowest_phy == mr_sas_port->lowest_phy) { in mpi3mr_refresh_sas_ports()
1777 mpi3mr_update_mr_sas_port(mrioc, &h_port[i], mr_sas_port); in mpi3mr_refresh_sas_ports()
1787 mr_sas_port = NULL; in mpi3mr_refresh_sas_ports()
1788 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list, in mpi3mr_refresh_sas_ports()
1790 if (mr_sas_port->marked_responding) in mpi3mr_refresh_sas_ports()
1792 if (h_port[i].sas_address != mr_sas_port->remote_identify.sas_address) in mpi3mr_refresh_sas_ports()
1794 if (h_port[i].phy_mask & mr_sas_port->phy_mask) { in mpi3mr_refresh_sas_ports()
1795 mpi3mr_update_mr_sas_port(mrioc, &h_port[i], mr_sas_port); in mpi3mr_refresh_sas_ports()
1805 mr_sas_port = NULL; in mpi3mr_refresh_sas_ports()
1806 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list, in mpi3mr_refresh_sas_ports()
1808 if (mr_sas_port->marked_responding) in mpi3mr_refresh_sas_ports()
1810 if (h_port[i].sas_address != mr_sas_port->remote_identify.sas_address) in mpi3mr_refresh_sas_ports()
1812 mpi3mr_update_mr_sas_port(mrioc, &h_port[i], mr_sas_port); in mpi3mr_refresh_sas_ports()
1960 struct mpi3mr_sas_port *mr_sas_port = NULL; in mpi3mr_expander_add() local
2086 mr_sas_port = mpi3mr_sas_port_add(mrioc, handle, sas_address_parent, in mpi3mr_expander_add()
2088 if (!mr_sas_port) { in mpi3mr_expander_add()
2094 sas_expander->parent_dev = &mr_sas_port->rphy->dev; in mpi3mr_expander_add()
2095 sas_expander->rphy = mr_sas_port->rphy; in mpi3mr_expander_add()
2143 if (mr_sas_port) in mpi3mr_expander_add()
2167 struct mpi3mr_sas_port *mr_sas_port, *next; in mpi3mr_expander_node_remove() local
2172 list_for_each_entry_safe(mr_sas_port, next, in mpi3mr_expander_node_remove()
2176 if (mr_sas_port->remote_identify.device_type == in mpi3mr_expander_node_remove()
2179 mr_sas_port->remote_identify.sas_address, in mpi3mr_expander_node_remove()
2180 mr_sas_port->hba_port); in mpi3mr_expander_node_remove()
2181 else if (mr_sas_port->remote_identify.device_type == in mpi3mr_expander_node_remove()
2183 mr_sas_port->remote_identify.device_type == in mpi3mr_expander_node_remove()
2186 mr_sas_port->remote_identify.sas_address, in mpi3mr_expander_node_remove()
2187 mr_sas_port->hba_port); in mpi3mr_expander_node_remove()