#include <linux/module.h>
#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/bitfield.h>
#include <linux/regmap.h>
#include <net/dsa.h>
#include <linux/of_net.h>
#include <linux/of_mdio.h>
#include <linux/of_platform.h>
#include <linux/mdio.h>
#include <linux/phylink.h>
#include <linux/gpio/consumer.h>
#include <linux/etherdevice.h>
#include <linux/dsa/tag_qca.h>
#include "qca8k.h"
#include "qca8k_leds.h"
static void
qca8k_split_addr(u32 regaddr, u16 *r1, u16 *r2, u16 *page)
{ … }
static int
qca8k_mii_write_lo(struct mii_bus *bus, int phy_id, u32 regnum, u32 val)
{ … }
static int
qca8k_mii_write_hi(struct mii_bus *bus, int phy_id, u32 regnum, u32 val)
{ … }
static int
qca8k_mii_read_lo(struct mii_bus *bus, int phy_id, u32 regnum, u32 *val)
{ … }
static int
qca8k_mii_read_hi(struct mii_bus *bus, int phy_id, u32 regnum, u32 *val)
{ … }
static int
qca8k_mii_read32(struct mii_bus *bus, int phy_id, u32 regnum, u32 *val)
{ … }
static void
qca8k_mii_write32(struct mii_bus *bus, int phy_id, u32 regnum, u32 val)
{ … }
static int
qca8k_set_page(struct qca8k_priv *priv, u16 page)
{ … }
static void qca8k_rw_reg_ack_handler(struct dsa_switch *ds, struct sk_buff *skb)
{ … }
static struct sk_buff *qca8k_alloc_mdio_header(enum mdio_cmd cmd, u32 reg, u32 *val,
int priority, unsigned int len)
{ … }
static void qca8k_mdio_header_fill_seq_num(struct sk_buff *skb, u32 seq_num)
{ … }
static int qca8k_read_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
{ … }
static int qca8k_write_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
{ … }
static int
qca8k_regmap_update_bits_eth(struct qca8k_priv *priv, u32 reg, u32 mask, u32 write_val)
{ … }
static int
qca8k_read_mii(struct qca8k_priv *priv, uint32_t reg, uint32_t *val)
{ … }
static int
qca8k_write_mii(struct qca8k_priv *priv, uint32_t reg, uint32_t val)
{ … }
static int
qca8k_regmap_update_bits_mii(struct qca8k_priv *priv, uint32_t reg,
uint32_t mask, uint32_t write_val)
{ … }
static int
qca8k_bulk_read(void *ctx, const void *reg_buf, size_t reg_len,
void *val_buf, size_t val_len)
{ … }
static int
qca8k_bulk_gather_write(void *ctx, const void *reg_buf, size_t reg_len,
const void *val_buf, size_t val_len)
{ … }
static int
qca8k_bulk_write(void *ctx, const void *data, size_t bytes)
{ … }
static int
qca8k_regmap_update_bits(void *ctx, uint32_t reg, uint32_t mask, uint32_t write_val)
{ … }
static const struct regmap_config qca8k_regmap_config = …;
static int
qca8k_phy_eth_busy_wait(struct qca8k_mgmt_eth_data *mgmt_eth_data,
struct sk_buff *read_skb, u32 *val)
{ … }
static int
qca8k_phy_eth_command(struct qca8k_priv *priv, bool read, int phy,
int regnum, u16 data)
{ … }
static int
qca8k_mdio_busy_wait(struct mii_bus *bus, u32 reg, u32 mask)
{ … }
static int
qca8k_mdio_write(struct qca8k_priv *priv, int phy, int regnum, u16 data)
{ … }
static int
qca8k_mdio_read(struct qca8k_priv *priv, int phy, int regnum)
{ … }
static int
qca8k_internal_mdio_write(struct mii_bus *slave_bus, int phy, int regnum, u16 data)
{ … }
static int
qca8k_internal_mdio_read(struct mii_bus *slave_bus, int phy, int regnum)
{ … }
static int
qca8k_legacy_mdio_write(struct mii_bus *slave_bus, int port, int regnum, u16 data)
{ … }
static int
qca8k_legacy_mdio_read(struct mii_bus *slave_bus, int port, int regnum)
{ … }
static int
qca8k_mdio_register(struct qca8k_priv *priv)
{ … }
static int
qca8k_setup_mdio_bus(struct qca8k_priv *priv)
{ … }
static int
qca8k_setup_mac_pwr_sel(struct qca8k_priv *priv)
{ … }
static int qca8k_find_cpu_port(struct dsa_switch *ds)
{ … }
static int
qca8k_setup_of_pws_reg(struct qca8k_priv *priv)
{ … }
static int
qca8k_parse_port_config(struct qca8k_priv *priv)
{ … }
static void
qca8k_mac_config_setup_internal_delay(struct qca8k_priv *priv, int cpu_port_index,
u32 reg)
{ … }
static struct phylink_pcs *
qca8k_phylink_mac_select_pcs(struct phylink_config *config,
phy_interface_t interface)
{ … }
static void
qca8k_phylink_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static void qca8k_phylink_get_caps(struct dsa_switch *ds, int port,
struct phylink_config *config)
{ … }
static void
qca8k_phylink_mac_link_down(struct phylink_config *config, unsigned int mode,
phy_interface_t interface)
{ … }
static void
qca8k_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)
{ … }
static struct qca8k_pcs *pcs_to_qca8k_pcs(struct phylink_pcs *pcs)
{ … }
static void qca8k_pcs_get_state(struct phylink_pcs *pcs,
struct phylink_link_state *state)
{ … }
static int qca8k_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface,
const unsigned long *advertising,
bool permit_pause_to_mac)
{ … }
static void qca8k_pcs_an_restart(struct phylink_pcs *pcs)
{ … }
static const struct phylink_pcs_ops qca8k_pcs_ops = …;
static void qca8k_setup_pcs(struct qca8k_priv *priv, struct qca8k_pcs *qpcs,
int port)
{ … }
static void qca8k_mib_autocast_handler(struct dsa_switch *ds, struct sk_buff *skb)
{ … }
static int
qca8k_get_ethtool_stats_eth(struct dsa_switch *ds, int port, u64 *data)
{ … }
static u32 qca8k_get_phy_flags(struct dsa_switch *ds, int port)
{ … }
static enum dsa_tag_protocol
qca8k_get_tag_protocol(struct dsa_switch *ds, int port,
enum dsa_tag_protocol mp)
{ … }
static void
qca8k_conduit_change(struct dsa_switch *ds, const struct net_device *conduit,
bool operational)
{ … }
static int qca8k_connect_tag_protocol(struct dsa_switch *ds,
enum dsa_tag_protocol proto)
{ … }
static void qca8k_setup_hol_fixup(struct qca8k_priv *priv, int port)
{ … }
static int
qca8k_setup(struct dsa_switch *ds)
{ … }
static const struct phylink_mac_ops qca8k_phylink_mac_ops = …;
static const struct dsa_switch_ops qca8k_switch_ops = …;
static int
qca8k_sw_probe(struct mdio_device *mdiodev)
{ … }
static void
qca8k_sw_remove(struct mdio_device *mdiodev)
{ … }
static void qca8k_sw_shutdown(struct mdio_device *mdiodev)
{ … }
#ifdef CONFIG_PM_SLEEP
static void
qca8k_set_pm(struct qca8k_priv *priv, int enable)
{ … }
static int qca8k_suspend(struct device *dev)
{ … }
static int qca8k_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(qca8k_pm_ops,
qca8k_suspend, qca8k_resume);
static const struct qca8k_info_ops qca8xxx_ops = …;
static const struct qca8k_match_data qca8327 = …;
static const struct qca8k_match_data qca8328 = …;
static const struct qca8k_match_data qca833x = …;
static const struct of_device_id qca8k_of_match[] = …;
static struct mdio_driver qca8kmdio_driver = …;
mdio_module_driver(qca8kmdio_driver);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;