drivers/gpib/eastwood/fluke_gpib.h
Source file repositories/reference/linux-study-clean/drivers/gpib/eastwood/fluke_gpib.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpib/eastwood/fluke_gpib.h- Extension
.h- Size
- 3990 bytes
- Lines
- 147
- Domain
- Driver Families
- Bucket
- drivers/gpib
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/dmaengine.hlinux/io.hlinux/delay.hlinux/interrupt.hnec7210.h
Detected Declarations
struct fluke_privenum cb7210_regsenum cb7210_page_inenum imr0_bitsenum isr0_bitsenum state1_bitsenum cb7210_address0enum bus_status_bitsenum cb7210_aux_cmdsfunction cb7210_page_in_bitsfunction fluke_read_byte_nolockfunction fluke_write_byte_nolockfunction fluke_paged_read_bytefunction fluke_paged_write_byte
Annotated Snippet
struct fluke_priv {
struct nec7210_priv nec7210_priv;
struct resource *gpib_iomem_res;
struct resource *write_transfer_counter_res;
struct resource *dma_port_res;
int irq;
struct dma_chan *dma_channel;
u8 *dma_buffer;
int dma_buffer_size;
void __iomem *write_transfer_counter;
};
// cb7210 specific registers and bits
enum cb7210_regs {
STATE1_REG = 0x4,
ISR0_IMR0 = 0x6,
BUS_STATUS = 0x7
};
enum cb7210_page_in {
ISR0_IMR0_PAGE = 1,
BUS_STATUS_PAGE = 1,
STATE1_PAGE = 1
};
/* IMR0 -- Interrupt Mode Register 0 */
enum imr0_bits {
FLUKE_IFCIE_BIT = 0x8, /* interface clear interrupt */
};
/* ISR0 -- Interrupt Status Register 0 */
enum isr0_bits {
FLUKE_IFCI_BIT = 0x8, /* interface clear interrupt */
};
enum state1_bits {
SOURCE_HANDSHAKE_SIDS_BITS = 0x0, /* source idle state */
SOURCE_HANDSHAKE_SGNS_BITS = 0x1, /* source generate state */
SOURCE_HANDSHAKE_SDYS_BITS = 0x2, /* source delay state */
SOURCE_HANDSHAKE_STRS_BITS = 0x5, /* source transfer state */
SOURCE_HANDSHAKE_MASK = 0x7
};
/*
* we customized the cb7210 vhdl to give the "data in" status
* on the unused bit 7 of the address0 register.
*/
enum cb7210_address0 {
DATA_IN_STATUS = 0x80
};
static inline int cb7210_page_in_bits(unsigned int page)
{
return 0x50 | (page & 0xf);
}
// don't use without locking nec_priv->register_page_lock
static inline u8 fluke_read_byte_nolock(struct nec7210_priv *nec_priv,
int register_num)
{
u8 retval;
retval = readl(nec_priv->mmiobase + register_num * nec_priv->offset);
return retval;
}
// don't use without locking nec_priv->register_page_lock
static inline void fluke_write_byte_nolock(struct nec7210_priv *nec_priv, u8 data,
int register_num)
{
writel(data, nec_priv->mmiobase + register_num * nec_priv->offset);
}
static inline u8 fluke_paged_read_byte(struct fluke_priv *e_priv,
unsigned int register_num, unsigned int page)
{
struct nec7210_priv *nec_priv = &e_priv->nec7210_priv;
u8 retval;
unsigned long flags;
spin_lock_irqsave(&nec_priv->register_page_lock, flags);
fluke_write_byte_nolock(nec_priv, cb7210_page_in_bits(page), AUXMR);
udelay(1);
/* chip auto clears the page after a read */
retval = fluke_read_byte_nolock(nec_priv, register_num);
spin_unlock_irqrestore(&nec_priv->register_page_lock, flags);
return retval;
}
static inline void fluke_paged_write_byte(struct fluke_priv *e_priv, u8 data,
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/dmaengine.h`, `linux/io.h`, `linux/delay.h`, `linux/interrupt.h`, `nec7210.h`.
- Detected declarations: `struct fluke_priv`, `enum cb7210_regs`, `enum cb7210_page_in`, `enum imr0_bits`, `enum isr0_bits`, `enum state1_bits`, `enum cb7210_address0`, `enum bus_status_bits`, `enum cb7210_aux_cmds`, `function cb7210_page_in_bits`.
- Atlas domain: Driver Families / drivers/gpib.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.