Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45399
b: refs/heads/master
c: b6e557f
h: refs/heads/master
i:
  45397: 3861698
  45395: 1a88e30
  45391: 4073421
v: v3
  • Loading branch information
Marcel Holtmann authored and David S. Miller committed Jan 9, 2007
1 parent 2ec58fb commit 1c45fad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4777569204cb59f2f04fbe9ef4e9a6918209104
refs/heads/master: b6e557fbf1dbba8cfa667a25503e5dbd0e9330b7
22 changes: 15 additions & 7 deletions trunk/net/bluetooth/rfcomm/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,13 @@ static int rfcomm_tty_write_room(struct tty_struct *tty)

BT_DBG("tty %p", tty);

if (!dev || !dev->dlc)
return 0;

room = rfcomm_room(dev->dlc) - atomic_read(&dev->wmem_alloc);
if (room < 0)
room = 0;

return room;
}

Expand Down Expand Up @@ -915,24 +919,27 @@ static void rfcomm_tty_unthrottle(struct tty_struct *tty)
static int rfcomm_tty_chars_in_buffer(struct tty_struct *tty)
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
struct rfcomm_dlc *dlc = dev->dlc;

BT_DBG("tty %p dev %p", tty, dev);

if (!skb_queue_empty(&dlc->tx_queue))
return dlc->mtu;
if (!dev || !dev->dlc)
return 0;

if (!skb_queue_empty(&dev->dlc->tx_queue))
return dev->dlc->mtu;

return 0;
}

static void rfcomm_tty_flush_buffer(struct tty_struct *tty)
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
if (!dev)
return;

BT_DBG("tty %p dev %p", tty, dev);

if (!dev || !dev->dlc)
return;

skb_queue_purge(&dev->dlc->tx_queue);

if (test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags) && tty->ldisc.write_wakeup)
Expand All @@ -952,11 +959,12 @@ static void rfcomm_tty_wait_until_sent(struct tty_struct *tty, int timeout)
static void rfcomm_tty_hangup(struct tty_struct *tty)
{
struct rfcomm_dev *dev = (struct rfcomm_dev *) tty->driver_data;
if (!dev)
return;

BT_DBG("tty %p dev %p", tty, dev);

if (!dev)
return;

rfcomm_tty_flush_buffer(tty);

if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
Expand Down

0 comments on commit 1c45fad

Please sign in to comment.