Skip to content

Commit 2a91ec6

Browse files
westeridavem330
authored andcommitted
thunderbolt: Move ring descriptor flags to thunderbolt.h
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>
1 parent 3b3d9f4 commit 2a91ec6

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

drivers/thunderbolt/nhi_regs.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ enum ring_flags {
1717
RING_FLAG_ENABLE = 1 << 31,
1818
};
1919

20-
enum ring_desc_flags {
21-
RING_DESC_ISOCH = 0x1, /* TX only? */
22-
RING_DESC_COMPLETED = 0x2, /* set by NHI */
23-
RING_DESC_POSTED = 0x4, /* always set this */
24-
RING_DESC_INTERRUPT = 0x8, /* request an interrupt on completion */
25-
};
26-
2720
/**
2821
* struct ring_desc - TX/RX ring entry
2922
*

include/linux/thunderbolt.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,24 @@ struct tb_ring {
478478
struct ring_frame;
479479
typedef void (*ring_cb)(struct tb_ring *, struct ring_frame *, bool canceled);
480480

481+
/**
482+
* enum ring_desc_flags - Flags for DMA ring descriptor
483+
* %RING_DESC_ISOCH: Enable isonchronous DMA (Tx only)
484+
* %RING_DESC_CRC_ERROR: In frame mode CRC check failed for the frame (Rx only)
485+
* %RING_DESC_COMPLETED: Descriptor completed (set by NHI)
486+
* %RING_DESC_POSTED: Always set this
487+
* %RING_DESC_BUFFER_OVERRUN: RX buffer overrun
488+
* %RING_DESC_INTERRUPT: Request an interrupt on completion
489+
*/
490+
enum ring_desc_flags {
491+
RING_DESC_ISOCH = 0x1,
492+
RING_DESC_CRC_ERROR = 0x1,
493+
RING_DESC_COMPLETED = 0x2,
494+
RING_DESC_POSTED = 0x4,
495+
RING_DESC_BUFFER_OVERRUN = 0x04,
496+
RING_DESC_INTERRUPT = 0x8,
497+
};
498+
481499
/**
482500
* struct ring_frame - For use with ring_rx/ring_tx
483501
* @buffer_phy: DMA mapped address of the frame

0 commit comments

Comments
 (0)