drivers/gpib/include/gpib_types.h
Source file repositories/reference/linux-study-clean/drivers/gpib/include/gpib_types.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpib/include/gpib_types.h- Extension
.h- Size
- 13672 bytes
- Lines
- 390
- 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.
- 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/gpib.hlinux/atomic.hlinux/device.hlinux/mutex.hlinux/wait.hlinux/sched.hlinux/timer.hlinux/interrupt.h
Detected Declarations
struct gpib_boardstruct gpib_board_configstruct gpib_interfacestruct gpib_event_queuestruct gpib_pseudo_irqstruct gpib_interface_liststruct gpib_boardstruct gpib_eventstruct gpib_status_queuestruct gpib_status_bytestruct gpib_descriptorstruct gpib_file_privatefunction init_event_queuefunction init_gpib_pseudo_irq
Annotated Snippet
struct gpib_board_config {
/* firmware blob */
void *init_data;
int init_data_length;
/* IO base address to use for non-pnp cards (set by core, driver should make local copy) */
u32 ibbase;
void __iomem *mmibbase;
/* IRQ to use for non-pnp cards (set by core, driver should make local copy) */
unsigned int ibirq;
/* dma channel to use for non-pnp cards (set by core, driver should make local copy) */
unsigned int ibdma;
/*
* pci bus of card, useful for distinguishing multiple identical pci cards
* (negative means don't care)
*/
int pci_bus;
/*
* pci slot of card, useful for distinguishing multiple identical pci cards
* (negative means don't care)
*/
int pci_slot;
/* sysfs device path of hardware to attach */
char *device_path;
/* serial number of hardware to attach */
char *serial_number;
};
/*
* struct gpib_interface defines the interface
* between the board-specific details dealt with in the drivers
* and generic interface provided by gpib-common.
* This really should be in a different header file.
*/
struct gpib_interface {
/* name of board */
char *name;
/* attach() initializes board and allocates resources */
int (*attach)(struct gpib_board *board, const struct gpib_board_config *config);
/* detach() shuts down board and frees resources */
void (*detach)(struct gpib_board *board);
/*
* read() should read at most 'length' bytes from the bus into
* 'buffer'. It should return when it fills the buffer or
* encounters an END (EOI and or EOS if appropriate). It should set 'end'
* to be nonzero if the read was terminated by an END, otherwise 'end'
* should be zero.
* Ultimately, this will be changed into or replaced by an asynchronous
* read. Zero return value for success, negative
* return indicates error.
* nbytes returns number of bytes read
*/
int (*read)(struct gpib_board *board, u8 *buffer, size_t length, int *end,
size_t *bytes_read);
/*
* write() should write 'length' bytes from buffer to the bus.
* If the boolean value send_eoi is nonzero, then EOI should
* be sent along with the last byte. Returns number of bytes
* written or negative value on error.
*/
int (*write)(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi,
size_t *bytes_written);
/*
* command() writes the command bytes in 'buffer' to the bus
* Returns zero on success or negative value on error.
*/
int (*command)(struct gpib_board *board, u8 *buffer, size_t length,
size_t *bytes_written);
/*
* Take control (assert ATN). If 'asyncronous' is nonzero, take
* control asyncronously (assert ATN immediately without waiting
* for other processes to complete first). Should not return
* until board becomes controller in charge. Returns zero no success,
* nonzero on error.
*/
int (*take_control)(struct gpib_board *board, int asyncronous);
/*
* De-assert ATN. Returns zero on success, nonzer on error.
*/
int (*go_to_standby)(struct gpib_board *board);
/* request/release control of the IFC and REN lines (system controller) */
int (*request_system_control)(struct gpib_board *board, int request_control);
/*
* Asserts or de-asserts 'interface clear' (IFC) depending on
* boolean value of 'assert'
*/
void (*interface_clear)(struct gpib_board *board, int assert);
/*
* Sends remote enable command if 'enable' is nonzero, disables remote mode
* if 'enable' is zero
*/
Annotation
- Immediate include surface: `linux/gpib.h`, `linux/atomic.h`, `linux/device.h`, `linux/mutex.h`, `linux/wait.h`, `linux/sched.h`, `linux/timer.h`, `linux/interrupt.h`.
- Detected declarations: `struct gpib_board`, `struct gpib_board_config`, `struct gpib_interface`, `struct gpib_event_queue`, `struct gpib_pseudo_irq`, `struct gpib_interface_list`, `struct gpib_board`, `struct gpib_event`, `struct gpib_status_queue`, `struct gpib_status_byte`.
- 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.
- 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.