blob: 245f57dbbb614e818d2f067f1f5c431d7e9f193b [file] [log] [blame]
Pete Zaitceva00828e2005-10-22 20:15:09 -07001/*
2 * Interface to the libusual.
3 *
4 * Copyright (c) 2005 Pete Zaitcev <zaitcev@redhat.com>
5 * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
6 * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com)
7 */
8
9#ifndef __LINUX_USB_USUAL_H
10#define __LINUX_USB_USUAL_H
11
Pete Zaitceva00828e2005-10-22 20:15:09 -070012
13/* We should do this for cleanliness... But other usb_foo.h do not do this. */
14/* #include <linux/usb.h> */
15
16/*
17 * The flags field, which we store in usb_device_id.driver_info.
18 * It is compatible with the old usb-storage flags in lower 24 bits.
19 */
20
21/*
22 * Static flag definitions. We use this roundabout technique so that the
23 * proc_info() routine can automatically display a message for each flag.
24 */
25#define US_DO_ALL_FLAGS \
26 US_FLAG(SINGLE_LUN, 0x00000001) \
27 /* allow access to only LUN 0 */ \
28 US_FLAG(NEED_OVERRIDE, 0x00000002) \
29 /* unusual_devs entry is necessary */ \
30 US_FLAG(SCM_MULT_TARG, 0x00000004) \
31 /* supports multiple targets */ \
32 US_FLAG(FIX_INQUIRY, 0x00000008) \
33 /* INQUIRY response needs faking */ \
34 US_FLAG(FIX_CAPACITY, 0x00000010) \
35 /* READ CAPACITY response too big */ \
36 US_FLAG(IGNORE_RESIDUE, 0x00000020) \
37 /* reported residue is wrong */ \
38 US_FLAG(BULK32, 0x00000040) \
39 /* Uses 32-byte CBW length */ \
40 US_FLAG(NOT_LOCKABLE, 0x00000080) \
41 /* PREVENT/ALLOW not supported */ \
42 US_FLAG(GO_SLOW, 0x00000100) \
43 /* Need delay after Command phase */ \
44 US_FLAG(NO_WP_DETECT, 0x00000200) \
45 /* Don't check for write-protect */ \
Phil Dibowitz883d9892006-06-24 17:27:10 -070046 US_FLAG(MAX_SECTORS_64, 0x00000400) \
Daniel Drake3c332422006-07-26 13:59:23 +010047 /* Sets max_sectors to 64 */ \
48 US_FLAG(IGNORE_DEVICE, 0x00000800) \
Oliver Neukum61bf54b2007-02-08 09:04:48 +010049 /* Don't claim device */ \
50 US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \
Doug Maxey33abc042007-12-05 23:36:45 -060051 /* sometimes sizes is too big */ \
52 US_FLAG(MAX_SECTORS_MIN,0x00002000) \
Constantin Baranovcc36bdd2008-03-16 20:04:23 +000053 /* Sets max_sectors to arch min */ \
54 US_FLAG(BULK_IGNORE_TAG,0x00004000) \
Ben Efros1537e0a2008-11-18 13:31:13 -080055 /* Ignore tag mismatch in bulk operations */ \
Alan Stern25ff1c32008-12-15 12:43:41 -050056 US_FLAG(SANE_SENSE, 0x00008000) \
57 /* Sane Sense (> 18 bytes) */ \
58 US_FLAG(CAPACITY_OK, 0x00010000) \
Alan Sterna0bb1082009-12-07 16:39:16 -050059 /* READ CAPACITY response is correct */ \
60 US_FLAG(BAD_SENSE, 0x00020000) \
Hans de Goedeae38c782010-10-01 14:20:10 -070061 /* Bad Sense (never more than 18 bytes) */ \
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
Hans de Goede00914022010-10-01 14:20:11 -070063 /* cannot handle READ_DISC_INFO */ \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
Alan Stern21c13a42011-06-07 11:35:52 -040065 /* cannot handle READ_CAPACITY_16 */ \
66 US_FLAG(INITIAL_READ10, 0x00100000) \
Namjae Jeoneaa05df2012-07-07 23:05:28 -040067 /* Initial READ(10) (and others) must be retried */ \
68 US_FLAG(WRITE_CACHE, 0x00200000) \
Oliver Neukum32c37fc2013-10-14 15:24:55 +020069 /* Write Cache status is not available */ \
Hans de Goede79b4c062013-10-25 17:04:33 +010070 US_FLAG(NEEDS_CAP16, 0x00400000) \
71 /* cannot handle READ_CAPACITY_10 */ \
72 US_FLAG(IGNORE_UAS, 0x00800000) \
Alan Sternb14bf2d2014-06-30 11:04:21 -040073 /* Device advertises UAS but it is broken */ \
74 US_FLAG(BROKEN_FUA, 0x01000000) \
75 /* Cannot handle FUA in WRITE or READ CDBs */ \
Hans de Goede59307852014-09-15 16:04:12 +020076 US_FLAG(NO_ATA_1X, 0x02000000) \
77 /* Cannot handle ATA_12 or ATA_16 CDBs */ \
Hans de Goede734016b2014-09-16 18:36:52 +020078 US_FLAG(NO_REPORT_OPCODES, 0x04000000) \
79 /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \
Hans de Goedeee136af2015-04-21 11:20:31 +020080 US_FLAG(MAX_SECTORS_240, 0x08000000) \
81 /* Sets max_sectors to 240 */ \
Hans de Goede13630742016-04-12 12:27:09 +020082 US_FLAG(NO_REPORT_LUNS, 0x10000000) \
83 /* Cannot handle REPORT_LUNS */ \
Pete Zaitceva00828e2005-10-22 20:15:09 -070084
85#define US_FLAG(name, value) US_FL_##name = value ,
86enum { US_DO_ALL_FLAGS };
87#undef US_FLAG
88
Matthew Wilcoxae6d22f2010-10-07 13:05:22 +020089#include <linux/usb/storage.h>
Pete Zaitceva00828e2005-10-22 20:15:09 -070090
Alan Sterne6e244b2009-02-12 14:47:44 -050091extern int usb_usual_ignore_device(struct usb_interface *intf);
92extern struct usb_device_id usb_storage_usb_ids[];
93
Pete Zaitceva00828e2005-10-22 20:15:09 -070094#endif /* __LINUX_USB_USUAL_H */