summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsakumisu <[email protected]>2024-06-07 21:51:33 +0800
committersakumisu <[email protected]>2024-06-07 21:51:33 +0800
commit935325175f093e382a7897ef9147b571eaa75645 (patch)
treefc0c8686655153633aaf5b89832b8c970347ed7b
parent6fd87902b5aa4b7eb9b9df2f093230c9a53a61f7 (diff)
remove old xhci patch
-rw-r--r--class/hub/usbh_hub.c22
-rw-r--r--core/usbh_core.c17
-rw-r--r--core/usbh_core.h3
-rw-r--r--docs/source/api/api_host.rst3
4 files changed, 0 insertions, 45 deletions
diff --git a/class/hub/usbh_hub.c b/class/hub/usbh_hub.c
index 6755b859..0d3e4b8c 100644
--- a/class/hub/usbh_hub.c
+++ b/class/hub/usbh_hub.c
@@ -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 */
diff --git a/core/usbh_core.c b/core/usbh_core.c
index cda801c3..18df49c3 100644
--- a/core/usbh_core.c
+++ b/core/usbh_core.c
@@ -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;
diff --git a/core/usbh_core.h b/core/usbh_core.h
index 731133b5..baf6df9a 100644
--- a/core/usbh_core.h
+++ b/core/usbh_core.h
@@ -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;
diff --git a/docs/source/api/api_host.rst b/docs/source/api/api_host.rst
index 1378df87..4fb12f20 100644
--- a/docs/source/api/api_host.rst
+++ b/docs/source/api/api_host.rst
@@ -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;