forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Copyright (C) 2009 - 2010 Ivo van Doorn <IvDoorn@gmail.com>
23 * Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com>
34 * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
....@@ -7,19 +8,6 @@
78 * Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com>
89 * Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com>
910 * <http://rt2x00.serialmonkey.com>
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2 of the License, or
14
- * (at your option) any later version.
15
- *
16
- * This program is distributed in the hope that it will be useful,
17
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
18
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
- * GNU General Public License for more details.
20
- *
21
- * You should have received a copy of the GNU General Public License
22
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
2311 */
2412
2513 /* Module: rt2800soc
....@@ -51,9 +39,16 @@
5139
5240 static void rt2800soc_disable_radio(struct rt2x00_dev *rt2x00dev)
5341 {
42
+ u32 reg;
43
+
5444 rt2800_disable_radio(rt2x00dev);
5545 rt2x00mmio_register_write(rt2x00dev, PWR_PIN_CFG, 0);
56
- rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, 0);
46
+
47
+ reg = 0;
48
+ if (rt2x00_rt(rt2x00dev, RT3883))
49
+ rt2x00_set_field32(&reg, TX_PIN_CFG_RFTR_EN, 1);
50
+
51
+ rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, reg);
5752 }
5853
5954 static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev,
....@@ -161,6 +156,7 @@
161156 .get_survey = rt2800_get_survey,
162157 .get_ringparam = rt2x00mac_get_ringparam,
163158 .tx_frames_pending = rt2x00mac_tx_frames_pending,
159
+ .reconfig_complete = rt2x00mac_reconfig_complete,
164160 };
165161
166162 static const struct rt2800_ops rt2800soc_rt2800_ops = {
....@@ -176,6 +172,7 @@
176172 .drv_write_firmware = rt2800soc_write_firmware,
177173 .drv_init_registers = rt2800mmio_init_registers,
178174 .drv_get_txwi = rt2800mmio_get_txwi,
175
+ .drv_get_dma_done = rt2800mmio_get_dma_done,
179176 };
180177
181178 static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = {
....@@ -185,7 +182,7 @@
185182 .tbtt_tasklet = rt2800mmio_tbtt_tasklet,
186183 .rxdone_tasklet = rt2800mmio_rxdone_tasklet,
187184 .autowake_tasklet = rt2800mmio_autowake_tasklet,
188
- .probe_hw = rt2800_probe_hw,
185
+ .probe_hw = rt2800mmio_probe_hw,
189186 .get_firmware_name = rt2800soc_get_firmware_name,
190187 .check_firmware = rt2800soc_check_firmware,
191188 .load_firmware = rt2800soc_load_firmware,
....@@ -200,10 +197,11 @@
200197 .link_tuner = rt2800_link_tuner,
201198 .gain_calibration = rt2800_gain_calibration,
202199 .vco_calibration = rt2800_vco_calibration,
200
+ .watchdog = rt2800_watchdog,
203201 .start_queue = rt2800mmio_start_queue,
204202 .kick_queue = rt2800mmio_kick_queue,
205203 .stop_queue = rt2800mmio_stop_queue,
206
- .flush_queue = rt2x00mmio_flush_queue,
204
+ .flush_queue = rt2800mmio_flush_queue,
207205 .write_tx_desc = rt2800mmio_write_tx_desc,
208206 .write_tx_data = rt2800_write_tx_data,
209207 .write_beacon = rt2800_write_beacon,
....@@ -216,6 +214,7 @@
216214 .config_erp = rt2800_config_erp,
217215 .config_ant = rt2800_config_ant,
218216 .config = rt2800_config,
217
+ .pre_reset_hw = rt2800_pre_reset_hw,
219218 };
220219
221220 static const struct rt2x00_ops rt2800soc_ops = {