Lines Matching refs:drv_cmd
2251 struct mpi3mr_drv_cmd *drv_cmd) in mpi3mr_dev_rmhs_complete_iou() argument
2253 u16 cmd_idx = drv_cmd->host_tag - MPI3MR_HOSTTAG_DEVRMCMD_MIN; in mpi3mr_dev_rmhs_complete_iou()
2256 if (drv_cmd->state & MPI3MR_CMD_RESET) in mpi3mr_dev_rmhs_complete_iou()
2261 __func__, drv_cmd->dev_handle, drv_cmd->ioc_status, in mpi3mr_dev_rmhs_complete_iou()
2262 drv_cmd->ioc_loginfo); in mpi3mr_dev_rmhs_complete_iou()
2263 if (drv_cmd->ioc_status != MPI3_IOCSTATUS_SUCCESS) { in mpi3mr_dev_rmhs_complete_iou()
2264 if (drv_cmd->retry_count < MPI3MR_DEV_RMHS_RETRY_COUNT) { in mpi3mr_dev_rmhs_complete_iou()
2265 drv_cmd->retry_count++; in mpi3mr_dev_rmhs_complete_iou()
2268 __func__, drv_cmd->dev_handle, in mpi3mr_dev_rmhs_complete_iou()
2269 drv_cmd->retry_count); in mpi3mr_dev_rmhs_complete_iou()
2270 mpi3mr_dev_rmhs_send_tm(mrioc, drv_cmd->dev_handle, in mpi3mr_dev_rmhs_complete_iou()
2271 drv_cmd, drv_cmd->iou_rc); in mpi3mr_dev_rmhs_complete_iou()
2276 __func__, drv_cmd->dev_handle); in mpi3mr_dev_rmhs_complete_iou()
2280 __func__, drv_cmd->dev_handle); in mpi3mr_dev_rmhs_complete_iou()
2281 clear_bit(drv_cmd->dev_handle, mrioc->removepend_bitmap); in mpi3mr_dev_rmhs_complete_iou()
2287 drv_cmd->dev_handle = delayed_dev_rmhs->handle; in mpi3mr_dev_rmhs_complete_iou()
2288 drv_cmd->retry_count = 0; in mpi3mr_dev_rmhs_complete_iou()
2289 drv_cmd->iou_rc = delayed_dev_rmhs->iou_rc; in mpi3mr_dev_rmhs_complete_iou()
2292 __func__, drv_cmd->dev_handle); in mpi3mr_dev_rmhs_complete_iou()
2293 mpi3mr_dev_rmhs_send_tm(mrioc, drv_cmd->dev_handle, drv_cmd, in mpi3mr_dev_rmhs_complete_iou()
2294 drv_cmd->iou_rc); in mpi3mr_dev_rmhs_complete_iou()
2301 drv_cmd->state = MPI3MR_CMD_NOTUSED; in mpi3mr_dev_rmhs_complete_iou()
2302 drv_cmd->callback = NULL; in mpi3mr_dev_rmhs_complete_iou()
2303 drv_cmd->retry_count = 0; in mpi3mr_dev_rmhs_complete_iou()
2304 drv_cmd->dev_handle = MPI3MR_INVALID_DEV_HANDLE; in mpi3mr_dev_rmhs_complete_iou()
2320 struct mpi3mr_drv_cmd *drv_cmd) in mpi3mr_dev_rmhs_complete_tm() argument
2323 u16 cmd_idx = drv_cmd->host_tag - MPI3MR_HOSTTAG_DEVRMCMD_MIN; in mpi3mr_dev_rmhs_complete_tm()
2327 if (drv_cmd->state & MPI3MR_CMD_RESET) in mpi3mr_dev_rmhs_complete_tm()
2330 if (drv_cmd->state & MPI3MR_CMD_REPLY_VALID) in mpi3mr_dev_rmhs_complete_tm()
2331 tm_reply = (struct mpi3_scsi_task_mgmt_reply *)drv_cmd->reply; in mpi3mr_dev_rmhs_complete_tm()
2336 mrioc->name, drv_cmd->dev_handle, drv_cmd->ioc_status, in mpi3mr_dev_rmhs_complete_tm()
2337 drv_cmd->ioc_loginfo, in mpi3mr_dev_rmhs_complete_tm()
2341 mrioc->name, drv_cmd->dev_handle, cmd_idx); in mpi3mr_dev_rmhs_complete_tm()
2345 drv_cmd->state = MPI3MR_CMD_PENDING; in mpi3mr_dev_rmhs_complete_tm()
2346 drv_cmd->is_waiting = 0; in mpi3mr_dev_rmhs_complete_tm()
2347 drv_cmd->callback = mpi3mr_dev_rmhs_complete_iou; in mpi3mr_dev_rmhs_complete_tm()
2348 iou_ctrl.operation = drv_cmd->iou_rc; in mpi3mr_dev_rmhs_complete_tm()
2349 iou_ctrl.param16[0] = cpu_to_le16(drv_cmd->dev_handle); in mpi3mr_dev_rmhs_complete_tm()
2350 iou_ctrl.host_tag = cpu_to_le16(drv_cmd->host_tag); in mpi3mr_dev_rmhs_complete_tm()
2363 drv_cmd->state = MPI3MR_CMD_NOTUSED; in mpi3mr_dev_rmhs_complete_tm()
2364 drv_cmd->callback = NULL; in mpi3mr_dev_rmhs_complete_tm()
2365 drv_cmd->dev_handle = MPI3MR_INVALID_DEV_HANDLE; in mpi3mr_dev_rmhs_complete_tm()
2366 drv_cmd->retry_count = 0; in mpi3mr_dev_rmhs_complete_tm()
2390 struct mpi3mr_drv_cmd *drv_cmd = cmdparam; in mpi3mr_dev_rmhs_send_tm() local
2401 if (drv_cmd) in mpi3mr_dev_rmhs_send_tm()
2427 drv_cmd = &mrioc->dev_rmhs_cmds[cmd_idx]; in mpi3mr_dev_rmhs_send_tm()
2430 cmd_idx = drv_cmd->host_tag - MPI3MR_HOSTTAG_DEVRMCMD_MIN; in mpi3mr_dev_rmhs_send_tm()
2436 if (drv_cmd->state & MPI3MR_CMD_PENDING) { in mpi3mr_dev_rmhs_send_tm()
2440 drv_cmd->state = MPI3MR_CMD_PENDING; in mpi3mr_dev_rmhs_send_tm()
2441 drv_cmd->is_waiting = 0; in mpi3mr_dev_rmhs_send_tm()
2442 drv_cmd->callback = mpi3mr_dev_rmhs_complete_tm; in mpi3mr_dev_rmhs_send_tm()
2443 drv_cmd->dev_handle = handle; in mpi3mr_dev_rmhs_send_tm()
2444 drv_cmd->iou_rc = iou_rc; in mpi3mr_dev_rmhs_send_tm()
2447 tm_req.host_tag = cpu_to_le16(drv_cmd->host_tag); in mpi3mr_dev_rmhs_send_tm()
2461 drv_cmd->state = MPI3MR_CMD_NOTUSED; in mpi3mr_dev_rmhs_send_tm()
2462 drv_cmd->callback = NULL; in mpi3mr_dev_rmhs_send_tm()
2463 drv_cmd->dev_handle = MPI3MR_INVALID_DEV_HANDLE; in mpi3mr_dev_rmhs_send_tm()
2464 drv_cmd->retry_count = 0; in mpi3mr_dev_rmhs_send_tm()
2480 struct mpi3mr_drv_cmd *drv_cmd) in mpi3mr_complete_evt_ack() argument
2482 u16 cmd_idx = drv_cmd->host_tag - MPI3MR_HOSTTAG_EVTACKCMD_MIN; in mpi3mr_complete_evt_ack()
2485 if (drv_cmd->state & MPI3MR_CMD_RESET) in mpi3mr_complete_evt_ack()
2488 if (drv_cmd->ioc_status != MPI3_IOCSTATUS_SUCCESS) { in mpi3mr_complete_evt_ack()
2491 (drv_cmd->ioc_status & MPI3_IOCSTATUS_STATUS_MASK), in mpi3mr_complete_evt_ack()
2492 drv_cmd->ioc_loginfo); in mpi3mr_complete_evt_ack()
2499 mpi3mr_send_event_ack(mrioc, delayed_evtack->event, drv_cmd, in mpi3mr_complete_evt_ack()
2506 drv_cmd->state = MPI3MR_CMD_NOTUSED; in mpi3mr_complete_evt_ack()
2507 drv_cmd->callback = NULL; in mpi3mr_complete_evt_ack()
2532 struct mpi3mr_drv_cmd *drv_cmd = cmdparam; in mpi3mr_send_event_ack() local
2535 if (drv_cmd) { in mpi3mr_send_event_ack()
2570 drv_cmd = &mrioc->evtack_cmds[cmd_idx]; in mpi3mr_send_event_ack()
2573 cmd_idx = drv_cmd->host_tag - MPI3MR_HOSTTAG_EVTACKCMD_MIN; in mpi3mr_send_event_ack()
2576 if (drv_cmd->state & MPI3MR_CMD_PENDING) { in mpi3mr_send_event_ack()
2581 drv_cmd->state = MPI3MR_CMD_PENDING; in mpi3mr_send_event_ack()
2582 drv_cmd->is_waiting = 0; in mpi3mr_send_event_ack()
2583 drv_cmd->callback = mpi3mr_complete_evt_ack; in mpi3mr_send_event_ack()
2584 evtack_req.host_tag = cpu_to_le16(drv_cmd->host_tag); in mpi3mr_send_event_ack()
2602 drv_cmd->state = MPI3MR_CMD_NOTUSED; in mpi3mr_send_event_ack()
2603 drv_cmd->callback = NULL; in mpi3mr_send_event_ack()
3786 struct mpi3mr_drv_cmd *drv_cmd, in mpi3mr_issue_tm() argument
3808 mutex_lock(&drv_cmd->mutex); in mpi3mr_issue_tm()
3809 if (drv_cmd->state & MPI3MR_CMD_PENDING) { in mpi3mr_issue_tm()
3812 mutex_unlock(&drv_cmd->mutex); in mpi3mr_issue_tm()
3818 mutex_unlock(&drv_cmd->mutex); in mpi3mr_issue_tm()
3825 mutex_unlock(&drv_cmd->mutex); in mpi3mr_issue_tm()
3829 drv_cmd->state = MPI3MR_CMD_PENDING; in mpi3mr_issue_tm()
3830 drv_cmd->is_waiting = 1; in mpi3mr_issue_tm()
3831 drv_cmd->callback = NULL; in mpi3mr_issue_tm()
3862 init_completion(&drv_cmd->done); in mpi3mr_issue_tm()
3868 wait_for_completion_timeout(&drv_cmd->done, (timeout * HZ)); in mpi3mr_issue_tm()
3870 if (!(drv_cmd->state & MPI3MR_CMD_COMPLETE)) { in mpi3mr_issue_tm()
3871 drv_cmd->is_waiting = 0; in mpi3mr_issue_tm()
3873 if (!(drv_cmd->state & MPI3MR_CMD_RESET)) { in mpi3mr_issue_tm()
3885 if (!(drv_cmd->state & MPI3MR_CMD_REPLY_VALID)) { in mpi3mr_issue_tm()
3891 tm_reply = (struct mpi3_scsi_task_mgmt_reply *)drv_cmd->reply; in mpi3mr_issue_tm()
3893 switch (drv_cmd->ioc_status) { in mpi3mr_issue_tm()
3904 handle, drv_cmd->ioc_status, drv_cmd->ioc_loginfo); in mpi3mr_issue_tm()
3924 tm_type, handle, drv_cmd->ioc_status, drv_cmd->ioc_loginfo, in mpi3mr_issue_tm()
3958 drv_cmd->state = MPI3MR_CMD_NOTUSED; in mpi3mr_issue_tm()
3959 mutex_unlock(&drv_cmd->mutex); in mpi3mr_issue_tm()