2020-04-23 02:23:59 +02:00
|
|
|
/*
|
2023-01-06 15:36:05 -05:00
|
|
|
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
|
|
|
|
* running old operating systems and software designed for IBM
|
|
|
|
|
* PC systems and compatibles from 1981 through fairly recent
|
|
|
|
|
* system designs based on the PCI bus.
|
2020-04-23 02:23:59 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* This file is part of the 86Box distribution.
|
2020-04-23 02:23:59 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Definitions for the Distributed DMA emulation.
|
2020-04-23 02:23:59 +02:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Authors: Miran Grca, <mgrca8@gmail.com>
|
2020-04-23 02:23:59 +02:00
|
|
|
*
|
2023-01-06 15:36:05 -05:00
|
|
|
* Copyright 2020 Miran Grca.
|
2020-04-23 02:23:59 +02:00
|
|
|
*/
|
2022-02-18 19:42:21 -05:00
|
|
|
|
2020-04-23 02:23:59 +02:00
|
|
|
#ifndef USB_H
|
2022-09-18 17:15:38 -04:00
|
|
|
#define USB_H
|
2020-04-23 02:23:59 +02:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
2017-01-22 00:22:14 -06:00
|
|
|
|
2023-04-30 23:01:15 +06:00
|
|
|
typedef struct usb_t usb_t;
|
|
|
|
|
|
|
|
|
|
/* USB device creation parameters struct */
|
2017-01-22 00:22:14 -06:00
|
|
|
typedef struct
|
2023-04-30 23:01:15 +06:00
|
|
|
{
|
|
|
|
|
void (*raise_interrupt)(usb_t*, void*);
|
|
|
|
|
void* parent_priv;
|
|
|
|
|
} usb_params_t;
|
|
|
|
|
|
|
|
|
|
/* USB Host Controller device struct */
|
|
|
|
|
typedef struct usb_t
|
2017-01-22 00:22:14 -06:00
|
|
|
{
|
2022-09-18 17:15:38 -04:00
|
|
|
uint8_t uhci_io[32], ohci_mmio[4096];
|
|
|
|
|
uint16_t uhci_io_base;
|
|
|
|
|
int uhci_enable, ohci_enable;
|
|
|
|
|
uint32_t ohci_mem_base;
|
|
|
|
|
mem_mapping_t ohci_mmio_mapping;
|
2023-04-30 23:01:15 +06:00
|
|
|
|
|
|
|
|
usb_params_t* usb_params;
|
2020-04-23 02:23:59 +02:00
|
|
|
} usb_t;
|
|
|
|
|
|
2023-04-30 00:59:11 +06:00
|
|
|
/* USB endpoint device struct. Incomplete and unused. */
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
uint16_t vendor_id;
|
|
|
|
|
uint16_t device_id;
|
|
|
|
|
} usb_device_t;
|
|
|
|
|
|
2020-04-23 02:23:59 +02:00
|
|
|
/* Global variables. */
|
2022-09-18 17:15:38 -04:00
|
|
|
extern const device_t usb_device;
|
2020-04-23 02:23:59 +02:00
|
|
|
|
|
|
|
|
/* Functions. */
|
2022-09-18 17:15:38 -04:00
|
|
|
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);
|
2020-04-23 02:23:59 +02:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2022-09-18 17:15:38 -04:00
|
|
|
#endif /*USB_H*/
|