[usb_request_t] Get rid of context field.

The context field is used by the xhci layer to remember the current TRB
that is being processed. This should not be part of the public portion
of usb request. Move it to the xhci's internal context.

Test: Pixelbook: fx serve. fx shell. lsusb. iochk on usb mass storage. audio -d 1 tone.
Astro: Netboot. lsusb.

Change-Id: I29c2a7292079c45e163b7e30e0245f5d34d08490
diff --git a/system/dev/usb/xhci/xdc-transfer.cpp b/system/dev/usb/xhci/xdc-transfer.cpp
index c636732..e782949 100644
--- a/system/dev/usb/xhci/xdc-transfer.cpp
+++ b/system/dev/usb/xhci/xdc-transfer.cpp
@@ -54,7 +54,8 @@
 
     // If we get here, then we are ready to ring the doorbell.
     // Save the ring position so we can update the ring dequeue ptr once the transfer completes.
-    req->context = ring->current;
+    xdc_req_internal_t* req_int = USB_REQ_TO_XDC_INTERNAL(req, sizeof(usb_request_t));
+    req_int->context = ring->current;
     xdc_ring_doorbell(xdc, ep);
 
     return ZX_OK;
@@ -287,7 +288,7 @@
     list_delete(&test_int->node);
 
     // Update our copy of the dequeue_ptr to the TRB following this transaction.
-    xhci_set_dequeue_ptr(ring, static_cast<xhci_trb_t*>(req->context));
+    xhci_set_dequeue_ptr(ring, static_cast<xhci_trb_t*>(test_int->context));
     xdc_process_transactions_locked(xdc, ep);
 
     // Save the request to be completed later out of the lock.
diff --git a/system/dev/usb/xhci/xdc.h b/system/dev/usb/xhci/xdc.h
index 20b5d48..f784b0d 100644
--- a/system/dev/usb/xhci/xdc.h
+++ b/system/dev/usb/xhci/xdc.h
@@ -139,6 +139,7 @@
     list_node_t node;
     usb_request_complete_cb complete_cb;
     void* cookie;
+    void* context;
 } xdc_req_internal_t;
 
 #define USB_REQ_TO_XDC_INTERNAL(req, size) \
diff --git a/system/dev/usb/xhci/xhci-transfer.cpp b/system/dev/usb/xhci/xhci-transfer.cpp
index 5b7d647..60a4a7e 100644
--- a/system/dev/usb/xhci/xhci-transfer.cpp
+++ b/system/dev/usb/xhci/xhci-transfer.cpp
@@ -296,9 +296,10 @@
         state->needs_status = false;
     }
 
+    xhci_usb_request_internal_t* req_int = USB_REQ_TO_XHCI_INTERNAL(req);
     // if we get here, then we are ready to ring the doorbell
     // update dequeue_ptr to TRB following this transaction
-    req->context = (void *)ring->current;
+    req_int->context = (void *)ring->current;
 
     XHCI_WRITE32(&xhci->doorbells[header->device_id], ep_index + 1);
     // it seems we need to ring the doorbell a second time when transitioning from STOPPED
@@ -785,7 +786,7 @@
     }
 
     // update dequeue_ptr to TRB following this transaction
-    xhci_set_dequeue_ptr(ring, static_cast<xhci_trb_t*>(req->context));
+    xhci_set_dequeue_ptr(ring, static_cast<xhci_trb_t*>(req_int->context));
 
     // remove request from pending_reqs
     xhci_delete_req_node(xhci, req);
diff --git a/system/dev/usb/xhci/xhci.h b/system/dev/usb/xhci/xhci.h
index 626411e..9b4172a 100644
--- a/system/dev/usb/xhci/xhci.h
+++ b/system/dev/usb/xhci/xhci.h
@@ -88,6 +88,7 @@
      void* cookie;
      // for queueing request at xhci level
      list_node_t node;
+     void* context;
 } xhci_usb_request_internal_t;
 
 #define USB_REQ_TO_XHCI_INTERNAL(req) \
diff --git a/system/ulib/ddk/include/ddk/protocol/usb.h b/system/ulib/ddk/include/ddk/protocol/usb.h
index 1b948c4..1dbc607 100644
--- a/system/ulib/ddk/include/ddk/protocol/usb.h
+++ b/system/ulib/ddk/include/ddk/protocol/usb.h
@@ -98,8 +98,6 @@
 
     usb_response_t response;
 
-    void *context;
-
     // The release_cb() callback is set by the allocator and is
     // invoked by the 'usb_request_release' method when it is called
     // by the requestor.