Documentation/arch/s390/driver-model.rst

Source file repositories/reference/linux-study-clean/Documentation/arch/s390/driver-model.rst

File Facts

System
Linux kernel
Corpus path
Documentation/arch/s390/driver-model.rst
Extension
.rst
Size
9532 bytes
Lines
308
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;
	char *name;
  };

The 'private' field contains data needed for internal i/o operation only, and
is not available to the device driver.

Each driver should declare in a MODULE_DEVICE_TABLE into which CU types/models
and/or device types/models it is interested. This information can later be found
in the struct ccw_device_id fields::

  struct ccw_device_id {
	__u16   match_flags;

	__u16   cu_type;
	__u16   dev_type;
	__u8    cu_model;
	__u8    dev_model;

	unsigned long driver_info;
  };

The functions in ccw_driver should be used in the following way:

probe:
	 This function is called by the device layer for each device the driver
	 is interested in. The driver should only allocate private structures
	 to put in dev->driver_data and create attributes (if needed). Also,
	 the interrupt handler (see below) should be set here.

::

  int (*probe) (struct ccw_device *cdev);

Parameters:
		cdev
			- the device to be probed.


remove:
	 This function is called by the device layer upon removal of the driver,
	 the device or the module. The driver should perform cleanups here.

::

  int (*remove) (struct ccw_device *cdev);

Parameters:
		cdev
			- the device to be removed.


set_online:
	    This function is called by the common I/O layer when the device is
	    activated via the 'online' attribute. The driver should finally
	    setup and activate the device here.

::

  int (*set_online) (struct ccw_device *);

Parameters:
		cdev
			- the device to be activated. The common layer has
			  verified that the device is not already online.


set_offline: This function is called by the common I/O layer when the device is
	     de-activated via the 'online' attribute. The driver should shut
	     down the device, but not de-allocate its private data.

Annotation

Implementation Notes