if_urevar.h revision 1.2.4.3 1 1.2.4.3 martin /* $NetBSD: if_urevar.h,v 1.2.4.3 2020/04/13 08:04:49 martin Exp $ */
2 1.2.4.3 martin
3 1.2.4.2 christos /* $OpenBSD: if_urereg.h,v 1.5 2018/11/02 21:32:30 jcs Exp $ */
4 1.2.4.2 christos /*-
5 1.2.4.2 christos * Copyright (c) 2015-2016 Kevin Lo <kevlo (at) FreeBSD.org>
6 1.2.4.2 christos * All rights reserved.
7 1.2.4.2 christos *
8 1.2.4.2 christos * Redistribution and use in source and binary forms, with or without
9 1.2.4.2 christos * modification, are permitted provided that the following conditions
10 1.2.4.2 christos * are met:
11 1.2.4.2 christos * 1. Redistributions of source code must retain the above copyright
12 1.2.4.2 christos * notice, this list of conditions and the following disclaimer.
13 1.2.4.2 christos * 2. Redistributions in binary form must reproduce the above copyright
14 1.2.4.2 christos * notice, this list of conditions and the following disclaimer in the
15 1.2.4.2 christos * documentation and/or other materials provided with the distribution.
16 1.2.4.2 christos *
17 1.2.4.2 christos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18 1.2.4.2 christos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 1.2.4.2 christos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 1.2.4.2 christos * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21 1.2.4.2 christos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 1.2.4.2 christos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 1.2.4.2 christos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 1.2.4.2 christos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 1.2.4.2 christos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 1.2.4.2 christos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 1.2.4.2 christos * SUCH DAMAGE.
28 1.2.4.2 christos *
29 1.2.4.2 christos * $FreeBSD$
30 1.2.4.2 christos */
31 1.2.4.2 christos
32 1.2.4.2 christos struct ure_intrpkt {
33 1.2.4.2 christos uint8_t ure_tsr;
34 1.2.4.2 christos uint8_t ure_rsr;
35 1.2.4.2 christos uint8_t ure_gep_msr;
36 1.2.4.2 christos uint8_t ure_waksr;
37 1.2.4.2 christos uint8_t ure_txok_cnt;
38 1.2.4.2 christos uint8_t ure_rxlost_cnt;
39 1.2.4.2 christos uint8_t ure_crcerr_cnt;
40 1.2.4.2 christos uint8_t ure_col_cnt;
41 1.2.4.2 christos } __packed;
42 1.2.4.2 christos
43 1.2.4.2 christos struct ure_rxpkt {
44 1.2.4.2 christos uint32_t ure_pktlen;
45 1.2.4.2 christos #define URE_RXPKT_LEN_MASK 0x7fff
46 1.2.4.2 christos uint32_t ure_csum;
47 1.2.4.2 christos #define URE_RXPKT_IPV4_CS __BIT(19)
48 1.2.4.2 christos #define URE_RXPKT_IPV6_CS __BIT(20)
49 1.2.4.2 christos #define URE_RXPKT_TCP_CS __BIT(22)
50 1.2.4.2 christos #define URE_RXPKT_UDP_CS __BIT(23)
51 1.2.4.2 christos uint32_t ure_misc;
52 1.2.4.2 christos #define URE_RXPKT_RX_VLAN_TAG __BIT(16)
53 1.2.4.2 christos #define URE_RXPKT_TCP_F __BIT(21)
54 1.2.4.2 christos #define URE_RXPKT_UDP_F __BIT(22)
55 1.2.4.2 christos #define URE_RXPKT_IP_F __BIT(23)
56 1.2.4.2 christos uint32_t ure_rsvd2;
57 1.2.4.2 christos uint32_t ure_rsvd3;
58 1.2.4.2 christos uint32_t ure_rsvd4;
59 1.2.4.2 christos } __packed;
60 1.2.4.2 christos
61 1.2.4.2 christos struct ure_txpkt {
62 1.2.4.2 christos uint32_t ure_pktlen;
63 1.2.4.2 christos #define URE_TXPKT_TX_FS __BIT(31)
64 1.2.4.2 christos #define URE_TXPKT_TX_LS __BIT(30)
65 1.2.4.2 christos #define URE_TXPKT_LEN_MASK 0xffff
66 1.2.4.2 christos uint32_t ure_csum;
67 1.2.4.2 christos #define URE_L4_OFFSET_MAX 0x7ff
68 1.2.4.2 christos #define URE_L4_OFFSET_SHIFT 17
69 1.2.4.2 christos #define URE_TXPKT_IPV6_CS __BIT(28)
70 1.2.4.2 christos #define URE_TXPKT_IPV4_CS __BIT(29)
71 1.2.4.2 christos #define URE_TXPKT_TCP_CS __BIT(30)
72 1.2.4.2 christos #define URE_TXPKT_UDP_CS __BIT(31)
73 1.2.4.2 christos } __packed;
74 1.2.4.2 christos
75 1.2.4.2 christos #ifndef URE_TX_LIST_CNT
76 1.2.4.2 christos #define URE_TX_LIST_CNT 4
77 1.2.4.2 christos #endif
78 1.2.4.2 christos #ifndef URE_RX_LIST_CNT
79 1.2.4.2 christos #define URE_RX_LIST_CNT 4
80 1.2.4.2 christos #endif
81 1.2.4.2 christos
82 1.2.4.3 martin /* usbnet::un_flags values */
83 1.2.4.3 martin #define URE_FLAG_VER_4C00 0x0001
84 1.2.4.3 martin #define URE_FLAG_VER_4C10 0x0002
85 1.2.4.3 martin #define URE_FLAG_VER_5C00 0x0004
86 1.2.4.3 martin #define URE_FLAG_VER_5C10 0x0008
87 1.2.4.3 martin #define URE_FLAG_VER_5C20 0x0010
88 1.2.4.3 martin #define URE_FLAG_VER_5C30 0x0020
89 1.2.4.2 christos #define URE_FLAG_8152 0x1000 /* RTL8152 */
90