libftdi Archives

Subject: Re: libftdi vs. ftdi_sio

From: Paul Fox <pgf@xxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 19 Jan 2011 14:41:37 -0500
jim wrote:
 > Uwe Bonnes wrote:
 > > >>>>> "Paul" == Paul Fox <pgf@xxxxxxxxxxxxxxxxxxxx> writes:
 > > 
 > >     Paul> i've been out of the loop for a while, and i'm hoping this 
 > > problem
 > >     Paul> has been solved.
 > > 
 > >     Paul> i use a flash programmer that's based on the MPSSE engine of an
 > >     Paul> ft4232h -- it uses the ft2232_spi.c driver in flashrom.  i also
 > >     Paul> use USB-to-serial converters (often two at a time) that are
 > >     Paul> ftdi-based.
 > > 
 > >     Paul> if i'm using the serial converters, i can't then use the
 > >     Paul> programmer -- i get an error due to conflict with the kernel
 > >     Paul> ftdi_sio module.  in practice, i plug the programmer into one
 > >     Paul> laptop, and the serial modules into another, and ssh between 
 > > them,
 > >     Paul> but that's a fairly heavyweight workaround.
 > > 
 > >     Paul> is there a way, using API calls from either libftdi or libusb,
 > >     Paul> that i can tell the kernel driver to not take ownership of my
 > >     Paul> ftdi-based programmer?
 > > 
 > > Multiple devices without different name are doomed for failure. libftdi
 > > allows to open a device with product and/or serial string. Look at the 
 > > recent
 > > "ftdi_usb_open_dev & ftdi_set_baudrate" thread. ft2232_spi.c and flashrom
 > > need to provide a way to specify these names. Look at examples/eeprom.c or
 > > how (sourceforge/svn) xc3prog handles this.
 > > 
 > > If your flash programmer doesn't provide a product/serial string, program
 > > them with MPROG, by adapting examples/eeprom.c or with ftdi_eeprom. If the
 > > flash-programmer doesn't provide the EEPROM, use the default string,
 > > something like "Dual RS232" depending on chip type. If the other device 
 > > also
 > > has no EEPROM, you are wrecked...
 > 
 > That's a more general issue with working with multiple devices.
 > Regarding Paul's specific question about kernel module conflicts,
 > libftdi should detach the ftdi_sio kernel driver already -- look for 
 > usb_detach_kernel_driver_np in the source.  You might need to be
 > running as root for that to work properly.

i checked -- usb_detach_kernel_driver_np() is failing with errno 61 (ENODATA)
and dmesg reports
    "usbfs: process 9346 (flashrom) did not claim interface 1 before use"

(looking at the ftdi.c source, it does look like the detach is
attempted before the claim.  but i don't know if that's right or wrong.)

paul

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

=---------------------
 paul fox, pgf@xxxxxxxxxxxxxxxxxxxx (arlington, ma, where it's 31.8 degrees)

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

Current Thread