Lines Matching refs:phy
212 static int sas_get_linkerrors(struct sas_phy *phy) in sas_get_linkerrors() argument
214 if (scsi_is_sas_phy_local(phy)) { in sas_get_linkerrors()
215 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_get_linkerrors()
217 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_get_linkerrors()
224 return sas_smp_get_phy_events(phy); in sas_get_linkerrors()
254 static int transport_sas_phy_reset(struct sas_phy *phy, int hard_reset) in transport_sas_phy_reset() argument
263 if (scsi_is_sas_phy_local(phy)) { in transport_sas_phy_reset()
264 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in transport_sas_phy_reset()
266 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in transport_sas_phy_reset()
274 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in transport_sas_phy_reset()
276 struct domain_device *ata_dev = sas_ex_to_ata(ddev, phy->number); in transport_sas_phy_reset()
283 return sas_smp_phy_control(ddev, phy->number, reset_type, NULL); in transport_sas_phy_reset()
287 static int sas_phy_enable(struct sas_phy *phy, int enable) in sas_phy_enable() argument
297 if (scsi_is_sas_phy_local(phy)) { in sas_phy_enable()
298 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_phy_enable()
300 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_phy_enable()
305 ret = transport_sas_phy_reset(phy, 0); in sas_phy_enable()
309 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_phy_enable()
313 ret = transport_sas_phy_reset(phy, 0); in sas_phy_enable()
315 ret = sas_smp_phy_control(ddev, phy->number, cmd, NULL); in sas_phy_enable()
320 int sas_phy_reset(struct sas_phy *phy, int hard_reset) in sas_phy_reset() argument
325 if (!phy->enabled) in sas_phy_reset()
333 if (scsi_is_sas_phy_local(phy)) { in sas_phy_reset()
334 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_phy_reset()
336 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_phy_reset()
342 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_phy_reset()
344 ret = sas_smp_phy_control(ddev, phy->number, reset_type, NULL); in sas_phy_reset()
349 int sas_set_phy_speed(struct sas_phy *phy, in sas_set_phy_speed() argument
355 rates->minimum_linkrate > phy->maximum_linkrate) || in sas_set_phy_speed()
357 rates->maximum_linkrate < phy->minimum_linkrate)) in sas_set_phy_speed()
361 rates->minimum_linkrate < phy->minimum_linkrate_hw) in sas_set_phy_speed()
362 rates->minimum_linkrate = phy->minimum_linkrate_hw; in sas_set_phy_speed()
365 rates->maximum_linkrate > phy->maximum_linkrate_hw) in sas_set_phy_speed()
366 rates->maximum_linkrate = phy->maximum_linkrate_hw; in sas_set_phy_speed()
368 if (scsi_is_sas_phy_local(phy)) { in sas_set_phy_speed()
369 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in sas_set_phy_speed()
371 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number]; in sas_set_phy_speed()
378 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent); in sas_set_phy_speed()
380 ret = sas_smp_phy_control(ddev, phy->number, in sas_set_phy_speed()
396 struct asd_sas_phy *phy = ha->sas_phy[i]; in sas_prep_resume_ha() local
398 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); in sas_prep_resume_ha()
399 phy->port_events_pending = 0; in sas_prep_resume_ha()
400 phy->phy_events_pending = 0; in sas_prep_resume_ha()
401 phy->frame_rcvd_size = 0; in sas_prep_resume_ha()
411 struct asd_sas_phy *phy = ha->sas_phy[i]; in phys_suspended() local
413 if (phy->suspended) in phys_suspended()
437 struct asd_sas_phy *phy = ha->sas_phy[i]; in sas_resume_ha() local
439 if (phy->suspended) { in sas_resume_ha()
440 dev_warn(&phy->phy->dev, "resume timeout\n"); in sas_resume_ha()
441 sas_notify_phy_event(phy, PHYE_RESUME_TIMEOUT); in sas_resume_ha()
472 static void sas_phy_release(struct sas_phy *phy) in sas_phy_release() argument
474 kfree(phy->hostdata); in sas_phy_release()
475 phy->hostdata = NULL; in sas_phy_release()
482 d->reset_result = transport_sas_phy_reset(d->phy, d->hard_reset); in phy_reset_work()
489 d->enable_result = sas_phy_enable(d->phy, d->enable); in phy_enable_work()
492 static int sas_phy_setup(struct sas_phy *phy) in sas_phy_setup() argument
502 d->phy = phy; in sas_phy_setup()
503 phy->hostdata = d; in sas_phy_setup()
508 static int queue_phy_reset(struct sas_phy *phy, int hard_reset) in queue_phy_reset() argument
510 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in queue_phy_reset()
512 struct sas_phy_data *d = phy->hostdata; in queue_phy_reset()
535 static int queue_phy_enable(struct sas_phy *phy, int enable) in queue_phy_enable() argument
537 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent); in queue_phy_enable()
539 struct sas_phy_data *d = phy->hostdata; in queue_phy_enable()