Lines Matching +full:fis +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
25 if (phy_id >= sas_ha->num_phys) { in sas_host_smp_discover()
31 phy = sas_ha->sas_phy[phy_id]->phy; in sas_host_smp_discover()
33 resp_data[13] = phy->negotiated_linkrate; in sas_host_smp_discover()
34 memcpy(resp_data + 16, sas_ha->sas_addr, SAS_ADDR_SIZE); in sas_host_smp_discover()
35 memcpy(resp_data + 24, sas_ha->sas_phy[phy_id]->attached_sas_addr, in sas_host_smp_discover()
37 resp_data[40] = (phy->minimum_linkrate << 4) | in sas_host_smp_discover()
38 phy->minimum_linkrate_hw; in sas_host_smp_discover()
39 resp_data[41] = (phy->maximum_linkrate << 4) | in sas_host_smp_discover()
40 phy->maximum_linkrate_hw; in sas_host_smp_discover()
42 if (!sas_ha->sas_phy[phy_id]->port || in sas_host_smp_discover()
43 !sas_ha->sas_phy[phy_id]->port->port_dev) in sas_host_smp_discover()
46 rphy = sas_ha->sas_phy[phy_id]->port->port_dev->rphy; in sas_host_smp_discover()
47 resp_data[12] = rphy->identify.device_type << 4; in sas_host_smp_discover()
48 resp_data[14] = rphy->identify.initiator_port_protocols; in sas_host_smp_discover()
49 resp_data[15] = rphy->identify.target_port_protocols; in sas_host_smp_discover()
53 * to_sas_gpio_gp_bit - given the gpio frame data find the byte/bit position of 'od'
62 * From SFF-8485 v0.7:
69 * The general-purpose (raw-bitstream) RX registers have the same layout
72 * SFF-8489 defines the behavior of the LEDs in response to the 'od' values.
83 index--; /* make index 0-based */ in to_sas_gpio_gp_bit()
87 od -= index * 32; in to_sas_gpio_gp_bit()
93 od &= (1 << 5) - 1; in to_sas_gpio_gp_bit()
94 byte = 3 - (od >> 3); in to_sas_gpio_gp_bit()
95 *bit = od & ((1 << 3) - 1); in to_sas_gpio_gp_bit()
107 return -1; in try_test_sas_gpio_gp_bit()
117 struct sas_internal *i = to_sas_internal(sas_ha->shost->transportt); in sas_host_smp_write_gpio()
120 if (i->dft->lldd_write_gpio == NULL) { in sas_host_smp_write_gpio()
125 written = i->dft->lldd_write_gpio(sas_ha, reg_type, reg_index, in sas_host_smp_write_gpio()
141 struct dev_to_host_fis *fis; in sas_report_phy_sata() local
144 if (phy_id >= sas_ha->num_phys) { in sas_report_phy_sata()
151 if (!sas_ha->sas_phy[phy_id]->port) in sas_report_phy_sata()
154 rphy = sas_ha->sas_phy[phy_id]->port->port_dev->rphy; in sas_report_phy_sata()
155 fis = (struct dev_to_host_fis *) in sas_report_phy_sata()
156 sas_ha->sas_phy[phy_id]->port->port_dev->frame_rcvd; in sas_report_phy_sata()
157 if (rphy->identify.target_port_protocols != SAS_PROTOCOL_SATA) in sas_report_phy_sata()
162 memcpy(resp_data + 16, sas_ha->sas_phy[phy_id]->attached_sas_addr, in sas_report_phy_sata()
165 /* check to see if we have a valid d2h fis */ in sas_report_phy_sata()
166 if (fis->fis_type != 0x34) in sas_report_phy_sata()
169 /* the d2h fis is required by the standard to be in LE format */ in sas_report_phy_sata()
172 &sas_ha->sas_phy[phy_id]->port->port_dev->frame_rcvd[i]; in sas_report_phy_sata()
185 to_sas_internal(sas_ha->shost->transportt); in sas_phy_control()
189 if (phy_id >= sas_ha->num_phys) { in sas_phy_control()
194 asd_phy = sas_ha->sas_phy[phy_id]; in sas_phy_control()
219 if (i->dft->lldd_control_phy(asd_phy, phy_op, &rates)) in sas_phy_control()
230 int error = -EINVAL; in sas_smp_host_handler()
233 if (job->request_payload.payload_len < 8 || in sas_smp_host_handler()
234 job->reply_payload.payload_len < 8) in sas_smp_host_handler()
237 error = -ENOMEM; in sas_smp_host_handler()
238 req_data = kzalloc(job->request_payload.payload_len, GFP_KERNEL); in sas_smp_host_handler()
241 sg_copy_to_buffer(job->request_payload.sg_list, in sas_smp_host_handler()
242 job->request_payload.sg_cnt, req_data, in sas_smp_host_handler()
243 job->request_payload.payload_len); in sas_smp_host_handler()
247 resp_data = kzalloc(max(job->reply_payload.payload_len, 128U), in sas_smp_host_handler()
252 error = -EINVAL; in sas_smp_host_handler()
264 resp_data[9] = sas_ha->num_phys; in sas_smp_host_handler()
270 memcpy(resp_data + 12, shost->hostt->name, in sas_smp_host_handler()
282 if (job->request_payload.payload_len < 16) in sas_smp_host_handler()
294 if (job->request_payload.payload_len < 16) in sas_smp_host_handler()
305 /* SFF-8485 v0.7 */ in sas_smp_host_handler()
309 if (job->request_payload.payload_len < in sas_smp_host_handler()
326 if (job->request_payload.payload_len < 44) in sas_smp_host_handler()
343 sg_copy_from_buffer(job->reply_payload.sg_list, in sas_smp_host_handler()
344 job->reply_payload.sg_cnt, resp_data, in sas_smp_host_handler()
345 job->reply_payload.payload_len); in sas_smp_host_handler()