Lines Matching refs:phy

54 static void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)  in get_lrate_mode()  argument
56 struct sas_phy *sas_phy = phy->sas_phy.phy; in get_lrate_mode()
61 phy->sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS; in get_lrate_mode()
62 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS; in get_lrate_mode()
65 phy->sas_phy.linkrate = SAS_LINK_RATE_3_0_GBPS; in get_lrate_mode()
66 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; in get_lrate_mode()
69 phy->sas_phy.linkrate = SAS_LINK_RATE_1_5_GBPS; in get_lrate_mode()
70 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; in get_lrate_mode()
73 sas_phy->negotiated_linkrate = phy->sas_phy.linkrate; in get_lrate_mode()
76 sas_phy->maximum_linkrate = phy->phy_desc->max_sas_lrate; in get_lrate_mode()
77 sas_phy->minimum_linkrate = phy->phy_desc->min_sas_lrate; in get_lrate_mode()
80 phy->sas_phy.oob_mode = SAS_OOB_MODE; in get_lrate_mode()
82 phy->sas_phy.oob_mode = SATA_OOB_MODE; in get_lrate_mode()
91 struct asd_phy *phy = &asd_ha->phys[phy_id]; in asd_phy_event_tasklet() local
101 sas_phy_disconnected(&phy->sas_phy); in asd_phy_event_tasklet()
102 sas_ha->notify_phy_event(&phy->sas_phy, PHYE_LOSS_OF_SIGNAL); in asd_phy_event_tasklet()
107 get_lrate_mode(phy, oob_mode); in asd_phy_event_tasklet()
109 phy_id, phy->sas_phy.linkrate, phy->sas_phy.iproto); in asd_phy_event_tasklet()
110 sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE); in asd_phy_event_tasklet()
115 sas_ha->notify_phy_event(&phy->sas_phy, PHYE_SPINUP_HOLD); in asd_phy_event_tasklet()
122 sas_phy_disconnected(&phy->sas_phy); in asd_phy_event_tasklet()
123 sas_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_ERROR); in asd_phy_event_tasklet()
129 static unsigned ord_phy(struct asd_ha_struct *asd_ha, struct asd_phy *phy) in ord_phy() argument
135 if (&asd_ha->phys[i] == phy) in ord_phy()
154 static void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr) in asd_get_attached_sas_addr() argument
156 if (phy->sas_phy.frame_rcvd[0] == 0x34 in asd_get_attached_sas_addr()
157 && phy->sas_phy.oob_mode == SATA_OOB_MODE) { in asd_get_attached_sas_addr()
158 struct asd_ha_struct *asd_ha = phy->sas_phy.ha->lldd_ha; in asd_get_attached_sas_addr()
160 u64 addr = be64_to_cpu(*(__be64 *)phy->phy_desc->sas_addr); in asd_get_attached_sas_addr()
162 addr += asd_ha->hw_prof.sata_name_base + ord_phy(asd_ha, phy); in asd_get_attached_sas_addr()
166 (void *) phy->sas_phy.frame_rcvd; in asd_get_attached_sas_addr()
171 static void asd_form_port(struct asd_ha_struct *asd_ha, struct asd_phy *phy) in asd_form_port() argument
176 struct asd_sas_phy *sas_phy = &phy->sas_phy; in asd_form_port()
180 if (!phy->asd_port) { in asd_form_port()
212 phy->asd_port = port; in asd_form_port()
215 __func__, phy->asd_port->phy_mask, sas_phy->id); in asd_form_port()
216 asd_update_port_links(asd_ha, phy); in asd_form_port()
220 static void asd_deform_port(struct asd_ha_struct *asd_ha, struct asd_phy *phy) in asd_deform_port() argument
222 struct asd_port *port = phy->asd_port; in asd_deform_port()
223 struct asd_sas_phy *sas_phy = &phy->sas_phy; in asd_deform_port()
230 phy->asd_port = NULL; in asd_deform_port()
242 struct asd_phy *phy = &ascb->ha->phys[phy_id]; in asd_bytes_dmaed_tasklet() local
243 struct sas_ha_struct *sas_ha = phy->sas_phy.ha; in asd_bytes_dmaed_tasklet()
246 size = min(size, (u16) sizeof(phy->frame_rcvd)); in asd_bytes_dmaed_tasklet()
248 spin_lock_irqsave(&phy->sas_phy.frame_rcvd_lock, flags); in asd_bytes_dmaed_tasklet()
249 memcpy(phy->sas_phy.frame_rcvd, edb->vaddr, size); in asd_bytes_dmaed_tasklet()
250 phy->sas_phy.frame_rcvd_size = size; in asd_bytes_dmaed_tasklet()
251 asd_get_attached_sas_addr(phy, phy->sas_phy.attached_sas_addr); in asd_bytes_dmaed_tasklet()
252 spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); in asd_bytes_dmaed_tasklet()
253 asd_dump_frame_rcvd(phy, dl); in asd_bytes_dmaed_tasklet()
254 asd_form_port(ascb->ha, phy); in asd_bytes_dmaed_tasklet()
255 sas_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED); in asd_bytes_dmaed_tasklet()
265 struct asd_phy *phy = &asd_ha->phys[phy_id]; in asd_link_reset_err_tasklet() local
290 asd_deform_port(asd_ha, phy); in asd_link_reset_err_tasklet()
319 struct asd_phy *phy = &asd_ha->phys[phy_id]; in asd_primitive_rcvd_tasklet() local
356 asd_deform_port(asd_ha, phy); in asd_primitive_rcvd_tasklet()
424 struct asd_phy *phy = &asd_ha->phys[phy_id]; in escb_tasklet_complete() local
587 asd_deform_port(asd_ha, phy); in escb_tasklet_complete()
649 struct asd_phy *phy = &ascb->ha->phys[phy_id]; in control_phy_tasklet_complete() local
674 get_lrate_mode(phy, oob_mode); in control_phy_tasklet_complete()
677 __func__, phy_id,phy->sas_phy.linkrate, in control_phy_tasklet_complete()
678 phy->sas_phy.iproto); in control_phy_tasklet_complete()
778 struct asd_phy *phy = &ascb->ha->phys[phy_id]; in asd_build_control_phy() local
793 set_speed_mask(&control_phy->speed_mask, phy->phy_desc); in asd_build_control_phy()
796 if (phy->sas_phy.role == PHY_ROLE_INITIATOR) in asd_build_control_phy()
798 else if (phy->sas_phy.role == PHY_ROLE_TARGET) in asd_build_control_phy()
810 if (phy->phy_desc->flags & ASD_SATA_SPINUP_HOLD) in asd_build_control_phy()
899 int asd_control_phy(struct asd_sas_phy *phy, enum phy_func func, void *arg) in asd_control_phy() argument
901 struct asd_ha_struct *asd_ha = phy->ha->lldd_ha; in asd_control_phy()
902 struct asd_phy_desc *pd = asd_ha->phys[phy->id].phy_desc; in asd_control_phy()
931 asd_build_control_phy(ascb, phy->id, phy_func_table[func]); in asd_control_phy()