Mailing List Archive

pl2303_ttyUSB0 userspace application not able to control RTS line
Hi,
I am using a prolific tech USB-to-serial converter on linux kernel version 2.6.35.
I wrote a userspace program to enable/disable RTS line which is working fine with
standard serial port like ttyS0 and ttyS1.

But when I used the USB-to-serial port (ttyUSB0) to enable/disable the RTS line,ttyUSB0
is not able to do that as well as some times gives

pl2303_ttyUSB0 : pl2303_open-failed submitting read urb -error 22.

Attached is the userspace application and kernel log is also given below,

/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_open - port 0
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x40:0x1:0x8:0x0 0
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x40:0x1:0x9:0x0 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - port 0
/home/teleset/Desktop/USB-Serial/pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - data bits = 8
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - baud = 9600
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - stop bits = 1
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - parity = none
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x21:0x20:0:0 7
/home/teleset/Desktop/USB-Serial/pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x40:0x1:0x0:0x0 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_open - submitting read urb
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_open - submitting interrupt urb
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl (0) cmd = 0x5401
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl not supported = 0x5401
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl (0) cmd = 0x540b
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl not supported = 0x540b
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl (0) cmd = 0x5402
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl not supported = 0x5402
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - port 0
/home/teleset/Desktop/USB-Serial/pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - data bits = 8
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - baud = 9600
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - stop bits = 1
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - parity = none
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x21:0x20:0:0 7
/home/teleset/Desktop/USB-Serial/pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x40:0x1:0x0:0x61 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl (0) cmd = 0x5401
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl not supported = 0x5401
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_tiocmget (0)
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_tiocmget - result = 6
/home/teleset/Desktop/USB-Serial/pl2303.c: set_control_lines - value = 3, retval = 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_tiocmget (0)
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_tiocmget - result = 6
/home/teleset/Desktop/USB-Serial/pl2303.c: set_control_lines - value = 1, retval = 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl (0) cmd = 0x5402
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl not supported = 0x5402
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - port 0
/home/teleset/Desktop/USB-Serial/pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - data bits = 8
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - baud = 9600
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - stop bits = 1
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_set_termios - parity = none
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x21:0x20:0:0 7
/home/teleset/Desktop/USB-Serial/pl2303.c: set_control_lines - value = 3, retval = 0
/home/teleset/Desktop/USB-Serial/pl2303.c: 0xa1:0x21:0:0 7 - 80 25 0 0 0 0 8
/home/teleset/Desktop/USB-Serial/pl2303.c: 0x40:0x1:0x0:0x0 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl (0) cmd = 0x5401
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_ioctl not supported = 0x5401
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_close - port 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_close - shutting down urbs
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_read_bulk_callback - port 0
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_read_bulk_callback - urb status = -2
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_read_bulk_callback - port is closed,
exiting.
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_read_int_callback (0)
/home/teleset/Desktop/USB-Serial/pl2303.c: pl2303_read_int_callback - urb shutting do

Thanks-
Raj
Re: pl2303_ttyUSB0 userspace application not able to control RTS line [ In reply to ]
On Tue, Oct 05, 2010 at 04:33:16PM +0530, Raju Rameshwar Uprade wrote:
> Hi,
> I am using a prolific tech USB-to-serial converter on linux kernel version 2.6.35.
> I wrote a userspace program to enable/disable RTS line which is working fine with
> standard serial port like ttyS0 and ttyS1.
>
> But when I used the USB-to-serial port (ttyUSB0) to enable/disable the RTS line,ttyUSB0
> is not able to do that as well as some times gives
>
> pl2303_ttyUSB0 : pl2303_open-failed submitting read urb -error 22.

Is this your "modified" driver?

I don't see that error in the kernel log below at all.

What kernel version is this?

And are you sure that your device actually has the RTS lines connected?
I have seen a number of these devices that do not bring those lines from
the chip to the rs232 connection.

You really might want to go purchase a "real" usb to serial converter
that works properly, the pl2303 devices do not fit that category.

good luck,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: pl2303_ttyUSB0 userspace application not able to control RTS line [ In reply to ]
> Is this your "modified" driver?

No..It's pl2303.

>
> I don't see that error in the kernel log below at all.

sometimes I got that error.

> What kernel version is this?

2.6.35

> And are you sure that your device actually has the RTS lines connected?
> I have seen a number of these devices that do not bring those lines from
> the chip to the rs232 connection.

I have connected a RS-485 interface card to this usb-to-serial converter which has
MAX-485 IC ( Line driver chip which convert RS-232 to RS-485),of which pin number 2 is
for RTS line.

Through my modified pl2303 device driver, I am able to enable/disable the RTS line as
per my need,as I told in my earlier email.

> You really might want to go purchase a "real" usb to serial converter
> that works properly, the pl2303 devices do not fit that category.

Yes, I am also thinking of purchasing a "real" usb to serial converter.

Thanks a lot Greg, I have learned a lot interacting with you.


Thanks-
Raj
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: pl2303_ttyUSB0 userspace application not able to control RTS line [ In reply to ]
On Tue, Oct 5, 2010 at 11:14 PM, Raju Rameshwar Uprade
<rajsingh@ncra.tifr.res.in> wrote:
>
>> Is this your "modified" driver?
>
>  No..It's pl2303.
>
>>
>> I don't see that error in the kernel log below at all.
>
>  sometimes I got that error.
>
>> What kernel version is this?
>
>  2.6.35
>
>> And are you sure that your device actually has the RTS lines connected?
>> I have seen a number of these devices that do not bring those lines from
>> the chip to the rs232 connection.
>
> I have connected a RS-485 interface card to this usb-to-serial converter which has
> MAX-485 IC ( Line driver chip which convert RS-232 to RS-485),of which pin number 2 is
> for RTS line.
>
> Through my modified pl2303 device driver, I am able to enable/disable the RTS line as
> per my need,as I told in my earlier email.
>
>> You really might want to go purchase a "real" usb to serial converter
>> that works properly, the pl2303 devices do not fit that category.
>
> Yes, I am also thinking of purchasing a "real" usb to serial converter.
>
> Thanks a lot Greg, I have learned a lot interacting with you.

You know - I have had the (mis)forune of working with some of your
people - straight out of college.. While I was impressed with their
capacities, I was duly unimpressed with their inability to shut the
fuck up when appropriate. If they knew that a typo on the command
line was more easily correctable after the fact (since of course set
-o vi ) was in place.. then they may (I DOUBT IT) shut the fuck
up.... Anyhow - just a pissed off observation...

Teach them to STFU when noone asked them shit to begin with.... Or -
put a dick (my dick) in their mouths....
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: pl2303_ttyUSB0 userspace application not able to control RTS line [ In reply to ]
What kind of email is this....

and who are you Greg oliver, I haven't wrote email to you.

I am interacting with Greg KH and rest of kernel mailing list.

Mind your own business and language.


> You know - I have had the (mis)forune of working with some of your
> people - straight out of college.. While I was impressed with their
> capacities, I was duly unimpressed with their inability to shut the
> fuck up when appropriate. If they knew that a typo on the command
> line was more easily correctable after the fact (since of course set
> -o vi ) was in place.. then they may (I DOUBT IT) shut the fuck
> up.... Anyhow - just a pissed off observation...
>
> Teach them to STFU when noone asked them shit to begin with.... Or -
> put a dick (my dick) in their mouths....



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/