1
2
3
4
5
6
7
8
9#ifndef __LINUX_USB_USUAL_H
10#define __LINUX_USB_USUAL_H
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#define US_DO_ALL_FLAGS \
26 US_FLAG(SINGLE_LUN, 0x00000001) \
27 \
28 US_FLAG(NEED_OVERRIDE, 0x00000002) \
29 \
30 US_FLAG(SCM_MULT_TARG, 0x00000004) \
31 \
32 US_FLAG(FIX_INQUIRY, 0x00000008) \
33 \
34 US_FLAG(FIX_CAPACITY, 0x00000010) \
35 \
36 US_FLAG(IGNORE_RESIDUE, 0x00000020) \
37 \
38 US_FLAG(BULK32, 0x00000040) \
39 \
40 US_FLAG(NOT_LOCKABLE, 0x00000080) \
41 \
42 US_FLAG(GO_SLOW, 0x00000100) \
43 \
44 US_FLAG(NO_WP_DETECT, 0x00000200) \
45 \
46 US_FLAG(MAX_SECTORS_64, 0x00000400) \
47 \
48 US_FLAG(IGNORE_DEVICE, 0x00000800) \
49 \
50 US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \
51 \
52 US_FLAG(MAX_SECTORS_MIN,0x00002000) \
53 \
54 US_FLAG(BULK_IGNORE_TAG,0x00004000) \
55 \
56 US_FLAG(SANE_SENSE, 0x00008000) \
57 \
58 US_FLAG(CAPACITY_OK, 0x00010000) \
59 \
60 US_FLAG(BAD_SENSE, 0x00020000) \
61 \
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
63 \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 \
66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 \
68 US_FLAG(WRITE_CACHE, 0x00200000) \
69
70
71#define US_FLAG(name, value) US_FL_##name = value ,
72enum { US_DO_ALL_FLAGS };
73#undef US_FLAG
74
75
76
77
78#define USB_US_TYPE_NONE 0
79#define USB_US_TYPE_STOR 1
80#define USB_US_TYPE_UB 2
81
82#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF)
83#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF)
84
85#include <linux/usb/storage.h>
86
87
88
89extern int usb_usual_ignore_device(struct usb_interface *intf);
90extern struct usb_device_id usb_storage_usb_ids[];
91
92#ifdef CONFIG_USB_LIBUSUAL
93
94extern void usb_usual_set_present(int type);
95extern void usb_usual_clear_present(int type);
96extern int usb_usual_check_type(const struct usb_device_id *, int type);
97#else
98
99#define usb_usual_set_present(t) do { } while(0)
100#define usb_usual_clear_present(t) do { } while(0)
101#define usb_usual_check_type(id, t) (0)
102#endif
103
104#endif
105