17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
19 * redistribution must be conditioned upon including a substantially
20 * similar Disclaimer requirement for further binary redistribution.
21 *
22 * NO WARRANTY
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
26 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
28 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
31 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33 * THE POSSIBILITY OF SUCH DAMAGES.
34 */
35
36 /*
37 * Driver for the Marvell 88W8363 Wireless LAN controller.
38 */
39 #include <sys/stat.h>
40 #include <sys/dlpi.h>
41 #include <inet/common.h>
42 #include <inet/mi.h>
43 #include <sys/stream.h>
44 #include <sys/errno.h>
45 #include <sys/stropts.h>
46 #include <sys/stat.h>
47 #include <sys/sunddi.h>
48 #include <sys/strsubr.h>
49 #include <sys/strsun.h>
50 #include <sys/pci.h>
51 #include <sys/mac_provider.h>
52 #include <sys/mac_wifi.h>
53 #include <sys/net80211.h>
54 #include <inet/wifi_ioctl.h>
55
56 #include "mwl_var.h"
111 };
112
113 #define MWL_DBG_ATTACH (1 << 0)
114 #define MWL_DBG_DMA (1 << 1)
115 #define MWL_DBG_FW (1 << 2)
116 #define MWL_DBG_HW (1 << 3)
117 #define MWL_DBG_INTR (1 << 4)
118 #define MWL_DBG_RX (1 << 5)
119 #define MWL_DBG_TX (1 << 6)
120 #define MWL_DBG_CMD (1 << 7)
121 #define MWL_DBG_CRYPTO (1 << 8)
122 #define MWL_DBG_SR (1 << 9)
123 #define MWL_DBG_MSG (1 << 10)
124
125 uint32_t mwl_dbg_flags = 0x0;
126
127 #ifdef DEBUG
128 #define MWL_DBG \
129 mwl_debug
130 #else
131 #define MWL_DBG
132 #endif
133
134 /*
135 * PIO access attributes for registers
136 */
137 static ddi_device_acc_attr_t mwl_reg_accattr = {
138 DDI_DEVICE_ATTR_V0,
139 DDI_STRUCTURE_LE_ACC,
140 DDI_STRICTORDER_ACC,
141 DDI_DEFAULT_ACC
142 };
143
144 static ddi_device_acc_attr_t mwl_cmdbuf_accattr = {
145 DDI_DEVICE_ATTR_V0,
146 DDI_NEVERSWAP_ACC,
147 DDI_STRICTORDER_ACC,
148 DDI_DEFAULT_ACC
149 };
150
151 /*
|
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
19 * redistribution must be conditioned upon including a substantially
20 * similar Disclaimer requirement for further binary redistribution.
21 *
22 * NO WARRANTY
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
26 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27 * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
28 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
31 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
33 * THE POSSIBILITY OF SUCH DAMAGES.
34 */
35
36 /*
37 * Copyright 2019 Joyent, Inc.
38 */
39
40 /*
41 * Driver for the Marvell 88W8363 Wireless LAN controller.
42 */
43 #include <sys/stat.h>
44 #include <sys/dlpi.h>
45 #include <inet/common.h>
46 #include <inet/mi.h>
47 #include <sys/stream.h>
48 #include <sys/errno.h>
49 #include <sys/stropts.h>
50 #include <sys/stat.h>
51 #include <sys/sunddi.h>
52 #include <sys/strsubr.h>
53 #include <sys/strsun.h>
54 #include <sys/pci.h>
55 #include <sys/mac_provider.h>
56 #include <sys/mac_wifi.h>
57 #include <sys/net80211.h>
58 #include <inet/wifi_ioctl.h>
59
60 #include "mwl_var.h"
115 };
116
117 #define MWL_DBG_ATTACH (1 << 0)
118 #define MWL_DBG_DMA (1 << 1)
119 #define MWL_DBG_FW (1 << 2)
120 #define MWL_DBG_HW (1 << 3)
121 #define MWL_DBG_INTR (1 << 4)
122 #define MWL_DBG_RX (1 << 5)
123 #define MWL_DBG_TX (1 << 6)
124 #define MWL_DBG_CMD (1 << 7)
125 #define MWL_DBG_CRYPTO (1 << 8)
126 #define MWL_DBG_SR (1 << 9)
127 #define MWL_DBG_MSG (1 << 10)
128
129 uint32_t mwl_dbg_flags = 0x0;
130
131 #ifdef DEBUG
132 #define MWL_DBG \
133 mwl_debug
134 #else
135 #define MWL_DBG(...) (void)(0)
136 #endif
137
138 /*
139 * PIO access attributes for registers
140 */
141 static ddi_device_acc_attr_t mwl_reg_accattr = {
142 DDI_DEVICE_ATTR_V0,
143 DDI_STRUCTURE_LE_ACC,
144 DDI_STRICTORDER_ACC,
145 DDI_DEFAULT_ACC
146 };
147
148 static ddi_device_acc_attr_t mwl_cmdbuf_accattr = {
149 DDI_DEVICE_ATTR_V0,
150 DDI_NEVERSWAP_ACC,
151 DDI_STRICTORDER_ACC,
152 DDI_DEFAULT_ACC
153 };
154
155 /*
|