Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325570
b: refs/heads/master
c: a3cc9fc
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Jun 12, 2012
1 parent 47f000c commit 23152a6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 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: 718c4ca1f721be3ae67f9ff7d43b9a910e4a1ec3
refs/heads/master: a3cc9fcff84c4c8aaecda2420acd89a1418d57e9
3 changes: 1 addition & 2 deletions trunk/include/net/irda/ircomm_tty.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
*/
struct ircomm_tty_cb {
irda_queue_t queue; /* Must be first */
struct tty_port port;
magic_t magic;

int state; /* Connect state */
Expand Down Expand Up @@ -97,8 +98,6 @@ struct ircomm_tty_cb {
void *skey;
void *ckey;

wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
struct timer_list watchdog_timer;
struct work_struct tqueue;

Expand Down
21 changes: 11 additions & 10 deletions trunk/net/irda/ircomm/ircomm_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
*/

retval = 0;
add_wait_queue(&self->open_wait, &wait);
add_wait_queue(&self->port.open_wait, &wait);

IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n",
__FILE__,__LINE__, tty->driver->name, self->open_count );
Expand Down Expand Up @@ -336,7 +336,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
}

__set_current_state(TASK_RUNNING);
remove_wait_queue(&self->open_wait, &wait);
remove_wait_queue(&self->port.open_wait, &wait);

if (extra_count) {
/* ++ is not atomic, so this should be protected - Jean II */
Expand Down Expand Up @@ -381,6 +381,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
return -ENOMEM;
}

tty_port_init(&self->port);
self->magic = IRCOMM_TTY_MAGIC;
self->flow = FLOW_STOP;

Expand All @@ -393,8 +394,6 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)

/* Init some important stuff */
init_timer(&self->watchdog_timer);
init_waitqueue_head(&self->open_wait);
init_waitqueue_head(&self->close_wait);
spin_lock_init(&self->spinlock);

/*
Expand All @@ -408,6 +407,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
tty->termios->c_oflag = 0;

/* Insert into hash */
/* FIXME there is a window from find to here */
hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL);
}
/* ++ is not atomic, so this should be protected - Jean II */
Expand Down Expand Up @@ -438,7 +438,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
* probably better sleep uninterruptible?
*/

if (wait_event_interruptible(self->close_wait, !test_bit(ASYNC_B_CLOSING, &self->flags))) {
if (wait_event_interruptible(self->port.close_wait,
!test_bit(ASYNC_B_CLOSING, &self->flags))) {
IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n",
__func__);
return -ERESTARTSYS;
Expand Down Expand Up @@ -559,11 +560,11 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
if (self->blocked_open) {
if (self->close_delay)
schedule_timeout_interruptible(self->close_delay);
wake_up_interruptible(&self->open_wait);
wake_up_interruptible(&self->port.open_wait);
}

self->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
wake_up_interruptible(&self->close_wait);
wake_up_interruptible(&self->port.close_wait);
}

/*
Expand Down Expand Up @@ -1011,7 +1012,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
self->open_count = 0;
spin_unlock_irqrestore(&self->spinlock, flags);

wake_up_interruptible(&self->open_wait);
wake_up_interruptible(&self->port.open_wait);
}

/*
Expand Down Expand Up @@ -1084,7 +1085,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
(status & IRCOMM_CD) ? "on" : "off");

if (status & IRCOMM_CD) {
wake_up_interruptible(&self->open_wait);
wake_up_interruptible(&self->port.open_wait);
} else {
IRDA_DEBUG(2,
"%s(), Doing serial hangup..\n", __func__ );
Expand All @@ -1103,7 +1104,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
tty->hw_stopped = 0;

/* Wake up processes blocked on open */
wake_up_interruptible(&self->open_wait);
wake_up_interruptible(&self->port.open_wait);

schedule_work(&self->tqueue);
return;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/irda/ircomm/ircomm_tty_attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self)
self->tty->hw_stopped = 0;

/* Wake up processes blocked on open */
wake_up_interruptible(&self->open_wait);
wake_up_interruptible(&self->port.open_wait);
}

schedule_work(&self->tqueue);
Expand Down

0 comments on commit 23152a6

Please sign in to comment.