Reputation: 131
I am writing a custom device driver for a USB device which is quite old. The driver is written on the basis on Sample code given by Apple for IOKit. I am able to do communication to the device and I have written the IOUserClient
for application space as well.
I am having issue with retrieving data from the buffer to the IOUserClient from the Kernel space. The way this works is that I send a READ command to the device and in turn the device takes time to fill up the read buffer which is notified in the completionhandler. I am using IOCommandGate
for the communication. The read function on the IOUserClient should ideally wait for the buffer to fill up from the device but it doesn't. I tried to add a IOLock
so that IOUserClient side will wait for the buffer fill up but it waits infinitely without terminating. This might be because the commandgate only forks one thread.
Can Commandgate sleep/awake be used in this case? The Kernel panic happens when I do that. Is there another way?
I am relatively new in this area and would appreciate some direction or pointers on the same.
Upvotes: 0
Views: 47