Fix the possible wrong last_auto_fpga_lbt_th saving:

1. Remove the last_auto_fpga_lbt_th saving from sdrctl set reg command. Otherwise, repeated sdrctl set reg will save wrong value into last_auto_fpga_lbt_th
2. The last_auto_fpga_lbt_th is only set in ad9361_rf_set_channel, which is called at least once by Linux after NIC is up
This commit is contained in:
Xianjun Jiao 2021-10-04 09:59:43 +02:00
parent 8598d2949d
commit b60e485eb5

View File

@ -1762,9 +1762,8 @@ static int openwifi_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *
priv->drv_xpu_reg_val[reg_addr_idx]=reg_val; priv->drv_xpu_reg_val[reg_addr_idx]=reg_val;
if (reg_addr_idx==DRV_XPU_REG_IDX_LBT_TH) { if (reg_addr_idx==DRV_XPU_REG_IDX_LBT_TH) {
if (reg_val) { if (reg_val) {
priv->last_auto_fpga_lbt_th = xpu_api->XPU_REG_LBT_TH_read();
xpu_api->XPU_REG_LBT_TH_write(reg_val); xpu_api->XPU_REG_LBT_TH_write(reg_val);
printk("%s override FPGA LBT threshold to %d. Save the last_auto_fpga_lbt_th %d\n", sdr_compatible_str, reg_val, priv->last_auto_fpga_lbt_th); printk("%s override FPGA LBT threshold to %d. The last_auto_fpga_lbt_th %d\n", sdr_compatible_str, reg_val, priv->last_auto_fpga_lbt_th);
} else { } else {
xpu_api->XPU_REG_LBT_TH_write(priv->last_auto_fpga_lbt_th); xpu_api->XPU_REG_LBT_TH_write(priv->last_auto_fpga_lbt_th);
printk("%s Restore last_auto_fpga_lbt_th %d to FPGA. ad9361_rf_set_channel will take control\n", sdr_compatible_str, priv->last_auto_fpga_lbt_th); printk("%s Restore last_auto_fpga_lbt_th %d to FPGA. ad9361_rf_set_channel will take control\n", sdr_compatible_str, priv->last_auto_fpga_lbt_th);