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