Hi all,

in my driver for our usb-serial converter I want to pass the received data back.
But after every
tty_insert_flip_char(tty, data[i], 0);
call, my write method is called with data[i] or something else (0x5E, 0x40, 0x41 
mostly).

What could be the reason for this?
Who calls my write method?
Is there a tty or anything-else-layer between the usb_serial driver and the
application which communicates with /dev/ttyUSBx?

(The app doesn't receive the data)

Best regards,

        Thomas




static void my_read_int_callback( struct urb *purb )
{
   struct usb_serial_port *port = (struct usb_serial_port *) purb->context;
   struct tty_struct *tty;
   unsigned char *data = purb->transfer_buffer;

   /* the urb might have been killed. */
   if (purb->status) {
     dbg(__FUNCTION__ " - read int status not zero: %d", purb->status);
     return;
   }

   tty = port->tty;
   if (purb->actual_length) {
     for (i = 0; i < purb->actual_length; ++i) {
       if(tty->flip.count >= TTY_FLIPBUF_SIZE) {
        tty_flip_buffer_push(tty);
       }
       tty_insert_flip_char(tty, data[i], 0);
     }
     tty_flip_buffer_push(tty);
   }
}




-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to