aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_devinfo.c18
-rw-r--r--drivers/scsi/scsi_priv.h15
-rw-r--r--drivers/scsi/scsi_scan.c2
-rw-r--r--include/scsi/scsi_device.h4
-rw-r--r--include/scsi/scsi_devinfo.h50
5 files changed, 46 insertions, 43 deletions
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c
index fe5a9ea27b5e..78d4aa8df675 100644
--- a/drivers/scsi/scsi_devinfo.c
+++ b/drivers/scsi/scsi_devinfo.c
@@ -22,7 +22,7 @@ struct scsi_dev_info_list {
22 struct list_head dev_info_list; 22 struct list_head dev_info_list;
23 char vendor[8]; 23 char vendor[8];
24 char model[16]; 24 char model[16];
25 unsigned flags; 25 blist_flags_t flags;
26 unsigned compatible; /* for use with scsi_static_device_list entries */ 26 unsigned compatible; /* for use with scsi_static_device_list entries */
27}; 27};
28 28
@@ -35,7 +35,7 @@ struct scsi_dev_info_list_table {
35 35
36 36
37static const char spaces[] = " "; /* 16 of them */ 37static const char spaces[] = " "; /* 16 of them */
38static unsigned scsi_default_dev_flags; 38static blist_flags_t scsi_default_dev_flags;
39static LIST_HEAD(scsi_dev_info_list); 39static LIST_HEAD(scsi_dev_info_list);
40static char scsi_dev_flags[256]; 40static char scsi_dev_flags[256];
41 41
@@ -52,7 +52,7 @@ static struct {
52 char *vendor; 52 char *vendor;
53 char *model; 53 char *model;
54 char *revision; /* revision known to be bad, unused */ 54 char *revision; /* revision known to be bad, unused */
55 unsigned flags; 55 blist_flags_t flags;
56} scsi_static_device_list[] __initdata = { 56} scsi_static_device_list[] __initdata = {
57 /* 57 /*
58 * The following devices are known not to tolerate a lun != 0 scan 58 * The following devices are known not to tolerate a lun != 0 scan
@@ -335,7 +335,7 @@ static void scsi_strcpy_devinfo(char *name, char *to, size_t to_length,
335 * Returns: 0 OK, -error on failure. 335 * Returns: 0 OK, -error on failure.
336 **/ 336 **/
337static int scsi_dev_info_list_add(int compatible, char *vendor, char *model, 337static int scsi_dev_info_list_add(int compatible, char *vendor, char *model,
338 char *strflags, int flags) 338 char *strflags, blist_flags_t flags)
339{ 339{
340 return scsi_dev_info_list_add_keyed(compatible, vendor, model, 340 return scsi_dev_info_list_add_keyed(compatible, vendor, model,
341 strflags, flags, 341 strflags, flags,
@@ -361,7 +361,7 @@ static int scsi_dev_info_list_add(int compatible, char *vendor, char *model,
361 * Returns: 0 OK, -error on failure. 361 * Returns: 0 OK, -error on failure.
362 **/ 362 **/
363int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model, 363int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model,
364 char *strflags, int flags, int key) 364 char *strflags, blist_flags_t flags, int key)
365{ 365{
366 struct scsi_dev_info_list *devinfo; 366 struct scsi_dev_info_list *devinfo;
367 struct scsi_dev_info_list_table *devinfo_table = 367 struct scsi_dev_info_list_table *devinfo_table =
@@ -571,9 +571,9 @@ static int scsi_dev_info_list_add_str(char *dev_list)
571 * matching flags value, else return the host or global default 571 * matching flags value, else return the host or global default
572 * settings. Called during scan time. 572 * settings. Called during scan time.
573 **/ 573 **/
574int scsi_get_device_flags(struct scsi_device *sdev, 574blist_flags_t scsi_get_device_flags(struct scsi_device *sdev,
575 const unsigned char *vendor, 575 const unsigned char *vendor,
576 const unsigned char *model) 576 const unsigned char *model)
577{ 577{
578 return scsi_get_device_flags_keyed(sdev, vendor, model, 578 return scsi_get_device_flags_keyed(sdev, vendor, model,
579 SCSI_DEVINFO_GLOBAL); 579 SCSI_DEVINFO_GLOBAL);
@@ -593,7 +593,7 @@ int scsi_get_device_flags(struct scsi_device *sdev,
593 * flags value, else return the host or global default settings. 593 * flags value, else return the host or global default settings.
594 * Called during scan time. 594 * Called during scan time.
595 **/ 595 **/
596int scsi_get_device_flags_keyed(struct scsi_device *sdev, 596blist_flags_t scsi_get_device_flags_keyed(struct scsi_device *sdev,
597 const unsigned char *vendor, 597 const unsigned char *vendor,
598 const unsigned char *model, 598 const unsigned char *model,
599 int key) 599 int key)
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index df1368aea9a3..a5946cd64caa 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -50,15 +50,16 @@ enum {
50 SCSI_DEVINFO_SPI, 50 SCSI_DEVINFO_SPI,
51}; 51};
52 52
53extern int scsi_get_device_flags(struct scsi_device *sdev, 53extern blist_flags_t scsi_get_device_flags(struct scsi_device *sdev,
54 const unsigned char *vendor, 54 const unsigned char *vendor,
55 const unsigned char *model); 55 const unsigned char *model);
56extern int scsi_get_device_flags_keyed(struct scsi_device *sdev, 56extern blist_flags_t scsi_get_device_flags_keyed(struct scsi_device *sdev,
57 const unsigned char *vendor, 57 const unsigned char *vendor,
58 const unsigned char *model, int key); 58 const unsigned char *model,
59 int key);
59extern int scsi_dev_info_list_add_keyed(int compatible, char *vendor, 60extern int scsi_dev_info_list_add_keyed(int compatible, char *vendor,
60 char *model, char *strflags, 61 char *model, char *strflags,
61 int flags, int key); 62 blist_flags_t flags, int key);
62extern int scsi_dev_info_list_del_keyed(char *vendor, char *model, int key); 63extern int scsi_dev_info_list_del_keyed(char *vendor, char *model, int key);
63extern int scsi_dev_info_add_list(int key, const char *name); 64extern int scsi_dev_info_add_list(int key, const char *name);
64extern int scsi_dev_info_remove_list(int key); 65extern int scsi_dev_info_remove_list(int key);
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index a0f2a20ea9e9..be5e919db0e8 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -566,7 +566,7 @@ EXPORT_SYMBOL(scsi_sanitize_inquiry_string);
566 * are copied to the scsi_device any flags value is stored in *@bflags. 566 * are copied to the scsi_device any flags value is stored in *@bflags.
567 **/ 567 **/
568static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, 568static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
569 int result_len, int *bflags) 569 int result_len, blist_flags_t *bflags)
570{ 570{
571 unsigned char scsi_cmd[MAX_COMMAND_SIZE]; 571 unsigned char scsi_cmd[MAX_COMMAND_SIZE];
572 int first_inquiry_len, try_inquiry_len, next_inquiry_len; 572 int first_inquiry_len, try_inquiry_len, next_inquiry_len;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 1fb6ad3c5006..7ae177c8e399 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -15,6 +15,8 @@ struct scsi_cmnd;
15struct scsi_lun; 15struct scsi_lun;
16struct scsi_sense_hdr; 16struct scsi_sense_hdr;
17 17
18typedef unsigned int __bitwise blist_flags_t;
19
18struct scsi_mode_data { 20struct scsi_mode_data {
19 __u32 length; 21 __u32 length;
20 __u16 block_descriptor_length; 22 __u16 block_descriptor_length;
@@ -141,7 +143,7 @@ struct scsi_device {
141 unsigned char current_tag; /* current tag */ 143 unsigned char current_tag; /* current tag */
142 struct scsi_target *sdev_target; /* used only for single_lun */ 144 struct scsi_target *sdev_target; /* used only for single_lun */
143 145
144 unsigned int sdev_bflags; /* black/white flags as also found in 146 blist_flags_t sdev_bflags; /* black/white flags as also found in
145 * scsi_devinfo.[hc]. For now used only to 147 * scsi_devinfo.[hc]. For now used only to
146 * pass settings from slave_alloc to scsi 148 * pass settings from slave_alloc to scsi
147 * core. */ 149 * core. */
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index 3cf125b56c3a..ea67c32e870e 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -6,55 +6,55 @@
6 */ 6 */
7 7
8/* Only scan LUN 0 */ 8/* Only scan LUN 0 */
9#define BLIST_NOLUN ((__force __u32 __bitwise)(1 << 0)) 9#define BLIST_NOLUN ((__force blist_flags_t)(1 << 0))
10/* Known to have LUNs, force scanning. 10/* Known to have LUNs, force scanning.
11 * DEPRECATED: Use max_luns=N */ 11 * DEPRECATED: Use max_luns=N */
12#define BLIST_FORCELUN ((__force __u32 __bitwise)(1 << 1)) 12#define BLIST_FORCELUN ((__force blist_flags_t)(1 << 1))
13/* Flag for broken handshaking */ 13/* Flag for broken handshaking */
14#define BLIST_BORKEN ((__force __u32 __bitwise)(1 << 2)) 14#define BLIST_BORKEN ((__force blist_flags_t)(1 << 2))
15/* unlock by special command */ 15/* unlock by special command */
16#define BLIST_KEY ((__force __u32 __bitwise)(1 << 3)) 16#define BLIST_KEY ((__force blist_flags_t)(1 << 3))
17/* Do not use LUNs in parallel */ 17/* Do not use LUNs in parallel */
18#define BLIST_SINGLELUN ((__force __u32 __bitwise)(1 << 4)) 18#define BLIST_SINGLELUN ((__force blist_flags_t)(1 << 4))
19/* Buggy Tagged Command Queuing */ 19/* Buggy Tagged Command Queuing */
20#define BLIST_NOTQ ((__force __u32 __bitwise)(1 << 5)) 20#define BLIST_NOTQ ((__force blist_flags_t)(1 << 5))
21/* Non consecutive LUN numbering */ 21/* Non consecutive LUN numbering */
22#define BLIST_SPARSELUN ((__force __u32 __bitwise)(1 << 6)) 22#define BLIST_SPARSELUN ((__force blist_flags_t)(1 << 6))
23/* Avoid LUNS >= 5 */ 23/* Avoid LUNS >= 5 */
24#define BLIST_MAX5LUN ((__force __u32 __bitwise)(1 << 7)) 24#define BLIST_MAX5LUN ((__force blist_flags_t)(1 << 7))
25/* Treat as (removable) CD-ROM */ 25/* Treat as (removable) CD-ROM */
26#define BLIST_ISROM ((__force __u32 __bitwise)(1 << 8)) 26#define BLIST_ISROM ((__force blist_flags_t)(1 << 8))
27/* LUNs past 7 on a SCSI-2 device */ 27/* LUNs past 7 on a SCSI-2 device */
28#define BLIST_LARGELUN ((__force __u32 __bitwise)(1 << 9)) 28#define BLIST_LARGELUN ((__force blist_flags_t)(1 << 9))
29/* override additional length field */ 29/* override additional length field */
30#define BLIST_INQUIRY_36 ((__force __u32 __bitwise)(1 << 10)) 30#define BLIST_INQUIRY_36 ((__force blist_flags_t)(1 << 10))
31/* do not do automatic start on add */ 31/* do not do automatic start on add */
32#define BLIST_NOSTARTONADD ((__force __u32 __bitwise)(1 << 12)) 32#define BLIST_NOSTARTONADD ((__force blist_flags_t)(1 << 12))
33/* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */ 33/* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */
34#define BLIST_REPORTLUN2 ((__force __u32 __bitwise)(1 << 17)) 34#define BLIST_REPORTLUN2 ((__force blist_flags_t)(1 << 17))
35/* don't try REPORT_LUNS scan (SCSI-3 devs) */ 35/* don't try REPORT_LUNS scan (SCSI-3 devs) */
36#define BLIST_NOREPORTLUN ((__force __u32 __bitwise)(1 << 18)) 36#define BLIST_NOREPORTLUN ((__force blist_flags_t)(1 << 18))
37/* don't use PREVENT-ALLOW commands */ 37/* don't use PREVENT-ALLOW commands */
38#define BLIST_NOT_LOCKABLE ((__force __u32 __bitwise)(1 << 19)) 38#define BLIST_NOT_LOCKABLE ((__force blist_flags_t)(1 << 19))
39/* device is actually for RAID config */ 39/* device is actually for RAID config */
40#define BLIST_NO_ULD_ATTACH ((__force __u32 __bitwise)(1 << 20)) 40#define BLIST_NO_ULD_ATTACH ((__force blist_flags_t)(1 << 20))
41/* select without ATN */ 41/* select without ATN */
42#define BLIST_SELECT_NO_ATN ((__force __u32 __bitwise)(1 << 21)) 42#define BLIST_SELECT_NO_ATN ((__force blist_flags_t)(1 << 21))
43/* retry HARDWARE_ERROR */ 43/* retry HARDWARE_ERROR */
44#define BLIST_RETRY_HWERROR ((__force __u32 __bitwise)(1 << 22)) 44#define BLIST_RETRY_HWERROR ((__force blist_flags_t)(1 << 22))
45/* maximum 512 sector cdb length */ 45/* maximum 512 sector cdb length */
46#define BLIST_MAX_512 ((__force __u32 __bitwise)(1 << 23)) 46#define BLIST_MAX_512 ((__force blist_flags_t)(1 << 23))
47/* Disable T10 PI (DIF) */ 47/* Disable T10 PI (DIF) */
48#define BLIST_NO_DIF ((__force __u32 __bitwise)(1 << 25)) 48#define BLIST_NO_DIF ((__force blist_flags_t)(1 << 25))
49/* Ignore SBC-3 VPD pages */ 49/* Ignore SBC-3 VPD pages */
50#define BLIST_SKIP_VPD_PAGES ((__force __u32 __bitwise)(1 << 26)) 50#define BLIST_SKIP_VPD_PAGES ((__force blist_flags_t)(1 << 26))
51/* Attempt to read VPD pages */ 51/* Attempt to read VPD pages */
52#define BLIST_TRY_VPD_PAGES ((__force __u32 __bitwise)(1 << 28)) 52#define BLIST_TRY_VPD_PAGES ((__force blist_flags_t)(1 << 28))
53/* don't try to issue RSOC */ 53/* don't try to issue RSOC */
54#define BLIST_NO_RSOC ((__force __u32 __bitwise)(1 << 29)) 54#define BLIST_NO_RSOC ((__force blist_flags_t)(1 << 29))
55/* maximum 1024 sector cdb length */ 55/* maximum 1024 sector cdb length */
56#define BLIST_MAX_1024 ((__force __u32 __bitwise)(1 << 30)) 56#define BLIST_MAX_1024 ((__force blist_flags_t)(1 << 30))
57/* Use UNMAP limit for WRITE SAME */ 57/* Use UNMAP limit for WRITE SAME */
58#define BLIST_UNMAP_LIMIT_WS ((__force __u32 __bitwise)(1 << 31)) 58#define BLIST_UNMAP_LIMIT_WS ((__force blist_flags_t)(1 << 31))
59 59
60#endif 60#endif