drivers/scsi/scsi_devinfo.c
Source file repositories/reference/linux-study-clean/drivers/scsi/scsi_devinfo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/scsi_devinfo.c- Extension
.c- Size
- 28946 bytes
- Lines
- 857
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/blkdev.hlinux/init.hlinux/kernel.hlinux/module.hlinux/moduleparam.hlinux/proc_fs.hlinux/seq_file.hlinux/slab.hscsi/scsi_device.hscsi/scsi_devinfo.hscsi_priv.h
Detected Declarations
struct scsi_dev_info_liststruct scsi_dev_info_list_tablestruct double_listfunction scsi_strcpy_devinfofunction scsi_dev_info_list_addfunction scsi_dev_info_list_add_keyedfunction list_for_each_entryfunction scsi_dev_info_list_add_strfunction scsi_dev_info_listfunction scsi_get_device_flags_keyedfunction devinfo_seq_showfunction list_for_eachfunction devinfo_seq_stopfunction proc_scsi_devinfo_openfunction proc_scsi_devinfo_writefunction scsi_exit_devinfofunction scsi_dev_info_add_listfunction scsi_dev_info_remove_listfunction list_for_each_safefunction scsi_init_devinfoexport scsi_dev_info_list_add_keyedexport scsi_get_device_flags_keyedexport scsi_dev_info_add_listexport scsi_dev_info_remove_list
Annotated Snippet
struct scsi_dev_info_list {
struct list_head dev_info_list;
char vendor[8];
char model[16];
blist_flags_t flags;
unsigned compatible; /* for use with scsi_static_device_list entries */
};
struct scsi_dev_info_list_table {
struct list_head node; /* our node for being on the master list */
struct list_head scsi_dev_info_list; /* head of dev info list */
const char *name; /* name of list for /proc (NULL for global) */
int key; /* unique numeric identifier */
};
static blist_flags_t scsi_default_dev_flags;
static LIST_HEAD(scsi_dev_info_list);
static char scsi_dev_flags[256];
/*
* scsi_static_device_list: list of devices that require settings that differ
* from the default, includes black-listed (broken) devices. The entries here
* are added to the tail of scsi_dev_info_list via scsi_dev_info_list_init.
*
* If possible, set the BLIST_* flags from inside a SCSI LLD rather than
* adding an entry to this list.
*/
static struct {
char *vendor;
char *model;
char *revision; /* revision known to be bad, unused */
blist_flags_t flags;
} scsi_static_device_list[] __initdata = {
/*
* The following devices are known not to tolerate a lun != 0 scan
* for one reason or another. Some will respond to all luns,
* others will lock up.
*/
{"Aashima", "IMAGERY 2400SP", "1.03", BLIST_NOLUN}, /* locks up */
{"CHINON", "CD-ROM CDS-431", "H42", BLIST_NOLUN}, /* locks up */
{"CHINON", "CD-ROM CDS-535", "Q14", BLIST_NOLUN}, /* locks up */
{"DENON", "DRD-25X", "V", BLIST_NOLUN}, /* locks up */
{"HITACHI", "DK312C", "CM81", BLIST_NOLUN}, /* responds to all lun */
{"HITACHI", "DK314C", "CR21", BLIST_NOLUN}, /* responds to all lun */
{"IBM", "2104-DU3", NULL, BLIST_NOLUN}, /* locks up */
{"IBM", "2104-TU3", NULL, BLIST_NOLUN}, /* locks up */
{"IMS", "CDD521/10", "2.06", BLIST_NOLUN}, /* locks up */
{"MAXTOR", "XT-3280", "PR02", BLIST_NOLUN}, /* locks up */
{"MAXTOR", "XT-4380S", "B3C", BLIST_NOLUN}, /* locks up */
{"MAXTOR", "MXT-1240S", "I1.2", BLIST_NOLUN}, /* locks up */
{"MAXTOR", "XT-4170S", "B5A", BLIST_NOLUN}, /* locks up */
{"MAXTOR", "XT-8760S", "B7B", BLIST_NOLUN}, /* locks up */
{"MEDIAVIS", "RENO CD-ROMX2A", "2.03", BLIST_NOLUN}, /* responds to all lun */
{"MICROTEK", "ScanMakerIII", "2.30", BLIST_NOLUN}, /* responds to all lun */
{"NEC", "CD-ROM DRIVE:841", "1.0", BLIST_NOLUN},/* locks up */
{"PHILIPS", "PCA80SC", "V4-2", BLIST_NOLUN}, /* responds to all lun */
{"RODIME", "RO3000S", "2.33", BLIST_NOLUN}, /* locks up */
{"SUN", "SENA", NULL, BLIST_NOLUN}, /* responds to all luns */
/*
* The following causes a failed REQUEST SENSE on lun 1 for
* aha152x controller, which causes SCSI code to reset bus.
*/
{"SANYO", "CRD-250S", "1.20", BLIST_NOLUN},
/*
* The following causes a failed REQUEST SENSE on lun 1 for
* aha152x controller, which causes SCSI code to reset bus.
*/
{"SEAGATE", "ST157N", "\004|j", BLIST_NOLUN},
{"SEAGATE", "ST296", "921", BLIST_NOLUN}, /* responds to all lun */
{"SEAGATE", "ST1581", "6538", BLIST_NOLUN}, /* responds to all lun */
{"SONY", "CD-ROM CDU-541", "4.3d", BLIST_NOLUN},
{"SONY", "CD-ROM CDU-55S", "1.0i", BLIST_NOLUN},
{"SONY", "CD-ROM CDU-561", "1.7x", BLIST_NOLUN},
{"SONY", "CD-ROM CDU-8012", NULL, BLIST_NOLUN},
{"SONY", "SDT-5000", "3.17", BLIST_SELECT_NO_ATN},
{"TANDBERG", "TDC 3600", "U07", BLIST_NOLUN}, /* locks up */
{"TEAC", "CD-R55S", "1.0H", BLIST_NOLUN}, /* locks up */
/*
* The following causes a failed REQUEST SENSE on lun 1 for
* seagate controller, which causes SCSI code to reset bus.
*/
{"TEAC", "CD-ROM", "1.06", BLIST_NOLUN},
{"TEAC", "MT-2ST/45S2-27", "RV M", BLIST_NOLUN}, /* responds to all lun */
/*
* The following causes a failed REQUEST SENSE on lun 1 for
* seagate controller, which causes SCSI code to reset bus.
*/
{"HP", "C1750A", "3226", BLIST_NOLUN}, /* scanjet iic */
{"HP", "C1790A", NULL, BLIST_NOLUN}, /* scanjet iip */
Annotation
- Immediate include surface: `linux/blkdev.h`, `linux/init.h`, `linux/kernel.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/proc_fs.h`, `linux/seq_file.h`, `linux/slab.h`.
- Detected declarations: `struct scsi_dev_info_list`, `struct scsi_dev_info_list_table`, `struct double_list`, `function scsi_strcpy_devinfo`, `function scsi_dev_info_list_add`, `function scsi_dev_info_list_add_keyed`, `function list_for_each_entry`, `function scsi_dev_info_list_add_str`, `function scsi_dev_info_list`, `function scsi_get_device_flags_keyed`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: integration implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.