diff options
author | Axel Haslam <ahaslam@baylibre.com> | 2016-05-31 14:36:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-05-31 17:18:18 -0700 |
commit | a8bc00fb88037e0107a0682478f47396a073be5c (patch) | |
tree | 13f4d67f6f6618e6ca02f8a45e310538158ca8eb /drivers/staging/greybus/greybus_protocols.h | |
parent | 8d6fbe9bf9947ee875c222a2e33d5977e2d052f2 (diff) | |
download | op-kernel-dev-a8bc00fb88037e0107a0682478f47396a073be5c.zip op-kernel-dev-a8bc00fb88037e0107a0682478f47396a073be5c.tar.gz |
greybus: uart: Add credits based tracking for transmit path
To avoid polling the firmware for space, a credit based system
is implemented.
The host will keep track of how many credits (bytes) it has
sent to the firmware, and stop sending data when the quota
is filled.
The host will be informed that the firmware has more
room for data when it handles the receive_credits request
message from the firmware, and will continue to write data
as credits become available.
The firmware and the host may implement an algorithm to aggregate
credits, and avoid extra greybus traffic.
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.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h index 072e5c9..089751c 100644 --- a/drivers/staging/greybus/greybus_protocols.h +++ b/drivers/staging/greybus/greybus_protocols.h @@ -1269,6 +1269,7 @@ struct gb_raw_send_request { #define GB_UART_TYPE_SET_CONTROL_LINE_STATE 0x05 #define GB_UART_TYPE_SEND_BREAK 0x06 #define GB_UART_TYPE_SERIAL_STATE 0x07 /* Unsolicited data */ +#define GB_UART_TYPE_RECEIVE_CREDITS 0x08 /* Represents data from AP -> Module */ struct gb_uart_send_data_request { @@ -1289,6 +1290,10 @@ struct gb_uart_recv_data_request { __u8 data[0]; } __packed; +struct gb_uart_receive_credits_request { + __le16 count; +} __packed; + struct gb_uart_set_line_coding_request { __le32 rate; __u8 format; |