/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <hxge_impl.h>
#include <hxge_vmac.h>
{
/*
* The driver doesn't control the link.
* It is always 10Gb full duplex.
*/
return (HXGE_OK);
}
{
goto fail;
goto fail;
goto fail;
goto fail;
/* Clear the interrupt status registers */
/*
* Take the masks off the overflow counters. Interrupt the system when
* any counts overflow. Don't interrupt the system for each frame.
* The current counts are retrieved when the "kstat" command is used.
*/
return (HXGE_OK);
fail:
"hxge_vmac_init: failed to initialize VMAC>"));
return (status);
}
/* Initialize the TxVMAC sub-block */
{
/* CFG_VMAC_TX_EN is done separately */
return (HXGE_ERROR);
return (HXGE_OK);
}
/* Initialize the RxVMAC sub-block */
{
/*
* NOTE: CFG_VMAC_RX_ENABLE is done separately. Do not enable
* strip CRC. Bug ID 11451 -- enable strip CRC will cause
* rejection on minimum sized packets.
*/
return (HXGE_ERROR);
return (HXGE_OK);
}
/* Enable TxVMAC */
{
return (rv);
/* Based on speed */
return (status);
}
/* Disable TxVMAC */
{
return (status);
}
/* Enable RxVMAC */
{
/*
* Because of hardware bug document with CR6770577, need
* vmac. Max framesize is programed here in
* hxge_rx_vmac_init().
*/
if (rv != HPI_SUCCESS) {
return (HXGE_ERROR);
}
/*
* Wait for a period of time.
*/
HXGE_DELAY(10);
/*
* Enable the vmac.
*/
return (status);
}
/* Disable RxVMAC */
{
/*
* Because of hardware bug document with CR6770577, need
* vmac. Max framesize is programed here in
* hxge_rx_vmac_init().
*/
(uint16_t)0);
/*
* Wait for 10us before doing disable.
*/
HXGE_DELAY(10);
return (status);
}
/* Reset TxVMAC */
{
(void) hpi_tx_vmac_reset(handle);
return (HXGE_OK);
}
/* Reset RxVMAC */
{
(uint16_t)0);
/*
* Wait for 10us before doing reset.
*/
HXGE_DELAY(10);
(void) hpi_rx_vmac_reset(handle);
return (HXGE_OK);
}
/*ARGSUSED*/
{
/* Clear the interrupt status registers */
(void) hpi_vmac_clear_rx_int_stat(handle);
(void) hpi_vmac_clear_tx_int_stat(handle);
return (DDI_INTR_CLAIMED);
}
/*
* Set promiscous mode
*/
{
goto fail;
goto fail;
if (on)
else
return (HXGE_OK);
fail:
"Unable to set promisc (%d)", on));
return (status);
}
void
{
}
int
{
int status = 0;
(void) hxge_rx_vmac_disable(hxgep);
(void) hxge_tx_vmac_disable(hxgep);
/*
* Apply the new jumbo parameter here which is contained in hxgep
* data structure (hxgep->vmac.maxframesize);
* The order of the following two calls is important.
*/
(void) hxge_tx_vmac_enable(hxgep);
(void) hxge_rx_vmac_enable(hxgep);
return (status);
}