--- zzzz-none-000/linux-4.19.183/drivers/usb/host/xhci-hub.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/usb/host/xhci-hub.c 2023-06-28 08:54:20.000000000 +0000 @@ -15,6 +15,11 @@ #include "xhci.h" #include "xhci-trace.h" +#if defined(CONFIG_AVM_KERNEL) +/* 20160219 AVM/VGJ USB3 ports switchable */ +extern int usb3port_config; +#endif + #define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E) #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ PORT_RC | PORT_PLC | PORT_PE) @@ -1290,6 +1295,18 @@ * However, hub_wq will ignore the roothub events until * the roothub is registered. */ +#if defined(CONFIG_AVM_KERNEL) + { + /* 20170316 AVM/VGJ USB3 ports switchable */ + /* 20210709 AVM/WKR Update for new Kernel */ + const int port_bit = (wIndex == 0) ? 1 : 2; + + if ((hcd->speed == HCD_USB3) && !(usb3port_config & port_bit)) { + pr_info("AVM: disable USB3 bus#%d port#%d config=%x\n", hcd->self.busnum, wIndex, usb3port_config); + break; + } + } +#endif xhci_set_port_power(xhci, hcd, wIndex, true, &flags); break; case USB_PORT_FEAT_RESET: @@ -1474,6 +1491,13 @@ trace_xhci_hub_status_data(i, temp); if ((temp & mask) != 0 || +#if defined(CONFIG_BCM_KF_USB_HOSTS) && defined(CONFIG_BCM_XHCI_COMP_QUIRK) + /* when in compliance mode no change events are generated + * this check is needed for compliance mode quirk to bring + * port out of compliance mode + */ + ((temp & PORT_PLS_MASK) == USB_SS_PORT_LS_COMP_MOD) || +#endif (bus_state->port_c_suspend & 1 << i) || (bus_state->resume_done[i] && time_after_eq( jiffies, bus_state->resume_done[i]))) {