Lines Matching defs:phy

179 static int sas_get_linkerrors(struct sas_phy *phy)
181 if (scsi_is_sas_phy_local(phy)) {
182 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
184 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
191 return sas_smp_get_phy_events(phy);
216 * transport_sas_phy_reset - reset a phy and permit libata to manage the link
218 * phy reset request via sysfs in host workqueue context so we know we
221 static int transport_sas_phy_reset(struct sas_phy *phy, int hard_reset)
230 if (scsi_is_sas_phy_local(phy)) {
231 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
233 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
241 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
243 struct domain_device *ata_dev = sas_ex_to_ata(ddev, phy->number);
250 return sas_smp_phy_control(ddev, phy->number, reset_type, NULL);
254 int sas_phy_enable(struct sas_phy *phy, int enable)
264 if (scsi_is_sas_phy_local(phy)) {
265 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
267 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
272 ret = transport_sas_phy_reset(phy, 0);
276 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
280 ret = transport_sas_phy_reset(phy, 0);
282 ret = sas_smp_phy_control(ddev, phy->number, cmd, NULL);
288 int sas_phy_reset(struct sas_phy *phy, int hard_reset)
293 if (!phy->enabled)
301 if (scsi_is_sas_phy_local(phy)) {
302 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
304 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
310 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
312 ret = sas_smp_phy_control(ddev, phy->number, reset_type, NULL);
318 static int sas_set_phy_speed(struct sas_phy *phy,
324 rates->minimum_linkrate > phy->maximum_linkrate) ||
326 rates->maximum_linkrate < phy->minimum_linkrate))
330 rates->minimum_linkrate < phy->minimum_linkrate_hw)
331 rates->minimum_linkrate = phy->minimum_linkrate_hw;
334 rates->maximum_linkrate > phy->maximum_linkrate_hw)
335 rates->maximum_linkrate = phy->maximum_linkrate_hw;
337 if (scsi_is_sas_phy_local(phy)) {
338 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
340 struct asd_sas_phy *asd_phy = sas_ha->sas_phy[phy->number];
347 struct sas_rphy *rphy = dev_to_rphy(phy->dev.parent);
349 ret = sas_smp_phy_control(ddev, phy->number,
366 struct asd_sas_phy *phy = ha->sas_phy[i];
368 memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
369 phy->frame_rcvd_size = 0;
379 struct asd_sas_phy *phy = ha->sas_phy[i];
381 if (phy->suspended)
418 * at this point we may be racing the phy coming back (as posted
420 * libsas context check that the phy remains suspended before
425 dev_info(ha->dev, "waiting up to 25 seconds for %d phy%s to resume\n",
429 struct asd_sas_phy *phy = ha->sas_phy[i];
431 if (phy->suspended) {
432 dev_warn(&phy->phy->dev, "resume timeout\n");
433 sas_notify_phy_event(phy, PHYE_RESUME_TIMEOUT,
485 static void sas_phy_release(struct sas_phy *phy)
487 kfree(phy->hostdata);
488 phy->hostdata = NULL;
495 d->reset_result = transport_sas_phy_reset(d->phy, d->hard_reset);
502 d->enable_result = sas_phy_enable(d->phy, d->enable);
505 static int sas_phy_setup(struct sas_phy *phy)
515 d->phy = phy;
516 phy->hostdata = d;
521 static int queue_phy_reset(struct sas_phy *phy, int hard_reset)
523 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
525 struct sas_phy_data *d = phy->hostdata;
550 static int queue_phy_enable(struct sas_phy *phy, int enable)
552 struct Scsi_Host *shost = dev_to_shost(phy->dev.parent);
554 struct sas_phy_data *d = phy->hostdata;
638 struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy,
642 struct sas_ha_struct *sas_ha = phy->ha;
650 atomic_inc(&phy->event_nr);
652 if (atomic_read(&phy->event_nr) > phy->ha->event_thres) {
654 if (cmpxchg(&phy->in_shutdown, 0, 1) == 0) {
655 pr_notice("The phy%d bursting events, shut it down.\n",
656 phy->id);
657 sas_notify_phy_event(phy, PHYE_SHUTDOWN,
664 atomic_dec(&phy->event_nr);
674 struct asd_sas_phy *phy = event->phy;
677 atomic_dec(&phy->event_nr);