aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ntb/ntb.h
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2019-07-02 05:25:18 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-07-02 05:25:18 +0000
commit6683132d54bd6d589889e43dabdc53d35e38a028 (patch)
tree888a302eaf24c414f89d83e3bb6d528d16dddb64 /sys/dev/ntb/ntb.h
parentecb278f2e66243352b151abcadab5f05da443d6a (diff)
downloadsrc-6683132d54bd6d589889e43dabdc53d35e38a028.tar.gz
src-6683132d54bd6d589889e43dabdc53d35e38a028.zip
Add driver for NTB in AMD SoC.
This patch is the driver for NTB hardware in AMD SoCs (ported from Linux) and enables the NTB infrastructure like Doorbells, Scratchpads and Memory window in AMD SoC. This driver has been validated using ntb_transport and if_ntb driver already available in FreeBSD. Submitted by: Rajesh Kumar <rajesh1.kumar@amd.com> MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D18774
Notes
Notes: svn path=/head/; revision=349594
Diffstat (limited to 'sys/dev/ntb/ntb.h')
-rw-r--r--sys/dev/ntb/ntb.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/dev/ntb/ntb.h b/sys/dev/ntb/ntb.h
index 2b6aab6bc509..3ca76c994d22 100644
--- a/sys/dev/ntb/ntb.h
+++ b/sys/dev/ntb/ntb.h
@@ -64,6 +64,51 @@ void ntb_link_event(device_t ntb);
*/
void ntb_db_event(device_t ntb, uint32_t vec);
+/**
+ * ntb_port_number() - get the local port number
+ * @ntb: NTB device context.
+ *
+ * Hardware driver returns local port number in compliance with topology.
+ *
+ * Return: the local port number
+ */
+int ntb_port_number(device_t ntb);
+
+/**
+ * ntb_port_count() - get the number of peer device ports
+ * @ntb: NTB device context.
+ *
+ * By default hardware driver supports just one peer device.
+ *
+ * Return: the number of peer ports
+ */
+int ntb_peer_port_count(device_t ntb);
+
+/**
+ * ntb_peer_port_number() - get the peer port by given index
+ * @ntb: NTB device context.
+ * @idx: Peer port index (should be zero for now).
+ *
+ * By default hardware driver supports just one peer device, so this method
+ * shall return the corresponding value.
+ *
+ * Return: the peer device port or an error number
+ */
+int ntb_peer_port_number(device_t ntb, int pidx);
+
+/*
+ * ntb_peer_port_idx() - get the peer device port index by given port
+ * number
+ * @ntb: NTB device context.
+ * @port: Peer port number
+ *
+ * By default hardware driver supports just one peer device, so given a
+ * valid peer port number, the return value shall be zero.
+ *
+ * Return: the peer port index or an error number
+ */
+int ntb_peer_port_idx(device_t ntb, int port);
+
/*
* ntb_link_is_up() - get the current ntb link state
* @ntb: NTB device context