Lines Matching refs:port

73 		to_sas_internal(dev->port->ha->core.shost->transportt);
205 struct sas_ha_struct *ha = dev->port->ha;
337 set_bit(DISCE_REVALIDATE_DOMAIN, &dev->port->disc.pending);
353 if (!ex_phy->port)
356 rphy = ex_phy->port->rphy;
638 static int sas_dev_present_in_domain(struct asd_sas_port *port,
643 if (SAS_ADDR(port->sas_addr) == SAS_ADDR(sas_addr))
645 list_for_each_entry(dev, &port->dev_list, dev_list_node) {
743 struct sas_port *port;
748 port = parent_phy->port;
765 sas_port_add_phy(port, phy->phy);
790 child->port = parent->port;
794 if (!phy->port) {
795 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id);
796 if (unlikely(!phy->port))
798 if (unlikely(sas_port_add(phy->port) != 0)) {
799 sas_port_free(phy->port);
804 sas_device_set_phy(child, phy->port);
816 rphy = sas_end_device_alloc(phy->port);
823 list_add_tail(&child->disco_list_node, &parent->port->disco_list);
837 rphy = sas_end_device_alloc(phy->port);
848 list_add_tail(&child->disco_list_node, &parent->port->disco_list);
871 spin_lock_irq(&parent->port->dev_list_lock);
873 spin_unlock_irq(&parent->port->dev_list_lock);
875 sas_port_delete(phy->port);
877 phy->port = NULL;
882 /* See if this phy is part of a wide port */
895 SAS_ADDR_SIZE) && ephy->port) {
896 sas_port_add_phy(ephy->port, phy->phy);
897 phy->port = ephy->port;
914 struct asd_sas_port *port;
929 phy->port = sas_port_alloc(&parent->rphy->dev, phy_id);
931 BUG_ON(sas_port_add(phy->port) != 0);
936 rphy = sas_expander_alloc(phy->port,
940 rphy = sas_expander_alloc(phy->port,
947 port = parent->port;
954 child->port = port;
961 parent->port->disc.max_level = max(parent->port->disc.max_level,
967 spin_lock_irq(&parent->port->dev_list_lock);
968 list_add_tail(&child->dev_list_node, &parent->port->dev_list);
969 spin_unlock_irq(&parent->port->dev_list_lock);
974 spin_lock_irq(&parent->port->dev_list_lock);
976 spin_unlock_irq(&parent->port->dev_list_lock);
1001 SAS_ADDR(dev->port->sas_addr))) {
1009 sas_configure_phy(dev, phy_id, dev->port->sas_addr, 1);
1013 if (sas_dev_present_in_domain(dev->port, ex_phy->attached_sas_addr))
1046 SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n",
1057 if (SAS_ADDR(dev->port->disc.fanout_sas_addr)) {
1067 memcpy(dev->port->disc.fanout_sas_addr,
1086 * wide port, so we add the phy to the wide port here.
1092 SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n",
1275 if (SAS_ADDR(parent->port->disc.fanout_sas_addr) != 0) {
1283 SAS_ADDR(parent->port->disc.fanout_sas_addr));
1284 } else if (SAS_ADDR(parent->port->disc.eeds_a) == 0) {
1285 memcpy(parent->port->disc.eeds_a, parent->sas_addr,
1287 memcpy(parent->port->disc.eeds_b, child->sas_addr,
1289 } else if (((SAS_ADDR(parent->port->disc.eeds_a) ==
1291 (SAS_ADDR(parent->port->disc.eeds_a) ==
1294 ((SAS_ADDR(parent->port->disc.eeds_b) ==
1296 (SAS_ADDR(parent->port->disc.eeds_b) ==
1521 * sas_addr: SAS port identifier of device directly attached to child
1562 * sas_addr: port identifier of device directly attached to the expander device
1616 static int sas_ex_level_discovery(struct asd_sas_port *port, const int level)
1621 list_for_each_entry(dev, &port->dev_list, dev_list_node) {
1630 res = sas_ex_discover_devices(port->port_dev, -1);
1638 static int sas_ex_bfs_disc(struct asd_sas_port *port)
1644 level = port->disc.max_level;
1645 res = sas_ex_level_discovery(port, level);
1647 } while (level < port->disc.max_level);
1661 ex->level = dev->port->disc.max_level; /* 0 */
1666 sas_ex_bfs_disc(dev->port);
1862 static void sas_unregister_ex_tree(struct asd_sas_port *port, struct domain_device *dev)
1871 sas_unregister_ex_tree(port, child);
1873 sas_unregister_dev(port, child);
1875 sas_unregister_dev(port, dev);
1892 sas_unregister_ex_tree(parent->port, child);
1894 sas_unregister_dev(parent->port, child);
1902 if (phy->port) {
1903 sas_port_delete_phy(phy->port, phy->phy);
1904 sas_device_set_phy(found, phy->port);
1905 if (phy->port->num_phys == 0)
1906 sas_port_delete(phy->port);
1907 phy->port = NULL;
1947 } while (level <= dev->port->disc.max_level);
2063 * the last phy in the port, for other phys in this port, we just delete it
2064 * from the port.For inserting, we do discovery when it is the
2065 * first phy,for other phys in this port, we add it to the port to
2066 * forming the wide-port.
2074 bool last = true; /* is this the last phy of the port */
2087 SAS_DPRINTK("phy%d part of wide port with "
2101 * @port: port to the domain of interest