megaraid.rst 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ==========================
  3. Notes on Management Module
  4. ==========================
  5. Overview
  6. --------
  7. Different classes of controllers from LSI Logic accept and respond to the
  8. user applications in a similar way. They understand the same firmware control
  9. commands. Furthermore, the applications also can treat different classes of
  10. the controllers uniformly. Hence it is logical to have a single module that
  11. interfaces with the applications on one side and all the low level drivers
  12. on the other.
  13. The advantages, though obvious, are listed for completeness:
  14. i. Avoid duplicate code from the low level drivers.
  15. ii. Unburden the low level drivers from having to export the
  16. character node device and related handling.
  17. iii. Implement any policy mechanisms in one place.
  18. iv. Applications have to interface with only module instead of
  19. multiple low level drivers.
  20. Currently this module (called Common Management Module) is used only to issue
  21. ioctl commands. But this module is envisioned to handle all user space level
  22. interactions. So any 'proc', 'sysfs' implementations will be localized in this
  23. common module.
  24. Credits
  25. -------
  26. ::
  27. "Shared code in a third module, a "library module", is an acceptable
  28. solution. modprobe automatically loads dependent modules, so users
  29. running "modprobe driver1" or "modprobe driver2" would automatically
  30. load the shared library module."
  31. - Jeff Garzik (jgarzik@pobox.com), 02.25.2004 LKML
  32. ::
  33. "As Jeff hinted, if your userspace<->driver API is consistent between
  34. your new MPT-based RAID controllers and your existing megaraid driver,
  35. then perhaps you need a single small helper module (lsiioctl or some
  36. better name), loaded by both mptraid and megaraid automatically, which
  37. handles registering the /dev/megaraid node dynamically. In this case,
  38. both mptraid and megaraid would register with lsiioctl for each
  39. adapter discovered, and lsiioctl would essentially be a switch,
  40. redirecting userspace tool ioctls to the appropriate driver."
  41. - Matt Domsch, (Matt_Domsch@dell.com), 02.25.2004 LKML
  42. Design
  43. ------
  44. The Common Management Module is implemented in megaraid_mm.[ch] files. This
  45. module acts as a registry for low level hba drivers. The low level drivers
  46. (currently only megaraid) register each controller with the common module.
  47. The applications interface with the common module via the character device
  48. node exported by the module.
  49. The lower level drivers now understand only a new improved ioctl packet called
  50. uioc_t. The management module converts the older ioctl packets from the older
  51. applications into uioc_t. After driver handles the uioc_t, the common module
  52. will convert that back into the old format before returning to applications.
  53. As new applications evolve and replace the old ones, the old packet format
  54. will be retired.
  55. Common module dedicates one uioc_t packet to each controller registered. This
  56. can easily be more than one. But since megaraid is the only low level driver
  57. today, and it can handle only one ioctl, there is no reason to have more. But
  58. as new controller classes get added, this will be tuned appropriately.