I have a highpoint RAID controller, which I'd like to be able to query with hdparm. smartctl allows operations on underlying devices within hardware RAID, so I thought I would add similar support to hdparm.
I've attached diffs for my changes which allow this. Although at present they only talk to the Highpoint controllers, they could easily be extended to support other controllers such as the cciss devices provided by HP hardware. The user interface is based on that used by smartctl, although implemented independantly:
hdparm --controller hpt,1/2/3 -i /dev/sdn
will query the first controller, 2nd port, 3rd device (usually a 3rd port-multiplier device connected to the second port).
Internally all the new operations are prefixed by 'controller_*', and all ioctl operations on the device go through this interface. This should allow other controllers to substitute their own handling. I decided to use a dispatcher function, rather than merely using a function table, although I'm not certain whether it is any better or worse.
I've tested this for the last couple of weeks, both talking to direct devices (no --controller option) and querying the highpoint device details. It appears stable and I've not had any crashes. Care should always be taken with these sorts of operations. It is known that 'hdparm -C' does not work on the highpoint controller (non-fatal - it just returns an error when it should have worked on the underlying device) - I have reported this to highpoint and they have stated that a fix will be available shortly. If nothing else, getting drivers fixed seems a good use for the patch, although I can completely understand if it does not fit with the way that you want to take hdparm.
The full source, along with the diff, has been placed up at http://usenet.gerph.org/HDParm/ so even if this isn't accepted as a core patch, it might be used by others. I'm happy to take suggestions and change requests, anyhow, although finding the time to make changes will always be a challenge :-)
Log in to post a comment.