greybus: look up connection for recevied messages

Look up the connection that an incoming message is associated with.
This is the start of making message handling oriented toward the
the connection rather than the cport.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
Alex Elder 2014-10-06 06:53:09 -05:00 committed by Greg Kroah-Hartman
parent ee9ebe4d0b
commit 00d2e7588c
1 changed files with 8 additions and 0 deletions

View File

@ -179,6 +179,14 @@ void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id,
{
struct gb_cport_handler *ch;
struct gbuf *gbuf;
struct gb_connection *connection;
connection = gb_hd_connection_find(hd, cport_id);
if (!connection) {
dev_err(hd->parent,
"nonexistent connection (%zu bytes dropped)\n", length);
return;
}
/* first check to see if we have a cport handler for this cport */
ch = &cport_handler[cport_id];