drivers/parport/ieee1284_ops.c
Source file repositories/reference/linux-study-clean/drivers/parport/ieee1284_ops.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/parport/ieee1284_ops.c- Extension
.c- Size
- 23429 bytes
- Lines
- 894
- 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/parport.hlinux/delay.hlinux/sched/signal.hlinux/uaccess.h
Detected Declarations
function ecp_forward_to_reversefunction parport_ieee1284_read_nibblefunction parport_ieee1284_read_bytefunction ecp_forward_to_reversefunction ecp_reverse_to_forwardfunction parport_ieee1284_ecp_write_datafunction parport_ieee1284_ecp_read_datafunction parport_ieee1284_ecp_write_addrfunction parport_ieee1284_epp_write_datafunction parport_ieee1284_epp_read_datafunction parport_ieee1284_epp_write_addrfunction parport_ieee1284_epp_read_addrexport parport_ieee1284_ecp_write_dataexport parport_ieee1284_ecp_read_dataexport parport_ieee1284_ecp_write_addrexport parport_ieee1284_write_compatexport parport_ieee1284_read_nibbleexport parport_ieee1284_read_byteexport parport_ieee1284_epp_write_dataexport parport_ieee1284_epp_read_dataexport parport_ieee1284_epp_write_addrexport parport_ieee1284_epp_read_addr
Annotated Snippet
if (count && no_irq) {
parport_release (dev);
schedule_timeout_interruptible(wait);
parport_claim_or_block (dev);
}
else
/* We must have the device claimed here */
parport_wait_event (port, wait);
/* Is there a signal pending? */
if (signal_pending (current))
break;
/* Wait longer next time. */
wait *= 2;
} while (time_before (jiffies, expire));
if (signal_pending (current))
break;
pr_debug("%s: Timed out\n", port->name);
break;
ready:
/* Write the character to the data lines. */
byte = *addr++;
parport_write_data (port, byte);
udelay (1);
/* Pulse strobe. */
parport_write_control (port, ctl | PARPORT_CONTROL_STROBE);
udelay (1); /* strobe */
parport_write_control (port, ctl);
udelay (1); /* hold */
/* Assume the peripheral received it. */
count++;
/* Let another process run if it needs to. */
if (time_before (jiffies, expire))
if (!parport_yield_blocking (dev)
&& need_resched())
schedule ();
}
stop:
port->physport->ieee1284.phase = IEEE1284_PH_FWD_IDLE;
return count;
}
/* Nibble mode. */
size_t parport_ieee1284_read_nibble (struct parport *port,
void *buffer, size_t len,
int flags)
{
#ifndef CONFIG_PARPORT_1284
return 0;
#else
unsigned char *buf = buffer;
int i;
unsigned char byte = 0;
len *= 2; /* in nibbles */
for (i=0; i < len; i++) {
unsigned char nibble;
/* Does the error line indicate end of data? */
if (((i & 1) == 0) &&
(parport_read_status(port) & PARPORT_STATUS_ERROR)) {
goto end_of_data;
}
/* Event 7: Set nAutoFd low. */
parport_frob_control (port,
PARPORT_CONTROL_AUTOFD,
PARPORT_CONTROL_AUTOFD);
/* Event 9: nAck goes low. */
port->ieee1284.phase = IEEE1284_PH_REV_DATA;
if (parport_wait_peripheral (port,
PARPORT_STATUS_ACK, 0)) {
/* Timeout -- no more data? */
pr_debug("%s: Nibble timeout at event 9 (%d bytes)\n",
port->name, i / 2);
parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0);
break;
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/parport.h`, `linux/delay.h`, `linux/sched/signal.h`, `linux/uaccess.h`.
- Detected declarations: `function ecp_forward_to_reverse`, `function parport_ieee1284_read_nibble`, `function parport_ieee1284_read_byte`, `function ecp_forward_to_reverse`, `function ecp_reverse_to_forward`, `function parport_ieee1284_ecp_write_data`, `function parport_ieee1284_ecp_read_data`, `function parport_ieee1284_ecp_write_addr`, `function parport_ieee1284_epp_write_data`, `function parport_ieee1284_epp_read_data`.
- 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.