Skip to content

Commit

Permalink
Merge branch 'android14-stable-mod-ancnss2' into android14-stable-mod…
Browse files Browse the repository at this point in the history
…-0824test
  • Loading branch information
liyafe1997 committed Aug 23, 2024
2 parents 97b839e + 0f78a6b commit 97b0096
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/cnss2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ static int cnss_driver_recovery_hdlr(struct cnss_plat_data *plat_priv,

if (test_bit(CNSS_DRIVER_RECOVERY, &plat_priv->driver_state)) {
cnss_pr_err("Recovery is already in progress\n");
WARN_ON(1);
CNSS_ASSERT(0);
ret = -EINVAL;
goto out;
}
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/wireless/cnss2/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#define MAX_NO_OF_MAC_ADDR 4
#define QMI_WLFW_MAX_TIMESTAMP_LEN 32
#define QMI_WLFW_MAX_NUM_MEM_SEG 32
#define QMI_WLFW_MAX_BUILD_ID_LEN 128
#define CNSS_RDDM_TIMEOUT_MS 20000
#define RECOVERY_TIMEOUT 60000
Expand Down Expand Up @@ -379,10 +378,10 @@ struct cnss_plat_data {
char fw_build_id[QMI_WLFW_MAX_BUILD_ID_LEN + 1];
u32 otp_version;
u32 fw_mem_seg_len;
struct cnss_fw_mem fw_mem[QMI_WLFW_MAX_NUM_MEM_SEG];
struct cnss_fw_mem fw_mem[QMI_WLFW_MAX_NUM_MEM_SEG_V01];
struct cnss_fw_mem m3_mem;
u32 qdss_mem_seg_len;
struct cnss_fw_mem qdss_mem[QMI_WLFW_MAX_NUM_MEM_SEG];
struct cnss_fw_mem qdss_mem[QMI_WLFW_MAX_NUM_MEM_SEG_V01];
u32 *qdss_reg;
struct cnss_pin_connect_result pin_result;
struct dentry *root_dentry;
Expand Down
13 changes: 10 additions & 3 deletions drivers/net/wireless/cnss2/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,8 @@ static void cnss_pci_select_window(struct cnss_pci_data *pci_priv, u32 offset)
if (val != window_enable) {
cnss_pr_err("Failed to config window register to 0x%x, current value: 0x%x\n",
window_enable, val);
CNSS_ASSERT(0);
if (!cnss_pci_check_link_status(pci_priv))
CNSS_ASSERT(0);
}
}

Expand Down Expand Up @@ -2443,7 +2444,6 @@ int cnss_wlan_register_driver(struct cnss_wlan_driver *driver_ops)
cnss_pr_err("Timeout (%ums) waiting for calibration to complete\n",
timeout);
if (!test_bit(CNSS_IN_REBOOT, &plat_priv->driver_state)) {
cnss_pci_dump_bl_sram_mem(pci_priv);
CNSS_ASSERT(0);
}

Expand Down Expand Up @@ -2547,8 +2547,12 @@ int cnss_pci_register_driver_hdlr(struct cnss_pci_data *pci_priv,

int cnss_pci_unregister_driver_hdlr(struct cnss_pci_data *pci_priv)
{
struct cnss_plat_data *plat_priv = pci_priv->plat_priv;
struct cnss_plat_data *plat_priv;

if (!pci_priv)
return -EINVAL;

plat_priv = pci_priv->plat_priv;
set_bit(CNSS_DRIVER_UNLOADING, &plat_priv->driver_state);
cnss_pci_dev_shutdown(pci_priv);
pci_priv->driver_ops = NULL;
Expand Down Expand Up @@ -4929,7 +4933,9 @@ static void cnss_pci_unregister_mhi(struct cnss_pci_data *pci_priv)
if (mhi_ctrl->cntrl_log_buf)
ipc_log_context_destroy(mhi_ctrl->cntrl_log_buf);
kfree(mhi_ctrl->irq);
mhi_ctrl->irq = NULL;
mhi_free_controller(mhi_ctrl);
pci_priv->mhi_ctrl = NULL;
}

static void cnss_pci_config_regs(struct cnss_pci_data *pci_priv)
Expand Down Expand Up @@ -5084,6 +5090,7 @@ static void cnss_pci_remove(struct pci_dev *pci_dev)
struct cnss_plat_data *plat_priv =
cnss_bus_dev_to_plat_priv(&pci_dev->dev);

cnss_pci_unregister_driver_hdlr(pci_priv);
cnss_pci_free_m3_mem(pci_priv);
cnss_pci_free_fw_mem(pci_priv);
cnss_pci_free_qdss_mem(pci_priv);
Expand Down
14 changes: 14 additions & 0 deletions drivers/net/wireless/cnss2/qmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

#define ELF_BDF_FILE_NAME_J1S "bd_j1s.elf"

#define ELF_BDF_FILE_NAME_L3A "bd_l3a.elf"
#define ELF_BDF_FILE_NAME_L3A_GLOBAL "bd_l3agl.elf"

#define ELF_BDF_FILE_NAME_J2S "bd_j2s.elf"

#define ELF_BDF_FILE_NAME_J3S "bd_j3s.elf"
Expand All @@ -44,6 +47,8 @@
#define ELF_BDF_FILE_NAME_L11R_GLOBAL "bd_l11rgl.elf"
#define ELF_BDF_FILE_NAME_L11R_INDIA "bd_l11rin.elf"

#define ELF_BDF_FILE_NAME_L81A "bd_l81a.elf"

#define ELF_BDF_FILE_NAME_GF "bdwlang.elf"

#define ELF_BDF_FILE_NAME_PREFIX "bdwlan.e"
Expand Down Expand Up @@ -631,6 +636,12 @@ static int cnss_get_bdf_file_name(struct cnss_plat_data *plat_priv,
case HARDWARE_PLATFORM_ELISH:
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME_K81A);
break;
case HARDWARE_PLATFORM_PSYCHE:
if (hw_country_ver == (uint32_t)CountryGlobal)
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME_L3A_GLOBAL);
else
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME_L3A);
break;
case HARDWARE_PLATFORM_MUNCH:
if (hw_country_ver == (uint32_t)CountryGlobal)
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME_L11R_GLOBAL);
Expand All @@ -639,6 +650,9 @@ static int cnss_get_bdf_file_name(struct cnss_plat_data *plat_priv,
else
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME_L11R);
break;
case HARDWARE_PLATFORM_DAGU:
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME_L81A);
break;
default:
snprintf(filename_tmp, filename_len, ELF_BDF_FILE_NAME);
break;
Expand Down

0 comments on commit 97b0096

Please sign in to comment.