As part of getting rid of ugly sleeps in the MMCCAM code I propose to create a new function code called XPT_TIMEOUT to allow scheduling completion of CCBs. Having it in the CAM framework makes it possible to just create a CCB with func_code set to XPT_TIMEOUT and specify a timeout and a completion callback, and then the framework will take care of marking CCB as completed and calling a specified callback.
One issue with the attached patch is that it seems that the callback is called by callout framework directly, not cam_doneq thread. I need help to understand how to do this properly and if such functionality is required at all.