greybus: define struct gb_message

A Greybus buffer (gbuf) is a generic buffer used for data transfer
over a Greybus interconnect.  We only ever use gbufs in operations,
which always involve exactly two of them.  The lifetime of a gbuf is
therefore directly connected to the lifetime of an operation, so
there no real need to manage gbufs separate from operations.

This patch begins the process of removing the gbuf abstraction, on
favor of a new data type, gb_message.  The purpose of a gb_message
is--like a gbuf--to represent data to be transferred over Greybus.
However a gb_message is oriented toward the more restrictive way
we do Greybus transfers--as operation messages (either a request or
a response).

This patch simply defines the structure in its initial form, and
defines the request and response fields in a Greybus operation
structure as embedded instances of that type.  The gbuf pointer
is defined within the gb_message structure, and as a result lots
of code needs to be tweaked to reference the request and response
gbufs as subfields of the request and response structures.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
6 files changed
tree: ce2d7f6d13a7362f7fe421f68573af314df6f077
  1. drivers/