Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1663966

[PATCH net-next 11/13] net: dsa: mv88e6xxx: prefix Port Association Vector macros

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject [PATCH net-next 11/13] net: dsa: mv88e6xxx: prefix Port Association Vector macros
Date 2017-06-12 18:50 +0200
Message-ID <tRAHq-4zK-65@gated-at.bofh.it> (permalink)
References <tRAHn-4zK-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


For implicit namespacing and clarity, prefix the common Port Association
Vector Register macros with MV88E6XXX_PORT_ASSOC_VECTOR.

Document the register and prefer ordered hex masks values for all
Marvell 16-bit registers.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c |  3 ++-
 drivers/net/dsa/mv88e6xxx/port.h | 14 ++++++++------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 8146c94e394d..e04e780ffe90 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1892,7 +1892,8 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
 	if (dsa_is_cpu_port(ds, port))
 		reg = 0;
 
-	err = mv88e6xxx_port_write(chip, port, PORT_ASSOC_VECTOR, reg);
+	err = mv88e6xxx_port_write(chip, port, MV88E6XXX_PORT_ASSOC_VECTOR,
+				   reg);
 	if (err)
 		return err;
 
diff --git a/drivers/net/dsa/mv88e6xxx/port.h b/drivers/net/dsa/mv88e6xxx/port.h
index 5bcba657a111..a855409789c3 100644
--- a/drivers/net/dsa/mv88e6xxx/port.h
+++ b/drivers/net/dsa/mv88e6xxx/port.h
@@ -183,12 +183,14 @@
 /* Offset 0x0A: Egress Rate Control 2 */
 #define MV88E6XXX_PORT_EGRESS_RATE_CTL2		0x0a
 
-#define PORT_ASSOC_VECTOR	0x0b
-#define PORT_ASSOC_VECTOR_HOLD_AT_1		BIT(15)
-#define PORT_ASSOC_VECTOR_INT_AGE_OUT		BIT(14)
-#define PORT_ASSOC_VECTOR_LOCKED_PORT		BIT(13)
-#define PORT_ASSOC_VECTOR_IGNORE_WRONG		BIT(12)
-#define PORT_ASSOC_VECTOR_REFRESH_LOCKED	BIT(11)
+/* Offset 0x0B: Port Association Vector */
+#define MV88E6XXX_PORT_ASSOC_VECTOR			0x0b
+#define MV88E6XXX_PORT_ASSOC_VECTOR_HOLD_AT_1		0x8000
+#define MV88E6XXX_PORT_ASSOC_VECTOR_INT_AGE_OUT		0x4000
+#define MV88E6XXX_PORT_ASSOC_VECTOR_LOCKED_PORT		0x2000
+#define MV88E6XXX_PORT_ASSOC_VECTOR_IGNORE_WRONG	0x1000
+#define MV88E6XXX_PORT_ASSOC_VECTOR_REFRESH_LOCKED	0x0800
+
 #define PORT_ATU_CONTROL	0x0c
 #define PORT_PRI_OVERRIDE	0x0d
 #define PORT_ETH_TYPE		0x0f
-- 
2.13.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 00/13] net: dsa: mv88e6xxx: port macros cosmetics Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 12/13] net: dsa: mv88e6xxx: prefix Port IEEE Priority mapping macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 04/13] net: dsa: mv88e6xxx: prefix Port Switch ID macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 10/13] net: dsa: mv88e6xxx: prefix Port Egress Rate Control macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 13/13] net: dsa: mv88e6xxx: prefix remaining port macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 05/13] net: dsa: mv88e6xxx: prefix Port Control macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 01/13] net: dsa: mv88e6xxx: prefix Port Status macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 03/13] net: dsa: mv88e6xxx: prefix Port Jamming macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 11/13] net: dsa: mv88e6xxx: prefix Port Association Vector macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 06/13] net: dsa: mv88e6xxx: prefix Port Control 1 macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  [PATCH net-next 08/13] net: dsa: mv88e6xxx: prefix Port Default VLAN macros Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-06-12 18:50 +0200
  Re: [PATCH net-next 00/13] net: dsa: mv88e6xxx: port macros  cosmetics David Miller <davem@davemloft.net> - 2017-06-13 17:30 +0200

csiph-web