summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-01-08 02:42:09 +0300
committerJakub Kicinski <kuba@kernel.org>2021-01-08 02:42:10 +0300
commit85b277de895f503871437e76f4f5e18c3e405564 (patch)
treea1354208c145fbbc9694a024016741a022a21e3a /include/linux
parentc214cc3aa8423ba8e67c7028eeea9b0f48e8a7e6 (diff)
parent1dbb130281c447fdd061475931e1eb7baf475f53 (diff)
downloadlinux-85b277de895f503871437e76f4f5e18c3e405564.tar.xz
Merge branch 'reduce-coupling-between-dsa-and-broadcom-systemport-driver'
Vladimir Oltean says: ==================== Reduce coupling between DSA and Broadcom SYSTEMPORT driver Upon a quick inspection, it seems that there is some code in the generic DSA layer that is somehow specific to the Broadcom SYSTEMPORT driver. The challenge there is that the hardware integration is very tight between the switch and the DSA master interface. However this does not mean that the drivers must also be as integrated as the hardware is. We can avoid creating a DSA notifier just for the Broadcom SYSTEMPORT, and we can move some Broadcom-specific queue mapping helpers outside of the common include/net/dsa.h. ==================== Link: https://lore.kernel.org/r/20210107012403.1521114-1-olteanv@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dsa/brcm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/dsa/brcm.h b/include/linux/dsa/brcm.h
new file mode 100644
index 000000000000..47545a948784
--- /dev/null
+++ b/include/linux/dsa/brcm.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only
+ * Copyright (C) 2014 Broadcom Corporation
+ */
+
+/* Included by drivers/net/ethernet/broadcom/bcmsysport.c and
+ * net/dsa/tag_brcm.c
+ */
+#ifndef _NET_DSA_BRCM_H
+#define _NET_DSA_BRCM_H
+
+/* Broadcom tag specific helpers to insert and extract queue/port number */
+#define BRCM_TAG_SET_PORT_QUEUE(p, q) ((p) << 8 | q)
+#define BRCM_TAG_GET_PORT(v) ((v) >> 8)
+#define BRCM_TAG_GET_QUEUE(v) ((v) & 0xff)
+
+#endif