aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/usb.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-01-05 22:25:13 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-01-05 22:25:13 -0500
commitfed8bf19ec20efc0641740b2d10aa589dbd6d1ab (patch)
treec104a13c7b8cb7f4152b15729dc5aede7c063e91 /drivers/usb/storage/usb.h
parente7c3aad53dba54d375b632f2a21b680546828dec (diff)
parent46f25dffbaba48c571d75f5f574f31978287b8d2 (diff)
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/usb/storage/usb.h')
-rw-r--r--drivers/usb/storage/usb.h40
1 files changed, 9 insertions, 31 deletions
diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
index 98b09711a739..7259fd1f6b0d 100644
--- a/drivers/usb/storage/usb.h
+++ b/drivers/usb/storage/usb.h
@@ -45,6 +45,7 @@
45#define _USB_H_ 45#define _USB_H_
46 46
47#include <linux/usb.h> 47#include <linux/usb.h>
48#include <linux/usb_usual.h>
48#include <linux/blkdev.h> 49#include <linux/blkdev.h>
49#include <linux/smp_lock.h> 50#include <linux/smp_lock.h>
50#include <linux/completion.h> 51#include <linux/completion.h>
@@ -63,38 +64,8 @@ struct us_unusual_dev {
63 __u8 useProtocol; 64 __u8 useProtocol;
64 __u8 useTransport; 65 __u8 useTransport;
65 int (*initFunction)(struct us_data *); 66 int (*initFunction)(struct us_data *);
66 unsigned int flags;
67}; 67};
68 68
69/*
70 * Static flag definitions. We use this roundabout technique so that the
71 * proc_info() routine can automatically display a message for each flag.
72 */
73#define US_DO_ALL_FLAGS \
74 US_FLAG(SINGLE_LUN, 0x00000001) \
75 /* allow access to only LUN 0 */ \
76 US_FLAG(NEED_OVERRIDE, 0x00000002) \
77 /* unusual_devs entry is necessary */ \
78 US_FLAG(SCM_MULT_TARG, 0x00000004) \
79 /* supports multiple targets */ \
80 US_FLAG(FIX_INQUIRY, 0x00000008) \
81 /* INQUIRY response needs faking */ \
82 US_FLAG(FIX_CAPACITY, 0x00000010) \
83 /* READ CAPACITY response too big */ \
84 US_FLAG(IGNORE_RESIDUE, 0x00000020) \
85 /* reported residue is wrong */ \
86 US_FLAG(BULK32, 0x00000040) \
87 /* Uses 32-byte CBW length */ \
88 US_FLAG(NOT_LOCKABLE, 0x00000080) \
89 /* PREVENT/ALLOW not supported */ \
90 US_FLAG(GO_SLOW, 0x00000100) \
91 /* Need delay after Command phase */ \
92 US_FLAG(NO_WP_DETECT, 0x00000200) \
93 /* Don't check for write-protect */ \
94
95#define US_FLAG(name, value) US_FL_##name = value ,
96enum { US_DO_ALL_FLAGS };
97#undef US_FLAG
98 69
99/* Dynamic flag definitions: used in set_bit() etc. */ 70/* Dynamic flag definitions: used in set_bit() etc. */
100#define US_FLIDX_URB_ACTIVE 18 /* 0x00040000 current_urb is in use */ 71#define US_FLIDX_URB_ACTIVE 18 /* 0x00040000 current_urb is in use */
@@ -122,7 +93,11 @@ enum { US_DO_ALL_FLAGS };
122typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data*); 93typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data*);
123typedef int (*trans_reset)(struct us_data*); 94typedef int (*trans_reset)(struct us_data*);
124typedef void (*proto_cmnd)(struct scsi_cmnd*, struct us_data*); 95typedef void (*proto_cmnd)(struct scsi_cmnd*, struct us_data*);
125typedef void (*extra_data_destructor)(void *); /* extra data destructor */ 96typedef void (*extra_data_destructor)(void *); /* extra data destructor */
97typedef void (*pm_hook)(struct us_data *, int); /* power management hook */
98
99#define US_SUSPEND 0
100#define US_RESUME 1
126 101
127/* we allocate one of these for every device that we remember */ 102/* we allocate one of these for every device that we remember */
128struct us_data { 103struct us_data {
@@ -178,6 +153,9 @@ struct us_data {
178 /* subdriver information */ 153 /* subdriver information */
179 void *extra; /* Any extra data */ 154 void *extra; /* Any extra data */
180 extra_data_destructor extra_destructor;/* extra data destructor */ 155 extra_data_destructor extra_destructor;/* extra data destructor */
156#ifdef CONFIG_PM
157 pm_hook suspend_resume_hook;
158#endif
181}; 159};
182 160
183/* Convert between us_data and the corresponding Scsi_Host */ 161/* Convert between us_data and the corresponding Scsi_Host */