One of the possible solutions to a problem that I'm working on is to have two Drivers loading in one DriverKit dext, an IOUserHIDEventService and an IOUserHIDDevice. For this to work, however, I need to have the event service send a message to the Device. IOKit has the service and connection objects that I can use just like an app would (just like the app the driver communication example). But DriverKit complains whenever I try to add the IOKit framework, saying that it is not supported. Is there another way that I can send a message directly from one driver to another?
One Driver talking to another Driver.
I wanted to do this for my driver, that when multiple devices are plugged, the second USB driver instance changes its behaviour.
Consider, that each driver runs in its own (kernel) process, talking to the app via its own (kernel) UserClient. The answer is right there = its not possible, because the address space is isolated as each driver runs in a sperate process (observe with ps). The only way I found, is to do this Driver1->UserClient1->App->UserClient2->Driver2.
The app watches the plug/unplug in any case, and I created a special call that on the Device#2 plug = calls into driver2 and activates the feature.
my 10 cents... PS: if this is a use-case then the app should handle this case (multiple devices plugged) anyways.