Skip to content

Commit 00f2fb9

Browse files
authored
ath12k: fix peer_id usage in normal RX path (#524)
ath12k: fix peer_id usage in normal RX path
2 parents 5b0a7d6 + b2f828a commit 00f2fb9

4 files changed

Lines changed: 39 additions & 5 deletions

File tree

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ struct ath12k_sta {
540540
#define ATH12K_MAX_5GHZ_FREQ (ATH12K_5GHZ_MAX_CENTER + ATH12K_HALF_20MHZ_BW)
541541
#define ATH12K_MIN_6GHZ_FREQ (ATH12K_6GHZ_MIN_CENTER - ATH12K_HALF_20MHZ_BW)
542542
#define ATH12K_MAX_6GHZ_FREQ (ATH12K_6GHZ_MAX_CENTER + ATH12K_HALF_20MHZ_BW)
543-
#define ATH12K_NUM_CHANS 101
544-
#define ATH12K_MAX_5GHZ_CHAN 173
543+
#define ATH12K_NUM_CHANS 102
544+
#define ATH12K_MAX_5GHZ_CHAN 177
545545

546546
static inline bool ath12k_is_2ghz_channel_freq(u32 freq)
547547
{

drivers/net/wireless/ath/ath12k/dp_rx.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
#include "dp_mon.h"
1818
#include "debugfs_htt_stats.h"
1919

20+
#define ATH12K_2GHZ_MIN_CHAN_NUM 1
21+
#define ATH12K_2GHZ_MAX_CHAN_NUM 14
22+
#define ATH12K_5GHZ_MIN_CHAN_NUM 36
23+
#define ATH12K_5GHZ_MAX_CHAN_NUM 177
24+
2025
static int ath12k_dp_rx_tid_delete_handler(struct ath12k_base *ab,
2126
struct ath12k_dp_rx_tid_rxq *rx_tid);
2227

@@ -1287,9 +1292,11 @@ void ath12k_dp_rx_h_ppdu(struct ath12k_pdev_dp *dp_pdev,
12871292
center_freq <= ATH12K_MAX_6GHZ_FREQ) {
12881293
rx_status->band = NL80211_BAND_6GHZ;
12891294
rx_status->freq = center_freq;
1290-
} else if (channel_num >= 1 && channel_num <= 14) {
1295+
} else if (channel_num >= ATH12K_2GHZ_MIN_CHAN_NUM &&
1296+
channel_num <= ATH12K_2GHZ_MAX_CHAN_NUM) {
12911297
rx_status->band = NL80211_BAND_2GHZ;
1292-
} else if (channel_num >= 36 && channel_num <= 173) {
1298+
} else if (channel_num >= ATH12K_5GHZ_MIN_CHAN_NUM &&
1299+
channel_num <= ATH12K_5GHZ_MAX_CHAN_NUM) {
12931300
rx_status->band = NL80211_BAND_5GHZ;
12941301
}
12951302

@@ -1338,7 +1345,7 @@ void ath12k_dp_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev, struct napi_struc
13381345
bool is_mcbc = rxcb->is_mcbc;
13391346
bool is_eapol = rxcb->is_eapol;
13401347

1341-
peer = ath12k_dp_peer_find_by_peerid(dp_pdev, rx_info->peer_id);
1348+
peer = ath12k_dp_peer_find_by_peerid(dp_pdev, rxcb->peer_id);
13421349

13431350
pubsta = peer ? peer->sta : NULL;
13441351

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
.max_power = 30, \
5252
}
5353

54+
#define ATH12K_5_9_GHZ_MIN_FREQ 5845
55+
#define ATH12K_5_9_GHZ_MAX_FREQ 5885
56+
5457
static const struct ieee80211_channel ath12k_2ghz_channels[] = {
5558
CHAN2G(1, 2412, 0),
5659
CHAN2G(2, 2417, 0),
@@ -96,6 +99,7 @@ static const struct ieee80211_channel ath12k_5ghz_channels[] = {
9699
CHAN5G(165, 5825, 0),
97100
CHAN5G(169, 5845, 0),
98101
CHAN5G(173, 5865, 0),
102+
CHAN5G(177, 5885, 0),
99103
};
100104

101105
static const struct ieee80211_channel ath12k_6ghz_channels[] = {
@@ -13879,6 +13883,26 @@ static int ath12k_mac_update_band(struct ath12k *ar,
1387913883
return 0;
1388013884
}
1388113885

13886+
static void ath12k_mac_update_5_9_ghz_ch_list(struct ath12k *ar,
13887+
struct ieee80211_supported_band *band)
13888+
{
13889+
int i;
13890+
13891+
if (test_bit(WMI_TLV_SERVICE_5_9GHZ_SUPPORT,
13892+
ar->ab->wmi_ab.svc_map))
13893+
return;
13894+
13895+
guard(spinlock_bh)(&ar->ab->base_lock);
13896+
if (ar->ab->dfs_region != ATH12K_DFS_REG_FCC)
13897+
return;
13898+
13899+
for (i = 0; i < band->n_channels; i++) {
13900+
if (band->channels[i].center_freq >= ATH12K_5_9_GHZ_MIN_FREQ &&
13901+
band->channels[i].center_freq <= ATH12K_5_9_GHZ_MAX_FREQ)
13902+
band->channels[i].flags |= IEEE80211_CHAN_DISABLED;
13903+
}
13904+
}
13905+
1388213906
static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
1388313907
u32 supported_bands,
1388413908
struct ieee80211_supported_band *bands[])
@@ -14012,6 +14036,8 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar,
1401214036
band->n_bitrates = ath12k_a_rates_size;
1401314037
band->bitrates = ath12k_a_rates;
1401414038

14039+
ath12k_mac_update_5_9_ghz_ch_list(ar, band);
14040+
1401514041
if (ab->hw_params->single_pdev_only) {
1401614042
phy_id = ath12k_get_phy_id(ar, WMI_HOST_WLAN_5GHZ_CAP);
1401714043
reg_cap = &ab->hal_reg_cap[phy_id];

drivers/net/wireless/ath/ath12k/wmi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,6 +2259,7 @@ enum wmi_tlv_service {
22592259
WMI_TLV_SERVICE_FREQINFO_IN_METADATA = 219,
22602260
WMI_TLV_SERVICE_EXT2_MSG = 220,
22612261
WMI_TLV_SERVICE_BEACON_PROTECTION_SUPPORT = 244,
2262+
WMI_TLV_SERVICE_5_9GHZ_SUPPORT = 247,
22622263
WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249,
22632264
WMI_TLV_SERVICE_MBSS_PARAM_IN_VDEV_START_SUPPORT = 253,
22642265

0 commit comments

Comments
 (0)