Skip to content

Commit

Permalink
ath10k: allow dynamic SAR power limits via common API
Browse files Browse the repository at this point in the history
ath10k assigns ath10k_mac_set_sar_specs to ath10k_ops, and
this function is called when user space application calls
NL80211_CMD_SET_SAR_SPECS. ath10k also registers SAR type,
and supported frequency ranges to wiphy so user space can
query SAR capabilities.

This SAR power limitation is compared to regulatory txpower
and selects the minimal one to set when station is connected.
Otherwise, it delays until the station is connected. If the
station is disconnected, it returns to regulatory txpower.

This feature is controlled by hw parameter: dynamic_sar_support.

Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1

Signed-off-by: Carl Huang <cjhuang@codeaurora.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Abhishek Kumar <kuabhs@chromium.org>
  • Loading branch information
Carl Huang authored and intel-lab-lkp committed Dec 3, 2020
1 parent 03b2114 commit 4853340
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 59 deletions.
16 changes: 16 additions & 0 deletions drivers/net/wireless/ath/ath10k/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = true,
.dynamic_sar_support = false,
},
{
.id = QCA988X_HW_2_0_VERSION,
Expand Down Expand Up @@ -124,6 +125,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = true,
.dynamic_sar_support = false,
},
{
.id = QCA9887_HW_1_0_VERSION,
Expand Down Expand Up @@ -159,6 +161,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA6174_HW_3_2_VERSION,
Expand Down Expand Up @@ -189,6 +192,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.tx_stats_over_pktlog = false,
.bmi_large_size_download = true,
.supports_peer_stats_info = true,
.dynamic_sar_support = true,
},
{
.id = QCA6174_HW_2_1_VERSION,
Expand Down Expand Up @@ -223,6 +227,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA6174_HW_2_1_VERSION,
Expand Down Expand Up @@ -257,6 +262,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA6174_HW_3_0_VERSION,
Expand Down Expand Up @@ -291,6 +297,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA6174_HW_3_2_VERSION,
Expand Down Expand Up @@ -329,6 +336,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.fw_diag_ce_download = true,
.tx_stats_over_pktlog = false,
.supports_peer_stats_info = true,
.dynamic_sar_support = true,
},
{
.id = QCA99X0_HW_2_0_DEV_VERSION,
Expand Down Expand Up @@ -369,6 +377,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA9984_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -416,6 +425,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA9888_HW_2_0_DEV_VERSION,
Expand Down Expand Up @@ -460,6 +470,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA9377_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -494,6 +505,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
Expand Down Expand Up @@ -530,6 +542,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = true,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = QCA9377_HW_1_1_DEV_VERSION,
Expand Down Expand Up @@ -557,6 +570,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.ast_skid_limit = 0x10,
.num_wds_entries = 0x20,
.uart_pin_workaround = true,
.dynamic_sar_support = false,
},
{
.id = QCA4019_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -598,6 +612,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = true,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = false,
},
{
.id = WCN3990_HW_1_0_DEV_VERSION,
Expand Down Expand Up @@ -625,6 +640,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.hw_filter_reset_required = false,
.fw_diag_ce_download = false,
.tx_stats_over_pktlog = false,
.dynamic_sar_support = true,
},
};

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/ath/ath10k/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,9 @@ struct ath10k {
bool coex_support;
int coex_gpio_pin;

s32 tx_power_2g_limit;
s32 tx_power_5g_limit;

/* must be last */
u8 drv_priv[] __aligned(sizeof(void *));
};
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/ath/ath10k/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ struct ath10k_hw_params {

/* provides bitrates for sta_statistics using WMI_TLV_PEER_STATS_INFO_EVENTID */
bool supports_peer_stats_info;

bool dynamic_sar_support;
};

struct htt_rx_desc;
Expand Down
Loading

0 comments on commit 4853340

Please sign in to comment.