]> asedeno.scripts.mit.edu Git - linux.git/commit
greybus: add gb_operation_find()
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:32 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:13:15 +0000 (18:13 +0200)
commit84d148b10e26d55b41726c7b5a6d227f10b39b0a
treea2a0e74afa560f68e3fdd99d3c0af6e10306df15
parent22b320f400f38afac70fff0472c4df1cf1bfeee5
greybus: add gb_operation_find()

Add a red-black tree indexed by operation id to a connection to
allow pending operations (whose requests are in-flight) to be
found when their matching response is recieved.

Assign the id at the time an operation is inserted, and update
the operation's message header(s) to include it.

Rename gb_connection_op_id() to be more consistent with the
naming conventions being used elsewhere.

(Noting now that this may switch to a simple list implementation
based on Greg's assertion that lists are faster than red-black trees
for up to a few hundred entries.)

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/operation.c
drivers/staging/greybus/operation.h