drivers/scsi/a4000t.c
Source file repositories/reference/linux-study-clean/drivers/scsi/a4000t.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/a4000t.c- Extension
.c- Size
- 3498 bytes
- Lines
- 130
- 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/module.hlinux/platform_device.hlinux/init.hlinux/interrupt.hlinux/slab.hasm/amigahw.hasm/amigaints.hscsi/scsi_host.hscsi/scsi_transport_spi.h53c700.h
Detected Declarations
function amiga_a4000t_scsi_probefunction amiga_a4000t_scsi_remove
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Detection routine for the NCR53c710 based Amiga SCSI Controllers for Linux.
* Amiga Technologies A4000T SCSI controller.
*
* Written 1997 by Alan Hourihane <alanh@fairlite.demon.co.uk>
* plus modifications of the 53c7xx.c driver to support the Amiga.
*
* Rewritten to use 53c700.c by Kars de Jong <jongk@linux-m68k.org>
*/
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/slab.h>
#include <asm/amigahw.h>
#include <asm/amigaints.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_transport_spi.h>
#include "53c700.h"
static struct scsi_host_template a4000t_scsi_driver_template = {
.name = "A4000T builtin SCSI",
.proc_name = "A4000t",
.this_id = 7,
.module = THIS_MODULE,
};
#define A4000T_SCSI_OFFSET 0x40
static int __init amiga_a4000t_scsi_probe(struct platform_device *pdev)
{
struct resource *res;
phys_addr_t scsi_addr;
struct NCR_700_Host_Parameters *hostdata;
struct Scsi_Host *host;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
if (!request_mem_region(res->start, resource_size(res),
"A4000T builtin SCSI"))
return -EBUSY;
hostdata = kzalloc_obj(struct NCR_700_Host_Parameters);
if (!hostdata) {
dev_err(&pdev->dev, "Failed to allocate host data\n");
goto out_release;
}
scsi_addr = res->start + A4000T_SCSI_OFFSET;
/* Fill in the required pieces of hostdata */
hostdata->base = ZTWO_VADDR(scsi_addr);
hostdata->clock = 50;
hostdata->chip710 = 1;
hostdata->dmode_extra = DMODE_FC2;
hostdata->dcntl_extra = EA_710;
/* and register the chip */
host = NCR_700_detect(&a4000t_scsi_driver_template, hostdata,
&pdev->dev);
if (!host) {
dev_err(&pdev->dev,
"No host detected; board configuration problem?\n");
goto out_free;
}
host->this_id = 7;
host->base = scsi_addr;
host->irq = IRQ_AMIGA_PORTS;
if (request_irq(host->irq, NCR_700_intr, IRQF_SHARED, "a4000t-scsi",
host)) {
dev_err(&pdev->dev, "request_irq failed\n");
goto out_put_host;
}
platform_set_drvdata(pdev, host);
scsi_scan_host(host);
return 0;
out_put_host:
scsi_host_put(host);
out_free:
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/init.h`, `linux/interrupt.h`, `linux/slab.h`, `asm/amigahw.h`, `asm/amigaints.h`, `scsi/scsi_host.h`.
- Detected declarations: `function amiga_a4000t_scsi_probe`, `function amiga_a4000t_scsi_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.