diff options
-rw-r--r-- | include/net/irda/ircomm_tty.h | 3 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 21 | ||||
-rw-r--r-- | net/irda/ircomm/ircomm_tty_attach.c | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h index 59ba38bc400f..365fa6ec5298 100644 --- a/include/net/irda/ircomm_tty.h +++ b/include/net/irda/ircomm_tty.h | |||
@@ -62,6 +62,7 @@ | |||
62 | */ | 62 | */ |
63 | struct ircomm_tty_cb { | 63 | struct ircomm_tty_cb { |
64 | irda_queue_t queue; /* Must be first */ | 64 | irda_queue_t queue; /* Must be first */ |
65 | struct tty_port port; | ||
65 | magic_t magic; | 66 | magic_t magic; |
66 | 67 | ||
67 | int state; /* Connect state */ | 68 | int state; /* Connect state */ |
@@ -97,8 +98,6 @@ struct ircomm_tty_cb { | |||
97 | void *skey; | 98 | void *skey; |
98 | void *ckey; | 99 | void *ckey; |
99 | 100 | ||
100 | wait_queue_head_t open_wait; | ||
101 | wait_queue_head_t close_wait; | ||
102 | struct timer_list watchdog_timer; | 101 | struct timer_list watchdog_timer; |
103 | struct work_struct tqueue; | 102 | struct work_struct tqueue; |
104 | 103 | ||
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 6b9d5a0e42f9..8eeaa8b7f4a6 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
@@ -278,7 +278,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
278 | */ | 278 | */ |
279 | 279 | ||
280 | retval = 0; | 280 | retval = 0; |
281 | add_wait_queue(&self->open_wait, &wait); | 281 | add_wait_queue(&self->port.open_wait, &wait); |
282 | 282 | ||
283 | IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n", | 283 | IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n", |
284 | __FILE__,__LINE__, tty->driver->name, self->open_count ); | 284 | __FILE__,__LINE__, tty->driver->name, self->open_count ); |
@@ -336,7 +336,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
336 | } | 336 | } |
337 | 337 | ||
338 | __set_current_state(TASK_RUNNING); | 338 | __set_current_state(TASK_RUNNING); |
339 | remove_wait_queue(&self->open_wait, &wait); | 339 | remove_wait_queue(&self->port.open_wait, &wait); |
340 | 340 | ||
341 | if (extra_count) { | 341 | if (extra_count) { |
342 | /* ++ is not atomic, so this should be protected - Jean II */ | 342 | /* ++ is not atomic, so this should be protected - Jean II */ |
@@ -381,6 +381,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
381 | return -ENOMEM; | 381 | return -ENOMEM; |
382 | } | 382 | } |
383 | 383 | ||
384 | tty_port_init(&self->port); | ||
384 | self->magic = IRCOMM_TTY_MAGIC; | 385 | self->magic = IRCOMM_TTY_MAGIC; |
385 | self->flow = FLOW_STOP; | 386 | self->flow = FLOW_STOP; |
386 | 387 | ||
@@ -393,8 +394,6 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
393 | 394 | ||
394 | /* Init some important stuff */ | 395 | /* Init some important stuff */ |
395 | init_timer(&self->watchdog_timer); | 396 | init_timer(&self->watchdog_timer); |
396 | init_waitqueue_head(&self->open_wait); | ||
397 | init_waitqueue_head(&self->close_wait); | ||
398 | spin_lock_init(&self->spinlock); | 397 | spin_lock_init(&self->spinlock); |
399 | 398 | ||
400 | /* | 399 | /* |
@@ -408,6 +407,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
408 | tty->termios->c_oflag = 0; | 407 | tty->termios->c_oflag = 0; |
409 | 408 | ||
410 | /* Insert into hash */ | 409 | /* Insert into hash */ |
410 | /* FIXME there is a window from find to here */ | ||
411 | hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL); | 411 | hashbin_insert(ircomm_tty, (irda_queue_t *) self, line, NULL); |
412 | } | 412 | } |
413 | /* ++ is not atomic, so this should be protected - Jean II */ | 413 | /* ++ is not atomic, so this should be protected - Jean II */ |
@@ -438,7 +438,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
438 | * probably better sleep uninterruptible? | 438 | * probably better sleep uninterruptible? |
439 | */ | 439 | */ |
440 | 440 | ||
441 | if (wait_event_interruptible(self->close_wait, !test_bit(ASYNC_B_CLOSING, &self->flags))) { | 441 | if (wait_event_interruptible(self->port.close_wait, |
442 | !test_bit(ASYNC_B_CLOSING, &self->flags))) { | ||
442 | IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n", | 443 | IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n", |
443 | __func__); | 444 | __func__); |
444 | return -ERESTARTSYS; | 445 | return -ERESTARTSYS; |
@@ -559,11 +560,11 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) | |||
559 | if (self->blocked_open) { | 560 | if (self->blocked_open) { |
560 | if (self->close_delay) | 561 | if (self->close_delay) |
561 | schedule_timeout_interruptible(self->close_delay); | 562 | schedule_timeout_interruptible(self->close_delay); |
562 | wake_up_interruptible(&self->open_wait); | 563 | wake_up_interruptible(&self->port.open_wait); |
563 | } | 564 | } |
564 | 565 | ||
565 | self->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); | 566 | self->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); |
566 | wake_up_interruptible(&self->close_wait); | 567 | wake_up_interruptible(&self->port.close_wait); |
567 | } | 568 | } |
568 | 569 | ||
569 | /* | 570 | /* |
@@ -1011,7 +1012,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty) | |||
1011 | self->open_count = 0; | 1012 | self->open_count = 0; |
1012 | spin_unlock_irqrestore(&self->spinlock, flags); | 1013 | spin_unlock_irqrestore(&self->spinlock, flags); |
1013 | 1014 | ||
1014 | wake_up_interruptible(&self->open_wait); | 1015 | wake_up_interruptible(&self->port.open_wait); |
1015 | } | 1016 | } |
1016 | 1017 | ||
1017 | /* | 1018 | /* |
@@ -1084,7 +1085,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self) | |||
1084 | (status & IRCOMM_CD) ? "on" : "off"); | 1085 | (status & IRCOMM_CD) ? "on" : "off"); |
1085 | 1086 | ||
1086 | if (status & IRCOMM_CD) { | 1087 | if (status & IRCOMM_CD) { |
1087 | wake_up_interruptible(&self->open_wait); | 1088 | wake_up_interruptible(&self->port.open_wait); |
1088 | } else { | 1089 | } else { |
1089 | IRDA_DEBUG(2, | 1090 | IRDA_DEBUG(2, |
1090 | "%s(), Doing serial hangup..\n", __func__ ); | 1091 | "%s(), Doing serial hangup..\n", __func__ ); |
@@ -1103,7 +1104,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self) | |||
1103 | tty->hw_stopped = 0; | 1104 | tty->hw_stopped = 0; |
1104 | 1105 | ||
1105 | /* Wake up processes blocked on open */ | 1106 | /* Wake up processes blocked on open */ |
1106 | wake_up_interruptible(&self->open_wait); | 1107 | wake_up_interruptible(&self->port.open_wait); |
1107 | 1108 | ||
1108 | schedule_work(&self->tqueue); | 1109 | schedule_work(&self->tqueue); |
1109 | return; | 1110 | return; |
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c index b65d66e0d817..bb1e9356bb18 100644 --- a/net/irda/ircomm/ircomm_tty_attach.c +++ b/net/irda/ircomm/ircomm_tty_attach.c | |||
@@ -575,7 +575,7 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self) | |||
575 | self->tty->hw_stopped = 0; | 575 | self->tty->hw_stopped = 0; |
576 | 576 | ||
577 | /* Wake up processes blocked on open */ | 577 | /* Wake up processes blocked on open */ |
578 | wake_up_interruptible(&self->open_wait); | 578 | wake_up_interruptible(&self->port.open_wait); |
579 | } | 579 | } |
580 | 580 | ||
581 | schedule_work(&self->tqueue); | 581 | schedule_work(&self->tqueue); |