libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v0.16-13-g8af5bbc

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 3 Nov 2009 17:28:22 +0100 (CET)
The branch, master has been updated
       via  8af5bbc7a631bd63e9f3c3d0f702c1cfe6a27196 (commit)
      from  ffca16f073d62159369124c136142c1c7cec1193 (commit)


- Log -----------------------------------------------------------------
commit 8af5bbc7a631bd63e9f3c3d0f702c1cfe6a27196
Author: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date:   Thu Jul 23 16:25:27 2009 +0200

    Call usb_set_configuration() on Windows only
    
    Hello,
    
    working with interface 0 of the FT2232(H) on Linux, I get zillions of
    kernel-log messages like:
    
    kernel: usb 6-3: usbfs: interface 1 claimed by ftdi_sio while 'a.out' sets 
config #1
    
    I understand as follows:
    ftdi_usb_open_dev()
    first detaches the driver for interface 0
    Now  usb_set_configuration() is called, but interface 1 is still attached to
    the kernel driver. This results in above kernel log.
    
    Do we really need to set the configuaration? Does any device have a
    alternative configuration at all?
    
    I propose appended patch, tested on Linux with and without ftdi_sio.ko
    loaded. No other change seen, beside no more kernel log messages like above.
    
    Bye
    
    --
    Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
    --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
    >From fcb2609f0dae14c5616c34242177959cf226a5f2 Mon Sep 17 00:00:00 2001
    From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
    Date: Thu, 23 Jul 2009 16:21:08 +0200
    Subject: usb_set_configuration() not needed on Linux

-----------------------------------------------------------------------

Summary of changes:
 src/ftdi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 5fce9a6..9f12c41 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -415,6 +415,7 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct 
usb_device *dev)
         detach_errno = errno;
 #endif
 
+#ifdef __WIN32__
     // set configuration (needed especially for windows)
     // tolerate EBUSY: one device with one configuration, but two interfaces
     //    and libftdi sessions to both interfaces (e.g. FT2232)
@@ -432,6 +433,7 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct 
usb_device *dev)
             ftdi_error_return(-3, "unable to set usb configuration. Make sure 
ftdi_sio is unloaded!");
         }
     }
+#endif
 
     if (usb_claim_interface(ftdi->usb_dev, ftdi->interface) != 0)
     {


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v0.16-13-g8af5bbc, libftdi-git <=