From 31b7bed8b600e10c853595fb48f510c54ec86523 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 12 Mar 2021 10:04:23 +0100 Subject: usb/storage: move usb-bot device to separate source file Pure code motion, no functional change. Signed-off-by: Gerd Hoffmann Message-Id: <20210312090425.772900-3-kraxel@redhat.com> --- hw/usb/dev-storage.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'hw/usb/dev-storage.c') diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 027e29dda3..3e613ecc88 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -551,17 +551,6 @@ static const struct SCSIBusInfo usb_msd_scsi_info_storage = { .load_request = usb_msd_load_request, }; -static const struct SCSIBusInfo usb_msd_scsi_info_bot = { - .tcq = false, - .max_target = 0, - .max_lun = 15, - - .transfer_data = usb_msd_transfer_data, - .complete = usb_msd_command_complete, - .cancel = usb_msd_request_cancelled, - .load_request = usb_msd_load_request, -}; - static void usb_msd_storage_realize(USBDevice *dev, Error **errp) { MSDState *s = USB_STORAGE_DEV(dev); @@ -613,22 +602,6 @@ static void usb_msd_storage_realize(USBDevice *dev, Error **errp) s->scsi_dev = scsi_dev; } -static void usb_msd_bot_realize(USBDevice *dev, Error **errp) -{ - MSDState *s = USB_STORAGE_DEV(dev); - DeviceState *d = DEVICE(dev); - - usb_desc_create_serial(dev); - usb_desc_init(dev); - if (d->hotplugged) { - s->dev.auto_attach = 0; - } - - scsi_bus_new(&s->bus, sizeof(s->bus), DEVICE(dev), - &usb_msd_scsi_info_bot, NULL); - usb_msd_handle_reset(dev); -} - static const VMStateDescription vmstate_usb_msd = { .name = "usb-storage", .version_id = 1, @@ -734,14 +707,6 @@ static void usb_msd_instance_init(Object *obj) object_property_set_int(obj, "bootindex", -1, NULL); } -static void usb_msd_class_bot_initfn(ObjectClass *klass, void *data) -{ - USBDeviceClass *uc = USB_DEVICE_CLASS(klass); - - uc->realize = usb_msd_bot_realize; - uc->attached_settable = true; -} - static const TypeInfo msd_info = { .name = "usb-storage", .parent = TYPE_USB_STORAGE, @@ -749,17 +714,10 @@ static const TypeInfo msd_info = { .instance_init = usb_msd_instance_init, }; -static const TypeInfo bot_info = { - .name = "usb-bot", - .parent = TYPE_USB_STORAGE, - .class_init = usb_msd_class_bot_initfn, -}; - static void usb_msd_register_types(void) { type_register_static(&usb_storage_dev_type_info); type_register_static(&msd_info); - type_register_static(&bot_info); } type_init(usb_msd_register_types) -- cgit v1.2.3