hw/usb/hcd-xhci: Fix USB_XHCI_NEC device
v2 cover hw/usb/hcd-xhci: Fix USB_XHCI_NEC device
Fix a regression since xhci-sysbus introduction.
Since v1:
- Do not declare TYPE_XHCI abstract
Cleaned a bit code style while here, patches included for 6.0.
Supersedes: <[email protected]>
Philippe Mathieu-Daudé (4):
hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI) hw/usb/hcd-xhci: Restrict TYPE_XHCI to hw/usb/ hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON
hw/usb/hcd-xhci-pci.h | 6 ++---- hw/usb/hcd-xhci.h | 1 + include/hw/usb/xhci.h | 1 - hw/usb/hcd-xhci-nec.c | 2 +- hw/usb/hcd-xhci-pci.c | 16 ++++++++-------- hw/usb/Kconfig | 4 +--- 6 files changed, 13 insertions(+), 17 deletions(-)
Signature · 1 line
2.26.2
PATCH v2 1/4 hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI)
Since commit 755fba11fbc and 8ddab8dd3d8 we can not build USB_XHCI_NEC without USB_XHCI_PCI. Correct the Kconfig dependency.
--- hw/usb/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/usb/Kconfig +1 -3
@@ -42,9 +42,7 @@ config USB_XHCI_PCI config USB_XHCI_NEC bool - default y if PCI_DEVICES - depends on PCI - select USB_XHCI + select USB_XHCI_PCI config USB_XHCI_SYSBUS bool
Signature · 1 line
2.26.2
Re: [PATCH-for-5.2 v2 1/4] hw/usb/Kconfig: Fix USB_XHCI_NEC (depends on USB_XHCI_PCI)
Quoted 10 lines · Philippe Mathieu-Daudé
Since commit
755fba11fbcand8ddab8dd3d8we can not buildUSB_XHCI_NECwithoutUSB_XHCI_PCI. Correct theKconfigdependency.Fixes 755fba11fbc ("usb/hcd-xhci: Move qemu-xhci device to hcd-xhci-pci.c")Reviewed-by Sai Pavan Boddu <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/Kconfig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
r~
PATCH v2 2/4 hw/usb/hcd-xhci: Restrict TYPE_XHCI to hw/usb/
In reply to Philippe Mathieu-DaudéTYPE_XHCI is not a generic device meant to be instantiated by QOM objects outside of hw/usb/. Do not expose the type in public namespace (via include/).
--- hw/usb/hcd-xhci.h | 1 + include/hw/usb/xhci.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
hw/usb/hcd-xhci.h +1 -0
@@ -27,6 +27,7 @@#include "hw/usb/xhci.h" #include "sysemu/dma.h" +#define TYPE_XHCI "base-xhci"OBJECT_DECLARE_SIMPLE_TYPE (XHCIState,XHCI )/* Very pessimistic, let's hope it's enough for all cases */
include/hw/usb/xhci.h +0 -1
@@ -1,7 +1,6 @@#ifndef HW_USB_XHCI_H #define HW_USB_XHCI_H -#define TYPE_XHCI "base-xhci"#define TYPE_NEC_XHCI "nec-usb-xhci"#define TYPE_QEMU_XHCI "qemu-xhci"#define TYPE_XHCI_SYSBUS "sysbus-xhci"
Signature · 1 line
2.26.2
Re: [PATCH-for-6.0 v2 2/4] hw/usb/hcd-xhci: Restrict TYPE_XHCI to hw/usb/
Quoted 9 lines · Philippe Mathieu-Daudé
TYPE_XHCIis not a generic device meant to be instantiated by QOM objects outside of hw/usb/. Do not expose the type in public namespace (viainclude/).Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/hcd-xhci.h | 1 + include/hw/usb/xhci.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
r~
PATCH v2 3/4 hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro
In reply to Philippe Mathieu-Daudé--- hw/usb/hcd-xhci-pci.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
hw/usb/hcd-xhci-pci.h +1 -3
@@ -28,9 +28,7 @@#include "hcd-xhci.h" #define TYPE_XHCI_PCI "pci-xhci" -#define XHCI_PCI (obj) \ - OBJECT_CHECK(XHCIPciState, (obj), TYPE_XHCI_PCI) - +OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI) typedef struct XHCIPciState { /*< private >*/
Signature · 1 line
2.26.2
Re: [PATCH-for-6.0 v2 3/4] hw/usb/hcd-xhci-pci: Use OBJECT_DECLARE_SIMPLE_TYPE() macro
Quoted 4 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/hcd-xhci-pci.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
r~
PATCH v2 4/4 hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON
In reply to Philippe Mathieu-DaudéFollow the code base style by using the _COMMON suffix to abstract QOM types.
--- hw/usb/hcd-xhci-pci.h | 4 ++-- hw/usb/hcd-xhci-nec.c | 2 +- hw/usb/hcd-xhci-pci.c | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-)
hw/usb/hcd-xhci-pci.h +2 -2
@@ -27,8 +27,8 @@#include "hw/usb.h" #include "hcd-xhci.h" -#define TYPE_XHCI_PCI "pci-xhci" -OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI) +#define TYPE_XHCI_PCI_COMMON "pci-xhci" +OBJECT_DECLARE_SIMPLE_TYPE(XHCIPciState, XHCI_PCI_COMMON) typedef struct XHCIPciState { /*< private >*/
hw/usb/hcd-xhci-nec.c +1 -1
@@ -52,7 +52,7 @@ static void nec_xhci_class_init(ObjectClass *klass, void *data)static const TypeInfo nec_xhci_info = { .name =TYPE_NEC_XHCI , - .parent =TYPE_XHCI_PCI , + .parent =TYPE_XHCI_PCI_COMMON , .class_init = nec_xhci_class_init, };
hw/usb/hcd-xhci-pci.c +8 -8
@@ -80,14 +80,14 @@ static void xhci_pci_intr_raise(XHCIState *xhci, int n, bool level)static void xhci_pci_reset (DeviceState *dev) { -XHCIPciState *s =XHCI_PCI (dev); +XHCIPciState *s =XHCI_PCI_COMMON (dev);device_legacy_reset (DEVICE (&s->xhci)); }static int xhci_pci_vmstate_post_load (void *opaque,int version_id) { -XHCIPciState *s =XHCI_PCI (opaque); +XHCIPciState *s =XHCI_PCI_COMMON (opaque);PCIDevice *pci_dev =PCI_DEVICE (s);int intr;
@@ -105,7 +105,7 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) {int ret;Error *err =NULL ; -XHCIPciState *s =XHCI_PCI (dev); +XHCIPciState *s =XHCI_PCI_COMMON (dev); dev->config[PCI_CLASS_PROG ] =0x30 ;/* xHCI */ dev->config[PCI_INTERRUPT_PIN ] =0x01 ;/* interrupt pin 1 */
@@ -165,7 +165,7 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp)static void usb_xhci_pci_exit (PCIDevice *dev) { -XHCIPciState *s =XHCI_PCI (dev); +XHCIPciState *s =XHCI_PCI_COMMON (dev);/* destroy msix memory region */ if (dev->msix_table && dev->msix_pba && dev->msix_entry_used) {
@@ -187,7 +187,7 @@ static const VMStateDescription vmstate_xhci_pci = {static void xhci_instance_init (Object *obj) { -XHCIPciState *s =XHCI_PCI (obj); +XHCIPciState *s =XHCI_PCI_COMMON (obj);/* * QEMU_PCI_CAP_EXPRESS initialization does not depend on QEMU command * line, therefore, no need to wait to realize like other devices
@@ -211,7 +211,7 @@ static void xhci_class_init(ObjectClass *klass, void *data) }static const TypeInfo xhci_pci_info = { - .name =TYPE_XHCI_PCI , + .name =TYPE_XHCI_PCI_COMMON , .parent =TYPE_PCI_DEVICE , .instance_size =sizeof (XHCIPciState), .class_init = xhci_class_init,
@@ -235,7 +235,7 @@ static void qemu_xhci_class_init(ObjectClass *klass, void *data)static void qemu_xhci_instance_init (Object *obj) { -XHCIPciState *s =XHCI_PCI (obj); +XHCIPciState *s =XHCI_PCI_COMMON (obj);XHCIState *xhci = &s->xhci; s->msi =ON_OFF_AUTO_OFF ;
@@ -247,7 +247,7 @@ static void qemu_xhci_instance_init(Object *obj)static const TypeInfo qemu_xhci_info = { .name =TYPE_QEMU_XHCI , - .parent =TYPE_XHCI_PCI , + .parent =TYPE_XHCI_PCI_COMMON , .class_init = qemu_xhci_class_init, .instance_init = qemu_xhci_instance_init, };
Signature · 1 line
2.26.2
Re: [PATCH-for-6.0 v2 4/4] hw/usb/hcd-xhci-pci: Rename "pci-xhci" as TYPE_XHCI_PCI_COMMON
Quoted 9 lines · Philippe Mathieu-Daudé
Follow the code base style by using the
_COMMONsuffix to abstract QOM types.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/hcd-xhci-pci.h | 4 ++-- hw/usb/hcd-xhci-nec.c | 2 +- hw/usb/hcd-xhci-pci.c | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-)
r~