eri.c revision 297a64e7779d7bd7140d1f3f2fa5db171aa21569
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * CDDL HEADER START
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * The contents of this file are subject to the terms of the
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Common Development and Distribution License (the "License").
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * You may not use this file except in compliance with the License.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * or http://www.opensolaris.org/os/licensing.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * See the License for the specific language governing permissions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * and limitations under the License.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * When distributing Covered Code, include this CDDL HEADER in each
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * If applicable, add the following below this CDDL HEADER, with the
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * fields enclosed by brackets "[]" replaced with your own identifying
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * information: Portions Copyright [yyyy] [name of copyright owner]
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * CDDL HEADER END
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Use is subject to license terms.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith#pragma ident "%Z%%M% %I% %E% SMI"
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * SunOS MT STREAMS ERI(PCI) 10/100 Mb Ethernet Device Driver
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * **** Function Prototypes *****
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Entry points (man9e)
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_attach(dev_info_t *, ddi_attach_cmd_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_detach(dev_info_t *, ddi_detach_cmd_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * I/O (Input/Output) Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic boolean_t eri_send_msg(struct eri *, mblk_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic mblk_t *eri_read_dma(struct eri *, volatile struct rmd *,
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Initialization Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_init_xfer_params(struct eri *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_setup_mac_address(struct eri *, dev_info_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic uint32_t eri_init_rx_channel(struct eri *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Un-init Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic uint32_t eri_txmac_disable(struct eri *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic uint32_t eri_rxmac_disable(struct eri *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic boolean_t eri_reclaim(struct eri *, uint32_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Transceiver (xcvr) Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_new_xcvr(struct eri *); /* Initializes & detects xcvrs */
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_xcvr_force_mode(struct eri *, uint32_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_mif_poll(struct eri *, soft_mif_enable_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic uint32_t eri_check_link_noind(struct eri *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic link_state_t eri_mif_check(struct eri *, uint16_t, uint16_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_mii_write(struct eri *, uint8_t, uint16_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic uint32_t eri_mii_read(struct eri *, uint8_t, uint16_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Reset Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Error Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_fatal_err(struct eri *, uint32_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_nonfatal_err(struct eri *, uint32_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Hardening Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_fault_msg(struct eri *, uint_t, msg_t, const char *, ...);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Misc Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_stop_timer(struct eri *erip);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_start_timer(struct eri *erip, fptrv_t func, clock_t msec);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Utility Functions
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_param_get(queue_t *q, mblk_t *mp, caddr_t cp);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_param_set(queue_t *, mblk_t *, char *, caddr_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Functions to support ndd
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic boolean_t eri_nd_load(caddr_t *nd_pparam, char *name,
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith pfi_t get_pfi, pfi_t set_pfi, caddr_t data);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_nd_getset(queue_t *q, caddr_t nd_param, MBLKP mp);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_param_register(struct eri *, param_t *, int);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_process_ndd_ioctl(struct eri *, queue_t *, mblk_t *, int);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_mk_mblk_tail_space(mblk_t *, mblk_t **, size_t);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_loopback(struct eri *, queue_t *, mblk_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic uint32_t eri_ladrf_bit(const uint8_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Nemo (GLDv3) Functions.
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_m_stat(void *, uint_t, uint64_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_m_start(void *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_m_stop(void *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_m_multicst(void *, boolean_t, const uint8_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic int eri_m_unicst(void *, const uint8_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic void eri_m_ioctl(void *, queue_t *, mblk_t *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmithstatic boolean_t eri_m_getcapab(void *, mac_capab_t, void *);
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Define PHY Vendors: Matches to IEEE
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Organizationally Unique Identifier (OUI)
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * The first two are supported as Internal XCVRs
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith#define PHY_LINK_NONE 0 /* Not attempted yet or retry */
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * MIB II broadcast/multicast packets
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith#define IS_BROADCAST(pkt) (bcmp(pkt, ðerbroadcastaddr, ETHERADDRL) == 0)
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith#define IS_MULTICAST(pkt) ((pkt[0] & 01) == 1)
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith#define NEXTTMDP(tbasep, tmdlimp, tmdp) (((tmdp) + 1) == tmdlimp \
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith#define ETHERHEADER_SIZE (sizeof (struct ether_header))
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * update MIB II statistics \
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith if (type == ETHERTYPE_IP || type == ETHERTYPE_IPV6) { \
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * Strip the PADS for 802.3 \
c1bef59b02d89a84c23d29663cc4e6d46148ebd2David Goldsmith * update MIB II statistics \
type; \
#define ERI_DONT_STRIP_CRC
static int eri_reinit_fatal = 0;
#ifdef DEBUG
static int noteri = 0;
#ifdef ERI_TX_HUNG
static int eri_reinit_txhung = 0;
#ifdef ERI_HDX_BUG_WORKAROUND
#ifdef ERI_PM_WORKAROUND_PCI
* Currently the standard is not stable w.r.t. gigabit link configuration
* property which may be created by OBP or eri.conf file. This property is
static int adv_100T4_cap = 0;
static int adv_pauseTX_cap = 0;
static int adv_pauseRX_cap = 0;
static int use_int_xcvr = 0;
_init(void)
int status;
return (status);
_fini(void)
int status;
if (status == 0) {
return (status);
int regno;
switch (cmd) {
case DDI_ATTACH:
case DDI_RESUME:
return (DDI_FAILURE);
param_linkup = 0;
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_FAILURE);
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
goto attach_fail;
return (DDI_SUCCESS);
if (mutex_inited) {
if (intr_add)
return (DDI_FAILURE);
return (DDI_FAILURE);
switch (cmd) {
case DDI_DETACH:
case DDI_SUSPEND:
return (DDI_SUCCESS);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
return (DDI_FAILURE);
for (i = 0; i < ERI_TPENDING; i++)
for (i = 0; i < ERI_RPENDING; i++)
return (DDI_SUCCESS);
char *uselocal;
unsigned prop_len;
static uint32_t
int err;
case ERI_SET_LOOP_MODE:
case ERI_ND_SET:
if (err != 0) {
case ERI_ND_GET:
case ERI_ND_SET:
case ERI_SET_LOOP_MODE:
case ERI_GET_LOOP_MODE:
case ERI_SET_LOOP_MODE:
case ERI_LOOPBACK_OFF:
param_linkup = 0;
case ERI_MAC_LOOPBACK_ON:
param_linkup = 0;
case ERI_PCS_LOOPBACK_ON:
case ERI_SER_LOOPBACK_ON:
param_linkup = 0;
case ERI_GET_LOOP_MODE:
if (add) {
static boolean_t
switch (cap) {
case MAC_CAPAB_HCKSUM: {
return (B_TRUE);
case MAC_CAPAB_POLL:
return (B_FALSE);
return (EIO);
if (macupdate)
switch (stat) {
case MAC_STAT_IFSPEED:
case MAC_STAT_MULTIRCV:
case MAC_STAT_BRDCSTRCV:
case MAC_STAT_IPACKETS:
case MAC_STAT_RBYTES:
case MAC_STAT_OBYTES:
case MAC_STAT_OPACKETS:
case MAC_STAT_IERRORS:
case MAC_STAT_OERRORS:
case MAC_STAT_MULTIXMT:
case MAC_STAT_BRDCSTXMT:
case MAC_STAT_NORCVBUF:
case MAC_STAT_NOXMTBUF:
case MAC_STAT_UNDERFLOWS:
case MAC_STAT_OVERFLOWS:
case MAC_STAT_COLLISIONS:
case ETHER_STAT_ALIGN_ERRORS:
case ETHER_STAT_FCS_ERRORS:
case ETHER_STAT_EX_COLLISIONS:
case ETHER_STAT_LINK_DUPLEX:
case ETHER_STAT_XCVR_ADDR:
case ETHER_STAT_XCVR_INUSE:
case ETHER_STAT_CAP_100FDX:
case ETHER_STAT_CAP_100HDX:
case ETHER_STAT_CAP_10FDX:
case ETHER_STAT_CAP_10HDX:
case ETHER_STAT_CAP_AUTONEG:
case ETHER_STAT_CAP_ASMPAUSE:
case ETHER_STAT_CAP_PAUSE:
case ETHER_STAT_ADV_CAP_10FDX:
case ETHER_STAT_ADV_CAP_10HDX:
case ETHER_STAT_ADV_CAP_PAUSE:
case ETHER_STAT_LP_CAP_100FDX:
case ETHER_STAT_LP_CAP_100HDX:
case ETHER_STAT_LP_CAP_10FDX:
case ETHER_STAT_LP_CAP_10HDX:
case ETHER_STAT_LP_CAP_PAUSE:
case ETHER_STAT_LINK_PAUSE:
case ETHER_STAT_LINK_ASMPAUSE:
case ETHER_STAT_LINK_AUTONEG:
#ifdef ERI_RX_TAG_ERROR_WORKAROUND
uint_t i;
int status = 0;
for (i = 0; i < ERI_TPENDING; i++) {
return (status);
uint_t i;
int status = 0;
for (i = 0; i < ERI_RPENDING; i++) {
return (status);
int i, status = 0;
for (i = 0; i < ERI_RPENDING; i++) {
return (status);
static uint32_t
static uint32_t
param_linkup = 0;
static uint32_t
static uint32_t
#ifdef ORIG
static uint32_t
uint32_t i;
* The ring size ERI_TPENDING is defined in eri_mac.h.
switch (ERI_TPENDING) {
i <<= ERI_TX_RINGSZ_SHIFT;
static uint32_t
* The Max ring size, ERI_RMDMAX is defined in eri_mac.h.
switch (ERI_RPENDING) {
i <<= ERI_RX_RINGSZ_SHIFT;
int status = 0;
return (status);
for (i = 0; i < ERI_RPENDING; i++) {
static uint32_t
#ifdef ERI_DONT_STRIP_CRC
if (param_mode)
BMAC_TXCFG_ENIPG0 : 0) |
BMAC_TXCFG_ENIPG0 : 0) |
uint32_t i;
static boolean_t
goto init_exit;
link_timeout = 0;
goto done;
param_linkup = 0;
goto done;
* Hang out/Initialize descriptors and buffers.
if (init_stat)
goto done;
goto done;
* Hang out/Initialize descriptors and buffers.
goto done;
goto done;
goto done;
if (! partial_init) {
goto done;
goto done;
carrier_ext = 0;
#ifdef ERI_DONT_STRIP_CRC
BMAC_TXCFG_ENIPG0 : 0) |
BMAC_TXCFG_ENIPG0 : 0) |
if (param_mode)
done:
if (init_stat)
if (!ret) {
return (ret);
return (DDI_FAILURE);
return (DDI_SUCCESS);
return (DDI_FAILURE);
if (needind)
uintptr_t a;
int size;
int alloc_stat = 0;
return (alloc_stat);
return (++alloc_stat);
return (++alloc_stat);
return (++alloc_stat);
return (++alloc_stat);
if (eri_use_dvma_tx &&
for (i = 0; i < ERI_TPENDING; i++) {
alloc_stat++;
if (alloc_stat)
return (alloc_stat);
if (eri_use_dvma_rx &&
for (i = 0; i < ERI_RPENDING; i++) {
alloc_stat++;
if (alloc_stat)
return (alloc_stat);
return (++alloc_stat);
return (++alloc_stat);
return (++alloc_stat);
return (++alloc_stat);
return (alloc_stat);
static uint_t
goto rx_done_int;
#ifdef ESTAR_WORKAROUND
#ifdef DEBUG
noteri++;
#ifdef ESTAR_WORKAROUND
#ifdef ESTAR_WORKAROUND
return (serviced);
return (serviced);
param_linkup = 0;
return (serviced);
return (serviced);
if (eri_overflow_reset &&
loop_limit--;
if (head)
if (macupdate)
return (serviced);
#ifdef ERI_PM_WORKAROUND
if (eri_overflow_reset)
#ifndef ERI_RMAC_HANG_WORKAROUND
if (eri_overflow_reset)
mblk_t *
return (NULL);
return (mp);
mblk_t *
return (NULL);
return (mp);
static uint32_t
uint32_t x;
static uint32_t
uint32_t x;
uint32_t y;
*datap = 0;
GET_BIT_STD(x);
GET_BIT_STD(x);
*datap += (x << i);
GET_BIT_STD(x);
GET_BIT_STD(x);
GET_BIT_STD(x);
#ifdef ERI_FRM_DEBUG
int frame_flag = 0;
static uint32_t
#ifdef ERI_FRM_DEBUG
if (!frame_flag) {
static boolean_t
uint32_t i, j;
if (!param_linkup) {
return (B_TRUE);
#ifdef ERI_HWCSUM
goto notmds;
#ifdef ERI_HDX_BUG_WORKAROUND
(void) ddi_dma_unbind_handle(
ctrl = 0;
if (macupdate)
return (B_TRUE);
~(ERI_G_MASK_TX_INT_ME));
if (macupdate)
return (B_FALSE);
static mblk_t *
return (mp);
static boolean_t
if (bp) {
reclaimed++;
static mblk_t *
int len;
#ifdef ERI_RCV_CKSUM
#ifdef ERI_DONT_STRIP_CRC
return (NULL);
#ifdef ERI_DONT_STRIP_CRC
#ifdef ERI_RCV_CKSUM
#ifdef ERI_RCV_CKSUM
return (retmp);
param_anar_100T4 = 0;
param_anar_10fdx = 0;
param_anar_10hdx = 0;
param_anar_100fdx = 0;
param_anar_100hdx = 0;
param_anar_asm_dir = 0;
param_anar_pause = 0;
if (link_pulse_disabled)
switch (cmd) {
case ERI_ND_GET:
case ERI_ND_SET:
param_linkup = 0;
param_linkup = 0;
param_linkup = 0;
return (EACCES);
if (macupdate)
int ok;
param_len++;
} while (param_val);
if (ok == 0) {
return (ok);
return (ENOMEM);
return (B_FALSE);
return (B_TRUE);
char *end;
long new_value;
return (EINVAL);
return (EINVAL);
int err;
char *valp;
if (!nd_param)
return (B_FALSE);
return (B_TRUE);
return (B_FALSE);
while (*valp++)
case ND_GET:
if (valp)
while (mp2) {
if (!err) {
if (!err) {
if (excess > 0) {
if (!err)
size_out = 0;
size_out = 0;
case ND_SET:
if (valp) {
return (B_TRUE);
static boolean_t
if (!nd_pparam)
return (B_FALSE);
== NULL)
return (B_FALSE);
goto fill_it;
return (B_FALSE);
return (B_TRUE);
#ifdef DEBUG
if (erip)
const char *fmt, ...)
} else switch (type) {
case ERI_VERB_MSG:
case ERI_LOG_MSG:
case ERI_BUF_MSG:
case ERI_CON_MSG:
if (msec) {
int status;
int old_transceiver;
return (status);
static uint32_t
if (param_speed) {
param_anlpar_100hdx = 0;
param_speed = 0;
param_anlpar_10hdx = 0;
return (linkupdate);
#ifdef ERI_RMAC_HANG_WORKAROUND
return (linkupdate);
return (linkupdate);
#ifdef ERI_TX_HUNG
return (linkupdate);
#ifdef ERI_PM_WORKAROUND
return (linkupdate);
static link_state_t
int restart_autoneg = 0;
return (LINK_STATE_UNKNOWN);
param_anlpar_10hdx = 0;
param_anlpar_100hdx = 0;
param_speed = 0;
param_anlpar_100fdx = 0;
param_anlpar_10fdx = 0;
param_mode = 0;
param_speed = 0;
if (!an_common) {
if (eri_phy_mintrans) {
if (param_mode)
param_linkup = 0;
if (param_autoneg) {
if (!param_linkup) {
if (eri_phy_mintrans) {
&old_mintrans);
if (param_mode)
} else if (param_linkup) {
param_linkup = 0;
if (param_autoneg)
if (restart_autoneg) {
param_mode = 0;
param_speed = 0;
param_anlpar_100T4 = 0;
param_anlpar_100fdx = 0;
param_anlpar_100hdx = 0;
param_anlpar_10fdx = 0;
param_anlpar_10hdx = 0;
param_aner_lpancap = 0;
return (retv);
goto reset_done;
goto eri_reset_xcvr_failed;
if (param_autoneg) {
if (param_anar_100T4)
if (param_anar_100fdx)
if (param_anar_100hdx)
if (param_anar_10fdx)
if (param_anar_10hdx)
if (eri_phy_mintrans &&
eri_phy_mintrans = 0;
if (!(param_anar_10fdx) &&
(param_anar_10hdx) &&
param_speed = 0;
param_mode = 0;
if (param_mode)
if (param_autoneg) {
if (speed_100) {
param_anlpar_10fdx = 0;
param_anlpar_10hdx = 0;
if (param_mode) {
param_anlpar_100hdx = 0;
} else if (speed_10) {
param_anlpar_100fdx = 0;
param_anlpar_100hdx = 0;
param_anlpar_100T4 = 0;
param_speed = 0;
if (param_mode) {
param_anlpar_10hdx = 0;
if (param_mode) {
#ifdef DEBUG
#ifdef ERI_TX_HUNG
if (macupdate)