drivers/parport/ieee1284.c
Source file repositories/reference/linux-study-clean/drivers/parport/ieee1284.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/parport/ieee1284.c- Extension
.c- Size
- 22413 bytes
- Lines
- 790
- Domain
- Driver Families
- Bucket
- drivers/parport
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/threads.hlinux/parport.hlinux/delay.hlinux/kernel.hlinux/interrupt.hlinux/timer.hlinux/sched/signal.h
Detected Declarations
function parport_ieee1284_wakeupfunction timeout_waiting_on_portfunction parport_wait_eventfunction udelayfunction configurablefunction parport_ieee1284_terminatefunction compliantfunction parport_ieee1284_ack_data_availfunction parport_ieee1284_interruptfunction tofunction tofunction negotiatefunction scheduleexport parport_negotiateexport parport_writeexport parport_readexport parport_wait_peripheralexport parport_wait_eventexport parport_set_timeoutexport parport_ieee1284_interrupt
Annotated Snippet
if (!ret) {
/* parport_wait_event didn't time out, but the
* peripheral wasn't actually ready either.
* Wait for another 10ms. */
schedule_timeout_interruptible(msecs_to_jiffies(10));
}
}
return 1;
}
#ifdef CONFIG_PARPORT_1284
/* Terminate a negotiated mode. */
static void parport_ieee1284_terminate (struct parport *port)
{
int r;
port = port->physport;
/* EPP terminates differently. */
switch (port->ieee1284.mode) {
case IEEE1284_MODE_EPP:
case IEEE1284_MODE_EPPSL:
case IEEE1284_MODE_EPPSWE:
/* Terminate from EPP mode. */
/* Event 68: Set nInit low */
parport_frob_control (port, PARPORT_CONTROL_INIT, 0);
udelay (50);
/* Event 69: Set nInit high, nSelectIn low */
parport_frob_control (port,
PARPORT_CONTROL_SELECT
| PARPORT_CONTROL_INIT,
PARPORT_CONTROL_SELECT
| PARPORT_CONTROL_INIT);
break;
case IEEE1284_MODE_ECP:
case IEEE1284_MODE_ECPRLE:
case IEEE1284_MODE_ECPSWE:
/* In ECP we can only terminate from fwd idle phase. */
if (port->ieee1284.phase != IEEE1284_PH_FWD_IDLE) {
/* Event 47: Set nInit high */
parport_frob_control (port,
PARPORT_CONTROL_INIT
| PARPORT_CONTROL_AUTOFD,
PARPORT_CONTROL_INIT
| PARPORT_CONTROL_AUTOFD);
/* Event 49: PError goes high */
r = parport_wait_peripheral (port,
PARPORT_STATUS_PAPEROUT,
PARPORT_STATUS_PAPEROUT);
if (r)
pr_debug("%s: Timeout at event 49\n",
port->name);
parport_data_forward (port);
pr_debug("%s: ECP direction: forward\n", port->name);
port->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
}
fallthrough;
default:
/* Terminate from all other modes. */
/* Event 22: Set nSelectIn low, nAutoFd high */
parport_frob_control (port,
PARPORT_CONTROL_SELECT
| PARPORT_CONTROL_AUTOFD,
PARPORT_CONTROL_SELECT);
/* Event 24: nAck goes low */
r = parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0);
if (r)
pr_debug("%s: Timeout at event 24\n", port->name);
/* Event 25: Set nAutoFd low */
parport_frob_control (port,
PARPORT_CONTROL_AUTOFD,
PARPORT_CONTROL_AUTOFD);
/* Event 27: nAck goes high */
r = parport_wait_peripheral (port,
PARPORT_STATUS_ACK,
PARPORT_STATUS_ACK);
if (r)
pr_debug("%s: Timeout at event 27\n", port->name);
Annotation
- Immediate include surface: `linux/module.h`, `linux/threads.h`, `linux/parport.h`, `linux/delay.h`, `linux/kernel.h`, `linux/interrupt.h`, `linux/timer.h`, `linux/sched/signal.h`.
- Detected declarations: `function parport_ieee1284_wakeup`, `function timeout_waiting_on_port`, `function parport_wait_event`, `function udelay`, `function configurable`, `function parport_ieee1284_terminate`, `function compliant`, `function parport_ieee1284_ack_data_avail`, `function parport_ieee1284_interrupt`, `function to`.
- Atlas domain: Driver Families / drivers/parport.
- Implementation status: integration 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.