cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * CDDL HEADER START
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore *
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * The contents of this file are subject to the terms of the
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Common Development and Distribution License (the "License").
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * You may not use this file except in compliance with the License.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore *
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * or http://www.opensolaris.org/os/licensing.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * See the License for the specific language governing permissions
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * and limitations under the License.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore *
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * When distributing Covered Code, include this CDDL HEADER in each
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * If applicable, add the following below this CDDL HEADER, with the
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * fields enclosed by brackets "[]" replaced with your own identifying
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * information: Portions Copyright [yyyy] [name of copyright owner]
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore *
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * CDDL HEADER END
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Use is subject to license terms.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
2c6a6ad1e812de6043502f2f52d21711033ab43eIlya Yanok/*
2c6a6ad1e812de6043502f2f52d21711033ab43eIlya Yanok * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
2c6a6ad1e812de6043502f2f52d21711033ab43eIlya Yanok */
2c6a6ad1e812de6043502f2f52d21711033ab43eIlya Yanok
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * rtls -- REALTEK 8139-serials PCI Fast Ethernet Driver.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore *
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * This product is covered by one or more of the following patents:
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * US5,307,459, US5,434,872, US5,732,094, US6,570,884, US6,115,776, and
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * US6,327,625.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore *
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Currently supports:
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * RTL8139
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#ifndef _SYS_RTLS_H
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define _SYS_RTLS_H
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#ifdef __cplusplus
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amoreextern "C" {
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#endif
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/* Debug flags */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_TRACE 0x01
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_ERRS 0x02
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RECV 0x04
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_DDI 0x08
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SEND 0x10
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_INT 0x20
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SENSE 0x40
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_REGCFG 0x80
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#ifdef DEBUG
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_DEBUG 1
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#endif
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Driver support device
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_VENDOR_ID 0x10EC /* RealTek */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_DEVICE_8139 0x8139
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SUPPORT_DEVICE_1 ((RT_VENDOR_ID << 16) | RT_DEVICE_8139)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* bind vendor and device id together */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_VENDOR_ID_2 0x1186 /* D-link */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_DEVICE_ID_2 0x1301
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SUPPORT_DEVICE_2 ((RTLS_VENDOR_ID_2 << 16) | RTLS_DEVICE_ID_2)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_VENDOR_ID_3 0x1113 /* Accton */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_DEVICE_ID_3 0x1211
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SUPPORT_DEVICE_3 ((RTLS_VENDOR_ID_3 << 16) | RTLS_DEVICE_ID_3)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore#define RTLS_VENDOR_ID_4 0x1186 /* D-link */
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore#define RTLS_DEVICE_ID_4 0x1300
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore#define RTLS_SUPPORT_DEVICE_4 ((RTLS_VENDOR_ID_4 << 16) | RTLS_DEVICE_ID_4)
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Driver tx/rx parameters
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_MAX_TX_DESC 4
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_TX_BUF_COUNT 8
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_TX_BUF_SIZE 2048
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RX_BUF_RING (32*1024) /* 32K */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RX_BUF_SIZE (RTLS_RX_BUF_RING + 2*1024)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_MCAST_BUF_SIZE 64 /* multicast hash table size in bits */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * RTL8139 CRC poly
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_HASH_POLY 0x04C11DB7 /* 0x04C11DB6 */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_HASH_CRC 0xFFFFFFFFU
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * STREAMS parameters
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_HIWAT (RTLS_MAX_TX_DESC * ETHERMAX)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* driver flow control high water */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_LOWAT 1 /* driver flow control low water */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_IDNUM 0 /* RTL Id; zero works */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Helpful defines for register access
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define REG32(reg, off) ((uint32_t *)((uintptr_t)(reg) + off))
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define REG16(reg, off) ((uint16_t *)((uintptr_t)(reg) + off))
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define REG8(reg, off) ((uint8_t *)((uintptr_t)(reg) + off))
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amoretypedef struct {
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore ddi_acc_handle_t acc_hdl; /* handle for memory */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore void *mem_va; /* CPU VA of memory */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore size_t alength; /* allocated size */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore ddi_dma_handle_t dma_hdl; /* DMA handle */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore ddi_dma_cookie_t cookie; /* associated cookie */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t ncookies; /* must be 1 */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore} dma_area_t;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amoretypedef struct rtls_stats {
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t ipackets;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t multi_rcv; /* ifInMulticastPkts */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t brdcst_rcv; /* ifInBroadcastPkts */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t rbytes;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t opackets;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t multi_xmt;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t brdcst_xmt;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint64_t obytes;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t collisions;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t firstcol;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t multicol;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t rcv_err; /* ifInErrors */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t xmt_err; /* ifOutErrors */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t mac_rcv_err;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t mac_xmt_err;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t overflow;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t underflow;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t no_carrier; /* dot3StatsCarrierSenseErrors */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t xmt_latecoll; /* dot3StatsLateCollisions */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t defer; /* dot3StatsDeferredTransmissions */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t frame_err; /* dot3StatsAlignErrors */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t crc_err; /* dot3StatsFCSErrors */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t in_short;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t too_long;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t no_rcvbuf; /* ifInDiscards */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore} rtls_stats_t;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amoretypedef struct rtls_instance {
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore mac_handle_t mh;
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore mii_handle_t mii;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore dev_info_t *devinfo; /* device instance */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore int32_t instance;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore caddr_t io_reg; /* mapped chip register address */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* io handle & iblock */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore ddi_acc_handle_t io_handle; /* ddi I/O handle */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore ddi_iblock_cookie_t iblk;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* dma buffer alloc used */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore dma_area_t dma_area_rx; /* receive dma area */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore dma_area_t dma_area_tx[RTLS_MAX_TX_DESC];
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* transmit dma area */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint8_t netaddr[ETHERADDRL]; /* mac address */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint16_t int_mask; /* interrupt mask */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* used for multicast set */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore char multicast_cnt[RTLS_MCAST_BUF_SIZE];
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t multi_hash[2];
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore boolean_t promisc; /* promisc state flag */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* used for send */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint8_t *tx_buf[RTLS_MAX_TX_DESC];
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint16_t tx_current_desc; /* Current Tx page */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint16_t tx_first_loop;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t tx_retry;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* used for recv */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint8_t *rx_ring;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore uint32_t cur_rx;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* mutex */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore kmutex_t rtls_io_lock; /* i/o reg access */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore kmutex_t rtls_tx_lock; /* send access */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore kmutex_t rtls_rx_lock; /* receive access */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* send reschedule used */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore boolean_t need_sched;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore boolean_t chip_error; /* chip error flag */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* current MAC state */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore boolean_t rtls_running;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore boolean_t rtls_suspended;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* rtls statistics */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore rtls_stats_t stats;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore} rtls_t;
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_TX_RETRY_NUM 16
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_TX_WAIT_TIMEOUT (void) (drv_usectohz(100 * 1000)) /* 100ms */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RESET_WAIT_NUM 0x100
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RESET_WAIT_INTERVAL (void) (drv_usecwait(100))
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RX_ADDR_ALIGNED(addr) (((addr + 3) & ~3) % RTLS_RX_BUF_RING)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* 4-bytes aligned, also with RTLS_RX_BUF_RING boundary */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/* parameter definition in rtls.conf file */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define FOECE_NONE 0 /* no force */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define FORCE_AUTO_NEGO 5 /* auto negotioation mode */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define FORCE_100_FDX 4 /* 100 full_duplex mode */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define FORCE_100_HDX 3 /* 100 half_duplex mode */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define FORCE_10_FDX 2 /* 10 full_duplex mode */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define FORCE_10_HDX 1 /* 10 half_duplex mode */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * RealTek 8129/8139 register offsets definition
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * MAC address register, initial value isautoloaded from the
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * EEPROM EthernetID field
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define ID_0_REG 0x0000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define ID_1_REG 0x0001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define ID_2_REG 0x0002
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define ID_3_REG 0x0003
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define ID_4_REG 0x0004
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define ID_5_REG 0x0005
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Multicast register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_0_REG 0x0008
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_1_REG 0x0009
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_2_REG 0x000a
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_3_REG 0x000b
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_4_REG 0x000c
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_5_REG 0x000d
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_6_REG 0x000e
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MULTICAST_7_REG 0x000f
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RCV_ALL_MULTI_PACKETS 0xffffffff
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Transmit status register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_DESC0_REG 0x0010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_DESC1_REG 0x0014
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_DESC2_REG 0x0018
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_DESC3_REG 0x001c
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_CS_LOST 0x80000000 /* Carrier Sense Lost */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_TX_ABORT 0x40000000 /* Transmit Abort */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_OWC 0x20000000 /* Out of Window Collision */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_CDH 0x10000000 /* CD Heart Beat */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_NCC 0x0f000000 /* Number of Collision Count */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_NCC_SHIFT 24
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_TX_THRESHOLD 0x003f0000 /* Early Tx Threshold */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_TX_THRESHOLD_SHIFT 16
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_TX_THRESHOLD_MAX 0x3f /* 0x3f * 32 Bytes */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_TX_OK 0x00008000 /* Transmit OK */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_TX_UNDERRUN 0x00004000 /* Transmit FIFO Underrun */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_OWN 0x00002000 /* RTL8139 Own bit */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_STATUS_PACKET_SIZE 0x00001fff
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* The total size in bytes of the data in this descriptor */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * The read-only bits (CRS, TABT, OWC, CDH, NCC3-0, TOK, TUN) will be cleared
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * by the RTL8139 when the Transmit Byte Count (bit12-0) in the corresponding
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Tx descriptor is written. If h/w transmit finish, at least some of these
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * bits are none zero.
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_COMPLETE_FLAG (TX_STATUS_TX_ABORT | TX_STATUS_TX_OK | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore TX_STATUS_TX_UNDERRUN)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_ERR_FLAG (TX_STATUS_TX_ABORT | TX_STATUS_TX_UNDERRUN | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore TX_STATUS_CS_LOST | TX_STATUS_OWC)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Transmit start address of descriptors
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_ADDR_DESC0_REG 0x0020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_ADDR_DESC1_REG 0x0024
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_ADDR_DESC2_REG 0x0028
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_ADDR_DESC3_REG 0x002c
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Receive buffer start address
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUFF_ADDR_REG 0x0030
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Early receive byte count register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_STATUS_REG 0x0036
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_STATUS_GOOD 0x08
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_STARUS_BAD 0x04
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_STATUS_COVERWRITE 0x02
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_STATUS_OK 0x01
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Commond register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_COMMAND_REG 0x0037
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_COMMAND_REG_RESERVE 0xe0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_COMMAND_RESET 0x10
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_COMMAND_RX_ENABLE 0x08
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_COMMAND_TX_ENABLE 0x04
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_COMMAND_BUFF_EMPTY 0x01
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Rx current read address register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_CURRENT_READ_ADDR_REG 0x0038
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_READ_RESET_VAL 0xfff0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Value in RX_CURRENT_READ_ADDR_REG is 16 less than
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * the actual rx read address
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define READ_ADDR_GAP 16
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_CURRENT_BUFF_ADDR_REG 0x003a
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Interrupt register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_INT_MASK_REG 0x003c
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_INT_STATUS_REG 0x003e
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_INT_STATUS_INTS 0xe07f
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define SYS_ERR_INT 0x8000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TIME_OUT_INT 0x4000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define CABLE_LEN_CHANGE_INT 0x2000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_OVERFLOW_INT 0x0040
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define LINK_CHANGE_INT 0x0020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUF_OVERFLOW_INT 0x0010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_ERR_INT 0x0008
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_OK_INT 0x0004
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ERR_INT 0x0002
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_OK_INT 0x0001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_INT_MASK_ALL 0xe07f
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_INT_MASK_NONE 0x0000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_RX_INT (RX_OK_INT | RX_ERR_INT | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_BUF_OVERFLOW_INT | RX_FIFO_OVERFLOW_INT)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_OVERFLOW_INT (RX_BUF_OVERFLOW_INT | RX_FIFO_OVERFLOW_INT)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_INT_MASK (LINK_CHANGE_INT | TX_ERR_INT | TX_OK_INT | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_BUF_OVERFLOW_INT | RX_FIFO_OVERFLOW_INT | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_ERR_INT | RX_OK_INT)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Transmit configuration register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_CONFIG_REG 0x0040
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_CONSIG_REG_RESERVE 0x8078f80e
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define HW_VERSION_ID_5 0x7c000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_INTERFRAME_GAP_BITS 0x03000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_INTERFRAME_GAP_SHIFT 24
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_INTERFRAME_GAP_802_3 0x03000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define HW_VERSION_ID_1 0x00800000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define LOOPBACK_MODE_ENABLE 0x00060000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define CRC_APPEND_ENABLE 0x00010000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DMA_BURST_BYTES 0x00000700
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DMA_BURST_2048B 0x00000700
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DMA_BURST_1024B 0x00000600
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_RETRY_COUNT_BITS 0x000000f0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_RETRY_COUNT_DEFUALT 0x00000010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore /* re-transmit count (16 + 1 * 16) = 32 times before aborting */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_CLEAR_ABORT 0x00000001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_CONFIG_DEFAULT (TX_INTERFRAME_GAP_802_3 | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore TX_DMA_BURST_1024B | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore TX_RETRY_COUNT_DEFUALT)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_FIFO_THRESHHOLD 1024
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Receive configuration register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_CONFIG_REG 0x0044
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_CONSIG_REG_RESERVE 0xf0fc0000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_THRESHOLD_BITS 0x0f000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_EARLY_INT_SEL 0x00020000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_RER8_ENABLE 0x00010000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_BITS 0x0000e000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_16B 0x00000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_32B 0x00002000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_64B 0x00004000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_128B 0x00006000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_256B 0x00008000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_512B 0x0000a000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_1024B 0x0000c000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_FIFO_THRESHOLD_NONE 0x0000e000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUF_LEN_BITS 0x00001800
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUF_LEN_8K 0x00000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUF_LEN_16K 0x00000800
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUF_LEN_32K 0x00001000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_BUF_LEN_64K 0x00001800
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_BYTES 0x00000700
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_16B 0x00000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_32B 0x00000100
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_64B 0x00000200
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_128B 0x00000300
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_256B 0x00000400
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_512B 0x00000500
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_1024B 0x00000600
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_DMA_BURST_UNLIMITED 0x00000700
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_NOWRAP_ENABLE 0x00000080
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_EEPROM_9356 0x00000040
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ACCEPT_ERR_PACKET 0x00000020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ACCEPT_RUNT_PACKET 0x00000010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ACCEPT_BROADCAST_PACKET 0x000000008
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ACCEPT_MULTICAST_PACKET 0x000000004
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ACCEPT_MAC_MATCH_PACKET 0x000000002
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ACCEPT_ALL_PACKET 0x000000001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_CONFIG_DEFAULT (RX_FIFO_THRESHOLD_NONE | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_BUF_LEN_32K | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_DMA_BURST_1024B | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_ACCEPT_BROADCAST_PACKET | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_ACCEPT_MULTICAST_PACKET | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_ACCEPT_MAC_MATCH_PACKET)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Missed packet counter: indicates the number of packets
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * discarded due to rx FIFO overflow
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_PACKET_MISS_COUNT_REG 0x004c
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * 93c46(93c56) commond register:
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2ebGarrett D'Amore#define RT_93c46_COMMAND_REG 0x0050
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_MODE_BITS 0xc0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_MODE_NORMAL 0x00
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_MODE_AUTOLOAD 0x40
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_MODE_PROGRAM 0x80
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_MODE_CONFIG 0xc0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_EECS 0x08
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_EESK 0x04
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_EEDI 0x02
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_93c46_EEDO 0x01
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Configuration registers
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_CONFIG_0_REG 0x0051
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_CONFIG_1_REG 0x0052
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_CONFIG_3_REG 0x0059
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_CONFIG_4_REG 0x005a
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Media status register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MEDIA_STATUS_REG 0x0058
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MEDIA_STATUS_LINK 0x04
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define MEDIA_STATUS_SPEED 0x08
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SPEED_100M 100000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SPEED_10M 10000000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RTLS_SPEED_UNKNOWN 0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Multiple interrupt select register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_MUL_INTSEL_REG 0x005c
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RT_MUL_INTSEL_BITS 0x0fff
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Transmit status of all descriptor registers register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_REG 0x0060
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_OWN_0 0x0001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_ABORT_0 0x0010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_UNDERRUN_0 0x0100
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_TXOK_0 0x1000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_OWN_1 0x0002
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_ABORT_1 0x0020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_UNDERRUN_1 0x0200
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_TXOK_1 0x2000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_OWN_2 0x0004
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_ABORT_2 0x0040
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_UNDERRUN_2 0x0400
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_TXOK_2 0x4000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_OWN_3 0x0008
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_ABORT_3 0x0080
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_UNDERRUN_3 0x0800
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define TX_DESC_STAUS_TXOK_3 0x8000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Basic mode control register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_CONTROL_REG 0x0062
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_CONTROL_BITS 0x3300
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_SPEED 0x2000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_SPEED_100 0x2000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_AUTONEGO 0x1000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_RESTAR_AUTONEGO 0x0200
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_DUPLEX 0x0100
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_DUPLEX_FULL 0x0100
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Basic mode status register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_STATUS_REG 0x0064
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_STATUS_AUTONEGO_DONE 0x0020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define BASIC_MODE_STATUS_REMOTE_FAULT 0x0010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Auto-negotiation advertisement register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_AD_REG 0x0066
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_MODE_BITS 0x01e0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_100FULL 0x0100
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_100HALF 0x0080
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_10FULL 0x0040
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_10HALF 0x0020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Auto-negotiation link partner ability register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_LP_REG 0x0068
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Auto-negotiation expansion register
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_EXP_REG 0x006a
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define AUTO_NEGO_EXP_LPCANAN 0x0001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore/*
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore * Receive status in rx packet header
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore */
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_SIZE 4
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_LEN_BITS 0xffff0000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_BITS 0x0000ffff
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_STATUS_DMA_BUSY 0xfff0
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_MULTI 0x8000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_PAM 0x4000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_BCAST 0x2000
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_ISE 0x0020
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_RUNT 0x0010
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_LONG 0x0008
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_CRC 0x0004
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_FAE 0x0002
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_HEADER_STATUS_ROK 0x0001
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#define RX_ERR_FLAGS (RX_HEADER_STATUS_ISE | RX_HEADER_STATUS_RUNT | \
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore RX_HEADER_STATUS_FAE | RX_HEADER_STATUS_CRC)
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#ifdef __cplusplus
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore}
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#endif
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore
cde2885fdf538266ee2a3b08dee2d5075ce8fa2bGarrett D'Amore#endif /* _SYS_RTLS_H */