]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
thunderbolt: Move ring descriptor flags to thunderbolt.h
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 2 Oct 2017 10:38:38 +0000 (13:38 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Oct 2017 18:24:41 +0000 (11:24 -0700)
A Thunderbolt service driver might need to check if there was an error
with the descriptor when in frame mode. We also add two Rx specific
error flags RING_DESC_CRC_ERROR and RING_DESC_BUFFER_OVERRUN.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Michael Jamet <michael.jamet@intel.com>
Reviewed-by: Yehezkel Bernat <yehezkel.bernat@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/thunderbolt/nhi_regs.h
include/linux/thunderbolt.h

index 491a4c0c18fc174852f2bceaa45dc8e330a1b49c..5ed6934e31e76f3cc6f8cc7e0b6de64d835d4d99 100644 (file)
@@ -17,13 +17,6 @@ enum ring_flags {
        RING_FLAG_ENABLE = 1 << 31,
 };
 
-enum ring_desc_flags {
-       RING_DESC_ISOCH = 0x1, /* TX only? */
-       RING_DESC_COMPLETED = 0x2, /* set by NHI */
-       RING_DESC_POSTED = 0x4, /* always set this */
-       RING_DESC_INTERRUPT = 0x8, /* request an interrupt on completion */
-};
-
 /**
  * struct ring_desc - TX/RX ring entry
  *
index 9ddb83ad890f46f9b340ba933a87f4ca526f60ce..e3b9af7be0adbef9ace138031dc515f78d62102d 100644 (file)
@@ -478,6 +478,24 @@ struct tb_ring {
 struct ring_frame;
 typedef void (*ring_cb)(struct tb_ring *, struct ring_frame *, bool canceled);
 
+/**
+ * enum ring_desc_flags - Flags for DMA ring descriptor
+ * %RING_DESC_ISOCH: Enable isonchronous DMA (Tx only)
+ * %RING_DESC_CRC_ERROR: In frame mode CRC check failed for the frame (Rx only)
+ * %RING_DESC_COMPLETED: Descriptor completed (set by NHI)
+ * %RING_DESC_POSTED: Always set this
+ * %RING_DESC_BUFFER_OVERRUN: RX buffer overrun
+ * %RING_DESC_INTERRUPT: Request an interrupt on completion
+ */
+enum ring_desc_flags {
+       RING_DESC_ISOCH = 0x1,
+       RING_DESC_CRC_ERROR = 0x1,
+       RING_DESC_COMPLETED = 0x2,
+       RING_DESC_POSTED = 0x4,
+       RING_DESC_BUFFER_OVERRUN = 0x04,
+       RING_DESC_INTERRUPT = 0x8,
+};
+
 /**
  * struct ring_frame - For use with ring_rx/ring_tx
  * @buffer_phy: DMA mapped address of the frame