forked from Minki/linux
cf85d08fdf
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>
37 lines
917 B
C
37 lines
917 B
C
/*
|
|
* include/net/dsa.h - Driver for Distributed Switch Architecture switch chips
|
|
* Copyright (c) 2008 Marvell Semiconductor
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef __LINUX_NET_DSA_H
|
|
#define __LINUX_NET_DSA_H
|
|
|
|
#define DSA_MAX_PORTS 12
|
|
|
|
struct dsa_platform_data {
|
|
/*
|
|
* Reference to a Linux network interface that connects
|
|
* to the switch chip.
|
|
*/
|
|
struct device *netdev;
|
|
|
|
/*
|
|
* How to access the switch configuration registers, and
|
|
* the names of the switch ports (use "cpu" to designate
|
|
* the switch port that the cpu is connected to).
|
|
*/
|
|
struct device *mii_bus;
|
|
int sw_addr;
|
|
char *port_names[DSA_MAX_PORTS];
|
|
};
|
|
|
|
extern bool dsa_uses_dsa_tags(void *dsa_ptr);
|
|
|
|
|
|
#endif
|