2020
2121#include "xhci.h"
2222#include "xhci-trace.h"
23- #include "xhci-mtk.h"
2423#include "xhci-debugfs.h"
2524#include "xhci-dbgcap.h"
2625
@@ -1420,6 +1419,7 @@ unsigned int xhci_get_endpoint_index(struct usb_endpoint_descriptor *desc)
14201419 (usb_endpoint_dir_in (desc ) ? 1 : 0 ) - 1 ;
14211420 return index ;
14221421}
1422+ EXPORT_SYMBOL_GPL (xhci_get_endpoint_index );
14231423
14241424/* The reverse operation to xhci_get_endpoint_index. Calculate the USB endpoint
14251425 * address from the XHCI endpoint index.
@@ -1852,8 +1852,8 @@ static int xhci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
18521852 * disabled, so there's no need for mutual exclusion to protect
18531853 * the xhci->devs[slot_id] structure.
18541854 */
1855- static int xhci_drop_endpoint (struct usb_hcd * hcd , struct usb_device * udev ,
1856- struct usb_host_endpoint * ep )
1855+ int xhci_drop_endpoint (struct usb_hcd * hcd , struct usb_device * udev ,
1856+ struct usb_host_endpoint * ep )
18571857{
18581858 struct xhci_hcd * xhci ;
18591859 struct xhci_container_ctx * in_ctx , * out_ctx ;
@@ -1913,16 +1913,14 @@ static int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
19131913
19141914 xhci_endpoint_zero (xhci , xhci -> devs [udev -> slot_id ], ep );
19151915
1916- if (xhci -> quirks & XHCI_MTK_HOST )
1917- xhci_mtk_drop_ep_quirk (hcd , udev , ep );
1918-
19191916 xhci_dbg (xhci , "drop ep 0x%x, slot id %d, new drop flags = %#x, new add flags = %#x\n" ,
19201917 (unsigned int ) ep -> desc .bEndpointAddress ,
19211918 udev -> slot_id ,
19221919 (unsigned int ) new_drop_flags ,
19231920 (unsigned int ) new_add_flags );
19241921 return 0 ;
19251922}
1923+ EXPORT_SYMBOL_GPL (xhci_drop_endpoint );
19261924
19271925/* Add an endpoint to a new possible bandwidth configuration for this device.
19281926 * Only one call to this function is allowed per endpoint before
@@ -1937,8 +1935,8 @@ static int xhci_drop_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
19371935 * configuration or alt setting is installed in the device, so there's no need
19381936 * for mutual exclusion to protect the xhci->devs[slot_id] structure.
19391937 */
1940- static int xhci_add_endpoint (struct usb_hcd * hcd , struct usb_device * udev ,
1941- struct usb_host_endpoint * ep )
1938+ int xhci_add_endpoint (struct usb_hcd * hcd , struct usb_device * udev ,
1939+ struct usb_host_endpoint * ep )
19421940{
19431941 struct xhci_hcd * xhci ;
19441942 struct xhci_container_ctx * in_ctx ;
@@ -2012,15 +2010,6 @@ static int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
20122010 return - ENOMEM ;
20132011 }
20142012
2015- if (xhci -> quirks & XHCI_MTK_HOST ) {
2016- ret = xhci_mtk_add_ep_quirk (hcd , udev , ep );
2017- if (ret < 0 ) {
2018- xhci_ring_free (xhci , virt_dev -> eps [ep_index ].new_ring );
2019- virt_dev -> eps [ep_index ].new_ring = NULL ;
2020- return ret ;
2021- }
2022- }
2023-
20242013 ctrl_ctx -> add_flags |= cpu_to_le32 (added_ctxs );
20252014 new_add_flags = le32_to_cpu (ctrl_ctx -> add_flags );
20262015
@@ -2045,6 +2034,7 @@ static int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
20452034 (unsigned int ) new_add_flags );
20462035 return 0 ;
20472036}
2037+ EXPORT_SYMBOL_GPL (xhci_add_endpoint );
20482038
20492039static void xhci_zero_in_ctx (struct xhci_hcd * xhci , struct xhci_virt_device * virt_dev )
20502040{
@@ -3078,6 +3068,7 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
30783068
30793069 return ret ;
30803070}
3071+ EXPORT_SYMBOL_GPL (xhci_check_bandwidth );
30813072
30823073void xhci_reset_bandwidth (struct usb_hcd * hcd , struct usb_device * udev )
30833074{
@@ -3102,6 +3093,7 @@ void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev)
31023093 }
31033094 xhci_zero_in_ctx (xhci , virt_dev );
31043095}
3096+ EXPORT_SYMBOL_GPL (xhci_reset_bandwidth );
31053097
31063098static void xhci_setup_input_ctx_for_config_ep (struct xhci_hcd * xhci ,
31073099 struct xhci_container_ctx * in_ctx ,
@@ -5428,6 +5420,10 @@ void xhci_init_driver(struct hc_driver *drv,
54285420 drv -> reset = over -> reset ;
54295421 if (over -> start )
54305422 drv -> start = over -> start ;
5423+ if (over -> add_endpoint )
5424+ drv -> add_endpoint = over -> add_endpoint ;
5425+ if (over -> drop_endpoint )
5426+ drv -> drop_endpoint = over -> drop_endpoint ;
54315427 if (over -> check_bandwidth )
54325428 drv -> check_bandwidth = over -> check_bandwidth ;
54335429 if (over -> reset_bandwidth )
0 commit comments