Hello Greg , Thanks a lot for your comments on the queries . I have a few more -
1 . How should we handle this case . The URB submitted on BULK OUT returns status in the write_bulk_callback other than 0 , -ECONNRESET,-ENOENT,-ESHUTDOWN We should resubmit thats correct but why should the transfer_buffer length be changed //From pl2303.c /* error in the urb, so we have to resubmit it */ if (serial_paranoia_check (port->serial, __FUNCTION__)) { return; } dbg("%s - Overflow in write", __FUNCTION__); dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); port->write_urb->transfer_buffer_length = 1; port->write_urb->dev = port->serial->dev; result = usb_submit_urb (port->write_urb, GFP_ATOMIC); if (result) dev_err(&urb->dev->dev, "%s - failed resubmitting write urb, error %d\n", __FUNCTION__, result); return; 2. For a particular USB-Serial devce how do we get the baud divisor corresponding to the baud rate. ( calculation details if any with an example would be really helpful or any pointers to receive More info on the same ) 3. When close is called then in the driver I have to wait till the data is drained from the device .How do I calculate the delay to wait on assuming that there is no way I can check if the device buffers are drained in the device that I am programming . Regards, Monali. > -----Original Message----- > From: Greg KH [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 19, 2005 12:38 PM > To: Monali Vishnu Katkar (WT01 - EMBEDDED & PRODUCT > ENGINEERING SOLUTIONS) > Cc: linux-usb-devel@lists.sourceforge.net > Subject: Re: [linux-usb-devel] Regarding USB to Serial bridge driver > > > On Fri, Mar 18, 2005 at 11:24:37AM +0530, > [EMAIL PROTECTED] wrote: > > Hello, > > > > I am writing a driver for USB to Serial converter /bridge > > having 4 serial ports . > > > > I was going through the existing USB to Serial driver . I > > have a few questions related to those . I would be glad to > > receive responses to my queries . > > > > 1. "num_interrupt_in" field in the usb_serial_device_type > > structure is for the device and not for the port . > > Yes. > > > I mean if there is a device which has INTERRUPT IN and BULK > > OUT endpoints per port and has 4 such ports I would decalare > > usb_serial_device_type with the fields poplulated as follows > > .num_interrupt_in = 4, > > .num_bulk_in = 0, > > .num_bulk_out = 4, > > .num_ports = 4, > > Yes. > > > 2. what are the tx Credits for the edgeport adapter ? I > > really didnt get a feel of what it means . > > That's a device specific thing. It has to do with how the > device handles how much room the device has left in its > buffer. If your device doesn't have such a thing, don't > worry about it. > > > 3. Do I need to maintain a buffer at the driver level . What > > governs the desicion of having a buffer at the driver level. > > In many sample drivers I found a separate buffer - e.g > > pl2303.c , kobil_sct.c . > > It all depends on your device, and how fast you want the data > to go through it, and fixing some fun tty corner cases where > the usb-serial driver dropps data, but the tty layer doesn't > think it was allowed to do that. See the archives for more > details on this if you are curious. > > > I guess it should be a good since we can only transmit 64 > > bytes ( maxPacketSize of endpoint ) in an URB and the > > applications talking to serial device may send more bytes > than these . > > Not necessarily, you can always return a short write, that's > legal. It's when the above mentioned condition happens that > you can not ignore it. > > > 4. What should be the criteria used to select the size of > > the buffer . > > Whatever you think will work best. > > > 5. What is the significance of this step in "kobil_write()" > > and "kobil_read_int_callback" > > > > // someone sets the dev to 0 if the close method has been called > > port->interrupt_in_urb->dev = port->serial->dev; > > Don't really know. > > Hope this helps, > > greg k-h > ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_ide95&alloc_id396&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel