Writing s390 channel device drivers
Author: Cornelia Huck
Introduction #
This document describes the interfaces available for device drivers that drive s390 based channel attached I/O devices. This includes interfaces for interaction with the hardware and interfaces for interacting with the common driver core. Those interfaces are provided by the s390 common I/O layer.
The document assumes a familarity with the technical terms associated with the s390 channel I/O architecture. For a description of this architecture, please refer to the "z/Architecture: Principles of Operation", IBM publication no. SA22-7832.
While most I/O devices on a s390 system are typically driven through the channel I/O mechanism described here, there are various other methods (like the diag interface). These are out of the scope of this document.
The s390 common I/O layer also provides access to some devices that are not strictly considered I/O devices. They are considered here as well, although they are not the focus of this document.
Some additional information can also be found in the kernel source under Documentation/arch/s390/driver-model.rst.
The css bus #
The css bus contains the subchannels available on the system. They fall into several categories:
-
Standard I/O subchannels, for use by the system. They have a child device on the ccw bus and are described below.
-
I/O subchannels bound to the vfio-ccw driver. See Documentation/arch/s390/vfio-ccw.rst.
-
Message subchannels. No Linux driver currently exists.
-
CHSC subchannels (at most one). The chsc subchannel driver can be used to send asynchronous chsc commands.
-
eADM subchannels. Used for talking to storage class memory.
The ccw bus #
The ccw bus typically contains the majority of devices available to a s390 system. Named after the channel command word (ccw), the basic command structure used to address its devices, the ccw bus contains so-called channel attached devices. They are addressed via I/O subchannels, visible on the css bus. A device driver for channel-attached devices, however, will never interact with the subchannel directly, but only via the I/O device on the ccw bus, the ccw device.
I/O functions for channel-attached devices #
Some hardware structures have been translated into C structures for use by the common I/O layer and device drivers. For more information on the hardware structures represented here, please consult the Principles of Operation.
struct ccw1 #
channel command word
Definition
;
Members
cmd_code: command codeflags: flags, like IDA addressing, etc.count: byte countcda: data address
Description
The ccw is the basic structure to build channel programs that perform operations with the device or the control unit. Only Format-1 channel command words are supported.
struct ccw0 #
channel command word
Definition
;
Members
cmd_code: command codecda: data addressflags: flags, like IDA addressing, etc.reserved: will be ignoredcount: byte count
Description
The format-0 ccw structure.
struct erw #
extended report word
Definition
;
Members
res0: reservedauth: authorization checkpvrf: path-verification-required flagcpt: channel-path timeoutfsavf: failing storage address validity flagcons: concurrent sensescavf: secondary ccw address validity flagfsaf: failing storage address formatscnt: sense count, if cons ==1res16: reserved
struct erw_eadm #
EADM Subchannel extended report word
Definition
;
Members
b: aob errorr: arsb error
struct sublog #
subchannel logout area
Definition
;
Members
res0: reservedesf: extended status flagslpum: last path used maskarep: ancillary reportfvf: field-validity flagssacc: storage access codetermc: termination codedevsc: device-status checkserr: secondary errorioerr: i/o-error alertseqc: sequence code
struct esw0 #
Format 0 Extended Status Word (ESW)
Definition
;
Members
sublog: subchannel logouterw: extended report wordfaddr: failing storage addresssaddr: secondary ccw address
struct esw1 #
Format 1 Extended Status Word (ESW)
Definition
;
Members
zero0: reserved zeroslpum: last path used maskzero16: reserved zeroserw: extended report wordzeros: three fullwords of zeros
struct esw2 #
Format 2 Extended Status Word (ESW)
Definition
;
Members
zero0: reserved zeroslpum: last path used maskdcti: device-connect-time intervalerw: extended report wordzeros: three fullwords of zeros
struct esw3 #
Format 3 Extended Status Word (ESW)
Definition
;
Members
zero0: reserved zeroslpum: last path used maskres: reservederw: extended report wordzeros: three fullwords of zeros
struct esw_eadm #
EADM Subchannel Extended Status Word (ESW)
Definition
;
Members
sublog: subchannel logouterw: extended report word
struct irb #
interruption response block
Definition
;
Members
scsw: subchannel status wordesw: extended status wordecw: extended control word
Description
The irb that is handed to the device driver when an interrupt occurs. For
solicited interrupts, the common I/O layer already performs checks whether
a field is valid; a field not being valid is always passed as 0.
If a unit check occurred, ecw may contain sense data; this is retrieved
by the common I/O layer itself if the device doesn't support concurrent
sense (so that the device driver never needs to perform basic sense itself).
For unsolicited interrupts, the irb is passed as-is (expect for sense data,
if applicable).
struct ciw #
command information word (CIW) layout
Definition
;
Members
et: entry typereserved: reserved bitsct: command typecmd: command codecount: command count
struct ccw_dev_id #
unique identifier for ccw devices
Definition
;
Members
ssid: subchannel set iddevno: device number
Description
This structure is not directly based on any hardware structure. The hardware identifies a device by its device number and its subchannel, which is in turn identified by its id. In order to get a unique identifier for ccw devices across subchannel sets, struct ccw_dev_id has been introduced.
ccw_dev_id_is_equal() #
int compare two ccw_dev_ids
Parameters
struct ccw_dev_id *dev_id1: a ccw_dev_idstruct ccw_dev_id *dev_id2: another ccw_dev_id
Return
1 if the two structures are equal field-by-field,
0 if not.
Context
any
pathmask_to_pos() #
u8 find the position of the left-most bit in a pathmask
Parameters
u8 mask: pathmask with at least one bit set
ccw devices #
Devices that want to initiate channel I/O need to attach to the ccw bus. Interaction with the driver core is done via the common I/O layer, which provides the abstractions of ccw devices and ccw device drivers.
The functions that initiate or terminate channel I/O all act upon a ccw device structure. Device drivers must not bypass those functions or strange side effects may happen.
struct ccw_device #
channel attached device
Definition
;
Members
ccwlock: pointer to device lockid: id of this devicedrv: ccw driver for this devicedev: embedded device structureonline: online status of devicehandler: interrupt handler
Description
handler is a member of the device rather than the driver since a driver can have different interrupt handlers for different ccw devices (multi-subchannel drivers).
struct ccw_driver #
device driver for channel attached devices
Definition
;
Members
ids: ids supported by this driverprobe: function called on proberemove: function called on removeset_online: called when setting device onlineset_offline: called when setting device offlinenotify: notify driver of device state changespath_event: notify driver of channel path eventsshutdown: called at device shutdownuc_handler: callback for unit check handlerdriver: embedded device driver structureint_class: interruption class to use for accounting interrupts
ccw_device_set_offline() #
int disable a ccw device for I/O
Parameters
struct ccw_device *cdev: target ccw device
Description
This function calls the driver's set_offline() function for cdev, if
given, and then disables cdev.
Return
0 on success and a negative error value on failure.
Context
enabled, ccw device lock not held
ccw_device_set_online() #
int enable a ccw device for I/O
Parameters
struct ccw_device *cdev: target ccw device
Description
This function first enables cdev and then calls the driver's set_online()
function for cdev, if given. If set_online() returns an error, cdev is
disabled again.
Return
0 on success and a negative error value on failure.
Context
enabled, ccw device lock not held
get_ccwdev_by_dev_id() #
struct ccw_device * obtain device from a ccw device id
Parameters
struct ccw_dev_id *dev_id: id of the device to be searched
Description
This function searches all devices attached to the ccw bus for a device matching dev_id.
Return
If a device is found its reference count is increased and returned;
else NULL is returned.
get_ccwdev_by_busid() #
struct ccw_device * obtain device from a bus id
Parameters
struct ccw_driver *cdrv: driver the device is owned byconst char *bus_id: bus id of the device to be searched
Description
This function searches all devices owned by cdrv for a device with a bus id matching bus_id.
Return
If a match is found, its reference count of the found device is increased
and it is returned; else NULL is returned.
ccw_driver_register() #
int register a ccw driver
Parameters
struct ccw_driver *cdriver: driver to be registered
Description
This function is mainly a wrapper around driver_register().
Return
0 on success and a negative error value on failure.
ccw_driver_unregister() #
void deregister a ccw driver
Parameters
struct ccw_driver *cdriver: driver to be deregistered
Description
This function is mainly a wrapper around driver_unregister().
ccw_device_siosl() #
int initiate logging
Parameters
struct ccw_device *cdev: ccw device
Description
This function is used to invoke model-dependent logging within the channel subsystem.
ccw_device_set_options_mask() #
int set some options and unset the rest
Parameters
struct ccw_device *cdev: device for which the options are to be setunsigned long flags: options to be set
Description
All flags specified in flags are set, all flags not specified in flags are cleared.
Return
0 on success, -EINVAL on an invalid flag combination.
ccw_device_set_options() #
int set some options
Parameters
struct ccw_device *cdev: device for which the options are to be setunsigned long flags: options to be set
Description
All flags specified in flags are set, the remainder is left untouched.
Return
0 on success, -EINVAL if an invalid flag combination would ensue.
ccw_device_clear_options() #
void clear some options
Parameters
struct ccw_device *cdev: device for which the options are to be clearedunsigned long flags: options to be cleared
Description
All flags specified in flags are cleared, the remainder is left untouched.
ccw_device_is_pathgroup() #
int determine if paths to this device are grouped
Parameters
struct ccw_device *cdev: ccw device
Description
Return non-zero if there is a path group, zero otherwise.
ccw_device_is_multipath() #
int determine if device is operating in multipath mode
Parameters
struct ccw_device *cdev: ccw device
Description
Return non-zero if device is operating in multipath mode, zero otherwise.
ccw_device_clear() #
int terminate I/O request processing
Parameters
struct ccw_device *cdev: target ccw deviceunsigned long intparm: interruption parameter to be returned upon conclusion of csch
Description
ccw_device_clear() calls csch on cdev's subchannel.
Return
0 on success,
-ENODEV on device not operational,
-EINVAL on invalid device state.
Context
Interrupts disabled, ccw device lock held
ccw_device_start_timeout_key() #
int start a s390 channel program with timeout and key
Parameters
struct ccw_device *cdev: target ccw devicestruct ccw1 *cpa: logical start address of channel programunsigned long intparm: user specific interruption parameter; will be presented back to cdev's interrupt handler. Allows a device driver to associate the interrupt with a particular I/O request.__u8 lpm: defines the channel path to be used for a specific I/O request. A value of 0 will make cio use the opm.__u8 key: storage key to be used for the I/Ounsigned long flags: additional flags; defines the action to be performed for I/O processing.int expires: timeout value in jiffies
Description
Start a S/390 channel program. When the interrupt arrives, the
IRQ handler is called, either immediately, delayed (dev-end missing,
or sense required) or never (no IRQ handler registered).
This function notifies the device driver if the channel program has not
completed during the time specified by expires. If a timeout occurs, the
channel program is terminated via xsch, hsch or csch, and the device's
interrupt handler will be called with an irb containing ERR_PTR(-ETIMEDOUT).
The interruption handler will echo back the intparm specified here, unless
another interruption parameter is specified by a subsequent invocation of
ccw_device_halt() or ccw_device_clear().
Return
0, if the operation was successful;
-EBUSY, if the device is busy, or status pending;
-EACCES, if no path specified in lpm is operational;
-ENODEV, if the device is not operational.
Context
Interrupts disabled, ccw device lock held
ccw_device_start_key() #
int start a s390 channel program with key
Parameters
struct ccw_device *cdev: target ccw devicestruct ccw1 *cpa: logical start address of channel programunsigned long intparm: user specific interruption parameter; will be presented back to cdev's interrupt handler. Allows a device driver to associate the interrupt with a particular I/O request.__u8 lpm: defines the channel path to be used for a specific I/O request. A value of 0 will make cio use the opm.__u8 key: storage key to be used for the I/Ounsigned long flags: additional flags; defines the action to be performed for I/O processing.
Description
Start a S/390 channel program. When the interrupt arrives, the
IRQ handler is called, either immediately, delayed (dev-end missing,
or sense required) or never (no IRQ handler registered).
The interruption handler will echo back the intparm specified here, unless
another interruption parameter is specified by a subsequent invocation of
ccw_device_halt() or ccw_device_clear().
Return
0, if the operation was successful;
-EBUSY, if the device is busy, or status pending;
-EACCES, if no path specified in lpm is operational;
-ENODEV, if the device is not operational.
Context
Interrupts disabled, ccw device lock held
ccw_device_start() #
int start a s390 channel program
Parameters
struct ccw_device *cdev: target ccw devicestruct ccw1 *cpa: logical start address of channel programunsigned long intparm: user specific interruption parameter; will be presented back to cdev's interrupt handler. Allows a device driver to associate the interrupt with a particular I/O request.__u8 lpm: defines the channel path to be used for a specific I/O request. A value of 0 will make cio use the opm.unsigned long flags: additional flags; defines the action to be performed for I/O processing.
Description
Start a S/390 channel program. When the interrupt arrives, the
IRQ handler is called, either immediately, delayed (dev-end missing,
or sense required) or never (no IRQ handler registered).
The interruption handler will echo back the intparm specified here, unless
another interruption parameter is specified by a subsequent invocation of
ccw_device_halt() or ccw_device_clear().
Return
0, if the operation was successful;
-EBUSY, if the device is busy, or status pending;
-EACCES, if no path specified in lpm is operational;
-ENODEV, if the device is not operational.
Context
Interrupts disabled, ccw device lock held
ccw_device_start_timeout() #
int start a s390 channel program with timeout
Parameters
struct ccw_device *cdev: target ccw devicestruct ccw1 *cpa: logical start address of channel programunsigned long intparm: user specific interruption parameter; will be presented back to cdev's interrupt handler. Allows a device driver to associate the interrupt with a particular I/O request.__u8 lpm: defines the channel path to be used for a specific I/O request. A value of 0 will make cio use the opm.unsigned long flags: additional flags; defines the action to be performed for I/O processing.int expires: timeout value in jiffies
Description
Start a S/390 channel program. When the interrupt arrives, the
IRQ handler is called, either immediately, delayed (dev-end missing,
or sense required) or never (no IRQ handler registered).
This function notifies the device driver if the channel program has not
completed during the time specified by expires. If a timeout occurs, the
channel program is terminated via xsch, hsch or csch, and the device's
interrupt handler will be called with an irb containing ERR_PTR(-ETIMEDOUT).
The interruption handler will echo back the intparm specified here, unless
another interruption parameter is specified by a subsequent invocation of
ccw_device_halt() or ccw_device_clear().
Return
0, if the operation was successful;
-EBUSY, if the device is busy, or status pending;
-EACCES, if no path specified in lpm is operational;
-ENODEV, if the device is not operational.
Context
Interrupts disabled, ccw device lock held
ccw_device_halt() #
int halt I/O request processing
Parameters
struct ccw_device *cdev: target ccw deviceunsigned long intparm: interruption parameter to be returned upon conclusion of hsch
Description
ccw_device_halt() calls hsch on cdev's subchannel.
The interruption handler will echo back the intparm specified here, unless
another interruption parameter is specified by a subsequent invocation of
ccw_device_clear().
Return
0 on success,
-ENODEV on device not operational,
-EINVAL on invalid device state,
-EBUSY on device busy or interrupt pending.
Context
Interrupts disabled, ccw device lock held
ccw_device_resume() #
int resume channel program execution
Parameters
struct ccw_device *cdev: target ccw device
Description
ccw_device_resume() calls rsch on cdev's subchannel.
Return
0 on success,
-ENODEV on device not operational,
-EINVAL on invalid device state,
-EBUSY on device busy or interrupt pending.
Context
Interrupts disabled, ccw device lock held
ccw_device_get_ciw() #
struct ciw * Search for CIW command in extended sense data.
Parameters
struct ccw_device *cdev: ccw device to inspect__u32 ct: command type to look for
Description
During SenseID, command information words (CIWs) describing special commands available to the device may have been stored in the extended sense data. This function searches for CIWs of a specified command type in the extended sense data.
Return
NULL if no extended sense data has been stored or if no CIW of the
specified command type could be found,
else a pointer to the CIW of the specified command type.
ccw_device_get_path_mask() #
__u8 get currently available paths
Parameters
struct ccw_device *cdev: ccw device to be queried
Return
0 if no subchannel for the device is available,
else the mask of currently available paths for the ccw device's subchannel.
ccw_device_get_chp_desc() #
struct channel_path_desc_fmt0 * return newly allocated channel-path descriptor
Parameters
struct ccw_device *cdev: device to obtain the descriptor forint chp_idx: index of the channel path
Description
On success return a newly allocated copy of the channel-path description
data associated with the given channel path. Return NULL on error.
ccw_device_get_util_str() #
u8 * return newly allocated utility strings
Parameters
struct ccw_device *cdev: device to obtain the utility strings forint chp_idx: index of the channel path
Description
On success return a newly allocated copy of the utility strings
associated with the given channel path. Return NULL on error.
ccw_device_get_id() #
void obtain a ccw device id
Parameters
struct ccw_device *cdev: device to obtain the id forstruct ccw_dev_id *dev_id: where to fill in the values
ccw_device_tm_start_timeout_key() #
int perform start function
Parameters
struct ccw_device *cdev: ccw device on which to perform the start functionstruct tcw *tcw: transport-command word to be startedunsigned long intparm: user defined parameter to be passed to the interrupt handleru8 lpm: mask of paths to useu8 key: storage key to use for storage accessint expires: time span in jiffies after which to abort request
Description
Start the tcw on the given ccw device. Return zero on success, non-zero otherwise.
ccw_device_tm_start_key() #
int perform start function
Parameters
struct ccw_device *cdev: ccw device on which to perform the start functionstruct tcw *tcw: transport-command word to be startedunsigned long intparm: user defined parameter to be passed to the interrupt handleru8 lpm: mask of paths to useu8 key: storage key to use for storage access
Description
Start the tcw on the given ccw device. Return zero on success, non-zero otherwise.
ccw_device_tm_start() #
int perform start function
Parameters
struct ccw_device *cdev: ccw device on which to perform the start functionstruct tcw *tcw: transport-command word to be startedunsigned long intparm: user defined parameter to be passed to the interrupt handleru8 lpm: mask of paths to use
Description
Start the tcw on the given ccw device. Return zero on success, non-zero otherwise.
ccw_device_tm_start_timeout() #
int perform start function
Parameters
struct ccw_device *cdev: ccw device on which to perform the start functionstruct tcw *tcw: transport-command word to be startedunsigned long intparm: user defined parameter to be passed to the interrupt handleru8 lpm: mask of paths to useint expires: time span in jiffies after which to abort request
Description
Start the tcw on the given ccw device. Return zero on success, non-zero otherwise.
ccw_device_get_mdc() #
int accumulate max data count
Parameters
struct ccw_device *cdev: ccw device for which the max data count is accumulatedu8 mask: mask of paths to use
Description
Return the number of 64K-bytes blocks all paths at least support for a transport command. Return value 0 indicates failure.
ccw_device_tm_intrg() #
int perform interrogate function
Parameters
struct ccw_device *cdev: ccw device on which to perform the interrogate function
Description
Perform an interrogate function on the given ccw device. Return zero on success, non-zero otherwise.
ccw_device_get_schid() #
void obtain a subchannel id
Parameters
struct ccw_device *cdev: device to obtain the id forstruct subchannel_id *schid: where to fill in the values
ccw_device_pnso() #
int Perform Network-Subchannel Operation
Parameters
struct ccw_device *cdev: device on which PNSO is performedstruct chsc_pnso_area *pnso_area: request and response block for the operationu8 oc: Operation Codestruct chsc_pnso_resume_token resume_token: resume token for multiblock responseint cnc: Boolean change-notification control
Description
pnso_area must be allocated by the caller with get_zeroed_page(GFP_KERNEL)
Returns 0 on success.
ccw_device_get_cssid() #
int obtain Channel Subsystem ID
Parameters
struct ccw_device *cdev: device to obtain the CSSID foru8 *cssid: The resulting Channel Subsystem ID
ccw_device_get_iid() #
int obtain MIF-image ID
Parameters
struct ccw_device *cdev: device to obtain the MIF-image ID foru8 *iid: The resulting MIF-image ID
ccw_device_get_chpid() #
int obtain Channel Path ID
Parameters
struct ccw_device *cdev: device to obtain the Channel Path ID forint chp_idx: Index of the channel pathu8 *chpid: The resulting Channel Path ID
ccw_device_get_chid() #
int obtain Channel ID associated with specified CHPID
Parameters
struct ccw_device *cdev: device to obtain the Channel ID forint chp_idx: Index of the channel pathu16 *chid: The resulting Channel ID
The channel-measurement facility #
The channel-measurement facility provides a means to collect measurement data which is made available by the channel subsystem for each channel attached device.
struct cmbdata #
channel measurement block data for user space
Definition
;
Members
size: size of the stored dataelapsed_time: time since last samplingssch_rsch_count: number of ssch and rschsample_count: number of samplesdevice_connect_time: time of device connectfunction_pending_time: time of function pendingdevice_disconnect_time: time of device disconnectcontrol_unit_queuing_time: time of control unit queuingdevice_active_only_time: time of device active onlydevice_busy_time: time of device busy (ext. format)initial_command_response_time: initial command response time (ext. format)
Description
All values are stored as 64 bit for simplicity, especially in 32 bit emulation mode. All time values are normalized to nanoseconds. Currently, two formats are known, which differ by the size of this structure, i.e. the last two members are only set when the extended channel measurement facility (first shipped in z990 machines) is activated. Potentially, more fields could be added, which would result in a new ioctl number.
enable_cmf() #
int switch on the channel measurement for a specific device
Parameters
struct ccw_device *cdev: The ccw device to be enabled
Description
Enable channel measurements for cdev. If this is called on a device for which channel measurement is already enabled a reset of the measurement data is triggered.
Return
0 for success or a negative error value.
Context
non-atomic
disable_cmf() #
int switch off the channel measurement for a specific device
Parameters
struct ccw_device *cdev: The ccw device to be disabled
Return
0 for success or a negative error value.
Context
non-atomic
cmf_read() #
u64 read one value from the current channel measurement block
Parameters
struct ccw_device *cdev: the channel to be readint index: the index of the value to be read
Return
The value read or 0 if the value cannot be read.
Context
any
cmf_readall() #
int read the current channel measurement block
Parameters
struct ccw_device *cdev: the channel to be readstruct cmbdata *data: a pointer to a data block that will be filled
Return
0 on success, a negative error value otherwise.
Context
any
The ccwgroup bus #
The ccwgroup bus only contains artificial devices, created by the user. Many networking devices (e.g. qeth) are in fact composed of several ccw devices (like read, write and data channel for qeth). The ccwgroup bus provides a mechanism to create a meta-device which contains those ccw devices as slave devices and can be associated with the netdevice.
ccw group devices #
struct ccwgroup_device #
ccw group device
Definition
;
Members
state: online/offline statecount: number of attached slave devicesdev: embedded device structureungroup_work: used to ungroup the ccwgroup devicecdev: variable number of slave devices, allocated as needed
struct ccwgroup_driver #
driver for ccw group devices
Definition
;
Members
setup: function called during device creation to setup the deviceremove: function called on removeset_online: function called when device is set onlineset_offline: function called when device is set offlineshutdown: function called when device is shut downdriver: embedded driver structureccw_driver: supported ccw_driver (optional)
ccwgroup_set_online() #
int enable a ccwgroup device
Parameters
struct ccwgroup_device *gdev: target ccwgroup device
Description
This function attempts to put the ccwgroup device into the online state.
Return
0 on success and a negative error value on failure.
ccwgroup_set_offline() #
int disable a ccwgroup device
Parameters
struct ccwgroup_device *gdev: target ccwgroup devicebool call_gdrv: Call the registered gdrv set_offline function
Description
This function attempts to put the ccwgroup device into the offline state.
Return
0 on success and a negative error value on failure.
ccwgroup_create_dev() #
int create and register a ccw group device
Parameters
struct device *parent: parent device for the new devicestruct ccwgroup_driver *gdrv: driver for the new group deviceint num_devices: number of slave devicesconst char *buf: buffer containing comma separated bus ids of slave devices
Description
Create and register a new ccw group device as a child of parent. Slave devices are obtained from the list of bus ids given in buf.
Return
0 on success and an error code on failure.
Context
non-atomic
ccwgroup_driver_register() #
int register a ccw group driver
Parameters
struct ccwgroup_driver *cdriver: driver to be registered
Description
This function is mainly a wrapper around driver_register().
ccwgroup_driver_unregister() #
void deregister a ccw group driver
Parameters
struct ccwgroup_driver *cdriver: driver to be deregistered
Description
This function is mainly a wrapper around driver_unregister().
ccwgroup_probe_ccwdev() #
int probe function for slave devices
Parameters
struct ccw_device *cdev: ccw device to be probed
Description
This is a dummy probe function for ccw devices that are slave devices in a ccw group device.
Return
always 0
ccwgroup_remove_ccwdev() #
void remove function for slave devices
Parameters
struct ccw_device *cdev: ccw device to be removed
Description
This is a remove function for ccw devices that are slave devices in a ccw group device. It sets the ccw device offline and also deregisters the embedding ccw group device.
Generic interfaces #
The following section contains interfaces in use not only by drivers dealing with ccw devices, but drivers for various other s390 hardware as well.
Adapter interrupts #
The common I/O layer provides helper functions for dealing with adapter interrupts and interrupt vectors.
register_adapter_interrupt() #
int register adapter interrupt handler
Parameters
struct airq_struct *airq: pointer to adapter interrupt descriptor
Description
Returns 0 on success, or -EINVAL.
unregister_adapter_interrupt() #
void unregister adapter interrupt handler
Parameters
struct airq_struct *airq: pointer to adapter interrupt descriptor
airq_iv_create() #
struct airq_iv * create an interrupt vector
Parameters
unsigned long bits: number of bits in the interrupt vectorunsigned long flags: allocation flagsunsigned long *vec: pointer to pinned guest memory if AIRQ_IV_GUESTVEC
Description
Returns a pointer to an interrupt vector structure
airq_iv_release() #
void release an interrupt vector
Parameters
struct airq_iv *iv: pointer to interrupt vector structure
airq_iv_alloc() #
unsigned long allocate irq bits from an interrupt vector
Parameters
struct airq_iv *iv: pointer to an interrupt vector structureunsigned long num: number of consecutive irq bits to allocate
Description
Returns the bit number of the first irq in the allocated block of irqs, or -1UL if no bit is available or the AIRQ_IV_ALLOC flag has not been specified
airq_iv_free() #
void free irq bits of an interrupt vector
Parameters
struct airq_iv *iv: pointer to interrupt vector structureunsigned long bit: number of the first irq bit to freeunsigned long num: number of consecutive irq bits to free
airq_iv_scan() #
unsigned long scan interrupt vector for non-zero bits
Parameters
struct airq_iv *iv: pointer to interrupt vector structureunsigned long start: bit number to start the searchunsigned long end: bit number to end the search
Description
Returns the bit number of the next non-zero interrupt bit, or -1UL if the scan completed without finding any more any non-zero bits.