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


Groups > linux.kernel > #1583512

[PATCH net-next v2 1/6] net: dsa: mv88e6xxx: add port mask helper

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject [PATCH net-next v2 1/6] net: dsa: mv88e6xxx: add port mask helper
Date 2017-02-17 16:10 +0100
Message-ID <tbSky-5TK-29@gated-at.bofh.it> (permalink)
References <tbSky-5TK-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Add a mv88e6xxx_port_mask() helper to get the bitmask of ports in a
switch chip, that will be used in several features.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 drivers/net/dsa/mv88e6xxx/mv88e6xxx.h | 5 +++++
 drivers/net/dsa/mv88e6xxx/port.c      | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
index 6033f2f6260a..166b513ff751 100644
--- a/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx/mv88e6xxx.h
@@ -944,6 +944,11 @@ static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip)
 	return chip->info->num_ports;
 }
 
+static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip)
+{
+	return GENMASK(mv88e6xxx_num_ports(chip) - 1, 0);
+}
+
 int mv88e6xxx_read(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
 int mv88e6xxx_write(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
 int mv88e6xxx_update(struct mv88e6xxx_chip *chip, int addr, int reg,
diff --git a/drivers/net/dsa/mv88e6xxx/port.c b/drivers/net/dsa/mv88e6xxx/port.c
index 8875784c4718..9bb0f2134cba 100644
--- a/drivers/net/dsa/mv88e6xxx/port.c
+++ b/drivers/net/dsa/mv88e6xxx/port.c
@@ -539,7 +539,7 @@ int mv88e6351_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port,
 
 int mv88e6xxx_port_set_vlan_map(struct mv88e6xxx_chip *chip, int port, u16 map)
 {
-	const u16 mask = GENMASK(mv88e6xxx_num_ports(chip) - 1, 0);
+	const u16 mask = mv88e6xxx_port_mask(chip);
 	u16 reg;
 	int err;
 
-- 
2.11.1

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


Thread

[PATCH net-next v2 0/6] net: dsa: mv88e6xxx: 88E6390 ATU/VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 16:10 +0100
  [PATCH net-next v2 1/6] net: dsa: mv88e6xxx: add port mask helper Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 16:10 +0100
    Re: [PATCH net-next v2 1/6] net: dsa: mv88e6xxx: add port mask helper Andrew Lunn <andrew@lunn.ch> - 2017-02-17 22:30 +0100
  [PATCH net-next v2 6/6] net: dsa: mv88e6xxx: add support for 6390 VTU Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 16:10 +0100
    Re: [PATCH net-next v2 6/6] net: dsa: mv88e6xxx: add support for  6390 VTU Andrew Lunn <andrew@lunn.ch> - 2017-02-17 23:50 +0100
  [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in its own file Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 16:10 +0100
    Re: [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in  its own file Andrew Lunn <andrew@lunn.ch> - 2017-02-17 22:40 +0100
      Re: [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in its own file Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 23:00 +0100
        Re: [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in  its own file Andrew Lunn <andrew@lunn.ch> - 2017-02-17 23:40 +0100
          Re: [PATCH net-next v2 2/6] net: dsa: mv88e6xxx: move ATU code in  its own file David Miller <davem@davemloft.net> - 2017-02-18 00:50 +0100
  [PATCH net-next v2 4/6] net: dsa: mv88e6xxx: move VTU code to its own file Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-02-17 16:10 +0100
    Re: [PATCH net-next v2 4/6] net: dsa: mv88e6xxx: move VTU code to  its own file Andrew Lunn <andrew@lunn.ch> - 2017-02-17 22:50 +0100

csiph-web