/** * isci_task_send_lu_reset_sas() - This function is called by of the SAS Domain * Template functions. * @lun: This parameter specifies the lun to be reset. * * status, zero indicates success. */ static int isci_task_send_lu_reset_sas( struct isci_host *isci_host, struct isci_remote_device *isci_device, u8 *lun) { struct isci_tmf tmf; int ret = TMF_RESP_FUNC_FAILED; dev_dbg(&isci_host->pdev->dev, "%s: isci_host = %p, isci_device = %p\n", __func__, isci_host, isci_device); /* Send the LUN reset to the target. By the time the call returns, * the TMF has fully exected in the target (in which case the return * value is "TMF_RESP_FUNC_COMPLETE", or the request timed-out (or * was otherwise unable to be executed ("TMF_RESP_FUNC_FAILED"). */ isci_task_build_tmf(&tmf, isci_tmf_ssp_lun_reset); #define ISCI_LU_RESET_TIMEOUT_MS 2000 /* 2 second timeout. */ ret = isci_task_execute_tmf(isci_host, isci_device, &tmf, ISCI_LU_RESET_TIMEOUT_MS); if (ret == TMF_RESP_FUNC_COMPLETE) dev_dbg(&isci_host->pdev->dev, "%s: %p: TMF_LU_RESET passed\n", __func__, isci_device); else dev_dbg(&isci_host->pdev->dev, "%s: %p: TMF_LU_RESET failed (%x)\n", __func__, isci_device, ret); return ret; }
static void isci_task_build_abort_task_tmf(struct isci_tmf *tmf, enum isci_tmf_function_codes code, struct isci_request *old_request) { isci_task_build_tmf(tmf, code); tmf->io_tag = old_request->io_tag; }
static int isci_task_send_lu_reset_sas( struct isci_host *isci_host, struct isci_remote_device *isci_device, u8 *lun) { struct isci_tmf tmf; int ret = TMF_RESP_FUNC_FAILED; dev_dbg(&isci_host->pdev->dev, "%s: isci_host = %p, isci_device = %p\n", __func__, isci_host, isci_device); isci_task_build_tmf(&tmf, isci_tmf_ssp_lun_reset, NULL, NULL); #define ISCI_LU_RESET_TIMEOUT_MS 2000 ret = isci_task_execute_tmf(isci_host, isci_device, &tmf, ISCI_LU_RESET_TIMEOUT_MS); if (ret == TMF_RESP_FUNC_COMPLETE) dev_dbg(&isci_host->pdev->dev, "%s: %p: TMF_LU_RESET passed\n", __func__, isci_device); else dev_dbg(&isci_host->pdev->dev, "%s: %p: TMF_LU_RESET failed (%x)\n", __func__, isci_device, ret); return ret; }
static void isci_task_build_abort_task_tmf(struct isci_tmf *tmf, enum isci_tmf_function_codes code, void (*tmf_sent_cb)(enum isci_tmf_cb_state, struct isci_tmf *, void *), struct isci_request *old_request) { isci_task_build_tmf(tmf, code, tmf_sent_cb, old_request); tmf->io_tag = old_request->io_tag; }