drivers/scsi/aic7xxx/aic79xx_core.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aic79xx_core.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic7xxx/aic79xx_core.c- Extension
.c- Size
- 296684 bytes
- Lines
- 10725
- 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
aic79xx_osm.haic79xx_inline.haicasm/aicasm_insformat.haic79xx_seq.h
Detected Declarations
struct ahd_hard_error_entryfunction ahd_set_modesfunction ahd_update_modesfunction ahd_assert_modesfunction ahd_save_modesfunction ahd_restore_modesfunction ahd_is_pausedfunction ahd_pausefunction ahd_unpausefunction ahd_sg_setupfunction ahd_setup_scb_commonfunction ahd_setup_data_scbfunction ahd_setup_noxfer_scbfunction ahd_sg_bus_to_virtfunction ahd_sg_virt_to_busfunction ahd_sync_scbfunction ahd_sync_sglistfunction ahd_sync_sensefunction ahd_targetcmd_offsetfunction ahd_fetch_transinfofunction ahd_inwfunction ahd_outwfunction ahd_inlfunction ahd_outlfunction ahd_inqfunction ahd_outqfunction ahd_get_scbptrfunction ahd_set_scbptrfunction ahd_get_hnscb_qofffunction ahd_set_hnscb_qofffunction ahd_get_hescb_qofffunction ahd_set_hescb_qofffunction ahd_get_snscb_qofffunction ahd_set_snscb_qofffunction ahd_get_sescb_qofffunction ahd_set_sescb_qofffunction ahd_get_sdscb_qofffunction ahd_set_sdscb_qofffunction ahd_inb_scbramfunction ahd_inw_scbramfunction ahd_inl_scbramfunction ahd_inq_scbramfunction ahd_lookup_scbfunction ahd_swap_with_next_hscbfunction ahd_queue_scbfunction ahd_sync_qoutfifofunction ahd_sync_tqinfifofunction ahd_check_cmdcmpltqueues
Annotated Snippet
struct ahd_hard_error_entry {
uint8_t errno;
const char *errmesg;
};
static const struct ahd_hard_error_entry ahd_hard_errors[] = {
{ DSCTMOUT, "Discard Timer has timed out" },
{ ILLOPCODE, "Illegal Opcode in sequencer program" },
{ SQPARERR, "Sequencer Parity Error" },
{ DPARERR, "Data-path Parity Error" },
{ MPARERR, "Scratch or SCB Memory Parity Error" },
{ CIOPARERR, "CIOBUS Parity Error" },
};
static const u_int num_errors = ARRAY_SIZE(ahd_hard_errors);
static const struct ahd_phase_table_entry ahd_phase_table[] =
{
{ P_DATAOUT, NOP, "in Data-out phase" },
{ P_DATAIN, INITIATOR_ERROR, "in Data-in phase" },
{ P_DATAOUT_DT, NOP, "in DT Data-out phase" },
{ P_DATAIN_DT, INITIATOR_ERROR, "in DT Data-in phase" },
{ P_COMMAND, NOP, "in Command phase" },
{ P_MESGOUT, NOP, "in Message-out phase" },
{ P_STATUS, INITIATOR_ERROR, "in Status phase" },
{ P_MESGIN, MSG_PARITY_ERROR, "in Message-in phase" },
{ P_BUSFREE, NOP, "while idle" },
{ 0, NOP, "in unknown phase" }
};
/*
* In most cases we only wish to itterate over real phases, so
* exclude the last element from the count.
*/
static const u_int num_phases = ARRAY_SIZE(ahd_phase_table) - 1;
/* Our Sequencer Program */
#include "aic79xx_seq.h"
/**************************** Function Declarations ***************************/
static void ahd_handle_transmission_error(struct ahd_softc *ahd);
static void ahd_handle_lqiphase_error(struct ahd_softc *ahd,
u_int lqistat1);
static int ahd_handle_pkt_busfree(struct ahd_softc *ahd,
u_int busfreetime);
static int ahd_handle_nonpkt_busfree(struct ahd_softc *ahd);
static void ahd_handle_proto_violation(struct ahd_softc *ahd);
static void ahd_force_renegotiation(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo);
static struct ahd_tmode_tstate*
ahd_alloc_tstate(struct ahd_softc *ahd,
u_int scsi_id, char channel);
#ifdef AHD_TARGET_MODE
static void ahd_free_tstate(struct ahd_softc *ahd,
u_int scsi_id, char channel, int force);
#endif
static void ahd_devlimited_syncrate(struct ahd_softc *ahd,
struct ahd_initiator_tinfo *,
u_int *period,
u_int *ppr_options,
role_t role);
static void ahd_update_neg_table(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo,
struct ahd_transinfo *tinfo);
static void ahd_update_pending_scbs(struct ahd_softc *ahd);
static void ahd_fetch_devinfo(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo);
static void ahd_scb_devinfo(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo,
struct scb *scb);
static void ahd_setup_initiator_msgout(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo,
struct scb *scb);
static void ahd_build_transfer_msg(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo);
static void ahd_construct_sdtr(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo,
u_int period, u_int offset);
static void ahd_construct_wdtr(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo,
u_int bus_width);
static void ahd_construct_ppr(struct ahd_softc *ahd,
struct ahd_devinfo *devinfo,
u_int period, u_int offset,
u_int bus_width, u_int ppr_options);
static void ahd_clear_msg_state(struct ahd_softc *ahd);
static void ahd_handle_message_phase(struct ahd_softc *ahd);
typedef enum {
AHDMSG_1B,
AHDMSG_2B,
Annotation
- Immediate include surface: `aic79xx_osm.h`, `aic79xx_inline.h`, `aicasm/aicasm_insformat.h`, `aic79xx_seq.h`.
- Detected declarations: `struct ahd_hard_error_entry`, `function ahd_set_modes`, `function ahd_update_modes`, `function ahd_assert_modes`, `function ahd_save_modes`, `function ahd_restore_modes`, `function ahd_is_paused`, `function ahd_pause`, `function ahd_unpause`, `function ahd_sg_setup`.
- 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.