drivers/parport/parport_gsc.h
Source file repositories/reference/linux-study-clean/drivers/parport/parport_gsc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/parport/parport_gsc.h- Extension
.h- Size
- 5382 bytes
- Lines
- 201
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/io.hlinux/delay.h
Detected Declarations
struct parport_gsc_privatefunction parport_readbfunction parport_writebfunction parport_gsc_write_datafunction parport_gsc_read_datafunction __parport_gsc_frob_controlfunction parport_gsc_data_reversefunction parport_gsc_data_forwardfunction parport_gsc_write_controlfunction parport_gsc_read_controlfunction parport_gsc_frob_controlfunction parport_gsc_read_statusfunction parport_gsc_disable_irqfunction parport_gsc_enable_irq
Annotated Snippet
struct parport_gsc_private {
/* Contents of CTR. */
unsigned char ctr;
/* Bitmask of writable CTR bits. */
unsigned char ctr_writable;
/* Number of bytes per portword. */
int pword;
/* Not used yet. */
int readIntrThreshold;
int writeIntrThreshold;
/* buffer suitable for DMA, if DMA enabled */
struct pci_dev *dev;
};
static inline void parport_gsc_write_data(struct parport *p, unsigned char d)
{
#ifdef DEBUG_PARPORT
printk(KERN_DEBUG "%s(%p,0x%02x)\n", __func__, p, d);
#endif
parport_writeb(d, DATA(p));
}
static inline unsigned char parport_gsc_read_data(struct parport *p)
{
unsigned char val = parport_readb (DATA (p));
#ifdef DEBUG_PARPORT
printk(KERN_DEBUG "%s(%p) = 0x%02x\n", __func__, p, val);
#endif
return val;
}
/* __parport_gsc_frob_control differs from parport_gsc_frob_control in that
* it doesn't do any extra masking. */
static inline unsigned char __parport_gsc_frob_control(struct parport *p,
unsigned char mask,
unsigned char val)
{
struct parport_gsc_private *priv = p->physport->private_data;
unsigned char ctr = priv->ctr;
#ifdef DEBUG_PARPORT
printk(KERN_DEBUG "%s(%02x,%02x): %02x -> %02x\n",
__func__, mask, val,
ctr, ((ctr & ~mask) ^ val) & priv->ctr_writable);
#endif
ctr = (ctr & ~mask) ^ val;
ctr &= priv->ctr_writable; /* only write writable bits. */
parport_writeb (ctr, CONTROL (p));
priv->ctr = ctr; /* Update soft copy */
return ctr;
}
static inline void parport_gsc_data_reverse(struct parport *p)
{
__parport_gsc_frob_control (p, 0x20, 0x20);
}
static inline void parport_gsc_data_forward(struct parport *p)
{
__parport_gsc_frob_control (p, 0x20, 0x00);
}
static inline void parport_gsc_write_control(struct parport *p,
unsigned char d)
{
const unsigned char wm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
PARPORT_CONTROL_INIT |
PARPORT_CONTROL_SELECT);
/* Take this out when drivers have adapted to newer interface. */
if (d & 0x20) {
printk(KERN_DEBUG "%s (%s): use data_reverse for this!\n",
p->name, p->cad->name);
parport_gsc_data_reverse (p);
}
__parport_gsc_frob_control (p, wm, d & wm);
}
static inline unsigned char parport_gsc_read_control(struct parport *p)
{
const unsigned char rm = (PARPORT_CONTROL_STROBE |
PARPORT_CONTROL_AUTOFD |
PARPORT_CONTROL_INIT |
PARPORT_CONTROL_SELECT);
const struct parport_gsc_private *priv = p->physport->private_data;
Annotation
- Immediate include surface: `asm/io.h`, `linux/delay.h`.
- Detected declarations: `struct parport_gsc_private`, `function parport_readb`, `function parport_writeb`, `function parport_gsc_write_data`, `function parport_gsc_read_data`, `function __parport_gsc_frob_control`, `function parport_gsc_data_reverse`, `function parport_gsc_data_forward`, `function parport_gsc_write_control`, `function parport_gsc_read_control`.
- 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.