drivers/ata/pata_parport/bpck6.c
Source file repositories/reference/linux-study-clean/drivers/ata/pata_parport/bpck6.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ata/pata_parport/bpck6.c- Extension
.c- Size
- 12856 bytes
- Lines
- 465
- Domain
- Driver Families
- Bucket
- drivers/ata
- 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.
- 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/module.hlinux/init.hlinux/kernel.hlinux/types.hlinux/parport.hpata_parport.h
Detected Declarations
function bpck6_send_cmdfunction bpck6_rd_data_bytefunction bpck6_wr_data_bytefunction bpck6_read_regrfunction bpck6_write_regrfunction bpck6_wait_for_fifofunction bpck6_write_blockfunction bpck6_read_blockfunction bpck6_openfunction bpck6_deselectfunction bpck6_wr_extoutfunction bpck6_connectfunction bpck6_disconnectfunction bpck6_test_portfunction bpck6_probe_unitfunction bpck6_log_adapter
Annotated Snippet
while (len--) {
parport_write_data(pi->pardev->port, *buf++);
parport_frob_control(pi->pardev->port, 0,
PARPORT_CONTROL_INIT);
}
break;
case PPCMODE_UNI_FW:
case PPCMODE_BI_FW:
bpck6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_FASTWR);
parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE,
PARPORT_CONTROL_STROBE);
last = *buf;
parport_write_data(pi->pardev->port, last);
while (len) {
this = *buf++;
len--;
if (this == last) {
parport_frob_control(pi->pardev->port, 0,
PARPORT_CONTROL_INIT);
} else {
parport_write_data(pi->pardev->port, this);
last = this;
}
}
parport_frob_control(pi->pardev->port, PARPORT_CONTROL_STROBE,
0);
bpck6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_FASTWR);
break;
case PPCMODE_EPP_BYTE:
pi->pardev->port->ops->epp_write_data(pi->pardev->port, buf,
len, PARPORT_EPP_FAST_8);
bpck6_wait_for_fifo(pi);
break;
case PPCMODE_EPP_WORD:
pi->pardev->port->ops->epp_write_data(pi->pardev->port, buf,
len, PARPORT_EPP_FAST_16);
bpck6_wait_for_fifo(pi);
break;
case PPCMODE_EPP_DWORD:
pi->pardev->port->ops->epp_write_data(pi->pardev->port, buf,
len, PARPORT_EPP_FAST_32);
bpck6_wait_for_fifo(pi);
break;
}
bpck6_send_cmd(pi, CMD_PREFIX_RESET | PREFIX_IO16 | PREFIX_BLK);
}
static void bpck6_read_block(struct pi_adapter *pi, char *buf, int len)
{
bpck6_send_cmd(pi, REG_BLKSIZE | ACCESS_REG | ACCESS_WRITE);
bpck6_wr_data_byte(pi, (u8)len);
bpck6_wr_data_byte(pi, (u8)(len >> 8));
bpck6_wr_data_byte(pi, 0);
bpck6_send_cmd(pi, CMD_PREFIX_SET | PREFIX_IO16 | PREFIX_BLK);
bpck6_send_cmd(pi, ATA_REG_DATA | ACCESS_PORT | ACCESS_READ);
switch (mode_map[pi->mode]) {
case PPCMODE_UNI_SW:
case PPCMODE_UNI_FW:
while (len) {
u8 d;
parport_frob_control(pi->pardev->port,
PARPORT_CONTROL_STROBE,
PARPORT_CONTROL_INIT); /* DATA STROBE */
d = parport_read_status(pi->pardev->port);
d = ((d & 0x80) >> 1) | ((d & 0x38) >> 3);
parport_frob_control(pi->pardev->port,
PARPORT_CONTROL_STROBE,
PARPORT_CONTROL_STROBE);
d |= parport_read_status(pi->pardev->port) & 0xB8;
*buf++ = d;
len--;
}
break;
case PPCMODE_BI_SW:
case PPCMODE_BI_FW:
parport_data_reverse(pi->pardev->port);
while (len) {
parport_frob_control(pi->pardev->port,
PARPORT_CONTROL_STROBE,
PARPORT_CONTROL_STROBE | PARPORT_CONTROL_INIT);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/kernel.h`, `linux/types.h`, `linux/parport.h`, `pata_parport.h`.
- Detected declarations: `function bpck6_send_cmd`, `function bpck6_rd_data_byte`, `function bpck6_wr_data_byte`, `function bpck6_read_regr`, `function bpck6_write_regr`, `function bpck6_wait_for_fifo`, `function bpck6_write_block`, `function bpck6_read_block`, `function bpck6_open`, `function bpck6_deselect`.
- Atlas domain: Driver Families / drivers/ata.
- Implementation status: source implementation candidate.
- 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.