Hi! As a technician, I need often to use some form of serial port communication. My recent experience is with a program for programming TYT radios from China. They supply a simple windows app, which allows to program all the features of the radio, which cannot be accomplished using the radio keyboard only. The program works perfectly in wine, with one exception - a physical comms with the radio. It complains that it doesn't receive a response from the radio, while the radio crashes - it stops working, when a programming attempt is made, and has to be power-cycled. The radio is connected using a USB cable, which contains just a regular PL-2303 USB to serial converter, which is perfectly supported in Linux. Port assignment for wine is also done, proof of which is, that the radio crashes upon the programming request. The data volume to be programmed is small, just a few hundreds of bytes. It's really stupid that I can prepare my data in the program only, and then I need to ask my colleague with real windows to perform a programming job :-(. The program can be freely downloaded from the TYT pages: http://www.tyt888.com/WebEditor/UploadFile/201096144939483.rar but a real radio is needed to debug the comms problem. I've captured the console output with WINEDEBUG=+comm, which is attached. It contains a log of three consecutive attempts to program the radio. I'm ready to do more debugging, but I don't know, how to proceed now. With regards, Pavel.
"Pavel" == Pavel Troller patrol@sinus.cz writes:
Pavel> Hi! As a technician, I need often to use some form of serial Pavel> port communication. My recent experience is with a program for Pavel> programming TYT radios from China. They supply a simple windows Pavel> app, which allows to program all the features of the radio, which Pavel> cannot be accomplished using the radio keyboard only. The Pavel> program works perfectly in wine, with one exception - a physical Pavel> comms with the radio. It complains that it doesn't receive a Pavel> response from the radio, while the radio crashes - it stops Pavel> working, when a programming attempt is made, and has to be Pavel> power-cycled.
By programming you mean volatile programming of some parameter and not flash programming?
trace:comm:get_irq_info TIOCGICOUNT err Invalid argument
Go to dlls/ntdll/serial.c get_irq_info() and and add TRACES for the parameters to find the invalid argument.
A run with +comm,+relay can also be helpfull. Look for the messagebox with the "It complains that it doesn't receive a response from the radio" and look what call before fails. If it is the get_irq_info above, we are on the right track...
Bye
"Pavel" == Pavel Troller patrol@sinus.cz writes:
Pavel> Hi! As a technician, I need often to use some form of serial Pavel> port communication. My recent experience is with a program for ... Pavel> power-cycled. The radio is connected using a USB cable, which Pavel> contains just a regular PL-2303 USB to serial converter, which is Pavel> perfectly supported in Linux. Port assignment for wine is also
It seems that the PL2303 driver doesn't implement TIOCGICOUNT /usr/src/linux/usb/serial/pl2303.c static int pl2303_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { struct serial_struct ser; struct usb_serial_port *port = tty->driver_data; dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd);
switch (cmd) { case TIOCGSERIAL: memset(&ser, 0, sizeof ser); ser.type = PORT_16654; ser.line = port->serial->minor; ser.port = port->number; ser.baud_base = 460800;
if (copy_to_user((void __user *)arg, &ser, sizeof ser)) return -EFAULT;
return 0;
case TIOCMIWAIT: dbg("%s (%d) TIOCMIWAIT", __func__, port->number); return wait_modem_info(port, arg); default: dbg("%s not supported = 0x%04x", __func__, cmd); break; } return -ENOIOCTLCMD; } Perhaps http://www.mp3car.com/vbulletin/linux/82704-iguidance-2-1-3-wine-7.html has some hints.
Bye
On 17/12/10 11:21, Uwe Bonnes wrote:
"Pavel" == Pavel Troller patrol@sinus.cz writes:
Pavel> Hi! As a technician, I need often to use some form of serial Pavel> port communication. My recent experience is with a program for
... Pavel> power-cycled. The radio is connected using a USB cable, which Pavel> contains just a regular PL-2303 USB to serial converter, which is Pavel> perfectly supported in Linux. Port assignment for wine is also
It seems that the PL2303 driver doesn't implement TIOCGICOUNT /usr/src/linux/usb/serial/pl2303.c
Well, no, this ioctl gets handled by the tty-layer. Yes, the driver needs to define a get_icount-routine which it lacks.
Regards,
Wolfram
On Fri, Dec 17, 2010 at 6:42 AM, Wolfram Sang wolfram@the-dreams.de wrote:
On 17/12/10 11:21, Uwe Bonnes wrote:
> "Pavel" == Pavel Troller patrol@sinus.cz writes:
Pavel> Hi! As a technician, I need often to use some form of serial Pavel> port communication. My recent experience is with a program
for
... Pavel> power-cycled. The radio is connected using a USB cable, which Pavel> contains just a regular PL-2303 USB to serial converter, which
is
Pavel> perfectly supported in Linux. Port assignment for wine is
also
It seems that the PL2303 driver doesn't implement TIOCGICOUNT /usr/src/linux/usb/serial/pl2303.c
Well, no, this ioctl gets handled by the tty-layer. Yes, the driver needs to define a get_icount-routine which it lacks.
I think this is introduced in kernel 2.6.37 (not yet released)
Regards,
Wolfram
> It seems that the PL2303 driver doesn't implement TIOCGICOUNT > /usr/src/linux/usb/serial/pl2303.c Well, no, this ioctl gets handled by the tty-layer. Yes, the driver needs to define a get_icount-routine which it lacks.
I think this is introduced in kernel 2.6.37 (not yet released)
So, its commit-id would be? ;) (And I can't see anything even in linux-next...) Anyway, this driver-talk became offtopic for this list.
Regards,
Wolfram
On Fri, Dec 17, 2010 at 7:28 AM, Wolfram Sang wolfram@the-dreams.de wrote:
> It seems that the PL2303 driver doesn't implement TIOCGICOUNT > /usr/src/linux/usb/serial/pl2303.c Well, no, this ioctl gets handled by the tty-layer. Yes, the driver needs to define a get_icount-routine which it lacks.
I think this is introduced in kernel 2.6.37 (not yet released)
So, its commit-id would be? ;) (And I can't see anything even in linux-next...) Anyway, this driver-talk became offtopic for this list.
OT: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=... http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
This is kernel related :P
Regards,
Wolfram
OT: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=... http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
This is kernel related :P
Ehrm, where does that add a handler for pl2303.c?
On Fri, Dec 17, 2010 at 8:42 AM, Wolfram Sang wolfram@the-dreams.de wrote:
OT:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
This is kernel related :P
Ehrm, where does that add a handler for pl2303.c?
I just made a patch for it. Its not there in the kernel yet. I need someone to test it.
attaching the c file
On Fri, Dec 17, 2010 at 8:42 AM, Wolfram Sang wolfram@the-dreams.de wrote:
OT:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
This is kernel related :P
Ehrm, where does that add a handler for pl2303.c?
I just made a patch for it. Its not there in the kernel yet. I need someone to test it.
Hi Vijay! IT WORKS!!! It REALLY works! Sorry for yelling, but it's really working! I've used the 2.6.36 version, which Vijay sent me privately, after adding a missing semicolon it compiled cleanly and since the first attempt, the program writes the radio PERFECTLY! It's even better than on windows, because on my colleague's computer, attempt to program the radio always gives error for the first time and one must click "Retry". The second attempt is then OK. Here, it works without any glitch! So, really many thanks to Vijay and all the experts here, which found the real cause of this problem! And sorry for blaming wine, it was not its fault!
With regards, Pavel
Hi All,
Can anyone tell me how to get that into the mainline kernel ASAP. Or Anyone can send it on my behalf to lkml list to get it into main line
Thanks, Vijay
On Sat, Dec 18, 2010 at 2:20 AM, Pavel Troller patrol@sinus.cz wrote:
On Fri, Dec 17, 2010 at 8:42 AM, Wolfram Sang wolfram@the-dreams.de
wrote:
OT:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
This is kernel related :P
Ehrm, where does that add a handler for pl2303.c?
I just made a patch for it. Its not there in the kernel yet. I need someone to test it.
Hi Vijay! IT WORKS!!! It REALLY works! Sorry for yelling, but it's really working! I've used the 2.6.36 version, which Vijay sent me privately, after adding a missing semicolon it compiled cleanly and since the first attempt, the program writes the radio PERFECTLY! It's even better than on windows, because on my colleague's computer, attempt to program the radio always gives error for the first time and one must click "Retry". The second attempt is then OK. Here, it works without any glitch! So, really many thanks to Vijay and all the experts here, which found the real cause of this problem! And sorry for blaming wine, it was not its fault!
With regards, Pavel
Hi! It would be very good! I'm voting even for including the 2.6.36 version into the next .36 patch (probably .36.3). I can contact Pavel Machek, which has a lot of drivers in the kernel, but if anybody here could push it to the sources directly, it would be better.
Regards, Pavel
Hi All,
Can anyone tell me how to get that into the mainline kernel ASAP. Or Anyone can send it on my behalf to lkml list to get it into main line
Thanks, Vijay
On Sat, Dec 18, 2010 at 2:20 AM, Pavel Troller patrol@sinus.cz wrote:
On Fri, Dec 17, 2010 at 8:42 AM, Wolfram Sang wolfram@the-dreams.de
wrote:
OT:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=...
This is kernel related :P
Ehrm, where does that add a handler for pl2303.c?
I just made a patch for it. Its not there in the kernel yet. I need someone to test it.
Hi Vijay! IT WORKS!!! It REALLY works! Sorry for yelling, but it's really working! I've used the 2.6.36 version, which Vijay sent me privately, after adding a missing semicolon it compiled cleanly and since the first attempt, the program writes the radio PERFECTLY! It's even better than on windows, because on my colleague's computer, attempt to program the radio always gives error for the first time and one must click "Retry". The second attempt is then OK. Here, it works without any glitch! So, really many thanks to Vijay and all the experts here, which found the real cause of this problem! And sorry for blaming wine, it was not its fault!
With regards, Pavel
It would be very good! I'm voting even for including the 2.6.36 version into the next .36 patch (probably .36.3).
The dot releases are for backported bug-fixes only. This is a new functionality, so it won't be in 2.6.36. Same for 2.6.37, which is in the stabilization phase now, usually no new features here, too. In fact, the patch should be send to linux-usb soon, so it will be included in the merge-window for 2.6.38 (please, no discussion about this workflow on wine-devel ;))
I can contact Pavel Machek, which has a lot of drivers in the kernel, but if anybody here could push it to the sources directly, it would be better.
No need to do this. Vijay just needs to
1) read Documentation/SubmittingPatches 2) consult the MAINTAINERS file (or use scripts/get_maintainer.pl) (you can set me on CC, too) 3) send the patch 4) wait for comments 5) if not applied goto 3
No magic involved :)
Regards,
Wolfram
"Wolfram" == Wolfram Sang wolfram@the-dreams.de writes:
... Wolfram> No need to do this. Vijay just needs to
Wolfram> 1) read Documentation/SubmittingPatches 2) consult the Wolfram> MAINTAINERS file (or use scripts/get_maintainer.pl) (you can Wolfram> set me on CC, too) 3) send the patch 4) wait for comments 5) if Wolfram> not applied goto 3
Wolfram> No magic involved :)
Only patience and perstistance needed ...
And hopefully more feedback than on wine-devel ...
Hi!
"Wolfram" == Wolfram Sang wolfram@the-dreams.de writes:
... Wolfram> No need to do this. Vijay just needs to
Wolfram> 1) read Documentation/SubmittingPatches 2) consult the Wolfram> MAINTAINERS file (or use scripts/get_maintainer.pl) (you can Wolfram> set me on CC, too) 3) send the patch 4) wait for comments 5) if Wolfram> not applied goto 3 Wolfram> No magic involved :)
Only patience and perstistance needed ...
Not a problem here. Thanks to Vijay, I can keep my kernels with his individual patches until they are included in the mainstream. The only thing I'm thinking about now is, how to make this information more publicly available, to help the others to find the patches. Do you think that this mailing list is enough ?
And hopefully more feedback than on wine-devel ...
Of course...
With regards, Pavel
-- Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt --------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Vijay Kiran Kamuju infyquest@gmail.com writes:
Can anyone tell me how to get that into the mainline kernel ASAP. Or Anyone can send it on my behalf to lkml list to get it into main line
Why don't you send the patch to linux-usb@vger.kernel.org?