Feature #9821

want a way to run vendor-specific commands via libscsi

Added by Robert Mustacchi almost 2 years ago. Updated over 1 year ago.

lib - userland libraries
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


When trying to create an action in libscsi, which is effectively a command to run, it needs to know how to determine the size of that command. One of the challenges with this is that if libscsi doesn't know the command, which is often common of vendor specific commands, then it will fail. We need to add a new interface to allow someone to specify the size of the cdb.

This is further complicated by the uscsi engine in libscsi, which needs to know how to determine the cdb size. Today it does that by trying to determine that from the command. However, that has no relation to the actual allocated size. If a user changes the first byte in the cdb, this could lead to us potentially giving a larger or smaller size in that command. While it might be more accurate for uscsi to try and determine it, it wouldn't be more correct necessarily. Really, the expected contract is that the command shouldn't change once it's been allocated.

I tested this with a custom program that leverages the new library. I also tested some existing consumers ala fwflash to make sure that they're not impacted.



Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed

git commit b75e7d76519aa3dc2e72aa357a039a6b65372a1c

commit  b75e7d76519aa3dc2e72aa357a039a6b65372a1c
Author: Robert Mustacchi <>
Date:   2019-01-10T18:26:29.000Z

    9821 want a way to run vendor-specific commands via libscsi
    Reviewed by: Bryan Cantrill <>
    Reviewed by: Jerry Jelinek <>
    Reviewed by: Garrett D'Amore <>
    Approved by: Richard Lowe <>

Also available in: Atom PDF