include/linux/parport_pc.h
Source file repositories/reference/linux-study-clean/include/linux/parport_pc.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/parport_pc.h- Extension
.h- Size
- 6780 bytes
- Lines
- 243
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/io.h
Detected Declarations
struct parport_pc_privatestruct parport_pc_via_datafunction parport_pc_write_datafunction parport_pc_read_datafunction dump_parport_statefunction __parport_pc_frob_controlfunction parport_pc_data_reversefunction parport_pc_data_forwardfunction parport_pc_write_controlfunction parport_pc_read_controlfunction parport_pc_frob_controlfunction parport_pc_read_statusfunction parport_pc_disable_irqfunction parport_pc_enable_irq
Annotated Snippet
struct parport_pc_private {
/* Contents of CTR. */
unsigned char ctr;
/* Bitmask of writable CTR bits. */
unsigned char ctr_writable;
/* Whether or not there's an ECR. */
int ecr;
/* Bitmask of writable ECR bits. */
unsigned char ecr_writable;
/* Number of PWords that FIFO will hold. */
int fifo_depth;
/* Number of bytes per portword. */
int pword;
/* Not used yet. */
int readIntrThreshold;
int writeIntrThreshold;
/* buffer suitable for DMA, if DMA enabled */
char *dma_buf;
dma_addr_t dma_handle;
struct list_head list;
struct parport *port;
};
struct parport_pc_via_data
{
/* ISA PnP IRQ routing register 1 */
u8 via_pci_parport_irq_reg;
/* ISA PnP DMA request routing register */
u8 via_pci_parport_dma_reg;
/* Register and value to enable SuperIO configuration access */
u8 via_pci_superio_config_reg;
u8 via_pci_superio_config_data;
/* SuperIO function register number */
u8 viacfg_function;
/* parallel port control register number */
u8 viacfg_parport_control;
/* Parallel port base address register */
u8 viacfg_parport_base;
};
static __inline__ void parport_pc_write_data(struct parport *p, unsigned char d)
{
#ifdef DEBUG_PARPORT
printk (KERN_DEBUG "parport_pc_write_data(%p,0x%02x)\n", p, d);
#endif
outb(d, DATA(p));
}
static __inline__ unsigned char parport_pc_read_data(struct parport *p)
{
unsigned char val = inb (DATA (p));
#ifdef DEBUG_PARPORT
printk (KERN_DEBUG "parport_pc_read_data(%p) = 0x%02x\n",
p, val);
#endif
return val;
}
#ifdef DEBUG_PARPORT
static inline void dump_parport_state (char *str, struct parport *p)
{
/* here's hoping that reading these ports won't side-effect anything underneath */
unsigned char ecr = inb (ECONTROL (p));
unsigned char dcr = inb (CONTROL (p));
unsigned char dsr = inb (STATUS (p));
static const char *const ecr_modes[] = {"SPP", "PS2", "PPFIFO", "ECP", "xXx", "yYy", "TST", "CFG"};
const struct parport_pc_private *priv = p->physport->private_data;
int i;
printk (KERN_DEBUG "*** parport state (%s): ecr=[%s", str, ecr_modes[(ecr & 0xe0) >> 5]);
if (ecr & 0x10) printk (",nErrIntrEn");
if (ecr & 0x08) printk (",dmaEn");
if (ecr & 0x04) printk (",serviceIntr");
if (ecr & 0x02) printk (",f_full");
if (ecr & 0x01) printk (",f_empty");
for (i=0; i<2; i++) {
printk ("] dcr(%s)=[", i ? "soft" : "hard");
dcr = i ? priv->ctr : inb (CONTROL (p));
if (dcr & 0x20) {
printk ("rev");
} else {
printk ("fwd");
Annotation
- Immediate include surface: `asm/io.h`.
- Detected declarations: `struct parport_pc_private`, `struct parport_pc_via_data`, `function parport_pc_write_data`, `function parport_pc_read_data`, `function dump_parport_state`, `function __parport_pc_frob_control`, `function parport_pc_data_reverse`, `function parport_pc_data_forward`, `function parport_pc_write_control`, `function parport_pc_read_control`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.