aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/serial_core.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-03-05 14:52:18 -0500
committerIngo Molnar <mingo@kernel.org>2015-03-05 14:52:18 -0500
commit33ca8a53f262b4af40611bea331b8c87d133af72 (patch)
treed6468c820a556c4915bcb5b761204a0fb19e8225 /include/linux/serial_core.h
parentdb2dcb4f91d5fec5c346a82c309187ee821e2495 (diff)
parent13a7a6ac0a11197edcd0f756a035f472b42cdf8b (diff)
Merge tag 'v4.0-rc2' into irq/core, to refresh the tree before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/serial_core.h')
-rw-r--r--include/linux/serial_core.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 057038cf2788..baf3e1d08416 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -123,6 +123,7 @@ struct uart_port {
123 void (*set_termios)(struct uart_port *, 123 void (*set_termios)(struct uart_port *,
124 struct ktermios *new, 124 struct ktermios *new,
125 struct ktermios *old); 125 struct ktermios *old);
126 void (*set_mctrl)(struct uart_port *, unsigned int);
126 int (*startup)(struct uart_port *port); 127 int (*startup)(struct uart_port *port);
127 void (*shutdown)(struct uart_port *port); 128 void (*shutdown)(struct uart_port *port);
128 void (*throttle)(struct uart_port *port); 129 void (*throttle)(struct uart_port *port);
@@ -190,8 +191,10 @@ struct uart_port {
190#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) 191#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15))
191#define UPF_MAGIC_MULTIPLIER ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ ) 192#define UPF_MAGIC_MULTIPLIER ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ )
192 193
193/* Port has hardware-assisted h/w flow control (iow, auto-RTS *not* auto-CTS) */ 194/* Port has hardware-assisted h/w flow control */
194#define UPF_HARD_FLOW ((__force upf_t) (1 << 21)) 195#define UPF_AUTO_CTS ((__force upf_t) (1 << 20))
196#define UPF_AUTO_RTS ((__force upf_t) (1 << 21))
197#define UPF_HARD_FLOW ((__force upf_t) (UPF_AUTO_CTS | UPF_AUTO_RTS))
195/* Port has hardware-assisted s/w flow control */ 198/* Port has hardware-assisted s/w flow control */
196#define UPF_SOFT_FLOW ((__force upf_t) (1 << 22)) 199#define UPF_SOFT_FLOW ((__force upf_t) (1 << 22))
197#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 200#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
@@ -213,11 +216,17 @@ struct uart_port {
213#error Change mask not equivalent to userspace-visible bit defines 216#error Change mask not equivalent to userspace-visible bit defines
214#endif 217#endif
215 218
216 /* status must be updated while holding port lock */ 219 /*
220 * Must hold termios_rwsem, port mutex and port lock to change;
221 * can hold any one lock to read.
222 */
217 upstat_t status; 223 upstat_t status;
218 224
219#define UPSTAT_CTS_ENABLE ((__force upstat_t) (1 << 0)) 225#define UPSTAT_CTS_ENABLE ((__force upstat_t) (1 << 0))
220#define UPSTAT_DCD_ENABLE ((__force upstat_t) (1 << 1)) 226#define UPSTAT_DCD_ENABLE ((__force upstat_t) (1 << 1))
227#define UPSTAT_AUTORTS ((__force upstat_t) (1 << 2))
228#define UPSTAT_AUTOCTS ((__force upstat_t) (1 << 3))
229#define UPSTAT_AUTOXOFF ((__force upstat_t) (1 << 4))
221 230
222 int hw_stopped; /* sw-assisted CTS flow state */ 231 int hw_stopped; /* sw-assisted CTS flow state */
223 unsigned int mctrl; /* current modem ctrl settings */ 232 unsigned int mctrl; /* current modem ctrl settings */
@@ -391,6 +400,13 @@ static inline bool uart_cts_enabled(struct uart_port *uport)
391 return !!(uport->status & UPSTAT_CTS_ENABLE); 400 return !!(uport->status & UPSTAT_CTS_ENABLE);
392} 401}
393 402
403static inline bool uart_softcts_mode(struct uart_port *uport)
404{
405 upstat_t mask = UPSTAT_CTS_ENABLE | UPSTAT_AUTOCTS;
406
407 return ((uport->status & mask) == UPSTAT_CTS_ENABLE);
408}
409
394/* 410/*
395 * The following are helper functions for the low level drivers. 411 * The following are helper functions for the low level drivers.
396 */ 412 */