rtw8822b.c (29583dfcd2dd72c766422bd05c16f06c6b1fb356) rtw8822b.c (45794099f5e1d7abc5eb07e6eec7e1e5c6cb540d)
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"

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

21 u8 rx_path, bool is_tx2_path);
22
23static void rtw8822be_efuse_parsing(struct rtw_efuse *efuse,
24 struct rtw8822b_efuse *map)
25{
26 ether_addr_copy(efuse->addr, map->e.mac_addr);
27}
28
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"

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

21 u8 rx_path, bool is_tx2_path);
22
23static void rtw8822be_efuse_parsing(struct rtw_efuse *efuse,
24 struct rtw8822b_efuse *map)
25{
26 ether_addr_copy(efuse->addr, map->e.mac_addr);
27}
28
29static void rtw8822bu_efuse_parsing(struct rtw_efuse *efuse,
30 struct rtw8822b_efuse *map)
31{
32 ether_addr_copy(efuse->addr, map->u.mac_addr);
33}
34
29static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
30{
31 struct rtw_efuse *efuse = &rtwdev->efuse;
32 struct rtw8822b_efuse *map;
33 int i;
34
35 map = (struct rtw8822b_efuse *)log_map;
36

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

51
52 for (i = 0; i < 4; i++)
53 efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i];
54
55 switch (rtw_hci_type(rtwdev)) {
56 case RTW_HCI_TYPE_PCIE:
57 rtw8822be_efuse_parsing(efuse, map);
58 break;
35static int rtw8822b_read_efuse(struct rtw_dev *rtwdev, u8 *log_map)
36{
37 struct rtw_efuse *efuse = &rtwdev->efuse;
38 struct rtw8822b_efuse *map;
39 int i;
40
41 map = (struct rtw8822b_efuse *)log_map;
42

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

57
58 for (i = 0; i < 4; i++)
59 efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i];
60
61 switch (rtw_hci_type(rtwdev)) {
62 case RTW_HCI_TYPE_PCIE:
63 rtw8822be_efuse_parsing(efuse, map);
64 break;
65 case RTW_HCI_TYPE_USB:
66 rtw8822bu_efuse_parsing(efuse, map);
67 break;
59 default:
60 /* unsupported now */
61 return -ENOTSUPP;
62 }
63
64 return 0;
65}
66

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

1583 } else {
1584 l2h = min_t(s8, igi, dm_info->l2h_th_ini);
1585 h2l = l2h - EDCCA_L2H_H2L_DIFF;
1586 }
1587
1588 rtw_phy_set_edcca_th(rtwdev, l2h, h2l);
1589}
1590
68 default:
69 /* unsupported now */
70 return -ENOTSUPP;
71 }
72
73 return 0;
74}
75

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

1592 } else {
1593 l2h = min_t(s8, igi, dm_info->l2h_th_ini);
1594 h2l = l2h - EDCCA_L2H_H2L_DIFF;
1595 }
1596
1597 rtw_phy_set_edcca_th(rtwdev, l2h, h2l);
1598}
1599
1600static void rtw8822b_fill_txdesc_checksum(struct rtw_dev *rtwdev,
1601 struct rtw_tx_pkt_info *pkt_info,
1602 u8 *txdesc)
1603{
1604 size_t words = 32 / 2; /* calculate the first 32 bytes (16 words) */
1605
1606 fill_txdesc_checksum_common(txdesc, words);
1607}
1608
1591static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8822b[] = {
1592 {0x0086,
1593 RTW_PWR_CUT_ALL_MSK,
1594 RTW_PWR_INTF_SDIO_MSK,
1595 RTW_PWR_ADDR_SDIO,
1596 RTW_PWR_CMD_WRITE, BIT(0), 0},
1597 {0x0086,
1598 RTW_PWR_CUT_ALL_MSK,

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

2158 .false_alarm_statistics = rtw8822b_false_alarm_statistics,
2159 .phy_calibration = rtw8822b_phy_calibration,
2160 .pwr_track = rtw8822b_pwr_track,
2161 .config_bfee = rtw8822b_bf_config_bfee,
2162 .set_gid_table = rtw_bf_set_gid_table,
2163 .cfg_csi_rate = rtw_bf_cfg_csi_rate,
2164 .adaptivity_init = rtw8822b_adaptivity_init,
2165 .adaptivity = rtw8822b_adaptivity,
1609static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8822b[] = {
1610 {0x0086,
1611 RTW_PWR_CUT_ALL_MSK,
1612 RTW_PWR_INTF_SDIO_MSK,
1613 RTW_PWR_ADDR_SDIO,
1614 RTW_PWR_CMD_WRITE, BIT(0), 0},
1615 {0x0086,
1616 RTW_PWR_CUT_ALL_MSK,

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

2176 .false_alarm_statistics = rtw8822b_false_alarm_statistics,
2177 .phy_calibration = rtw8822b_phy_calibration,
2178 .pwr_track = rtw8822b_pwr_track,
2179 .config_bfee = rtw8822b_bf_config_bfee,
2180 .set_gid_table = rtw_bf_set_gid_table,
2181 .cfg_csi_rate = rtw_bf_cfg_csi_rate,
2182 .adaptivity_init = rtw8822b_adaptivity_init,
2183 .adaptivity = rtw8822b_adaptivity,
2184 .fill_txdesc_checksum = rtw8822b_fill_txdesc_checksum,
2166
2167 .coex_set_init = rtw8822b_coex_cfg_init,
2168 .coex_set_ant_switch = rtw8822b_coex_cfg_ant_switch,
2169 .coex_set_gnt_fix = rtw8822b_coex_cfg_gnt_fix,
2170 .coex_set_gnt_debug = rtw8822b_coex_cfg_gnt_debug,
2171 .coex_set_rfe_type = rtw8822b_coex_cfg_rfe_type,
2172 .coex_set_wl_tx_power = rtw8822b_coex_cfg_wl_tx_power,
2173 .coex_set_wl_rx_gain = rtw8822b_coex_cfg_wl_rx_gain,

--- 420 unchanged lines hidden ---
2185
2186 .coex_set_init = rtw8822b_coex_cfg_init,
2187 .coex_set_ant_switch = rtw8822b_coex_cfg_ant_switch,
2188 .coex_set_gnt_fix = rtw8822b_coex_cfg_gnt_fix,
2189 .coex_set_gnt_debug = rtw8822b_coex_cfg_gnt_debug,
2190 .coex_set_rfe_type = rtw8822b_coex_cfg_rfe_type,
2191 .coex_set_wl_tx_power = rtw8822b_coex_cfg_wl_tx_power,
2192 .coex_set_wl_rx_gain = rtw8822b_coex_cfg_wl_rx_gain,

--- 420 unchanged lines hidden ---