Lines Matching refs:phy
191 static int sas_get_linkerrors(struct sas_phy *phy) in sas_get_linkerrors() argument
193 if (scsi_is_sas_phy_local(phy)) { in sas_get_linkerrors()
194 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_get_linkerrors()
196 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_get_linkerrors()
203 return sas_smp_get_phy_events(phy); in sas_get_linkerrors()
233 static int transport_sas_phy_reset(struct sas_phy *phy, int hard_reset) in transport_sas_phy_reset() argument
242 if (scsi_is_sas_phy_local(phy)) { in transport_sas_phy_reset()
243 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in transport_sas_phy_reset()
245 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in transport_sas_phy_reset()
253 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in transport_sas_phy_reset()
255 struct domain_device *ata_dev = sas_ex_to_ata(ddev, phy->number); in transport_sas_phy_reset()
262 return sas_smp_phy_control(ddev, phy->number, reset_type, NULL); in transport_sas_phy_reset()
266 static int sas_phy_enable(struct sas_phy *phy, int enable) in sas_phy_enable() argument
276 if (scsi_is_sas_phy_local(phy)) { in sas_phy_enable()
277 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_phy_enable()
279 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_phy_enable()
284 ret = transport_sas_phy_reset(phy, 0); in sas_phy_enable()
288 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_phy_enable()
292 ret = transport_sas_phy_reset(phy, 0); in sas_phy_enable()
294 ret = sas_smp_phy_control(ddev, phy->number, cmd, NULL); in sas_phy_enable()
299 int sas_phy_reset(struct sas_phy *phy, int hard_reset) in sas_phy_reset() argument
304 if (!phy->enabled) in sas_phy_reset()
312 if (scsi_is_sas_phy_local(phy)) { in sas_phy_reset()
313 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_phy_reset()
315 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_phy_reset()
321 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_phy_reset()
323 ret = sas_smp_phy_control(ddev, phy->number, reset_type, NULL); in sas_phy_reset()
328 int sas_set_phy_speed(struct sas_phy *phy, in sas_set_phy_speed() argument
334 rates->minimum_linkrate > phy->maximum_linkrate) || in sas_set_phy_speed()
336 rates->maximum_linkrate < phy->minimum_linkrate)) in sas_set_phy_speed()
340 rates->minimum_linkrate < phy->minimum_linkrate_hw) in sas_set_phy_speed()
341 rates->minimum_linkrate = phy->minimum_linkrate_hw; in sas_set_phy_speed()
344 rates->maximum_linkrate > phy->maximum_linkrate_hw) in sas_set_phy_speed()
345 rates->maximum_linkrate = phy->maximum_linkrate_hw; in sas_set_phy_speed()
347 if (scsi_is_sas_phy_local(phy)) { in sas_set_phy_speed()
348 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_set_phy_speed()
350 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_set_phy_speed()
357 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_set_phy_speed()
359 ret = sas_smp_phy_control(ddev, phy->number, in sas_set_phy_speed()
375 struct asd_sas_phy *phy = ha->sas_phy[i]; in sas_prep_resume_ha() local
377 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); in sas_prep_resume_ha()
378 phy->port_events_pending = 0; in sas_prep_resume_ha()
379 phy->phy_events_pending = 0; in sas_prep_resume_ha()
380 phy->frame_rcvd_size = 0; in sas_prep_resume_ha()
390 struct asd_sas_phy *phy = ha->sas_phy[i]; in phys_suspended() local
392 if (phy->suspended) in phys_suspended()
416 struct asd_sas_phy *phy = ha->sas_phy[i]; in sas_resume_ha() local
418 if (phy->suspended) { in sas_resume_ha()
419 dev_warn(&phy->phy->dev, "resume timeout\n"); in sas_resume_ha()
420 sas_notify_phy_event(phy, PHYE_RESUME_TIMEOUT); in sas_resume_ha()
451 static void sas_phy_release(struct sas_phy *phy) in sas_phy_release() argument
453 kfree(phy->hostdata); in sas_phy_release()
454 phy->hostdata = NULL; in sas_phy_release()
461 d->reset_result = transport_sas_phy_reset(d->phy, d->hard_reset); in phy_reset_work()
468 d->enable_result = sas_phy_enable(d->phy, d->enable); in phy_enable_work()
471 static int sas_phy_setup(struct sas_phy *phy) in sas_phy_setup() argument
481 d->phy = phy; in sas_phy_setup()
482 phy->hostdata = d; in sas_phy_setup()
487 static int queue_phy_reset(struct sas_phy *phy, int hard_reset) in queue_phy_reset() argument
489 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in queue_phy_reset()
491 struct sas_phy_data *d = phy->hostdata; in queue_phy_reset()
514 static int queue_phy_enable(struct sas_phy *phy, int enable) in queue_phy_enable() argument
516 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in queue_phy_enable()
518 struct sas_phy_data *d = phy->hostdata; in queue_phy_enable()