Ver Fonte

xhci: Add No Op Command

This commit adds No Op Command (23) to xHC for verifying the operation
of the Command Ring mechanisms.
No Op Command is defined in XHCI spec (4.6.2) and just reports Command
Completion Event with Completion Code == Success.
Before this commit, No Op Command is not implemented so xHC reports
Command Completion Event with Completion Code == TRB Error. This commit
fixes this behaviour to report Completion Code correctly.

Signed-off-by: Hikaru Nishida <hikarupsp@gmail.com>
Message-id: 20190720060427.50457-1-hikarupsp@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hikaru Nishida há 6 anos atrás
pai
commit
dc2c037fd2
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      hw/usb/hcd-xhci.c

+ 3 - 0
hw/usb/hcd-xhci.c

@@ -2543,6 +2543,9 @@ static void xhci_process_commands(XHCIState *xhci)
         case CR_GET_PORT_BANDWIDTH:
         case CR_GET_PORT_BANDWIDTH:
             event.ccode = xhci_get_port_bandwidth(xhci, trb.parameter);
             event.ccode = xhci_get_port_bandwidth(xhci, trb.parameter);
             break;
             break;
+        case CR_NOOP:
+            event.ccode = CC_SUCCESS;
+            break;
         case CR_VENDOR_NEC_FIRMWARE_REVISION:
         case CR_VENDOR_NEC_FIRMWARE_REVISION:
             if (xhci->nec_quirks) {
             if (xhci->nec_quirks) {
                 event.type = 48; /* NEC reply */
                 event.type = 48; /* NEC reply */