Re: Questions for TX power get/set implementation of realtek WiFi

From: 邱名碩
Date: Tue Mar 02 2021 - 12:51:34 EST


邱名碩 <ccchiu77@xxxxxxxxx> 於 2021年3月2日 週二 下午6:21寫道:
>
> Hi guys,
> I'm planning to implement the get_txpower hook function of the
> struct ieee80211_ops and handle the IEEE80211_CONF_CHANGE_POWER for
> rtl8xxxu driver. So that users can get the information of the current
> tx power limit and set a new limit value with iw commands.
>
> I found there's phy_txpwr_idx_to_dbm() of each driver in
> realtek/rtlwifi to translate the tx power index parsed from efuse to
> tx power level in dBm. Does the power level translated represent the
> current tx power limit in dBm? In my RTL8188CUS module, the power
> index of CCK/OFDM from efuse for each channel is basically 36/38, thus
> the translated txpower level is 11dBm. Is this the expected value for
> the default txpower limit value? Or do I need some other formula to
> compute?
>
> And for the handler of IEEE80211_CONF_CHANGE_POWER, can I
> translate the hw->conf.power_level with the phy_dbm_to_txpwr_idx
> functions I found in some rtlwifi family drivers, then directly set
> the txpower index with phy_set_txpower_index functions which write
> power index to bbreg for different rates (CCK and OFDM)? Are there
> some invalid values I should take care of because the TCP RX
> performance seems to be extremely low when I write the power index
> value translated from 20dBm to bbreg. Any suggestions for what I
> should handle before writing the bbreg?
>
> Chris

Sorry for confusion. I'm removing and correcting the invalid mail address here.