Hello, I have DriverKit SCSI driver (PCI through Thunderbolt). And there is some logic and command which should be send to device in UserAbortTaskRequest method. But I cannot find out a way UserAbortTaskRequest to be called by system, so cannot debug the code inside.
- In which cases IOUserSCSIParallelInterfaceController/DriverKit framework calls UserAbortTaskRequest ?
- Is there a way to imitate situation (in driver or in some external tool), so that UserAbortTaskRequest be called to debug such case?
Hello, I have DriverKit SCSI driver (PCI through Thunderbolt). And there is some logic and command which should be send to device in UserAbortTaskRequest method. But I cannot find out a way UserAbortTaskRequest to be called by system, so cannot debug the code inside.
First off, please file a bug on this and then send me the bug number once it's filed. As far as I can tell, the 6 SCSI Task Management Functions:
- UserAbortTaskRequest()
- UserAbortTaskSetRequest()
- UserClearACARequest()
- UserClearTaskSetRequest()
- UserLogicalUnitResetRequest()
- UserTargetResetRequest()
...are not currently implemented by SCSIControllerDriverKit and never have been. I haven't confirmed the full details of why that choice was made, but from the larger kernel context I suspect it's because they're basically unused by the system and always have been. For standard I/O request there isn't any cancellation options, so all requests are either completed by the controlling driver (note that this includes errors) or fail "externally" as part of things like driver teardown.
Historically, these methods might have been by things that directly issued SCSI commands like the SCSITaskUserClient's AbortTask(). However, looking at our code, that was actually implemented by calling AbortCommand, which has since been deprecated and is no longer functional. This appears to have been overlooked because, as far as I can, nothing in the system ever actually called SCSITaskUserClient AbortTask.
In other words, while the kernel does "implement" these functions, none of them are actually used for anything. Bugs were filed about removing these functions (r.64130212&63913004), but that removal did not occur. As mentioned above, please file a bug on this and post the bug number back here. At this point I'm not sure removal is possible (due to binary compatibility issues) but we should at least document that they are not functional.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware