Deleted Added
full compact
if_tlreg.h (214264) if_tlreg.h (226995)
1/*-
2 * Copyright (c) 1997, 1998
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
1/*-
2 * Copyright (c) 1997, 1998
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 15 unchanged lines hidden (view full) ---

24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 * $FreeBSD: head/sys/dev/tl/if_tlreg.h 214264 2010-10-24 12:51:02Z marius $
32 * $FreeBSD: head/sys/dev/tl/if_tlreg.h 226995 2011-11-01 16:13:59Z marius $
33 */
34
33 */
34
35
36struct tl_type {
37 u_int16_t tl_vid;
38 u_int16_t tl_did;
35struct tl_type {
36 u_int16_t tl_vid;
37 u_int16_t tl_did;
39 char *tl_name;
38 const char *tl_name;
40};
41
42/*
43 * ThunderLAN TX/RX list format. The TX and RX lists are pretty much
44 * identical: the list begins with a 32-bit forward pointer which points
45 * at the next list in the chain, followed by 16 bits for the total
46 * frame size, and a 16 bit status field. This is followed by a series
47 * of 10 32-bit data count/data address pairs that point to the fragments

--- 150 unchanged lines hidden (view full) ---

198#define TL_INTR_RXEOF 0x3
199#define TL_INTR_DUMMY 0x4
200#define TL_INTR_TXEOC 0x5
201#define TL_INTR_ADCHK 0x6
202#define TL_INTR_RXEOC 0x7
203
204#define TL_INT_MASK 0x001C
205#define TL_VEC_MASK 0x1FE0
39};
40
41/*
42 * ThunderLAN TX/RX list format. The TX and RX lists are pretty much
43 * identical: the list begins with a 32-bit forward pointer which points
44 * at the next list in the chain, followed by 16 bits for the total
45 * frame size, and a 16 bit status field. This is followed by a series
46 * of 10 32-bit data count/data address pairs that point to the fragments

--- 150 unchanged lines hidden (view full) ---

197#define TL_INTR_RXEOF 0x3
198#define TL_INTR_DUMMY 0x4
199#define TL_INTR_TXEOC 0x5
200#define TL_INTR_ADCHK 0x6
201#define TL_INTR_RXEOC 0x7
202
203#define TL_INT_MASK 0x001C
204#define TL_VEC_MASK 0x1FE0
205
206/*
207 * Host command register bits
208 */
209#define TL_CMD_GO 0x80000000
210#define TL_CMD_STOP 0x40000000
211#define TL_CMD_ACK 0x20000000
212#define TL_CMD_CHSEL7 0x10000000
213#define TL_CMD_CHSEL6 0x08000000

--- 171 unchanged lines hidden (view full) ---

385/*
386 * ThunderLAN NETMASK bits
387 */
388#define TL_MASK_MASK7 0x80
389#define TL_MASK_MASK6 0x40
390#define TL_MASK_MASK5 0x20
391#define TL_MASK_MASK4 0x10
392
206/*
207 * Host command register bits
208 */
209#define TL_CMD_GO 0x80000000
210#define TL_CMD_STOP 0x40000000
211#define TL_CMD_ACK 0x20000000
212#define TL_CMD_CHSEL7 0x10000000
213#define TL_CMD_CHSEL6 0x08000000

--- 171 unchanged lines hidden (view full) ---

385/*
386 * ThunderLAN NETMASK bits
387 */
388#define TL_MASK_MASK7 0x80
389#define TL_MASK_MASK6 0x40
390#define TL_MASK_MASK5 0x20
391#define TL_MASK_MASK4 0x10
392
393/*
394 * MII frame format
395 */
396#ifdef ANSI_DOESNT_ALLOW_BITFIELDS
397struct tl_mii_frame {
398 u_int16_t mii_stdelim:2,
399 mii_opcode:2,
400 mii_phyaddr:5,
401 mii_regaddr:5,
402 mii_turnaround:2;
403 u_int16_t mii_data;
404};
405#else
406struct tl_mii_frame {
407 u_int8_t mii_stdelim;
408 u_int8_t mii_opcode;
409 u_int8_t mii_phyaddr;
410 u_int8_t mii_regaddr;
411 u_int8_t mii_turnaround;
412 u_int16_t mii_data;
413};
414#endif
415/*
416 * MII constants
417 */
418#define TL_MII_STARTDELIM 0x01
419#define TL_MII_READOP 0x02
420#define TL_MII_WRITEOP 0x01
421#define TL_MII_TURNAROUND 0x02
422
423#define TL_LAST_FRAG 0x80000000
424#define TL_CSTAT_UNUSED 0x8000
425#define TL_CSTAT_FRAMECMP 0x4000
426#define TL_CSTAT_READY 0x3000
427#define TL_CSTAT_UNUSED13 0x2000
428#define TL_CSTAT_UNUSED12 0x1000
429#define TL_CSTAT_EOC 0x0800
430#define TL_CSTAT_RXERROR 0x0400

--- 63 unchanged lines hidden (view full) ---

494#define CSR_WRITE_4(sc, reg, val) bus_write_4(sc->tl_res, reg, val)
495#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->tl_res, reg, val)
496#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->tl_res, reg, val)
497
498#define CSR_READ_4(sc, reg) bus_read_4(sc->tl_res, reg)
499#define CSR_READ_2(sc, reg) bus_read_2(sc->tl_res, reg)
500#define CSR_READ_1(sc, reg) bus_read_1(sc->tl_res, reg)
501
393#define TL_LAST_FRAG 0x80000000
394#define TL_CSTAT_UNUSED 0x8000
395#define TL_CSTAT_FRAMECMP 0x4000
396#define TL_CSTAT_READY 0x3000
397#define TL_CSTAT_UNUSED13 0x2000
398#define TL_CSTAT_UNUSED12 0x1000
399#define TL_CSTAT_EOC 0x0800
400#define TL_CSTAT_RXERROR 0x0400

--- 63 unchanged lines hidden (view full) ---

464#define CSR_WRITE_4(sc, reg, val) bus_write_4(sc->tl_res, reg, val)
465#define CSR_WRITE_2(sc, reg, val) bus_write_2(sc->tl_res, reg, val)
466#define CSR_WRITE_1(sc, reg, val) bus_write_1(sc->tl_res, reg, val)
467
468#define CSR_READ_4(sc, reg) bus_read_4(sc->tl_res, reg)
469#define CSR_READ_2(sc, reg) bus_read_2(sc->tl_res, reg)
470#define CSR_READ_1(sc, reg) bus_read_1(sc->tl_res, reg)
471
472#define CSR_BARRIER(sc, reg, length, flags) \
473 bus_barrier(sc->tl_res, reg, length, flags)
474
502#define CMD_PUT(sc, x) CSR_WRITE_4(sc, TL_HOSTCMD, x)
503#define CMD_SET(sc, x) \
504 CSR_WRITE_4(sc, TL_HOSTCMD, CSR_READ_4(sc, TL_HOSTCMD) | (x))
505#define CMD_CLR(sc, x) \
506 CSR_WRITE_4(sc, TL_HOSTCMD, CSR_READ_4(sc, TL_HOSTCMD) & ~(x))
507
508/*
509 * ThunderLAN adapters typically have a serial EEPROM containing

--- 75 unchanged lines hidden ---
475#define CMD_PUT(sc, x) CSR_WRITE_4(sc, TL_HOSTCMD, x)
476#define CMD_SET(sc, x) \
477 CSR_WRITE_4(sc, TL_HOSTCMD, CSR_READ_4(sc, TL_HOSTCMD) | (x))
478#define CMD_CLR(sc, x) \
479 CSR_WRITE_4(sc, TL_HOSTCMD, CSR_READ_4(sc, TL_HOSTCMD) & ~(x))
480
481/*
482 * ThunderLAN adapters typically have a serial EEPROM containing

--- 75 unchanged lines hidden ---