Move libusb_init() call to prevent crash
[libftdi] / src / ftdi.h
index 820a5c7..b43f6ec 100644 (file)
@@ -2,7 +2,7 @@
                           ftdi.h  -  description
                              -------------------
     begin                : Fri Apr 4 2003
-    copyright            : (C) 2003 by Intra2net AG
+    copyright            : (C) 2003-2011 by Intra2net AG and the libftdi developers
     email                : opensource@intra2net.com
  ***************************************************************************/
 
@@ -57,6 +57,13 @@ enum ftdi_interface
     INTERFACE_D   = 4
 };
 
+/** Automatic loading / unloading of kernel modules */
+enum ftdi_module_detach_mode
+{
+    AUTO_DETACH_SIO_MODULE = 0,
+    DONT_DETACH_SIO_MODULE = 1
+};
+
 /* Shifting commands IN MPSSE Mode*/
 #define MPSSE_WRITE_NEG 0x01   /* Write TDI/DO on negative TCK/SK edge*/
 #define MPSSE_BITMODE   0x02   /* Write bits, not bytes */
@@ -313,6 +320,9 @@ struct ftdi_context
 
     /** String representation of last error */
     char *error_str;
+
+    /** Defines behavior in case a kernel module is already attached to the device */
+    enum ftdi_module_detach_mode module_detach_mode;
 };
 
 /**