aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/storage/uas-detect.h')
-rw-r--r--drivers/usb/storage/uas-detect.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/usb/storage/uas-detect.h b/drivers/usb/storage/uas-detect.h
index f58caa9e6a27..ecc83c405a8b 100644
--- a/drivers/usb/storage/uas-detect.h
+++ b/drivers/usb/storage/uas-detect.h
@@ -9,7 +9,8 @@ static int uas_is_interface(struct usb_host_interface *intf)
9 intf->desc.bInterfaceProtocol == USB_PR_UAS); 9 intf->desc.bInterfaceProtocol == USB_PR_UAS);
10} 10}
11 11
12static int uas_find_uas_alt_setting(struct usb_interface *intf) 12static struct usb_host_interface *uas_find_uas_alt_setting(
13 struct usb_interface *intf)
13{ 14{
14 int i; 15 int i;
15 16
@@ -17,10 +18,10 @@ static int uas_find_uas_alt_setting(struct usb_interface *intf)
17 struct usb_host_interface *alt = &intf->altsetting[i]; 18 struct usb_host_interface *alt = &intf->altsetting[i];
18 19
19 if (uas_is_interface(alt)) 20 if (uas_is_interface(alt))
20 return alt->desc.bAlternateSetting; 21 return alt;
21 } 22 }
22 23
23 return -ENODEV; 24 return NULL;
24} 25}
25 26
26static int uas_find_endpoints(struct usb_host_interface *alt, 27static int uas_find_endpoints(struct usb_host_interface *alt,
@@ -58,14 +59,14 @@ static int uas_use_uas_driver(struct usb_interface *intf,
58 struct usb_device *udev = interface_to_usbdev(intf); 59 struct usb_device *udev = interface_to_usbdev(intf);
59 struct usb_hcd *hcd = bus_to_hcd(udev->bus); 60 struct usb_hcd *hcd = bus_to_hcd(udev->bus);
60 unsigned long flags = id->driver_info; 61 unsigned long flags = id->driver_info;
61 int r, alt; 62 struct usb_host_interface *alt;
62 63 int r;
63 64
64 alt = uas_find_uas_alt_setting(intf); 65 alt = uas_find_uas_alt_setting(intf);
65 if (alt < 0) 66 if (!alt)
66 return 0; 67 return 0;
67 68
68 r = uas_find_endpoints(&intf->altsetting[alt], eps); 69 r = uas_find_endpoints(alt, eps);
69 if (r < 0) 70 if (r < 0)
70 return 0; 71 return 0;
71 72
@@ -110,6 +111,10 @@ static int uas_use_uas_driver(struct usb_interface *intf,
110 } 111 }
111 } 112 }
112 113
114 /* All Seagate disk enclosures have broken ATA pass-through support */
115 if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bc2)
116 flags |= US_FL_NO_ATA_1X;
117
113 usb_stor_adjust_quirks(udev, &flags); 118 usb_stor_adjust_quirks(udev, &flags);
114 119
115 if (flags & US_FL_IGNORE_UAS) { 120 if (flags & US_FL_IGNORE_UAS) {