forked from xuos/xiuos
Modifying functions in usb core is related to xhci.
This commit is contained in:
parent
56b8a29888
commit
dd55f8d731
|
@ -28,6 +28,7 @@ typedef void (*usbh_complete_callback_t)(void *arg, int nbytes);
|
||||||
typedef void *usbh_pipe_t;
|
typedef void *usbh_pipe_t;
|
||||||
|
|
||||||
struct usbh_bus;
|
struct usbh_bus;
|
||||||
|
struct usbh_hub;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief USB Endpoint Configuration.
|
* @brief USB Endpoint Configuration.
|
||||||
|
|
|
@ -89,27 +89,6 @@ static inline void usbh_control_urb_fill(struct usbh_urb *urb,
|
||||||
urb->arg = arg;
|
urb->arg = arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void usbh_control_urb_fill_xiuos(struct usbh_urb *urb,
|
|
||||||
struct usbh_hubport *hport,
|
|
||||||
usbh_pipe_t pipe,
|
|
||||||
struct usb_setup_packet *setup,
|
|
||||||
uint8_t *transfer_buffer,
|
|
||||||
uint32_t transfer_buffer_length,
|
|
||||||
uint32_t timeout,
|
|
||||||
usbh_complete_callback_t complete,
|
|
||||||
void *arg)
|
|
||||||
{
|
|
||||||
struct usbh_bus *usb = usbh_get_bus_of_port(hport);
|
|
||||||
urb->usb_hc_type = usb->usb_hc_type;
|
|
||||||
urb->pipe = pipe;
|
|
||||||
urb->setup = setup;
|
|
||||||
urb->transfer_buffer = transfer_buffer;
|
|
||||||
urb->transfer_buffer_length = transfer_buffer_length;
|
|
||||||
urb->timeout = timeout;
|
|
||||||
urb->complete = complete;
|
|
||||||
urb->arg = arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void usbh_bulk_urb_fill(struct usbh_urb *urb,
|
static inline void usbh_bulk_urb_fill(struct usbh_urb *urb,
|
||||||
usbh_pipe_t pipe,
|
usbh_pipe_t pipe,
|
||||||
uint8_t *transfer_buffer,
|
uint8_t *transfer_buffer,
|
||||||
|
@ -127,26 +106,6 @@ static inline void usbh_bulk_urb_fill(struct usbh_urb *urb,
|
||||||
urb->arg = arg;
|
urb->arg = arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void usbh_bulk_urb_fill_xiuos(struct usbh_urb *urb,
|
|
||||||
struct usbh_hubport *hport,
|
|
||||||
usbh_pipe_t pipe,
|
|
||||||
uint8_t *transfer_buffer,
|
|
||||||
uint32_t transfer_buffer_length,
|
|
||||||
uint32_t timeout,
|
|
||||||
usbh_complete_callback_t complete,
|
|
||||||
void *arg)
|
|
||||||
{
|
|
||||||
struct usbh_bus *usb = usbh_get_bus_of_port(hport);
|
|
||||||
urb->usb_hc_type = usb->usb_hc_type;
|
|
||||||
urb->pipe = pipe;
|
|
||||||
urb->setup = NULL;
|
|
||||||
urb->transfer_buffer = transfer_buffer;
|
|
||||||
urb->transfer_buffer_length = transfer_buffer_length;
|
|
||||||
urb->timeout = timeout;
|
|
||||||
urb->complete = complete;
|
|
||||||
urb->arg = arg;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void usbh_int_urb_fill(struct usbh_urb *urb,
|
static inline void usbh_int_urb_fill(struct usbh_urb *urb,
|
||||||
usbh_pipe_t pipe,
|
usbh_pipe_t pipe,
|
||||||
uint8_t *transfer_buffer,
|
uint8_t *transfer_buffer,
|
||||||
|
@ -164,25 +123,6 @@ static inline void usbh_int_urb_fill(struct usbh_urb *urb,
|
||||||
urb->arg = arg;
|
urb->arg = arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void usbh_int_urb_fill_xiuos(struct usbh_urb *urb,
|
|
||||||
struct usbh_hubport *hport,
|
|
||||||
usbh_pipe_t pipe,
|
|
||||||
uint8_t *transfer_buffer,
|
|
||||||
uint32_t transfer_buffer_length,
|
|
||||||
uint32_t timeout,
|
|
||||||
usbh_complete_callback_t complete,
|
|
||||||
void *arg)
|
|
||||||
{
|
|
||||||
struct usbh_bus *usb = usbh_get_bus_of_port(hport);
|
|
||||||
urb->usb_hc_type = usb->usb_hc_type;
|
|
||||||
urb->pipe = pipe;
|
|
||||||
urb->setup = NULL;
|
|
||||||
urb->transfer_buffer = transfer_buffer;
|
|
||||||
urb->transfer_buffer_length = transfer_buffer_length;
|
|
||||||
urb->timeout = timeout;
|
|
||||||
urb->complete = complete;
|
|
||||||
urb->arg = arg;
|
|
||||||
}
|
|
||||||
struct usbh_class_info {
|
struct usbh_class_info {
|
||||||
uint8_t match_flags; /* Used for product specific matches; range is inclusive */
|
uint8_t match_flags; /* Used for product specific matches; range is inclusive */
|
||||||
uint8_t class; /* Base device class code */
|
uint8_t class; /* Base device class code */
|
||||||
|
@ -355,6 +295,67 @@ struct usbh_bus* usbh_get_bus_of_index(uint8_t usb);
|
||||||
*/
|
*/
|
||||||
struct usbh_hubport * usbh_root_hub_port ( struct usbh_hubport *hport );
|
struct usbh_hubport * usbh_root_hub_port ( struct usbh_hubport *hport );
|
||||||
|
|
||||||
|
static inline void usbh_control_urb_fill_xiuos(struct usbh_urb *urb,
|
||||||
|
struct usbh_hubport *hport,
|
||||||
|
usbh_pipe_t pipe,
|
||||||
|
struct usb_setup_packet *setup,
|
||||||
|
uint8_t *transfer_buffer,
|
||||||
|
uint32_t transfer_buffer_length,
|
||||||
|
uint32_t timeout,
|
||||||
|
usbh_complete_callback_t complete,
|
||||||
|
void *arg)
|
||||||
|
{
|
||||||
|
struct usbh_bus *usb = usbh_get_bus_of_port(hport);
|
||||||
|
urb->usb_hc_type = usb->usb_hc_type;
|
||||||
|
urb->pipe = pipe;
|
||||||
|
urb->setup = setup;
|
||||||
|
urb->transfer_buffer = transfer_buffer;
|
||||||
|
urb->transfer_buffer_length = transfer_buffer_length;
|
||||||
|
urb->timeout = timeout;
|
||||||
|
urb->complete = complete;
|
||||||
|
urb->arg = arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void usbh_bulk_urb_fill_xiuos(struct usbh_urb *urb,
|
||||||
|
struct usbh_hubport *hport,
|
||||||
|
usbh_pipe_t pipe,
|
||||||
|
uint8_t *transfer_buffer,
|
||||||
|
uint32_t transfer_buffer_length,
|
||||||
|
uint32_t timeout,
|
||||||
|
usbh_complete_callback_t complete,
|
||||||
|
void *arg)
|
||||||
|
{
|
||||||
|
struct usbh_bus *usb = usbh_get_bus_of_port(hport);
|
||||||
|
urb->usb_hc_type = usb->usb_hc_type;
|
||||||
|
urb->pipe = pipe;
|
||||||
|
urb->setup = NULL;
|
||||||
|
urb->transfer_buffer = transfer_buffer;
|
||||||
|
urb->transfer_buffer_length = transfer_buffer_length;
|
||||||
|
urb->timeout = timeout;
|
||||||
|
urb->complete = complete;
|
||||||
|
urb->arg = arg;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void usbh_int_urb_fill_xiuos(struct usbh_urb *urb,
|
||||||
|
struct usbh_hubport *hport,
|
||||||
|
usbh_pipe_t pipe,
|
||||||
|
uint8_t *transfer_buffer,
|
||||||
|
uint32_t transfer_buffer_length,
|
||||||
|
uint32_t timeout,
|
||||||
|
usbh_complete_callback_t complete,
|
||||||
|
void *arg)
|
||||||
|
{
|
||||||
|
struct usbh_bus *usb = usbh_get_bus_of_port(hport);
|
||||||
|
urb->usb_hc_type = usb->usb_hc_type;
|
||||||
|
urb->pipe = pipe;
|
||||||
|
urb->setup = NULL;
|
||||||
|
urb->transfer_buffer = transfer_buffer;
|
||||||
|
urb->transfer_buffer_length = transfer_buffer_length;
|
||||||
|
urb->timeout = timeout;
|
||||||
|
urb->complete = complete;
|
||||||
|
urb->arg = arg;
|
||||||
|
}
|
||||||
|
|
||||||
int usbh_initialize(uint32_t id, struct usbh_bus *usb);
|
int usbh_initialize(uint32_t id, struct usbh_bus *usb);
|
||||||
struct usbh_hubport *usbh_find_hubport(uint32_t id, uint8_t dev_addr);
|
struct usbh_hubport *usbh_find_hubport(uint32_t id, uint8_t dev_addr);
|
||||||
void *usbh_find_class_instance(const char *devname);
|
void *usbh_find_class_instance(const char *devname);
|
||||||
|
|
Loading…
Reference in New Issue