From b407fca15efd7de9b0147ec724e4e619db49b7a2 Mon Sep 17 00:00:00 2001 From: Daniel Beer Date: Thu, 18 Jul 2013 13:56:26 +1200 Subject: [PATCH] transport: modify interface to support disappearing devices. --- transport/transport.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/transport/transport.h b/transport/transport.h index c175401..ec68abb 100644 --- a/transport/transport.h +++ b/transport/transport.h @@ -55,6 +55,16 @@ struct transport_class { * error occurs. */ int (*set_modem)(transport_t tr, transport_modem_t state); + + /* This pair of optional methods allows a transport to survive a + * USB device reset. Before an impending reset, suspend() should + * be called to release references to the bus. After the reset + * is completed, resume() should be called to reattach. + * + * It is an error to invoke IO methods on a suspended device. + */ + int (*suspend)(transport_t tr); + int (*resume)(transport_t tr); }; struct transport {