net: dsa: mv88e6xxx: prefix Global 2 Device Mapping macros
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>
Mon, 19 Jun 2017 14:55:39 +0000 (10:55 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jun 2017 17:24:42 +0000 (13:24 -0400)
Prefix and document the Global 2 Device Mapping macros.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/global2.c
drivers/net/dsa/mv88e6xxx/global2.h

index d821b9591a8f8193d5bf65c80bd60770a6a88a7a..d5239c4f3a9be7c717b1f91eb84c55f1010c9ef0 100644 (file)
@@ -73,7 +73,7 @@ static int mv88e6xxx_g2_device_mapping_write(struct mv88e6xxx_chip *chip,
 {
        u16 val = (target << 8) | (port & 0xf);
 
-       return mv88e6xxx_g2_update(chip, GLOBAL2_DEVICE_MAPPING, val);
+       return mv88e6xxx_g2_update(chip, MV88E6XXX_G2_DEVICE_MAPPING, val);
 }
 
 static int mv88e6xxx_g2_set_device_mapping(struct mv88e6xxx_chip *chip)
index c838c51cb2a10c51bec255fb20e894c960133eda..dd9b243309a09a8c8ed479873cd2ee061a2024e5 100644 (file)
 #define GLOBAL2_SWITCH_MGMT_FLOW_CONTROL_MSG   BIT(13)
 #define GLOBAL2_SWITCH_MGMT_FORCE_FLOW_CTRL_PRI        BIT(7)
 #define GLOBAL2_SWITCH_MGMT_RSVD2CPU           BIT(3)
-#define GLOBAL2_DEVICE_MAPPING 0x06
-#define GLOBAL2_DEVICE_MAPPING_UPDATE          BIT(15)
-#define GLOBAL2_DEVICE_MAPPING_TARGET_SHIFT    8
-#define GLOBAL2_DEVICE_MAPPING_PORT_MASK       0x0f
+
+/* Offset 0x06: Device Mapping Table Register */
+#define MV88E6XXX_G2_DEVICE_MAPPING            0x06
+#define MV88E6XXX_G2_DEVICE_MAPPING_UPDATE     0x8000
+#define MV88E6XXX_G2_DEVICE_MAPPING_DEV_MASK   0x1f00
+#define MV88E6XXX_G2_DEVICE_MAPPING_PORT_MASK  0x000f
 
 /* Offset 0x07: Trunk Mask Table Register */
 #define MV88E6XXX_G2_TRUNK_MASK                        0x07