/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <hxge_impl.h>
#include <hpi_vmac.h>
{
return (HPI_SUCCESS);
}
{
return (HPI_SUCCESS);
}
{
if (config == 0) {
" hpi_vmac_tx_config Invalid Input: config <0x%x>",
config));
return (HPI_FAILURE);
}
switch (op) {
case ENABLE:
if (config & CFG_VMAC_TX_EN)
if (config & CFG_VMAC_TX_CRC_INSERT)
if (config & CFG_VMAC_TX_PAD)
if (max_frame_length)
break;
case DISABLE:
if (config & CFG_VMAC_TX_EN)
if (config & CFG_VMAC_TX_CRC_INSERT)
if (config & CFG_VMAC_TX_PAD)
break;
case INIT:
if (config & CFG_VMAC_TX_EN)
else
if (config & CFG_VMAC_TX_CRC_INSERT)
else
if (config & CFG_VMAC_TX_PAD)
else
if (max_frame_length)
break;
default:
" hpi_vmac_tx_config Invalid Input: op <0x%x>", op));
return (HPI_FAILURE);
}
return (HPI_SUCCESS);
}
{
/*
* HW team not sure setting framesize to 0 is problematic
* or not.
*/
if (max_frame_length == 0)
fsize = 1;
else
return (HPI_SUCCESS);
}
{
if (config == 0) {
" hpi_vmac_rx_config Invalid Input: config <0x%x>",
config));
return (HPI_FAILURE);
}
switch (op) {
case ENABLE:
if (config & CFG_VMAC_RX_EN)
if (config & CFG_VMAC_RX_STRIP_CRC)
if (config & CFG_VMAC_RX_LOOP_BACK)
break;
case DISABLE:
if (config & CFG_VMAC_RX_EN)
if (config & CFG_VMAC_RX_STRIP_CRC)
if (config & CFG_VMAC_RX_LOOP_BACK)
break;
case INIT:
if (config & CFG_VMAC_RX_EN)
else
else
if (config & CFG_VMAC_RX_STRIP_CRC)
else
else
else
else
if (config & CFG_VMAC_RX_LOOP_BACK)
else
break;
default:
" hpi_vmac_rx_config Invalid Input: op <0x%x>", op));
return (HPI_FAILURE);
}
if (max_frame_length)
return (HPI_SUCCESS);
}
{
return (HPI_SUCCESS);
}
{
return (HPI_SUCCESS);
}
{
if (overflow_cnt)
if (frame_cnt)
return (HPI_SUCCESS);
}
{
if (overflow_cnt)
value |= overflow_mask;
if (frame_cnt)
value |= frame_mask;
return (HPI_SUCCESS);
}