4 * driver for the IPOCTAL boards
5 * Copyright (c) 2009 Nicolas Serafini, EIC2 SA
6 * Copyright (c) 2010,2011 Samuel Iglesias Gonsalvez <siglesia@cern.ch>, CERN
7 * Copyright (c) 2012 Samuel Iglesias Gonsalvez <siglesias@igalia.com>, Igalia
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; version 2 of the License.
18 #define IPOCTAL_MAX_BOARDS 16
19 #define MAX_DEVICES (NR_CHANNELS * IPOCTAL_MAX_BOARDS)
20 #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
23 * enum uart_parity_e - UART supported parity.
32 * enum uart_error - UART error type
36 UART_NOERROR = 0, /* No error during transmission */
37 UART_TIMEOUT = 1 << 0, /* Timeout error */
38 UART_OVERRUN = 1 << 1, /* Overrun error */
39 UART_PARITY = 1 << 2, /* Parity error */
40 UART_FRAMING = 1 << 3, /* Framing error */
41 UART_BREAK = 1 << 4, /* Received break */
45 * struct ipoctal_config - Serial configuration
48 * @stop_bits: Stop bits (1 or 2)
49 * @bits_per_char: data size in bits
51 * @flow_control: Flow control management (RTS/CTS) (0 disabled, 1 enabled)
53 struct ipoctal_config {
55 unsigned int stop_bits;
56 unsigned int bits_per_char;
57 unsigned short parity;
58 unsigned int flow_control;
62 * struct ipoctal_stats -- Stats since last reset
64 * @tx: Number of transmitted bytes
65 * @rx: Number of received bytes
66 * @overrun: Number of overrun errors
67 * @parity_err: Number of parity errors
68 * @framing_err: Number of framing errors
69 * @rcv_break: Number of break received
71 struct ipoctal_stats {
74 unsigned long overrun_err;
75 unsigned long parity_err;
76 unsigned long framing_err;
77 unsigned long rcv_break;
80 #endif /* _IPOCTAL_H_ */