drivers/parport/parport_cs.c
Source file repositories/reference/linux-study-clean/drivers/parport/parport_cs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/parport/parport_cs.c- Extension
.c- Size
- 5645 bytes
- Lines
- 196
- Domain
- Driver Families
- Bucket
- drivers/parport
- 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
linux/kernel.hlinux/module.hlinux/init.hlinux/ptrace.hlinux/slab.hlinux/string.hlinux/timer.hlinux/ioport.hlinux/major.hlinux/interrupt.hlinux/parport.hlinux/parport_pc.hpcmcia/cistpl.hpcmcia/ds.hpcmcia/cisreg.hpcmcia/ciscode.h
Detected Declarations
function parport_probefunction parport_detachfunction parport_config_checkfunction parport_configfunction parport_cs_release
Annotated Snippet
if (p == NULL) {
pr_notice("parport_cs: parport_pc_probe_port() at 0x%3x, irq %u failed\n",
(unsigned int)link->resource[0]->start, link->irq);
goto failed;
}
p->modes |= PARPORT_MODE_PCSPP;
if (epp_mode)
p->modes |= PARPORT_MODE_TRISTATE | PARPORT_MODE_EPP;
info->ndev = 1;
info->port = p;
return 0;
failed:
parport_cs_release(link);
kfree(link->priv);
return -ENODEV;
} /* parport_config */
static void parport_cs_release(struct pcmcia_device *link)
{
parport_info_t *info = link->priv;
dev_dbg(&link->dev, "parport_release\n");
if (info->ndev) {
struct parport *p = info->port;
parport_pc_unregister_port(p);
}
info->ndev = 0;
pcmcia_disable_device(link);
} /* parport_cs_release */
static const struct pcmcia_device_id parport_ids[] = {
PCMCIA_DEVICE_FUNC_ID(3),
PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial+Parallel Port: SP230",0x3beb8cf2,0xdb9e58bc),
PCMCIA_DEVICE_MANF_CARD(0x0137, 0x0003),
PCMCIA_DEVICE_NULL
};
MODULE_DEVICE_TABLE(pcmcia, parport_ids);
static struct pcmcia_driver parport_cs_driver = {
.owner = THIS_MODULE,
.name = "parport_cs",
.probe = parport_probe,
.remove = parport_detach,
.id_table = parport_ids,
};
module_pcmcia_driver(parport_cs_driver);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/init.h`, `linux/ptrace.h`, `linux/slab.h`, `linux/string.h`, `linux/timer.h`, `linux/ioport.h`.
- Detected declarations: `function parport_probe`, `function parport_detach`, `function parport_config_check`, `function parport_config`, `function parport_cs_release`.
- Atlas domain: Driver Families / drivers/parport.
- 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.