| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* Copyright (C) 2009 - 2010 Ivo van Doorn <IvDoorn@gmail.com> |
|---|
| 2 | 3 | * Copyright (C) 2009 Alban Browaeys <prahal@yahoo.com> |
|---|
| 3 | 4 | * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org> |
|---|
| .. | .. |
|---|
| 7 | 8 | * Copyright (C) 2009 Xose Vazquez Perez <xose.vazquez@gmail.com> |
|---|
| 8 | 9 | * Copyright (C) 2009 Bart Zolnierkiewicz <bzolnier@gmail.com> |
|---|
| 9 | 10 | * <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/>. |
|---|
| 23 | 11 | */ |
|---|
| 24 | 12 | |
|---|
| 25 | 13 | /* Module: rt2800soc |
|---|
| .. | .. |
|---|
| 51 | 39 | |
|---|
| 52 | 40 | static void rt2800soc_disable_radio(struct rt2x00_dev *rt2x00dev) |
|---|
| 53 | 41 | { |
|---|
| 42 | + u32 reg; |
|---|
| 43 | + |
|---|
| 54 | 44 | rt2800_disable_radio(rt2x00dev); |
|---|
| 55 | 45 | 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(®, TX_PIN_CFG_RFTR_EN, 1); |
|---|
| 50 | + |
|---|
| 51 | + rt2x00mmio_register_write(rt2x00dev, TX_PIN_CFG, reg); |
|---|
| 57 | 52 | } |
|---|
| 58 | 53 | |
|---|
| 59 | 54 | static int rt2800soc_set_device_state(struct rt2x00_dev *rt2x00dev, |
|---|
| .. | .. |
|---|
| 161 | 156 | .get_survey = rt2800_get_survey, |
|---|
| 162 | 157 | .get_ringparam = rt2x00mac_get_ringparam, |
|---|
| 163 | 158 | .tx_frames_pending = rt2x00mac_tx_frames_pending, |
|---|
| 159 | + .reconfig_complete = rt2x00mac_reconfig_complete, |
|---|
| 164 | 160 | }; |
|---|
| 165 | 161 | |
|---|
| 166 | 162 | static const struct rt2800_ops rt2800soc_rt2800_ops = { |
|---|
| .. | .. |
|---|
| 176 | 172 | .drv_write_firmware = rt2800soc_write_firmware, |
|---|
| 177 | 173 | .drv_init_registers = rt2800mmio_init_registers, |
|---|
| 178 | 174 | .drv_get_txwi = rt2800mmio_get_txwi, |
|---|
| 175 | + .drv_get_dma_done = rt2800mmio_get_dma_done, |
|---|
| 179 | 176 | }; |
|---|
| 180 | 177 | |
|---|
| 181 | 178 | static const struct rt2x00lib_ops rt2800soc_rt2x00_ops = { |
|---|
| .. | .. |
|---|
| 185 | 182 | .tbtt_tasklet = rt2800mmio_tbtt_tasklet, |
|---|
| 186 | 183 | .rxdone_tasklet = rt2800mmio_rxdone_tasklet, |
|---|
| 187 | 184 | .autowake_tasklet = rt2800mmio_autowake_tasklet, |
|---|
| 188 | | - .probe_hw = rt2800_probe_hw, |
|---|
| 185 | + .probe_hw = rt2800mmio_probe_hw, |
|---|
| 189 | 186 | .get_firmware_name = rt2800soc_get_firmware_name, |
|---|
| 190 | 187 | .check_firmware = rt2800soc_check_firmware, |
|---|
| 191 | 188 | .load_firmware = rt2800soc_load_firmware, |
|---|
| .. | .. |
|---|
| 200 | 197 | .link_tuner = rt2800_link_tuner, |
|---|
| 201 | 198 | .gain_calibration = rt2800_gain_calibration, |
|---|
| 202 | 199 | .vco_calibration = rt2800_vco_calibration, |
|---|
| 200 | + .watchdog = rt2800_watchdog, |
|---|
| 203 | 201 | .start_queue = rt2800mmio_start_queue, |
|---|
| 204 | 202 | .kick_queue = rt2800mmio_kick_queue, |
|---|
| 205 | 203 | .stop_queue = rt2800mmio_stop_queue, |
|---|
| 206 | | - .flush_queue = rt2x00mmio_flush_queue, |
|---|
| 204 | + .flush_queue = rt2800mmio_flush_queue, |
|---|
| 207 | 205 | .write_tx_desc = rt2800mmio_write_tx_desc, |
|---|
| 208 | 206 | .write_tx_data = rt2800_write_tx_data, |
|---|
| 209 | 207 | .write_beacon = rt2800_write_beacon, |
|---|
| .. | .. |
|---|
| 216 | 214 | .config_erp = rt2800_config_erp, |
|---|
| 217 | 215 | .config_ant = rt2800_config_ant, |
|---|
| 218 | 216 | .config = rt2800_config, |
|---|
| 217 | + .pre_reset_hw = rt2800_pre_reset_hw, |
|---|
| 219 | 218 | }; |
|---|
| 220 | 219 | |
|---|
| 221 | 220 | static const struct rt2x00_ops rt2800soc_ops = { |
|---|