megaraid.txt 3.0 KB

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