consolidate devlist handling in a single file
PATCH 1/1 consolidate devlist handling in a single file
Currently it's spread all over the scsi midlayer but having this nicely separate out to a file of it's own without exposing the data structures sounds like a good idea.
drivers/scsi/Makefile +2 -1
@@ -124,7 +124,8 @@ scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \ scsicam.o scsi_error.o scsi_lib.o \ - scsi_scan.o scsi_syms.o scsi_sysfs.o + scsi_scan.o scsi_syms.o scsi_sysfs.o \ + scsi_devinfo.o scsi_mod-$(CONFIG_PROC_FS) += scsi_proc.o scsi_mod-$(CONFIG_X86_PC9800) += scsi_pc98.o
drivers/scsi/scsi.c +3 -286
328 lines not on this page · raw message
drivers/scsi/scsi_priv.h +7 -27
@@ -41,6 +41,8 @@#define SCSI_SENSE_VALID (scmd) \ (((scmd)->sense_buffer[0] & 0x70) == 0x70) +struct Scsi_Device_Template ; +/* * scsi_target: representation of a scsi target, for now, this is only
@@ -69,12 +71,16 @@extern int scsi_attach_device (struct scsi_device *sdev);extern void scsi_detach_device (struct scsi_device *sdev);extern void scsi_rescan_device (struct scsi_device *sdev); -extern int scsi_get_device_flags (unsigned char *vendor,unsigned char *model);extern int scsi_insert_special_req (struct scsi_request *sreq,int );extern void scsi_init_cmd_from_req (struct scsi_cmnd *cmd,struct scsi_request *sreq);extern void __scsi_release_request (struct scsi_request *sreq); +/* scsi_devinfo.c */ +extern int scsi_get_device_flags (unsigned char *vendor,unsigned char *model); +extern int scsi_init_devinfo (void ); +extern void scsi_exit_devinfo (void ); +/* scsi_error.c */ extern void scsi_times_out (struct scsi_cmnd *cmd);extern void scsi_error_handler (void *host);
@@ -119,31 +125,5 @@extern void scsi_sysfs_remove_host (struct Scsi_Host *);extern int scsi_sysfs_register (void );extern void scsi_sysfs_unregister (void ); - -/* -* dev_info: for the black/white list in the old scsi_static_device_list -*/ -struct dev_info { -char *vendor; -char *model; -char *revision;/* revision known to be bad, unused */ -unsigned flags; -}; - -extern struct dev_info scsi_static_device_list[]; - -/* -* scsi_dev_info_list: structure to hold black/white listed devices. -*/ -struct scsi_dev_info_list { -struct list_head dev_info_list; -char vendor[8 ]; -char model[16 ]; -unsigned flags; -unsigned compatible;/* for use with scsi_static_device_list entries */ -}; - -extern struct list_head scsi_dev_info_list; -extern int scsi_dev_info_list_add_str (char *);#endif /* _SCSI_PRIV_H */
drivers/scsi/scsi_proc.c +0 -80
106 lines not on this page · raw message
drivers/scsi/scsi_scan.c +1 -165
172 lines not on this page · raw message
drivers/scsi/scsi_devinfo.c new file +542 -0
542 lines not on this page · raw message
drivers/scsi/scsi_devinfo.h new file +16 -0
@@ -0,0 +1,16 @@ + +/* +* Flags for SCSI devices that need special treatment +*/ +#define BLIST_NOLUN 0x001/* Only scan LUN 0 */ +#define BLIST_FORCELUN 0x002/* Known to have LUNs, force scanning */ +#define BLIST_BORKEN 0x004/* Flag for broken handshaking */ +#define BLIST_KEY 0x008/* unlock by special command */ +#define BLIST_SINGLELUN 0x010/* Do not use LUNs in parallel */ +#define BLIST_NOTQ 0x020/* Buggy Tagged Command Queuing */ +#define BLIST_SPARSELUN 0x040/* Non consecutive LUN numbering */ +#define BLIST_MAX5LUN 0x080/* Avoid LUNS >= 5 */ +#define BLIST_ISROM 0x100/* Treat as (removable) CD-ROM */ +#define BLIST_LARGELUN 0x200/* LUNs past 7 on a SCSI-2 device */ +#define BLIST_INQUIRY_36 0x400/* override additional length field */ +#define BLIST_INQUIRY_58 0x800/* ... for broken inquiry responses */