drivers/scsi/jazz_esp.c
Source file repositories/reference/linux-study-clean/drivers/scsi/jazz_esp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/jazz_esp.c- Extension
.c- Size
- 4681 bytes
- Lines
- 210
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/gfp.hlinux/types.hlinux/module.hlinux/init.hlinux/interrupt.hlinux/platform_device.hlinux/dma-mapping.hasm/irq.hasm/io.hasm/dma.hasm/jazz.hasm/jazzdma.hscsi/scsi_host.hesp_scsi.h
Detected Declarations
function Copyrightfunction jazz_esp_read8function jazz_esp_irq_pendingfunction jazz_esp_reset_dmafunction jazz_esp_dma_drainfunction jazz_esp_send_dma_cmdfunction jazz_esp_dma_errorfunction esp_jazz_probefunction esp_jazz_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/* jazz_esp.c: ESP front-end for MIPS JAZZ systems.
*
* Copyright (C) 2007 Thomas Bogendörfer (tsbogend@alpha.frankende)
*/
#include <linux/kernel.h>
#include <linux/gfp.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/dma.h>
#include <asm/jazz.h>
#include <asm/jazzdma.h>
#include <scsi/scsi_host.h>
#include "esp_scsi.h"
#define DRV_MODULE_NAME "jazz_esp"
#define PFX DRV_MODULE_NAME ": "
#define DRV_VERSION "1.000"
#define DRV_MODULE_RELDATE "May 19, 2007"
static void jazz_esp_write8(struct esp *esp, u8 val, unsigned long reg)
{
*(volatile u8 *)(esp->regs + reg) = val;
}
static u8 jazz_esp_read8(struct esp *esp, unsigned long reg)
{
return *(volatile u8 *)(esp->regs + reg);
}
static int jazz_esp_irq_pending(struct esp *esp)
{
if (jazz_esp_read8(esp, ESP_STATUS) & ESP_STAT_INTR)
return 1;
return 0;
}
static void jazz_esp_reset_dma(struct esp *esp)
{
vdma_disable ((int)esp->dma_regs);
}
static void jazz_esp_dma_drain(struct esp *esp)
{
/* nothing to do */
}
static void jazz_esp_dma_invalidate(struct esp *esp)
{
vdma_disable ((int)esp->dma_regs);
}
static void jazz_esp_send_dma_cmd(struct esp *esp, u32 addr, u32 esp_count,
u32 dma_count, int write, u8 cmd)
{
BUG_ON(!(cmd & ESP_CMD_DMA));
jazz_esp_write8(esp, (esp_count >> 0) & 0xff, ESP_TCLOW);
jazz_esp_write8(esp, (esp_count >> 8) & 0xff, ESP_TCMED);
vdma_disable ((int)esp->dma_regs);
if (write)
vdma_set_mode ((int)esp->dma_regs, DMA_MODE_READ);
else
vdma_set_mode ((int)esp->dma_regs, DMA_MODE_WRITE);
vdma_set_addr ((int)esp->dma_regs, addr);
vdma_set_count ((int)esp->dma_regs, dma_count);
vdma_enable ((int)esp->dma_regs);
scsi_esp_cmd(esp, cmd);
}
static int jazz_esp_dma_error(struct esp *esp)
{
u32 enable = vdma_get_enable((int)esp->dma_regs);
if (enable & (R4030_MEM_INTR|R4030_ADDR_INTR))
return 1;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/gfp.h`, `linux/types.h`, `linux/module.h`, `linux/init.h`, `linux/interrupt.h`, `linux/platform_device.h`, `linux/dma-mapping.h`.
- Detected declarations: `function Copyright`, `function jazz_esp_read8`, `function jazz_esp_irq_pending`, `function jazz_esp_reset_dma`, `function jazz_esp_dma_drain`, `function jazz_esp_send_dma_cmd`, `function jazz_esp_dma_error`, `function esp_jazz_probe`, `function esp_jazz_remove`.
- 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.