linux/drivers/net/ethernet/chelsio/cxgb3/vsc8211.c

/*
 * Copyright (c) 2005-2008 Chelsio, Inc. All rights reserved.
 *
 * This software is available to you under a choice of one of two
 * licenses.  You may choose to be licensed under the terms of the GNU
 * General Public License (GPL) Version 2, available from the file
 * COPYING in the main directory of this source tree, or the
 * OpenIB.org BSD license below:
 *
 *     Redistribution and use in source and binary forms, with or
 *     without modification, are permitted provided that the following
 *     conditions are met:
 *
 *      - Redistributions of source code must retain the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer.
 *
 *      - Redistributions in binary form must reproduce the above
 *        copyright notice, this list of conditions and the following
 *        disclaimer in the documentation and/or other materials
 *        provided with the distribution.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
#include "common.h"

/* VSC8211 PHY specific registers. */
enum {};

enum {};

enum {};

#define CFG_CHG_INTR_MASK
#define INTR_MASK

/* PHY specific auxiliary control & status register fields */
#define S_ACSR_ACTIPHY_TMR
#define M_ACSR_ACTIPHY_TMR
#define V_ACSR_ACTIPHY_TMR(x)

#define S_ACSR_SPEED
#define M_ACSR_SPEED
#define G_ACSR_SPEED(x)

#define S_ACSR_DUPLEX
#define F_ACSR_DUPLEX

#define S_ACSR_ACTIPHY
#define F_ACSR_ACTIPHY

/*
 * Reset the PHY.  This PHY completes reset immediately so we never wait.
 */
static int vsc8211_reset(struct cphy *cphy, int wait)
{}

static int vsc8211_intr_enable(struct cphy *cphy)
{}

static int vsc8211_intr_disable(struct cphy *cphy)
{}

static int vsc8211_intr_clear(struct cphy *cphy)
{}

static int vsc8211_autoneg_enable(struct cphy *cphy)
{}

static int vsc8211_autoneg_restart(struct cphy *cphy)
{}

static int vsc8211_get_link_status(struct cphy *cphy, int *link_ok,
				   int *speed, int *duplex, int *fc)
{}

static int vsc8211_get_link_status_fiber(struct cphy *cphy, int *link_ok,
					 int *speed, int *duplex, int *fc)
{}

#ifdef UNUSED
/*
 * Enable/disable auto MDI/MDI-X in forced link speed mode.
 */
static int vsc8211_set_automdi(struct cphy *phy, int enable)
{
	int err;

	err = t3_mdio_write(phy, MDIO_DEVAD_NONE, VSC8211_EXT_PAGE_AXS, 0x52b5);
	if (err)
		return err;

	err = t3_mdio_write(phy, MDIO_DEVAD_NONE, 18, 0x12);
	if (err)
		return err;

	err = t3_mdio_write(phy, MDIO_DEVAD_NONE, 17, enable ? 0x2803 : 0x3003);
	if (err)
		return err;

	err = t3_mdio_write(phy, MDIO_DEVAD_NONE, 16, 0x87fa);
	if (err)
		return err;

	err = t3_mdio_write(phy, MDIO_DEVAD_NONE, VSC8211_EXT_PAGE_AXS, 0);
	if (err)
		return err;

	return 0;
}

int vsc8211_set_speed_duplex(struct cphy *phy, int speed, int duplex)
{
	int err;

	err = t3_set_phy_speed_duplex(phy, speed, duplex);
	if (!err)
		err = vsc8211_set_automdi(phy, 1);
	return err;
}
#endif /* UNUSED */

static int vsc8211_power_down(struct cphy *cphy, int enable)
{}

static int vsc8211_intr_handler(struct cphy *cphy)
{}

static const struct cphy_ops vsc8211_ops =;

static const struct cphy_ops vsc8211_fiber_ops =;

int t3_vsc8211_phy_prep(struct cphy *phy, struct adapter *adapter,
			int phy_addr, const struct mdio_ops *mdio_ops)
{}