Lines Matching refs:stor_device

515 	struct storvsc_device *stor_device;  in get_out_stor_device()  local
517 stor_device = hv_get_drvdata(device); in get_out_stor_device()
519 if (stor_device && stor_device->destroy) in get_out_stor_device()
520 stor_device = NULL; in get_out_stor_device()
522 return stor_device; in get_out_stor_device()
537 struct storvsc_device *stor_device; in get_in_stor_device() local
539 stor_device = hv_get_drvdata(device); in get_in_stor_device()
541 if (!stor_device) in get_in_stor_device()
549 if (stor_device->destroy && in get_in_stor_device()
550 (atomic_read(&stor_device->num_outstanding_req) == 0)) in get_in_stor_device()
551 stor_device = NULL; in get_in_stor_device()
554 return stor_device; in get_in_stor_device()
796 struct storvsc_device *stor_device; in handle_sc_creation() local
799 stor_device = get_out_stor_device(device); in handle_sc_creation()
800 if (!stor_device) in handle_sc_creation()
803 if (stor_device->open_sub_channel == false) in handle_sc_creation()
818 struct storvsc_device *stor_device; in handle_multichannel_storage() local
826 stor_device = get_out_stor_device(device); in handle_multichannel_storage()
827 if (!stor_device) in handle_multichannel_storage()
830 request = &stor_device->init_request; in handle_multichannel_storage()
833 stor_device->open_sub_channel = true; in handle_multichannel_storage()
847 stor_device->open_sub_channel = false; in handle_multichannel_storage()
879 stor_device->open_sub_channel = true; in handle_multichannel_storage()
885 struct storvsc_device *stor_device; in storvsc_channel_init() local
892 stor_device = get_out_stor_device(device); in storvsc_channel_init()
893 if (!stor_device) in storvsc_channel_init()
896 request = &stor_device->init_request; in storvsc_channel_init()
997 stor_device->max_transfer_bytes = in storvsc_channel_init()
1154 struct storvsc_device *stor_device; in storvsc_on_io_completion() local
1157 stor_device = hv_get_drvdata(device); in storvsc_on_io_completion()
1203 if (atomic_dec_and_test(&stor_device->num_outstanding_req) && in storvsc_on_io_completion()
1204 stor_device->drain_notify) in storvsc_on_io_completion()
1205 wake_up(&stor_device->waiting_to_drain); in storvsc_on_io_completion()
1215 struct storvsc_device *stor_device; in storvsc_on_receive() local
1224 stor_device = get_in_stor_device(device); in storvsc_on_receive()
1230 work->host = stor_device->host; in storvsc_on_receive()
1243 struct storvsc_device *stor_device; in storvsc_on_channel_callback() local
1255 stor_device = get_in_stor_device(device); in storvsc_on_channel_callback()
1256 if (!stor_device) in storvsc_on_channel_callback()
1269 if ((request == &stor_device->init_request) || in storvsc_on_channel_callback()
1270 (request == &stor_device->reset_request)) { in storvsc_on_channel_callback()
1313 struct storvsc_device *stor_device; in storvsc_dev_remove() local
1316 stor_device = hv_get_drvdata(device); in storvsc_dev_remove()
1319 stor_device->destroy = true; in storvsc_dev_remove()
1328 storvsc_wait_to_drain(stor_device); in storvsc_dev_remove()
1344 kfree(stor_device); in storvsc_dev_remove()
1351 struct storvsc_device *stor_device; in storvsc_do_io() local
1357 stor_device = get_out_stor_device(device); in storvsc_do_io()
1359 if (!stor_device) in storvsc_do_io()
1405 atomic_inc(&stor_device->num_outstanding_req); in storvsc_do_io()
1473 struct storvsc_device *stor_device; in storvsc_host_reset_handler() local
1479 stor_device = get_out_stor_device(device); in storvsc_host_reset_handler()
1480 if (!stor_device) in storvsc_host_reset_handler()
1483 request = &stor_device->reset_request; in storvsc_host_reset_handler()
1490 vstor_packet->vm_srb.path_id = stor_device->path_id; in storvsc_host_reset_handler()
1495 (unsigned long)&stor_device->reset_request, in storvsc_host_reset_handler()
1514 storvsc_wait_to_drain(stor_device); in storvsc_host_reset_handler()
1750 struct storvsc_device *stor_device; in storvsc_probe() local
1804 stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL); in storvsc_probe()
1805 if (!stor_device) { in storvsc_probe()
1810 stor_device->destroy = false; in storvsc_probe()
1811 stor_device->open_sub_channel = false; in storvsc_probe()
1812 init_waitqueue_head(&stor_device->waiting_to_drain); in storvsc_probe()
1813 stor_device->device = device; in storvsc_probe()
1814 stor_device->host = host; in storvsc_probe()
1815 hv_set_drvdata(device, stor_device); in storvsc_probe()
1817 stor_device->port_number = host->host_no; in storvsc_probe()
1822 host_dev->path = stor_device->path_id; in storvsc_probe()
1823 host_dev->target = stor_device->target_id; in storvsc_probe()
1851 host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT); in storvsc_probe()
1882 kfree(stor_device); in storvsc_probe()
1891 struct storvsc_device *stor_device = hv_get_drvdata(dev); in storvsc_remove() local
1892 struct Scsi_Host *host = stor_device->host; in storvsc_remove()