- 14 Nov, 2014 23 commits
-
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Suggested-by: Alex Elder <elder@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Most of the attribute routines are created with gb_module_attr() and few are left out because they weren't printing 32 bit hexadecimal values. Extend gb_module_attr() to cover more cases. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Also fix indentation. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Parent objects of 'dev' are allocated with kzalloc() and so all of their fields are initialized with 0. Hence no need of marking them NULL again. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Viresh Kumar authored
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Matt Porter authored
Remove some leftover cruft from recent refactoring of connection handlers. Signed-off-by: Matt Porter <mporter@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
When an incoming request is received, the operation type is encoded in the header and is not available in the payload. Add the operation type as a parameter to the request_recv method so the request handler knows what to do. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alex Elder authored
We can update a connection's operation id counter under spinlock, and thereby avoid the need to maintain it in an atomic variable. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alex Elder authored
Greg raised the alarm when I first put in the red-black tree for tracking pending operations. The reality as that we're not likely to have that many operations in flight at any one time, so the complexity of the red-black tree is most likely unwarranted. I already This pulls out the red-black tree and uses a simple list instead. A connection maintains two lists of operations. An operation starts on its connection's operations list. It is moved to the pending list when its request message is sent. And it is moved back to the operations list when the response message arrives. It is removed from whatever list it's in when the operation is destroyed. We reuse the single operation->links field for both lists. Only outgoing requests are ever "pending." Incoming requests are transient--we receive them, process them, send the response, and then we're done. Change a few function names so it's clear we're working with the pending list. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alex Elder authored
Currently, gb_operation_insert() arranges to time out a request if it takes too long. Move this out of that function and into gb_operation_request_send(), so we know it's getting set up after the request has actually be sent. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alex Elder authored
This commit changed the timeout behavior for operations: 6a8732e operation: make the timeout a per-operation thing... It unfortunately left in place some code that was only appropriate for per-connection timeouts. In particular, the timer for an operation is currently getting started only if no existing operations are in flight. Fix that oversight, and schedule an operation's timer unconditionally. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Alex Elder authored
The buffers allocated for CPort URBS are ES1_GBUF_MSG_SIZE bytes. But usb_fill_bulk_urb() passes PAGE_SIZE as its size. They happen to be the same, but the code is wrong, so fix it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Matt Porter authored
Add a PWM driver that implements the Greybus PWM protocol. Signed-off-by: Matt Porter <mporter@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
- 06 Nov, 2014 8 commits
-
-
Alex Elder authored
The gbuf complete method is a callback that allows the creator of a gbuf to know when all processing on a gbuf is done. We now only ever allocate gbufs for use in Greybus operations, and in that case we only ever supply gb_operation_gbuf_complete() as the completion callback. Furthermore, the only place gbuf->complete() is called is in gb_operation_recv_work(). Knowing this, we can just call gb_operation_gbuf_complete() directly from gb_operation_recv_work(), and get rid of the gbuf->complete() method entirely. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Simple move of a block of code, done as a separate commit to make it easier to see that's all that's going on. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
All greybus_gbuf_finished() does is call the gbuf's complete method. Currently, greybus_gbuf_finished() is only ever called in one place, and that place can call the complete method directly instead. That allows us to eliminate greybus_gbuf_finished(). Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
A gbuf now records a pointer to its operation. The only thing ever stored in a gbuf context pointer is the gbuf's operation. Therefore there's no longer any need to maintain the context pointer, so get rid of it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Currently a gbuf records a pointer to the connection it's associated with. We now know only use gbufs in operation messages, so we can point a gbuf at its operation instead. This still gives access to the connection where needed, but it also will provide all the context we'll ever need for a gbuf, and this allows us (in the next patch) to remove the gbuf->context field as well. So switch to recording in a gbuf the operation rather than the connection it is associated with. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Right now, the actual_length field of a gbuf is only ever assigned, never used. We now fill gbufs only with operation messages, and they encode within them the amount of space "actually used" in a buffer in a request-specific way. As a result, there's no need for the gbuf->actual_length field, so we can remove it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Handling of incoming requests has been moved into the Greybus connection and protocol layers. As a result, the original cport oriented handler code is no longer used. So get rid of it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
This file is an artifact of some early testing, but it is otherwise unused. So get rid of it. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
- 05 Nov, 2014 9 commits
-
-
Alex Elder authored
Define a new protocol method intended to handle the receipt of an incoming operation request. Most protocols have no expected incoming requests and can leave this null. If a request arrives for a protocol with no request receive handler an error is reported and the request fails. Get rid of the previous fixed array of receive handlers, it's no longer needed. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Get rid of the connection handler structure, and instead put the methods that were there into the protocol structure. Eliminate the big switch statement in connection_init() and just call the connection's protocol's init function there directly. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Set up protocol structures as static objects in each protocol source file. Pass the address of that in--rather than the protocol id and version information--to the protocol registration routine. Call a central routine to register all our pre-defined protocols. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Add protocols to the global list in sorted order, based on their protocol id, and then their major and minor version number. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
We don't really need a list of protocol users, we can just keep track of how many there are. Get rid of the list and use a count instead. Also, have gb_protocol_get() return the protocol rather than assigning a passed-in connection pointer's protocol. Make a comparable change to the gb_protocol_put() interface. Get rid of gb_protocol_find() (the version that locks), because it is no longer needed. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
Right now we only look up a protocol based on its protocol id. Add support for maintaining a major and minor version as well, and use them when looking up a protocol. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-
Alex Elder authored
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>
-
Alex Elder authored
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>
-
Alex Elder authored
This function should have private scope. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-