/*
* 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
*/
/*
*/
/*
* Tunable Receive Completion Ring Configuration B parameters.
*/
extern uint32_t nxge_rx_mode;
extern uint32_t nxge_jumbo_mtu;
extern uint16_t nxge_rdc_buf_offset;
static void
/* ARGSUSED */
{
return (status);
(void) nxge_intr_hw_disable(nxgep);
nxge_lb_phy1000) ||
nxge_lb_phy10g) ||
nxge_lb_serdes10g))) {
return (status);
}
return (status);
return (status);
(void) nxge_intr_hw_enable(nxgep);
return (status);
}
/* ARGSUSED */
void
{
/*
* Set up initial hardware parameters required such as mac mtu size.
*/
/*
* Set the maxframe size to 1522 (1518 + 4) to account for
* VLAN tagged packets.
*/
}
/* ARGSUSED */
void
{
return;
}
"nxge_hw_init_niu_common"
" already done for dip $%p function %d exiting",
return;
}
" Started for device id %x with function %d",
/* per neptune common block init */
(void) nxge_fflp_hw_reset(nxgep);
switch (nxge_rdc_buf_offset) {
case SW_OFFSET_NO_OFFSET:
case SW_OFFSET_64:
case SW_OFFSET_128:
break;
default:
"nxge_hw_init_niu_common: Unsupported RDC buffer"
" offset code %d, setting to %d",
break;
}
} else {
switch (nxge_rdc_buf_offset) {
case SW_OFFSET_NO_OFFSET:
case SW_OFFSET_64:
case SW_OFFSET_128:
case SW_OFFSET_192:
case SW_OFFSET_256:
case SW_OFFSET_320:
case SW_OFFSET_384:
case SW_OFFSET_448:
break;
default:
"nxge_hw_init_niu_common: Unsupported RDC buffer"
" offset code %d, setting to %d",
break;
}
}
" Done for device id %x with function %d",
}
/* ARGSUSED */
{
/* DDI interface returns second arg as NULL (n2 niumx driver) !!! */
}
"<== nxge_intr: not initialized 0x%x", serviced));
return (serviced);
}
}
if (ldvp) {
}
return (DDI_INTR_UNCLAIMED);
}
/*
* This interrupt handler will have to go through all the logical
* devices to find out which logical device interrupts us and then call
* its handler to process the events.
*/
/* Get this group's flag bits. */
if (rs) {
continue;
}
continue;
}
"vector0 0x%llx vector1 0x%llx vector2 0x%llx",
/*
* Call device's handler if flag bits are on.
*/
if (((ldv < NXGE_MAC_LD_START) &&
(ldv >= NXGE_MAC_LD_START &&
(void) (t_ldvp->ldv_intr_handler)(
"==> nxge_intr: "
"calling device %d #ldvs %d #intrs %d",
}
}
}
/* rearm group interrupts */
}
serviced));
return (serviced);
}
/*
* XFP Related Status Register Values Under 3 Different Conditions
*
* -------------+-------------------------+-------------------------
* | Intel XFP and Avago | Picolight XFP
* -------------+---------+---------------+---------+---------------
* | STATUS0 | TX_ALARM_STAT | STATUS0 | TX_ALARM_STAT
* -------------+---------+---------------+---------+---------------
* No XFP | 0x639C | 0x40 | 0x639C | 0x40
* -------------+---------+---------------+---------+---------------
* XFP,linkdown | 0x43BC | 0x40 | 0x639C | 0x40
* -------------+---------+---------------+---------+---------------
* XFP,linkup | 0x03FC | 0x0 | 0x03FC | 0x0
* -------------+---------+---------------+---------+---------------
* Note:
* STATUS0 = BCM8704_USER_ANALOG_STATUS0_REG
* TX_ALARM_STAT = BCM8704_USER_TX_ALARM_STATUS_REG
*/
/* ARGSUSED */
static nxge_status_t
{
/*
* Keep the val1 code even though it is not used. Could be
* used to differenciate the "No XFP" case and "XFP,linkdown"
* case when a Intel XFP is used.
*/
}
"XAUI is bad or absent on port<%d>\n", portn));
}
#ifdef NXGE_DEBUG
/*
* As a workaround for CR6693529, do not execute this block of
* code for non-debug driver. When a Picolight XFP transceiver
* is used, register BCM8704_USER_ANALOG_STATUS0_REG returns
* the same 0x639C value in normal link down case, which causes
* false FMA messages and link reconnection problem.
*/
/*
* 0x03FC = 0000 0011 1111 1100 (XFP is normal)
* 0x639C = 0110 0011 1001 1100 (XFP has problem)
* bit14 = 1: PDM loss-of-light indicator
* bit13 = 1: PDM Rx loss-of-signal
* bit6 = 0: Light is NOT ok
* bit5 = 0: PMD Rx signal is NOT ok
*/
if (val == 0x639C) {
"XFP is bad or absent on port<%d>\n",
portn));
}
status = NXGE_ERROR;
}
#endif
}
return (status);
}
/* ARGSUSED */
{
return (serviced);
}
}
}
"<== nxge_syserrintr(no logical group): "
return (DDI_INTR_UNCLAIMED);
}
/*
* Get the logical device state if the function uses interrupt.
*/
}
/* This interrupt handler is for system error interrupts. */
/* SMX */
"==> nxge_syserr_intr: device error - SMX"));
"==> nxge_syserr_intr: device error - MAC"));
/*
* There is nothing to be done here. All MAC errors go to per
* MAC port interrupt. MIF interrupt is the only MAC sub-block
* that can generate status here. MIF status reported will be
* ignored here. It is checked by per port timer instead.
*/
"==> nxge_syserr_intr: device error - IPP"));
(void) nxge_ipp_handle_sys_errors(nxgep);
/* ZCP */
"==> nxge_syserr_intr: device error - ZCP"));
(void) nxge_zcp_handle_sys_errors(nxgep);
/* TDMC */
"==> nxge_syserr_intr: device error - TDMC"));
/*
* There is no TDMC system errors defined in the PRM. All TDMC
* channel specific errors are reported on a per channel basis.
*/
/* RDMC */
"==> nxge_syserr_intr: device error - RDMC"));
(void) nxge_rxdma_handle_sys_errors(nxgep);
"==> nxge_syserr_intr: device error - TXC"));
(void) nxge_txc_handle_sys_errors(nxgep);
/* PCI-E */
"==> nxge_syserr_intr: device error - PCI-E"));
/* META1 */
"==> nxge_syserr_intr: device error - META1"));
/* META2 */
"==> nxge_syserr_intr: device error - META2"));
/* FFLP */
"==> nxge_syserr_intr: device error - FFLP"));
(void) nxge_fflp_handle_sys_errors(nxgep);
}
/*
* nxge_check_xaui_xfg checks XAUI for all of the following
* portmodes, but checks XFP only if portmode == PORT_10G_FIBER.
*/
"==> nxge_syserr_intr: device error - XAUI"));
}
}
}
return (serviced);
}
/* ARGSUSED */
void
{
}
/* ARGSUSED */
void
{
}
/* ARGSUSED */
void
{
int i;
"<== nxge_rx_hw_blank (not enabled)"));
return;
}
return;
}
(void) npi_rxdma_cfg_rdc_rcr_timeout(handle,
}
}
}
/* ARGSUSED */
void
{
(void) nxge_tx_mac_disable(nxgep);
(void) nxge_rx_mac_disable(nxgep);
}
/* ARGSUSED */
void
{
int cmd;
return;
}
switch (cmd) {
default:
return;
case NXGE_GET_MII:
break;
case NXGE_PUT_MII:
break;
case NXGE_GET64:
break;
case NXGE_PUT64:
break;
case NXGE_PUT_TCAM:
break;
case NXGE_GET_TCAM:
break;
case NXGE_TX_REGS_DUMP:
break;
case NXGE_RX_REGS_DUMP:
break;
case NXGE_VIR_INT_REGS_DUMP:
case NXGE_INT_REGS_DUMP:
break;
case NXGE_RTRACE:
break;
}
}
/* ARGSUSED */
void
{
int i;
}
case LB_GET_MODE:
} else {
}
break;
case LB_SET_MODE:
break;
}
} else {
}
break;
case LB_GET_INFO_SIZE:
/* TN1010 does not support external loopback */
size += sizeof (lb_external10g);
}
/* Publish PHY loopback if PHY is present */
}
/*
* Even if cap_10gfdx is false, we still do 10G
* serdes loopback as a part of SunVTS xnetlbtest
* internal loopback test.
*/
size += sizeof (lb_serdes10g);
/* TN1010 does not support external loopback */
size += sizeof (lb_external1000);
}
size += sizeof (lb_mac1000);
size += sizeof (lb_phy1000);
}
size += sizeof (lb_external100);
size += sizeof (lb_external10);
size += sizeof (lb_serdes1000);
"NXGE_GET_LB_INFO command: size %d", size));
} else
break;
case LB_GET_INFO:
/* TN1010 does not support external loopback */
size += sizeof (lb_external10g);
}
/* Publish PHY loopback if PHY is present */
}
size += sizeof (lb_serdes10g);
/* TN1010 does not support external loopback */
size += sizeof (lb_external1000);
}
size += sizeof (lb_mac1000);
size += sizeof (lb_phy1000);
}
size += sizeof (lb_external100);
size += sizeof (lb_external10);
size += sizeof (lb_serdes1000);
"NXGE_GET_LB_INFO command: size %d", size));
i = 0;
}
/* TN1010 does not support ext lb */
lb_props[i++] = lb_external10g;
}
}
lb_props[i++] = lb_serdes10g;
/* TN1010 does not support ext lb */
lb_props[i++] = lb_external1000;
}
}
lb_props[i++] = lb_external100;
lb_props[i++] = lb_external10;
lb_props[i++] = lb_mac1000;
lb_props[i++] = lb_phy1000;
lb_props[i++] = lb_serdes1000;
}
} else
} else {
}
break;
}
}
/*
* DMA channel interfaces to access various channel specific
* hardware functions.
*/
/* ARGSUSED */
void
{
/*
* Channel is assumed to be from 0 to the maximum DMA channel #. If we
* use the virtual DMA CSR address space from the config space (in PCI
* case), then the following code need to be use different offset
* computation macro.
*/
}
/* ARGSUSED */
{
/*
* Channel is assumed to be from 0 to the maximum DMA channel #. If we
* use the virtual DMA CSR address space from the config space (in PCI
* case), then the following code need to be use different offset
* computation macro.
*/
}
/* ARGSUSED */
void
{
}
/* ARGSUSED */
void
{
"reg = 0x%016llX index = 0x%08X value = 0x%08X",
}
/*ARGSUSED*/
{
"!nxge%d: Loopback mode already set (lb_mode %d).\n",
goto nxge_set_lb_exit;
}
lb_info = &lb_external10;
lb_info = &lb_phy1000;
lb_info = &lb_serdes10g;
lb_info = &lb_serdes1000;
lb_info = &lb_mac1000;
else {
"!nxge%d: Loopback mode not supported(mode %d).\n",
goto nxge_set_lb_exit;
}
if (lb_mode == nxge_lb_normal) {
if (nxge_lb_dbg) {
"!nxge%d: Returning to normal operation",
}
"!nxge%d: Failed to return to normal operation",
}
goto nxge_set_lb_exit;
}
if (nxge_lb_dbg)
"!nxge%d: Adapter now in %s loopback mode",
}
goto nxge_set_lb_err;
goto nxge_set_lb_err;
goto nxge_set_lb_err;
goto nxge_set_lb_err;
}
nxge_lb_phy10g) ||
== nxge_lb_mac1000) ||
nxge_lb_phy1000) ||
} else {
}
}
goto nxge_set_lb_err;
"<== nxge_set_lb status = 0x%08x", status));
return (status);
"!nxge%d: Failed to put adapter in %s loopback mode",
return (status);
}
/* Return to normal (no loopback) mode */
/* ARGSUSED */
{
return (status);
return (status);
return (status);
return (status);
return (status);
}
/* ARGSUSED */
void
{
}
/* ARGSUSED */
void
{
"reg = 0x%08X index = 0x%08X value = 0x%08X",
}
/* ARGSUSED */
void
{
nxgep->nxge_timerid = 0;
goto nxge_check_hw_state_exit;
}
"NULL ldgvp (interrupt not ready)."));
goto nxge_check_hw_state_exit;
}
"ldgvp $%p t_ldvp $%p use_timer flag %d",
goto nxge_check_hw_state_exit;
}
}
}
/*ARGSUSED*/
static void
{
uint32_t i, j;
size = 1024;
"malformed M_IOCTL MBLKL = %d size = %d",
return;
}
for (i = 0, j = base_entry; i < num_entries; i++, j++) {
}
}