Deleted Added
full compact
if_stereg.h (200950) if_stereg.h (226995)
1/*-
2 * Copyright (c) 1997, 1998, 1999
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, 1999
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/ste/if_stereg.h 200950 2009-12-24 17:22:15Z yongari $
32 * $FreeBSD: head/sys/dev/ste/if_stereg.h 226995 2011-11-01 16:13:59Z marius $
33 */
34
35/*
36 * Sundance PCI device/vendor ID for the
37 * ST201 chip.
38 */
39#define ST_VENDORID 0x13F0
40#define ST_DEVICEID_ST201_1 0x0200

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

487
488#define CSR_READ_4(sc, reg) \
489 bus_read_4((sc)->ste_res, reg)
490#define CSR_READ_2(sc, reg) \
491 bus_read_2((sc)->ste_res, reg)
492#define CSR_READ_1(sc, reg) \
493 bus_read_1((sc)->ste_res, reg)
494
33 */
34
35/*
36 * Sundance PCI device/vendor ID for the
37 * ST201 chip.
38 */
39#define ST_VENDORID 0x13F0
40#define ST_DEVICEID_ST201_1 0x0200

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

487
488#define CSR_READ_4(sc, reg) \
489 bus_read_4((sc)->ste_res, reg)
490#define CSR_READ_2(sc, reg) \
491 bus_read_2((sc)->ste_res, reg)
492#define CSR_READ_1(sc, reg) \
493 bus_read_1((sc)->ste_res, reg)
494
495#define CSR_BARRIER(sc, reg, length, flags) \
496 bus_barrier((sc)->ste_res, reg, length, flags)
497
495#define STE_DESC_ALIGN 8
496#define STE_RX_LIST_CNT 128
497#define STE_TX_LIST_CNT 128
498#define STE_RX_LIST_SZ \
499 (sizeof(struct ste_desc_onefrag) * STE_RX_LIST_CNT)
500#define STE_TX_LIST_SZ \
501 (sizeof(struct ste_desc) * STE_TX_LIST_CNT)
502#define STE_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF)

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

514#define STE_PACKET_SIZE 1536
515#define STE_INC(x, y) (x) = (x + 1) % y
516#define STE_DEC(x, y) (x) = ((x) + ((y) - 1)) % (y)
517#define STE_NEXT(x, y) (x + 1) % y
518
519struct ste_type {
520 uint16_t ste_vid;
521 uint16_t ste_did;
498#define STE_DESC_ALIGN 8
499#define STE_RX_LIST_CNT 128
500#define STE_TX_LIST_CNT 128
501#define STE_RX_LIST_SZ \
502 (sizeof(struct ste_desc_onefrag) * STE_RX_LIST_CNT)
503#define STE_TX_LIST_SZ \
504 (sizeof(struct ste_desc) * STE_TX_LIST_CNT)
505#define STE_ADDR_LO(x) ((uint64_t)(x) & 0xFFFFFFFF)

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

517#define STE_PACKET_SIZE 1536
518#define STE_INC(x, y) (x) = (x + 1) % y
519#define STE_DEC(x, y) (x) = ((x) + ((y) - 1)) % (y)
520#define STE_NEXT(x, y) (x + 1) % y
521
522struct ste_type {
523 uint16_t ste_vid;
524 uint16_t ste_did;
522 char *ste_name;
525 const char *ste_name;
523};
524
525struct ste_list_data {
526 struct ste_desc_onefrag *ste_rx_list;
527 bus_addr_t ste_rx_list_paddr;
528 struct ste_desc *ste_tx_list;
529 bus_addr_t ste_tx_list_paddr;
530};

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

585 struct callout ste_callout;
586 struct ste_hw_stats ste_stats;
587 struct mtx ste_mtx;
588};
589
590#define STE_LOCK(_sc) mtx_lock(&(_sc)->ste_mtx)
591#define STE_UNLOCK(_sc) mtx_unlock(&(_sc)->ste_mtx)
592#define STE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->ste_mtx, MA_OWNED)
526};
527
528struct ste_list_data {
529 struct ste_desc_onefrag *ste_rx_list;
530 bus_addr_t ste_rx_list_paddr;
531 struct ste_desc *ste_tx_list;
532 bus_addr_t ste_tx_list_paddr;
533};

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

588 struct callout ste_callout;
589 struct ste_hw_stats ste_stats;
590 struct mtx ste_mtx;
591};
592
593#define STE_LOCK(_sc) mtx_lock(&(_sc)->ste_mtx)
594#define STE_UNLOCK(_sc) mtx_unlock(&(_sc)->ste_mtx)
595#define STE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->ste_mtx, MA_OWNED)
593
594struct ste_mii_frame {
595 uint8_t mii_stdelim;
596 uint8_t mii_opcode;
597 uint8_t mii_phyaddr;
598 uint8_t mii_regaddr;
599 uint8_t mii_turnaround;
600 uint16_t mii_data;
601};
602
603/*
604 * MII constants
605 */
606#define STE_MII_STARTDELIM 0x01
607#define STE_MII_READOP 0x02
608#define STE_MII_WRITEOP 0x01
609#define STE_MII_TURNAROUND 0x02