2 /* $OpenBSD: if_urndisreg.h,v 1.19 2013/11/21 14:08:05 mpi Exp $ */
5 * Copyright (c) 2010 Jonathan Armani <armani@openbsd.org>
6 * Copyright (c) 2010 Fabien Romano <fabien@openbsd.org>
7 * Copyright (c) 2010 Michael Knudsen <mk@openbsd.org>
10 * Permission to use, copy, modify, and distribute this software for any
11 * purpose with or without fee is hereby granted, provided that the above
12 * copyright notice and this permission notice appear in all copies.
14 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 #ifndef _IF_URNDISREG_H_
24 #define _IF_URNDISREG_H_
26 #define RNDIS_RESPONSE_LEN 1024 /* bytes */
27 #define RNDIS_RX_MAXLEN (16 * 1024)
28 #define RNDIS_TX_FRAMES_MAX 8
29 #define RNDIS_TX_MAXLEN MCLBYTES
40 struct usb_ether sc_ue;
43 /* RNDIS device info */
44 uint32_t sc_lim_pktsz;
47 struct usb_device *sc_udev;
48 struct usb_xfer *sc_xfer[URNDIS_N_TRANSFER];
50 uint8_t sc_ifaceno_ctl;
51 uint8_t sc_response_buf[RNDIS_RESPONSE_LEN] __aligned(4);
54 #define URNDIS_LOCK(sc) mtx_lock(&(sc)->sc_mtx)
55 #define URNDIS_UNLOCK(sc) mtx_unlock(&(sc)->sc_mtx)
56 #define URNDIS_LOCK_ASSERT(sc, what) mtx_assert(&(sc)->sc_mtx, (what))
58 #endif /* _IF_URNDISREG_H_ */