5 * Created on October 1, 2011, 11:29 PM
15 #include <libusb-1.0/libusb.h>
16 #include "stlink-common.h"
21 #define SG_TIMEOUT_SEC 1 // actually 1 is about 2 sec
22 // Each CDB can be a total of 6, 10, 12, or 16 bytes, later version
23 // of the SCSI standard also allow for variable-length CDBs (min. CDB is 6).
24 // the stlink needs max. 10 bytes.
32 // Query data flow direction.
36 // The SCSI Request Sense command is used to obtain sense data
37 // (error information) from a target device.
38 // http://en.wikipedia.org/wiki/SCSI_Request_Sense_Command
39 #define SENSE_BUF_LEN 32
43 #if defined(CONFIG_USE_LIBUSB)
48 unsigned char cdb_cmd_blk[CDB_SL];
50 int q_data_dir; // Q_DATA_IN, Q_DATA_OUT
51 // the start of the query data in the device memory space
54 // Sense (error information) data
55 unsigned char sense_buf[SENSE_BUF_LEN];
67 struct stlink_libsg {};
70 stlink_t* stlink_quirk_open(const char *dev_name, const int verbose);
76 #endif /* STLINK_SG_H */