drivers/gpib/ni_usb/ni_usb_gpib.h
Source file repositories/reference/linux-study-clean/drivers/gpib/ni_usb/ni_usb_gpib.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpib/ni_usb/ni_usb_gpib.h- Extension
.h- Size
- 5501 bytes
- Lines
- 227
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mutex.hlinux/semaphore.hlinux/usb.hlinux/timer.hgpibP.h
Detected Declarations
struct ni_usb_urb_ctxstruct ni_usb_privstruct ni_usb_status_blockstruct ni_usb_registerenum ni_usb_deviceenum endpoint_addressesenum hs_enpoint_addressesenum hs_plus_endpoint_addressesenum ni_usb_bulk_idsenum ni_usb_error_codesenum ni_usb_control_requestsenum ni_usb_unknown3_registerfunction nec7210_to_tnt4882_offsetfunction ni_usb_bulk_terminationfunction ni_usb_bulk_register_write_headerfunction ni_usb_bulk_register_writefunction ni_usb_bulk_register_read_headerfunction ni_usb_bulk_register_read
Annotated Snippet
struct ni_usb_urb_ctx {
struct completion complete;
unsigned timed_out : 1;
};
// struct which defines private_data for ni_usb devices
struct ni_usb_priv {
struct usb_interface *bus_interface;
int bulk_out_endpoint;
int bulk_in_endpoint;
int interrupt_in_endpoint;
u8 eos_char;
unsigned short eos_mode;
unsigned int monitored_ibsta_bits;
struct urb *bulk_urb;
struct urb *interrupt_urb;
u8 interrupt_buffer[0x11];
struct mutex addressed_transfer_lock; // protect transfer lock
struct mutex bulk_transfer_lock; // protect bulk message sends
struct mutex control_transfer_lock; // protect control messages
struct mutex interrupt_transfer_lock; // protect interrupt messages
struct timer_list bulk_timer;
struct ni_usb_urb_ctx context;
int product_id;
unsigned short ren_state;
};
struct ni_usb_status_block {
short id;
unsigned short ibsta;
short error_code;
unsigned short count;
};
struct ni_usb_register {
enum ni_usb_device device;
short address;
unsigned short value;
};
enum ni_usb_bulk_ids {
NIUSB_IBCAC_ID = 0x1,
NIUSB_UNKNOWN3_ID = 0x3, // device level function id?
NIUSB_TERM_ID = 0x4,
NIUSB_IBGTS_ID = 0x6,
NIUSB_IBRPP_ID = 0x7,
NIUSB_REG_READ_ID = 0x8,
NIUSB_REG_WRITE_ID = 0x9,
NIUSB_IBSIC_ID = 0xf,
NIUSB_REGISTER_READ_DATA_START_ID = 0x34,
NIUSB_REGISTER_READ_DATA_END_ID = 0x35,
NIUSB_IBRD_DATA_ID = 0x36,
NIUSB_IBRD_EXTENDED_DATA_ID = 0x37,
NIUSB_IBRD_STATUS_ID = 0x38
};
enum ni_usb_error_codes {
NIUSB_NO_ERROR = 0,
/*
* NIUSB_ABORTED_ERROR occurs when I/O is interrupted early by
* doing a NI_USB_STOP_REQUEST on the control endpoint.
*/
NIUSB_ABORTED_ERROR = 1,
/*
* NIUSB_READ_ATN_ERROR occurs when you do a board read while
* ATN is set
*/
NIUSB_ATN_STATE_ERROR = 2,
/*
* NIUSB_ADDRESSING_ERROR occurs when you do a board
* read/write as CIC but are not in LACS/TACS
*/
NIUSB_ADDRESSING_ERROR = 3,
/*
* NIUSB_EOSMODE_ERROR occurs on reads if any eos mode or char
* bits are set when REOS is not set.
* Have also seen error 4 if you try to send more than 16
* command bytes at once on a usb-b.
*/
NIUSB_EOSMODE_ERROR = 4,
/*
* NIUSB_NO_BUS_ERROR occurs when you try to write a command
* byte but there are no devices connected to the gpib bus
*/
NIUSB_NO_BUS_ERROR = 5,
/*
* NIUSB_NO_LISTENER_ERROR occurs when you do a board write as
* CIC with no listener
*/
NIUSB_NO_LISTENER_ERROR = 8,
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/semaphore.h`, `linux/usb.h`, `linux/timer.h`, `gpibP.h`.
- Detected declarations: `struct ni_usb_urb_ctx`, `struct ni_usb_priv`, `struct ni_usb_status_block`, `struct ni_usb_register`, `enum ni_usb_device`, `enum endpoint_addresses`, `enum hs_enpoint_addresses`, `enum hs_plus_endpoint_addresses`, `enum ni_usb_bulk_ids`, `enum ni_usb_error_codes`.
- Atlas domain: Driver Families / drivers/gpib.
- Implementation status: source 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.