Documentation/driver-api/eisa.rst

Source file repositories/reference/linux-study-clean/Documentation/driver-api/eisa.rst

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/eisa.rst
Extension
.rst
Size
7832 bytes
Lines
233
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: operation-table or driver-model contract
Status
pattern implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct device_driver         driver;
	};

=============== ====================================================
id_table	an array of NULL terminated EISA id strings,
		followed by an empty string. Each string can
		optionally be paired with a driver-dependent value
		(driver_data).

driver		a generic driver, such as described in
		Documentation/driver-api/driver-model/driver.rst. Only .name,
		.probe and .remove members are mandatory.
=============== ====================================================

An example is the 3c59x driver::

	static struct eisa_device_id vortex_eisa_ids[] = {
		{ "TCM5920", EISA_3C592_OFFSET },
		{ "TCM5970", EISA_3C597_OFFSET },
		{ "" }
	};

	static struct eisa_driver vortex_eisa_driver = {
		.id_table = vortex_eisa_ids,
		.driver   = {
			.name    = "3c59x",
			.probe   = vortex_eisa_probe,
			.remove  = vortex_eisa_remove
		}
	};

Device
======

The sysfs framework calls .probe and .remove functions upon device
discovery and removal (note that the .remove function is only called
when driver is built as a module).

Both functions are passed a pointer to a 'struct device', which is
encapsulated in a 'struct eisa_device' described as follows::

	struct eisa_device {
		struct eisa_device_id id;
		int                   slot;
		int                   state;
		unsigned long         base_addr;
		struct resource       res[EISA_MAX_RESOURCES];
		u64                   dma_mask;
		struct device         dev; /* generic device */
	};

======== ============================================================
id	 EISA id, as read from device. id.driver_data is set from the
	 matching driver EISA id.
slot	 slot number which the device was detected on
state    set of flags indicating the state of the device. Current
	 flags are EISA_CONFIG_ENABLED and EISA_CONFIG_FORCED.
res	 set of four 256 bytes I/O regions allocated to this device
dma_mask DMA mask set from the parent device.
dev	 generic device (see Documentation/driver-api/driver-model/device.rst)
======== ============================================================

You can get the 'struct eisa_device' from 'struct device' using the
'to_eisa_device' macro.

Misc stuff
==========

::

Annotation

Implementation Notes