James C. McPherson wrote: > Raj, Ashok wrote: >> Hi >> >> There are some devices that need microcode files to be uploaded. We have >> a similar situation with cpu microcode and we used kobj_open/kobj_read >> in the kernel. >> >> Is it acceptable for device drivers to do the same? For e.g a wireless >> nic driver that needs sort of the same functionality. Today we are >> including the ucode in the driver that seems ugly. (not that they get >> changed very often, but still....) >> >> I hear that this would be discouraged to use any other than the ddi >> framework calls.
What you hear is correct. The approach in a driver, rather than building all the mCode into the driver binary and wasting memory, would be to build misc modules with the firmware encoded into a large static byte array or similar. Then the driver can use ddi_modopen(9f) to load the appropriate mCode module stuff the data into the device and use ddi_modclose(9f) to allow the module to unload. > Hi Ashok, > you should have a look into PSARC/2008/198 > http://opensolaris.org/os/community/arc/caselog/2008/198 This basically skips having to encode the binary mCode into something that can be passed to the complier. It's however not yet integrated. As such I wouldn't bet any new work on this being available without coordinating with the folks delivering this. -jan
