main.c (5d6651fe85837b11564a2e2c3c6279c057d078d6) main.c (4830872685f80666b29bab6a930254809c18c40a)
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2/* Copyright(c) 2018-2019 Realtek Corporation
3 */
4
5#include "main.h"
6#include "regd.h"
7#include "fw.h"
8#include "ps.h"

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

889
890 ra_mask &= cfg_mask;
891
892 return ra_mask;
893}
894
895void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si)
896{
1// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2/* Copyright(c) 2018-2019 Realtek Corporation
3 */
4
5#include "main.h"
6#include "regd.h"
7#include "fw.h"
8#include "ps.h"

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

889
890 ra_mask &= cfg_mask;
891
892 return ra_mask;
893}
894
895void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si)
896{
897 struct rtw_dm_info *dm_info = &rtwdev->dm_info;
897 struct ieee80211_sta *sta = si->sta;
898 struct rtw_efuse *efuse = &rtwdev->efuse;
899 struct rtw_hal *hal = &rtwdev->hal;
900 u8 wireless_set;
901 u8 bw_mode;
902 u8 rate_id;
903 u8 rf_type = RF_1T1R;
904 u8 stbc_en = 0;

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

933 ra_mask &= RA_MASK_VHT_RATES | RA_MASK_OFDM_IN_VHT;
934 wireless_set = WIRELESS_OFDM | WIRELESS_VHT;
935 } else if (sta->ht_cap.ht_supported) {
936 ra_mask &= RA_MASK_HT_RATES | RA_MASK_OFDM_IN_HT_5G;
937 wireless_set = WIRELESS_OFDM | WIRELESS_HT;
938 } else {
939 wireless_set = WIRELESS_OFDM;
940 }
898 struct ieee80211_sta *sta = si->sta;
899 struct rtw_efuse *efuse = &rtwdev->efuse;
900 struct rtw_hal *hal = &rtwdev->hal;
901 u8 wireless_set;
902 u8 bw_mode;
903 u8 rate_id;
904 u8 rf_type = RF_1T1R;
905 u8 stbc_en = 0;

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

934 ra_mask &= RA_MASK_VHT_RATES | RA_MASK_OFDM_IN_VHT;
935 wireless_set = WIRELESS_OFDM | WIRELESS_VHT;
936 } else if (sta->ht_cap.ht_supported) {
937 ra_mask &= RA_MASK_HT_RATES | RA_MASK_OFDM_IN_HT_5G;
938 wireless_set = WIRELESS_OFDM | WIRELESS_HT;
939 } else {
940 wireless_set = WIRELESS_OFDM;
941 }
942 dm_info->rrsr_val_init = RRSR_INIT_5G;
941 } else if (hal->current_band_type == RTW_BAND_2G) {
942 ra_mask |= sta->supp_rates[NL80211_BAND_2GHZ];
943 if (sta->vht_cap.vht_supported) {
944 ra_mask &= RA_MASK_VHT_RATES | RA_MASK_CCK_IN_VHT |
945 RA_MASK_OFDM_IN_VHT;
946 wireless_set = WIRELESS_CCK | WIRELESS_OFDM |
947 WIRELESS_HT | WIRELESS_VHT;
948 } else if (sta->ht_cap.ht_supported) {
949 ra_mask &= RA_MASK_HT_RATES | RA_MASK_CCK_IN_HT |
950 RA_MASK_OFDM_IN_HT_2G;
951 wireless_set = WIRELESS_CCK | WIRELESS_OFDM |
952 WIRELESS_HT;
953 } else if (sta->supp_rates[0] <= 0xf) {
954 wireless_set = WIRELESS_CCK;
955 } else {
956 wireless_set = WIRELESS_CCK | WIRELESS_OFDM;
957 }
943 } else if (hal->current_band_type == RTW_BAND_2G) {
944 ra_mask |= sta->supp_rates[NL80211_BAND_2GHZ];
945 if (sta->vht_cap.vht_supported) {
946 ra_mask &= RA_MASK_VHT_RATES | RA_MASK_CCK_IN_VHT |
947 RA_MASK_OFDM_IN_VHT;
948 wireless_set = WIRELESS_CCK | WIRELESS_OFDM |
949 WIRELESS_HT | WIRELESS_VHT;
950 } else if (sta->ht_cap.ht_supported) {
951 ra_mask &= RA_MASK_HT_RATES | RA_MASK_CCK_IN_HT |
952 RA_MASK_OFDM_IN_HT_2G;
953 wireless_set = WIRELESS_CCK | WIRELESS_OFDM |
954 WIRELESS_HT;
955 } else if (sta->supp_rates[0] <= 0xf) {
956 wireless_set = WIRELESS_CCK;
957 } else {
958 wireless_set = WIRELESS_CCK | WIRELESS_OFDM;
959 }
960 dm_info->rrsr_val_init = RRSR_INIT_2G;
958 } else {
959 rtw_err(rtwdev, "Unknown band type\n");
960 wireless_set = 0;
961 }
962
963 switch (sta->bandwidth) {
964 case IEEE80211_STA_RX_BW_80:
965 bw_mode = RTW_CHANNEL_WIDTH_80;

--- 867 unchanged lines hidden ---
961 } else {
962 rtw_err(rtwdev, "Unknown band type\n");
963 wireless_set = 0;
964 }
965
966 switch (sta->bandwidth) {
967 case IEEE80211_STA_RX_BW_80:
968 bw_mode = RTW_CHANNEL_WIDTH_80;

--- 867 unchanged lines hidden ---