]> git.karo-electronics.de Git - karo-tx-linux.git/commit
greybus: introduce an operation abstraction
authorAlex Elder <elder@linaro.org>
Thu, 2 Oct 2014 02:54:15 +0000 (21:54 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 3 Oct 2014 04:18:41 +0000 (21:18 -0700)
commite88afa5811c741facff3fa695d340133ac8a1be1
treec03b0d910285538feb295a6764e4988952dbcdbe
parentc68adb2f2c999886f8e18e98ad4e69aec14c9f32
greybus: introduce an operation abstraction

This patch defines a new "operation" abstraction.  An operation is a
request from by one end of a connection to the function (or AP) on
the other, coupled with a matching response returned to the requestor.
The request indicates some action to be performed by the target of
the request (such as "read some data").  Once the action has
completed the target sends back an operation response message.
Additional data can be supplied by the sender with its request,
and/or by the target with its resposne message.

Each request message has a unique id, generated by the sender.
The sender recognizes the matching response by the presence
of this id value.  Each end of a connection is responsible
for creating unique ids for the requests it sends.

An operation also has a type, whose interpretation is dependent on
the function type on the end of the connection opposite the sender.
It is up to the creator of an operation to fill in the data (if any)
to be sent with the request.

Note that not all requests are initiated by the AP.  Incoming data
on a module function can result in a request message being sent from
that function to the AP to notify of the data's arrival.  Once the
AP has processed this, it sends a response to the sender.

Every operation response contains a status byte.  If it's value
is 0, the operation was successful.  Any other value indicates
an error.

Add a defintion of U16_MAX to "kernel_ver.h".

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/greybus.h
drivers/staging/greybus/kernel_ver.h
drivers/staging/greybus/operation.c [new file with mode: 0644]
drivers/staging/greybus/operation.h [new file with mode: 0644]