Commit graph

94 commits

Author SHA1 Message Date
Matt Porter
52adb56340 greybus: update GREYBUS_VERSION_[MAJOR|MINOR] to match spec
The Greybus spec was updated to have major=0 and minor=1 so update
this in the code.

Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-18 20:06:08 -07:00
Matt Porter
e94e17143e greybus: move versioning from svc message header to handshake function
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>
2014-09-18 20:06:08 -07:00
Matt Porter
710ecb0605 greybus: update svc_msg_header fields and users to match spec
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>
2014-09-18 20:06:08 -07:00
Greg Kroah-Hartman
772149b6df greybus: fix hd init sequence of setting up parent and driver pointers properly 2014-09-14 12:27:28 -07:00
Greg Kroah-Hartman
13c8d9cd8a greybus: add test_sink driver 2014-09-14 12:27:19 -07:00
Greg Kroah-Hartman
45f3678bcf greybus: gbuf: cport in buffer stream logic 2014-09-14 11:40:35 -07:00
Greg Kroah-Hartman
80e04f0994 greybus: gbuf recieve path work, not done, dinner time... 2014-09-13 18:20:54 -07:00
Greg Kroah-Hartman
ee6fb79902 greybus: devices: endpoint description of device 2014-09-13 17:31:27 -07:00
Greg Kroah-Hartman
7f9e05e15b greybus: es1: functionally complete
Have only tested USB device add/remove, the urbs seem to all be queued
up, no data has been tested to flow through yet.

Odds are the hc interface will have to change, but this is a good first
start to build on.
2014-09-13 17:28:33 -07:00
Greg Kroah-Hartman
a1dc62b0c8 greybus: core: verify major/minor number of greybus protocol 2014-09-13 17:28:19 -07:00
Greg Kroah-Hartman
543b8ed2fe greybus: uart-gb: let the core dynamically allocate the major number
Don't register the tty_gb_driver, the gb core is not ready for the for
ES1 devices.
2014-09-13 17:02:47 -07:00
Greg Kroah-Hartman
168db1cd29 greybus: tty driver fixes to get init working properly 2014-09-13 16:15:52 -07:00
Greg Kroah-Hartman
082570b0ee greybus: es1 endpoint descriptor: minor fixes to get the config right 2014-09-13 16:15:07 -07:00
Greg Kroah-Hartman
ac7171ea26 greybus: Makefile: add 'check' option to run sparse with endian checks enabled 2014-09-13 12:39:23 -07:00
Greg Kroah-Hartman
b57b06241b greybus: ap: cleanup of process ap message loop 2014-09-13 12:18:09 -07:00
Greg Kroah-Hartman
88929c593d greybus: ap: convert to workqueue from thread 2014-09-13 11:35:02 -07:00
Greg Kroah-Hartman
9c8d3afdb5 greybus: es1: handle cport data in and out 2014-09-13 11:09:35 -07:00
Greg Kroah-Hartman
0dad95dc37 greybus: es1: allocate cport out urbs properly 2014-09-13 09:54:35 -07:00
Greg Kroah-Hartman
112997324d greybus: es1: add the start of cport urb handling. 2014-09-12 21:17:37 -07:00
Greg Kroah-Hartman
8c53e073f7 greybus: AP: move a bunch of svc message handling logic into ap.c
Add a send_svc_msg() callback to the host driver.
hook up ES1 driver to send control USB messages as it's SVC transport.
2014-09-12 20:47:11 -07:00
Greg Kroah-Hartman
ccbb51ed42 greybus: Merge branch 'master' of github.com:gregkh/greybus 2014-09-11 08:22:57 -07:00
Greg Kroah-Hartman
f91121b48f greybus: Fix build errors on older kernels.
Thanks to Marti for pointing out the code didn't build properly on 3.10.
Added kernel_ver.h to handle any api mis-matches between the code and
older kernel versions.
2014-09-11 08:22:06 -07:00
Greg Kroah-Hartman
a6294fe849 greybus: fix endian issue in sysfs.c 2014-09-10 17:12:20 -07:00
Greg Kroah-Hartman
3d5453261b greybus: pass appropriate type to create function
Based on a patch from Alex Elder <elder@linaro.org>.

Alex's original description:

Every descriptor in a manifest is interpreted by greybus_new_module().
We call a function to do initialization based on descriptor's type.

Since we know the type of the descriptor at that point, we can pass
to the called function the actual sub-type it needs (i.e., the union
member associated with the type).  This allows those functions to
be slightly simplified, and more focused.

Also change some size variables to have size_t type, and simplify a
few spots further by using sizeof(object) in place of sizeof(type).
2014-09-09 17:16:54 -07:00
Alex Elder
e82bef42fd greybus: fix manifest parsing size bug
The type-specific "create" routines that get called while parsing
the descriptor entries in the module manifest assume the size they
are provided is the size of their data portion only--not including
the descriptor header.

Compute this value in greybus_new_module(), and pass it to those
functions rather than the full descriptor size.  Move a few
declarations to the innermost block that uses them.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:16:12 -07:00
Alex Elder
57fc0a1104 greybus: validate descriptor sizes
When interpreting a manifest descriptor header, don't assume there
is enough space in the buffer to hold a descriptor header.  Also,
verify the remaining buffer is at least as big as the reported
descriptor size.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:15:05 -07:00
Alex Elder
a22e15a1fc greybus: interpret descriptor type properly
The type field in a manifest descriptor header is in little endian
format.  Make sure we interpret it that way.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:09:59 -07:00
Alex Elder
a5808add9a greybus: call put_device() on error
As soon as we've called device_initialize() we're required to call
put_device() in order to drop our reference to the device structure.
This was missed in the error path in greybus_new_module().  Fix that.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:09:06 -07:00
Alex Elder
badad68e3a greybus: define struct greybus_manifest
Define a structure that describes the entire greybus manifest.
Adjust greybus_new_module() to use that, making it explicit that
it's not just a header that's being provided to that function.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-09 15:07:42 -07:00
Alex Elder
05ad189c23 greybus: switch to the term "manifest"
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>
2014-09-09 15:05:25 -07:00
Greg Kroah-Hartman
d9d077fdbc greybus: es1: forgot to free our urb on disconnect 2014-09-08 20:11:18 -07:00
Greg Kroah-Hartman
47f6ef12fe greybus: es1: finialized USB device structure
Set up device properly and start up the SVC interrupt in endpoint for
processing data
2014-09-08 20:09:08 -07:00
Greg Kroah-Hartman
8b9951480b greybus: es1_ap_desc.c: updated ES1 USB device descriptor
Interrupt IN endpoint added.
2014-09-08 19:34:30 -07:00
Greg Kroah-Hartman
fe3270425f greybus: minor whitespace cleanups to make checkpatch.pl happy 2014-09-07 15:57:07 -07:00
Greg Kroah-Hartman
d47aa76161 greybus: battery FIXME added 2014-09-07 15:54:24 -07:00
Greg Kroah-Hartman
33ea3a3f56 greybus: add battery module 2014-09-07 15:39:34 -07:00
Greg Kroah-Hartman
43cc32a2ab greybus: first cut at parsing svc messages sent to the AP 2014-09-07 13:51:12 -07:00
Greg Kroah-Hartman
68f1fc4d2c greybus: more hd work 2014-09-07 13:12:11 -07:00
Greg Kroah-Hartman
a39879fc08 greybus: host controller additions
Also some gbuf functions starting to get fleshed out.
2014-09-06 16:57:36 -07:00
Greg Kroah-Hartman
d6e0e1c552 greybus: add es1_ap_desc.c to describe the ES1 USB device descriptors 2014-09-06 13:13:13 -07:00
Greg Kroah-Hartman
f0e49eb059 greybus: uart-gb: remove unneeded THIS_MODULE setting 2014-09-06 11:42:25 -07:00
Marti Bolivar
7fabc884f9 greybus: uart-gb.c: dynamically allocate device numbers 2014-09-06 11:42:07 -07:00
Marti Bolivar
f8089c0c6e greybus: uart-gb.c: replace alloc_tty_driver with tty_alloc_driver
alloc_tty_driver() is deprecated.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2014-09-06 11:41:23 -07:00
Greg Kroah-Hartman
48123e0e1e greybus: add proper packing to all greybus message types 2014-09-02 10:51:56 -07:00
Greg Kroah-Hartman
3be03d42cd greybus: minor checkpatch cleanups 2014-09-01 19:10:06 -07:00
Greg Kroah-Hartman
06340efb7c greybus: split sysfs functions out to separate file. 2014-09-01 19:05:54 -07:00
Greg Kroah-Hartman
e24e7257b1 greybus: greybus_string() 2014-09-01 19:01:14 -07:00
Greg Kroah-Hartman
21ee4116fd greybus: module id attributes 2014-09-01 18:57:42 -07:00
Greg Kroah-Hartman
291f3b9e61 greybus: serial number attribute added 2014-09-01 18:41:39 -07:00
Greg Kroah-Hartman
b94295e050 greybus: sysfs attributes for functions and more driver core integration. 2014-09-01 18:34:28 -07:00