s390-drivers.rst 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. ===================================
  2. Writing s390 channel device drivers
  3. ===================================
  4. :Author: Cornelia Huck
  5. Introduction
  6. ============
  7. This document describes the interfaces available for device drivers that
  8. drive s390 based channel attached I/O devices. This includes interfaces
  9. for interaction with the hardware and interfaces for interacting with
  10. the common driver core. Those interfaces are provided by the s390 common
  11. I/O layer.
  12. The document assumes a familarity with the technical terms associated
  13. with the s390 channel I/O architecture. For a description of this
  14. architecture, please refer to the "z/Architecture: Principles of
  15. Operation", IBM publication no. SA22-7832.
  16. While most I/O devices on a s390 system are typically driven through the
  17. channel I/O mechanism described here, there are various other methods
  18. (like the diag interface). These are out of the scope of this document.
  19. The s390 common I/O layer also provides access to some devices that are
  20. not strictly considered I/O devices. They are considered here as well,
  21. although they are not the focus of this document.
  22. Some additional information can also be found in the kernel source under
  23. Documentation/s390/driver-model.txt.
  24. The css bus
  25. ===========
  26. The css bus contains the subchannels available on the system. They fall
  27. into several categories:
  28. * Standard I/O subchannels, for use by the system. They have a child
  29. device on the ccw bus and are described below.
  30. * I/O subchannels bound to the vfio-ccw driver. See
  31. Documentation/s390/vfio-ccw.txt.
  32. * Message subchannels. No Linux driver currently exists.
  33. * CHSC subchannels (at most one). The chsc subchannel driver can be used
  34. to send asynchronous chsc commands.
  35. * eADM subchannels. Used for talking to storage class memory.
  36. The ccw bus
  37. ===========
  38. The ccw bus typically contains the majority of devices available to a
  39. s390 system. Named after the channel command word (ccw), the basic
  40. command structure used to address its devices, the ccw bus contains
  41. so-called channel attached devices. They are addressed via I/O
  42. subchannels, visible on the css bus. A device driver for
  43. channel-attached devices, however, will never interact with the
  44. subchannel directly, but only via the I/O device on the ccw bus, the ccw
  45. device.
  46. I/O functions for channel-attached devices
  47. ------------------------------------------
  48. Some hardware structures have been translated into C structures for use
  49. by the common I/O layer and device drivers. For more information on the
  50. hardware structures represented here, please consult the Principles of
  51. Operation.
  52. .. kernel-doc:: arch/s390/include/asm/cio.h
  53. :internal:
  54. ccw devices
  55. -----------
  56. Devices that want to initiate channel I/O need to attach to the ccw bus.
  57. Interaction with the driver core is done via the common I/O layer, which
  58. provides the abstractions of ccw devices and ccw device drivers.
  59. The functions that initiate or terminate channel I/O all act upon a ccw
  60. device structure. Device drivers must not bypass those functions or
  61. strange side effects may happen.
  62. .. kernel-doc:: arch/s390/include/asm/ccwdev.h
  63. :internal:
  64. .. kernel-doc:: drivers/s390/cio/device.c
  65. :export:
  66. .. kernel-doc:: drivers/s390/cio/device_ops.c
  67. :export:
  68. The channel-measurement facility
  69. --------------------------------
  70. The channel-measurement facility provides a means to collect measurement
  71. data which is made available by the channel subsystem for each channel
  72. attached device.
  73. .. kernel-doc:: arch/s390/include/uapi/asm/cmb.h
  74. :internal:
  75. .. kernel-doc:: drivers/s390/cio/cmf.c
  76. :export:
  77. The ccwgroup bus
  78. ================
  79. The ccwgroup bus only contains artificial devices, created by the user.
  80. Many networking devices (e.g. qeth) are in fact composed of several ccw
  81. devices (like read, write and data channel for qeth). The ccwgroup bus
  82. provides a mechanism to create a meta-device which contains those ccw
  83. devices as slave devices and can be associated with the netdevice.
  84. ccw group devices
  85. -----------------
  86. .. kernel-doc:: arch/s390/include/asm/ccwgroup.h
  87. :internal:
  88. .. kernel-doc:: drivers/s390/cio/ccwgroup.c
  89. :export:
  90. Generic interfaces
  91. ==================
  92. The following section contains interfaces in use not only by drivers
  93. dealing with ccw devices, but drivers for various other s390 hardware
  94. as well.
  95. Adapter interrupts
  96. ------------------
  97. The common I/O layer provides helper functions for dealing with adapter
  98. interrupts and interrupt vectors.
  99. .. kernel-doc:: drivers/s390/cio/airq.c
  100. :export: