mirror of
https://github.com/sakumisu/CherryUSB.git
synced 2025-05-09 00:21:44 +08:00
remove old xhci patch
This commit is contained in:
parent
6fd87902b5
commit
935325175f
@ -27,13 +27,6 @@ extern void usbh_hubport_release(struct usbh_hubport *hport);
|
||||
|
||||
static const char *speed_table[] = { "error-speed", "low-speed", "full-speed", "high-speed", "wireless-speed", "super-speed", "superplus-speed" };
|
||||
|
||||
#ifdef CONFIG_USBHOST_XHCI
|
||||
struct usbh_hubport *usbh_get_roothub_port(unsigned int port)
|
||||
{
|
||||
return &roothub.child[port - 1];
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_USBHOST_MAX_EXTHUBS > 0
|
||||
static struct usbh_hub g_hub_class[CONFIG_USBHOST_MAX_EXTHUBS];
|
||||
static uint32_t g_devinuse = 0;
|
||||
@ -563,24 +556,9 @@ static void usbh_hub_events(struct usbh_hub *hub)
|
||||
} else if (portstatus & HUB_PORT_STATUS_LOW_SPEED) {
|
||||
speed = USB_SPEED_LOW;
|
||||
}
|
||||
#ifdef CONFIG_USBHOST_XHCI
|
||||
else {
|
||||
extern uint8_t usbh_get_port_speed(struct usbh_hub * hub, const uint8_t port);
|
||||
|
||||
/* USB3.0 speed cannot get from portstatus, checkout port speed instead */
|
||||
uint8_t super_speed = usbh_get_port_speed(hub, port + 1);
|
||||
if (super_speed > USB_SPEED_HIGH) {
|
||||
/* assert that when using USB 3.0 ports, attached device must also be USB 3.0 speed */
|
||||
speed = super_speed;
|
||||
} else {
|
||||
speed = USB_SPEED_FULL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
else {
|
||||
speed = USB_SPEED_FULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
child = &hub->child[port];
|
||||
/** release child sources first */
|
||||
|
@ -81,12 +81,6 @@ static int __usbh_free_devaddr(struct usbh_devaddr_map *devgen, uint8_t devaddr)
|
||||
|
||||
static int usbh_free_devaddr(struct usbh_hubport *hport)
|
||||
{
|
||||
#ifndef CONFIG_USBHOST_XHCI
|
||||
if (hport->dev_addr > 0) {
|
||||
__usbh_free_devaddr(&hport->bus->devgen, hport->dev_addr);
|
||||
}
|
||||
#endif
|
||||
|
||||
hport->dev_addr = 0;
|
||||
return 0;
|
||||
}
|
||||
@ -398,23 +392,12 @@ int usbh_enumerate(struct usbh_hubport *hport)
|
||||
/* Reconfigure EP0 with the correct maximum packet size */
|
||||
ep->wMaxPacketSize = ep_mps;
|
||||
|
||||
#ifdef CONFIG_USBHOST_XHCI
|
||||
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) {
|
||||
USB_LOG_ERR("Failed to allocate devaddr,errorcode:%d\r\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
#else
|
||||
/* Assign a function address to the device connected to this port */
|
||||
dev_addr = usbh_allocate_devaddr(&hport->bus->devgen);
|
||||
if (dev_addr < 0) {
|
||||
USB_LOG_ERR("Failed to allocate devaddr,errorcode:%d\r\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set the USB device address */
|
||||
setup->bmRequestType = USB_REQUEST_DIR_OUT | USB_REQUEST_STANDARD | USB_REQUEST_RECIPIENT_DEVICE;
|
||||
|
@ -110,9 +110,6 @@ struct usbh_hubport {
|
||||
struct usb_setup_packet *setup;
|
||||
struct usbh_hub *parent;
|
||||
struct usbh_bus *bus;
|
||||
#ifdef CONFIG_USBHOST_XHCI
|
||||
uint32_t protocol; /* port protocol, for xhci, some ports are USB2.0, others are USB3.0 */
|
||||
#endif
|
||||
struct usb_endpoint_descriptor ep0;
|
||||
struct usbh_urb ep0_urb;
|
||||
usb_osal_mutex_t mutex;
|
||||
|
@ -84,9 +84,6 @@ hubport 结构体
|
||||
uint8_t *raw_config_desc;
|
||||
struct usb_setup_packet *setup;
|
||||
struct usbh_hub *parent;
|
||||
#ifdef CONFIG_USBHOST_XHCI
|
||||
uint32_t protocol; /* port protocol, for xhci, some ports are USB2.0, others are USB3.0 */
|
||||
#endif
|
||||
struct usb_endpoint_descriptor ep0;
|
||||
struct usbh_urb ep0_urb;
|
||||
usb_osal_mutex_t mutex;
|
||||
|
Loading…
x
Reference in New Issue
Block a user