This reverts commit 4d1529e6687d53878b71cdcd646e28e10d62c2e8.
Alex reports that this causes problems.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Just an extra check to make sure the list isn't corrupted.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
There's a message that gets printed in gb_manifest_parse() if excess
descriptors are found in the manifest. This should only be printed
if the parse was successful. If it was not successful it's not
really very helpful.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Switch to using "protocol_id" to refer to a byte-sized numeric
protocol number. A "protocol" will represent a protocol structure
(created in the next patch).
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Even if we successfully parse a manifest we are returning
failure. Instead, we now proudly proclaim success.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
The internal struct manifest_desc needs the data payload, rather
than the entire descriptor with header to be populated into the
data field. Also fix two places where the parser was trying to
extract the entire descriptor with header for the data payload
field.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
The code that was setting up a module was not properly initializing
the module data structure. Fixing this required a little rework.
Now gb_add_module() (which the host device pointer and module id)
allocates and initializes the structure, and passes it to
gb_manifest_parse() for populating it further.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Record the protocol association with a connection when it gets
created.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
We decided yesterday that we would no longer support the notion of a
"function." Instead, a connection will simply exist between the AP
and an interface on a module (and a CPort Id on each end). What
was previously considered the "function type" will now be handled
as the "protocol" associated with the connection.
Update gb_connection_create() to take just the interface and a cport
id associated with that interface.
Right now every module points back to a host device, so for now
we'll establish the connection back to that.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Update the definitions in "greybus_manifest.h" to reflect the
changes to the Greybus specification made on October 1.
They are:
- renaming "device" to be "interface"
- renumbering greybus descriptor type
- eliminating the notion of a "function"
- defining a CPort's protocol in the CPort descriptor
- having a "class" take on the types previously used for "function"
- renaming "serial number" to be "unique id" (for now)
- relying on an interface's maximum cport id to determine how
much device+cport address space the interface consumes
- adding a simple class descriptor
- renaming gb_interface->interface_id to be gb_interface->id
This also reorders some things to match ordering in the document,
and adds some commentary for the various structures.
Since greybus_function_type is gone, we eliminate the "type" field
from a function structure. (Functions are going away, next.)
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Add support for parsing one or more cports descriptors in a module
manifest. There must be at least one for each interface, but we impose
no limit on the number of interfaces associated with a module.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Add support for parsing one or more interface descriptors in a module
manifest. There must be at least one, but we impose no limit on the
number of interfaces associated with a module.
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Currently the module manifest parsing code is sort of representative
only and is not really very useful.
This patch begins doing "real" parsing of the module manifest.
It scans the module manifest to identify the descriptors it holds.
It then verifies there's only one module descriptor found, and
initializes new some fields in the gb_module structure based on what
it contains (converting what's found to native byte order).
Note that if anything unexpected is found or other errors occur when
parsing the manifest, the parse fails.
Because we now save this converted information when it's parsed we
no longer have a greybus_descriptor_module struct within a struct
gb_module. And because we've already converted these values, we can
do a little less work displaying values in sysfs. (We also now show
vendor, product, and version values in the right byte order.) This
eliminates the need for greybus_string(), so get rid of it.
It also slightly simplifies the greybus module matching code.
Move some existing parsing code into a new file, "manifest.c".
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>