linux/drivers/net/phy/vitesse.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for Vitesse PHYs
 *
 * Author: Kriston Carson
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/phy.h>

/* Vitesse Extended Page Magic Register(s) */
#define MII_VSC82X4_EXT_PAGE_16E
#define MII_VSC82X4_EXT_PAGE_17E
#define MII_VSC82X4_EXT_PAGE_18E

/* Vitesse Extended Control Register 1 */
#define MII_VSC8244_EXT_CON1
#define MII_VSC8244_EXTCON1_INIT
#define MII_VSC8244_EXTCON1_TX_SKEW_MASK
#define MII_VSC8244_EXTCON1_RX_SKEW_MASK
#define MII_VSC8244_EXTCON1_TX_SKEW
#define MII_VSC8244_EXTCON1_RX_SKEW

/* Vitesse Interrupt Mask Register */
#define MII_VSC8244_IMASK
#define MII_VSC8244_IMASK_IEN
#define MII_VSC8244_IMASK_SPEED
#define MII_VSC8244_IMASK_LINK
#define MII_VSC8244_IMASK_DUPLEX
#define MII_VSC8244_IMASK_MASK

#define MII_VSC8221_IMASK_MASK

/* Vitesse Interrupt Status Register */
#define MII_VSC8244_ISTAT
#define MII_VSC8244_ISTAT_STATUS
#define MII_VSC8244_ISTAT_SPEED
#define MII_VSC8244_ISTAT_LINK
#define MII_VSC8244_ISTAT_DUPLEX
#define MII_VSC8244_ISTAT_MASK

#define MII_VSC8221_ISTAT_MASK

/* Vitesse Auxiliary Control/Status Register */
#define MII_VSC8244_AUX_CONSTAT
#define MII_VSC8244_AUXCONSTAT_INIT
#define MII_VSC8244_AUXCONSTAT_DUPLEX
#define MII_VSC8244_AUXCONSTAT_SPEED
#define MII_VSC8244_AUXCONSTAT_GBIT
#define MII_VSC8244_AUXCONSTAT_100

#define MII_VSC8221_AUXCONSTAT_INIT
#define MII_VSC8221_AUXCONSTAT_RESERVED

/* Vitesse Extended Page Access Register */
#define MII_VSC82X4_EXT_PAGE_ACCESS

/* Vitesse VSC8601 Extended PHY Control Register 1 */
#define MII_VSC8601_EPHY_CTL
#define MII_VSC8601_EPHY_CTL_RGMII_SKEW

#define PHY_ID_VSC8234
#define PHY_ID_VSC8244
#define PHY_ID_VSC8572
#define PHY_ID_VSC8601
#define PHY_ID_VSC7385
#define PHY_ID_VSC7388
#define PHY_ID_VSC7395
#define PHY_ID_VSC7398
#define PHY_ID_VSC8662
#define PHY_ID_VSC8221
#define PHY_ID_VSC8211

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

static int vsc824x_add_skew(struct phy_device *phydev)
{}

static int vsc824x_config_init(struct phy_device *phydev)
{}

#define VSC73XX_EXT_PAGE_ACCESS

static int vsc73xx_read_page(struct phy_device *phydev)
{}

static int vsc73xx_write_page(struct phy_device *phydev, int page)
{}

static void vsc73xx_config_init(struct phy_device *phydev)
{}

static int vsc738x_config_init(struct phy_device *phydev)
{}

static int vsc739x_config_init(struct phy_device *phydev)
{}

static int vsc73xx_config_aneg(struct phy_device *phydev)
{}

/* This adds a skew for both TX and RX clocks, so the skew should only be
 * applied to "rgmii-id" interfaces. It may not work as expected
 * on "rgmii-txid", "rgmii-rxid" or "rgmii" interfaces.
 */
static int vsc8601_add_skew(struct phy_device *phydev)
{}

static int vsc8601_config_init(struct phy_device *phydev)
{}

static int vsc82xx_config_intr(struct phy_device *phydev)
{}

static irqreturn_t vsc82xx_handle_interrupt(struct phy_device *phydev)
{}

static int vsc8221_config_init(struct phy_device *phydev)
{}

/* vsc82x4_config_autocross_enable - Enable auto MDI/MDI-X for forced links
 * @phydev: target phy_device struct
 *
 * Enable auto MDI/MDI-X when in 10/100 forced link speeds by writing
 * special values in the VSC8234/VSC8244 extended reserved registers
 */
static int vsc82x4_config_autocross_enable(struct phy_device *phydev)
{}

/* vsc82x4_config_aneg - restart auto-negotiation or write BMCR
 * @phydev: target phy_device struct
 *
 * Description: If auto-negotiation is enabled, we configure the
 *   advertising, and then restart auto-negotiation.  If it is not
 *   enabled, then we write the BMCR and also start the auto
 *   MDI/MDI-X feature
 */
static int vsc82x4_config_aneg(struct phy_device *phydev)
{}

/* Vitesse 82xx */
static struct phy_driver vsc82xx_driver[] =;

module_phy_driver(vsc82xx_driver);

static struct mdio_device_id __maybe_unused vitesse_tbl[] =;

MODULE_DEVICE_TABLE(mdio, vitesse_tbl);