fifo wip
Change-Id: I8d56e5269358066eea28c85ef87432de1ae5c368
diff --git a/system/dev/usb/dwc3/dwc3-fifo.h b/system/dev/usb/dwc3/dwc3-fifo.h
new file mode 100644
index 0000000..4f6a512
--- /dev/null
+++ b/system/dev/usb/dwc3/dwc3-fifo.h
@@ -0,0 +1,26 @@
+// Copyright 2018 The Fuchsia Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#pragma once
+
+#include <ddk/io-buffer.h>
+
+#include "dwc3-types.h"
+
+namespace dwc3 {
+
+class Dwc3Fifo {
+public:
+
+private:
+ DISALLOW_COPY_ASSIGN_AND_MOVE(Dwc3Fifo);
+
+ io_buffer_t buffer;
+ dwc3_trb_t* first; // first TRB in the fifo
+ dwc3_trb_t* next; // next free TRB in the fifo
+ dwc3_trb_t* current; // TRB for currently pending transaction
+ dwc3_trb_t* last; // last TRB in the fifo (link TRB)
+};
+
+} // namespace dwc3
diff --git a/system/dev/usb/dwc3/dwc3-types.h b/system/dev/usb/dwc3/dwc3-types.h
index 98f5113..e31c0bd 100644
--- a/system/dev/usb/dwc3/dwc3-types.h
+++ b/system/dev/usb/dwc3/dwc3-types.h
@@ -5,7 +5,7 @@
#pragma once
// Transfer Request Block
-typedef volatile struct {
+typedef volatile struct dwc3_trb {
uint32_t ptr_low;
uint32_t ptr_high;
uint32_t status;
diff --git a/system/dev/usb/dwc3/dwc3.h b/system/dev/usb/dwc3/dwc3.h
index 7856f9c..25204ce 100644
--- a/system/dev/usb/dwc3/dwc3.h
+++ b/system/dev/usb/dwc3/dwc3.h
@@ -24,6 +24,7 @@
#include <threads.h>
+#include "dwc3-fifo.h"
#include "dwc3-types.h"
// physical endpoint numbers for ep0