drivers/scsi/aic7xxx/aic7770_osm.c
Source file repositories/reference/linux-study-clean/drivers/scsi/aic7xxx/aic7770_osm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/aic7xxx/aic7770_osm.c- Extension
.c- Size
- 4432 bytes
- Lines
- 157
- 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
aic7xxx_osm.hlinux/device.hlinux/eisa.h
Detected Declarations
function aic7770_map_registersfunction aic7770_map_intfunction aic7770_probefunction aic7770_removefunction ahc_linux_eisa_initfunction ahc_linux_eisa_exit
Annotated Snippet
#include "aic7xxx_osm.h"
#include <linux/device.h>
#include <linux/eisa.h>
int
aic7770_map_registers(struct ahc_softc *ahc, u_int port)
{
/*
* Lock out other contenders for our i/o space.
*/
if (!request_region(port, AHC_EISA_IOSIZE, "aic7xxx"))
return (ENOMEM);
ahc->tag = BUS_SPACE_PIO;
ahc->bsh.ioport = port;
return (0);
}
int
aic7770_map_int(struct ahc_softc *ahc, u_int irq)
{
int error;
int shared;
shared = 0;
if ((ahc->flags & AHC_EDGE_INTERRUPT) == 0)
shared = IRQF_SHARED;
error = request_irq(irq, ahc_linux_isr, shared, "aic7xxx", ahc);
if (error == 0)
ahc->platform_data->irq = irq;
return (-error);
}
static int
aic7770_probe(struct device *dev)
{
struct eisa_device *edev = to_eisa_device(dev);
u_int eisaBase = edev->base_addr+AHC_EISA_SLOT_OFFSET;
struct ahc_softc *ahc;
char buf[80];
char *name;
int error;
sprintf(buf, "ahc_eisa:%d", eisaBase >> 12);
name = kstrdup(buf, GFP_ATOMIC);
if (name == NULL)
return -ENOMEM;
ahc = ahc_alloc(&aic7xxx_driver_template, name);
if (ahc == NULL)
return -ENOMEM;
ahc->dev = dev;
error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
eisaBase);
if (error != 0) {
ahc->bsh.ioport = 0;
ahc_free(ahc);
return error < 0 ? error : -error;
}
dev_set_drvdata(dev, ahc);
error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
return (error);
}
static int
aic7770_remove(struct device *dev)
{
struct ahc_softc *ahc = dev_get_drvdata(dev);
u_long s;
if (ahc->platform_data && ahc->platform_data->host)
scsi_remove_host(ahc->platform_data->host);
ahc_lock(ahc, &s);
ahc_intr_enable(ahc, FALSE);
ahc_unlock(ahc, &s);
ahc_free(ahc);
return 0;
}
static struct eisa_device_id aic7770_ids[] = {
{ "ADP7771", 0 }, /* AHA 274x */
{ "ADP7756", 1 }, /* AHA 284x BIOS enabled */
{ "ADP7757", 2 }, /* AHA 284x BIOS disabled */
{ "ADP7782", 3 }, /* AHA 274x Olivetti OEM */
{ "ADP7783", 4 }, /* AHA 274x Olivetti OEM (Differential) */
Annotation
- Immediate include surface: `aic7xxx_osm.h`, `linux/device.h`, `linux/eisa.h`.
- Detected declarations: `function aic7770_map_registers`, `function aic7770_map_int`, `function aic7770_probe`, `function aic7770_remove`, `function ahc_linux_eisa_init`, `function ahc_linux_eisa_exit`.
- 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.