Lines Matching refs:devip
794 static void clear_luns_changed_on_target(struct sdebug_dev_info *devip) in clear_luns_changed_on_target() argument
802 if ((devip->sdbg_host == dp->sdbg_host) && in clear_luns_changed_on_target()
803 (devip->target == dp->target)) in clear_luns_changed_on_target()
811 struct sdebug_dev_info * devip) in check_readiness() argument
816 k = find_first_bit(devip->uas_bm, SDEBUG_NUM_UAS); in check_readiness()
868 clear_luns_changed_on_target(devip); in check_readiness()
882 clear_bit(k, devip->uas_bm); in check_readiness()
889 if ((UAS_TUR == uas_only) && devip->stopped) { in check_readiness()
1279 static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_inquiry() argument
1294 else if (scsi_debug_no_lun_0 && (0 == devip->lun)) in resp_inquiry()
1306 int host_no = devip->sdbg_host->shost->host_no; in resp_inquiry()
1309 (devip->channel & 0x7f); in resp_inquiry()
1313 (devip->target * 1000) + devip->lun); in resp_inquiry()
1315 (devip->target * 1000) - 3; in resp_inquiry()
1425 struct sdebug_dev_info * devip) in resp_requests() argument
1487 struct sdebug_dev_info * devip) in resp_start_stop() argument
1498 if (start == devip->stopped) in resp_start_stop()
1499 devip->stopped = !start; in resp_start_stop()
1514 struct sdebug_dev_info * devip) in resp_readcap() argument
1541 struct sdebug_dev_info * devip) in resp_readcap16() argument
1583 struct sdebug_dev_info * devip) in resp_report_tgtpgs() argument
1587 int host_no = devip->sdbg_host->shost->host_no; in resp_report_tgtpgs()
1606 (devip->channel & 0x7f); in resp_report_tgtpgs()
1608 (devip->channel & 0x7f) + 0x80; in resp_report_tgtpgs()
1664 resp_rsup_opcodes(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_rsup_opcodes() argument
1815 resp_rsup_tmfs(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_rsup_tmfs() argument
2001 resp_mode_sense(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_mode_sense() argument
2028 target_dev_id = ((devip->sdbg_host->shost->host_no + 1) * 2000) + in resp_mode_sense()
2029 (devip->target * 1000) - 3; in resp_mode_sense()
2160 resp_mode_select(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_mode_select() argument
2234 set_bit(SDEBUG_UA_MODE_CHANGED, devip->uas_bm); in resp_mode_select()
2264 struct sdebug_dev_info * devip) in resp_log_sense() argument
2548 resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_read_dt0() argument
2867 resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_dt0() argument
3039 resp_write_same_10(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_same_10() argument
3064 resp_write_same_16(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_same_16() argument
3095 resp_write_buffer(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_buffer() argument
3106 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in resp_write_buffer()
3107 set_bit(SDEBUG_UA_MICROCODE_CHANGED, devip->uas_bm); in resp_write_buffer()
3110 set_bit(SDEBUG_UA_MICROCODE_CHANGED_WO_RESET, devip->uas_bm); in resp_write_buffer()
3115 &devip->sdbg_host->dev_info_list, in resp_write_buffer()
3119 if (devip != dp) in resp_write_buffer()
3127 &devip->sdbg_host->dev_info_list, in resp_write_buffer()
3141 resp_comp_write(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_comp_write() argument
3224 resp_unmap(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_unmap() argument
3283 resp_get_lba_status(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_get_lba_status() argument
3325 struct sdebug_dev_info * devip) in resp_report_luns() argument
3336 clear_luns_changed_on_target(devip); in resp_report_luns()
3382 unsigned int num, struct sdebug_dev_info *devip) in resp_xdwriteread() argument
3418 resp_xdwriteread_10(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_xdwriteread_10() argument
3430 errsts = resp_read_dt0(scp, devip); in resp_xdwriteread_10()
3434 errsts = resp_write_dt0(scp, devip); in resp_xdwriteread_10()
3440 return resp_xdwriteread(scp, lba, num, devip); in resp_xdwriteread_10()
3451 struct sdebug_dev_info *devip; in sdebug_q_cmd_complete() local
3467 devip = (struct sdebug_dev_info *)scp->device->hostdata; in sdebug_q_cmd_complete()
3468 if (devip) in sdebug_q_cmd_complete()
3469 atomic_dec(&devip->num_in_q); in sdebug_q_cmd_complete()
3511 struct sdebug_dev_info *devip; in sdebug_q_cmd_hrt_complete() local
3527 devip = (struct sdebug_dev_info *)scp->device->hostdata; in sdebug_q_cmd_hrt_complete()
3528 if (devip) in sdebug_q_cmd_hrt_complete()
3529 atomic_dec(&devip->num_in_q); in sdebug_q_cmd_hrt_complete()
3566 struct sdebug_dev_info *devip; in sdebug_device_create() local
3568 devip = kzalloc(sizeof(*devip), flags); in sdebug_device_create()
3569 if (devip) { in sdebug_device_create()
3570 devip->sdbg_host = sdbg_host; in sdebug_device_create()
3571 list_add_tail(&devip->dev_list, &sdbg_host->dev_info_list); in sdebug_device_create()
3573 return devip; in sdebug_device_create()
3580 struct sdebug_dev_info * devip = in devInfoReg() local
3583 if (devip) in devInfoReg()
3584 return devip; in devInfoReg()
3590 list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) { in devInfoReg()
3591 if ((devip->used) && (devip->channel == sdev->channel) && in devInfoReg()
3592 (devip->target == sdev->id) && in devInfoReg()
3593 (devip->lun == sdev->lun)) in devInfoReg()
3594 return devip; in devInfoReg()
3596 if ((!devip->used) && (!open_devip)) in devInfoReg()
3597 open_devip = devip; in devInfoReg()
3630 struct sdebug_dev_info *devip; in scsi_debug_slave_configure() local
3637 devip = devInfoReg(sdp); in scsi_debug_slave_configure()
3638 if (NULL == devip) in scsi_debug_slave_configure()
3640 sdp->hostdata = devip; in scsi_debug_slave_configure()
3649 struct sdebug_dev_info *devip = in scsi_debug_slave_destroy() local
3655 if (devip) { in scsi_debug_slave_destroy()
3657 devip->used = false; in scsi_debug_slave_destroy()
3668 struct sdebug_dev_info *devip; in stop_queued_cmnd() local
3679 devip = (struct sdebug_dev_info *) in stop_queued_cmnd()
3681 if (devip) in stop_queued_cmnd()
3682 atomic_dec(&devip->num_in_q); in stop_queued_cmnd()
3713 struct sdebug_dev_info *devip; in stop_all_queued() local
3720 devip = (struct sdebug_dev_info *) in stop_all_queued()
3722 if (devip) in stop_all_queued()
3723 atomic_dec(&devip->num_in_q); in stop_all_queued()
3782 struct sdebug_dev_info * devip; in scsi_debug_device_reset() local
3790 devip = devInfoReg(sdp); in scsi_debug_device_reset()
3791 if (devip) in scsi_debug_device_reset()
3792 set_bit(SDEBUG_UA_POR, devip->uas_bm); in scsi_debug_device_reset()
3800 struct sdebug_dev_info *devip; in scsi_debug_target_reset() local
3818 list_for_each_entry(devip, in scsi_debug_target_reset()
3821 if (devip->target == sdp->id) { in scsi_debug_target_reset()
3822 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_target_reset()
3836 struct sdebug_dev_info *devip; in scsi_debug_bus_reset() local
3851 list_for_each_entry(devip, in scsi_debug_bus_reset()
3854 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_bus_reset()
3869 struct sdebug_dev_info *devip; in scsi_debug_host_reset() local
3877 list_for_each_entry(devip, &sdbg_host->dev_info_list, in scsi_debug_host_reset()
3879 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_host_reset()
3943 schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, in schedule_resp() argument
3951 if (NULL == cmnd || NULL == devip) { in schedule_resp()
3965 num_in_q = atomic_read(&devip->num_in_q); in schedule_resp()
4005 atomic_inc(&devip->num_in_q); in schedule_resp()
5089 struct sdebug_dev_info *devip; in sdebug_change_qdepth() local
5092 devip = (struct sdebug_dev_info *)sdev->hostdata; in sdebug_change_qdepth()
5093 if (NULL == devip) { in sdebug_change_qdepth()
5097 num_in_q = atomic_read(&devip->num_in_q); in sdebug_change_qdepth()
5157 struct sdebug_dev_info *devip; in scsi_debug_queuecommand() local
5191 devip = (struct sdebug_dev_info *)sdp->hostdata; in scsi_debug_queuecommand()
5192 if (!devip) { in scsi_debug_queuecommand()
5193 devip = devInfoReg(sdp); in scsi_debug_queuecommand()
5194 if (NULL == devip) in scsi_debug_queuecommand()
5255 SDEBUG_NUM_UAS != find_first_bit(devip->uas_bm, SDEBUG_NUM_UAS)) { in scsi_debug_queuecommand()
5256 errsts = check_readiness(scp, UAS_ONLY, devip); in scsi_debug_queuecommand()
5260 if ((F_M_ACCESS & flags) && devip->stopped) { in scsi_debug_queuecommand()
5276 errsts = oip->pfp(scp, devip); in scsi_debug_queuecommand()
5278 errsts = r_pfp(scp, devip); in scsi_debug_queuecommand()
5281 return schedule_resp(scp, devip, errsts, in scsi_debug_queuecommand()
5284 return schedule_resp(scp, devip, check_condition_result, 0); in scsi_debug_queuecommand()