提交 fbec359e 编写于 作者: G Guenter Roeck 提交者: Peter Maydell

hw: usb: hcd-ohci: Move OHCISysBusState and TYPE_SYSBUS_OHCI to include file

We need to be able to use OHCISysBusState outside hcd-ohci.c, so move it
to its include file.
Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Tested-by: NNiek Linnenbank <nieklinnenbank@gmail.com>
Message-id: 20200217204812.9857-2-linux@roeck-us.net
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
上级 f6287c24
......@@ -1870,21 +1870,6 @@ void ohci_sysbus_die(struct OHCIState *ohci)
ohci_bus_stop(ohci);
}
#define TYPE_SYSBUS_OHCI "sysbus-ohci"
#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
typedef struct {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
OHCIState ohci;
char *masterbus;
uint32_t num_ports;
uint32_t firstport;
dma_addr_t dma_offset;
} OHCISysBusState;
static void ohci_realize_pxa(DeviceState *dev, Error **errp)
{
OHCISysBusState *s = SYSBUS_OHCI(dev);
......
......@@ -22,6 +22,7 @@
#define HCD_OHCI_H
#include "sysemu/dma.h"
#include "hw/usb.h"
/* Number of Downstream Ports on the root hub: */
#define OHCI_MAX_PORTS 15
......@@ -90,6 +91,21 @@ typedef struct OHCIState {
void (*ohci_die)(struct OHCIState *ohci);
} OHCIState;
#define TYPE_SYSBUS_OHCI "sysbus-ohci"
#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
typedef struct {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
OHCIState ohci;
char *masterbus;
uint32_t num_ports;
uint32_t firstport;
dma_addr_t dma_offset;
} OHCISysBusState;
extern const VMStateDescription vmstate_ohci_state;
void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册