Lines Matching +full:- +full:phy

1 // SPDX-License-Identifier: GPL-2.0
3 * Serial Attached SCSI (SAS) Phy class
15 /* ---------- Phy events ---------- */
20 struct asd_sas_phy *phy = ev->phy; in sas_phye_loss_of_signal() local
22 phy->error = 0; in sas_phye_loss_of_signal()
23 sas_deform_port(phy, 1); in sas_phye_loss_of_signal()
29 struct asd_sas_phy *phy = ev->phy; in sas_phye_oob_done() local
31 phy->error = 0; in sas_phye_oob_done()
37 struct asd_sas_phy *phy = ev->phy; in sas_phye_oob_error() local
38 struct sas_ha_struct *sas_ha = phy->ha; in sas_phye_oob_error()
39 struct asd_sas_port *port = phy->port; in sas_phye_oob_error()
41 to_sas_internal(sas_ha->shost->transportt); in sas_phye_oob_error()
43 sas_deform_port(phy, 1); in sas_phye_oob_error()
45 if (!port && phy->enabled && i->dft->lldd_control_phy) { in sas_phye_oob_error()
46 phy->error++; in sas_phye_oob_error()
47 switch (phy->error) { in sas_phye_oob_error()
50 i->dft->lldd_control_phy(phy, PHY_FUNC_HARD_RESET, in sas_phye_oob_error()
55 phy->error = 0; in sas_phye_oob_error()
56 phy->enabled = 0; in sas_phye_oob_error()
57 i->dft->lldd_control_phy(phy, PHY_FUNC_DISABLE, NULL); in sas_phye_oob_error()
66 struct asd_sas_phy *phy = ev->phy; in sas_phye_spinup_hold() local
67 struct sas_ha_struct *sas_ha = phy->ha; in sas_phye_spinup_hold()
69 to_sas_internal(sas_ha->shost->transportt); in sas_phye_spinup_hold()
71 phy->error = 0; in sas_phye_spinup_hold()
72 i->dft->lldd_control_phy(phy, PHY_FUNC_RELEASE_SPINUP_HOLD, NULL); in sas_phye_spinup_hold()
78 struct asd_sas_phy *phy = ev->phy; in sas_phye_resume_timeout() local
80 /* phew, lldd got the phy back in the nick of time */ in sas_phye_resume_timeout()
81 if (!phy->suspended) { in sas_phye_resume_timeout()
82 dev_info(&phy->phy->dev, "resume timeout cancelled\n"); in sas_phye_resume_timeout()
86 phy->error = 0; in sas_phye_resume_timeout()
87 phy->suspended = 0; in sas_phye_resume_timeout()
88 sas_deform_port(phy, 1); in sas_phye_resume_timeout()
95 struct asd_sas_phy *phy = ev->phy; in sas_phye_shutdown() local
96 struct sas_ha_struct *sas_ha = phy->ha; in sas_phye_shutdown()
98 to_sas_internal(sas_ha->shost->transportt); in sas_phye_shutdown()
100 if (phy->enabled) { in sas_phye_shutdown()
103 phy->error = 0; in sas_phye_shutdown()
104 phy->enabled = 0; in sas_phye_shutdown()
105 ret = i->dft->lldd_control_phy(phy, PHY_FUNC_DISABLE, NULL); in sas_phye_shutdown()
107 pr_notice("lldd disable phy%d returned %d\n", phy->id, in sas_phye_shutdown()
110 pr_notice("phy%d is not enabled, cannot shutdown\n", phy->id); in sas_phye_shutdown()
111 phy->in_shutdown = 0; in sas_phye_shutdown()
114 /* ---------- Phy class registration ---------- */
121 for (i = 0; i < sas_ha->num_phys; i++) { in sas_register_phys()
122 struct asd_sas_phy *phy = sas_ha->sas_phy[i]; in sas_register_phys() local
124 phy->error = 0; in sas_register_phys()
125 atomic_set(&phy->event_nr, 0); in sas_register_phys()
126 INIT_LIST_HEAD(&phy->port_phy_el); in sas_register_phys()
128 phy->port = NULL; in sas_register_phys()
129 phy->ha = sas_ha; in sas_register_phys()
130 spin_lock_init(&phy->frame_rcvd_lock); in sas_register_phys()
131 spin_lock_init(&phy->sas_prim_lock); in sas_register_phys()
132 phy->frame_rcvd_size = 0; in sas_register_phys()
134 phy->phy = sas_phy_alloc(&sas_ha->shost->shost_gendev, i); in sas_register_phys()
135 if (!phy->phy) in sas_register_phys()
136 return -ENOMEM; in sas_register_phys()
138 phy->phy->identify.initiator_port_protocols = in sas_register_phys()
139 phy->iproto; in sas_register_phys()
140 phy->phy->identify.target_port_protocols = phy->tproto; in sas_register_phys()
141 phy->phy->identify.sas_address = SAS_ADDR(sas_ha->sas_addr); in sas_register_phys()
142 phy->phy->identify.phy_identifier = i; in sas_register_phys()
143 phy->phy->minimum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; in sas_register_phys()
144 phy->phy->maximum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; in sas_register_phys()
145 phy->phy->minimum_linkrate = SAS_LINK_RATE_UNKNOWN; in sas_register_phys()
146 phy->phy->maximum_linkrate = SAS_LINK_RATE_UNKNOWN; in sas_register_phys()
147 phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN; in sas_register_phys()
149 sas_phy_add(phy->phy); in sas_register_phys()