summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/module.h
diff options
context:
space:
mode:
authorAlex Elder2014-10-02 04:54:16 +0200
committerGreg Kroah-Hartman2014-10-03 06:18:41 +0200
commitb09c94a1b71c82385ffa5f3c913d7d6e14eaea3d (patch)
tree3ce7862425665b787d6c57864aa97447ea73b104 /drivers/staging/greybus/module.h
parentgreybus: introduce an operation abstraction (diff)
downloadkernel-qcow2-linux-b09c94a1b71c82385ffa5f3c913d7d6e14eaea3d.tar.gz
kernel-qcow2-linux-b09c94a1b71c82385ffa5f3c913d7d6e14eaea3d.tar.xz
kernel-qcow2-linux-b09c94a1b71c82385ffa5f3c913d7d6e14eaea3d.zip
greybus: start improving manifest parsing
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>
Diffstat (limited to 'drivers/staging/greybus/module.h')
-rw-r--r--drivers/staging/greybus/module.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/staging/greybus/module.h b/drivers/staging/greybus/module.h
index 921c001911a2..326176a57adf 100644
--- a/drivers/staging/greybus/module.h
+++ b/drivers/staging/greybus/module.h
@@ -20,7 +20,14 @@ struct gb_module {
struct list_head links; /* greybus_host_device->modules */
u8 module_id; /* Physical location within the Endo */
- struct greybus_descriptor_module module;
+ /* Information taken from the manifest module descriptor */
+ u16 vendor;
+ u16 product;
+ u16 version;
+ u64 serial_number;
+ char *vendor_string;
+ char *product_string;
+
int num_cports;
int num_strings;
u16 cport_ids[MAX_CPORTS_PER_MODULE];