linux/drivers/net/phy/smsc.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * drivers/net/phy/smsc.c
 *
 * Driver for SMSC PHYs
 *
 * Author: Herbert Valerio Riedel
 *
 * Copyright (c) 2006 Herbert Valerio Riedel <[email protected]>
 *
 * Support added for SMSC LAN8187 and LAN8700 by [email protected]
 *
 */

#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/of.h>
#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/crc16.h>
#include <linux/etherdevice.h>
#include <linux/smscphy.h>

/* Vendor-specific PHY Definitions */
/* EDPD NLP / crossover time configuration */
#define PHY_EDPD_CONFIG
#define PHY_EDPD_CONFIG_EXT_CROSSOVER_

/* Control/Status Indication Register */
#define SPECIAL_CTRL_STS
#define SPECIAL_CTRL_STS_OVRRD_AMDIX_
#define SPECIAL_CTRL_STS_AMDIX_ENABLE_
#define SPECIAL_CTRL_STS_AMDIX_STATE_

#define EDPD_MAX_WAIT_DFLT_MS
/* interval between phylib state machine runs in ms */
#define PHY_STATE_MACH_MS

struct smsc_hw_stat {};

static struct smsc_hw_stat smsc_hw_stats[] =;

struct smsc_phy_priv {};

static int smsc_phy_ack_interrupt(struct phy_device *phydev)
{}

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

static int smsc_phy_config_edpd(struct phy_device *phydev)
{}

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

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

static int smsc_phy_reset(struct phy_device *phydev)
{}

static int lan87xx_config_aneg(struct phy_device *phydev)
{}

static int lan95xx_config_aneg_ext(struct phy_device *phydev)
{}

/*
 * The LAN87xx suffers from rare absence of the ENERGYON-bit when Ethernet cable
 * plugs in while LAN87xx is in Energy Detect Power-Down mode. This leads to
 * unstable detection of plugging in Ethernet cable.
 * This workaround disables Energy Detect Power-Down mode and waiting for
 * response on link pulses to detect presence of plugged Ethernet cable.
 * The Energy Detect Power-Down mode is enabled again in the end of procedure to
 * save approximately 220 mW of power if cable is unplugged.
 * The workaround is only applicable to poll mode. Energy Detect Power-Down may
 * not be used in interrupt mode lest link change detection becomes unreliable.
 */
int lan87xx_read_status(struct phy_device *phydev)
{}
EXPORT_SYMBOL_GPL();

static int lan874x_phy_config_init(struct phy_device *phydev)
{}

static void lan874x_get_wol(struct phy_device *phydev,
			    struct ethtool_wolinfo *wol)
{}

static u16 smsc_crc16(const u8 *buffer, size_t len)
{}

static int lan874x_chk_wol_pattern(const u8 pattern[], const u16 *mask,
				   u8 len, u8 *data, u8 *datalen)
{}

static int lan874x_set_wol_pattern(struct phy_device *phydev, u16 val,
				   const u8 data[], u8 datalen,
				   const u16 *mask, u8 masklen)
{}

static int lan874x_set_wol(struct phy_device *phydev,
			   struct ethtool_wolinfo *wol)
{}

static int smsc_get_sset_count(struct phy_device *phydev)
{}

static void smsc_get_strings(struct phy_device *phydev, u8 *data)
{}

static u64 smsc_get_stat(struct phy_device *phydev, int i)
{}

static void smsc_get_stats(struct phy_device *phydev,
			   struct ethtool_stats *stats, u64 *data)
{}

static int smsc_phy_get_edpd(struct phy_device *phydev, u16 *edpd)
{}

static int smsc_phy_set_edpd(struct phy_device *phydev, u16 edpd)
{}

int smsc_phy_get_tunable(struct phy_device *phydev,
			 struct ethtool_tunable *tuna, void *data)
{}
EXPORT_SYMBOL_GPL();

int smsc_phy_set_tunable(struct phy_device *phydev,
			 struct ethtool_tunable *tuna, const void *data)
{}
EXPORT_SYMBOL_GPL();

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

static struct phy_driver smsc_phy_driver[] =;

module_phy_driver(smsc_phy_driver);

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

static struct mdio_device_id __maybe_unused smsc_tbl[] =;

MODULE_DEVICE_TABLE(mdio, smsc_tbl);