On Fri, Feb 22, 2008 at 05:30:22PM -0800, Chetan Karia wrote: > On 22/02/2008, Greg KH <[EMAIL PROTECTED]> wrote: > > On Wed, Feb 20, 2008 at 10:35:48AM -0800, Chetan Karia wrote: > > > Hello, > > > > > > I am kernel newbie and I have a question about usb serial driver. I > > > have a usb to serial driver which exposes 3 virtual serial ports > > > ttyUSB0, ttyUSB1 and ttyUSB2. The endpoint to virtual serial port > > > mapping is like this > > > ep0 ==> ttyUSB0 > > > ep1 ==> ttyUSB1 > > > ep2 ==> ttyUSB2. > > > > > > Which device is this? I think you are talking about the endpoint > > "pairs" one IN and one OUT per tty, right? > > > Yes I am talking about endpoint per one IN and one OUT per tty.
But what physical device is this? > > > All I want to do is create another virtual serial port ttyUSB3 (easy) > > > and setup its endpoint address (bulk in and bulk out) to same as > > > ttyUSB1 that is ep1. I do this in attach function of the driver and I > > > want to know will there be any race condition if ttyUSB1 and ttyUSB3 > > > are used simultaneously? Is there any way to overcome that race > > > condition or its simply not correct way to go. > > > > > > Does the device really support another serial endpoint? You can't just > > make a new one if the hardware can't handle it. > > > My intention was not to create new endpoint but two tty's (virtual > serial ports) that talk to a single pair of IN and OUT endpoint. > (ep1) Again, why not just do this from userspace by writing to the same port? > > > My sole intention for doing that is ttyUSB1 and ttyUSB3 should be able > > > to read/write from/to same endpoint (ep1) concurrently. Is that > > > possible? > > > > > > Hm, why? Some devices might get very confused, depending on the > > protocol used by the device. It all depends on the hardware. > > > > What's wrong with just having 2 programs write to the same tty node at > > the same time? > > > I was under the impression that 2 user-level programs can't read/write > to single tty node concurrently. Am I wrong? I need both read and > write capability. You can easily write to a single port from 2 programs. But note, your device might get confused, depending on the format of the data it is expecting to receive. thanks, greg k-h - To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
