diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-05-01 15:35:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-21 18:15:53 -0400 |
commit | 7e4d6c387994294ac8198b624ee71e75de60dfd2 (patch) | |
tree | 09c8c519a6284f79c38f49347eb7fdf44d8de13e /drivers/usb/storage/scsiglue.c | |
parent | 2742fd8899328345d97a3443fb787b051b79ebae (diff) |
usb-storage: separate dynamic flags from fixed flags
This patch (as1089) separates out the dynamic atomic bitflags and the
static bitfields in usb-storage. Until now the two sorts of flags
have been sharing the same word; this has always been awkward.
To help prevent possible confusion, the two new fields each have a
different name from the original. us->fflags contains the fixed
bitfields (mostly taken from the USB ID table in unusual_devs.h), and
us->dflags contains the dynamic atomic bitflags (used with set_bit,
test_bit, and so on).
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/scsiglue.c')
-rw-r--r-- | drivers/usb/storage/scsiglue.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 3fcde9f0fa5f..1caf3f7af349 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c | |||
@@ -116,10 +116,10 @@ static int slave_configure(struct scsi_device *sdev) | |||
116 | * while others have trouble with more than 64K. At this time we | 116 | * while others have trouble with more than 64K. At this time we |
117 | * are limiting both to 32K (64 sectores). | 117 | * are limiting both to 32K (64 sectores). |
118 | */ | 118 | */ |
119 | if (us->flags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) { | 119 | if (us->fflags & (US_FL_MAX_SECTORS_64 | US_FL_MAX_SECTORS_MIN)) { |
120 | unsigned int max_sectors = 64; | 120 | unsigned int max_sectors = 64; |
121 | 121 | ||
122 | if (us->flags & US_FL_MAX_SECTORS_MIN) | 122 | if (us->fflags & US_FL_MAX_SECTORS_MIN) |
123 | max_sectors = PAGE_CACHE_SIZE >> 9; | 123 | max_sectors = PAGE_CACHE_SIZE >> 9; |
124 | if (sdev->request_queue->max_sectors > max_sectors) | 124 | if (sdev->request_queue->max_sectors > max_sectors) |
125 | blk_queue_max_sectors(sdev->request_queue, | 125 | blk_queue_max_sectors(sdev->request_queue, |
@@ -148,7 +148,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
148 | * majority of devices work fine, but a few still can't | 148 | * majority of devices work fine, but a few still can't |
149 | * handle it. The sd driver will simply assume those | 149 | * handle it. The sd driver will simply assume those |
150 | * devices are write-enabled. */ | 150 | * devices are write-enabled. */ |
151 | if (us->flags & US_FL_NO_WP_DETECT) | 151 | if (us->fflags & US_FL_NO_WP_DETECT) |
152 | sdev->skip_ms_page_3f = 1; | 152 | sdev->skip_ms_page_3f = 1; |
153 | 153 | ||
154 | /* A number of devices have problems with MODE SENSE for | 154 | /* A number of devices have problems with MODE SENSE for |
@@ -158,13 +158,13 @@ static int slave_configure(struct scsi_device *sdev) | |||
158 | /* Some disks return the total number of blocks in response | 158 | /* Some disks return the total number of blocks in response |
159 | * to READ CAPACITY rather than the highest block number. | 159 | * to READ CAPACITY rather than the highest block number. |
160 | * If this device makes that mistake, tell the sd driver. */ | 160 | * If this device makes that mistake, tell the sd driver. */ |
161 | if (us->flags & US_FL_FIX_CAPACITY) | 161 | if (us->fflags & US_FL_FIX_CAPACITY) |
162 | sdev->fix_capacity = 1; | 162 | sdev->fix_capacity = 1; |
163 | 163 | ||
164 | /* A few disks have two indistinguishable version, one of | 164 | /* A few disks have two indistinguishable version, one of |
165 | * which reports the correct capacity and the other does not. | 165 | * which reports the correct capacity and the other does not. |
166 | * The sd driver has to guess which is the case. */ | 166 | * The sd driver has to guess which is the case. */ |
167 | if (us->flags & US_FL_CAPACITY_HEURISTICS) | 167 | if (us->fflags & US_FL_CAPACITY_HEURISTICS) |
168 | sdev->guess_capacity = 1; | 168 | sdev->guess_capacity = 1; |
169 | 169 | ||
170 | /* Some devices report a SCSI revision level above 2 but are | 170 | /* Some devices report a SCSI revision level above 2 but are |
@@ -213,7 +213,7 @@ static int slave_configure(struct scsi_device *sdev) | |||
213 | 213 | ||
214 | /* Some devices choke when they receive a PREVENT-ALLOW MEDIUM | 214 | /* Some devices choke when they receive a PREVENT-ALLOW MEDIUM |
215 | * REMOVAL command, so suppress those commands. */ | 215 | * REMOVAL command, so suppress those commands. */ |
216 | if (us->flags & US_FL_NOT_LOCKABLE) | 216 | if (us->fflags & US_FL_NOT_LOCKABLE) |
217 | sdev->lockable = 0; | 217 | sdev->lockable = 0; |
218 | 218 | ||
219 | /* this is to satisfy the compiler, tho I don't think the | 219 | /* this is to satisfy the compiler, tho I don't think the |
@@ -238,7 +238,7 @@ static int queuecommand(struct scsi_cmnd *srb, | |||
238 | } | 238 | } |
239 | 239 | ||
240 | /* fail the command if we are disconnecting */ | 240 | /* fail the command if we are disconnecting */ |
241 | if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) { | 241 | if (test_bit(US_FLIDX_DISCONNECTING, &us->dflags)) { |
242 | US_DEBUGP("Fail command during disconnect\n"); | 242 | US_DEBUGP("Fail command during disconnect\n"); |
243 | srb->result = DID_NO_CONNECT << 16; | 243 | srb->result = DID_NO_CONNECT << 16; |
244 | done(srb); | 244 | done(srb); |
@@ -280,9 +280,9 @@ static int command_abort(struct scsi_cmnd *srb) | |||
280 | * with the reset). Note that we must retain the host lock while | 280 | * with the reset). Note that we must retain the host lock while |
281 | * calling usb_stor_stop_transport(); otherwise it might interfere | 281 | * calling usb_stor_stop_transport(); otherwise it might interfere |
282 | * with an auto-reset that begins as soon as we release the lock. */ | 282 | * with an auto-reset that begins as soon as we release the lock. */ |
283 | set_bit(US_FLIDX_TIMED_OUT, &us->flags); | 283 | set_bit(US_FLIDX_TIMED_OUT, &us->dflags); |
284 | if (!test_bit(US_FLIDX_RESETTING, &us->flags)) { | 284 | if (!test_bit(US_FLIDX_RESETTING, &us->dflags)) { |
285 | set_bit(US_FLIDX_ABORTING, &us->flags); | 285 | set_bit(US_FLIDX_ABORTING, &us->dflags); |
286 | usb_stor_stop_transport(us); | 286 | usb_stor_stop_transport(us); |
287 | } | 287 | } |
288 | scsi_unlock(us_to_host(us)); | 288 | scsi_unlock(us_to_host(us)); |
@@ -329,7 +329,7 @@ void usb_stor_report_device_reset(struct us_data *us) | |||
329 | struct Scsi_Host *host = us_to_host(us); | 329 | struct Scsi_Host *host = us_to_host(us); |
330 | 330 | ||
331 | scsi_report_device_reset(host, 0, 0); | 331 | scsi_report_device_reset(host, 0, 0); |
332 | if (us->flags & US_FL_SCM_MULT_TARG) { | 332 | if (us->fflags & US_FL_SCM_MULT_TARG) { |
333 | for (i = 1; i < host->max_id; ++i) | 333 | for (i = 1; i < host->max_id; ++i) |
334 | scsi_report_device_reset(host, 0, i); | 334 | scsi_report_device_reset(host, 0, i); |
335 | } | 335 | } |
@@ -400,7 +400,7 @@ static int proc_info (struct Scsi_Host *host, char *buffer, | |||
400 | pos += sprintf(pos, " Quirks:"); | 400 | pos += sprintf(pos, " Quirks:"); |
401 | 401 | ||
402 | #define US_FLAG(name, value) \ | 402 | #define US_FLAG(name, value) \ |
403 | if (us->flags & value) pos += sprintf(pos, " " #name); | 403 | if (us->fflags & value) pos += sprintf(pos, " " #name); |
404 | US_DO_ALL_FLAGS | 404 | US_DO_ALL_FLAGS |
405 | #undef US_FLAG | 405 | #undef US_FLAG |
406 | 406 | ||