diff options
| author | Jiri Slaby <jslaby@suse.cz> | 2012-06-04 07:35:19 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-12 18:50:23 -0400 |
| commit | 849d5a997fe6a9e44401daed62a98121390ec0d3 (patch) | |
| tree | 1dad7891098bbd111e48a124f1097c9297c20cac /net/irda | |
| parent | 580d27b449cb8f540bba1cc54066bb44f4e6242d (diff) | |
TTY: ircomm, use flags from tty_port
Switch to tty_port->flags. And while at it, remove redefined flags for
them.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: netdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/irda')
| -rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 46 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_tty_attach.c | 5 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_tty_ioctl.c | 10 |
3 files changed, 31 insertions, 30 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 787578f9f312..8e61026b9dd4 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
| @@ -194,7 +194,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self) | |||
| 194 | IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); | 194 | IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); |
| 195 | 195 | ||
| 196 | /* Check if already open */ | 196 | /* Check if already open */ |
| 197 | if (test_and_set_bit(ASYNC_B_INITIALIZED, &self->flags)) { | 197 | if (test_and_set_bit(ASYNCB_INITIALIZED, &self->port.flags)) { |
| 198 | IRDA_DEBUG(2, "%s(), already open so break out!\n", __func__ ); | 198 | IRDA_DEBUG(2, "%s(), already open so break out!\n", __func__ ); |
| 199 | return 0; | 199 | return 0; |
| 200 | } | 200 | } |
| @@ -231,7 +231,7 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self) | |||
| 231 | 231 | ||
| 232 | return 0; | 232 | return 0; |
| 233 | err: | 233 | err: |
| 234 | clear_bit(ASYNC_B_INITIALIZED, &self->flags); | 234 | clear_bit(ASYNCB_INITIALIZED, &self->port.flags); |
| 235 | return ret; | 235 | return ret; |
| 236 | } | 236 | } |
| 237 | 237 | ||
| @@ -260,7 +260,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
| 260 | */ | 260 | */ |
| 261 | if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ | 261 | if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ |
| 262 | /* nonblock mode is set or port is not enabled */ | 262 | /* nonblock mode is set or port is not enabled */ |
| 263 | self->flags |= ASYNC_NORMAL_ACTIVE; | 263 | self->port.flags |= ASYNC_NORMAL_ACTIVE; |
| 264 | IRDA_DEBUG(1, "%s(), O_NONBLOCK requested!\n", __func__ ); | 264 | IRDA_DEBUG(1, "%s(), O_NONBLOCK requested!\n", __func__ ); |
| 265 | return 0; | 265 | return 0; |
| 266 | } | 266 | } |
| @@ -306,8 +306,8 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
| 306 | current->state = TASK_INTERRUPTIBLE; | 306 | current->state = TASK_INTERRUPTIBLE; |
| 307 | 307 | ||
| 308 | if (tty_hung_up_p(filp) || | 308 | if (tty_hung_up_p(filp) || |
| 309 | !test_bit(ASYNC_B_INITIALIZED, &self->flags)) { | 309 | !test_bit(ASYNCB_INITIALIZED, &self->port.flags)) { |
| 310 | retval = (self->flags & ASYNC_HUP_NOTIFY) ? | 310 | retval = (self->port.flags & ASYNC_HUP_NOTIFY) ? |
| 311 | -EAGAIN : -ERESTARTSYS; | 311 | -EAGAIN : -ERESTARTSYS; |
| 312 | break; | 312 | break; |
| 313 | } | 313 | } |
| @@ -317,7 +317,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
| 317 | * specified, we cannot return before the IrCOMM link is | 317 | * specified, we cannot return before the IrCOMM link is |
| 318 | * ready | 318 | * ready |
| 319 | */ | 319 | */ |
| 320 | if (!test_bit(ASYNC_B_CLOSING, &self->flags) && | 320 | if (!test_bit(ASYNCB_CLOSING, &self->port.flags) && |
| 321 | (do_clocal || (self->settings.dce & IRCOMM_CD)) && | 321 | (do_clocal || (self->settings.dce & IRCOMM_CD)) && |
| 322 | self->state == IRCOMM_TTY_READY) | 322 | self->state == IRCOMM_TTY_READY) |
| 323 | { | 323 | { |
| @@ -350,7 +350,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, | |||
| 350 | __FILE__, __LINE__, tty->driver->name, self->port.count); | 350 | __FILE__, __LINE__, tty->driver->name, self->port.count); |
| 351 | 351 | ||
| 352 | if (!retval) | 352 | if (!retval) |
| 353 | self->flags |= ASYNC_NORMAL_ACTIVE; | 353 | self->port.flags |= ASYNC_NORMAL_ACTIVE; |
| 354 | 354 | ||
| 355 | return retval; | 355 | return retval; |
| 356 | } | 356 | } |
| @@ -420,13 +420,13 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
| 420 | self->line, self->port.count); | 420 | self->line, self->port.count); |
| 421 | 421 | ||
| 422 | /* Not really used by us, but lets do it anyway */ | 422 | /* Not really used by us, but lets do it anyway */ |
| 423 | self->tty->low_latency = (self->flags & ASYNC_LOW_LATENCY) ? 1 : 0; | 423 | tty->low_latency = (self->port.flags & ASYNC_LOW_LATENCY) ? 1 : 0; |
| 424 | 424 | ||
| 425 | /* | 425 | /* |
| 426 | * If the port is the middle of closing, bail out now | 426 | * If the port is the middle of closing, bail out now |
| 427 | */ | 427 | */ |
| 428 | if (tty_hung_up_p(filp) || | 428 | if (tty_hung_up_p(filp) || |
| 429 | test_bit(ASYNC_B_CLOSING, &self->flags)) { | 429 | test_bit(ASYNCB_CLOSING, &self->port.flags)) { |
| 430 | 430 | ||
| 431 | /* Hm, why are we blocking on ASYNC_CLOSING if we | 431 | /* Hm, why are we blocking on ASYNC_CLOSING if we |
| 432 | * do return -EAGAIN/-ERESTARTSYS below anyway? | 432 | * do return -EAGAIN/-ERESTARTSYS below anyway? |
| @@ -437,14 +437,14 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) | |||
| 437 | */ | 437 | */ |
| 438 | 438 | ||
| 439 | if (wait_event_interruptible(self->port.close_wait, | 439 | if (wait_event_interruptible(self->port.close_wait, |
| 440 | !test_bit(ASYNC_B_CLOSING, &self->flags))) { | 440 | !test_bit(ASYNCB_CLOSING, &self->port.flags))) { |
| 441 | IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n", | 441 | IRDA_WARNING("%s - got signal while blocking on ASYNC_CLOSING!\n", |
| 442 | __func__); | 442 | __func__); |
| 443 | return -ERESTARTSYS; | 443 | return -ERESTARTSYS; |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | #ifdef SERIAL_DO_RESTART | 446 | #ifdef SERIAL_DO_RESTART |
| 447 | return (self->flags & ASYNC_HUP_NOTIFY) ? | 447 | return (self->port.flags & ASYNC_HUP_NOTIFY) ? |
| 448 | -EAGAIN : -ERESTARTSYS; | 448 | -EAGAIN : -ERESTARTSYS; |
| 449 | #else | 449 | #else |
| 450 | return -EAGAIN; | 450 | return -EAGAIN; |
| @@ -531,7 +531,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) | |||
| 531 | } | 531 | } |
| 532 | 532 | ||
| 533 | /* Hum... Should be test_and_set_bit ??? - Jean II */ | 533 | /* Hum... Should be test_and_set_bit ??? - Jean II */ |
| 534 | set_bit(ASYNC_B_CLOSING, &self->flags); | 534 | set_bit(ASYNCB_CLOSING, &self->port.flags); |
| 535 | 535 | ||
| 536 | /* We need to unlock here (we were unlocking at the end of this | 536 | /* We need to unlock here (we were unlocking at the end of this |
| 537 | * function), because tty_wait_until_sent() may schedule. | 537 | * function), because tty_wait_until_sent() may schedule. |
| @@ -561,7 +561,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) | |||
| 561 | wake_up_interruptible(&self->port.open_wait); | 561 | wake_up_interruptible(&self->port.open_wait); |
| 562 | } | 562 | } |
| 563 | 563 | ||
| 564 | self->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); | 564 | self->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); |
| 565 | wake_up_interruptible(&self->port.close_wait); | 565 | wake_up_interruptible(&self->port.close_wait); |
| 566 | } | 566 | } |
| 567 | 567 | ||
| @@ -954,7 +954,7 @@ static void ircomm_tty_shutdown(struct ircomm_tty_cb *self) | |||
| 954 | 954 | ||
| 955 | IRDA_DEBUG(0, "%s()\n", __func__ ); | 955 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
| 956 | 956 | ||
| 957 | if (!test_and_clear_bit(ASYNC_B_INITIALIZED, &self->flags)) | 957 | if (!test_and_clear_bit(ASYNCB_INITIALIZED, &self->port.flags)) |
| 958 | return; | 958 | return; |
| 959 | 959 | ||
| 960 | ircomm_tty_detach_cable(self); | 960 | ircomm_tty_detach_cable(self); |
| @@ -1005,7 +1005,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty) | |||
| 1005 | 1005 | ||
| 1006 | /* I guess we need to lock here - Jean II */ | 1006 | /* I guess we need to lock here - Jean II */ |
| 1007 | spin_lock_irqsave(&self->spinlock, flags); | 1007 | spin_lock_irqsave(&self->spinlock, flags); |
| 1008 | self->flags &= ~ASYNC_NORMAL_ACTIVE; | 1008 | self->port.flags &= ~ASYNC_NORMAL_ACTIVE; |
| 1009 | self->tty = NULL; | 1009 | self->tty = NULL; |
| 1010 | self->port.count = 0; | 1010 | self->port.count = 0; |
| 1011 | spin_unlock_irqrestore(&self->spinlock, flags); | 1011 | spin_unlock_irqrestore(&self->spinlock, flags); |
| @@ -1077,7 +1077,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self) | |||
| 1077 | if (status & IRCOMM_DCE_DELTA_ANY) { | 1077 | if (status & IRCOMM_DCE_DELTA_ANY) { |
| 1078 | /*wake_up_interruptible(&self->delta_msr_wait);*/ | 1078 | /*wake_up_interruptible(&self->delta_msr_wait);*/ |
| 1079 | } | 1079 | } |
| 1080 | if ((self->flags & ASYNC_CHECK_CD) && (status & IRCOMM_DELTA_CD)) { | 1080 | if ((self->port.flags & ASYNC_CHECK_CD) && (status & IRCOMM_DELTA_CD)) { |
| 1081 | IRDA_DEBUG(2, | 1081 | IRDA_DEBUG(2, |
| 1082 | "%s(), ircomm%d CD now %s...\n", __func__ , self->line, | 1082 | "%s(), ircomm%d CD now %s...\n", __func__ , self->line, |
| 1083 | (status & IRCOMM_CD) ? "on" : "off"); | 1083 | (status & IRCOMM_CD) ? "on" : "off"); |
| @@ -1094,7 +1094,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self) | |||
| 1094 | return; | 1094 | return; |
| 1095 | } | 1095 | } |
| 1096 | } | 1096 | } |
| 1097 | if (self->flags & ASYNC_CTS_FLOW) { | 1097 | if (self->port.flags & ASYNC_CTS_FLOW) { |
| 1098 | if (tty->hw_stopped) { | 1098 | if (tty->hw_stopped) { |
| 1099 | if (status & IRCOMM_CTS) { | 1099 | if (status & IRCOMM_CTS) { |
| 1100 | IRDA_DEBUG(2, | 1100 | IRDA_DEBUG(2, |
| @@ -1327,27 +1327,27 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m) | |||
| 1327 | 1327 | ||
| 1328 | seq_puts(m, "Flags:"); | 1328 | seq_puts(m, "Flags:"); |
| 1329 | sep = ' '; | 1329 | sep = ' '; |
| 1330 | if (self->flags & ASYNC_CTS_FLOW) { | 1330 | if (self->port.flags & ASYNC_CTS_FLOW) { |
| 1331 | seq_printf(m, "%cASYNC_CTS_FLOW", sep); | 1331 | seq_printf(m, "%cASYNC_CTS_FLOW", sep); |
| 1332 | sep = '|'; | 1332 | sep = '|'; |
| 1333 | } | 1333 | } |
| 1334 | if (self->flags & ASYNC_CHECK_CD) { | 1334 | if (self->port.flags & ASYNC_CHECK_CD) { |
| 1335 | seq_printf(m, "%cASYNC_CHECK_CD", sep); | 1335 | seq_printf(m, "%cASYNC_CHECK_CD", sep); |
| 1336 | sep = '|'; | 1336 | sep = '|'; |
| 1337 | } | 1337 | } |
| 1338 | if (self->flags & ASYNC_INITIALIZED) { | 1338 | if (self->port.flags & ASYNC_INITIALIZED) { |
| 1339 | seq_printf(m, "%cASYNC_INITIALIZED", sep); | 1339 | seq_printf(m, "%cASYNC_INITIALIZED", sep); |
| 1340 | sep = '|'; | 1340 | sep = '|'; |
| 1341 | } | 1341 | } |
| 1342 | if (self->flags & ASYNC_LOW_LATENCY) { | 1342 | if (self->port.flags & ASYNC_LOW_LATENCY) { |
| 1343 | seq_printf(m, "%cASYNC_LOW_LATENCY", sep); | 1343 | seq_printf(m, "%cASYNC_LOW_LATENCY", sep); |
| 1344 | sep = '|'; | 1344 | sep = '|'; |
| 1345 | } | 1345 | } |
| 1346 | if (self->flags & ASYNC_CLOSING) { | 1346 | if (self->port.flags & ASYNC_CLOSING) { |
| 1347 | seq_printf(m, "%cASYNC_CLOSING", sep); | 1347 | seq_printf(m, "%cASYNC_CLOSING", sep); |
| 1348 | sep = '|'; | 1348 | sep = '|'; |
| 1349 | } | 1349 | } |
| 1350 | if (self->flags & ASYNC_NORMAL_ACTIVE) { | 1350 | if (self->port.flags & ASYNC_NORMAL_ACTIVE) { |
| 1351 | seq_printf(m, "%cASYNC_NORMAL_ACTIVE", sep); | 1351 | seq_printf(m, "%cASYNC_NORMAL_ACTIVE", sep); |
| 1352 | sep = '|'; | 1352 | sep = '|'; |
| 1353 | } | 1353 | } |
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c index bb1e9356bb18..bed311af7311 100644 --- a/net/irda/ircomm/ircomm_tty_attach.c +++ b/net/irda/ircomm/ircomm_tty_attach.c | |||
| @@ -566,7 +566,8 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self) | |||
| 566 | * will have to wait for the peer device (DCE) to raise the CTS | 566 | * will have to wait for the peer device (DCE) to raise the CTS |
| 567 | * line. | 567 | * line. |
| 568 | */ | 568 | */ |
| 569 | if ((self->flags & ASYNC_CTS_FLOW) && ((self->settings.dce & IRCOMM_CTS) == 0)) { | 569 | if ((self->port.flags & ASYNC_CTS_FLOW) && |
| 570 | ((self->settings.dce & IRCOMM_CTS) == 0)) { | ||
| 570 | IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __func__ ); | 571 | IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __func__ ); |
| 571 | return; | 572 | return; |
| 572 | } else { | 573 | } else { |
| @@ -977,7 +978,7 @@ static int ircomm_tty_state_ready(struct ircomm_tty_cb *self, | |||
| 977 | ircomm_tty_next_state(self, IRCOMM_TTY_SEARCH); | 978 | ircomm_tty_next_state(self, IRCOMM_TTY_SEARCH); |
| 978 | ircomm_tty_start_watchdog_timer(self, 3*HZ); | 979 | ircomm_tty_start_watchdog_timer(self, 3*HZ); |
| 979 | 980 | ||
| 980 | if (self->flags & ASYNC_CHECK_CD) { | 981 | if (self->port.flags & ASYNC_CHECK_CD) { |
| 981 | /* Drop carrier */ | 982 | /* Drop carrier */ |
| 982 | self->settings.dce = IRCOMM_DELTA_CD; | 983 | self->settings.dce = IRCOMM_DELTA_CD; |
| 983 | ircomm_tty_check_modem_status(self); | 984 | ircomm_tty_check_modem_status(self); |
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c index a6d25e37b6b2..31b917e9c8d8 100644 --- a/net/irda/ircomm/ircomm_tty_ioctl.c +++ b/net/irda/ircomm/ircomm_tty_ioctl.c | |||
| @@ -90,19 +90,19 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self) | |||
| 90 | 90 | ||
| 91 | /* CTS flow control flag and modem status interrupts */ | 91 | /* CTS flow control flag and modem status interrupts */ |
| 92 | if (cflag & CRTSCTS) { | 92 | if (cflag & CRTSCTS) { |
| 93 | self->flags |= ASYNC_CTS_FLOW; | 93 | self->port.flags |= ASYNC_CTS_FLOW; |
| 94 | self->settings.flow_control |= IRCOMM_RTS_CTS_IN; | 94 | self->settings.flow_control |= IRCOMM_RTS_CTS_IN; |
| 95 | /* This got me. Bummer. Jean II */ | 95 | /* This got me. Bummer. Jean II */ |
| 96 | if (self->service_type == IRCOMM_3_WIRE_RAW) | 96 | if (self->service_type == IRCOMM_3_WIRE_RAW) |
| 97 | IRDA_WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__); | 97 | IRDA_WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__); |
| 98 | } else { | 98 | } else { |
| 99 | self->flags &= ~ASYNC_CTS_FLOW; | 99 | self->port.flags &= ~ASYNC_CTS_FLOW; |
| 100 | self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN; | 100 | self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN; |
| 101 | } | 101 | } |
| 102 | if (cflag & CLOCAL) | 102 | if (cflag & CLOCAL) |
| 103 | self->flags &= ~ASYNC_CHECK_CD; | 103 | self->port.flags &= ~ASYNC_CHECK_CD; |
| 104 | else | 104 | else |
| 105 | self->flags |= ASYNC_CHECK_CD; | 105 | self->port.flags |= ASYNC_CHECK_CD; |
| 106 | #if 0 | 106 | #if 0 |
| 107 | /* | 107 | /* |
| 108 | * Set up parity check flag | 108 | * Set up parity check flag |
| @@ -270,7 +270,7 @@ static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self, | |||
| 270 | 270 | ||
| 271 | memset(&info, 0, sizeof(info)); | 271 | memset(&info, 0, sizeof(info)); |
| 272 | info.line = self->line; | 272 | info.line = self->line; |
| 273 | info.flags = self->flags; | 273 | info.flags = self->port.flags; |
| 274 | info.baud_base = self->settings.data_rate; | 274 | info.baud_base = self->settings.data_rate; |
| 275 | info.close_delay = self->port.close_delay; | 275 | info.close_delay = self->port.close_delay; |
| 276 | info.closing_wait = self->port.closing_wait; | 276 | info.closing_wait = self->port.closing_wait; |
