Thread (9 messages) 9 messages, 3 authors, 2016-09-15

Re: [PATCH V2 3/3] net-next: dsa: add new driver for qca8xxx family

flat view

From: John Crispin <john@phrozen.org>
Date: 2016-09-14 15:48:03
Also in: lkml


On 14/09/2016 12:39, John Crispin wrote:
quoted hunk ↗ jump to hunk
+static void
+qca8k_fdb_add(struct dsa_switch *ds, int port,
+	      const struct switchdev_obj_port_fdb *fdb,
+	      struct switchdev_trans *trans)
+{
+	struct qca8k_priv *priv = qca8k_to_priv(ds);
+	u16 port_mask = BIT(port);
+	u16 vid = fdb->vid;
+
+	if (!vid)
+		vid = 1;
+
+	qca8k_fdb_write(priv, vid, port_mask, fdb->addr,
+			QCA8K_ATU_STATUS_STATIC);
+
+	qca8k_fdb_access(priv, QCA8K_FDB_LOAD, -1);
+}
+
+static int
+qca8k_fdb_del(struct dsa_switch *ds, int port,
+	      const struct switchdev_obj_port_fdb *fdb)
+{
+	struct qca8k_priv *priv = qca8k_to_priv(ds);
+	u16 port_mask = BIT(port);
+
+	qca8k_fdb_write(priv, fdb->vid, port_mask, fdb->addr, 0);
+
+	return qca8k_fdb_access(priv, QCA8K_FDB_PURGE, -1);
+}
+
while adding MDB support i noticed that

1) the code above is still not properly locked
2) i can unify the FDB and MDB code

i will send a V3 with those 2 changes tomorrow.

	John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help