#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/errno.h>
#include <linux/unistd.h>
#include <linux/hwmon.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/ethtool_netlink.h>
#include <linux/phy.h>
#include <linux/marvell_phy.h>
#include <linux/bitfield.h>
#include <linux/of.h>
#include <linux/sfp.h>
#include <linux/io.h>
#include <asm/irq.h>
#include <linux/uaccess.h>
#define MII_MARVELL_PHY_PAGE …
#define MII_MARVELL_COPPER_PAGE …
#define MII_MARVELL_FIBER_PAGE …
#define MII_MARVELL_MSCR_PAGE …
#define MII_MARVELL_LED_PAGE …
#define MII_MARVELL_VCT5_PAGE …
#define MII_MARVELL_MISC_TEST_PAGE …
#define MII_MARVELL_VCT7_PAGE …
#define MII_MARVELL_WOL_PAGE …
#define MII_MARVELL_MODE_PAGE …
#define MII_M1011_IEVENT …
#define MII_M1011_IEVENT_CLEAR …
#define MII_M1011_IMASK …
#define MII_M1011_IMASK_INIT …
#define MII_M1011_IMASK_CLEAR …
#define MII_M1011_PHY_SCR …
#define MII_M1011_PHY_SCR_DOWNSHIFT_EN …
#define MII_M1011_PHY_SCR_DOWNSHIFT_MASK …
#define MII_M1011_PHY_SCR_DOWNSHIFT_MAX …
#define MII_M1011_PHY_SCR_MDI …
#define MII_M1011_PHY_SCR_MDI_X …
#define MII_M1011_PHY_SCR_AUTO_CROSS …
#define MII_M1011_PHY_SSR …
#define MII_M1011_PHY_SSR_DOWNSHIFT …
#define MII_M1111_PHY_LED_CONTROL …
#define MII_M1111_PHY_LED_DIRECT …
#define MII_M1111_PHY_LED_COMBINE …
#define MII_M1111_PHY_EXT_CR …
#define MII_M1111_PHY_EXT_CR_DOWNSHIFT_MASK …
#define MII_M1111_PHY_EXT_CR_DOWNSHIFT_MAX …
#define MII_M1111_PHY_EXT_CR_DOWNSHIFT_EN …
#define MII_M1111_RGMII_RX_DELAY …
#define MII_M1111_RGMII_TX_DELAY …
#define MII_M1111_PHY_EXT_SR …
#define MII_M1111_HWCFG_MODE_MASK …
#define MII_M1111_HWCFG_MODE_FIBER_RGMII …
#define MII_M1111_HWCFG_MODE_SGMII_NO_CLK …
#define MII_M1111_HWCFG_MODE_RTBI …
#define MII_M1111_HWCFG_MODE_COPPER_1000X_AN …
#define MII_M1111_HWCFG_MODE_COPPER_RTBI …
#define MII_M1111_HWCFG_MODE_COPPER_RGMII …
#define MII_M1111_HWCFG_MODE_COPPER_1000X_NOAN …
#define MII_M1111_HWCFG_SERIAL_AN_BYPASS …
#define MII_M1111_HWCFG_FIBER_COPPER_RES …
#define MII_M1111_HWCFG_FIBER_COPPER_AUTO …
#define MII_88E1121_PHY_MSCR_REG …
#define MII_88E1121_PHY_MSCR_RX_DELAY …
#define MII_88E1121_PHY_MSCR_TX_DELAY …
#define MII_88E1121_PHY_MSCR_DELAY_MASK …
#define MII_88E1121_MISC_TEST …
#define MII_88E1510_MISC_TEST_TEMP_THRESHOLD_MASK …
#define MII_88E1510_MISC_TEST_TEMP_THRESHOLD_SHIFT …
#define MII_88E1510_MISC_TEST_TEMP_IRQ_EN …
#define MII_88E1510_MISC_TEST_TEMP_IRQ …
#define MII_88E1121_MISC_TEST_TEMP_SENSOR_EN …
#define MII_88E1121_MISC_TEST_TEMP_MASK …
#define MII_88E1510_TEMP_SENSOR …
#define MII_88E1510_TEMP_SENSOR_MASK …
#define MII_88E1540_COPPER_CTRL3 …
#define MII_88E1540_COPPER_CTRL3_LINK_DOWN_DELAY_MASK …
#define MII_88E1540_COPPER_CTRL3_LINK_DOWN_DELAY_00MS …
#define MII_88E1540_COPPER_CTRL3_LINK_DOWN_DELAY_10MS …
#define MII_88E1540_COPPER_CTRL3_LINK_DOWN_DELAY_20MS …
#define MII_88E1540_COPPER_CTRL3_LINK_DOWN_DELAY_40MS …
#define MII_88E1540_COPPER_CTRL3_FAST_LINK_DOWN …
#define MII_88E6390_MISC_TEST …
#define MII_88E6390_MISC_TEST_TEMP_SENSOR_ENABLE_SAMPLE_1S …
#define MII_88E6390_MISC_TEST_TEMP_SENSOR_ENABLE …
#define MII_88E6390_MISC_TEST_TEMP_SENSOR_ENABLE_ONESHOT …
#define MII_88E6390_MISC_TEST_TEMP_SENSOR_DISABLE …
#define MII_88E6390_MISC_TEST_TEMP_SENSOR_MASK …
#define MII_88E6393_MISC_TEST_SAMPLES_2048 …
#define MII_88E6393_MISC_TEST_SAMPLES_4096 …
#define MII_88E6393_MISC_TEST_SAMPLES_8192 …
#define MII_88E6393_MISC_TEST_SAMPLES_16384 …
#define MII_88E6393_MISC_TEST_SAMPLES_MASK …
#define MII_88E6393_MISC_TEST_RATE_2_3MS …
#define MII_88E6393_MISC_TEST_RATE_6_4MS …
#define MII_88E6393_MISC_TEST_RATE_11_9MS …
#define MII_88E6393_MISC_TEST_RATE_MASK …
#define MII_88E6390_TEMP_SENSOR …
#define MII_88E6393_TEMP_SENSOR_THRESHOLD_MASK …
#define MII_88E6393_TEMP_SENSOR_THRESHOLD_SHIFT …
#define MII_88E6390_TEMP_SENSOR_MASK …
#define MII_88E6390_TEMP_SENSOR_SAMPLES …
#define MII_88E1318S_PHY_MSCR1_REG …
#define MII_88E1318S_PHY_MSCR1_PAD_ODD …
#define MII_88E1318S_PHY_CSIER …
#define MII_88E1318S_PHY_CSIER_WOL_EIE …
#define MII_88E1318S_PHY_LED_FUNC …
#define MII_88E1318S_PHY_LED_FUNC_OFF …
#define MII_88E1318S_PHY_LED_FUNC_ON …
#define MII_88E1318S_PHY_LED_FUNC_HI_Z …
#define MII_88E1318S_PHY_LED_FUNC_BLINK …
#define MII_88E1318S_PHY_LED_TCR …
#define MII_88E1318S_PHY_LED_TCR_FORCE_INT …
#define MII_88E1318S_PHY_LED_TCR_INTn_ENABLE …
#define MII_88E1318S_PHY_LED_TCR_INT_ACTIVE_LOW …
#define MII_88E1318S_PHY_MAGIC_PACKET_WORD2 …
#define MII_88E1318S_PHY_MAGIC_PACKET_WORD1 …
#define MII_88E1318S_PHY_MAGIC_PACKET_WORD0 …
#define MII_88E1318S_PHY_WOL_CTRL …
#define MII_88E1318S_PHY_WOL_CTRL_CLEAR_WOL_STATUS …
#define MII_88E1318S_PHY_WOL_CTRL_LINK_UP_ENABLE …
#define MII_88E1318S_PHY_WOL_CTRL_MAGIC_PACKET_MATCH_ENABLE …
#define MII_PHY_LED_CTRL …
#define MII_88E1121_PHY_LED_DEF …
#define MII_88E1510_PHY_LED_DEF …
#define MII_88E1510_PHY_LED0_LINK_LED1_ACTIVE …
#define MII_M1011_PHY_STATUS …
#define MII_M1011_PHY_STATUS_1000 …
#define MII_M1011_PHY_STATUS_100 …
#define MII_M1011_PHY_STATUS_SPD_MASK …
#define MII_M1011_PHY_STATUS_FULLDUPLEX …
#define MII_M1011_PHY_STATUS_RESOLVED …
#define MII_M1011_PHY_STATUS_LINK …
#define MII_88E3016_PHY_SPEC_CTRL …
#define MII_88E3016_DISABLE_SCRAMBLER …
#define MII_88E3016_AUTO_MDIX_CROSSOVER …
#define MII_88E1510_GEN_CTRL_REG_1 …
#define MII_88E1510_GEN_CTRL_REG_1_MODE_MASK …
#define MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII …
#define MII_88E1510_GEN_CTRL_REG_1_MODE_SGMII …
#define MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII_1000X …
#define MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII_100FX …
#define MII_88E1510_GEN_CTRL_REG_1_MODE_RGMII_SGMII …
#define MII_88E1510_GEN_CTRL_REG_1_RESET …
#define MII_88E1510_MSCR_2 …
#define MII_VCT5_TX_RX_MDI0_COUPLING …
#define MII_VCT5_TX_RX_MDI1_COUPLING …
#define MII_VCT5_TX_RX_MDI2_COUPLING …
#define MII_VCT5_TX_RX_MDI3_COUPLING …
#define MII_VCT5_TX_RX_AMPLITUDE_MASK …
#define MII_VCT5_TX_RX_AMPLITUDE_SHIFT …
#define MII_VCT5_TX_RX_COUPLING_POSITIVE_REFLECTION …
#define MII_VCT5_CTRL …
#define MII_VCT5_CTRL_ENABLE …
#define MII_VCT5_CTRL_COMPLETE …
#define MII_VCT5_CTRL_TX_SAME_CHANNEL …
#define MII_VCT5_CTRL_TX0_CHANNEL …
#define MII_VCT5_CTRL_TX1_CHANNEL …
#define MII_VCT5_CTRL_TX2_CHANNEL …
#define MII_VCT5_CTRL_TX3_CHANNEL …
#define MII_VCT5_CTRL_SAMPLES_2 …
#define MII_VCT5_CTRL_SAMPLES_4 …
#define MII_VCT5_CTRL_SAMPLES_8 …
#define MII_VCT5_CTRL_SAMPLES_16 …
#define MII_VCT5_CTRL_SAMPLES_32 …
#define MII_VCT5_CTRL_SAMPLES_64 …
#define MII_VCT5_CTRL_SAMPLES_128 …
#define MII_VCT5_CTRL_SAMPLES_DEFAULT …
#define MII_VCT5_CTRL_SAMPLES_256 …
#define MII_VCT5_CTRL_SAMPLES_SHIFT …
#define MII_VCT5_CTRL_MODE_MAXIMUM_PEEK …
#define MII_VCT5_CTRL_MODE_FIRST_LAST_PEEK …
#define MII_VCT5_CTRL_MODE_OFFSET …
#define MII_VCT5_CTRL_SAMPLE_POINT …
#define MII_VCT5_CTRL_PEEK_HYST_DEFAULT …
#define MII_VCT5_SAMPLE_POINT_DISTANCE …
#define MII_VCT5_SAMPLE_POINT_DISTANCE_MAX …
#define MII_VCT5_TX_PULSE_CTRL …
#define MII_VCT5_TX_PULSE_CTRL_DONT_WAIT_LINK_DOWN …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_WIDTH_128nS …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_WIDTH_96nS …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_WIDTH_64nS …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_WIDTH_32nS …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_WIDTH_SHIFT …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_AMPLITUDE_1000mV …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_AMPLITUDE_750mV …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_AMPLITUDE_500mV …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_AMPLITUDE_250mV …
#define MII_VCT5_TX_PULSE_CTRL_PULSE_AMPLITUDE_SHIFT …
#define MII_VCT5_TX_PULSE_CTRL_MAX_AMP …
#define MII_VCT5_TX_PULSE_CTRL_GT_140m_46_86mV …
#define TDR_SHORT_CABLE_LENGTH …
#define MII_VCT7_PAIR_0_DISTANCE …
#define MII_VCT7_PAIR_1_DISTANCE …
#define MII_VCT7_PAIR_2_DISTANCE …
#define MII_VCT7_PAIR_3_DISTANCE …
#define MII_VCT7_RESULTS …
#define MII_VCT7_RESULTS_PAIR3_MASK …
#define MII_VCT7_RESULTS_PAIR2_MASK …
#define MII_VCT7_RESULTS_PAIR1_MASK …
#define MII_VCT7_RESULTS_PAIR0_MASK …
#define MII_VCT7_RESULTS_PAIR3_SHIFT …
#define MII_VCT7_RESULTS_PAIR2_SHIFT …
#define MII_VCT7_RESULTS_PAIR1_SHIFT …
#define MII_VCT7_RESULTS_PAIR0_SHIFT …
#define MII_VCT7_RESULTS_INVALID …
#define MII_VCT7_RESULTS_OK …
#define MII_VCT7_RESULTS_OPEN …
#define MII_VCT7_RESULTS_SAME_SHORT …
#define MII_VCT7_RESULTS_CROSS_SHORT …
#define MII_VCT7_RESULTS_BUSY …
#define MII_VCT7_CTRL …
#define MII_VCT7_CTRL_RUN_NOW …
#define MII_VCT7_CTRL_RUN_ANEG …
#define MII_VCT7_CTRL_DISABLE_CROSS …
#define MII_VCT7_CTRL_RUN_AFTER_BREAK_LINK …
#define MII_VCT7_CTRL_IN_PROGRESS …
#define MII_VCT7_CTRL_METERS …
#define MII_VCT7_CTRL_CENTIMETERS …
#define MII_VCT_TXPINS …
#define MII_VCT_RXPINS …
#define MII_VCT_SR …
#define MII_VCT_TXPINS_ENVCT …
#define MII_VCT_TXRXPINS_VCTTST …
#define MII_VCT_TXRXPINS_VCTTST_SHIFT …
#define MII_VCT_TXRXPINS_VCTTST_OK …
#define MII_VCT_TXRXPINS_VCTTST_SHORT …
#define MII_VCT_TXRXPINS_VCTTST_OPEN …
#define MII_VCT_TXRXPINS_VCTTST_FAIL …
#define MII_VCT_TXRXPINS_AMPRFLN …
#define MII_VCT_TXRXPINS_AMPRFLN_SHIFT …
#define MII_VCT_TXRXPINS_DISTRFLN …
#define MII_VCT_TXRXPINS_DISTRFLN_MAX …
#define M88E3082_PAIR_A …
#define M88E3082_PAIR_B …
#define LPA_PAUSE_FIBER …
#define LPA_PAUSE_ASYM_FIBER …
#define NB_FIBER_STATS …
#define NB_STAT_MAX …
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
struct marvell_hw_stat { … };
static const struct marvell_hw_stat marvell_hw_stats[] = …;
static_assert(…);
struct marvell_hw_stat_simple { … };
static const struct marvell_hw_stat_simple marvell_hw_stats_simple[] = …;
static_assert(…);
enum { … };
struct marvell_priv { … };
static int marvell_read_page(struct phy_device *phydev)
{ … }
static int marvell_write_page(struct phy_device *phydev, int page)
{ … }
static int marvell_set_page(struct phy_device *phydev, int page)
{ … }
static int marvell_ack_interrupt(struct phy_device *phydev)
{ … }
static int marvell_config_intr(struct phy_device *phydev)
{ … }
static irqreturn_t marvell_handle_interrupt(struct phy_device *phydev)
{ … }
static int marvell_set_polarity(struct phy_device *phydev, int polarity)
{ … }
static int marvell_config_aneg(struct phy_device *phydev)
{ … }
static int m88e1101_config_aneg(struct phy_device *phydev)
{ … }
#if IS_ENABLED(CONFIG_OF_MDIO)
static int marvell_of_reg_init(struct phy_device *phydev)
{ … }
#else
static int marvell_of_reg_init(struct phy_device *phydev)
{
return 0;
}
#endif
static int m88e1121_config_aneg_rgmii_delays(struct phy_device *phydev)
{ … }
static int m88e1121_config_aneg(struct phy_device *phydev)
{ … }
static int m88e1318_config_aneg(struct phy_device *phydev)
{ … }
static inline u32 linkmode_adv_to_fiber_adv_t(unsigned long *advertise)
{ … }
static int marvell_config_aneg_fiber(struct phy_device *phydev)
{ … }
static int m88e1111_config_aneg(struct phy_device *phydev)
{ … }
static int m88e1510_config_aneg(struct phy_device *phydev)
{ … }
static void marvell_config_led(struct phy_device *phydev)
{ … }
static int marvell_config_init(struct phy_device *phydev)
{ … }
static int m88e3016_config_init(struct phy_device *phydev)
{ … }
static int m88e1111_config_init_hwcfg_mode(struct phy_device *phydev,
u16 mode,
int fibre_copper_auto)
{ … }
static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev)
{ … }
static int m88e1111_config_init_rgmii(struct phy_device *phydev)
{ … }
static int m88e1111_config_init_sgmii(struct phy_device *phydev)
{ … }
static int m88e1111_config_init_rtbi(struct phy_device *phydev)
{ … }
static int m88e1111_config_init_1000basex(struct phy_device *phydev)
{ … }
static int m88e1111_config_init(struct phy_device *phydev)
{ … }
static int m88e1111_get_downshift(struct phy_device *phydev, u8 *data)
{ … }
static int m88e1111_set_downshift(struct phy_device *phydev, u8 cnt)
{ … }
static int m88e1111_get_tunable(struct phy_device *phydev,
struct ethtool_tunable *tuna, void *data)
{ … }
static int m88e1111_set_tunable(struct phy_device *phydev,
struct ethtool_tunable *tuna, const void *data)
{ … }
static int m88e1011_get_downshift(struct phy_device *phydev, u8 *data)
{ … }
static int m88e1011_set_downshift(struct phy_device *phydev, u8 cnt)
{ … }
static int m88e1011_get_tunable(struct phy_device *phydev,
struct ethtool_tunable *tuna, void *data)
{ … }
static int m88e1011_set_tunable(struct phy_device *phydev,
struct ethtool_tunable *tuna, const void *data)
{ … }
static int m88e1112_config_init(struct phy_device *phydev)
{ … }
static int m88e1111gbe_config_init(struct phy_device *phydev)
{ … }
static int marvell_1011gbe_config_init(struct phy_device *phydev)
{ … }
static int m88e1116r_config_init(struct phy_device *phydev)
{ … }
static int m88e1318_config_init(struct phy_device *phydev)
{ … }
static int m88e1510_config_init(struct phy_device *phydev)
{ … }
static int m88e1118_config_aneg(struct phy_device *phydev)
{ … }
static int m88e1118_config_init(struct phy_device *phydev)
{ … }
static int m88e1149_config_init(struct phy_device *phydev)
{ … }
static int m88e1145_config_init_rgmii(struct phy_device *phydev)
{ … }
static int m88e1145_config_init_sgmii(struct phy_device *phydev)
{ … }
static int m88e1145_config_init(struct phy_device *phydev)
{ … }
static int m88e1540_get_fld(struct phy_device *phydev, u8 *msecs)
{ … }
static int m88e1540_set_fld(struct phy_device *phydev, const u8 *msecs)
{ … }
static int m88e1540_get_tunable(struct phy_device *phydev,
struct ethtool_tunable *tuna, void *data)
{ … }
static int m88e1540_set_tunable(struct phy_device *phydev,
struct ethtool_tunable *tuna, const void *data)
{ … }
static int m88e6390_errata(struct phy_device *phydev)
{ … }
static int m88e6390_config_aneg(struct phy_device *phydev)
{ … }
static void fiber_lpa_mod_linkmode_lpa_t(unsigned long *advertising, u32 lpa)
{ … }
static int marvell_read_status_page_an(struct phy_device *phydev,
int fiber, int status)
{ … }
static int marvell_read_status_page(struct phy_device *phydev, int page)
{ … }
static int marvell_read_status(struct phy_device *phydev)
{ … }
static int marvell_suspend(struct phy_device *phydev)
{ … }
static int marvell_resume(struct phy_device *phydev)
{ … }
static int marvell_aneg_done(struct phy_device *phydev)
{ … }
static void m88e1318_get_wol(struct phy_device *phydev,
struct ethtool_wolinfo *wol)
{ … }
static int m88e1318_set_wol(struct phy_device *phydev,
struct ethtool_wolinfo *wol)
{ … }
static int marvell_get_sset_count(struct phy_device *phydev)
{ … }
static int marvell_get_sset_count_simple(struct phy_device *phydev)
{ … }
static void marvell_get_strings(struct phy_device *phydev, u8 *data)
{ … }
static void marvell_get_strings_simple(struct phy_device *phydev, u8 *data)
{ … }
static u64 marvell_get_stat(struct phy_device *phydev, int i)
{ … }
static u64 marvell_get_stat_simple(struct phy_device *phydev, int i)
{ … }
static void marvell_get_stats(struct phy_device *phydev,
struct ethtool_stats *stats, u64 *data)
{ … }
static void marvell_get_stats_simple(struct phy_device *phydev,
struct ethtool_stats *stats, u64 *data)
{ … }
static int m88e1510_loopback(struct phy_device *phydev, bool enable)
{ … }
static int marvell_vct5_wait_complete(struct phy_device *phydev)
{ … }
static int marvell_vct5_amplitude(struct phy_device *phydev, int pair)
{ … }
static u32 marvell_vct5_distance2cm(int distance)
{ … }
static u32 marvell_vct5_cm2distance(int cm)
{ … }
static int marvell_vct5_amplitude_distance(struct phy_device *phydev,
int distance, int pair)
{ … }
static int marvell_vct5_amplitude_graph(struct phy_device *phydev)
{ … }
static int marvell_cable_test_start_common(struct phy_device *phydev)
{ … }
static int marvell_vct7_cable_test_start(struct phy_device *phydev)
{ … }
static int marvell_vct5_cable_test_tdr_start(struct phy_device *phydev,
const struct phy_tdr_config *cfg)
{ … }
static int marvell_vct7_distance_to_length(int distance, bool meter)
{ … }
static bool marvell_vct7_distance_valid(int result)
{ … }
static int marvell_vct7_report_length(struct phy_device *phydev,
int pair, bool meter)
{ … }
static int marvell_vct7_cable_test_report_trans(int result)
{ … }
static int marvell_vct7_cable_test_report(struct phy_device *phydev)
{ … }
static int marvell_vct7_cable_test_get_status(struct phy_device *phydev,
bool *finished)
{ … }
static int m88e3082_vct_cable_test_start(struct phy_device *phydev)
{ … }
static int m88e3082_vct_cable_test_report_trans(int result, u8 distance)
{ … }
static u32 m88e3082_vct_distrfln_2_cm(u8 distrfln)
{ … }
static int m88e3082_vct_cable_test_get_status(struct phy_device *phydev,
bool *finished)
{ … }
static int m88e1111_vct_cable_test_start(struct phy_device *phydev)
{ … }
static u32 m88e1111_vct_distrfln_2_cm(u8 distrfln)
{ … }
static int m88e1111_vct_cable_test_get_status(struct phy_device *phydev,
bool *finished)
{ … }
#ifdef CONFIG_HWMON
struct marvell_hwmon_ops { … };
static const struct marvell_hwmon_ops *
to_marvell_hwmon_ops(const struct phy_device *phydev)
{ … }
static int m88e1121_get_temp(struct phy_device *phydev, long *temp)
{ … }
static int m88e1510_get_temp(struct phy_device *phydev, long *temp)
{ … }
static int m88e1510_get_temp_critical(struct phy_device *phydev, long *temp)
{ … }
static int m88e1510_set_temp_critical(struct phy_device *phydev, long temp)
{ … }
static int m88e1510_get_temp_alarm(struct phy_device *phydev, long *alarm)
{ … }
static int m88e6390_get_temp(struct phy_device *phydev, long *temp)
{ … }
static int m88e6393_get_temp(struct phy_device *phydev, long *temp)
{ … }
static int m88e6393_get_temp_critical(struct phy_device *phydev, long *temp)
{ … }
static int m88e6393_set_temp_critical(struct phy_device *phydev, long temp)
{ … }
static int m88e6393_hwmon_config(struct phy_device *phydev)
{ … }
static int marvell_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *temp)
{ … }
static int marvell_hwmon_write(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long temp)
{ … }
static umode_t marvell_hwmon_is_visible(const void *data,
enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static u32 marvell_hwmon_chip_config[] = …;
static const struct hwmon_channel_info marvell_hwmon_chip = …;
static u32 marvell_hwmon_temp_config[] = …;
static const struct hwmon_channel_info marvell_hwmon_temp = …;
static const struct hwmon_channel_info * const marvell_hwmon_info[] = …;
static const struct hwmon_ops marvell_hwmon_hwmon_ops = …;
static const struct hwmon_chip_info marvell_hwmon_chip_info = …;
static int marvell_hwmon_name(struct phy_device *phydev)
{ … }
static int marvell_hwmon_probe(struct phy_device *phydev)
{ … }
static const struct marvell_hwmon_ops m88e1121_hwmon_ops = …;
static const struct marvell_hwmon_ops m88e1510_hwmon_ops = …;
static const struct marvell_hwmon_ops m88e6390_hwmon_ops = …;
static const struct marvell_hwmon_ops m88e6393_hwmon_ops = …;
#define DEF_MARVELL_HWMON_OPS(s) …
#else
#define DEF_MARVELL_HWMON_OPS …
static int marvell_hwmon_probe(struct phy_device *phydev)
{
return 0;
}
#endif
static int m88e1318_led_brightness_set(struct phy_device *phydev,
u8 index, enum led_brightness value)
{ … }
static int m88e1318_led_blink_set(struct phy_device *phydev, u8 index,
unsigned long *delay_on,
unsigned long *delay_off)
{ … }
struct marvell_led_rules { … };
static const struct marvell_led_rules marvell_led0[] = …;
static const struct marvell_led_rules marvell_led1[] = …;
static const struct marvell_led_rules marvell_led2[] = …;
static int marvell_find_led_mode(unsigned long rules,
const struct marvell_led_rules *marvell_rules,
int count,
int *mode)
{ … }
static int marvell_get_led_mode(u8 index, unsigned long rules, int *mode)
{ … }
static int marvell_find_led_rules(unsigned long *rules,
const struct marvell_led_rules *marvell_rules,
int count,
int mode)
{ … }
static int marvell_get_led_rules(u8 index, unsigned long *rules, int mode)
{ … }
static int m88e1318_led_hw_is_supported(struct phy_device *phydev, u8 index,
unsigned long rules)
{ … }
static int m88e1318_led_hw_control_set(struct phy_device *phydev, u8 index,
unsigned long rules)
{ … }
static int m88e1318_led_hw_control_get(struct phy_device *phydev, u8 index,
unsigned long *rules)
{ … }
static int marvell_probe(struct phy_device *phydev)
{ … }
static int m88e1510_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
{ … }
static void m88e1510_sfp_remove(void *upstream)
{ … }
static const struct sfp_upstream_ops m88e1510_sfp_ops = …;
static int m88e1510_probe(struct phy_device *phydev)
{ … }
static struct phy_driver marvell_drivers[] = …;
module_phy_driver(marvell_drivers);
static struct mdio_device_id __maybe_unused marvell_tbl[] = …;
MODULE_DEVICE_TABLE(mdio, marvell_tbl);