/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (C) 2003-2005 Chelsio Communications. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI" /* vsc7321.c */
/* Driver for Vitesse VSC7321 (Meigs II) MAC */
#if 0
#ifndef INVARIANTS
#define INVARIANTS
#endif
#endif
#include "gmac.h"
#include "elmer0.h"
#include "vsc7321_reg.h"
struct init_table {
};
struct _cmac_instance {
};
{
do {
} while ((status & 1) == 0);
}
{
}
/* Hard reset the MAC. This wipes out *all* configuration. */
{
val &= ~1;
DELAY_US(2);
} else {
}
DELAY_US(1000);
}
{ REG_SW_RESET, 0x80000001 },
{ INITBLOCK_SLEEP, 0x64 },
{ REG_SW_RESET, 0x00000000 },
{ REG_IFACE_MODE, 0x00000000 },
{ REG_CRC_CFG, 0x00000020 },
{ REG_PLL_CLK_SPEED, 0x00000000 },
{ INITBLOCK_SLEEP, 0x0a },
{ REG_PLL_CLK_SPEED, 0x000000d4 },
{ REG_SPI4_MISC, 0x00040009 },
{ REG_SPI4_ING_SETUP2, 0x04040004 },
{ REG_SPI4_ING_SETUP1, 0x00100000 },
{ REG_AGE_INC(0), 0x00000000 },
};
{ /* Port 0 */
/* FIFO setup */
{ REG_TEST(0,0), 0x00000002 },
{ REG_TOP_BOTTOM(0,0), 0x00100000 },
{ REG_HIGH_LOW_WM(0,0), 0x0fff0fff },
{ REG_CT_THRHLD(0,0), 0x00000000 },
{ REG_TEST(0,0), 0x00000000 },
/* Port config */
{ REG_MODE_CFG(0), 0x0000054c },
{ REG_MAX_LEN(0), 0x000005ee },
{ REG_DEV_SETUP(0), 0x00000001 },
{ REG_TBI_CONFIG(0), 0x00000000 },
{ REG_DEV_SETUP(0), 0x00000046 },
{ REG_PAUSE_CFG(0), 0x00000000 },
{ REG_NORMALIZER(0), 0x00000064 },
{ REG_DENORM(0), 0x00000010 },
},
{ /* Port 1 */
/* FIFO setup */
/* Port config */
},
{ /* Port 2 */
/* FIFO setup */
/* Port config */
},
{ /* Port 3 */
/* FIFO setup */
/* Port config */
},
};
{
int i;
for (i = 0; i < len; i++) {
} else {
}
}
}
/* ARGSUSED */
{
return 0;
}
{
int i;
i = 0;
do {
DELAY_US(1);
DELAY_US(5);
return NULL;
}
return mac;
}
/* ARGSUSED */
{
return 0;
}
/* ARGSUSED */
{
return 0;
}
/* ARGSUSED */
{
return 0;
}
/* ARGSUSED */
{
/* Nothing extra needed */
return 0;
}
/* Expect MAC address to be in network byte order. */
{
return 0;
}
{
return 0;
}
/* This is intended to reset a port, not the whole MAC */
{
return 0;
}
/* ARGSUSED */
{
/* Meigs II is always promiscuous. */
return 0;
}
/* ARGSUSED */
{
return 0;
}
/* ARGSUSED */
int fc)
{
/* XXX Fixme */
return 0;
}
{
if (which & MAC_DIRECTION_RX)
val |= 0x2;
if (which & MAC_DIRECTION_TX)
val |= 1;
return 0;
}
{
if (which & MAC_DIRECTION_RX)
val &= ~0x2;
if (which & MAC_DIRECTION_TX)
val &= ~0x1;
return 0;
}
#if 0
/* TBD XXX cmac interface stats will need to assigned to Chelsio's
* mac stats. cmac stats is now just usings Chelsio's
* so we don't need the conversion.
*/
{
return 0;
}
#endif
/* ARGSUSED */
int flag)
{
}
{
}
#ifdef C99_NOT_SUPPORTED
NULL,
NULL,
NULL,
};
#else
.destroy = mac_destroy,
.enable = mac_enable,
.disable = mac_disable,
.set_mtu = mac_set_mtu,
};
#endif
0,
};