Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0
0002 
0003 ==========================
0004 Notes on Management Module
0005 ==========================
0006 
0007 Overview
0008 --------
0009 
0010 Different classes of controllers from LSI Logic accept and respond to the
0011 user applications in a similar way. They understand the same firmware control
0012 commands. Furthermore, the applications also can treat different classes of
0013 the controllers uniformly. Hence it is logical to have a single module that
0014 interfaces with the applications on one side and all the low level drivers
0015 on the other.
0016 
0017 The advantages, though obvious, are listed for completeness:
0018 
0019         i.      Avoid duplicate code from the low level drivers.
0020         ii.     Unburden the low level drivers from having to export the
0021                 character node device and related handling.
0022         iii.    Implement any policy mechanisms in one place.
0023         iv.     Applications have to interface with only module instead of
0024                 multiple low level drivers.
0025 
0026 Currently this module (called Common Management Module) is used only to issue
0027 ioctl commands. But this module is envisioned to handle all user space level
0028 interactions. So any 'proc', 'sysfs' implementations will be localized in this
0029 common module.
0030 
0031 Credits
0032 -------
0033 
0034 ::
0035 
0036         "Shared code in a third module, a "library module", is an acceptable
0037         solution. modprobe automatically loads dependent modules, so users
0038         running "modprobe driver1" or "modprobe driver2" would automatically
0039         load the shared library module."
0040 
0041 - Jeff Garzik (jgarzik@pobox.com), 02.25.2004 LKML
0042 
0043 ::
0044 
0045         "As Jeff hinted, if your userspace<->driver API is consistent between
0046         your new MPT-based RAID controllers and your existing megaraid driver,
0047         then perhaps you need a single small helper module (lsiioctl or some
0048         better name), loaded by both mptraid and megaraid automatically, which
0049         handles registering the /dev/megaraid node dynamically. In this case,
0050         both mptraid and megaraid would register with lsiioctl for each
0051         adapter discovered, and lsiioctl would essentially be a switch,
0052         redirecting userspace tool ioctls to the appropriate driver."
0053 
0054 - Matt Domsch, (Matt_Domsch@dell.com), 02.25.2004 LKML
0055 
0056 Design
0057 ------
0058 
0059 The Common Management Module is implemented in megaraid_mm.[ch] files. This
0060 module acts as a registry for low level hba drivers. The low level drivers
0061 (currently only megaraid) register each controller with the common module.
0062 
0063 The applications interface with the common module via the character device
0064 node exported by the module.
0065 
0066 The lower level drivers now understand only a new improved ioctl packet called
0067 uioc_t. The management module converts the older ioctl packets from the older
0068 applications into uioc_t. After driver handles the uioc_t, the common module
0069 will convert that back into the old format before returning to applications.
0070 
0071 As new applications evolve and replace the old ones, the old packet format
0072 will be retired.
0073 
0074 Common module dedicates one uioc_t packet to each controller registered. This
0075 can easily be more than one. But since megaraid is the only low level driver
0076 today, and it can handle only one ioctl, there is no reason to have more. But
0077 as new controller classes get added, this will be tuned appropriately.