From c36640cba02c1a29a08b797fff4df295bf359f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bremv=C3=A5g?= Date: Sun, 12 Jul 2020 08:48:44 +0200 Subject: [PATCH] Implement simple transmit power boost and override --- hal/rtl8812a/rtl8812a_phycfg.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/hal/rtl8812a/rtl8812a_phycfg.c b/hal/rtl8812a/rtl8812a_phycfg.c index cffb8de..15e15e4 100644 --- a/hal/rtl8812a/rtl8812a_phycfg.c +++ b/hal/rtl8812a/rtl8812a_phycfg.c @@ -14,17 +14,34 @@ *****************************************************************************/ #define _RTL8812A_PHYCFG_C_ -/* #include */ - #include -/*---------------------Define local function prototype-----------------------*/ +/* Manual Transmit Power Control + The following options take values from 0 to 63, where: + 0 - disable + 1 - lowest transmit power the device can do + 2 - highest transmit power the device can do + Note that these options may override your country's regulations about transmit power. + Setting the device to work at higher transmit powers most of the time may cause premature + failure or damage by overheating. Make sure the device has enough airflow before you increase this. + It is currently unknown what these values translate to in dBm. +*/ -/*----------------------------Function Body----------------------------------*/ +// Transmit Power Boost +// This value is added to the device's calculation of transmit power index. +// Useful if you want to keep power usage low while still boosting/decreasing transmit power. +// Can take a negative value as well to reduce power. +// Zero disables it. Default: 2, for a tiny boost. +int transmit_power_boost = 2; +// (ADVANCED) To know what transmit powers this device decides to use dynamically, see: +// https://github.com/lwfinger/rtl8192ee/blob/42ad92dcc71cb15a62f8c39e50debe3a28566b5f/hal/phydm/rtl8192e/halhwimg8192e_rf.c#L1310 -/* - * 1. BB register R/W API - * */ +// Transmit Power Override +// This value completely overrides the driver's calculations and uses only one value for all transmissions. +// Zero disables it. Default: 0 +int transmit_power_override = 0; + +/* Manual Transmit Power Control */ u32 PHY_QueryBBReg8812(