Merge branch 'master' of github.com:UweBonnes/stlink
[fw/stlink] / src / stlink-sg.h
index c9776cddb76701202860c2a5b8bb59b0fc77dcdb..beecac324e63b9408f1353789c70dedbacb17bb3 100644 (file)
 extern "C" {
 #endif
     
-#include <libusb-1.0/libusb.h>
+#include <libusb.h>
 #include "stlink-common.h"
     
         // device access
 #define RDWR           0
 #define RO             1
 #define SG_TIMEOUT_SEC 1 // actually 1 is about 2 sec
+#define SG_TIMEOUT_MSEC        3 * 1000
     // Each CDB can be a total of 6, 10, 12, or 16 bytes, later version
     // of the SCSI standard also allow for variable-length CDBs (min. CDB is 6).
     // the stlink needs max. 10 bytes.
@@ -42,7 +43,9 @@ extern "C" {
 
     struct stlink_libsg {
         libusb_context* libusb_ctx;
-        libusb_device_handle *handle;
+        libusb_device_handle *usb_handle;
+        unsigned ep_rep;
+        unsigned ep_req;
         
         int sg_fd;
         int do_scsi_pt_err;
@@ -54,12 +57,13 @@ extern "C" {
         uint32_t q_addr;
 
         // Sense (error information) data
+        // obsolete, this was fed to the scsi tools
         unsigned char sense_buf[SENSE_BUF_LEN];
 
         reg reg;
     };
 
-    stlink_t* stlink_v1_open(const char *dev_name, const int verbose);
+    stlink_t* stlink_v1_open(const int verbose);
 
 #ifdef __cplusplus
 }