rtw8723d.c (29583dfcd2dd72c766422bd05c16f06c6b1fb356) rtw8723d.c (87caeef032fc3921bc866ad7becb6ed51aa8b27b)
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2/* Copyright(c) 2018-2019 Realtek Corporation
3 */
4
5#include <linux/module.h>
6#include "main.h"
7#include "coex.h"
8#include "fw.h"

--- 196 unchanged lines hidden (view full) ---

205}
206
207static void rtw8723de_efuse_parsing(struct rtw_efuse *efuse,
208 struct rtw8723d_efuse *map)
209{
210 ether_addr_copy(efuse->addr, map->e.mac_addr);
211}
212
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2/* Copyright(c) 2018-2019 Realtek Corporation
3 */
4
5#include <linux/module.h>
6#include "main.h"
7#include "coex.h"
8#include "fw.h"

--- 196 unchanged lines hidden (view full) ---

205}
206
207static void rtw8723de_efuse_parsing(struct rtw_efuse *efuse,
208 struct rtw8723d_efuse *map)
209{
210 ether_addr_copy(efuse->addr, map->e.mac_addr);
211}
212
213static void rtw8723du_efuse_parsing(struct rtw_efuse *efuse,
214 struct rtw8723d_efuse *map)
215{
216 ether_addr_copy(efuse->addr, map->u.mac_addr);
217}
218
213static int rtw8723d_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
214{
215 struct rtw_efuse *efuse = &rtwdev->efuse;
216 struct rtw8723d_efuse *map;
217 int i;
218
219 map = (struct rtw8723d_efuse *)log_map;
220

--- 13 unchanged lines hidden (view full) ---

234
235 for (i = 0; i < 4; i++)
236 efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i];
237
238 switch (rtw_hci_type(rtwdev)) {
239 case RTW_HCI_TYPE_PCIE:
240 rtw8723de_efuse_parsing(efuse, map);
241 break;
219static int rtw8723d_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
220{
221 struct rtw_efuse *efuse = &rtwdev->efuse;
222 struct rtw8723d_efuse *map;
223 int i;
224
225 map = (struct rtw8723d_efuse *)log_map;
226

--- 13 unchanged lines hidden (view full) ---

240
241 for (i = 0; i < 4; i++)
242 efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i];
243
244 switch (rtw_hci_type(rtwdev)) {
245 case RTW_HCI_TYPE_PCIE:
246 rtw8723de_efuse_parsing(efuse, map);
247 break;
248 case RTW_HCI_TYPE_USB:
249 rtw8723du_efuse_parsing(efuse, map);
250 break;
242 default:
243 /* unsupported now */
244 return -ENOTSUPP;
245 }
246
247 return 0;
248}
249

--- 1690 unchanged lines hidden (view full) ---

1940 dm_info->pwr_trk_triggered = true;
1941 return;
1942 }
1943
1944 rtw8723d_phy_pwrtrack(rtwdev);
1945 dm_info->pwr_trk_triggered = false;
1946}
1947
251 default:
252 /* unsupported now */
253 return -ENOTSUPP;
254 }
255
256 return 0;
257}
258

--- 1690 unchanged lines hidden (view full) ---

1949 dm_info->pwr_trk_triggered = true;
1950 return;
1951 }
1952
1953 rtw8723d_phy_pwrtrack(rtwdev);
1954 dm_info->pwr_trk_triggered = false;
1955}
1956
1957static void rtw8723d_fill_txdesc_checksum(struct rtw_dev *rtwdev,
1958 struct rtw_tx_pkt_info *pkt_info,
1959 u8 *txdesc)
1960{
1961 size_t words = 32 / 2; /* calculate the first 32 bytes (16 words) */
1962 __le16 chksum = 0;
1963 __le16 *data = (__le16 *)(txdesc);
1964
1965 SET_TX_DESC_TXDESC_CHECKSUM(txdesc, 0x0000);
1966
1967 while (words--)
1968 chksum ^= *data++;
1969
1970 chksum = ~chksum;
1971
1972 SET_TX_DESC_TXDESC_CHECKSUM(txdesc, __le16_to_cpu(chksum));
1973}
1974
1948static struct rtw_chip_ops rtw8723d_ops = {
1949 .phy_set_param = rtw8723d_phy_set_param,
1950 .read_efuse = rtw8723d_read_efuse,
1951 .query_rx_desc = rtw8723d_query_rx_desc,
1952 .set_channel = rtw8723d_set_channel,
1953 .mac_init = rtw8723d_mac_init,
1954 .shutdown = rtw8723d_shutdown,
1955 .read_rf = rtw_phy_read_rf_sipi,

--- 4 unchanged lines hidden (view full) ---

1960 .efuse_grant = rtw8723d_efuse_grant,
1961 .false_alarm_statistics = rtw8723d_false_alarm_statistics,
1962 .phy_calibration = rtw8723d_phy_calibration,
1963 .cck_pd_set = rtw8723d_phy_cck_pd_set,
1964 .pwr_track = rtw8723d_pwr_track,
1965 .config_bfee = NULL,
1966 .set_gid_table = NULL,
1967 .cfg_csi_rate = NULL,
1975static struct rtw_chip_ops rtw8723d_ops = {
1976 .phy_set_param = rtw8723d_phy_set_param,
1977 .read_efuse = rtw8723d_read_efuse,
1978 .query_rx_desc = rtw8723d_query_rx_desc,
1979 .set_channel = rtw8723d_set_channel,
1980 .mac_init = rtw8723d_mac_init,
1981 .shutdown = rtw8723d_shutdown,
1982 .read_rf = rtw_phy_read_rf_sipi,

--- 4 unchanged lines hidden (view full) ---

1987 .efuse_grant = rtw8723d_efuse_grant,
1988 .false_alarm_statistics = rtw8723d_false_alarm_statistics,
1989 .phy_calibration = rtw8723d_phy_calibration,
1990 .cck_pd_set = rtw8723d_phy_cck_pd_set,
1991 .pwr_track = rtw8723d_pwr_track,
1992 .config_bfee = NULL,
1993 .set_gid_table = NULL,
1994 .cfg_csi_rate = NULL,
1995 .fill_txdesc_checksum = rtw8723d_fill_txdesc_checksum,
1968
1969 .coex_set_init = rtw8723d_coex_cfg_init,
1970 .coex_set_ant_switch = NULL,
1971 .coex_set_gnt_fix = rtw8723d_coex_cfg_gnt_fix,
1972 .coex_set_gnt_debug = rtw8723d_coex_cfg_gnt_debug,
1973 .coex_set_rfe_type = rtw8723d_coex_cfg_rfe_type,
1974 .coex_set_wl_tx_power = rtw8723d_coex_cfg_wl_tx_power,
1975 .coex_set_wl_rx_gain = rtw8723d_coex_cfg_wl_rx_gain,

--- 816 unchanged lines hidden ---
1996
1997 .coex_set_init = rtw8723d_coex_cfg_init,
1998 .coex_set_ant_switch = NULL,
1999 .coex_set_gnt_fix = rtw8723d_coex_cfg_gnt_fix,
2000 .coex_set_gnt_debug = rtw8723d_coex_cfg_gnt_debug,
2001 .coex_set_rfe_type = rtw8723d_coex_cfg_rfe_type,
2002 .coex_set_wl_tx_power = rtw8723d_coex_cfg_wl_tx_power,
2003 .coex_set_wl_rx_gain = rtw8723d_coex_cfg_wl_rx_gain,

--- 816 unchanged lines hidden ---