| @@ -1,39 +1,39 @@ | | | @@ -1,39 +1,39 @@ |
1 | /* $NetBSD: if_urtwn.c,v 1.37 2015/03/08 02:19:04 christos Exp $ */ | | 1 | /* $NetBSD: if_urtwn.c,v 1.38 2015/03/08 14:56:06 christos Exp $ */ |
2 | /* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ | | 2 | /* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ |
3 | | | 3 | |
4 | /*- | | 4 | /*- |
5 | * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> | | 5 | * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> |
6 | * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org> | | 6 | * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org> |
7 | * | | 7 | * |
8 | * Permission to use, copy, modify, and distribute this software for any | | 8 | * Permission to use, copy, modify, and distribute this software for any |
9 | * purpose with or without fee is hereby granted, provided that the above | | 9 | * purpose with or without fee is hereby granted, provided that the above |
10 | * copyright notice and this permission notice appear in all copies. | | 10 | * copyright notice and this permission notice appear in all copies. |
11 | * | | 11 | * |
12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | | 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | */ | | 19 | */ |
20 | | | 20 | |
21 | /*- | | 21 | /*- |
22 | * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU. | | 22 | * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU. |
23 | */ | | 23 | */ |
24 | | | 24 | |
25 | #include <sys/cdefs.h> | | 25 | #include <sys/cdefs.h> |
26 | __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.37 2015/03/08 02:19:04 christos Exp $"); | | 26 | __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.38 2015/03/08 14:56:06 christos Exp $"); |
27 | | | 27 | |
28 | #ifdef _KERNEL_OPT | | 28 | #ifdef _KERNEL_OPT |
29 | #include "opt_inet.h" | | 29 | #include "opt_inet.h" |
30 | #endif | | 30 | #endif |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/sockio.h> | | 33 | #include <sys/sockio.h> |
34 | #include <sys/sysctl.h> | | 34 | #include <sys/sysctl.h> |
35 | #include <sys/mbuf.h> | | 35 | #include <sys/mbuf.h> |
36 | #include <sys/kernel.h> | | 36 | #include <sys/kernel.h> |
37 | #include <sys/socket.h> | | 37 | #include <sys/socket.h> |
38 | #include <sys/systm.h> | | 38 | #include <sys/systm.h> |
39 | #include <sys/malloc.h> | | 39 | #include <sys/malloc.h> |
| @@ -87,29 +87,29 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v | | | @@ -87,29 +87,29 @@ __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v |
87 | #define DBG_TX __BIT(2) | | 87 | #define DBG_TX __BIT(2) |
88 | #define DBG_RX __BIT(3) | | 88 | #define DBG_RX __BIT(3) |
89 | #define DBG_STM __BIT(4) | | 89 | #define DBG_STM __BIT(4) |
90 | #define DBG_RF __BIT(5) | | 90 | #define DBG_RF __BIT(5) |
91 | #define DBG_REG __BIT(6) | | 91 | #define DBG_REG __BIT(6) |
92 | #define DBG_ALL 0xffffffffU | | 92 | #define DBG_ALL 0xffffffffU |
93 | u_int urtwn_debug = 0; | | 93 | u_int urtwn_debug = 0; |
94 | #define DPRINTFN(n, s) \ | | 94 | #define DPRINTFN(n, s) \ |
95 | do { if (urtwn_debug & (n)) printf s; } while (/*CONSTCOND*/0) | | 95 | do { if (urtwn_debug & (n)) printf s; } while (/*CONSTCOND*/0) |
96 | #else | | 96 | #else |
97 | #define DPRINTFN(n, s) | | 97 | #define DPRINTFN(n, s) |
98 | #endif | | 98 | #endif |
99 | | | 99 | |
100 | #define URTWN_DEV(v,p) { { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, 0 } | | 100 | #define URTWN_DEV(v,p) { { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, 0 } |
101 | #define URTWN_RTL8188E_DEV(v,p) \ | | 101 | #define URTWN_RTL8188E_DEV(v,p) \ |
102 | { { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, FLAG_RTL8188E } | | 102 | { { USB_VENDOR_##v, USB_PRODUCT_##v##_##p }, FLAG_RTL8188E } |
103 | static const struct urtwn_dev { | | 103 | static const struct urtwn_dev { |
104 | struct usb_devno dev; | | 104 | struct usb_devno dev; |
105 | uint32_t flags; | | 105 | uint32_t flags; |
106 | #define FLAG_RTL8188E __BIT(0) | | 106 | #define FLAG_RTL8188E __BIT(0) |
107 | } urtwn_devs[] = { | | 107 | } urtwn_devs[] = { |
108 | URTWN_DEV(ABOCOM, RTL8188CU_1), | | 108 | URTWN_DEV(ABOCOM, RTL8188CU_1), |
109 | URTWN_DEV(ABOCOM, RTL8188CU_2), | | 109 | URTWN_DEV(ABOCOM, RTL8188CU_2), |
110 | URTWN_DEV(ABOCOM, RTL8192CU), | | 110 | URTWN_DEV(ABOCOM, RTL8192CU), |
111 | URTWN_DEV(ASUSTEK, RTL8192CU), | | 111 | URTWN_DEV(ASUSTEK, RTL8192CU), |
112 | URTWN_DEV(ASUSTEK, RTL8192CU_3), | | 112 | URTWN_DEV(ASUSTEK, RTL8192CU_3), |
113 | URTWN_DEV(ASUSTEK, USBN10NANO), | | 113 | URTWN_DEV(ASUSTEK, USBN10NANO), |
114 | URTWN_DEV(ASUSTEK, RTL8192CU_3), | | 114 | URTWN_DEV(ASUSTEK, RTL8192CU_3), |
115 | URTWN_DEV(AZUREWAVE, RTL8188CE_1), | | 115 | URTWN_DEV(AZUREWAVE, RTL8188CE_1), |