From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"David S . Miller" <davem@davemloft.net>
Cc: Andreas Noever <andreas.noever@gmail.com>,
Michael Jamet <michael.jamet@intel.com>,
Yehezkel Bernat <yehezkel.bernat@intel.com>,
Amir Levy <amir.jer.levy@intel.com>,
Mario.Limonciello@dell.com, Lukas Wunner <lukas@wunner.de>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 10/16] thunderbolt: Move ring descriptor flags to thunderbolt.h
Date: Mon, 18 Sep 2017 18:30:43 +0300 [thread overview]
Message-ID: <20170918153049.44185-11-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20170918153049.44185-1-mika.westerberg@linux.intel.com>
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>
---
drivers/thunderbolt/nhi_regs.h | 7 -------
include/linux/thunderbolt.h | 18 ++++++++++++++++++
2 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/drivers/thunderbolt/nhi_regs.h b/drivers/thunderbolt/nhi_regs.h
index 491a4c0c18fc..5ed6934e31e7 100644
--- a/drivers/thunderbolt/nhi_regs.h
+++ b/drivers/thunderbolt/nhi_regs.h
@@ -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
*
diff --git a/include/linux/thunderbolt.h b/include/linux/thunderbolt.h
index 1a376374c327..fac4ff62c0de 100644
--- a/include/linux/thunderbolt.h
+++ b/include/linux/thunderbolt.h
@@ -479,6 +479,24 @@ 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 compltion
+ */
+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
* @callback: Callback called when the frame is finished
--
2.13.5
next prev parent reply other threads:[~2017-09-18 15:35 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 15:30 [PATCH 00/16] Thunderbolt networking Mika Westerberg
2017-09-18 15:30 ` [PATCH 01/16] byteorder: Move {cpu_to_be32,be32_to_cpu}_array() from Thunderbolt to core Mika Westerberg
2017-09-18 15:30 ` [PATCH 02/16] thunderbolt: Add support for XDomain properties Mika Westerberg
2017-09-18 15:30 ` [PATCH 03/16] thunderbolt: Move enum tb_cfg_pkg_type to thunderbolt.h Mika Westerberg
2017-09-18 15:30 ` [PATCH 04/16] thunderbolt: Move thunderbolt domain structure " Mika Westerberg
2017-09-18 15:30 ` [PATCH 05/16] thunderbolt: Move tb_switch_phy_port_from_link() " Mika Westerberg
2017-09-18 15:30 ` [PATCH 06/16] thunderbolt: Add support for XDomain discovery protocol Mika Westerberg
2017-09-18 16:12 ` Dan Williams
2017-09-18 16:15 ` Dan Williams
2017-09-19 7:40 ` Mika Westerberg
2017-09-18 15:30 ` [PATCH 07/16] thunderbolt: Configure interrupt throttling for all interrupts Mika Westerberg
2017-09-18 15:30 ` [PATCH 08/16] thunderbolt: Add support for frame mode Mika Westerberg
2017-09-18 15:30 ` [PATCH 09/16] thunderbolt: Export ring handling functions to modules Mika Westerberg
2017-09-18 15:30 ` Mika Westerberg [this message]
2017-09-18 15:30 ` [PATCH 11/16] thunderbolt: Use spinlock in ring serialization Mika Westerberg
2017-09-18 15:30 ` [PATCH 12/16] thunderbolt: Use spinlock in NHI serialization Mika Westerberg
2017-09-18 15:30 ` [PATCH 13/16] thunderbolt: Add polling mode for rings Mika Westerberg
2017-09-18 15:30 ` [PATCH 14/16] thunderbolt: Add function to retrieve DMA device for the ring Mika Westerberg
2017-09-18 15:30 ` [PATCH 15/16] thunderbolt: Allocate ring HopID automatically if requested Mika Westerberg
2017-09-18 15:30 ` [PATCH 16/16] thunderbolt: Add support for networking over Thunderbolt cable Mika Westerberg
2017-09-18 23:21 ` Andrew Lunn
2017-09-19 7:12 ` Mika Westerberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918153049.44185-11-mika.westerberg@linux.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=Mario.Limonciello@dell.com \
--cc=amir.jer.levy@intel.com \
--cc=andreas.noever@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=michael.jamet@intel.com \
--cc=netdev@vger.kernel.org \
--cc=yehezkel.bernat@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox