<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><tt>Hi CLUEbies,<br>
<br>
I'm back in Colorado, yay. But I'm on the Western Slope so not sure I
can be physically present at many meetings.<br>
<br>
Hey I'm having some trouble with qcserial and setting the baud rate.
The ioctl() fails. I'm using OpenWRT Backfire and kernel version
"Linux OpenWrt 2.6.32.27 #1 Mon Mar 28 12:05:44 MDT 2011 armv5teb
GNU/Linux".<br>
<br>
The device/module chain to load this serial device driver is usbcore
-> usbserial -> usb_wwan -> option -> qcserial<br>
<br>
The kernel dmesg when those modules are loaded is:<br>
USB Serial support registered for GSM modem (1-port)<br>
usbcore: registered new interface driver option<br>
option: v0.7.2:USB Driver for GSM modems<br>
USB Serial support registered for Qualcomm USB modem<br>
qcserial 1-2:1.1: Qualcomm USB modem converter detected<br>
usb 1-2: Qualcomm USB modem converter now attached to ttyUSB0<br>
usbcore: registered new interface driver qcserial<br>
<br>
I don't get the /dev/ttyUSB0 device until AFTER the qcserial driver is
loaded. The problem is that the port is set to 9600 baud and this
can't be changed. The ioctl() doesn't work, see strace output below.
I'm trolling through the modules code to try to figure out where the
stty ioctl TCSETSW is supposed to be handled and it's quite
convoluted. Do any of you know or have any ideas?<br>
<br>
Here is the stty output:<br>
<br>
root@OpenWrt:~# stty -F /dev/ttyUSB0 -a<br>
speed 9600 baud; rows 0; columns 0; line = 0;<br>
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol =
<undef>; eol2 = <undef>; swtch = <undef>; start = ^Q;
stop = ^S; susp = ^Z;<br>
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;<br>
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts<br>
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon
-ixoff -iuclc -ixany -imaxbel -iutf8<br>
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0
vt0 ff0<br>
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop
-echoprt echoctl echoke<br>
<br>
Here's 2 attempts to change the baud rate:<br>
<br>
root@OpenWrt:~# stty -F /dev/ttyUSB0 speed 38400<br>
9600<br>
stty: /dev/ttyUSB0: unable to perform all requested operations<br>
root@OpenWrt:~# stty -F /dev/ttyUSB0 speed 38400<br>
9600<br>
stty: /dev/ttyUSB0: unable to perform all requested operations<br>
<br>
Here's the part of the strace output showing the ioctl TCSETSW returns
zero (success) but the TCGETS right after shows that the baud rate is
still B9600. Every baud rate other than 9600 fails the same way, I
tried them all. I guess I can have any baud rate I want as long as
it's 9600 baud. Unfortunately I have 10MB of data (gobi chipset files)
that I need to write to the USB serial port and it all takes a
veeerrrryy long time at 9600 baud.<br>
<br>
open("/dev/ttyUSB0", O_RDONLY|O_NONBLOCK|O_LARGEFILE) = 3<br>
dup2(3, 0) = 0<br>
close(3) = 0<br>
fcntl64(0, F_GETFL) = 0x20800 (flags
O_RDONLY|O_NONBLOCK|O_LARGEFILE)<br>
fcntl64(0, F_SETFL, O_RDONLY|O_LARGEFILE) = 0<br>
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo
...}) = 0<br>
ioctl(1, TIOCGWINSZ, {ws_row=59, ws_col=143, ws_xpixel=1001,
ws_ypixel=826}) = 0<br>
write(1, "9600\n", 59600<br>
) = 5<br>
ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B115200 opost isig icanon echo
...}) = 0<br>
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B9600 opost isig icanon echo
...}) = 0<br>
write(2, "stty", 4stty) = 4<br>
write(2, ": ", 2: ) = 2<br>
write(2, "/dev/ttyUSB0", 12/dev/ttyUSB0) = 12<br>
write(2, ": unable to perform all requeste"..., 44: unable to perform
all requested operations) = 44<br>
write(2, "\n", 1<br>
<br>
What should I do or what could I try to make my USB serial port be more
fasterer? :) Thanks for any ideas.<br>
<br>
Jim<br>
</tt></font>
<pre class="moz-signature" cols="72">--
Jim Ockers, P.Eng. (<a moz-do-not-send="true"
class="moz-txt-link-abbreviated" href="mailto:ockers@ockers.net">ockers@ockers.net</a>)
Contact info: <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.ockers.net/msi.html">http://www.ockers.net/msi.html</a>
</pre>
</body>
</html>