OSDN Git Service

greybus: core: don't set up endo until host device is initialized
authorAlex Elder <elder@linaro.org>
Fri, 22 May 2015 17:56:49 +0000 (12:56 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 23 May 2015 23:45:42 +0000 (16:45 -0700)
commiteb765e4e91c8614c11ef2c4af7ce1222a30d6b79
tree3f3bfd27d08373461950682e7e77c64684ff440a
parent344943d2cdd85347637d0f3691c8c8bd34432247
greybus: core: don't set up endo until host device is initialized

Currently, the data structure representing an Endo is set up at the
time a host device gets created.  This is too early.

Once the control infrastructure is in place, there's no sense in
setting up the Endo utnil after we have heard from the SVC via a
probe operation on our control CPort.  And even then, there's
no real point until we've successfully authenticated with the SVC,
which will be indicated by the arrival of the Control protocol
"connected" operation request notifying us that our SVC CPort
is operational.

In addition to this logical argument, we also can't actually
receive any messages on the Control CPort until the host device
is set up and ready to receive messages.  At the point we're
currently setting up the Endo data structure, that has not yet
been done.

Define a new exported function greybus_endo_setup(), which will
be used (for now) as the entry point for setting up the Endo
data structure.  Arrange to call it in the host USB driver
probe method, *after* we are set up for handling messages.

Note: Once the control protocol has been implemented, this function
may no longer need to be exported.

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/es1.c
drivers/staging/greybus/es2.c
drivers/staging/greybus/greybus.h