That's where it belong to. Also rename it in a similar way to:
gb_interface_create() and gb_interface_destroy().
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Add a few error messages to help explain the reason for failures.
Add a missing space in a message in svc_management().
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Rename and renumber the values for the AP ID service message
and related symbols to match the recently-updated spec.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
We removed the DDB function messages from the spec as they are
not needed. Now remove it from the code.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Rather than bringing up all interfaces described in the manifest,
wait until we get a link up message, and at that time go initialize
the link.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Give svc_set_route_send() non-private scope so it can be used by a
function outside "ap.c" in the next patch. Change its type so it
can tell its caller if an error occurs.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
When the AP receives a link up event, request that the SVC set a
route to the interface's device id (this device id has been
previously reported to the AP). In the future, we may not always
immediately set a route upon receiving a link up event but this
is sufficient for the known use cases at this time.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
The link up message is the event that tells the AP what device ID
has been assigned to a particular interface on a module during
enumeration. The link up is sent *only* after the hotplug event
for a particular module has been sent to the AP.
The link up payload must carry the Module ID and Interface ID
to uniquely identify the struct gb_interface to which the
Device ID has been assigned.
After processing of the link up message, the interface's device_id
field will contain the assigned Device ID so that the AP has the
information necessary to issue network route commands.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
The AP needs to know its assigned Device ID in order to establish
Greybus connections between CPorts. We could have pulled the Device
ID from the controller hardware in a driver specific manner, but
instead we define one generic message from the SVC to let the
AP know this information. Add this additional unipro management
message and handle it by setting the supplied Device ID in the
struct greybus_host_device. The greybus core will use this to
populate the source Device ID when establishing a connection
between the AP and another module's CPort.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
The two functions greybus_svc_in() and greybus_cport_in() do
very similar things, but their arguments are in a different order.
Move the greybus_host_device structure argument for greybus_svc_in()
to be first so the functions' prototypes are better aligned.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This patch renames of symbols, for better clarity and consistency.
cport -> cport_id (when it represents a cport *number*)
send_svc_msg -> submit_svc (like submit_gbuf)
greybus_cport_in_data -> greybus_cport_in
gb_new_ap_msg -> greybus_svc_in (like greybus_cport_in)
cport->number -> cport->id (like cport_id)
Making the svc and cport message stuff more similar is done with an
eye toward having SVC messages and messages exchanged with other
modules use some more common communication mechanisms.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Currently only the handshake_type is being initialized when
responding to an SVC handshake request. Update this to
explicitly set all header/payload fields appropriately.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
We check the type of the message now.
Start to check the size of the payload to match the size of the message
type. Still more work to do needed here.
Also "hooked up" the hotplug message, but doesn't call anything as the
core doesn't implement that yet...
The Greybus spec has been updated to improve the efficiency of the
version major/minor information that had been previously carried in
every SVC message header. The version major/minor is now provided
as part of the handshake function.
Update the SVC msg header and handshake function payload definitions
and move the version major/minor validation into the SVC handshake
handling routine.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
The Greybus spec has been updated to clarify some of the original
intent of the SVC message definition. The svc_msg_header was:
struct svc_msg_header {
__u8 function;
__u8 message_type;
...
}
and is now
struct svc_msg_header {
__u8 function_id;
__u8 message_type;
...
}
to match the spec. The function_id carries enum svc_function_id values
and message_type is now clarified to be a session layer level field
that is simply "data" or "error".
Change all references of function type to function id. For now, don't
parse the message_type field but add the two allowable svc_msg_type enums.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
We agreed to rename a few things to improve clarity. This patch
implements one of those changes. The blob of data that describes
what's relevant to Greybus within an Ara module will now be called
the "module manifest." In addition, in the context of Greybus we'll
also be calling what's in an Ara module a "module" or "Greybus module."
So this patch renames some structures and updates some comments. It
also renames "greybus_desc.h" to be "greybus_manifest.h", and renames
greybus_new_device() to be greybus_new_module().
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>