if_xlreg.h (221568) | if_xlreg.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/xl/if_xlreg.h 221568 2011-05-07 00:25:12Z yongari $ | 32 * $FreeBSD: head/sys/dev/xl/if_xlreg.h 226995 2011-11-01 16:13:59Z marius $ |
33 */ 34 35#define XL_EE_READ 0x0080 /* read, 5 bit address */ 36#define XL_EE_WRITE 0x0040 /* write, 5 bit address */ 37#define XL_EE_ERASE 0x00c0 /* erase, 5 bit address */ 38#define XL_EE_EWEN 0x0030 /* erase, no data needed */ 39#define XL_EE_8BIT_READ 0x0200 /* read, 8 bit address */ 40#define XL_EE_BUSY 0x8000 --- 510 unchanged lines hidden (view full) --- 551#define XL_TXSTAT_EMPTY 0x20000000 /* 3c905B only */ 552#define XL_TXSTAT_DL_INTR 0x80000000 553 554#define XL_CAPABILITY_BM 0x20 555 556struct xl_type { 557 u_int16_t xl_vid; 558 u_int16_t xl_did; | 33 */ 34 35#define XL_EE_READ 0x0080 /* read, 5 bit address */ 36#define XL_EE_WRITE 0x0040 /* write, 5 bit address */ 37#define XL_EE_ERASE 0x00c0 /* erase, 5 bit address */ 38#define XL_EE_EWEN 0x0030 /* erase, no data needed */ 39#define XL_EE_8BIT_READ 0x0200 /* read, 8 bit address */ 40#define XL_EE_BUSY 0x8000 --- 510 unchanged lines hidden (view full) --- 551#define XL_TXSTAT_EMPTY 0x20000000 /* 3c905B only */ 552#define XL_TXSTAT_DL_INTR 0x80000000 553 554#define XL_CAPABILITY_BM 0x20 555 556struct xl_type { 557 u_int16_t xl_vid; 558 u_int16_t xl_did; |
559 char *xl_name; | 559 const char *xl_name; |
560}; 561 | 560}; 561 |
562struct xl_mii_frame { 563 u_int8_t mii_stdelim; 564 u_int8_t mii_opcode; 565 u_int8_t mii_phyaddr; 566 u_int8_t mii_regaddr; 567 u_int8_t mii_turnaround; 568 u_int16_t mii_data; 569}; 570 | |
571/* | 562/* |
572 * MII constants 573 */ 574#define XL_MII_STARTDELIM 0x01 575#define XL_MII_READOP 0x02 576#define XL_MII_WRITEOP 0x01 577#define XL_MII_TURNAROUND 0x02 578 579/* | |
580 * The 3C905B adapters implement a few features that we want to 581 * take advantage of, namely the multicast hash filter. With older 582 * chips, you only have the option of turning on reception of all 583 * multicast frames, which is kind of lame. 584 * 585 * We also use this to decide on a transmit strategy. For the 3c90xB 586 * cards, we can use polled descriptor mode, which reduces CPU overhead. 587 */ --- 87 unchanged lines hidden (view full) --- 675 676#define CSR_READ_4(sc, reg) \ 677 bus_space_read_4(sc->xl_btag, sc->xl_bhandle, reg) 678#define CSR_READ_2(sc, reg) \ 679 bus_space_read_2(sc->xl_btag, sc->xl_bhandle, reg) 680#define CSR_READ_1(sc, reg) \ 681 bus_space_read_1(sc->xl_btag, sc->xl_bhandle, reg) 682 | 563 * The 3C905B adapters implement a few features that we want to 564 * take advantage of, namely the multicast hash filter. With older 565 * chips, you only have the option of turning on reception of all 566 * multicast frames, which is kind of lame. 567 * 568 * We also use this to decide on a transmit strategy. For the 3c90xB 569 * cards, we can use polled descriptor mode, which reduces CPU overhead. 570 */ --- 87 unchanged lines hidden (view full) --- 658 659#define CSR_READ_4(sc, reg) \ 660 bus_space_read_4(sc->xl_btag, sc->xl_bhandle, reg) 661#define CSR_READ_2(sc, reg) \ 662 bus_space_read_2(sc->xl_btag, sc->xl_bhandle, reg) 663#define CSR_READ_1(sc, reg) \ 664 bus_space_read_1(sc->xl_btag, sc->xl_bhandle, reg) 665 |
683#define XL_SEL_WIN(x) \ 684 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_WINSEL | x) | 666#define CSR_BARRIER(sc, reg, length, flags) \ 667 bus_space_barrier(sc->xl_btag, sc->xl_bhandle, reg, length, flags) 668 669#define XL_SEL_WIN(x) do { \ 670 CSR_BARRIER(sc, XL_COMMAND, 2, \ 671 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ 672 CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_WINSEL | x); \ 673 CSR_BARRIER(sc, XL_COMMAND, 2, \ 674 BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE); \ 675} while (0) 676 |
685#define XL_TIMEOUT 1000 686 687/* 688 * General constants that are fun to know. 689 * 690 * 3Com PCI vendor ID 691 */ 692#define TC_VENDORID 0x10B7 --- 73 unchanged lines hidden --- | 677#define XL_TIMEOUT 1000 678 679/* 680 * General constants that are fun to know. 681 * 682 * 3Com PCI vendor ID 683 */ 684#define TC_VENDORID 0x10B7 --- 73 unchanged lines hidden --- |