Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364250
b: refs/heads/master
c: a30737a
h: refs/heads/master
v: v3
  • Loading branch information
Peter Hurley authored and Greg Kroah-Hartman committed Mar 18, 2013
1 parent b6c3d73 commit d05bca4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 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: 21622939fc452c7fb739464b8e49368c3ceaa0ee
refs/heads/master: a30737ab7d99f27810b254787e5e62a6c92cb355
24 changes: 14 additions & 10 deletions trunk/drivers/tty/n_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ static void reset_buffer_flags(struct tty_struct *tty)
n_tty_set_room(tty);
}

static void n_tty_packet_mode_flush(struct tty_struct *tty)
{
unsigned long flags;

spin_lock_irqsave(&tty->ctrl_lock, flags);
if (tty->link->packet) {
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
wake_up_interruptible(&tty->link->read_wait);
}
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
}

/**
* n_tty_flush_buffer - clean input queue
* @tty: terminal device
Expand All @@ -237,19 +249,11 @@ static void reset_buffer_flags(struct tty_struct *tty)

static void n_tty_flush_buffer(struct tty_struct *tty)
{
unsigned long flags;
/* clear everything and unthrottle the driver */
reset_buffer_flags(tty);

if (!tty->link)
return;

spin_lock_irqsave(&tty->ctrl_lock, flags);
if (tty->link->packet) {
tty->ctrl_status |= TIOCPKT_FLUSHREAD;
wake_up_interruptible(&tty->link->read_wait);
}
spin_unlock_irqrestore(&tty->ctrl_lock, flags);
if (tty->link)
n_tty_packet_mode_flush(tty);
}

/**
Expand Down

0 comments on commit d05bca4

Please sign in to comment.