check_ethernet.hook: let mist handle Mass Storage

At boot or resume time, due to races between USB device firmware and
the linux driver inialization sequence, a USB ethernet dongle may come
up in "Mass Storage" mode.  (old problem... e.g. crbug.com/452686)

Mist knows how to flip the devices back to vendor mode (which is what
the ethernet drivers are looking for).  So if the ethernet link doesn't
come up right away due to a device coming up in Mass storage mode,
assume mist can fix it.

If mist is not installed, evict the USB Storage device and hope that
it comes back in vendor mode. This costs more time but avoids the
hard dependency on mist.

BUG=b:134466648
TEST=code snippets manually unit tested

Change-Id: Iddd90dba2f8fb0e7c2dda72ea342cebca6eb8856
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crostestutils/+/3985053
Commit-Queue: Grant Grundler <grundler@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Auto-Submit: Grant Grundler <grundler@chromium.org>
Tested-by: Grant Grundler <grundler@chromium.org>
1 file changed