usb: gadget: Fix f_mbim state machine

The USB f_mbim driver has a state machine to control the packets
transmissions from the QBI to the host. In use cases that the MBIM
connection with the host is restarted rapidly, the USB driver may still
receive packets from the QBI which belong to the previous session even
though the connection with the host has restarted.

This change makes sure that every packet that arrive from the QBI will be
notified back to the host only in the appropriate state of the state
machine, means only if the MBIM connection was successfully restarted by
finishing notify the host the CDC notifications as SPEED_CHANGE or
NETWORK_CONNECTION.

CRs-Fixed: 440163
Change-Id: Ifb162b73f677caa17721e5b7d2144dfbe670531d
Signed-off-by: Ido Shayevitz <idos@codeaurora.org>
1 file changed