|
@@ -1232,9 +1232,12 @@ static int mos7840_chars_in_buffer(struct tty_struct *tty)
|
|
|
return 0;
|
|
|
|
|
|
spin_lock_irqsave(&mos7840_port->pool_lock, flags);
|
|
|
- for (i = 0; i < NUM_URBS; ++i)
|
|
|
- if (mos7840_port->busy[i])
|
|
|
- chars += URB_TRANSFER_BUFFER_SIZE;
|
|
|
+ for (i = 0; i < NUM_URBS; ++i) {
|
|
|
+ if (mos7840_port->busy[i]) {
|
|
|
+ struct urb *urb = mos7840_port->write_urb_pool[i];
|
|
|
+ chars += urb->transfer_buffer_length;
|
|
|
+ }
|
|
|
+ }
|
|
|
spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
|
|
|
dbg("%s - returns %d", __func__, chars);
|
|
|
return chars;
|