summaryrefslogtreecommitdiffstats
path: root/include/net/dsa.h
diff options
context:
space:
mode:
authorAndrew Lunn2016-06-04 21:17:00 +0200
committerDavid S. Miller2016-06-04 23:29:53 +0200
commit66472fc04e8be62858f29c7798ed17e984c1ab3b (patch)
tree7f1dd73e2bf0c8dac71112e707a4588e67d678e4 /include/net/dsa.h
parentnet: dsa: Remove dynamic allocate of routing table (diff)
downloadkernel-qcow2-linux-66472fc04e8be62858f29c7798ed17e984c1ab3b.tar.gz
kernel-qcow2-linux-66472fc04e8be62858f29c7798ed17e984c1ab3b.tar.xz
kernel-qcow2-linux-66472fc04e8be62858f29c7798ed17e984c1ab3b.zip
net: dsa: Copy the routing table into the switch structure
The new binding will not have a chip data structure, it will place the routing directly into the switch structure. To enable backwards compatibility, copy the routing from the chip data into the switch structure. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/dsa.h')
-rw-r--r--include/net/dsa.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 4e3afa9648ca..b666f27b3daa 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -148,6 +148,13 @@ struct dsa_switch {
*/
struct dsa_switch_driver *drv;
+ /*
+ * An array of which element [a] indicates which port on this
+ * switch should be used to send packets to that are destined
+ * for switch a. Can be NULL if there is only one switch chip.
+ */
+ s8 rtable[DSA_MAX_SWITCHES];
+
#ifdef CONFIG_NET_DSA_HWMON
/*
* Hardware monitoring information
@@ -194,7 +201,7 @@ static inline u8 dsa_upstream_port(struct dsa_switch *ds)
if (dst->cpu_switch == ds->index)
return dst->cpu_port;
else
- return ds->cd->rtable[dst->cpu_switch];
+ return ds->rtable[dst->cpu_switch];
}
struct switchdev_trans;