DM USB: xHCI: refine stop endpoint logic

According to xHCI spec, the Stop Endpoint command should execute
no matter the endpoint is in halted state or not, but current
implementation just refuse do the command and return error to
Guest OS. It is wrong and this patch is used to fix it.

Signed-off-by: Xiaoguang Wu <xiaoguang.wu@intel.com>
Reviewed-by: Liang Yang <liang3.yang@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Tracked-On: #1366
This commit is contained in:
Xiaoguang Wu 2018-09-25 19:18:48 +08:00 committed by lijinxia
parent adc7913741
commit 2d00a99a4c

View File

@ -1942,7 +1942,8 @@ pci_xhci_cmd_reset_ep(struct pci_xhci_vdev *xdev,
assert(dev_ctx != NULL);
ep_ctx = &dev_ctx->ctx_ep[epid];
if ((ep_ctx->dwEpCtx0 & 0x7) != XHCI_ST_EPCTX_HALTED) {
if (type == XHCI_TRB_TYPE_RESET_EP &&
(ep_ctx->dwEpCtx0 & 0x7) != XHCI_ST_EPCTX_HALTED) {
cmderr = XHCI_TRB_ERROR_CONTEXT_STATE;
goto done;
}