summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/greybus_protocols.h
diff options
context:
space:
mode:
authorAxel Haslam <ahaslam@baylibre.com>2016-05-31 14:36:12 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-05-31 17:18:18 -0700
commit2b3b87f056b276b688cb0429faf682cac33dbf7b (patch)
tree87195edc1814cc9c28ae3d3c8194f305e999d1eb /drivers/staging/greybus/greybus_protocols.h
parenta8bc00fb88037e0107a0682478f47396a073be5c (diff)
downloadlinux-2b3b87f056b276b688cb0429faf682cac33dbf7b.tar.bz2
greybus: uart: Implement flush_buffer
Data may be held pening in the hardware because of flow control mechanisms. When the port is closed, we need to flush all data that was not sent. For this, use the greybus message GB_UART_TYPE_FLUSH_FIFOS which will flush all data queued on the module but not yet sent on the data line. Suggested-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Axel Haslam <ahaslam@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/greybus_protocols.h')
-rw-r--r--drivers/staging/greybus/greybus_protocols.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h
index 089751c24117..ff371c44cdf4 100644
--- a/drivers/staging/greybus/greybus_protocols.h
+++ b/drivers/staging/greybus/greybus_protocols.h
@@ -1270,6 +1270,7 @@ struct gb_raw_send_request {
#define GB_UART_TYPE_SEND_BREAK 0x06
#define GB_UART_TYPE_SERIAL_STATE 0x07 /* Unsolicited data */
#define GB_UART_TYPE_RECEIVE_CREDITS 0x08
+#define GB_UART_TYPE_FLUSH_FIFOS 0x09
/* Represents data from AP -> Module */
struct gb_uart_send_data_request {
@@ -1335,6 +1336,12 @@ struct gb_uart_serial_state_request {
__u8 control;
} __packed;
+struct gb_uart_serial_flush_request {
+ __u8 flags;
+#define GB_SERIAL_FLAG_FLUSH_TRANSMITTER 0x01
+#define GB_SERIAL_FLAG_FLUSH_RECEIVER 0x02
+} __packed;
+
/* Loopback */
/* Version of the Greybus loopback protocol we support */