summaryrefslogtreecommitdiffstats
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.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index cf3a1e789bf..21c2e05c1bc 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -112,6 +112,7 @@ struct uart_icount {
};
typedef unsigned int __bitwise__ upf_t;
+typedef unsigned int __bitwise__ upstat_t;
struct uart_port {
spinlock_t lock; /* port lock */
@@ -122,6 +123,10 @@ struct uart_port {
void (*set_termios)(struct uart_port *,
struct ktermios *new,
struct ktermios *old);
+ int (*startup)(struct uart_port *port);
+ void (*shutdown)(struct uart_port *port);
+ void (*throttle)(struct uart_port *port);
+ void (*unthrottle)(struct uart_port *port);
int (*handle_irq)(struct uart_port *);
void (*pm)(struct uart_port *, unsigned int state,
unsigned int old);
@@ -152,6 +157,7 @@ struct uart_port {
unsigned long sysrq; /* sysrq timeout */
#endif
+ /* flags must be updated while holding port mutex */
upf_t flags;
#define UPF_FOURPORT ((__force upf_t) (1 << 1))
@@ -187,6 +193,13 @@ struct uart_port {
#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff))
#define UPF_USR_MASK ((__force upf_t) (UPF_SPD_MASK|UPF_LOW_LATENCY))
+ /* status must be updated while holding port lock */
+ upstat_t status;
+
+#define UPSTAT_CTS_ENABLE ((__force upstat_t) (1 << 0))
+#define UPSTAT_DCD_ENABLE ((__force upstat_t) (1 << 1))
+
+ int hw_stopped; /* sw-assisted CTS flow state */
unsigned int mctrl; /* current modem ctrl settings */
unsigned int timeout; /* character-based timeout */
unsigned int type; /* port type */
@@ -347,11 +360,16 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port);
static inline int uart_tx_stopped(struct uart_port *port)
{
struct tty_struct *tty = port->state->port.tty;
- if(tty->stopped || tty->hw_stopped)
+ if (tty->stopped || port->hw_stopped)
return 1;
return 0;
}
+static inline bool uart_cts_enabled(struct uart_port *uport)
+{
+ return uport->status & UPSTAT_CTS_ENABLE;
+}
+
/*
* The following are helper functions for the low level drivers.
*/