Lines Matching refs:devip

797 static void clear_luns_changed_on_target(struct sdebug_dev_info *devip)  in clear_luns_changed_on_target()  argument
805 if ((devip->sdbg_host == dp->sdbg_host) && in clear_luns_changed_on_target()
806 (devip->target == dp->target)) in clear_luns_changed_on_target()
814 struct sdebug_dev_info * devip) in check_readiness() argument
819 k = find_first_bit(devip->uas_bm, SDEBUG_NUM_UAS); in check_readiness()
871 clear_luns_changed_on_target(devip); in check_readiness()
885 clear_bit(k, devip->uas_bm); in check_readiness()
892 if ((UAS_TUR == uas_only) && devip->stopped) { in check_readiness()
1282 static int resp_inquiry(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_inquiry() argument
1297 else if (scsi_debug_no_lun_0 && (0 == devip->lun)) in resp_inquiry()
1309 int host_no = devip->sdbg_host->shost->host_no; in resp_inquiry()
1312 (devip->channel & 0x7f); in resp_inquiry()
1316 (devip->target * 1000) + devip->lun); in resp_inquiry()
1318 (devip->target * 1000) - 3; in resp_inquiry()
1428 struct sdebug_dev_info * devip) in resp_requests() argument
1489 struct sdebug_dev_info * devip) in resp_start_stop() argument
1500 if (start == devip->stopped) in resp_start_stop()
1501 devip->stopped = !start; in resp_start_stop()
1516 struct sdebug_dev_info * devip) in resp_readcap() argument
1543 struct sdebug_dev_info * devip) in resp_readcap16() argument
1585 struct sdebug_dev_info * devip) in resp_report_tgtpgs() argument
1589 int host_no = devip->sdbg_host->shost->host_no; in resp_report_tgtpgs()
1608 (devip->channel & 0x7f); in resp_report_tgtpgs()
1610 (devip->channel & 0x7f) + 0x80; in resp_report_tgtpgs()
1666 resp_rsup_opcodes(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_rsup_opcodes() argument
1817 resp_rsup_tmfs(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_rsup_tmfs() argument
2003 resp_mode_sense(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_mode_sense() argument
2030 target_dev_id = ((devip->sdbg_host->shost->host_no + 1) * 2000) + in resp_mode_sense()
2031 (devip->target * 1000) - 3; in resp_mode_sense()
2162 resp_mode_select(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_mode_select() argument
2236 set_bit(SDEBUG_UA_MODE_CHANGED, devip->uas_bm); in resp_mode_select()
2266 struct sdebug_dev_info * devip) in resp_log_sense() argument
2545 resp_read_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_read_dt0() argument
2864 resp_write_dt0(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_dt0() argument
3036 resp_write_same_10(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_same_10() argument
3061 resp_write_same_16(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_same_16() argument
3092 resp_write_buffer(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_write_buffer() argument
3103 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in resp_write_buffer()
3104 set_bit(SDEBUG_UA_MICROCODE_CHANGED, devip->uas_bm); in resp_write_buffer()
3107 set_bit(SDEBUG_UA_MICROCODE_CHANGED_WO_RESET, devip->uas_bm); in resp_write_buffer()
3112 &devip->sdbg_host->dev_info_list, in resp_write_buffer()
3116 if (devip != dp) in resp_write_buffer()
3124 &devip->sdbg_host->dev_info_list, in resp_write_buffer()
3138 resp_comp_write(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_comp_write() argument
3221 resp_unmap(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_unmap() argument
3280 resp_get_lba_status(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_get_lba_status() argument
3322 struct sdebug_dev_info * devip) in resp_report_luns() argument
3333 clear_luns_changed_on_target(devip); in resp_report_luns()
3379 unsigned int num, struct sdebug_dev_info *devip) in resp_xdwriteread() argument
3415 resp_xdwriteread_10(struct scsi_cmnd *scp, struct sdebug_dev_info *devip) in resp_xdwriteread_10() argument
3427 errsts = resp_read_dt0(scp, devip); in resp_xdwriteread_10()
3431 errsts = resp_write_dt0(scp, devip); in resp_xdwriteread_10()
3437 return resp_xdwriteread(scp, lba, num, devip); in resp_xdwriteread_10()
3448 struct sdebug_dev_info *devip; in sdebug_q_cmd_complete() local
3464 devip = (struct sdebug_dev_info *)scp->device->hostdata; in sdebug_q_cmd_complete()
3465 if (devip) in sdebug_q_cmd_complete()
3466 atomic_dec(&devip->num_in_q); in sdebug_q_cmd_complete()
3508 struct sdebug_dev_info *devip; in sdebug_q_cmd_hrt_complete() local
3524 devip = (struct sdebug_dev_info *)scp->device->hostdata; in sdebug_q_cmd_hrt_complete()
3525 if (devip) in sdebug_q_cmd_hrt_complete()
3526 atomic_dec(&devip->num_in_q); in sdebug_q_cmd_hrt_complete()
3563 struct sdebug_dev_info *devip; in sdebug_device_create() local
3565 devip = kzalloc(sizeof(*devip), flags); in sdebug_device_create()
3566 if (devip) { in sdebug_device_create()
3567 devip->sdbg_host = sdbg_host; in sdebug_device_create()
3568 list_add_tail(&devip->dev_list, &sdbg_host->dev_info_list); in sdebug_device_create()
3570 return devip; in sdebug_device_create()
3577 struct sdebug_dev_info * devip = in devInfoReg() local
3580 if (devip) in devInfoReg()
3581 return devip; in devInfoReg()
3587 list_for_each_entry(devip, &sdbg_host->dev_info_list, dev_list) { in devInfoReg()
3588 if ((devip->used) && (devip->channel == sdev->channel) && in devInfoReg()
3589 (devip->target == sdev->id) && in devInfoReg()
3590 (devip->lun == sdev->lun)) in devInfoReg()
3591 return devip; in devInfoReg()
3593 if ((!devip->used) && (!open_devip)) in devInfoReg()
3594 open_devip = devip; in devInfoReg()
3626 struct sdebug_dev_info *devip; in scsi_debug_slave_configure() local
3633 devip = devInfoReg(sdp); in scsi_debug_slave_configure()
3634 if (NULL == devip) in scsi_debug_slave_configure()
3636 sdp->hostdata = devip; in scsi_debug_slave_configure()
3645 struct sdebug_dev_info *devip = in scsi_debug_slave_destroy() local
3651 if (devip) { in scsi_debug_slave_destroy()
3653 devip->used = false; in scsi_debug_slave_destroy()
3664 struct sdebug_dev_info *devip; in stop_queued_cmnd() local
3675 devip = (struct sdebug_dev_info *) in stop_queued_cmnd()
3677 if (devip) in stop_queued_cmnd()
3678 atomic_dec(&devip->num_in_q); in stop_queued_cmnd()
3709 struct sdebug_dev_info *devip; in stop_all_queued() local
3716 devip = (struct sdebug_dev_info *) in stop_all_queued()
3718 if (devip) in stop_all_queued()
3719 atomic_dec(&devip->num_in_q); in stop_all_queued()
3778 struct sdebug_dev_info * devip; in scsi_debug_device_reset() local
3786 devip = devInfoReg(sdp); in scsi_debug_device_reset()
3787 if (devip) in scsi_debug_device_reset()
3788 set_bit(SDEBUG_UA_POR, devip->uas_bm); in scsi_debug_device_reset()
3796 struct sdebug_dev_info *devip; in scsi_debug_target_reset() local
3814 list_for_each_entry(devip, in scsi_debug_target_reset()
3817 if (devip->target == sdp->id) { in scsi_debug_target_reset()
3818 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_target_reset()
3832 struct sdebug_dev_info *devip; in scsi_debug_bus_reset() local
3847 list_for_each_entry(devip, in scsi_debug_bus_reset()
3850 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_bus_reset()
3865 struct sdebug_dev_info *devip; in scsi_debug_host_reset() local
3873 list_for_each_entry(devip, &sdbg_host->dev_info_list, in scsi_debug_host_reset()
3875 set_bit(SDEBUG_UA_BUS_RESET, devip->uas_bm); in scsi_debug_host_reset()
3938 schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip, in schedule_resp() argument
3950 if (NULL == devip) { in schedule_resp()
3966 num_in_q = atomic_read(&devip->num_in_q); in schedule_resp()
4006 atomic_inc(&devip->num_in_q); in schedule_resp()
5076 struct sdebug_dev_info *devip; in sdebug_change_qdepth() local
5079 devip = (struct sdebug_dev_info *)sdev->hostdata; in sdebug_change_qdepth()
5080 if (NULL == devip) { in sdebug_change_qdepth()
5084 num_in_q = atomic_read(&devip->num_in_q); in sdebug_change_qdepth()
5144 struct sdebug_dev_info *devip; in scsi_debug_queuecommand() local
5178 devip = (struct sdebug_dev_info *)sdp->hostdata; in scsi_debug_queuecommand()
5179 if (!devip) { in scsi_debug_queuecommand()
5180 devip = devInfoReg(sdp); in scsi_debug_queuecommand()
5181 if (NULL == devip) in scsi_debug_queuecommand()
5242 SDEBUG_NUM_UAS != find_first_bit(devip->uas_bm, SDEBUG_NUM_UAS)) { in scsi_debug_queuecommand()
5243 errsts = check_readiness(scp, UAS_ONLY, devip); in scsi_debug_queuecommand()
5247 if ((F_M_ACCESS & flags) && devip->stopped) { in scsi_debug_queuecommand()
5263 errsts = oip->pfp(scp, devip); in scsi_debug_queuecommand()
5265 errsts = r_pfp(scp, devip); in scsi_debug_queuecommand()
5268 return schedule_resp(scp, devip, errsts, in scsi_debug_queuecommand()
5271 return schedule_resp(scp, devip, check_condition_result, 0); in scsi_debug_queuecommand()