Blame view

include/linux/usb_usual.h 3.28 KB
a00828e9a   Pete Zaitcev   [PATCH] USB: driv...
1
2
3
4
5
6
7
8
9
10
  /*
   * Interface to the libusual.
   *
   * Copyright (c) 2005 Pete Zaitcev <zaitcev@redhat.com>
   * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
   * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com)
   */
  
  #ifndef __LINUX_USB_USUAL_H
  #define __LINUX_USB_USUAL_H
a00828e9a   Pete Zaitcev   [PATCH] USB: driv...
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
  
  /* We should do this for cleanliness... But other usb_foo.h do not do this. */
  /* #include <linux/usb.h> */
  
  /*
   * The flags field, which we store in usb_device_id.driver_info.
   * It is compatible with the old usb-storage flags in lower 24 bits.
   */
  
  /*
   * Static flag definitions.  We use this roundabout technique so that the
   * proc_info() routine can automatically display a message for each flag.
   */
  #define US_DO_ALL_FLAGS						\
  	US_FLAG(SINGLE_LUN,	0x00000001)			\
  		/* allow access to only LUN 0 */		\
  	US_FLAG(NEED_OVERRIDE,	0x00000002)			\
  		/* unusual_devs entry is necessary */		\
  	US_FLAG(SCM_MULT_TARG,	0x00000004)			\
  		/* supports multiple targets */			\
  	US_FLAG(FIX_INQUIRY,	0x00000008)			\
  		/* INQUIRY response needs faking */		\
  	US_FLAG(FIX_CAPACITY,	0x00000010)			\
  		/* READ CAPACITY response too big */		\
  	US_FLAG(IGNORE_RESIDUE,	0x00000020)			\
  		/* reported residue is wrong */			\
  	US_FLAG(BULK32,		0x00000040)			\
  		/* Uses 32-byte CBW length */			\
  	US_FLAG(NOT_LOCKABLE,	0x00000080)			\
  		/* PREVENT/ALLOW not supported */		\
  	US_FLAG(GO_SLOW,	0x00000100)			\
  		/* Need delay after Command phase */		\
  	US_FLAG(NO_WP_DETECT,	0x00000200)			\
  		/* Don't check for write-protect */		\
883d989a7   Phil Dibowitz   [PATCH] USB Stora...
45
  	US_FLAG(MAX_SECTORS_64,	0x00000400)			\
3c332422f   Daniel Drake   usb-storage: Add ...
46
47
  		/* Sets max_sectors to 64    */			\
  	US_FLAG(IGNORE_DEVICE,	0x00000800)			\
61bf54b71   Oliver Neukum   USB Storage: indi...
48
49
  		/* Don't claim device */			\
  	US_FLAG(CAPACITY_HEURISTICS,	0x00001000)		\
33abc04f0   Doug Maxey   usb-storage: Fix ...
50
51
  		/* sometimes sizes is too big */		\
  	US_FLAG(MAX_SECTORS_MIN,0x00002000)			\
cc36bdd47   Constantin Baranov   USB: add support ...
52
53
  		/* Sets max_sectors to arch min */		\
  	US_FLAG(BULK_IGNORE_TAG,0x00004000)			\
1537e0ad9   Ben Efros   USB: storage devi...
54
  		/* Ignore tag mismatch in bulk operations */    \
25ff1c316   Alan Stern   USB: storage: add...
55
56
57
  	US_FLAG(SANE_SENSE,     0x00008000)			\
  		/* Sane Sense (> 18 bytes) */			\
  	US_FLAG(CAPACITY_OK,	0x00010000)			\
a0bb10811   Alan Stern   USB: usb-storage:...
58
59
  		/* READ CAPACITY response is correct */		\
  	US_FLAG(BAD_SENSE,	0x00020000)			\
ae38c78a0   Hans de Goede   usb-storage: add ...
60
61
  		/* Bad Sense (never more than 18 bytes) */	\
  	US_FLAG(NO_READ_DISC_INFO,	0x00040000)		\
00914025c   Hans de Goede   usb-storage: add ...
62
63
  		/* cannot handle READ_DISC_INFO */		\
  	US_FLAG(NO_READ_CAPACITY_16,	0x00080000)		\
21c13a4f7   Alan Stern   usb-storage: redo...
64
65
66
  		/* cannot handle READ_CAPACITY_16 */		\
  	US_FLAG(INITIAL_READ10,	0x00100000)			\
  		/* Initial READ(10) (and others) must be retried */
a00828e9a   Pete Zaitcev   [PATCH] USB: driv...
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  
  #define US_FLAG(name, value)	US_FL_##name = value ,
  enum { US_DO_ALL_FLAGS };
  #undef US_FLAG
  
  /*
   * The bias field for libusual and friends.
   */
  #define USB_US_TYPE_NONE   0
  #define USB_US_TYPE_STOR   1		/* usb-storage */
  #define USB_US_TYPE_UB     2		/* ub */
  
  #define USB_US_TYPE(flags) 		(((flags) >> 24) & 0xFF)
  #define USB_US_ORIG_FLAGS(flags)	((flags) & 0x00FFFFFF)
ae6d22fe1   Matthew Wilcox   USB: Move USB Sto...
81
  #include <linux/usb/storage.h>
a00828e9a   Pete Zaitcev   [PATCH] USB: driv...
82
83
84
  
  /*
   */
e6e244b6c   Alan Stern   usb-storage: prep...
85
86
  extern int usb_usual_ignore_device(struct usb_interface *intf);
  extern struct usb_device_id usb_storage_usb_ids[];
a00828e9a   Pete Zaitcev   [PATCH] USB: driv...
87
  #ifdef CONFIG_USB_LIBUSUAL
a00828e9a   Pete Zaitcev   [PATCH] USB: driv...
88
89
90
91
92
93
94
95
96
97
98
  extern void usb_usual_set_present(int type);
  extern void usb_usual_clear_present(int type);
  extern int usb_usual_check_type(const struct usb_device_id *, int type);
  #else
  
  #define usb_usual_set_present(t)	do { } while(0)
  #define usb_usual_clear_present(t)	do { } while(0)
  #define usb_usual_check_type(id, t)	(0)
  #endif /* CONFIG_USB_LIBUSUAL */
  
  #endif /* __LINUX_USB_USUAL_H */