mirror of https://github.com/xemu-project/xemu.git
usb/uhci: Disallow user creating a vt82c686-uhci-pci device
Because this device only works as part of VIA superio chips set user creatable to false. Since the class init method is common for UHCI variants introduce a flag in UHCIInfo for this. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <e6abf1f19ca72bbc2d8a5a6aa941edbf87a9845f.1635161629.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
d3647ef1fd
commit
ece29df33b
|
@ -1282,6 +1282,9 @@ void uhci_data_class_init(ObjectClass *klass, void *data)
|
||||||
} else {
|
} else {
|
||||||
device_class_set_props(dc, uhci_properties_standalone);
|
device_class_set_props(dc, uhci_properties_standalone);
|
||||||
}
|
}
|
||||||
|
if (info->notuser) {
|
||||||
|
dc->user_creatable = false;
|
||||||
|
}
|
||||||
u->info = *info;
|
u->info = *info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ typedef struct UHCIInfo {
|
||||||
uint8_t irq_pin;
|
uint8_t irq_pin;
|
||||||
void (*realize)(PCIDevice *dev, Error **errp);
|
void (*realize)(PCIDevice *dev, Error **errp);
|
||||||
bool unplug;
|
bool unplug;
|
||||||
|
bool notuser; /* disallow user_creatable */
|
||||||
} UHCIInfo;
|
} UHCIInfo;
|
||||||
|
|
||||||
void uhci_data_class_init(ObjectClass *klass, void *data);
|
void uhci_data_class_init(ObjectClass *klass, void *data);
|
||||||
|
|
|
@ -25,6 +25,8 @@ static UHCIInfo uhci_info[] = {
|
||||||
.irq_pin = 3,
|
.irq_pin = 3,
|
||||||
.realize = usb_uhci_vt82c686b_realize,
|
.realize = usb_uhci_vt82c686b_realize,
|
||||||
.unplug = true,
|
.unplug = true,
|
||||||
|
/* Reason: only works as USB function of VT82xx superio chips */
|
||||||
|
.notuser = true,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue