You can clone with
Cannot retrieve contributors at this time
Notes on Management Module ~~~~~~~~~~~~~~~~~~~~~~~~~~Overview:--------Different classes of controllers from LSI Logic accept and respond to theuser applications in a similar way. They understand the same firmware controlcommands. Furthermore, the applications also can treat different classes ofthe controllers uniformly. Hence it is logical to have a single module thatinterfaces with the applications on one side and all the low level driverson the other.The advantages, though obvious, are listed for completeness: i. Avoid duplicate code from the low level drivers. ii. Unburden the low level drivers from having to export the character node device and related handling. iii. Implement any policy mechanisms in one place. iv. Applications have to interface with only module instead of multiple low level drivers.Currently this module (called Common Management Module) is used only to issueioctl commands. But this module is envisioned to handle all user space levelinteractions. So any 'proc', 'sysfs' implementations will be localized in thiscommon module.Credits:-------"Shared code in a third module, a "library module", is an acceptablesolution. modprobe automatically loads dependent modules, so usersrunning "modprobe driver1" or "modprobe driver2" would automaticallyload the shared library module." - Jeff Garzik (email@example.com), 02.25.2004 LKML"As Jeff hinted, if your userspace<->driver API is consistent betweenyour new MPT-based RAID controllers and your existing megaraid driver,then perhaps you need a single small helper module (lsiioctl or somebetter name), loaded by both mptraid and megaraid automatically, whichhandles registering the /dev/megaraid node dynamically. In this case,both mptraid and megaraid would register with lsiioctl for eachadapter discovered, and lsiioctl would essentially be a switch,redirecting userspace tool ioctls to the appropriate driver." - Matt Domsch, (Matt_Domsch@dell.com), 02.25.2004 LKMLDesign:------The Common Management Module is implemented in megaraid_mm.[ch] files. Thismodule acts as a registry for low level hba drivers. The low level drivers(currently only megaraid) register each controller with the common module.The applications interface with the common module via the character devicenode exported by the module.The lower level drivers now understand only a new improved ioctl packet calleduioc_t. The management module converts the older ioctl packets from the olderapplications into uioc_t. After driver handles the uioc_t, the common modulewill convert that back into the old format before returning to applications.As new applications evolve and replace the old ones, the old packet format will be retired.Common module dedicates one uioc_t packet to each controller registered. Thiscan easily be more than one. But since megaraid is the only low level drivertoday, and it can handle only one ioctl, there is no reason to have more. Butas new controller classes get added, this will be tuned appropriately.