aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-20 18:55:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-20 18:55:17 -0400
commite11c675ede0d42a405ae595528bf0b29ce1ae56f (patch)
treee0ec481e66e4a4b70289d78992b209639a582c0c /include
parent467f9957d9283be40101d7255d06fae7e211ff4c (diff)
parent7bd032dc2793afcbaf4a350056768da84cdbd89b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (79 commits) USB serial: update the console driver usb-serial: straighten out serial_open usb-serial: add missing tests and debug lines usb-serial: rename subroutines usb-serial: fix termios initialization logic usb-serial: acquire references when a new tty is installed usb-serial: change logic of serial lookups usb-serial: put subroutines in logical order usb-serial: change referencing of port and serial structures tty: Char: mxser, use THRE for ASPP_OQUEUE ioctl tty: Char: mxser, add support for CP112UL uartlite: support shared interrupt lines tty: USB: serial/mct_u232, fix tty refcnt tty: riscom8, fix tty refcnt tty: riscom8, fix shutdown declaration TTY: fix typos tty: Power: fix suspend vt regression tty: vt: use printk_once tty: handle VT specific compat ioctls in vt driver n_tty: move echoctl check and clean up logic ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/cyclades.h11
-rw-r--r--include/linux/hayesesp.h1
-rw-r--r--include/linux/kfifo.h4
-rw-r--r--include/linux/serial.h2
-rw-r--r--include/linux/serial_8250.h1
-rw-r--r--include/linux/serial_core.h93
-rw-r--r--include/linux/tty.h19
-rw-r--r--include/linux/usb/serial.h10
-rw-r--r--include/linux/vt.h32
-rw-r--r--include/linux/vt_kern.h16
10 files changed, 104 insertions, 85 deletions
diff --git a/include/linux/cyclades.h b/include/linux/cyclades.h
index 1fbdea4f08eb..a5049eaf782d 100644
--- a/include/linux/cyclades.h
+++ b/include/linux/cyclades.h
@@ -499,6 +499,7 @@ struct cyclades_card {
499 void __iomem *p9050; 499 void __iomem *p9050;
500 struct RUNTIME_9060 __iomem *p9060; 500 struct RUNTIME_9060 __iomem *p9060;
501 } ctl_addr; 501 } ctl_addr;
502 struct BOARD_CTRL __iomem *board_ctrl; /* cyz specific */
502 int irq; 503 int irq;
503 unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */ 504 unsigned int num_chips; /* 0 if card absent, -1 if Z/PCI, else Y */
504 unsigned int first_line; /* minor number of first channel on card */ 505 unsigned int first_line; /* minor number of first channel on card */
@@ -541,6 +542,15 @@ struct cyclades_port {
541 int magic; 542 int magic;
542 struct tty_port port; 543 struct tty_port port;
543 struct cyclades_card *card; 544 struct cyclades_card *card;
545 union {
546 struct {
547 void __iomem *base_addr;
548 } cyy;
549 struct {
550 struct CH_CTRL __iomem *ch_ctrl;
551 struct BUF_CTRL __iomem *buf_ctrl;
552 } cyz;
553 } u;
544 int line; 554 int line;
545 int flags; /* defined in tty.h */ 555 int flags; /* defined in tty.h */
546 int type; /* UART type */ 556 int type; /* UART type */
@@ -568,7 +578,6 @@ struct cyclades_port {
568 struct cyclades_idle_stats idle_stats; 578 struct cyclades_idle_stats idle_stats;
569 struct cyclades_icount icount; 579 struct cyclades_icount icount;
570 struct completion shutdown_wait; 580 struct completion shutdown_wait;
571 wait_queue_head_t delta_msr_wait;
572 int throttle; 581 int throttle;
573}; 582};
574 583
diff --git a/include/linux/hayesesp.h b/include/linux/hayesesp.h
index 940aeb51d53f..92b08cfe4a75 100644
--- a/include/linux/hayesesp.h
+++ b/include/linux/hayesesp.h
@@ -96,7 +96,6 @@ struct esp_struct {
96 int xmit_head; 96 int xmit_head;
97 int xmit_tail; 97 int xmit_tail;
98 int xmit_cnt; 98 int xmit_cnt;
99 wait_queue_head_t delta_msr_wait;
100 wait_queue_head_t break_wait; 99 wait_queue_head_t break_wait;
101 struct async_icount icount; /* kernel counters for the 4 input interrupts */ 100 struct async_icount icount; /* kernel counters for the 4 input interrupts */
102 struct hayes_esp_config config; /* port configuration */ 101 struct hayes_esp_config config; /* port configuration */
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index 29f62e1733ff..ad6bdf5a5970 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -38,7 +38,7 @@ extern struct kfifo *kfifo_alloc(unsigned int size, gfp_t gfp_mask,
38 spinlock_t *lock); 38 spinlock_t *lock);
39extern void kfifo_free(struct kfifo *fifo); 39extern void kfifo_free(struct kfifo *fifo);
40extern unsigned int __kfifo_put(struct kfifo *fifo, 40extern unsigned int __kfifo_put(struct kfifo *fifo,
41 unsigned char *buffer, unsigned int len); 41 const unsigned char *buffer, unsigned int len);
42extern unsigned int __kfifo_get(struct kfifo *fifo, 42extern unsigned int __kfifo_get(struct kfifo *fifo,
43 unsigned char *buffer, unsigned int len); 43 unsigned char *buffer, unsigned int len);
44 44
@@ -77,7 +77,7 @@ static inline void kfifo_reset(struct kfifo *fifo)
77 * bytes copied. 77 * bytes copied.
78 */ 78 */
79static inline unsigned int kfifo_put(struct kfifo *fifo, 79static inline unsigned int kfifo_put(struct kfifo *fifo,
80 unsigned char *buffer, unsigned int len) 80 const unsigned char *buffer, unsigned int len)
81{ 81{
82 unsigned long flags; 82 unsigned long flags;
83 unsigned int ret; 83 unsigned int ret;
diff --git a/include/linux/serial.h b/include/linux/serial.h
index e5bb75a63802..c8613c3ff9d3 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -122,6 +122,7 @@ struct serial_uart_config {
122 122
123/* Internal flags used only by kernel */ 123/* Internal flags used only by kernel */
124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */ 124#define ASYNCB_INITIALIZED 31 /* Serial port was initialized */
125#define ASYNCB_SUSPENDED 30 /* Serial port is suspended */
125#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */ 126#define ASYNCB_NORMAL_ACTIVE 29 /* Normal device is active */
126#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */ 127#define ASYNCB_BOOT_AUTOCONF 28 /* Autoconfigure port on bootup */
127#define ASYNCB_CLOSING 27 /* Serial port is closing */ 128#define ASYNCB_CLOSING 27 /* Serial port is closing */
@@ -133,6 +134,7 @@ struct serial_uart_config {
133#define ASYNCB_FIRST_KERNEL 22 134#define ASYNCB_FIRST_KERNEL 22
134 135
135#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY) 136#define ASYNC_HUP_NOTIFY (1U << ASYNCB_HUP_NOTIFY)
137#define ASYNC_SUSPENDED (1U << ASYNCB_SUSPENDED)
136#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT) 138#define ASYNC_FOURPORT (1U << ASYNCB_FOURPORT)
137#define ASYNC_SAK (1U << ASYNCB_SAK) 139#define ASYNC_SAK (1U << ASYNCB_SAK)
138#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS) 140#define ASYNC_SPLIT_TERMIOS (1U << ASYNCB_SPLIT_TERMIOS)
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index d4d2a78ad43e..fb46aba11fb5 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -22,6 +22,7 @@ struct plat_serial8250_port {
22 void __iomem *membase; /* ioremap cookie or NULL */ 22 void __iomem *membase; /* ioremap cookie or NULL */
23 resource_size_t mapbase; /* resource base */ 23 resource_size_t mapbase; /* resource base */
24 unsigned int irq; /* interrupt number */ 24 unsigned int irq; /* interrupt number */
25 unsigned long irqflags; /* request_irq flags */
25 unsigned int uartclk; /* UART clock rate */ 26 unsigned int uartclk; /* UART clock rate */
26 void *private_data; 27 void *private_data;
27 unsigned char regshift; /* register shift */ 28 unsigned char regshift; /* register shift */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 23d2fb051f97..d58e460844dd 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -20,6 +20,8 @@
20#ifndef LINUX_SERIAL_CORE_H 20#ifndef LINUX_SERIAL_CORE_H
21#define LINUX_SERIAL_CORE_H 21#define LINUX_SERIAL_CORE_H
22 22
23#include <linux/serial.h>
24
23/* 25/*
24 * The type definitions. These are from Ted Ts'o's serial.h 26 * The type definitions. These are from Ted Ts'o's serial.h
25 */ 27 */
@@ -186,7 +188,6 @@
186#include <linux/sysrq.h> 188#include <linux/sysrq.h>
187 189
188struct uart_port; 190struct uart_port;
189struct uart_info;
190struct serial_struct; 191struct serial_struct;
191struct device; 192struct device;
192 193
@@ -265,6 +266,7 @@ struct uart_port {
265 unsigned int (*serial_in)(struct uart_port *, int); 266 unsigned int (*serial_in)(struct uart_port *, int);
266 void (*serial_out)(struct uart_port *, int, int); 267 void (*serial_out)(struct uart_port *, int, int);
267 unsigned int irq; /* irq number */ 268 unsigned int irq; /* irq number */
269 unsigned long irqflags; /* irq flags */
268 unsigned int uartclk; /* base uart clock */ 270 unsigned int uartclk; /* base uart clock */
269 unsigned int fifosize; /* tx fifo size */ 271 unsigned int fifosize; /* tx fifo size */
270 unsigned char x_char; /* xon/xoff char */ 272 unsigned char x_char; /* xon/xoff char */
@@ -283,7 +285,7 @@ struct uart_port {
283 285
284 unsigned int read_status_mask; /* driver specific */ 286 unsigned int read_status_mask; /* driver specific */
285 unsigned int ignore_status_mask; /* driver specific */ 287 unsigned int ignore_status_mask; /* driver specific */
286 struct uart_info *info; /* pointer to parent info */ 288 struct uart_state *state; /* pointer to parent state */
287 struct uart_icount icount; /* statistics */ 289 struct uart_icount icount; /* statistics */
288 290
289 struct console *cons; /* struct console, if any */ 291 struct console *cons; /* struct console, if any */
@@ -335,52 +337,16 @@ struct uart_port {
335}; 337};
336 338
337/* 339/*
338 * This is the state information which is only valid when the port
339 * is open; it may be cleared the core driver once the device has
340 * been closed. Either the low level driver or the core can modify
341 * stuff here.
342 */
343typedef unsigned int __bitwise__ uif_t;
344
345struct uart_info {
346 struct tty_port port;
347 struct circ_buf xmit;
348 uif_t flags;
349
350/*
351 * Definitions for info->flags. These are _private_ to serial_core, and
352 * are specific to this structure. They may be queried by low level drivers.
353 *
354 * FIXME: use the ASY_ definitions
355 */
356#define UIF_CHECK_CD ((__force uif_t) (1 << 25))
357#define UIF_CTS_FLOW ((__force uif_t) (1 << 26))
358#define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29))
359#define UIF_INITIALIZED ((__force uif_t) (1 << 31))
360#define UIF_SUSPENDED ((__force uif_t) (1 << 30))
361
362 struct tasklet_struct tlet;
363 wait_queue_head_t delta_msr_wait;
364};
365
366/*
367 * This is the state information which is persistent across opens. 340 * This is the state information which is persistent across opens.
368 * The low level driver must not to touch any elements contained
369 * within.
370 */ 341 */
371struct uart_state { 342struct uart_state {
372 unsigned int close_delay; /* msec */ 343 struct tty_port port;
373 unsigned int closing_wait; /* msec */
374
375#define USF_CLOSING_WAIT_INF (0)
376#define USF_CLOSING_WAIT_NONE (~0U)
377 344
378 int count;
379 int pm_state; 345 int pm_state;
380 struct uart_info info; 346 struct circ_buf xmit;
381 struct uart_port *port;
382 347
383 struct mutex mutex; 348 struct tasklet_struct tlet;
349 struct uart_port *uart_port;
384}; 350};
385 351
386#define UART_XMIT_SIZE PAGE_SIZE 352#define UART_XMIT_SIZE PAGE_SIZE
@@ -461,7 +427,7 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
461 427
462static inline int uart_tx_stopped(struct uart_port *port) 428static inline int uart_tx_stopped(struct uart_port *port)
463{ 429{
464 struct tty_struct *tty = port->info->port.tty; 430 struct tty_struct *tty = port->state->port.tty;
465 if(tty->stopped || tty->hw_stopped) 431 if(tty->stopped || tty->hw_stopped)
466 return 1; 432 return 1;
467 return 0; 433 return 0;
@@ -476,7 +442,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
476#ifdef SUPPORT_SYSRQ 442#ifdef SUPPORT_SYSRQ
477 if (port->sysrq) { 443 if (port->sysrq) {
478 if (ch && time_before(jiffies, port->sysrq)) { 444 if (ch && time_before(jiffies, port->sysrq)) {
479 handle_sysrq(ch, port->info->port.tty); 445 handle_sysrq(ch, port->state->port.tty);
480 port->sysrq = 0; 446 port->sysrq = 0;
481 return 1; 447 return 1;
482 } 448 }
@@ -494,7 +460,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
494 */ 460 */
495static inline int uart_handle_break(struct uart_port *port) 461static inline int uart_handle_break(struct uart_port *port)
496{ 462{
497 struct uart_info *info = port->info; 463 struct uart_state *state = port->state;
498#ifdef SUPPORT_SYSRQ 464#ifdef SUPPORT_SYSRQ
499 if (port->cons && port->cons->index == port->line) { 465 if (port->cons && port->cons->index == port->line) {
500 if (!port->sysrq) { 466 if (!port->sysrq) {
@@ -505,7 +471,7 @@ static inline int uart_handle_break(struct uart_port *port)
505 } 471 }
506#endif 472#endif
507 if (port->flags & UPF_SAK) 473 if (port->flags & UPF_SAK)
508 do_SAK(info->port.tty); 474 do_SAK(state->port.tty);
509 return 0; 475 return 0;
510} 476}
511 477
@@ -515,22 +481,23 @@ static inline int uart_handle_break(struct uart_port *port)
515 * @status: new carrier detect status, nonzero if active 481 * @status: new carrier detect status, nonzero if active
516 */ 482 */
517static inline void 483static inline void
518uart_handle_dcd_change(struct uart_port *port, unsigned int status) 484uart_handle_dcd_change(struct uart_port *uport, unsigned int status)
519{ 485{
520 struct uart_info *info = port->info; 486 struct uart_state *state = uport->state;
487 struct tty_port *port = &state->port;
521 488
522 port->icount.dcd++; 489 uport->icount.dcd++;
523 490
524#ifdef CONFIG_HARD_PPS 491#ifdef CONFIG_HARD_PPS
525 if ((port->flags & UPF_HARDPPS_CD) && status) 492 if ((uport->flags & UPF_HARDPPS_CD) && status)
526 hardpps(); 493 hardpps();
527#endif 494#endif
528 495
529 if (info->flags & UIF_CHECK_CD) { 496 if (port->flags & ASYNC_CHECK_CD) {
530 if (status) 497 if (status)
531 wake_up_interruptible(&info->port.open_wait); 498 wake_up_interruptible(&port->open_wait);
532 else if (info->port.tty) 499 else if (port->tty)
533 tty_hangup(info->port.tty); 500 tty_hangup(port->tty);
534 } 501 }
535} 502}
536 503
@@ -540,24 +507,24 @@ uart_handle_dcd_change(struct uart_port *port, unsigned int status)
540 * @status: new clear to send status, nonzero if active 507 * @status: new clear to send status, nonzero if active
541 */ 508 */
542static inline void 509static inline void
543uart_handle_cts_change(struct uart_port *port, unsigned int status) 510uart_handle_cts_change(struct uart_port *uport, unsigned int status)
544{ 511{
545 struct uart_info *info = port->info; 512 struct tty_port *port = &uport->state->port;
546 struct tty_struct *tty = info->port.tty; 513 struct tty_struct *tty = port->tty;
547 514
548 port->icount.cts++; 515 uport->icount.cts++;
549 516
550 if (info->flags & UIF_CTS_FLOW) { 517 if (port->flags & ASYNC_CTS_FLOW) {
551 if (tty->hw_stopped) { 518 if (tty->hw_stopped) {
552 if (status) { 519 if (status) {
553 tty->hw_stopped = 0; 520 tty->hw_stopped = 0;
554 port->ops->start_tx(port); 521 uport->ops->start_tx(uport);
555 uart_write_wakeup(port); 522 uart_write_wakeup(uport);
556 } 523 }
557 } else { 524 } else {
558 if (!status) { 525 if (!status) {
559 tty->hw_stopped = 1; 526 tty->hw_stopped = 1;
560 port->ops->stop_tx(port); 527 uport->ops->stop_tx(uport);
561 } 528 }
562 } 529 }
563 } 530 }
@@ -569,7 +536,7 @@ static inline void
569uart_insert_char(struct uart_port *port, unsigned int status, 536uart_insert_char(struct uart_port *port, unsigned int status,
570 unsigned int overrun, unsigned int ch, unsigned int flag) 537 unsigned int overrun, unsigned int ch, unsigned int flag)
571{ 538{
572 struct tty_struct *tty = port->info->port.tty; 539 struct tty_struct *tty = port->state->port.tty;
573 540
574 if ((status & port->ignore_status_mask & ~overrun) == 0) 541 if ((status & port->ignore_status_mask & ~overrun) == 0)
575 tty_insert_flip_char(tty, ch, flag); 542 tty_insert_flip_char(tty, ch, flag);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index a916a318004e..f0f43d08d8b8 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -187,7 +187,12 @@ struct tty_port;
187struct tty_port_operations { 187struct tty_port_operations {
188 /* Return 1 if the carrier is raised */ 188 /* Return 1 if the carrier is raised */
189 int (*carrier_raised)(struct tty_port *port); 189 int (*carrier_raised)(struct tty_port *port);
190 /* Control the DTR line */
190 void (*dtr_rts)(struct tty_port *port, int raise); 191 void (*dtr_rts)(struct tty_port *port, int raise);
192 /* Called when the last close completes or a hangup finishes
193 IFF the port was initialized. Do not use to free resources */
194 void (*shutdown)(struct tty_port *port);
195 void (*drop)(struct tty_port *port);
191}; 196};
192 197
193struct tty_port { 198struct tty_port {
@@ -198,11 +203,12 @@ struct tty_port {
198 int count; /* Usage count */ 203 int count; /* Usage count */
199 wait_queue_head_t open_wait; /* Open waiters */ 204 wait_queue_head_t open_wait; /* Open waiters */
200 wait_queue_head_t close_wait; /* Close waiters */ 205 wait_queue_head_t close_wait; /* Close waiters */
206 wait_queue_head_t delta_msr_wait; /* Modem status change */
201 unsigned long flags; /* TTY flags ASY_*/ 207 unsigned long flags; /* TTY flags ASY_*/
202 struct mutex mutex; /* Locking */ 208 struct mutex mutex; /* Locking */
203 unsigned char *xmit_buf; /* Optional buffer */ 209 unsigned char *xmit_buf; /* Optional buffer */
204 int close_delay; /* Close port delay */ 210 unsigned int close_delay; /* Close port delay */
205 int closing_wait; /* Delay for output */ 211 unsigned int closing_wait; /* Delay for output */
206 int drain_delay; /* Set to zero if no pure time 212 int drain_delay; /* Set to zero if no pure time
207 based drain is needed else 213 based drain is needed else
208 set to size of fifo */ 214 set to size of fifo */
@@ -459,6 +465,12 @@ extern int tty_port_block_til_ready(struct tty_port *port,
459extern int tty_port_close_start(struct tty_port *port, 465extern int tty_port_close_start(struct tty_port *port,
460 struct tty_struct *tty, struct file *filp); 466 struct tty_struct *tty, struct file *filp);
461extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); 467extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty);
468extern void tty_port_close(struct tty_port *port,
469 struct tty_struct *tty, struct file *filp);
470extern inline int tty_port_users(struct tty_port *port)
471{
472 return port->count + port->blocked_open;
473}
462 474
463extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc); 475extern int tty_register_ldisc(int disc, struct tty_ldisc_ops *new_ldisc);
464extern int tty_unregister_ldisc(int disc); 476extern int tty_unregister_ldisc(int disc);
@@ -524,5 +536,8 @@ extern int pcxe_open(struct tty_struct *tty, struct file *filp);
524extern int vt_ioctl(struct tty_struct *tty, struct file *file, 536extern int vt_ioctl(struct tty_struct *tty, struct file *file,
525 unsigned int cmd, unsigned long arg); 537 unsigned int cmd, unsigned long arg);
526 538
539extern long vt_compat_ioctl(struct tty_struct *tty, struct file * file,
540 unsigned int cmd, unsigned long arg);
541
527#endif /* __KERNEL__ */ 542#endif /* __KERNEL__ */
528#endif 543#endif
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 0ec50ba62139..7b85e327af91 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -238,9 +238,8 @@ struct usb_serial_driver {
238 int (*resume)(struct usb_serial *serial); 238 int (*resume)(struct usb_serial *serial);
239 239
240 /* serial function calls */ 240 /* serial function calls */
241 /* Called by console with tty = NULL and by tty */ 241 /* Called by console and by the tty layer */
242 int (*open)(struct tty_struct *tty, 242 int (*open)(struct tty_struct *tty, struct usb_serial_port *port);
243 struct usb_serial_port *port, struct file *filp);
244 void (*close)(struct usb_serial_port *port); 243 void (*close)(struct usb_serial_port *port);
245 int (*write)(struct tty_struct *tty, struct usb_serial_port *port, 244 int (*write)(struct tty_struct *tty, struct usb_serial_port *port,
246 const unsigned char *buf, int count); 245 const unsigned char *buf, int count);
@@ -261,6 +260,9 @@ struct usb_serial_driver {
261 be an attached tty at this point */ 260 be an attached tty at this point */
262 void (*dtr_rts)(struct usb_serial_port *port, int on); 261 void (*dtr_rts)(struct usb_serial_port *port, int on);
263 int (*carrier_raised)(struct usb_serial_port *port); 262 int (*carrier_raised)(struct usb_serial_port *port);
263 /* Called by the usb serial hooks to allow the user to rework the
264 termios state */
265 void (*init_termios)(struct tty_struct *tty);
264 /* USB events */ 266 /* USB events */
265 void (*read_int_callback)(struct urb *urb); 267 void (*read_int_callback)(struct urb *urb);
266 void (*write_int_callback)(struct urb *urb); 268 void (*write_int_callback)(struct urb *urb);
@@ -300,7 +302,7 @@ static inline void usb_serial_console_disconnect(struct usb_serial *serial) {}
300extern struct usb_serial *usb_serial_get_by_index(unsigned int minor); 302extern struct usb_serial *usb_serial_get_by_index(unsigned int minor);
301extern void usb_serial_put(struct usb_serial *serial); 303extern void usb_serial_put(struct usb_serial *serial);
302extern int usb_serial_generic_open(struct tty_struct *tty, 304extern int usb_serial_generic_open(struct tty_struct *tty,
303 struct usb_serial_port *port, struct file *filp); 305 struct usb_serial_port *port);
304extern int usb_serial_generic_write(struct tty_struct *tty, 306extern int usb_serial_generic_write(struct tty_struct *tty,
305 struct usb_serial_port *port, const unsigned char *buf, int count); 307 struct usb_serial_port *port, const unsigned char *buf, int count);
306extern void usb_serial_generic_close(struct usb_serial_port *port); 308extern void usb_serial_generic_close(struct usb_serial_port *port);
diff --git a/include/linux/vt.h b/include/linux/vt.h
index 02c1c0288770..7afca0d72139 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -1,17 +1,6 @@
1#ifndef _LINUX_VT_H 1#ifndef _LINUX_VT_H
2#define _LINUX_VT_H 2#define _LINUX_VT_H
3 3
4#ifdef __KERNEL__
5struct notifier_block;
6
7struct vt_notifier_param {
8 struct vc_data *vc; /* VC on which the update happened */
9 unsigned int c; /* Printed char */
10};
11
12extern int register_vt_notifier(struct notifier_block *nb);
13extern int unregister_vt_notifier(struct notifier_block *nb);
14#endif
15 4
16/* 5/*
17 * These constants are also useful for user-level apps (e.g., VC 6 * These constants are also useful for user-level apps (e.g., VC
@@ -74,4 +63,25 @@ struct vt_consize {
74#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */ 63#define VT_UNLOCKSWITCH 0x560C /* allow vt switching */
75#define VT_GETHIFONTMASK 0x560D /* return hi font mask */ 64#define VT_GETHIFONTMASK 0x560D /* return hi font mask */
76 65
66struct vt_event {
67 unsigned int event;
68#define VT_EVENT_SWITCH 0x0001 /* Console switch */
69#define VT_EVENT_BLANK 0x0002 /* Screen blank */
70#define VT_EVENT_UNBLANK 0x0004 /* Screen unblank */
71#define VT_EVENT_RESIZE 0x0008 /* Resize display */
72#define VT_MAX_EVENT 0x000F
73 unsigned int old; /* Old console */
74 unsigned int new; /* New console (if changing) */
75 unsigned int pad[4]; /* Padding for expansion */
76};
77
78#define VT_WAITEVENT 0x560E /* Wait for an event */
79
80struct vt_setactivate {
81 unsigned int console;
82 struct vt_mode mode;
83};
84
85#define VT_SETACTIVATE 0x560F /* Activate and set the mode of a console */
86
77#endif /* _LINUX_VT_H */ 87#endif /* _LINUX_VT_H */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 2f1113467f70..c0c4e1103a73 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -13,6 +13,7 @@
13#include <linux/console_struct.h> 13#include <linux/console_struct.h>
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/consolemap.h> 15#include <linux/consolemap.h>
16#include <linux/notifier.h>
16 17
17/* 18/*
18 * Presently, a lot of graphics programs do not restore the contents of 19 * Presently, a lot of graphics programs do not restore the contents of
@@ -91,7 +92,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
91#endif 92#endif
92 93
93/* vt.c */ 94/* vt.c */
94int vt_waitactive(int vt); 95void vt_event_post(unsigned int event, unsigned int old, unsigned int new);
96int vt_waitactive(int n);
95void change_console(struct vc_data *new_vc); 97void change_console(struct vc_data *new_vc);
96void reset_vc(struct vc_data *vc); 98void reset_vc(struct vc_data *vc);
97extern int unbind_con_driver(const struct consw *csw, int first, int last, 99extern int unbind_con_driver(const struct consw *csw, int first, int last,
@@ -116,4 +118,16 @@ struct vt_spawn_console {
116}; 118};
117extern struct vt_spawn_console vt_spawn_con; 119extern struct vt_spawn_console vt_spawn_con;
118 120
121extern int vt_move_to_console(unsigned int vt, int alloc);
122
123/* Interfaces for VC notification of character events (for accessibility etc) */
124
125struct vt_notifier_param {
126 struct vc_data *vc; /* VC on which the update happened */
127 unsigned int c; /* Printed char */
128};
129
130extern int register_vt_notifier(struct notifier_block *nb);
131extern int unregister_vt_notifier(struct notifier_block *nb);
132
119#endif /* _VT_KERN_H */ 133#endif /* _VT_KERN_H */