drivers/gpib/ines/ines_gpib.c
Source file repositories/reference/linux-study-clean/drivers/gpib/ines/ines_gpib.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpib/ines/ines_gpib.c- Extension
.c- Size
- 43734 bytes
- Lines
- 1502
- Domain
- Driver Families
- Bucket
- drivers/gpib
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ines.hlinux/pci.hlinux/pci_ids.hlinux/bitops.hasm/dma.hlinux/io.hlinux/module.hlinux/init.hlinux/sched.hlinux/slab.hgpib_pci_ids.hlinux/kernel.hlinux/ptrace.hlinux/string.hlinux/timer.hpcmcia/cistpl.hpcmcia/ds.hpcmcia/cisreg.h
Detected Declarations
struct ines_pci_idstruct local_infoenum ines_pci_vendor_idsenum ines_pci_device_idsenum ines_pci_subdevice_idsfunction ines_line_statusfunction ines_set_xfer_counterfunction ines_t1_delayfunction num_in_fifo_bytesfunction pio_readfunction ines_accel_readfunction num_out_fifo_bytesfunction ines_write_waitfunction ines_accel_writefunction ines_pci_interruptfunction ines_interruptfunction ines_readfunction ines_writefunction ines_commandfunction ines_take_controlfunction ines_go_to_standbyfunction ines_request_system_controlfunction ines_interface_clearfunction ines_remote_enablefunction ines_enable_eosfunction ines_disable_eosfunction ines_update_statusfunction ines_primary_addressfunction ines_secondary_addressfunction ines_parallel_pollfunction ines_parallel_poll_configurefunction ines_parallel_poll_responsefunction ines_serial_poll_responsefunction ines_serial_poll_statusfunction ines_return_to_localfunction ines_allocate_privatefunction ines_free_privatefunction ines_generic_attachfunction ines_onlinefunction ines_common_pci_attachfunction ines_pci_attachfunction ines_pci_accel_attachfunction ines_isa_attachfunction ines_pci_detachfunction ines_isa_detachfunction ines_pci_probefunction gpib_attachfunction ines_gpib_remove
Annotated Snippet
static struct pci_driver ines_pci_driver = {
.name = "ines_gpib",
.id_table = ines_pci_table,
.probe = &ines_pci_probe
};
#ifdef CONFIG_GPIB_PCMCIA
#include <linux/kernel.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>
static const int ines_pcmcia_iosize = 0x20;
/*
* The event() function is this driver's Card Services event handler.
* It will be called by Card Services when an appropriate card status
* event is received. The config() and release() entry points are
* used to configure or release a socket, in response to card insertion
* and ejection events. They are invoked from the gpib event
* handler.
*/
static int ines_gpib_config(struct pcmcia_device *link);
static void ines_gpib_release(struct pcmcia_device *link);
static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config);
static int ines_pcmcia_accel_attach(struct gpib_board *board,
const struct gpib_board_config *config);
static void ines_pcmcia_detach(struct gpib_board *board);
static int ines_common_pcmcia_attach(struct gpib_board *board);
/*
* A linked list of "instances" of the gpib device. Each actual
* PCMCIA card corresponds to one device instance, and is described
* by one dev_link_t structure (defined in ds.h).
*
* You may not want to use a linked list for this -- for example, the
* memory card driver uses an array of dev_link_t pointers, where minor
* device numbers are used to derive the corresponding array index.
*/
static struct pcmcia_device *curr_dev;
/*
* A dev_link_t structure has fields for most things that are needed
* to keep track of a socket, but there will usually be some device
* specific information that also needs to be kept track of. The
* 'priv' pointer in a dev_link_t structure can be used to point to
* a device-specific private data structure, like this.
*
* A driver needs to provide a dev_node_t structure for each device
* on a card. In some cases, there is only one device per card (for
* example, ethernet cards, modems). In other cases, there may be
* many actual or logical devices (SCSI adapters, memory cards with
* multiple partitions). The dev_node_t structures need to be kept
* in a linked list starting at the 'dev' field of a dev_link_t
* structure. We allocate them in the card's private data structure,
* because they generally can't be allocated dynamically.
*/
struct local_info {
struct pcmcia_device *p_dev;
struct gpib_board *dev;
u_short manfid;
u_short cardid;
};
/*
* gpib_attach() creates an "instance" of the driver, allocating
* local data structures for one device. The device is registered
* with Card Services.
*
* The dev_link structure is initialized, but we don't actually
* configure the card at this point -- we wait until we receive a
* card insertion event.
*/
static int ines_gpib_probe(struct pcmcia_device *link)
{
struct local_info *info;
// int ret, i;
/* Allocate space for private device-specific data */
info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
Annotation
- Immediate include surface: `ines.h`, `linux/pci.h`, `linux/pci_ids.h`, `linux/bitops.h`, `asm/dma.h`, `linux/io.h`, `linux/module.h`, `linux/init.h`.
- Detected declarations: `struct ines_pci_id`, `struct local_info`, `enum ines_pci_vendor_ids`, `enum ines_pci_device_ids`, `enum ines_pci_subdevice_ids`, `function ines_line_status`, `function ines_set_xfer_counter`, `function ines_t1_delay`, `function num_in_fifo_bytes`, `function pio_read`.
- Atlas domain: Driver Families / drivers/gpib.
- Implementation status: pattern 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.