#include <linux/delay.h>
#include <linux/export.h>
#include <linux/gpio.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_data/b53.h>
#include <linux/phy.h>
#include <linux/phylink.h>
#include <linux/etherdevice.h>
#include <linux/if_bridge.h>
#include <linux/if_vlan.h>
#include <net/dsa.h>
#include "b53_regs.h"
#include "b53_priv.h"
struct b53_mib_desc { … };
static const struct b53_mib_desc b53_mibs_65[] = …;
#define B53_MIBS_65_SIZE …
static const struct b53_mib_desc b53_mibs_63xx[] = …;
#define B53_MIBS_63XX_SIZE …
static const struct b53_mib_desc b53_mibs[] = …;
#define B53_MIBS_SIZE …
static const struct b53_mib_desc b53_mibs_58xx[] = …;
#define B53_MIBS_58XX_SIZE …
#define B53_MAX_MTU_25 …
#define B53_MAX_MTU …
static int b53_do_vlan_op(struct b53_device *dev, u8 op)
{ … }
static void b53_set_vlan_entry(struct b53_device *dev, u16 vid,
struct b53_vlan *vlan)
{ … }
static void b53_get_vlan_entry(struct b53_device *dev, u16 vid,
struct b53_vlan *vlan)
{ … }
static void b53_set_forwarding(struct b53_device *dev, int enable)
{ … }
static void b53_enable_vlan(struct b53_device *dev, int port, bool enable,
bool enable_filtering)
{ … }
static int b53_set_jumbo(struct b53_device *dev, bool enable, bool allow_10_100)
{ … }
static int b53_flush_arl(struct b53_device *dev, u8 mask)
{ … }
static int b53_fast_age_port(struct b53_device *dev, int port)
{ … }
static int b53_fast_age_vlan(struct b53_device *dev, u16 vid)
{ … }
void b53_imp_vlan_setup(struct dsa_switch *ds, int cpu_port)
{ … }
EXPORT_SYMBOL(…);
static void b53_port_set_ucast_flood(struct b53_device *dev, int port,
bool unicast)
{ … }
static void b53_port_set_mcast_flood(struct b53_device *dev, int port,
bool multicast)
{ … }
static void b53_port_set_learning(struct b53_device *dev, int port,
bool learning)
{ … }
static void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable)
{ … }
int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy)
{ … }
EXPORT_SYMBOL(…);
void b53_disable_port(struct dsa_switch *ds, int port)
{ … }
EXPORT_SYMBOL(…);
void b53_brcm_hdr_setup(struct dsa_switch *ds, int port)
{ … }
EXPORT_SYMBOL(…);
static void b53_enable_cpu_port(struct b53_device *dev, int port)
{ … }
static void b53_enable_mib(struct b53_device *dev)
{ … }
static u16 b53_default_pvid(struct b53_device *dev)
{ … }
static bool b53_vlan_port_needs_forced_tagged(struct dsa_switch *ds, int port)
{ … }
int b53_configure_vlan(struct dsa_switch *ds)
{ … }
EXPORT_SYMBOL(…);
static void b53_switch_reset_gpio(struct b53_device *dev)
{ … }
static int b53_switch_reset(struct b53_device *dev)
{ … }
static int b53_phy_read16(struct dsa_switch *ds, int addr, int reg)
{ … }
static int b53_phy_write16(struct dsa_switch *ds, int addr, int reg, u16 val)
{ … }
static int b53_reset_switch(struct b53_device *priv)
{ … }
static int b53_apply_config(struct b53_device *priv)
{ … }
static void b53_reset_mib(struct b53_device *priv)
{ … }
static const struct b53_mib_desc *b53_get_mib(struct b53_device *dev)
{ … }
static unsigned int b53_get_mib_size(struct b53_device *dev)
{ … }
static struct phy_device *b53_get_phy_device(struct dsa_switch *ds, int port)
{ … }
void b53_get_strings(struct dsa_switch *ds, int port, u32 stringset,
uint8_t *data)
{ … }
EXPORT_SYMBOL(…);
void b53_get_ethtool_stats(struct dsa_switch *ds, int port, uint64_t *data)
{ … }
EXPORT_SYMBOL(…);
void b53_get_ethtool_phy_stats(struct dsa_switch *ds, int port, uint64_t *data)
{ … }
EXPORT_SYMBOL(…);
int b53_get_sset_count(struct dsa_switch *ds, int port, int sset)
{ … }
EXPORT_SYMBOL(…);
enum b53_devlink_resource_id { … };
static u64 b53_devlink_vlan_table_get(void *priv)
{ … }
int b53_setup_devlink_resources(struct dsa_switch *ds)
{ … }
EXPORT_SYMBOL(…);
static int b53_setup(struct dsa_switch *ds)
{ … }
static void b53_teardown(struct dsa_switch *ds)
{ … }
static void b53_force_link(struct b53_device *dev, int port, int link)
{ … }
static void b53_force_port_config(struct b53_device *dev, int port,
int speed, int duplex,
bool tx_pause, bool rx_pause)
{ … }
static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port,
phy_interface_t interface)
{ … }
static void b53_adjust_531x5_rgmii(struct dsa_switch *ds, int port,
phy_interface_t interface)
{ … }
static void b53_adjust_5325_mii(struct dsa_switch *ds, int port)
{ … }
void b53_port_event(struct dsa_switch *ds, int port)
{ … }
EXPORT_SYMBOL(…);
static void b53_phylink_get_caps(struct dsa_switch *ds, int port,
struct phylink_config *config)
{ … }
static struct phylink_pcs *b53_phylink_mac_select_pcs(struct phylink_config *config,
phy_interface_t interface)
{ … }
static void b53_phylink_mac_config(struct phylink_config *config,
unsigned int mode,
const struct phylink_link_state *state)
{ … }
static void b53_phylink_mac_link_down(struct phylink_config *config,
unsigned int mode,
phy_interface_t interface)
{ … }
static void b53_phylink_mac_link_up(struct phylink_config *config,
struct phy_device *phydev,
unsigned int mode,
phy_interface_t interface,
int speed, int duplex,
bool tx_pause, bool rx_pause)
{ … }
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
struct netlink_ext_ack *extack)
{ … }
EXPORT_SYMBOL(…);
static int b53_vlan_prepare(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan)
{ … }
int b53_vlan_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan,
struct netlink_ext_ack *extack)
{ … }
EXPORT_SYMBOL(…);
int b53_vlan_del(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_vlan *vlan)
{ … }
EXPORT_SYMBOL(…);
static int b53_arl_op_wait(struct b53_device *dev)
{ … }
static int b53_arl_rw_op(struct b53_device *dev, unsigned int op)
{ … }
static int b53_arl_read(struct b53_device *dev, u64 mac,
u16 vid, struct b53_arl_entry *ent, u8 *idx)
{ … }
static int b53_arl_op(struct b53_device *dev, int op, int port,
const unsigned char *addr, u16 vid, bool is_valid)
{ … }
int b53_fdb_add(struct dsa_switch *ds, int port,
const unsigned char *addr, u16 vid,
struct dsa_db db)
{ … }
EXPORT_SYMBOL(…);
int b53_fdb_del(struct dsa_switch *ds, int port,
const unsigned char *addr, u16 vid,
struct dsa_db db)
{ … }
EXPORT_SYMBOL(…);
static int b53_arl_search_wait(struct b53_device *dev)
{ … }
static void b53_arl_search_rd(struct b53_device *dev, u8 idx,
struct b53_arl_entry *ent)
{ … }
static int b53_fdb_copy(int port, const struct b53_arl_entry *ent,
dsa_fdb_dump_cb_t *cb, void *data)
{ … }
int b53_fdb_dump(struct dsa_switch *ds, int port,
dsa_fdb_dump_cb_t *cb, void *data)
{ … }
EXPORT_SYMBOL(…);
int b53_mdb_add(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct dsa_db db)
{ … }
EXPORT_SYMBOL(…);
int b53_mdb_del(struct dsa_switch *ds, int port,
const struct switchdev_obj_port_mdb *mdb,
struct dsa_db db)
{ … }
EXPORT_SYMBOL(…);
int b53_br_join(struct dsa_switch *ds, int port, struct dsa_bridge bridge,
bool *tx_fwd_offload, struct netlink_ext_ack *extack)
{ … }
EXPORT_SYMBOL(…);
void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge)
{ … }
EXPORT_SYMBOL(…);
void b53_br_set_stp_state(struct dsa_switch *ds, int port, u8 state)
{ … }
EXPORT_SYMBOL(…);
void b53_br_fast_age(struct dsa_switch *ds, int port)
{ … }
EXPORT_SYMBOL(…);
int b53_br_flags_pre(struct dsa_switch *ds, int port,
struct switchdev_brport_flags flags,
struct netlink_ext_ack *extack)
{ … }
EXPORT_SYMBOL(…);
int b53_br_flags(struct dsa_switch *ds, int port,
struct switchdev_brport_flags flags,
struct netlink_ext_ack *extack)
{ … }
EXPORT_SYMBOL(…);
static bool b53_possible_cpu_port(struct dsa_switch *ds, int port)
{ … }
static bool b53_can_enable_brcm_tags(struct dsa_switch *ds, int port,
enum dsa_tag_protocol tag_protocol)
{ … }
enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port,
enum dsa_tag_protocol mprot)
{ … }
EXPORT_SYMBOL(…);
int b53_mirror_add(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror, bool ingress,
struct netlink_ext_ack *extack)
{ … }
EXPORT_SYMBOL(…);
void b53_mirror_del(struct dsa_switch *ds, int port,
struct dsa_mall_mirror_tc_entry *mirror)
{ … }
EXPORT_SYMBOL(…);
int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
{ … }
EXPORT_SYMBOL(…);
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
{ … }
EXPORT_SYMBOL(…);
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
{ … }
EXPORT_SYMBOL(…);
static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu)
{ … }
static int b53_get_max_mtu(struct dsa_switch *ds, int port)
{ … }
static const struct phylink_mac_ops b53_phylink_mac_ops = …;
static const struct dsa_switch_ops b53_switch_ops = …;
struct b53_chip_data { … };
#define B53_VTA_REGS …
#define B53_VTA_REGS_9798 …
#define B53_VTA_REGS_63XX …
static const struct b53_chip_data b53_switch_chips[] = …;
static int b53_switch_init(struct b53_device *dev)
{ … }
struct b53_device *b53_switch_alloc(struct device *base,
const struct b53_io_ops *ops,
void *priv)
{ … }
EXPORT_SYMBOL(…);
int b53_switch_detect(struct b53_device *dev)
{ … }
EXPORT_SYMBOL(…);
int b53_switch_register(struct b53_device *dev)
{ … }
EXPORT_SYMBOL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;