OSDN Git Service

greybus: reserve host cport id 0
authorAlex Elder <elder@linaro.org>
Sat, 13 Jun 2015 16:02:10 +0000 (11:02 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Mon, 15 Jun 2015 23:49:00 +0000 (16:49 -0700)
commit88d18a975ddac4fa849909c2ae178b0c126f7f8e
treec325e9983735460f0d232d968352a861dab9c5b4
parentfb690ca96f9a7aff8bc8135ce23606e243f4cbae
greybus: reserve host cport id 0

For ES1 and ES2, we use pad bytes in an operation message header to
encode the CPort ID used for transferring the message.  The pad
bytes should otherwise be zero, and we ensure this as the message
is passed to or from the upper layer.

If host-side CPort ID 0 is used, we have no way of knowing whether
the CPort field has been "packed" into the header.

To allow detection of this, reserve host CPort id 0.  Update
cport_id_valid() to treat 0 as invalid.

(CPort ID 0 is reserved by one of the UniPro standards.  We'll
assume for now that we never use it for Greybus.)

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/core.c
drivers/staging/greybus/greybus.h