drivers/scsi/sym53c8xx_2/sym_hipd.c
Source file repositories/reference/linux-study-clean/drivers/scsi/sym53c8xx_2/sym_hipd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/sym53c8xx_2/sym_hipd.c- Extension
.c- Size
- 147011 bytes
- Lines
- 5840
- Domain
- Driver Families
- Bucket
- drivers/scsi
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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/slab.hasm/param.hsym_glue.hsym_nvram.h
Detected Declarations
function sym_printl_hexfunction sym_print_msgfunction sym_print_nego_msgfunction sym_print_xerrfunction chipsfunction SRSTfunction sym_start_resetfunction sym_reset_scsi_busfunction sym_selectclockfunction chipsfunction sym_getfreqfunction sym_getclockfunction sym_getpciclockfunction sym_getsyncfunction QUADWORDfunction sym_save_initial_settingfunction sym_set_bus_modefunction sym_start_upfunction addressingfunction adapterfunction sym_regtestfunction sym_regtestfunction sym_snooptestfunction sym_log_hard_errorfunction sym_dump_registersfunction sym_lookup_chip_tablefunction sym_lookup_dmapfunction sym_update_dmap_regsfunction sym_check_goalsfunction sym_prepare_negofunction sym_put_start_queuefunction sym_start_next_ccbsfunction sym_wakeup_donefunction sym_flush_comp_queuefunction sym_flush_busy_queuefunction sym_start_upfunction scriptsfunction BUSfunction sym_settransfunction sym_announce_transfer_ratefunction sym_setwidefunction sym_setsyncfunction sym_setpprotfunction sym_recover_scsi_intfunction sym_int_stofunction sym_int_udcfunction sym_int_sbmcfunction a
Annotated Snippet
if (istat & SIP) {
INW(np, nc_sist);
}
else if (istat & DIP) {
if (INB(np, nc_dstat) & ABRT)
break;
}
udelay(5);
}
OUTB(np, nc_istat, 0);
if (!i)
printf("%s: unable to abort current chip operation, "
"ISTAT=0x%02x.\n", sym_name(np), istat);
do_chip_reset:
sym_chip_reset(np);
}
/*
* Start reset process.
*
* The interrupt handler will reinitialize the chip.
*/
static void sym_start_reset(struct sym_hcb *np)
{
sym_reset_scsi_bus(np, 1);
}
int sym_reset_scsi_bus(struct sym_hcb *np, int enab_int)
{
u32 term;
int retv = 0;
sym_soft_reset(np); /* Soft reset the chip */
if (enab_int)
OUTW(np, nc_sien, RST);
/*
* Enable Tolerant, reset IRQD if present and
* properly set IRQ mode, prior to resetting the bus.
*/
OUTB(np, nc_stest3, TE);
OUTB(np, nc_dcntl, (np->rv_dcntl & IRQM));
OUTB(np, nc_scntl1, CRST);
INB(np, nc_mbox1);
udelay(200);
if (!SYM_SETUP_SCSI_BUS_CHECK)
goto out;
/*
* Check for no terminators or SCSI bus shorts to ground.
* Read SCSI data bus, data parity bits and control signals.
* We are expecting RESET to be TRUE and other signals to be
* FALSE.
*/
term = INB(np, nc_sstat0);
term = ((term & 2) << 7) + ((term & 1) << 17); /* rst sdp0 */
term |= ((INB(np, nc_sstat2) & 0x01) << 26) | /* sdp1 */
((INW(np, nc_sbdl) & 0xff) << 9) | /* d7-0 */
((INW(np, nc_sbdl) & 0xff00) << 10) | /* d15-8 */
INB(np, nc_sbcl); /* req ack bsy sel atn msg cd io */
if (!np->maxwide)
term &= 0x3ffff;
if (term != (2<<7)) {
printf("%s: suspicious SCSI data while resetting the BUS.\n",
sym_name(np));
printf("%s: %sdp0,d7-0,rst,req,ack,bsy,sel,atn,msg,c/d,i/o = "
"0x%lx, expecting 0x%lx\n",
sym_name(np),
(np->features & FE_WIDE) ? "dp1,d15-8," : "",
(u_long)term, (u_long)(2<<7));
if (SYM_SETUP_SCSI_BUS_CHECK == 1)
retv = 1;
}
out:
OUTB(np, nc_scntl1, 0);
return retv;
}
/*
* Select SCSI clock frequency
*/
static void sym_selectclock(struct sym_hcb *np, u_char scntl3)
{
/*
* If multiplier not present or not selected, leave here.
*/
if (np->multiplier <= 1) {
OUTB(np, nc_scntl3, scntl3);
return;
Annotation
- Immediate include surface: `linux/slab.h`, `asm/param.h`, `sym_glue.h`, `sym_nvram.h`.
- Detected declarations: `function sym_printl_hex`, `function sym_print_msg`, `function sym_print_nego_msg`, `function sym_print_xerr`, `function chips`, `function SRST`, `function sym_start_reset`, `function sym_reset_scsi_bus`, `function sym_selectclock`, `function chips`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
- 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.