greybus: connection: add flush host-device callback
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 27 May 2016 15:26:37 +0000 (17:26 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 27 May 2016 19:24:17 +0000 (12:24 -0700)
commit800d6c8f4e66cc6ff3737b4de1272c31cd9e1e3c
tree6fede458e5dbed9afe805213e863420c98d32ff0
parent3de5acfafb3c610bc6f7013a1583852cbc2747f1
greybus: connection: add flush host-device callback

Add a new host-device callback to flush any host-device queues,
including any ongoing transfers, as part of connection tear down.

The host-device buffers are flushed after the disconnecting operation
have completed and the AP queues have been emptied.

This can be used to flush already queued messages which upon reception
would have been discarded by the remote end anyway.

Note that this does not remove the need to flush any host-device queues
as part of CPort disable which needs to make the CPort ready for reuse
after deallocating all associated state and resetting the port.

Suggested-by: Mitchell Tasman <tasman@leaflabs.com>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/hd.h