136 lines · plain
1===================================2Writing s390 channel device drivers3===================================4 5:Author: Cornelia Huck6 7Introduction8============9 10This document describes the interfaces available for device drivers that11drive s390 based channel attached I/O devices. This includes interfaces12for interaction with the hardware and interfaces for interacting with13the common driver core. Those interfaces are provided by the s390 common14I/O layer.15 16The document assumes a familarity with the technical terms associated17with the s390 channel I/O architecture. For a description of this18architecture, please refer to the "z/Architecture: Principles of19Operation", IBM publication no. SA22-7832.20 21While most I/O devices on a s390 system are typically driven through the22channel I/O mechanism described here, there are various other methods23(like the diag interface). These are out of the scope of this document.24 25The s390 common I/O layer also provides access to some devices that are26not strictly considered I/O devices. They are considered here as well,27although they are not the focus of this document.28 29Some additional information can also be found in the kernel source under30Documentation/arch/s390/driver-model.rst.31 32The css bus33===========34 35The css bus contains the subchannels available on the system. They fall36into several categories:37 38* Standard I/O subchannels, for use by the system. They have a child39 device on the ccw bus and are described below.40* I/O subchannels bound to the vfio-ccw driver. See41 Documentation/arch/s390/vfio-ccw.rst.42* Message subchannels. No Linux driver currently exists.43* CHSC subchannels (at most one). The chsc subchannel driver can be used44 to send asynchronous chsc commands.45* eADM subchannels. Used for talking to storage class memory.46 47The ccw bus48===========49 50The ccw bus typically contains the majority of devices available to a51s390 system. Named after the channel command word (ccw), the basic52command structure used to address its devices, the ccw bus contains53so-called channel attached devices. They are addressed via I/O54subchannels, visible on the css bus. A device driver for55channel-attached devices, however, will never interact with the56subchannel directly, but only via the I/O device on the ccw bus, the ccw57device.58 59I/O functions for channel-attached devices60------------------------------------------61 62Some hardware structures have been translated into C structures for use63by the common I/O layer and device drivers. For more information on the64hardware structures represented here, please consult the Principles of65Operation.66 67.. kernel-doc:: arch/s390/include/asm/cio.h68 :internal:69 70ccw devices71-----------72 73Devices that want to initiate channel I/O need to attach to the ccw bus.74Interaction with the driver core is done via the common I/O layer, which75provides the abstractions of ccw devices and ccw device drivers.76 77The functions that initiate or terminate channel I/O all act upon a ccw78device structure. Device drivers must not bypass those functions or79strange side effects may happen.80 81.. kernel-doc:: arch/s390/include/asm/ccwdev.h82 :internal:83 84.. kernel-doc:: drivers/s390/cio/device.c85 :export:86 87.. kernel-doc:: drivers/s390/cio/device_ops.c88 :export:89 90The channel-measurement facility91--------------------------------92 93The channel-measurement facility provides a means to collect measurement94data which is made available by the channel subsystem for each channel95attached device.96 97.. kernel-doc:: arch/s390/include/uapi/asm/cmb.h98 :internal:99 100.. kernel-doc:: drivers/s390/cio/cmf.c101 :export:102 103The ccwgroup bus104================105 106The ccwgroup bus only contains artificial devices, created by the user.107Many networking devices (e.g. qeth) are in fact composed of several ccw108devices (like read, write and data channel for qeth). The ccwgroup bus109provides a mechanism to create a meta-device which contains those ccw110devices as slave devices and can be associated with the netdevice.111 112ccw group devices113-----------------114 115.. kernel-doc:: arch/s390/include/asm/ccwgroup.h116 :internal:117 118.. kernel-doc:: drivers/s390/cio/ccwgroup.c119 :export:120 121Generic interfaces122==================123 124The following section contains interfaces in use not only by drivers125dealing with ccw devices, but drivers for various other s390 hardware126as well.127 128Adapter interrupts129------------------130 131The common I/O layer provides helper functions for dealing with adapter132interrupts and interrupt vectors.133 134.. kernel-doc:: drivers/s390/cio/airq.c135 :export:136