]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/linux/usb_usual.h
Net: ceph: Makefile: remove deprecated kbuild goal definitions
[net-next-2.6.git] / include / linux / usb_usual.h
CommitLineData
a00828e9
PZ
1/*
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
a00828e9
PZ
12
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 */ \
883d989a 46 US_FLAG(MAX_SECTORS_64, 0x00000400) \
3c332422
DD
47 /* Sets max_sectors to 64 */ \
48 US_FLAG(IGNORE_DEVICE, 0x00000800) \
61bf54b7
ON
49 /* Don't claim device */ \
50 US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \
33abc04f
DM
51 /* sometimes sizes is too big */ \
52 US_FLAG(MAX_SECTORS_MIN,0x00002000) \
cc36bdd4
CB
53 /* Sets max_sectors to arch min */ \
54 US_FLAG(BULK_IGNORE_TAG,0x00004000) \
1537e0ad 55 /* Ignore tag mismatch in bulk operations */ \
25ff1c31
AS
56 US_FLAG(SANE_SENSE, 0x00008000) \
57 /* Sane Sense (> 18 bytes) */ \
58 US_FLAG(CAPACITY_OK, 0x00010000) \
a0bb1081
AS
59 /* READ CAPACITY response is correct */ \
60 US_FLAG(BAD_SENSE, 0x00020000) \
ae38c78a
HG
61 /* Bad Sense (never more than 18 bytes) */ \
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
00914025
HG
63 /* cannot handle READ_DISC_INFO */ \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */
a00828e9
PZ
66
67#define US_FLAG(name, value) US_FL_##name = value ,
68enum { US_DO_ALL_FLAGS };
69#undef US_FLAG
70
71/*
72 * The bias field for libusual and friends.
73 */
74#define USB_US_TYPE_NONE 0
75#define USB_US_TYPE_STOR 1 /* usb-storage */
76#define USB_US_TYPE_UB 2 /* ub */
77
78#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF)
79#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF)
80
ae6d22fe 81#include <linux/usb/storage.h>
a00828e9
PZ
82
83/*
84 */
e6e244b6
AS
85extern int usb_usual_ignore_device(struct usb_interface *intf);
86extern struct usb_device_id usb_storage_usb_ids[];
87
a00828e9
PZ
88#ifdef CONFIG_USB_LIBUSUAL
89
a00828e9
PZ
90extern void usb_usual_set_present(int type);
91extern void usb_usual_clear_present(int type);
92extern int usb_usual_check_type(const struct usb_device_id *, int type);
93#else
94
95#define usb_usual_set_present(t) do { } while(0)
96#define usb_usual_clear_present(t) do { } while(0)
97#define usb_usual_check_type(id, t) (0)
98#endif /* CONFIG_USB_LIBUSUAL */
99
100#endif /* __LINUX_USB_USUAL_H */