Lines Matching refs:lun

30                                        int channel, int id, int lun,  in do_scsi_device_find()  argument
41 if (dev->lun == lun) { in do_scsi_device_find()
71 SCSIDevice *scsi_device_find(SCSIBus *bus, int channel, int id, int lun) in scsi_device_find() argument
74 return do_scsi_device_find(bus, channel, id, lun, false); in scsi_device_find()
77 SCSIDevice *scsi_device_get(SCSIBus *bus, int channel, int id, int lun) in scsi_device_get() argument
81 d = do_scsi_device_find(bus, channel, id, lun, false); in scsi_device_get()
204 static SCSIRequest *scsi_device_alloc_req(SCSIDevice *s, uint32_t tag, uint32_t lun, in scsi_device_alloc_req() argument
209 return sc->alloc_req(s, tag, lun, buf, hba_private); in scsi_device_alloc_req()
272 int channel, int target, int lun, in scsi_bus_is_address_free() argument
278 d = do_scsi_device_find(bus, channel, target, lun, true); in scsi_bus_is_address_free()
279 if (d && d->lun == lun) { in scsi_bus_is_address_free()
304 if (dev->lun != -1 && dev->lun > bus->info->max_lun) { in scsi_bus_check_address()
305 error_setg(errp, "bad scsi device lun: %d", dev->lun); in scsi_bus_check_address()
309 if (dev->id != -1 && dev->lun != -1) { in scsi_bus_check_address()
311 if (!scsi_bus_is_address_free(bus, dev->channel, dev->id, dev->lun, &d)) { in scsi_bus_check_address()
329 if (dev->lun == -1) { in scsi_qdev_realize()
330 dev->lun = 0; in scsi_qdev_realize()
333 is_free = scsi_bus_is_address_free(bus, dev->channel, ++id, dev->lun, NULL); in scsi_qdev_realize()
340 } else if (dev->lun == -1) { in scsi_qdev_realize()
341 int lun = -1; in scsi_qdev_realize() local
343 is_free = scsi_bus_is_address_free(bus, dev->channel, dev->id, ++lun, NULL); in scsi_qdev_realize()
344 } while (!is_free && lun < bus->info->max_lun); in scsi_qdev_realize()
349 dev->lun = lun; in scsi_qdev_realize()
522 static void store_lun(uint8_t *outbuf, int lun) in store_lun() argument
524 if (lun < 256) { in store_lun()
527 outbuf[1] = lun; in store_lun()
530 outbuf[0] = 0x40 | (lun >> 8); in store_lun()
531 outbuf[1] = (lun & 255); in store_lun()
569 if (dev->channel == channel && dev->id == id && dev->lun != 0 && in scsi_target_emulate_report_luns()
571 store_lun(tmp, dev->lun); in scsi_target_emulate_report_luns()
597 assert(r->req.dev->lun != r->req.lun); in scsi_target_emulate_inquiry()
638 if (r->req.lun != 0) { in scsi_target_emulate_inquiry()
666 if (req->lun != 0 && in scsi_target_send_command()
685 if (req->lun != 0) { in scsi_target_send_command()
767 uint32_t tag, uint32_t lun, void *hba_private) in scsi_req_alloc() argument
781 req->lun = lun; in scsi_req_alloc()
794 trace_scsi_req_alloc(req->dev->id, req->lun, req->tag); in scsi_req_alloc()
798 SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun, in scsi_req_new() argument
809 trace_scsi_req_parse_bad(d->id, lun, tag, 0); in scsi_req_new()
826 } else if (lun != d->lun || in scsi_req_new()
841 trace_scsi_req_parse_bad(d->id, lun, tag, buf[0]); in scsi_req_new()
843 req = scsi_req_alloc(&reqops_invalid_opcode, d, tag, lun, hba_private); in scsi_req_new()
846 trace_scsi_req_parsed(d->id, lun, tag, buf[0], in scsi_req_new()
849 trace_scsi_req_parsed_lba(d->id, lun, tag, buf[0], in scsi_req_new()
854 req = scsi_req_alloc(&reqops_invalid_field, d, tag, lun, hba_private); in scsi_req_new()
856 req = scsi_req_alloc(ops, d, tag, lun, hba_private); in scsi_req_new()
858 req = scsi_device_alloc_req(d, tag, lun, buf, hba_private); in scsi_req_new()
867 trace_scsi_inquiry(d->id, lun, tag, cmd.buf[1], cmd.buf[2]); in scsi_req_new()
870 trace_scsi_test_unit_ready(d->id, lun, tag); in scsi_req_new()
873 trace_scsi_report_luns(d->id, lun, tag); in scsi_req_new()
876 trace_scsi_request_sense(d->id, lun, tag); in scsi_req_new()
943 trace_scsi_req_build_sense(req->dev->id, req->lun, req->tag, in scsi_req_build_sense()
975 trace_scsi_req_dequeue(req->dev->id, req->lun, req->tag); in scsi_req_dequeue()
1467 trace_scsi_req_continue_canceled(req->dev->id, req->lun, req->tag); in scsi_req_continue()
1470 trace_scsi_req_continue(req->dev->id, req->lun, req->tag); in scsi_req_continue()
1485 trace_scsi_req_data_canceled(req->dev->id, req->lun, req->tag, len); in scsi_req_data()
1488 trace_scsi_req_data(req->dev->id, req->lun, req->tag, len); in scsi_req_data()
1614 trace_scsi_req_cancel(req->dev->id, req->lun, req->tag); in scsi_req_cancel_async()
1639 trace_scsi_req_cancel(req->dev->id, req->lun, req->tag); in scsi_req_cancel()
1708 trace_scsi_device_set_ua(sdev->id, sdev->lun, sense.key, in scsi_device_set_ua()
1793 path = g_strdup_printf("%s/%d:%d:%d", id, d->channel, d->id, d->lun); in scsibus_get_dev_path()
1795 path = g_strdup_printf("%d:%d:%d", d->channel, d->id, d->lun); in scsibus_get_dev_path()
1805 qdev_fw_name(dev), d->id, d->lun); in scsibus_get_fw_dev_path()
1821 qemu_put_be32s(f, &req->lun); in put_scsi_req()
1850 uint32_t lun; in get_scsi_requests() local
1855 qemu_get_be32s(f, &lun); in get_scsi_requests()
1860 req = scsi_req_new(s, tag, lun, buf, sizeof(buf), NULL); in get_scsi_requests()
1940 DEFINE_PROP_UINT32("lun", SCSIDevice, lun, -1),