Lines Matching refs:mr_sas_port

586  * @mr_sas_port: Internal Port object
592 struct mpi3mr_sas_port *mr_sas_port,
595 u64 sas_address = mr_sas_port->remote_identify.sas_address;
602 mr_sas_port->num_phys--;
603 mr_sas_port->phy_mask &= ~(1 << mr_sas_phy->phy_id);
604 if (mr_sas_port->lowest_phy == mr_sas_phy->phy_id)
605 mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
606 sas_port_delete_phy(mr_sas_port->port, mr_sas_phy->phy);
613 * @mr_sas_port: Internal Port object
619 struct mpi3mr_sas_port *mr_sas_port,
622 u64 sas_address = mr_sas_port->remote_identify.sas_address;
628 list_add_tail(&mr_sas_phy->port_siblings, &mr_sas_port->phy_list);
629 mr_sas_port->num_phys++;
630 mr_sas_port->phy_mask |= (1 << mr_sas_phy->phy_id);
631 if (mr_sas_phy->phy_id < mr_sas_port->lowest_phy)
632 mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
633 sas_port_add_phy(mr_sas_port->port, mr_sas_phy->phy);
652 struct mpi3mr_sas_port *mr_sas_port;
661 list_for_each_entry(mr_sas_port, &mr_sas_node->sas_port_list,
663 if (mr_sas_port->remote_identify.sas_address !=
666 if (mr_sas_port->hba_port != hba_port)
668 list_for_each_entry(srch_phy, &mr_sas_port->phy_list,
673 mpi3mr_add_sas_phy(mrioc, mr_sas_port, mr_sas_phy);
681 * @mr_sas_port: Internal Port object
686 struct mpi3mr_sas_port *mr_sas_port)
688 u64 sas_address = mr_sas_port->remote_identify.sas_address;
689 struct mpi3mr_hba_port *hba_port = mr_sas_port->hba_port;
691 mr_sas_port->remote_identify.device_type;
693 dev_info(&mr_sas_port->port->dev,
717 struct mpi3mr_sas_port *mr_sas_port, *next;
723 list_for_each_entry_safe(mr_sas_port, next, &mr_sas_node->sas_port_list,
725 list_for_each_entry(srch_phy, &mr_sas_port->phy_list,
729 if ((mr_sas_port->num_phys == 1) &&
731 mpi3mr_delete_sas_port(mrioc, mr_sas_port);
733 mpi3mr_delete_sas_phy(mrioc, mr_sas_port,
1308 struct mpi3mr_sas_port *mr_sas_port;
1322 mr_sas_port = kzalloc(sizeof(struct mpi3mr_sas_port), GFP_KERNEL);
1323 if (!mr_sas_port)
1326 INIT_LIST_HEAD(&mr_sas_port->port_list);
1327 INIT_LIST_HEAD(&mr_sas_port->phy_list);
1340 &mr_sas_port->remote_identify))) {
1346 if (mr_sas_port->remote_identify.device_type == SAS_PHY_UNUSED) {
1352 mr_sas_port->hba_port = hba_port;
1354 mr_sas_port->remote_identify.sas_address, hba_port);
1356 if (mr_sas_node->num_phys > sizeof(mr_sas_port->phy_mask) * 8)
1362 mr_sas_port->remote_identify.sas_address) ||
1366 if (i > sizeof(mr_sas_port->phy_mask) * 8) {
1368 i, sizeof(mr_sas_port->phy_mask) * 8);
1372 &mr_sas_port->phy_list);
1373 mr_sas_port->num_phys++;
1374 mr_sas_port->phy_mask |= (1 << i);
1377 if (!mr_sas_port->num_phys) {
1383 mr_sas_port->lowest_phy = ffs(mr_sas_port->phy_mask) - 1;
1385 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) {
1387 mr_sas_port->remote_identify.sas_address,
1388 mr_sas_port->hba_port);
1411 list_for_each_entry(mr_sas_phy, &mr_sas_port->phy_list,
1417 mr_sas_port->remote_identify.sas_address,
1424 mr_sas_port->port = port;
1425 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) {
1430 mr_sas_port->remote_identify.device_type);
1432 rphy->identify = mr_sas_port->remote_identify;
1441 if (mr_sas_port->remote_identify.device_type == SAS_END_DEVICE) {
1450 mr_sas_port->remote_identify.sas_address);
1452 mr_sas_port->rphy = rphy;
1454 list_add_tail(&mr_sas_port->port_list, &mr_sas_node->sas_port_list);
1464 if (mr_sas_port->remote_identify.device_type ==
1466 mr_sas_port->remote_identify.device_type ==
1469 mr_sas_port->remote_identify.sas_address,
1472 return mr_sas_port;
1475 list_for_each_entry_safe(mr_sas_phy, next, &mr_sas_port->phy_list,
1478 kfree(mr_sas_port);
1499 struct mpi3mr_sas_port *mr_sas_port, *next;
1515 list_for_each_entry_safe(mr_sas_port, next, &mr_sas_node->sas_port_list,
1517 if (mr_sas_port->remote_identify.sas_address != sas_address)
1519 if (mr_sas_port->hba_port != hba_port)
1522 list_del(&mr_sas_port->port_list);
1559 &mr_sas_port->phy_list, port_siblings) {
1562 dev_info(&mr_sas_port->port->dev,
1565 mr_sas_port->remote_identify.sas_address,
1569 sas_port_delete_phy(mr_sas_port->port,
1574 sas_port_delete(mr_sas_port->port);
1584 kfree(mr_sas_port);
1609 * @mr_sas_port: sas_port objects which needs to be updated
1619 struct mpi3mr_sas_port *mr_sas_port)
1627 mr_sas_port->marked_responding = 1;
1629 dev_info(&mr_sas_port->port->dev,
1631 mr_sas_port->remote_identify.sas_address,
1632 mr_sas_port->hba_port->port_id, mr_sas_port->phy_mask,
1635 mr_sas_port->hba_port->port_id = h_port->iounit_port_id;
1636 mr_sas_port->hba_port->flags &= ~MPI3MR_HBA_PORT_FLAG_DIRTY;
1639 phy_mask_xor = mr_sas_port->phy_mask ^ h_port->phy_mask;
1641 phys_to_be_removed = mr_sas_port->phy_mask & phy_mask_xor;
1644 * Register these new phys to current mr_sas_port's port.
1655 mr_sas_port->remote_identify.sas_address,
1656 mr_sas_port->hba_port);
1659 /* Delete the phys which are not part of current mr_sas_port's port. */
1688 struct mpi3mr_sas_port *mr_sas_port;
1754 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list,
1758 mr_sas_port->hba_port->port_id,
1759 mr_sas_port->remote_identify.sas_address,
1760 mr_sas_port->phy_mask, mr_sas_port->lowest_phy);
1762 mr_sas_port = NULL;
1773 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list,
1775 mr_sas_port->marked_responding = 0;
1776 mr_sas_port->hba_port->flags |= MPI3MR_HBA_PORT_FLAG_DIRTY;
1781 mr_sas_port = NULL;
1782 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list,
1784 if (mr_sas_port->marked_responding)
1786 if (h_port[i].sas_address != mr_sas_port->remote_identify.sas_address)
1788 if (h_port[i].lowest_phy == mr_sas_port->lowest_phy) {
1789 mpi3mr_update_mr_sas_port(mrioc, &h_port[i], mr_sas_port);
1799 mr_sas_port = NULL;
1800 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list,
1802 if (mr_sas_port->marked_responding)
1804 if (h_port[i].sas_address != mr_sas_port->remote_identify.sas_address)
1806 if (h_port[i].phy_mask & mr_sas_port->phy_mask) {
1807 mpi3mr_update_mr_sas_port(mrioc, &h_port[i], mr_sas_port);
1817 mr_sas_port = NULL;
1818 list_for_each_entry(mr_sas_port, &mrioc->sas_hba.sas_port_list,
1820 if (mr_sas_port->marked_responding)
1822 if (h_port[i].sas_address != mr_sas_port->remote_identify.sas_address)
1824 mpi3mr_update_mr_sas_port(mrioc, &h_port[i], mr_sas_port);
1973 struct mpi3mr_sas_port *mr_sas_port = NULL;
2099 mr_sas_port = mpi3mr_sas_port_add(mrioc, handle, sas_address_parent,
2101 if (!mr_sas_port) {
2107 sas_expander->parent_dev = &mr_sas_port->rphy->dev;
2108 sas_expander->rphy = mr_sas_port->rphy;
2156 if (mr_sas_port)
2180 struct mpi3mr_sas_port *mr_sas_port, *next;
2185 list_for_each_entry_safe(mr_sas_port, next,
2189 if (mr_sas_port->remote_identify.device_type ==
2192 mr_sas_port->remote_identify.sas_address,
2193 mr_sas_port->hba_port);
2194 else if (mr_sas_port->remote_identify.device_type ==
2196 mr_sas_port->remote_identify.device_type ==
2199 mr_sas_port->remote_identify.sas_address,
2200 mr_sas_port->hba_port);