/* LOCKING: the frame_rcvd_lock needs to be held since this parses the frame buffer.  */
static void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr)
/* LOCKING: the frame_rcvd_lock needs to be held since this parses the frame buffer.  */
static void asd_get_attached_sas_addr(struct asd_phy *phy, u8 *sas_addr)
{
	if (phy->sas_phy.frame_rcvd[0] == 0x34
	    && phy->sas_phy.oob_mode == SATA_OOB_MODE) {
		struct asd_ha_struct *asd_ha = phy->sas_phy.ha->lldd_ha;
		u64 addr = be64_to_cpu(*(__be64 *)phy->phy_desc->sas_addr);
		addr += asd_ha->hw_prof.sata_name_base + ord_phy(asd_ha, phy);
		*(__be64 *)sas_addr = cpu_to_be64(addr);
	} else {
		struct sas_identify_frame *idframe =
			(void *) phy->sas_phy.frame_rcvd;
		memcpy(sas_addr, idframe->sas_addr, SAS_ADDR_SIZE);
	}
}