fastboot: Re-initialize gadget mode if connection is lost

If USB cable is disconnected and re-connected, re-initialize USB
gadget mode. This fixes the issue that depthcharge is stuck in a tight
loop trying to recv packets from the host even if connection is
lost. On re-connecting the cable, device re-initializes the
connection.

CQ-DEPEND=CL:281066
BUG=chrome-os-partner:41687
BRANCH=None
TEST=Compiles successfully. fastboot works fine on disconnecting and
reconnecting cable between host and device.

Change-Id: Icd8a0eb2556acd2849fab34806ed1fd60506ed3c
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/281067
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
3 files changed