s390-drivers.rst 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. Some additional information can also be found in the kernel source under
  20. Documentation/s390/driver-model.txt.
  21. The ccw bus
  22. ===========
  23. The ccw bus typically contains the majority of devices available to a
  24. s390 system. Named after the channel command word (ccw), the basic
  25. command structure used to address its devices, the ccw bus contains
  26. so-called channel attached devices. They are addressed via I/O
  27. subchannels, visible on the css bus. A device driver for
  28. channel-attached devices, however, will never interact with the
  29. subchannel directly, but only via the I/O device on the ccw bus, the ccw
  30. device.
  31. I/O functions for channel-attached devices
  32. ------------------------------------------
  33. Some hardware structures have been translated into C structures for use
  34. by the common I/O layer and device drivers. For more information on the
  35. hardware structures represented here, please consult the Principles of
  36. Operation.
  37. .. kernel-doc:: arch/s390/include/asm/cio.h
  38. :internal:
  39. ccw devices
  40. -----------
  41. Devices that want to initiate channel I/O need to attach to the ccw bus.
  42. Interaction with the driver core is done via the common I/O layer, which
  43. provides the abstractions of ccw devices and ccw device drivers.
  44. The functions that initiate or terminate channel I/O all act upon a ccw
  45. device structure. Device drivers must not bypass those functions or
  46. strange side effects may happen.
  47. .. kernel-doc:: arch/s390/include/asm/ccwdev.h
  48. :internal:
  49. .. kernel-doc:: drivers/s390/cio/device.c
  50. :export:
  51. .. kernel-doc:: drivers/s390/cio/device_ops.c
  52. :export:
  53. The channel-measurement facility
  54. --------------------------------
  55. The channel-measurement facility provides a means to collect measurement
  56. data which is made available by the channel subsystem for each channel
  57. attached device.
  58. .. kernel-doc:: arch/s390/include/asm/cmb.h
  59. :internal:
  60. .. kernel-doc:: drivers/s390/cio/cmf.c
  61. :export:
  62. The ccwgroup bus
  63. ================
  64. The ccwgroup bus only contains artificial devices, created by the user.
  65. Many networking devices (e.g. qeth) are in fact composed of several ccw
  66. devices (like read, write and data channel for qeth). The ccwgroup bus
  67. provides a mechanism to create a meta-device which contains those ccw
  68. devices as slave devices and can be associated with the netdevice.
  69. ccw group devices
  70. -----------------
  71. .. kernel-doc:: arch/s390/include/asm/ccwgroup.h
  72. :internal:
  73. .. kernel-doc:: drivers/s390/cio/ccwgroup.c
  74. :export:
  75. Generic interfaces
  76. ==================
  77. Some interfaces are available to other drivers that do not necessarily
  78. have anything to do with the busses described above, but still are
  79. indirectly using basic infrastructure in the common I/O layer. One
  80. example is the support for adapter interrupts.
  81. .. kernel-doc:: drivers/s390/cio/airq.c
  82. :export: