8 * Damien Bergamini <damien.bergamini@free.fr>
9 *
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.
13 *
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.
21 */
22
23 /*
24 * Ralink Technology RT2561, RT2561S and RT2661 chipset driver
25 * http://www.ralinktech.com/
26 */
27
28 #include <sys/types.h>
29 #include <sys/byteorder.h>
30 #include <sys/conf.h>
31 #include <sys/cmn_err.h>
32 #include <sys/stat.h>
33 #include <sys/ddi.h>
34 #include <sys/sunddi.h>
35 #include <sys/strsubr.h>
36 #include <sys/ethernet.h>
37 #include <inet/common.h>
38 #include <inet/nd.h>
39 #include <inet/mi.h>
40 #include <sys/note.h>
41 #include <sys/stream.h>
42 #include <sys/strsun.h>
43 #include <sys/modctl.h>
44 #include <sys/devops.h>
45 #include <sys/dlpi.h>
46 #include <sys/mac_provider.h>
47 #include <sys/mac_wifi.h>
60
61 #define RT2661_DBG_80211 (1 << 0)
62 #define RT2661_DBG_DMA (1 << 1)
63 #define RT2661_DBG_EEPROM (1 << 2)
64 #define RT2661_DBG_FW (1 << 3)
65 #define RT2661_DBG_HW (1 << 4)
66 #define RT2661_DBG_INTR (1 << 5)
67 #define RT2661_DBG_RX (1 << 6)
68 #define RT2661_DBG_SCAN (1 << 7)
69 #define RT2661_DBG_TX (1 << 8)
70 #define RT2661_DBG_RADIO (1 << 9)
71 #define RT2661_DBG_RESUME (1 << 10)
72 #define RT2661_DBG_MSG (1 << 11)
73
74 uint32_t rt2661_dbg_flags = 0;
75
76 #ifdef DEBUG
77 #define RWD_DEBUG \
78 rt2661_debug
79 #else
80 #define RWD_DEBUG
81 #endif
82
83 static void *rt2661_soft_state_p = NULL;
84
85 static const uint8_t *ucode = NULL;
86 int usize;
87
88 static const struct {
89 uint32_t reg;
90 uint32_t val;
91 } rt2661_def_mac[] = {
92 RT2661_DEF_MAC
93 };
94
95 static const struct {
96 uint8_t reg;
97 uint8_t val;
98 } rt2661_def_bbp[] = {
99 RT2661_DEF_BBP
100 };
|
8 * Damien Bergamini <damien.bergamini@free.fr>
9 *
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.
13 *
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.
21 */
22
23 /*
24 * Ralink Technology RT2561, RT2561S and RT2661 chipset driver
25 * http://www.ralinktech.com/
26 */
27
28 /*
29 * Copyright 2019 Joyent, Inc.
30 */
31
32 #include <sys/types.h>
33 #include <sys/byteorder.h>
34 #include <sys/conf.h>
35 #include <sys/cmn_err.h>
36 #include <sys/stat.h>
37 #include <sys/ddi.h>
38 #include <sys/sunddi.h>
39 #include <sys/strsubr.h>
40 #include <sys/ethernet.h>
41 #include <inet/common.h>
42 #include <inet/nd.h>
43 #include <inet/mi.h>
44 #include <sys/note.h>
45 #include <sys/stream.h>
46 #include <sys/strsun.h>
47 #include <sys/modctl.h>
48 #include <sys/devops.h>
49 #include <sys/dlpi.h>
50 #include <sys/mac_provider.h>
51 #include <sys/mac_wifi.h>
64
65 #define RT2661_DBG_80211 (1 << 0)
66 #define RT2661_DBG_DMA (1 << 1)
67 #define RT2661_DBG_EEPROM (1 << 2)
68 #define RT2661_DBG_FW (1 << 3)
69 #define RT2661_DBG_HW (1 << 4)
70 #define RT2661_DBG_INTR (1 << 5)
71 #define RT2661_DBG_RX (1 << 6)
72 #define RT2661_DBG_SCAN (1 << 7)
73 #define RT2661_DBG_TX (1 << 8)
74 #define RT2661_DBG_RADIO (1 << 9)
75 #define RT2661_DBG_RESUME (1 << 10)
76 #define RT2661_DBG_MSG (1 << 11)
77
78 uint32_t rt2661_dbg_flags = 0;
79
80 #ifdef DEBUG
81 #define RWD_DEBUG \
82 rt2661_debug
83 #else
84 #define RWD_DEBUG(...) (void)(0)
85 #endif
86
87 static void *rt2661_soft_state_p = NULL;
88
89 static const uint8_t *ucode = NULL;
90 int usize;
91
92 static const struct {
93 uint32_t reg;
94 uint32_t val;
95 } rt2661_def_mac[] = {
96 RT2661_DEF_MAC
97 };
98
99 static const struct {
100 uint8_t reg;
101 uint8_t val;
102 } rt2661_def_bbp[] = {
103 RT2661_DEF_BBP
104 };
|