linux/drivers/net/sungem_phy.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * PHY drivers for the sungem ethernet driver.
 *
 * This file could be shared with other drivers.
 *
 * (c) 2002-2007, Benjamin Herrenscmidt ([email protected])
 *
 * TODO:
 *  - Add support for PHYs that provide an IRQ line
 *  - Eventually moved the entire polling state machine in
 *    there (out of the eth driver), so that it can easily be
 *    skipped on PHYs that implement it in hardware.
 *  - On LXT971 & BCM5201, Apple uses some chip specific regs
 *    to read the link status. Figure out why and if it makes
 *    sense to do the same (magic aneg ?)
 *  - Apple has some additional power management code for some
 *    Broadcom PHYs that they "hide" from the OpenSource version
 *    of darwin, still need to reverse engineer that
 */


#include <linux/module.h>

#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/delay.h>
#include <linux/of.h>
#include <linux/sungem_phy.h>

/* Link modes of the BCM5400 PHY */
static const int phy_BCM5400_link_table[8][3] =;

static inline int __sungem_phy_read(struct mii_phy* phy, int id, int reg)
{}

static inline void __sungem_phy_write(struct mii_phy* phy, int id, int reg, int val)
{}

static inline int sungem_phy_read(struct mii_phy* phy, int reg)
{}

static inline void sungem_phy_write(struct mii_phy* phy, int reg, int val)
{}

static int reset_one_mii_phy(struct mii_phy* phy, int phy_id)
{}

static int bcm5201_init(struct mii_phy* phy)
{}

static int bcm5201_suspend(struct mii_phy* phy)
{}

static int bcm5221_init(struct mii_phy* phy)
{}

static int bcm5221_suspend(struct mii_phy* phy)
{}

static int bcm5241_init(struct mii_phy* phy)
{}

static int bcm5241_suspend(struct mii_phy* phy)
{}

static int bcm5400_init(struct mii_phy* phy)
{}

static int bcm5400_suspend(struct mii_phy* phy)
{}

static int bcm5401_init(struct mii_phy* phy)
{}

static int bcm5401_suspend(struct mii_phy* phy)
{}

static int bcm5411_init(struct mii_phy* phy)
{}

static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise)
{}

static int genmii_setup_forced(struct mii_phy *phy, int speed, int fd)
{}

static int genmii_poll_link(struct mii_phy *phy)
{}

static int genmii_read_link(struct mii_phy *phy)
{}

static int generic_suspend(struct mii_phy* phy)
{}

static int bcm5421_init(struct mii_phy* phy)
{}

static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise)
{}

static int bcm54xx_setup_forced(struct mii_phy *phy, int speed, int fd)
{}

static int bcm54xx_read_link(struct mii_phy *phy)
{}

static int marvell88e1111_init(struct mii_phy* phy)
{}

#define BCM5421_MODE_MASK

static int bcm5421_poll_link(struct mii_phy* phy)
{}

static int bcm5421_read_link(struct mii_phy* phy)
{}

static int bcm5421_enable_fiber(struct mii_phy* phy, int autoneg)
{}

#define BCM5461_FIBER_LINK
#define BCM5461_MODE_MASK

static int bcm5461_poll_link(struct mii_phy* phy)
{}

#define BCM5461_FIBER_DUPLEX

static int bcm5461_read_link(struct mii_phy* phy)
{}

static int bcm5461_enable_fiber(struct mii_phy* phy, int autoneg)
{}

static int marvell_setup_aneg(struct mii_phy *phy, u32 advertise)
{}

static int marvell_setup_forced(struct mii_phy *phy, int speed, int fd)
{}

static int marvell_read_link(struct mii_phy *phy)
{}

#define MII_BASIC_FEATURES

/* On gigabit capable PHYs, we advertise Pause support but not asym pause
 * support for now as I'm not sure it's supported and Darwin doesn't do
 * it neither. --BenH.
 */
#define MII_GBIT_FEATURES

/* Broadcom BCM 5201 */
static const struct mii_phy_ops bcm5201_phy_ops =;

static struct mii_phy_def bcm5201_phy_def =;

/* Broadcom BCM 5221 */
static const struct mii_phy_ops bcm5221_phy_ops =;

static struct mii_phy_def bcm5221_phy_def =;

/* Broadcom BCM 5241 */
static const struct mii_phy_ops bcm5241_phy_ops =;
static struct mii_phy_def bcm5241_phy_def =;

/* Broadcom BCM 5400 */
static const struct mii_phy_ops bcm5400_phy_ops =;

static struct mii_phy_def bcm5400_phy_def =;

/* Broadcom BCM 5401 */
static const struct mii_phy_ops bcm5401_phy_ops =;

static struct mii_phy_def bcm5401_phy_def =;

/* Broadcom BCM 5411 */
static const struct mii_phy_ops bcm5411_phy_ops =;

static struct mii_phy_def bcm5411_phy_def =;

/* Broadcom BCM 5421 */
static const struct mii_phy_ops bcm5421_phy_ops =;

static struct mii_phy_def bcm5421_phy_def =;

/* Broadcom BCM 5421 built-in K2 */
static const struct mii_phy_ops bcm5421k2_phy_ops =;

static struct mii_phy_def bcm5421k2_phy_def =;

static const struct mii_phy_ops bcm5461_phy_ops =;

static struct mii_phy_def bcm5461_phy_def =;

/* Broadcom BCM 5462 built-in Vesta */
static const struct mii_phy_ops bcm5462V_phy_ops =;

static struct mii_phy_def bcm5462V_phy_def =;

/* Marvell 88E1101 amd 88E1111 */
static const struct mii_phy_ops marvell88e1101_phy_ops =;

static const struct mii_phy_ops marvell88e1111_phy_ops =;

/* two revs in darwin for the 88e1101 ... I could use a datasheet
 * to get the proper names...
 */
static struct mii_phy_def marvell88e1101v1_phy_def =;
static struct mii_phy_def marvell88e1101v2_phy_def =;
static struct mii_phy_def marvell88e1111_phy_def =;

/* Generic implementation for most 10/100 PHYs */
static const struct mii_phy_ops generic_phy_ops =;

static struct mii_phy_def genmii_phy_def =;

static struct mii_phy_def* mii_phy_table[] =;

int sungem_phy_probe(struct mii_phy *phy, int mii_id)
{}

EXPORT_SYMBOL();
MODULE_DESCRIPTION();
MODULE_LICENSE();