usb: f_gsi: Add error checking for PREPARE_TRBS and STARTXFER ops

The GSI operations for GSI_EP_OP_PREPARE_TRBS and GSI_EP_OP_STARTXFER
should not proceed if the endpoint is disabled and should return an
error code (-ESHUTDOWN). Add error checking in f_gsi when calling
these ops. This is to catch cases where the endpoint is not enabled
(i.e. GSI_EP_OP_CONFIG was not called or GSI_EP_OP_DISABLE was
called) prior to ipa_connect_channels(), and helps to avoid the
situation in which STARTXFER is called on a disabled endpoint and
later GSI_EP_OP_FREE_TRBS is called which causes the HW to
incorrectly access stale DMA addresses the next time STARTXFER is
called.

Change-Id: I45f70524b87ec6303e135e385accd8e68e2b5a01
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
2 files changed