drivers/gpib/nec7210/nec7210.c
Source file repositories/reference/linux-study-clean/drivers/gpib/nec7210/nec7210.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpib/nec7210/nec7210.c- Extension
.c- Size
- 30368 bytes
- Lines
- 1110
- Domain
- Driver Families
- Bucket
- drivers/gpib
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
board.hlinux/ioport.hlinux/sched.hlinux/module.hlinux/slab.hasm/dma.hlinux/bitops.hlinux/pci.hlinux/pci_ids.hlinux/string.hlinux/init.hlinux/spinlock.hlinux/delay.h
Detected Declarations
function nec7210_enable_eosfunction nec7210_disable_eosfunction nec7210_parallel_pollfunction nec7210_parallel_poll_configurefunction nec7210_parallel_poll_responsefunction SPMRfunction nec7210_serial_poll_statusfunction nec7210_primary_addressfunction nec7210_secondary_addressfunction update_talker_statefunction update_listener_statefunction nec7210_update_status_nolockfunction nec7210_update_statusfunction nec7210_set_reg_bitsfunction nec7210_set_handshake_modefunction nec7210_read_data_infunction nec7210_take_controlfunction nec7210_go_to_standbyfunction nec7210_request_system_controlfunction nec7210_interface_clearfunction nec7210_remote_enablefunction nec7210_release_rfd_holdofffunction test_bitfunction nec7210_t1_delayfunction nec7210_return_to_localfunction nec7210_atn_has_changedfunction nec7210_commandfunction pio_readfunction __dma_readfunction dma_readfunction nec7210_readfunction pio_write_waitfunction pio_writefunction __dma_writefunction dma_writefunction nec7210_writefunction nec7210_interruptfunction nec7210_interrupt_have_statusfunction nec7210_board_resetfunction nec7210_board_onlinefunction nec7210_ioport_read_bytefunction nec7210_ioport_write_bytefunction nec7210_locking_ioport_read_bytefunction nec7210_locking_ioport_write_bytefunction nec7210_iomem_read_bytefunction nec7210_iomem_write_bytefunction nec7210_locking_iomem_read_bytefunction nec7210_locking_iomem_write_byte
Annotated Snippet
if ((address_status_bits & HR_NATN)) {
if (address_status_bits & HR_SPMS)
priv->talker_state = serial_poll_active;
else
priv->talker_state = talker_active;
} else {
priv->talker_state = talker_addressed;
}
} else {
priv->talker_state = talker_idle;
}
}
static void update_listener_state(struct nec7210_priv *priv, unsigned int address_status_bits)
{
if (address_status_bits & HR_LA) {
if ((address_status_bits & HR_NATN))
priv->listener_state = listener_active;
else
priv->listener_state = listener_addressed;
} else {
priv->listener_state = listener_idle;
}
}
unsigned int nec7210_update_status_nolock(struct gpib_board *board, struct nec7210_priv *priv)
{
int address_status_bits;
u8 spoll_status;
if (!priv)
return 0;
address_status_bits = read_byte(priv, ADSR);
if (address_status_bits & HR_CIC)
set_bit(CIC_NUM, &board->status);
else
clear_bit(CIC_NUM, &board->status);
// check for talker/listener addressed
update_talker_state(priv, address_status_bits);
if (priv->talker_state == talker_active || priv->talker_state == talker_addressed)
set_bit(TACS_NUM, &board->status);
else
clear_bit(TACS_NUM, &board->status);
update_listener_state(priv, address_status_bits);
if (priv->listener_state == listener_active ||
priv->listener_state == listener_addressed)
set_bit(LACS_NUM, &board->status);
else
clear_bit(LACS_NUM, &board->status);
if (address_status_bits & HR_NATN)
clear_bit(ATN_NUM, &board->status);
else
set_bit(ATN_NUM, &board->status);
spoll_status = nec7210_serial_poll_status(board, priv);
if (priv->srq_pending && (spoll_status & request_service_bit) == 0) {
priv->srq_pending = 0;
set_bit(SPOLL_NUM, &board->status);
}
/*
* we rely on the interrupt handler to set the
* rest of the status bits
*/
return board->status;
}
EXPORT_SYMBOL(nec7210_update_status_nolock);
unsigned int nec7210_update_status(struct gpib_board *board, struct nec7210_priv *priv,
unsigned int clear_mask)
{
unsigned long flags;
unsigned int retval;
spin_lock_irqsave(&board->spinlock, flags);
board->status &= ~clear_mask;
retval = nec7210_update_status_nolock(board, priv);
spin_unlock_irqrestore(&board->spinlock, flags);
return retval;
}
EXPORT_SYMBOL(nec7210_update_status);
unsigned int nec7210_set_reg_bits(struct nec7210_priv *priv, unsigned int reg,
unsigned int mask, unsigned int bits)
{
priv->reg_bits[reg] &= ~mask;
priv->reg_bits[reg] |= mask & bits;
write_byte(priv, priv->reg_bits[reg], reg);
Annotation
- Immediate include surface: `board.h`, `linux/ioport.h`, `linux/sched.h`, `linux/module.h`, `linux/slab.h`, `asm/dma.h`, `linux/bitops.h`, `linux/pci.h`.
- Detected declarations: `function nec7210_enable_eos`, `function nec7210_disable_eos`, `function nec7210_parallel_poll`, `function nec7210_parallel_poll_configure`, `function nec7210_parallel_poll_response`, `function SPMR`, `function nec7210_serial_poll_status`, `function nec7210_primary_address`, `function nec7210_secondary_address`, `function update_talker_state`.
- Atlas domain: Driver Families / drivers/gpib.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.