This simplifies the messaging protocol. Messages will now only have
the raw content plus a checksum byte at the end. We will worry about
needs of the transport layer (e.g. preamble/postamble bytes) on the
host driver side, and will not support variable-length commands for
now.
There is also a protocol version command, which is now command number
0x00, which returns a 4-byte protocol version followed by a 1-byte
checksum.
BUG=none
TEST=tested on daisy using mkbp kernel driver
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I8fcc693cd50bc2b515164ea7a2a941cdd8333e73
This organizes the commands in the messaging protocol so that we have
a more clear distinction between commands which are intended to to
control or get status of the EC itself and those which are intended
to query information about peripherals, such as the obtaining the
keyboard state.
Note: This will require the mkbp code to be updated.
BUG=none
TEST=compile tested for now
Change-Id: I2d5c58fc794563d402da24e19fee146df817472a
Signed-off-by: David Hendricks <dhendrix@chromium.org>
This simply changes the constant '4' to MSG_PROTO_BYTES, which
includes the postamble. This helps reduce magic constant values
used in processing a packet.
BUG=chrome-os-partner:8975
TEST=tested on daisy (with kernel mkbp driver change)
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: Id4634076ad63f45783354179dfebea4fd450fc1e
Whatever means is used to talk to the AP there is no justifcation for
putting message processing directly in drivers. Create a suitable
header file to define the interface, and provide a processing function
which can provide responses to incoming messages.
BUG=chromium-os:28925
TEST=build on daisy and discovery; run on daisy
Change-Id: If09ea3e30d42d8c5f226dc4421d4895adc54f937
Signed-off-by: Simon Glass <sjg@chromium.org>