drivers/scsi/aic7xxx/aic7xxx_proc.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aic7xxx_proc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic7xxx/aic7xxx_proc.c- Extension
.c- Size
- 9474 bytes
- Lines
- 344
- 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.
- 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
aic7xxx_osm.haic7xxx_inline.haic7xxx_93cx6.h
Detected Declarations
function ahc_calc_syncsratefunction ahc_format_transinfofunction ahc_dump_target_statefunction ahc_dump_device_statefunction ahc_proc_write_seepromfunction ahc_linux_show_info
Annotated Snippet
if (period_factor == scsi_syncrates[i].period_factor) {
/* Period in kHz */
return (100000000 / scsi_syncrates[i].period);
}
}
/*
* Wasn't in the table, so use the standard
* 4 times conversion.
*/
return (10000000 / (period_factor * 4 * 10));
}
static void
ahc_format_transinfo(struct seq_file *m, struct ahc_transinfo *tinfo)
{
u_int speed;
u_int freq;
u_int mb;
speed = 3300;
freq = 0;
if (tinfo->offset != 0) {
freq = ahc_calc_syncsrate(tinfo->period);
speed = freq;
}
speed *= (0x01 << tinfo->width);
mb = speed / 1000;
if (mb > 0)
seq_printf(m, "%d.%03dMB/s transfers", mb, speed % 1000);
else
seq_printf(m, "%dKB/s transfers", speed);
if (freq != 0) {
seq_printf(m, " (%d.%03dMHz%s, offset %d",
freq / 1000, freq % 1000,
(tinfo->ppr_options & MSG_EXT_PPR_DT_REQ) != 0
? " DT" : "", tinfo->offset);
}
if (tinfo->width > 0) {
if (freq != 0) {
seq_puts(m, ", ");
} else {
seq_puts(m, " (");
}
seq_printf(m, "%dbit)", 8 * (0x01 << tinfo->width));
} else if (freq != 0) {
seq_putc(m, ')');
}
seq_putc(m, '\n');
}
static void
ahc_dump_target_state(struct ahc_softc *ahc, struct seq_file *m,
u_int our_id, char channel, u_int target_id,
u_int target_offset)
{
struct scsi_target *starget;
struct ahc_initiator_tinfo *tinfo;
struct ahc_tmode_tstate *tstate;
int lun;
tinfo = ahc_fetch_transinfo(ahc, channel, our_id,
target_id, &tstate);
if ((ahc->features & AHC_TWIN) != 0)
seq_printf(m, "Channel %c ", channel);
seq_printf(m, "Target %d Negotiation Settings\n", target_id);
seq_puts(m, "\tUser: ");
ahc_format_transinfo(m, &tinfo->user);
starget = ahc->platform_data->starget[target_offset];
if (!starget)
return;
seq_puts(m, "\tGoal: ");
ahc_format_transinfo(m, &tinfo->goal);
seq_puts(m, "\tCurr: ");
ahc_format_transinfo(m, &tinfo->curr);
for (lun = 0; lun < AHC_NUM_LUNS; lun++) {
struct scsi_device *sdev;
sdev = scsi_device_lookup_by_target(starget, lun);
if (sdev == NULL)
continue;
ahc_dump_device_state(m, sdev);
}
}
Annotation
- Immediate include surface: `aic7xxx_osm.h`, `aic7xxx_inline.h`, `aic7xxx_93cx6.h`.
- Detected declarations: `function ahc_calc_syncsrate`, `function ahc_format_transinfo`, `function ahc_dump_target_state`, `function ahc_dump_device_state`, `function ahc_proc_write_seeprom`, `function ahc_linux_show_info`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
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.