drivers/gpib/fmh_gpib/fmh_gpib.c

Source file repositories/reference/linux-study-clean/drivers/gpib/fmh_gpib/fmh_gpib.c

File Facts

System
Linux kernel
Corpus path
drivers/gpib/fmh_gpib/fmh_gpib.c
Extension
.c
Size
53237 bytes
Lines
1754
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.

Dependency Surface

Detected Declarations

Annotated Snippet

static struct pci_driver fmh_gpib_pci_driver;

// wrappers for interface functions
static int fmh_gpib_read(struct gpib_board *board, u8 *buffer, size_t length,
			 int *end, size_t *bytes_read)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read);
}

static int fmh_gpib_write(struct gpib_board *board, u8 *buffer, size_t length,
			  int send_eoi, size_t *bytes_written)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written);
}

static int fmh_gpib_command(struct gpib_board *board, u8 *buffer, size_t length,
			    size_t *bytes_written)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_written);
}

static int fmh_gpib_take_control(struct gpib_board *board, int synchronous)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_take_control(board, &priv->nec7210_priv, synchronous);
}

static int fmh_gpib_go_to_standby(struct gpib_board *board)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_go_to_standby(board, &priv->nec7210_priv);
}

static int fmh_gpib_request_system_control(struct gpib_board *board, int request_control)
{
	struct fmh_priv *priv = board->private_data;
	struct nec7210_priv *nec_priv = &priv->nec7210_priv;

	return nec7210_request_system_control(board, nec_priv, request_control);
}

static void fmh_gpib_interface_clear(struct gpib_board *board, int assert)
{
	struct fmh_priv *priv = board->private_data;

	nec7210_interface_clear(board, &priv->nec7210_priv, assert);
}

static void fmh_gpib_remote_enable(struct gpib_board *board, int enable)
{
	struct fmh_priv *priv = board->private_data;

	nec7210_remote_enable(board, &priv->nec7210_priv, enable);
}

static int fmh_gpib_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8_bits);
}

static void fmh_gpib_disable_eos(struct gpib_board *board)
{
	struct fmh_priv *priv = board->private_data;

	nec7210_disable_eos(board, &priv->nec7210_priv);
}

static unsigned int fmh_gpib_update_status(struct gpib_board *board, unsigned int clear_mask)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_update_status(board, &priv->nec7210_priv, clear_mask);
}

static int fmh_gpib_primary_address(struct gpib_board *board, unsigned int address)
{
	struct fmh_priv *priv = board->private_data;

	return nec7210_primary_address(board, &priv->nec7210_priv, address);
}

Annotation

Implementation Notes