Hi, I have a USB device with a FT232 USB-serial converter that needs to set a non-standard baud rate of 250kbaud. I am able to open the USB device and configure it using standard baud rates, but have not been successful in configuring it for the required 250kbaud.
The driver source code is in drivers/usb/serial/ftdi_sio.c and this file includes comments indicating there are ways to set non-standard baudrates (near line 787), but none of them have worked for me. The approaches listed and the problems I have encountered are as follows: The first suggestion is to "set tty->termios->c_cflag speed to B38400 and then set your real speed in tty->alt_speed". I have not been able find a way to access to the tty structure (tty_struct) to set the "alt_speed" member variable. I found references to a TIOCTTYGSTRUCT ioctl to retrieve a pointer to the tty_struct, but the #define for this is now commented out in /usr/include/asm/ioctls.h along with a comment indicating it is for debugging only. I found a reference in the Linux kernel archives suggesting that this ioctl was to be removed. Also, I have not been able to find the header file for "tty_struct" in /usr/include/linux (the kernel source has it in a file called "tty.h"). Is there another way to set "alt_speed"? The second suggestion is to set a custom divisor in the termios structure. However, there is no integer divisor that gives me the required baud rate (even with the various different baud_base settings of HI, VHI, SHI, or WARP). The only other solutions seem cheesy: recompile the driver with the custom baud rate coded in, or perhaps change the crystal frequency in the attached device so that it scales to a standard baud rate... Any suggestions would be appreciated. If there is no elegant way to set non-standard baud rates, could one be added? thanks, Derek ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
