linux/drivers/net/phy/bcm-phy-lib.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2015-2017 Broadcom
 */

#include "bcm-phy-lib.h"
#include <linux/bitfield.h>
#include <linux/brcmphy.h>
#include <linux/etherdevice.h>
#include <linux/export.h>
#include <linux/mdio.h>
#include <linux/module.h>
#include <linux/phy.h>
#include <linux/ethtool.h>
#include <linux/ethtool_netlink.h>
#include <linux/netdevice.h>

#define MII_BCM_CHANNEL_WIDTH
#define BCM_CL45VEN_EEE_ADV

int __bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_write_exp(struct phy_device *phydev, u16 reg, u16 val)
{}
EXPORT_SYMBOL_GPL();

int __bcm_phy_read_exp(struct phy_device *phydev, u16 reg)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_read_exp(struct phy_device *phydev, u16 reg)
{}
EXPORT_SYMBOL_GPL();

int __bcm_phy_modify_exp(struct phy_device *phydev, u16 reg, u16 mask, u16 set)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_modify_exp(struct phy_device *phydev, u16 reg, u16 mask, u16 set)
{}
EXPORT_SYMBOL_GPL();

int bcm54xx_auxctl_read(struct phy_device *phydev, u16 regnum)
{}
EXPORT_SYMBOL_GPL();

int bcm54xx_auxctl_write(struct phy_device *phydev, u16 regnum, u16 val)
{}
EXPORT_SYMBOL();

int bcm_phy_write_misc(struct phy_device *phydev,
		       u16 reg, u16 chl, u16 val)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_read_misc(struct phy_device *phydev,
		      u16 reg, u16 chl)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_ack_intr(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_config_intr(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

irqreturn_t bcm_phy_handle_interrupt(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_read_shadow(struct phy_device *phydev, u16 shadow)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_write_shadow(struct phy_device *phydev, u16 shadow,
			 u16 val)
{}
EXPORT_SYMBOL_GPL();

int __bcm_phy_read_rdb(struct phy_device *phydev, u16 rdb)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_read_rdb(struct phy_device *phydev, u16 rdb)
{}
EXPORT_SYMBOL_GPL();

int __bcm_phy_write_rdb(struct phy_device *phydev, u16 rdb, u16 val)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_write_rdb(struct phy_device *phydev, u16 rdb, u16 val)
{}
EXPORT_SYMBOL_GPL();

int __bcm_phy_modify_rdb(struct phy_device *phydev, u16 rdb, u16 mask, u16 set)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_modify_rdb(struct phy_device *phydev, u16 rdb, u16 mask, u16 set)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_enable_apd(struct phy_device *phydev, bool dll_pwr_down)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_set_eee(struct phy_device *phydev, bool enable)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_downshift_get(struct phy_device *phydev, u8 *count)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_downshift_set(struct phy_device *phydev, u8 count)
{}
EXPORT_SYMBOL_GPL();

struct bcm_phy_hw_stat {};

/* Counters freeze at either 0xffff or 0xff, better than nothing */
static const struct bcm_phy_hw_stat bcm_phy_hw_stats[] =;

int bcm_phy_get_sset_count(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

void bcm_phy_get_strings(struct phy_device *phydev, u8 *data)
{}
EXPORT_SYMBOL_GPL();

/* Caller is supposed to provide appropriate storage for the library code to
 * access the shadow copy
 */
static u64 bcm_phy_get_stat(struct phy_device *phydev, u64 *shadow,
			    unsigned int i)
{}

void bcm_phy_get_stats(struct phy_device *phydev, u64 *shadow,
		       struct ethtool_stats *stats, u64 *data)
{}
EXPORT_SYMBOL_GPL();

void bcm_phy_r_rc_cal_reset(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_28nm_a0b0_afe_config_init(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_enable_jumbo(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

static int __bcm_phy_enable_rdb_access(struct phy_device *phydev)
{}

static int __bcm_phy_enable_legacy_access(struct phy_device *phydev)
{}

static int _bcm_phy_cable_test_start(struct phy_device *phydev, bool is_rdb)
{}

static int bcm_phy_cable_test_report_trans(int result)
{}

static bool bcm_phy_distance_valid(int result)
{}

static int bcm_phy_report_length(struct phy_device *phydev, int pair)
{}

static int _bcm_phy_cable_test_get_status(struct phy_device *phydev,
					  bool *finished, bool is_rdb)
{}

static int bcm_setup_lre_forced(struct phy_device *phydev)
{}

/**
 * bcm_linkmode_adv_to_lre_adv_t - translate linkmode advertisement to LDS
 * @advertising: the linkmode advertisement settings
 * Return: LDS Auto-Negotiation Advertised Ability register value
 *
 * A small helper function that translates linkmode advertisement
 * settings to phy LDS autonegotiation advertisements for the
 * MII_BCM54XX_LREANAA register of Broadcom PHYs capable of LDS
 */
static u32 bcm_linkmode_adv_to_lre_adv_t(unsigned long *advertising)
{}

int bcm_phy_cable_test_start(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_cable_test_get_status(struct phy_device *phydev, bool *finished)
{}
EXPORT_SYMBOL_GPL();

/* We assume that all PHYs which support RDB access can be switched to legacy
 * mode. If, in the future, this is not true anymore, we have to re-implement
 * this with RDB access.
 */
int bcm_phy_cable_test_start_rdb(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_cable_test_get_status_rdb(struct phy_device *phydev,
				      bool *finished)
{}
EXPORT_SYMBOL_GPL();

#define BCM54XX_WOL_SUPPORTED_MASK

int bcm_phy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol)
{}
EXPORT_SYMBOL_GPL();

void bcm_phy_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol)
{}
EXPORT_SYMBOL_GPL();

irqreturn_t bcm_phy_wol_isr(int irq, void *dev_id)
{}
EXPORT_SYMBOL_GPL();

int bcm_phy_led_brightness_set(struct phy_device *phydev,
			       u8 index, enum led_brightness value)
{}
EXPORT_SYMBOL_GPL();

int bcm_setup_lre_master_slave(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

int bcm_config_lre_aneg(struct phy_device *phydev, bool changed)
{}
EXPORT_SYMBOL_GPL();

/**
 * bcm_config_lre_advert - sanitize and advertise Long-Distance Signaling
 *  auto-negotiation parameters
 * @phydev: target phy_device struct
 * Return:  0 if the PHY's advertisement hasn't changed, < 0 on error,
 *          > 0 if it has changed
 *
 * Writes MII_BCM54XX_LREANAA with the appropriate values. The values are to be
 *   sanitized before, to make sure we only advertise what is supported.
 *  The sanitization is done already in phy_ethtool_ksettings_set()
 */
int bcm_config_lre_advert(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_AUTHOR();