net: dsa: sja1105: Add missing L2 Forwarding Table definitions for P/Q/R/S
authorVladimir Oltean <olteanv@gmail.com>
Sun, 2 Jun 2019 21:11:55 +0000 (00:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Jun 2019 18:49:19 +0000 (11:49 -0700)
This appends to the L2 Forwarding and L2 Forwarding Parameters tables
(originally added for first-generation switches) the bits that are new
in the second generation.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/sja1105/sja1105_static_config.c
drivers/net/dsa/sja1105/sja1105_static_config.h

index 7e90e62da389dc745e659fff1959e76329b62445..6d65a7b09395f07262d90b525eddf523f927f434 100644 (file)
@@ -236,10 +236,20 @@ size_t sja1105pqrs_l2_lookup_entry_packing(void *buf, void *entry_ptr,
        const size_t size = SJA1105PQRS_SIZE_L2_LOOKUP_ENTRY;
        struct sja1105_l2_lookup_entry *entry = entry_ptr;
 
-       /* These are static L2 lookup entries, so the structure
-        * should match UM11040 Table 16/17 definitions when
-        * LOCKEDS is 1.
-        */
+       if (entry->lockeds) {
+               sja1105_packing(buf, &entry->tsreg,    159, 159, size, op);
+               sja1105_packing(buf, &entry->mirrvlan, 158, 147, size, op);
+               sja1105_packing(buf, &entry->takets,   146, 146, size, op);
+               sja1105_packing(buf, &entry->mirr,     145, 145, size, op);
+               sja1105_packing(buf, &entry->retag,    144, 144, size, op);
+       } else {
+               sja1105_packing(buf, &entry->touched,  159, 159, size, op);
+               sja1105_packing(buf, &entry->age,      158, 144, size, op);
+       }
+       sja1105_packing(buf, &entry->mask_iotag,   143, 143, size, op);
+       sja1105_packing(buf, &entry->mask_vlanid,  142, 131, size, op);
+       sja1105_packing(buf, &entry->mask_macaddr, 130,  83, size, op);
+       sja1105_packing(buf, &entry->iotag,         82,  82, size, op);
        sja1105_packing(buf, &entry->vlanid,        81,  70, size, op);
        sja1105_packing(buf, &entry->macaddr,       69,  22, size, op);
        sja1105_packing(buf, &entry->destports,     21,  17, size, op);
index 069ca8fd059ca851aa39e39178cbd48c9fb1598c..d513b1c91b9850341d62c8c0ffc8f78d52c2253a 100644 (file)
@@ -122,9 +122,35 @@ struct sja1105_l2_lookup_entry {
        u64 destports;
        u64 enfport;
        u64 index;
+       /* P/Q/R/S only */
+       u64 mask_iotag;
+       u64 mask_vlanid;
+       u64 mask_macaddr;
+       u64 iotag;
+       bool lockeds;
+       union {
+               /* LOCKEDS=1: Static FDB entries */
+               struct {
+                       u64 tsreg;
+                       u64 mirrvlan;
+                       u64 takets;
+                       u64 mirr;
+                       u64 retag;
+               };
+               /* LOCKEDS=0: Dynamically learned FDB entries */
+               struct {
+                       u64 touched;
+                       u64 age;
+               };
+       };
 };
 
 struct sja1105_l2_lookup_params_entry {
+       u64 start_dynspc;    /* P/Q/R/S only */
+       u64 drpnolearn;      /* P/Q/R/S only */
+       u64 use_static;      /* P/Q/R/S only */
+       u64 owr_dyn;         /* P/Q/R/S only */
+       u64 learn_once;      /* P/Q/R/S only */
        u64 maxage;          /* Shared */
        u64 dyn_tbsz;        /* E/T only */
        u64 poly;            /* E/T only */