usb: f_gsi: Ignore supsend/resume events if data interface is not selected

Usually the GSI disconnect handler is invoked on disconnect
and bus suspend (with remote wakeup disabled) conditions.
However, for functions such as MBIM that support alternate
data interface, suspend/resume handling becomes a no-op
if the data interface is not selected.

One such example is disabling/enabling network device from device manager
or host sending set_alt 0 before suspend. This operation explicitly
disables data interface, remains the state in STATE_CONNECT_IN_PROGRESS.
After that when set_alt 1 comes from the host ipa_work_handler does
enable the data interface in this state.

Hence post the disconnect event in set_alt 0 handling and
subsequent suspend/resume operations become no-ops.

Change-Id: Idaf240ed5253f61880c05a1b11d87d4979d474c9
Signed-off-by: Devdutt Patnaik <dpatnaik@codeaurora.org>
Signed-off-by: Chandana Kishori Chiluveru <cchiluve@codeaurora.org>
1 file changed