diff --git a/src/include/86box/usb.h b/src/include/86box/usb.h index 10b27fd30..ecb5c0f86 100644 --- a/src/include/86box/usb.h +++ b/src/include/86box/usb.h @@ -86,12 +86,22 @@ typedef struct void* priv; } usb_device_t; +enum usb_bus_types +{ + USB_BUS_OHCI = 0, + USB_BUS_UHCI = 1 +}; + /* Global variables. */ extern const device_t usb_device; /* Functions. */ extern void uhci_update_io_mapping(usb_t *dev, uint8_t base_l, uint8_t base_h, int enable); extern void ohci_update_mem_mapping(usb_t *dev, uint8_t base1, uint8_t base2, uint8_t base3, int enable); +/* Attach USB device to a port of a USB bus. Returns the port to which it got attached to. */ +extern uint8_t usb_attach_device(usb_t *dev, usb_device_t* device, uint8_t bus_type); +/* Detach USB device from a port. */ +extern void usb_detach_device(usb_t *dev, uint8_t port, uint8_t bus_type); #ifdef __cplusplus } diff --git a/src/usb.c b/src/usb.c index 19c17f865..d0703b5d7 100644 --- a/src/usb.c +++ b/src/usb.c @@ -464,6 +464,18 @@ ohci_update_mem_mapping(usb_t *dev, uint8_t base1, uint8_t base2, uint8_t base3, mem_mapping_set_addr(&dev->ohci_mmio_mapping, dev->ohci_mem_base, 0x1000); } +uint8_t +usb_attach_device(usb_t *dev, usb_device_t* device, uint8_t bus_type) +{ + return 255; +} + +void +usb_detach_device(usb_t *dev, uint8_t port, uint8_t bus_type) +{ + /* Unused. */ +} + static void usb_reset(void *priv) {