1 /* $NetBSD: lan9118var.h,v 1.1 2009/08/09 06:40:10 kiyohara Exp $ */
3 * Copyright (c) 2008 KIYOHARA Takashi
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
28 #ifndef _LAN9118VAR_H_
29 #define _LAN9118VAR_H_
37 #define LAN9118_DEFAULT_TX_FIF_SZ 5 /*kB*/
39 #ifndef LAN9118_TX_FIF_SZ
40 #define LAN9118_TX_FIF_SZ LAN9118_DEFAULT_TX_FIF_SZ
42 #define LAN9118_TX_DATA_FIFO_SIZE (LAN9118_TX_FIF_SZ * 1024 - 512)
44 * LAN9118 has FIFO buffer, total size is 16kB. That is using TX and RX
45 * buffers. We can set TX FIFO Size. Also TX Status FIFO size is fixed
48 * TX FIFO Size : LAN9118_TX_FIF_SZ
49 * TX Status FIFO Size : 512 Bytes (fixed)
50 * TX Data FIFO Size : LAN9118_TX_FIF_SZ - TX Status FIFO Size
52 * RX FIFO Size : 16kB - LAN9118_TX_FIF_SZ
53 * RX Status FIFO Size : RX FIFO Size / 16
54 * RX Data FIFO Size : RX FIFO Size - RX Status FIFO Size
58 struct lan9118_softc
{
59 device_t sc_dev
; /* generic device glue */
60 struct ethercom sc_ec
; /* ethernet common glue */
61 struct mii_data sc_mii
;
63 bus_space_tag_t sc_iot
;
64 bus_space_handle_t sc_ioh
;
68 uint8_t sc_enaddr
[ETHER_ADDR_LEN
];
70 uint32_t sc_afc_cfg
; /* AFC_CFG configuration */
72 struct callout sc_tick
;
75 #define LAN9118_FLAGS_SWAP 0x00000001
76 #define LAN9118_FLAGS_NO_EEPROM 0x00000002
79 rndsource_element_t rnd_source
;
84 int lan9118_attach(struct lan9118_softc
*);
85 int lan9118_intr(void *);
87 #endif /* _SMSC9118VAR_H_ */