Solaris Device Driver Attach Failure
Many times, we have seen failure while attaching a driver module to its corresponding device(s). The more frequent error message is "driver loaded successfully but failed to attach". We don't find any more information in the system log (/var/adm/messages or dmesg) too.
During the driver attach, the Operating System tries to know the presence of the device to which driver module is to be attached. To do this, it checks the name property of each device in the device tree and them proceeds with matching compatible property if it finds no match. If it finds no matching compatible property, then it fails the attach operation.
We can make use of -i (the alias) option of add_drv to specify device to which the driver need to be attached. For example, to attach driver module xyz to a PCIe device with vendor ID 0xABCD and device ID 0x1234, use add_drv -i '"pciexABCD,1234"' xyz. This will result in attaching driver module xyz to the device with vendor ID 0xABCD and device ID 0x1234. This can be verified by running modinfo.