Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'dsa_loop-and-platform_data-cleanups'

Vladimir Oltean says:

====================
dsa_loop and platform_data cleanups

While working to add some new features to dsa_loop, I gathered a number
of cleanup patches. They mostly remove some data structures that became
unused after the multi-switch platforms were migrated to the modern DT
bindings.
====================

Link: https://patch.msgid.link/20260406212158.721806-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+34 -88
-5
Documentation/networking/dsa/dsa.rst
··· 383 383 well as various properties of its ports: names/labels, and finally a routing 384 384 table indication (when cascading switches) 385 385 386 - - ``dsa_platform_data``: platform device configuration data which can reference 387 - a collection of dsa_chip_data structures if multiple switches are cascaded, 388 - the conduit network device this switch tree is attached to needs to be 389 - referenced 390 - 391 386 - ``dsa_switch_tree``: structure assigned to the conduit network device under 392 387 ``dsa_ptr``, this structure references a dsa_platform_data structure as well as 393 388 the tagging protocol supported by the switch tree, and which receive/transmit
+34 -1
drivers/net/dsa/dsa_loop.c
··· 14 14 #include <linux/workqueue.h> 15 15 #include <linux/module.h> 16 16 #include <linux/if_bridge.h> 17 - #include <linux/dsa/loop.h> 17 + #include <linux/if_vlan.h> 18 + #include <linux/types.h> 18 19 #include <net/dsa.h> 19 20 20 21 #define DSA_LOOP_NUM_PORTS 6 21 22 #define DSA_LOOP_CPU_PORT (DSA_LOOP_NUM_PORTS - 1) 22 23 #define NUM_FIXED_PHYS (DSA_LOOP_NUM_PORTS - 2) 24 + 25 + struct dsa_loop_vlan { 26 + u16 members; 27 + u16 untagged; 28 + }; 29 + 30 + struct dsa_loop_mib_entry { 31 + char name[ETH_GSTRING_LEN]; 32 + unsigned long val; 33 + }; 34 + 35 + enum dsa_loop_mib_counters { 36 + DSA_LOOP_PHY_READ_OK, 37 + DSA_LOOP_PHY_READ_ERR, 38 + DSA_LOOP_PHY_WRITE_OK, 39 + DSA_LOOP_PHY_WRITE_ERR, 40 + __DSA_LOOP_CNT_MAX, 41 + }; 42 + 43 + struct dsa_loop_port { 44 + struct dsa_loop_mib_entry mib[__DSA_LOOP_CNT_MAX]; 45 + u16 pvid; 46 + int mtu; 47 + }; 48 + 49 + struct dsa_loop_priv { 50 + struct mii_bus *bus; 51 + unsigned int port_base; 52 + struct dsa_loop_vlan vlans[VLAN_N_VID]; 53 + struct net_device *netdev; 54 + struct dsa_loop_port ports[DSA_MAX_PORTS]; 55 + }; 23 56 24 57 struct dsa_loop_pdata { 25 58 /* Must be first, such that dsa_register_switch() can access this
-42
include/linux/dsa/loop.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef DSA_LOOP_H 3 - #define DSA_LOOP_H 4 - 5 - #include <linux/if_vlan.h> 6 - #include <linux/types.h> 7 - #include <linux/ethtool.h> 8 - #include <net/dsa.h> 9 - 10 - struct dsa_loop_vlan { 11 - u16 members; 12 - u16 untagged; 13 - }; 14 - 15 - struct dsa_loop_mib_entry { 16 - char name[ETH_GSTRING_LEN]; 17 - unsigned long val; 18 - }; 19 - 20 - enum dsa_loop_mib_counters { 21 - DSA_LOOP_PHY_READ_OK, 22 - DSA_LOOP_PHY_READ_ERR, 23 - DSA_LOOP_PHY_WRITE_OK, 24 - DSA_LOOP_PHY_WRITE_ERR, 25 - __DSA_LOOP_CNT_MAX, 26 - }; 27 - 28 - struct dsa_loop_port { 29 - struct dsa_loop_mib_entry mib[__DSA_LOOP_CNT_MAX]; 30 - u16 pvid; 31 - int mtu; 32 - }; 33 - 34 - struct dsa_loop_priv { 35 - struct mii_bus *bus; 36 - unsigned int port_base; 37 - struct dsa_loop_vlan vlans[VLAN_N_VID]; 38 - struct net_device *netdev; 39 - struct dsa_loop_port ports[DSA_MAX_PORTS]; 40 - }; 41 - 42 - #endif /* DSA_LOOP_H */
-40
include/linux/platform_data/dsa.h
··· 3 3 #define __DSA_PDATA_H 4 4 5 5 struct device; 6 - struct net_device; 7 6 8 - #define DSA_MAX_SWITCHES 4 9 7 #define DSA_MAX_PORTS 12 10 - #define DSA_RTABLE_NONE -1 11 8 12 9 struct dsa_chip_data { 13 - /* 14 - * How to access the switch configuration registers. 15 - */ 16 - struct device *host_dev; 17 - int sw_addr; 18 - 19 10 /* 20 11 * Reference to network devices 21 12 */ ··· 14 23 15 24 /* set to size of eeprom if supported by the switch */ 16 25 int eeprom_len; 17 - 18 - /* Device tree node pointer for this specific switch chip 19 - * used during switch setup in case additional properties 20 - * and resources needs to be used 21 - */ 22 - struct device_node *of_node; 23 26 24 27 /* 25 28 * The names of the switch's ports. Use "cpu" to ··· 23 38 * or any other string to indicate this is a physical port. 24 39 */ 25 40 char *port_names[DSA_MAX_PORTS]; 26 - struct device_node *port_dn[DSA_MAX_PORTS]; 27 - 28 - /* 29 - * An array of which element [a] indicates which port on this 30 - * switch should be used to send packets to that are destined 31 - * for switch a. Can be NULL if there is only one switch chip. 32 - */ 33 - s8 rtable[DSA_MAX_SWITCHES]; 34 41 }; 35 - 36 - struct dsa_platform_data { 37 - /* 38 - * Reference to a Linux network interface that connects 39 - * to the root switch chip of the tree. 40 - */ 41 - struct device *netdev; 42 - struct net_device *of_netdev; 43 - 44 - /* 45 - * Info structs describing each of the switch chips 46 - * connected via this network interface. 47 - */ 48 - int nr_chips; 49 - struct dsa_chip_data *chip; 50 - }; 51 - 52 42 53 43 #endif /* __DSA_PDATA_H */