Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Interface to the libusual.
0004  *
0005  * Copyright (c) 2005 Pete Zaitcev <zaitcev@redhat.com>
0006  * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
0007  * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com)
0008  */
0009 
0010 #ifndef __LINUX_USB_USUAL_H
0011 #define __LINUX_USB_USUAL_H
0012 
0013 
0014 /* We should do this for cleanliness... But other usb_foo.h do not do this. */
0015 /* #include <linux/usb.h> */
0016 
0017 /*
0018  * The flags field, which we store in usb_device_id.driver_info.
0019  * It is compatible with the old usb-storage flags in lower 24 bits.
0020  */
0021 
0022 /*
0023  * Static flag definitions.  We use this roundabout technique so that the
0024  * proc_info() routine can automatically display a message for each flag.
0025  */
0026 #define US_DO_ALL_FLAGS                     \
0027     US_FLAG(SINGLE_LUN, 0x00000001)         \
0028         /* allow access to only LUN 0 */        \
0029     US_FLAG(NEED_OVERRIDE,  0x00000002)         \
0030         /* unusual_devs entry is necessary */       \
0031     US_FLAG(SCM_MULT_TARG,  0x00000004)         \
0032         /* supports multiple targets */         \
0033     US_FLAG(FIX_INQUIRY,    0x00000008)         \
0034         /* INQUIRY response needs faking */     \
0035     US_FLAG(FIX_CAPACITY,   0x00000010)         \
0036         /* READ CAPACITY response too big */        \
0037     US_FLAG(IGNORE_RESIDUE, 0x00000020)         \
0038         /* reported residue is wrong */         \
0039     US_FLAG(BULK32,     0x00000040)         \
0040         /* Uses 32-byte CBW length */           \
0041     US_FLAG(NOT_LOCKABLE,   0x00000080)         \
0042         /* PREVENT/ALLOW not supported */       \
0043     US_FLAG(GO_SLOW,    0x00000100)         \
0044         /* Need delay after Command phase */        \
0045     US_FLAG(NO_WP_DETECT,   0x00000200)         \
0046         /* Don't check for write-protect */     \
0047     US_FLAG(MAX_SECTORS_64, 0x00000400)         \
0048         /* Sets max_sectors to 64    */         \
0049     US_FLAG(IGNORE_DEVICE,  0x00000800)         \
0050         /* Don't claim device */            \
0051     US_FLAG(CAPACITY_HEURISTICS,    0x00001000)     \
0052         /* sometimes sizes is too big */        \
0053     US_FLAG(MAX_SECTORS_MIN,0x00002000)         \
0054         /* Sets max_sectors to arch min */      \
0055     US_FLAG(BULK_IGNORE_TAG,0x00004000)         \
0056         /* Ignore tag mismatch in bulk operations */    \
0057     US_FLAG(SANE_SENSE,     0x00008000)         \
0058         /* Sane Sense (> 18 bytes) */           \
0059     US_FLAG(CAPACITY_OK,    0x00010000)         \
0060         /* READ CAPACITY response is correct */     \
0061     US_FLAG(BAD_SENSE,  0x00020000)         \
0062         /* Bad Sense (never more than 18 bytes) */  \
0063     US_FLAG(NO_READ_DISC_INFO,  0x00040000)     \
0064         /* cannot handle READ_DISC_INFO */      \
0065     US_FLAG(NO_READ_CAPACITY_16,    0x00080000)     \
0066         /* cannot handle READ_CAPACITY_16 */        \
0067     US_FLAG(INITIAL_READ10, 0x00100000)         \
0068         /* Initial READ(10) (and others) must be retried */ \
0069     US_FLAG(WRITE_CACHE,    0x00200000)         \
0070         /* Write Cache status is not available */   \
0071     US_FLAG(NEEDS_CAP16,    0x00400000)         \
0072         /* cannot handle READ_CAPACITY_10 */        \
0073     US_FLAG(IGNORE_UAS, 0x00800000)         \
0074         /* Device advertises UAS but it is broken */    \
0075     US_FLAG(BROKEN_FUA, 0x01000000)         \
0076         /* Cannot handle FUA in WRITE or READ CDBs */   \
0077     US_FLAG(NO_ATA_1X,  0x02000000)         \
0078         /* Cannot handle ATA_12 or ATA_16 CDBs */   \
0079     US_FLAG(NO_REPORT_OPCODES,  0x04000000)     \
0080         /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \
0081     US_FLAG(MAX_SECTORS_240,    0x08000000)     \
0082         /* Sets max_sectors to 240 */           \
0083     US_FLAG(NO_REPORT_LUNS, 0x10000000)         \
0084         /* Cannot handle REPORT_LUNS */         \
0085     US_FLAG(ALWAYS_SYNC, 0x20000000)            \
0086         /* lies about caching, so always sync */    \
0087     US_FLAG(NO_SAME, 0x40000000)                \
0088         /* Cannot handle WRITE_SAME */          \
0089     US_FLAG(SENSE_AFTER_SYNC, 0x80000000)           \
0090         /* Do REQUEST_SENSE after SYNCHRONIZE_CACHE */  \
0091 
0092 #define US_FLAG(name, value)    US_FL_##name = value ,
0093 enum { US_DO_ALL_FLAGS };
0094 #undef US_FLAG
0095 
0096 #include <linux/usb/storage.h>
0097 
0098 extern int usb_usual_ignore_device(struct usb_interface *intf);
0099 extern const struct usb_device_id usb_storage_usb_ids[];
0100 
0101 #endif /* __LINUX_USB_USUAL_H */