include/linux/parport.h
Source file repositories/reference/linux-study-clean/include/linux/parport.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/parport.h- Extension
.h- Size
- 19351 bytes
- Lines
- 546
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/jiffies.hlinux/proc_fs.hlinux/spinlock.hlinux/wait.hlinux/irqreturn.hlinux/semaphore.hlinux/device.hasm/ptrace.huapi/linux/parport.hlinux/parport_pc.h
Detected Declarations
struct parportstruct pardevicestruct pc_parport_statestruct ax_parport_statestruct amiga_parport_statestruct ip32_parport_statestruct parport_statestruct parport_operationsstruct parport_device_infostruct pardevicestruct ieee1284_infostruct parportstruct parport_driverstruct pardev_cbenum ieee1284_phasefunction parport_claimfunction parport_claim_or_blockfunction parport_generic_irq
Annotated Snippet
struct device_driver driver;
};
#define to_parport_driver(n) container_of(n, struct parport_driver, driver)
int parport_bus_init(void);
void parport_bus_exit(void);
/* parport_register_port registers a new parallel port at the given
address (if one does not already exist) and returns a pointer to it.
This entails claiming the I/O region, IRQ and DMA. NULL is returned
if initialisation fails. */
struct parport *parport_register_port(unsigned long base, int irq, int dma,
struct parport_operations *ops);
/* Once a registered port is ready for high-level drivers to use, the
low-level driver that registered it should announce it. This will
call the high-level drivers' attach() functions (after things like
determining the IEEE 1284.3 topology of the port and collecting
DeviceIDs). */
void parport_announce_port (struct parport *port);
/* Unregister a port. */
extern void parport_remove_port(struct parport *port);
/* Register a new high-level driver. */
int __must_check __parport_register_driver(struct parport_driver *,
struct module *,
const char *mod_name);
/*
* parport_register_driver must be a macro so that KBUILD_MODNAME can
* be expanded
*/
/**
* parport_register_driver - register a parallel port device driver
* @driver: structure describing the driver
*
* This can be called by a parallel port device driver in order
* to receive notifications about ports being found in the
* system, as well as ports no longer available.
*
* The @driver structure is allocated by the caller and must not be
* deallocated until after calling parport_unregister_driver().
*
* If using the non device model:
* The driver's attach() function may block. The port that
* attach() is given will be valid for the duration of the
* callback, but if the driver wants to take a copy of the
* pointer it must call parport_get_port() to do so. Calling
* parport_register_device() on that port will do this for you.
*
* The driver's detach() function may block. The port that
* detach() is given will be valid for the duration of the
* callback, but if the driver wants to take a copy of the
* pointer it must call parport_get_port() to do so.
*
*
* Returns 0 on success. The non device model will always succeeds.
* but the new device model can fail and will return the error code.
**/
#define parport_register_driver(driver) \
__parport_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
/* Unregister a high-level driver. */
void parport_unregister_driver(struct parport_driver *);
/**
* module_parport_driver() - Helper macro for registering a modular parport driver
* @__parport_driver: struct parport_driver to be used
*
* Helper macro for parport drivers which do not do anything special in module
* init and exit. This eliminates a lot of boilerplate. Each module may only
* use this macro once, and calling it replaces module_init() and module_exit().
*/
#define module_parport_driver(__parport_driver) \
module_driver(__parport_driver, parport_register_driver, parport_unregister_driver)
/* If parport_register_driver doesn't fit your needs, perhaps
* parport_find_xxx does. */
extern struct parport *parport_find_number (int);
extern struct parport *parport_find_base (unsigned long);
/* generic irq handler, if it suits your needs */
extern irqreturn_t parport_irq_handler(int irq, void *dev_id);
/* Reference counting for ports. */
extern struct parport *parport_get_port (struct parport *);
extern void parport_put_port (struct parport *);
Annotation
- Immediate include surface: `linux/jiffies.h`, `linux/proc_fs.h`, `linux/spinlock.h`, `linux/wait.h`, `linux/irqreturn.h`, `linux/semaphore.h`, `linux/device.h`, `asm/ptrace.h`.
- Detected declarations: `struct parport`, `struct pardevice`, `struct pc_parport_state`, `struct ax_parport_state`, `struct amiga_parport_state`, `struct ip32_parport_state`, `struct parport_state`, `struct parport_operations`, `struct parport_device_info`, `struct pardevice`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.