Commit 350d85ba authored by John Garry's avatar John Garry Committed by Martin K. Petersen

scsi: libsas: Add sas_execute_ssp_tmf()

Add a function to issue an SSP TMF.

Add a temp prototype to keep make W=1 happy.

Link: https://lore.kernel.org/r/1645112566-115804-11-git-send-email-john.garry@huawei.comTested-by: default avatarYihang Li <liyihang6@hisilicon.com>
Tested-by: default avatarDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 001ec7f8
...@@ -937,6 +937,9 @@ int sas_execute_tmf(struct domain_device *device, void *parameter, ...@@ -937,6 +937,9 @@ int sas_execute_tmf(struct domain_device *device, void *parameter,
task->dev = device; task->dev = device;
task->task_proto = device->tproto; task->task_proto = device->tproto;
if (!dev_is_sata(device))
memcpy(&task->ssp_task, parameter, para_len);
task->task_done = sas_task_internal_done; task->task_done = sas_task_internal_done;
task->tmf = tmf; task->tmf = tmf;
...@@ -1022,6 +1025,21 @@ int sas_execute_tmf(struct domain_device *device, void *parameter, ...@@ -1022,6 +1025,21 @@ int sas_execute_tmf(struct domain_device *device, void *parameter,
return res; return res;
} }
int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun,
struct sas_tmf_task *tmf);
int sas_execute_ssp_tmf(struct domain_device *device, u8 *lun,
struct sas_tmf_task *tmf)
{
struct sas_ssp_task ssp_task;
if (!(device->tproto & SAS_PROTOCOL_SSP))
return TMF_RESP_FUNC_ESUPP;
memcpy(ssp_task.LUN, lun, 8);
return sas_execute_tmf(device, &ssp_task, sizeof(ssp_task), -1, tmf);
}
/* /*
* Tell an upper layer that it needs to initiate an abort for a given task. * Tell an upper layer that it needs to initiate an abort for a given task.
* This should only ever be called by an LLDD. * This should only ever be called by an LLDD.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment