aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/serial_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r--include/linux/serial_core.h71
1 files changed, 42 insertions, 29 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 4e4f1277f3bf..b4199841f1fc 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -40,7 +40,8 @@
40#define PORT_NS16550A 14 40#define PORT_NS16550A 14
41#define PORT_XSCALE 15 41#define PORT_XSCALE 15
42#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */ 42#define PORT_RM9000 16 /* PMC-Sierra RM9xxx internal UART */
43#define PORT_MAX_8250 16 /* max port ID */ 43#define PORT_OCTEON 17 /* Cavium OCTEON internal UART */
44#define PORT_MAX_8250 17 /* max port ID */
44 45
45/* 46/*
46 * ARM specific type numbers. These are not currently guaranteed 47 * ARM specific type numbers. These are not currently guaranteed
@@ -158,6 +159,8 @@
158/* SH-SCI */ 159/* SH-SCI */
159#define PORT_SCIFA 83 160#define PORT_SCIFA 83
160 161
162#define PORT_S3C6400 84
163
161#ifdef __KERNEL__ 164#ifdef __KERNEL__
162 165
163#include <linux/compiler.h> 166#include <linux/compiler.h>
@@ -246,6 +249,8 @@ struct uart_port {
246 spinlock_t lock; /* port lock */ 249 spinlock_t lock; /* port lock */
247 unsigned long iobase; /* in/out[bwl] */ 250 unsigned long iobase; /* in/out[bwl] */
248 unsigned char __iomem *membase; /* read/write[bwl] */ 251 unsigned char __iomem *membase; /* read/write[bwl] */
252 unsigned int (*serial_in)(struct uart_port *, int);
253 void (*serial_out)(struct uart_port *, int, int);
249 unsigned int irq; /* irq number */ 254 unsigned int irq; /* irq number */
250 unsigned int uartclk; /* base uart clock */ 255 unsigned int uartclk; /* base uart clock */
251 unsigned int fifosize; /* tx fifo size */ 256 unsigned int fifosize; /* tx fifo size */
@@ -291,6 +296,8 @@ struct uart_port {
291#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 296#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
292#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 297#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
293#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 298#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
299/* The exact UART type is known and should not be probed. */
300#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
294#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 301#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
295#define UPF_FIXED_PORT ((__force upf_t) (1 << 29)) 302#define UPF_FIXED_PORT ((__force upf_t) (1 << 29))
296#define UPF_DEAD ((__force upf_t) (1 << 30)) 303#define UPF_DEAD ((__force upf_t) (1 << 30))
@@ -314,35 +321,13 @@ struct uart_port {
314}; 321};
315 322
316/* 323/*
317 * This is the state information which is persistent across opens.
318 * The low level driver must not to touch any elements contained
319 * within.
320 */
321struct uart_state {
322 unsigned int close_delay; /* msec */
323 unsigned int closing_wait; /* msec */
324
325#define USF_CLOSING_WAIT_INF (0)
326#define USF_CLOSING_WAIT_NONE (~0U)
327
328 int count;
329 int pm_state;
330 struct uart_info *info;
331 struct uart_port *port;
332
333 struct mutex mutex;
334};
335
336#define UART_XMIT_SIZE PAGE_SIZE
337
338typedef unsigned int __bitwise__ uif_t;
339
340/*
341 * This is the state information which is only valid when the port 324 * This is the state information which is only valid when the port
342 * is open; it may be freed by the core driver once the device has 325 * is open; it may be cleared the core driver once the device has
343 * been closed. Either the low level driver or the core can modify 326 * been closed. Either the low level driver or the core can modify
344 * stuff here. 327 * stuff here.
345 */ 328 */
329typedef unsigned int __bitwise__ uif_t;
330
346struct uart_info { 331struct uart_info {
347 struct tty_port port; 332 struct tty_port port;
348 struct circ_buf xmit; 333 struct circ_buf xmit;
@@ -364,6 +349,29 @@ struct uart_info {
364 wait_queue_head_t delta_msr_wait; 349 wait_queue_head_t delta_msr_wait;
365}; 350};
366 351
352/*
353 * This is the state information which is persistent across opens.
354 * The low level driver must not to touch any elements contained
355 * within.
356 */
357struct uart_state {
358 unsigned int close_delay; /* msec */
359 unsigned int closing_wait; /* msec */
360
361#define USF_CLOSING_WAIT_INF (0)
362#define USF_CLOSING_WAIT_NONE (~0U)
363
364 int count;
365 int pm_state;
366 struct uart_info info;
367 struct uart_port *port;
368
369 struct mutex mutex;
370};
371
372#define UART_XMIT_SIZE PAGE_SIZE
373
374
367/* number of characters left in xmit buffer before we ask for more */ 375/* number of characters left in xmit buffer before we ask for more */
368#define WAKEUP_CHARS 256 376#define WAKEUP_CHARS 256
369 377
@@ -437,8 +445,13 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
437#define uart_circ_chars_free(circ) \ 445#define uart_circ_chars_free(circ) \
438 (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE)) 446 (CIRC_SPACE((circ)->head, (circ)->tail, UART_XMIT_SIZE))
439 447
440#define uart_tx_stopped(portp) \ 448static inline int uart_tx_stopped(struct uart_port *port)
441 ((portp)->info->port.tty->stopped || (portp)->info->port.tty->hw_stopped) 449{
450 struct tty_struct *tty = port->info->port.tty;
451 if(tty->stopped || tty->hw_stopped)
452 return 1;
453 return 0;
454}
442 455
443/* 456/*
444 * The following are helper functions for the low level drivers. 457 * The following are helper functions for the low level drivers.
@@ -449,7 +462,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch)
449#ifdef SUPPORT_SYSRQ 462#ifdef SUPPORT_SYSRQ
450 if (port->sysrq) { 463 if (port->sysrq) {
451 if (ch && time_before(jiffies, port->sysrq)) { 464 if (ch && time_before(jiffies, port->sysrq)) {
452 handle_sysrq(ch, port->info ? port->info->port.tty : NULL); 465 handle_sysrq(ch, port->info->port.tty);
453 port->sysrq = 0; 466 port->sysrq = 0;
454 return 1; 467 return 1;
455 } 468 }