Lines Matching refs:phy

31 static bool phy_is_wideport_member(struct asd_sas_port *port, struct asd_sas_phy *phy)  in phy_is_wideport_member()  argument
33 struct sas_ha_struct *sas_ha = phy->ha; in phy_is_wideport_member()
35 if (memcmp(port->attached_sas_addr, phy->attached_sas_addr, in phy_is_wideport_member()
37 memcmp(port->sas_addr, phy->sas_addr, SAS_ADDR_SIZE) != 0)) in phy_is_wideport_member()
42 static void sas_resume_port(struct asd_sas_phy *phy) in sas_resume_port() argument
45 struct asd_sas_port *port = phy->port; in sas_resume_port()
46 struct sas_ha_struct *sas_ha = phy->ha; in sas_resume_port()
50 si->dft->lldd_port_formed(phy); in sas_resume_port()
76 struct ex_phy *phy = &dev->ex_dev.ex_phy[i]; in sas_resume_port() local
78 phy->phy_change_count = -1; in sas_resume_port()
93 static void sas_form_port(struct asd_sas_phy *phy) in sas_form_port() argument
96 struct sas_ha_struct *sas_ha = phy->ha; in sas_form_port()
97 struct asd_sas_port *port = phy->port; in sas_form_port()
103 if (!phy_is_wideport_member(port, phy)) in sas_form_port()
104 sas_deform_port(phy, 0); in sas_form_port()
105 else if (phy->suspended) { in sas_form_port()
106 phy->suspended = 0; in sas_form_port()
107 sas_resume_port(phy); in sas_form_port()
114 __func__, phy->id, phy->port->id, in sas_form_port()
115 phy->port->num_phys); in sas_form_port()
126 phy_is_wideport_member(port, phy) && port->num_phys > 0) { in sas_form_port()
128 SAS_DPRINTK("phy%d matched wide port%d\n", phy->id, in sas_form_port()
141 memcpy(port->sas_addr, phy->sas_addr, in sas_form_port()
157 list_add_tail(&phy->port_phy_el, &port->phy_list); in sas_form_port()
158 sas_phy_set_target(phy, port->port_dev); in sas_form_port()
159 phy->port = port; in sas_form_port()
161 port->phy_mask |= (1U << phy->id); in sas_form_port()
164 port->class = phy->class; in sas_form_port()
165 memcpy(port->attached_sas_addr, phy->attached_sas_addr, in sas_form_port()
167 port->iproto = phy->iproto; in sas_form_port()
168 port->tproto = phy->tproto; in sas_form_port()
169 port->oob_mode = phy->oob_mode; in sas_form_port()
170 port->linkrate = phy->linkrate; in sas_form_port()
172 port->linkrate = max(port->linkrate, phy->linkrate); in sas_form_port()
177 port->port = sas_port_alloc(phy->phy->dev.parent, port->id); in sas_form_port()
181 sas_port_add_phy(port->port, phy->phy); in sas_form_port()
184 dev_name(&phy->phy->dev), dev_name(&port->port->dev), in sas_form_port()
193 si->dft->lldd_port_formed(phy); in sas_form_port()
195 sas_discover_event(phy->port, DISCE_DISCOVER_DOMAIN); in sas_form_port()
207 void sas_deform_port(struct asd_sas_phy *phy, int gone) in sas_deform_port() argument
209 struct sas_ha_struct *sas_ha = phy->ha; in sas_deform_port()
210 struct asd_sas_port *port = phy->port; in sas_deform_port()
229 sas_port_delete_phy(port->port, phy->phy); in sas_deform_port()
234 si->dft->lldd_port_deformed(phy); in sas_deform_port()
239 list_del_init(&phy->port_phy_el); in sas_deform_port()
240 sas_phy_set_target(phy, NULL); in sas_deform_port()
241 phy->port = NULL; in sas_deform_port()
243 port->phy_mask &= ~(1U << phy->id); in sas_deform_port()
266 struct asd_sas_phy *phy = ev->phy; in sas_porte_bytes_dmaed() local
268 sas_form_port(phy); in sas_porte_bytes_dmaed()
274 struct asd_sas_phy *phy = ev->phy; in sas_porte_broadcast_rcvd() local
278 spin_lock_irqsave(&phy->sas_prim_lock, flags); in sas_porte_broadcast_rcvd()
279 prim = phy->sas_prim; in sas_porte_broadcast_rcvd()
280 spin_unlock_irqrestore(&phy->sas_prim_lock, flags); in sas_porte_broadcast_rcvd()
283 sas_discover_event(phy->port, DISCE_REVALIDATE_DOMAIN); in sas_porte_broadcast_rcvd()
285 if (phy->port) in sas_porte_broadcast_rcvd()
286 flush_workqueue(phy->port->ha->disco_q); in sas_porte_broadcast_rcvd()
292 struct asd_sas_phy *phy = ev->phy; in sas_porte_link_reset_err() local
294 sas_deform_port(phy, 1); in sas_porte_link_reset_err()
300 struct asd_sas_phy *phy = ev->phy; in sas_porte_timer_event() local
302 sas_deform_port(phy, 1); in sas_porte_timer_event()
308 struct asd_sas_phy *phy = ev->phy; in sas_porte_hard_reset() local
310 sas_deform_port(phy, 1); in sas_porte_hard_reset()