diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2008-10-07 09:45:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-10-08 20:19:56 -0400 |
commit | cf85d08fdf4548ee46657ccfb7f9949a85145db5 (patch) | |
tree | 583e251b0d772c23ca931a207e9ac0995d679f44 /include/linux | |
parent | 91da11f870f00a3322b81c73042291d7f0be5a17 (diff) |
dsa: add support for original DSA tagging format
Most of the DSA switches currently in the field do not support the
Ethertype DSA tagging format that one of the previous patches added
support for, but only the original DSA tagging format.
The original DSA tagging format carries the same information as the
Ethertype DSA tagging format, but with the difference that it does not
have an ethertype field. In other words, when receiving a packet that
is tagged with an original DSA tag, there is no way of telling in
eth_type_trans() that this packet is in fact a DSA-tagged packet.
This patch adds a hook into eth_type_trans() which is only compiled in
if support for a switch chip that doesn't support Ethertype DSA is
selected, and which checks whether there is a DSA switch driver
instance attached to this network device which uses the old tag format.
If so, it sets the protocol field to ETH_P_DSA without looking at the
packet, so that the packet ends up in the right place.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Tested-by: Nicolas Pitre <nico@marvell.com>
Tested-by: Peter van Valderen <linux@ddcrew.com>
Tested-by: Dirk Teurlings <dirk@upexia.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/if_ether.h | 1 | ||||
-rw-r--r-- | include/linux/netdevice.h | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 2140aacb6338..32b9dcda68c7 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -101,6 +101,7 @@ | |||
101 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ | 101 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ |
102 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ | 102 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ |
103 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ | 103 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ |
104 | #define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ | ||
104 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ | 105 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ |
105 | 106 | ||
106 | /* | 107 | /* |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 794eeb4b3462..97f0c64c152a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/workqueue.h> | 42 | #include <linux/workqueue.h> |
43 | 43 | ||
44 | #include <net/net_namespace.h> | 44 | #include <net/net_namespace.h> |
45 | #include <net/dsa.h> | ||
45 | 46 | ||
46 | struct vlan_group; | 47 | struct vlan_group; |
47 | struct ethtool_ops; | 48 | struct ethtool_ops; |
@@ -801,6 +802,16 @@ void dev_net_set(struct net_device *dev, struct net *net) | |||
801 | #endif | 802 | #endif |
802 | } | 803 | } |
803 | 804 | ||
805 | static inline bool netdev_uses_dsa_tags(struct net_device *dev) | ||
806 | { | ||
807 | #ifdef CONFIG_NET_DSA_TAG_DSA | ||
808 | if (dev->dsa_ptr != NULL) | ||
809 | return dsa_uses_dsa_tags(dev->dsa_ptr); | ||
810 | #endif | ||
811 | |||
812 | return 0; | ||
813 | } | ||
814 | |||
804 | /** | 815 | /** |
805 | * netdev_priv - access network device private data | 816 | * netdev_priv - access network device private data |
806 | * @dev: network device | 817 | * @dev: network device |