drivers/scsi/ncr53c8xx.c
Source file repositories/reference/linux-study-clean/drivers/scsi/ncr53c8xx.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/ncr53c8xx.c- Extension
.c- Size
- 210327 bytes
- Lines
- 8412
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/delay.hlinux/dma-mapping.hlinux/errno.hlinux/gfp.hlinux/init.hlinux/interrupt.hlinux/ioport.hlinux/mm.hlinux/module.hlinux/sched.hlinux/signal.hlinux/spinlock.hlinux/stat.hlinux/string.hlinux/time.hlinux/timer.hlinux/types.hasm/dma.hasm/io.hscsi/scsi.hscsi/scsi_cmnd.hscsi/scsi_dbg.hscsi/scsi_device.hscsi/scsi_tcq.hscsi/scsi_transport.hscsi/scsi_transport_spi.hncr53c8xx.h
Detected Declarations
struct tcbstruct lcbstruct ccbstruct ncbstruct scriptstruct linkstruct usrcmdstruct tcbstruct lcbstruct launchstruct headstruct dsbstruct ccbstruct ncbstruct scriptstruct scripthstruct host_datafunction ___m_freefunction __m_freefunction ___mp0_getpfunction ___mp0_freepfunction ___dma_getpfunction ___dma_freepfunction ___del_dma_poolfunction __m_free_dmafunction __vtobusfunction __unmap_scsi_datafunction __map_scsi_sg_datafunction get_setup_tokenfunction sym53c8xx__setupfunction device_queue_depthfunction ncr_script_fillfunction ncr_script_copy_and_bindfunction ncr_print_msgfunction ncr_initfunction ncr_prepare_settingfunction adapterfunction scsi_donefunction ncr_flush_done_cmdsfunction ncr_prepare_negofunction ncr_queue_commandfunction ncr_start_next_ccbfunction ncr_put_start_queuefunction ncr_reset_scsi_busfunction ncr_start_resetfunction ncr_reset_busfunction ncr_detachfunction ccb
Annotated Snippet
struct link {
ncrcmd l_cmd;
ncrcmd l_paddr;
};
struct usrcmd {
u_long target;
u_long lun;
u_long data;
u_long cmd;
};
#define UC_SETSYNC 10
#define UC_SETTAGS 11
#define UC_SETDEBUG 12
#define UC_SETORDER 13
#define UC_SETWIDE 14
#define UC_SETFLAG 15
#define UC_SETVERBOSE 17
#define UF_TRACE (0x01)
#define UF_NODISC (0x02)
#define UF_NOSCAN (0x04)
/*========================================================================
**
** Declaration of structs: target control block
**
**========================================================================
*/
struct tcb {
/*----------------------------------------------------------------
** During reselection the ncr jumps to this point with SFBR
** set to the encoded target number with bit 7 set.
** if it's not this target, jump to the next.
**
** JUMP IF (SFBR != #target#), @(next tcb)
**----------------------------------------------------------------
*/
struct link jump_tcb;
/*----------------------------------------------------------------
** Load the actual values for the sxfer and the scntl3
** register (sync/wide mode).
**
** SCR_COPY (1), @(sval field of this tcb), @(sxfer register)
** SCR_COPY (1), @(wval field of this tcb), @(scntl3 register)
**----------------------------------------------------------------
*/
ncrcmd getscr[6];
/*----------------------------------------------------------------
** Get the IDENTIFY message and load the LUN to SFBR.
**
** CALL, <RESEL_LUN>
**----------------------------------------------------------------
*/
struct link call_lun;
/*----------------------------------------------------------------
** Now look for the right lun.
**
** For i = 0 to 3
** SCR_JUMP ^ IFTRUE(MASK(i, 3)), @(first lcb mod. i)
**
** Recent chips will prefetch the 4 JUMPS using only 1 burst.
** It is kind of hashcoding.
**----------------------------------------------------------------
*/
struct link jump_lcb[4]; /* JUMPs for reselection */
struct lcb * lp[MAX_LUN]; /* The lcb's of this tcb */
/*----------------------------------------------------------------
** Pointer to the ccb used for negotiation.
** Prevent from starting a negotiation for all queued commands
** when tagged command queuing is enabled.
**----------------------------------------------------------------
*/
struct ccb * nego_cp;
/*----------------------------------------------------------------
** statistical data
**----------------------------------------------------------------
*/
u_long transfers;
u_long bytes;
/*----------------------------------------------------------------
** negotiation of wide and synch transfer and device quirks.
**----------------------------------------------------------------
Annotation
- Immediate include surface: `linux/blkdev.h`, `linux/delay.h`, `linux/dma-mapping.h`, `linux/errno.h`, `linux/gfp.h`, `linux/init.h`, `linux/interrupt.h`, `linux/ioport.h`.
- Detected declarations: `struct tcb`, `struct lcb`, `struct ccb`, `struct ncb`, `struct script`, `struct link`, `struct usrcmd`, `struct tcb`, `struct lcb`, `struct launch`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.