aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-10-29 05:03:34 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2014-03-04 18:38:18 -0500
commitd77adc0284beea5783c52b2af49217a37c2114cd (patch)
tree08c7980863f7b8b24aacdeb1089425c4d18d2c43
parentd495c1baa1b3ba277bb5ae24adeab0600151cba4 (diff)
uas: Move uas_find_endpoints to uas-detect.h
No changes, just the move. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
-rw-r--r--drivers/usb/storage/uas-detect.h27
-rw-r--r--drivers/usb/storage/uas.c27
2 files changed, 27 insertions, 27 deletions
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index 082bde1fa74d..8de030a0a4a4 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -40,6 +40,33 @@ static int uas_find_uas_alt_setting(struct usb_interface *intf)
40 return -ENODEV; 40 return -ENODEV;
41} 41}
42 42
43static int uas_find_endpoints(struct usb_host_interface *alt,
44 struct usb_host_endpoint *eps[])
45{
46 struct usb_host_endpoint *endpoint = alt->endpoint;
47 unsigned i, n_endpoints = alt->desc.bNumEndpoints;
48
49 for (i = 0; i < n_endpoints; i++) {
50 unsigned char *extra = endpoint[i].extra;
51 int len = endpoint[i].extralen;
52 while (len >= 3) {
53 if (extra[1] == USB_DT_PIPE_USAGE) {
54 unsigned pipe_id = extra[2];
55 if (pipe_id > 0 && pipe_id < 5)
56 eps[pipe_id - 1] = &endpoint[i];
57 break;
58 }
59 len -= extra[0];
60 extra += extra[0];
61 }
62 }
63
64 if (!eps[0] || !eps[1] || !eps[2] || !eps[3])
65 return -ENODEV;
66
67 return 0;
68}
69
43static int uas_use_uas_driver(struct usb_interface *intf, 70static int uas_use_uas_driver(struct usb_interface *intf,
44 const struct usb_device_id *id) 71 const struct usb_device_id *id)
45{ 72{
diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index 7662b3e13c4d..5cedc7f034b6 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -898,33 +898,6 @@ static int uas_switch_interface(struct usb_device *udev,
898 intf->altsetting[0].desc.bInterfaceNumber, alt); 898 intf->altsetting[0].desc.bInterfaceNumber, alt);
899} 899}
900 900
901static int uas_find_endpoints(struct usb_host_interface *alt,
902 struct usb_host_endpoint *eps[])
903{
904 struct usb_host_endpoint *endpoint = alt->endpoint;
905 unsigned i, n_endpoints = alt->desc.bNumEndpoints;
906
907 for (i = 0; i < n_endpoints; i++) {
908 unsigned char *extra = endpoint[i].extra;
909 int len = endpoint[i].extralen;
910 while (len >= 3) {
911 if (extra[1] == USB_DT_PIPE_USAGE) {
912 unsigned pipe_id = extra[2];
913 if (pipe_id > 0 && pipe_id < 5)
914 eps[pipe_id - 1] = &endpoint[i];
915 break;
916 }
917 len -= extra[0];
918 extra += extra[0];
919 }
920 }
921
922 if (!eps[0] || !eps[1] || !eps[2] || !eps[3])
923 return -ENODEV;
924
925 return 0;
926}
927
928static void uas_configure_endpoints(struct uas_dev_info *devinfo) 901static void uas_configure_endpoints(struct uas_dev_info *devinfo)
929{ 902{
930 struct usb_host_endpoint *eps[4] = { }; 903 struct usb_host_endpoint *eps[4] = { };