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


Groups > linux.kernel > #1389642 > unrolled thread

[RFC 18/20] net: dsa: mv88e6xxx: add flags to info

Started byVivien Didelot <vivien.didelot@savoirfairelinux.com>
First post2016-04-28 00:40 +0200
Last post2016-04-28 00:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [RFC 18/20] net: dsa: mv88e6xxx: add flags to info Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-04-28 00:40 +0200

#1389642 — [RFC 18/20] net: dsa: mv88e6xxx: add flags to info

FromVivien Didelot <vivien.didelot@savoirfairelinux.com>
Date2016-04-28 00:40 +0200
Subject[RFC 18/20] net: dsa: mv88e6xxx: add flags to info
Message-ID<rsGhI-P8-9@gated-at.bofh.it>
Add a flags bitmap to the mv88e6xxx_info structure to help describing
features supported or not by a switch model.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
 drivers/net/dsa/mv88e6xxx.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h
index 56e3347..325caf8 100644
--- a/drivers/net/dsa/mv88e6xxx.h
+++ b/drivers/net/dsa/mv88e6xxx.h
@@ -338,6 +338,10 @@
 
 #define MV88E6XXX_N_FID		4096
 
+enum mv88e6xxx_flag {
+	MV88E6XXX_NUM_FLAGS,
+};
+
 enum mv88e6xxx_family {
 	MV88E6XXX_FAMILY_NONE,
 	MV88E6XXX_FAMILY_6065,	/* 6031 6035 6061 6065 */
@@ -356,6 +360,7 @@ struct mv88e6xxx_info {
 	const char *name;
 	unsigned int num_databases;
 	unsigned int num_ports;
+	unsigned long flags;
 };
 
 struct mv88e6xxx_atu_entry {
@@ -445,6 +450,12 @@ struct mv88e6xxx_hw_stat {
 	enum stat_type type;
 };
 
+static inline bool mv88e6xxx_has(struct mv88e6xxx_priv_state *ps,
+				 enum mv88e6xxx_flag flag)
+{
+	return !!(ps->info->flags & BIT(flag));
+}
+
 int mv88e6xxx_switch_reset(struct dsa_switch *ds, bool ppu_active);
 const char *mv88e6xxx_drv_probe(struct device *dsa_dev, struct device *host_dev,
 				int sw_addr, void **priv,
-- 
2.8.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web