Extract the functions of the host controller to USB core.
This commit is contained in:
parent
cc22f1b8f8
commit
9f3edeb6b4
|
@ -13,9 +13,12 @@ Others: CherryUSB third-party/cherryusb/core/usbh_core.c for references
|
|||
History:
|
||||
1. Date: 2024-06-18
|
||||
Author: AIIT XUOS Lab
|
||||
Modification:
|
||||
Modify function usbh_enumerate usbh_hport_activate_ep0 usbh_hport_deactivate_ep0 and usbh_hport_activate_epx, for select host controller function.
|
||||
new function usbh_control_transfer_msg, for references usbh_control_transfer, to select host controller function by type.
|
||||
Modification: Modify function usbh_enumerate usbh_hport_activate_ep0 usbh_hport_deactivate_ep0 and usbh_hport_activate_epx, for select host controller function.
|
||||
New function usbh_control_transfer_msg, for references usbh_control_transfer, to select host controller function by type.
|
||||
|
||||
2. Date: 2024-06-19
|
||||
Author: AIIT XUOS Lab
|
||||
Modification: Extract the functions of the host controller to core.
|
||||
*************************************************/
|
||||
|
||||
#include "usbh_core.h"
|
||||
|
@ -589,7 +592,6 @@ int usbh_enumerate(struct usbh_hubport *hport)
|
|||
#ifdef CONFIG_USBHOST_XHCI
|
||||
if (USB_HC_XHCI == usb->usb_hc_type) {
|
||||
extern int usbh_get_xhci_devaddr(usbh_pipe_t * pipe);
|
||||
|
||||
/* Assign a function address to the device connected to this port */
|
||||
dev_addr = usbh_get_xhci_devaddr(hport->ep0);
|
||||
if (dev_addr < 0) {
|
||||
|
@ -1008,3 +1010,49 @@ int lsusb(int argc, char **argv)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* xhci hardware init */
|
||||
int usb_hc_init(uint32_t id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_roothub_control(struct usbh_bus *usb, struct usb_setup_packet *setup, uint8_t *buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_ep_pipe_reconfigure(struct usbh_bus *usb, usbh_pipe_t pipe, uint8_t dev_addr, uint8_t mtu, uint8_t speed)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_pipe_alloc(usbh_pipe_t *pipe, const struct usbh_endpoint_cfg *ep_cfg)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_get_xhci_devaddr(usbh_pipe_t *pipe)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_pipe_free(usbh_pipe_t pipe)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_submit_urb(struct usbh_urb *urb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usbh_kill_urb(struct usbh_urb *urb)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void USBH_IRQHandler(void *param)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -93,6 +93,8 @@ static inline struct xhci_host* xhci_get_inst_of_port(struct usbh_hubport *hport
|
|||
|
||||
static struct xhci_host xhci_host[CONFIG_USBHOST_XHCI_NUM];
|
||||
|
||||
/* Functions that need to be refactored */
|
||||
#if 0
|
||||
/* xhci hardware init */
|
||||
int usb_hc_init(uint32_t id)
|
||||
{
|
||||
|
@ -536,7 +538,7 @@ void USBH_IRQHandler(void *param)
|
|||
|
||||
(void)xhci_event_process(xhci);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Functions for xHCI drivers. These functions are called by USB core.
|
||||
|
|
Loading…
Reference in New Issue