linux/include/linux/platform_data/dsa.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#ifndef __DSA_PDATA_H
   3#define __DSA_PDATA_H
   4
   5struct device;
   6struct net_device;
   7
   8#define DSA_MAX_SWITCHES        4
   9#define DSA_MAX_PORTS           12
  10#define DSA_RTABLE_NONE         -1
  11
  12struct dsa_chip_data {
  13        /*
  14         * How to access the switch configuration registers.
  15         */
  16        struct device   *host_dev;
  17        int             sw_addr;
  18
  19        /*
  20         * Reference to network devices
  21         */
  22        struct device   *netdev[DSA_MAX_PORTS];
  23
  24        /* set to size of eeprom if supported by the switch */
  25        int             eeprom_len;
  26
  27        /* Device tree node pointer for this specific switch chip
  28         * used during switch setup in case additional properties
  29         * and resources needs to be used
  30         */
  31        struct device_node *of_node;
  32
  33        /*
  34         * The names of the switch's ports.  Use "cpu" to
  35         * designate the switch port that the cpu is connected to,
  36         * "dsa" to indicate that this port is a DSA link to
  37         * another switch, NULL to indicate the port is unused,
  38         * or any other string to indicate this is a physical port.
  39         */
  40        char            *port_names[DSA_MAX_PORTS];
  41        struct device_node *port_dn[DSA_MAX_PORTS];
  42
  43        /*
  44         * An array of which element [a] indicates which port on this
  45         * switch should be used to send packets to that are destined
  46         * for switch a. Can be NULL if there is only one switch chip.
  47         */
  48        s8              rtable[DSA_MAX_SWITCHES];
  49};
  50
  51struct dsa_platform_data {
  52        /*
  53         * Reference to a Linux network interface that connects
  54         * to the root switch chip of the tree.
  55         */
  56        struct device   *netdev;
  57        struct net_device *of_netdev;
  58
  59        /*
  60         * Info structs describing each of the switch chips
  61         * connected via this network interface.
  62         */
  63        int             nr_chips;
  64        struct dsa_chip_data    *chip;
  65};
  66
  67
  68#endif /* __DSA_PDATA_H */
  69