Commit 1193a7de authored by Kalle Valo's avatar Kalle Valo

Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git

ath.git patches for v5.13. Major changes:

ath11k

* add initial support for QCN9074, but not enabled yet due to firmware problems

* enable radar detection for 160MHz secondary segment

* handle beacon misses in station mode
parents 2117fce8 26f69792
...@@ -1759,17 +1759,11 @@ static int ath10k_snoc_probe(struct platform_device *pdev) ...@@ -1759,17 +1759,11 @@ static int ath10k_snoc_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int ath10k_snoc_remove(struct platform_device *pdev) static int ath10k_snoc_free_resources(struct ath10k *ar)
{ {
struct ath10k *ar = platform_get_drvdata(pdev);
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n"); ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc free resources\n");
reinit_completion(&ar->driver_recovery);
if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags))
wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ);
set_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags); set_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags);
...@@ -1783,12 +1777,29 @@ static int ath10k_snoc_remove(struct platform_device *pdev) ...@@ -1783,12 +1777,29 @@ static int ath10k_snoc_remove(struct platform_device *pdev)
return 0; return 0;
} }
static int ath10k_snoc_remove(struct platform_device *pdev)
{
struct ath10k *ar = platform_get_drvdata(pdev);
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc remove\n");
reinit_completion(&ar->driver_recovery);
if (test_bit(ATH10K_SNOC_FLAG_RECOVERY, &ar_snoc->flags))
wait_for_completion_timeout(&ar->driver_recovery, 3 * HZ);
ath10k_snoc_free_resources(ar);
return 0;
}
static void ath10k_snoc_shutdown(struct platform_device *pdev) static void ath10k_snoc_shutdown(struct platform_device *pdev)
{ {
struct ath10k *ar = platform_get_drvdata(pdev); struct ath10k *ar = platform_get_drvdata(pdev);
ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc shutdown\n"); ath10k_dbg(ar, ATH10K_DBG_SNOC, "snoc shutdown\n");
ath10k_snoc_remove(pdev); ath10k_snoc_free_resources(ar);
} }
static struct platform_driver ath10k_snoc_driver = { static struct platform_driver ath10k_snoc_driver = {
......
...@@ -373,7 +373,7 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab) ...@@ -373,7 +373,7 @@ static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
cfg->tgt_ce = ab->hw_params.target_ce_config; cfg->tgt_ce = ab->hw_params.target_ce_config;
cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len; cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map; cfg->svc_to_ce_map = ab->hw_params.svc_to_ce_map;
ab->qmi.service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074; ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
} }
static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab) static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
......
...@@ -187,6 +187,59 @@ const struct ce_attr ath11k_host_ce_config_qca6390[] = { ...@@ -187,6 +187,59 @@ const struct ce_attr ath11k_host_ce_config_qca6390[] = {
}; };
const struct ce_attr ath11k_host_ce_config_qcn9074[] = {
/* CE0: host->target HTC control and raw streams */
{
.flags = CE_ATTR_FLAGS,
.src_nentries = 16,
.src_sz_max = 2048,
.dest_nentries = 0,
},
/* CE1: target->host HTT + HTC control */
{
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
.dest_nentries = 512,
.recv_cb = ath11k_htc_rx_completion_handler,
},
/* CE2: target->host WMI */
{
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
.dest_nentries = 32,
.recv_cb = ath11k_htc_rx_completion_handler,
},
/* CE3: host->target WMI (mac0) */
{
.flags = CE_ATTR_FLAGS,
.src_nentries = 32,
.src_sz_max = 2048,
.dest_nentries = 0,
},
/* CE4: host->target HTT */
{
.flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR,
.src_nentries = 2048,
.src_sz_max = 256,
.dest_nentries = 0,
},
/* CE5: target->host pktlog */
{
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
.dest_nentries = 512,
.recv_cb = ath11k_dp_htt_htc_t2h_msg_handler,
},
};
static bool ath11k_ce_need_shadow_fix(int ce_id) static bool ath11k_ce_need_shadow_fix(int ce_id)
{ {
/* only ce4 needs shadow workaroud*/ /* only ce4 needs shadow workaroud*/
...@@ -455,7 +508,7 @@ static void ath11k_ce_srng_msi_ring_params_setup(struct ath11k_base *ab, u32 ce_ ...@@ -455,7 +508,7 @@ static void ath11k_ce_srng_msi_ring_params_setup(struct ath11k_base *ab, u32 ce_
struct hal_srng_params *ring_params) struct hal_srng_params *ring_params)
{ {
u32 msi_data_start; u32 msi_data_start;
u32 msi_data_count; u32 msi_data_count, msi_data_idx;
u32 msi_irq_start; u32 msi_irq_start;
u32 addr_lo; u32 addr_lo;
u32 addr_hi; u32 addr_hi;
...@@ -469,10 +522,11 @@ static void ath11k_ce_srng_msi_ring_params_setup(struct ath11k_base *ab, u32 ce_ ...@@ -469,10 +522,11 @@ static void ath11k_ce_srng_msi_ring_params_setup(struct ath11k_base *ab, u32 ce_
return; return;
ath11k_get_msi_address(ab, &addr_lo, &addr_hi); ath11k_get_msi_address(ab, &addr_lo, &addr_hi);
ath11k_get_ce_msi_idx(ab, ce_id, &msi_data_idx);
ring_params->msi_addr = addr_lo; ring_params->msi_addr = addr_lo;
ring_params->msi_addr |= (dma_addr_t)(((uint64_t)addr_hi) << 32); ring_params->msi_addr |= (dma_addr_t)(((uint64_t)addr_hi) << 32);
ring_params->msi_data = (ce_id % msi_data_count) + msi_data_start; ring_params->msi_data = (msi_data_idx % msi_data_count) + msi_data_start;
ring_params->flags |= HAL_SRNG_FLAGS_MSI_INTR; ring_params->flags |= HAL_SRNG_FLAGS_MSI_INTR;
} }
......
...@@ -173,6 +173,7 @@ struct ath11k_ce { ...@@ -173,6 +173,7 @@ struct ath11k_ce {
extern const struct ce_attr ath11k_host_ce_config_ipq8074[]; extern const struct ce_attr ath11k_host_ce_config_ipq8074[];
extern const struct ce_attr ath11k_host_ce_config_qca6390[]; extern const struct ce_attr ath11k_host_ce_config_qca6390[];
extern const struct ce_attr ath11k_host_ce_config_qcn9074[];
void ath11k_ce_cleanup_pipes(struct ath11k_base *ab); void ath11k_ce_cleanup_pipes(struct ath11k_base *ab);
void ath11k_ce_rx_replenish_retry(struct timer_list *t); void ath11k_ce_rx_replenish_retry(struct timer_list *t);
......
...@@ -45,6 +45,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -45,6 +45,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.ring_mask = &ath11k_hw_ring_mask_ipq8074, .ring_mask = &ath11k_hw_ring_mask_ipq8074,
.internal_sleep_clock = false, .internal_sleep_clock = false,
.regs = &ipq8074_regs, .regs = &ipq8074_regs,
.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074,
.host_ce_config = ath11k_host_ce_config_ipq8074, .host_ce_config = ath11k_host_ce_config_ipq8074,
.ce_count = 12, .ce_count = 12,
.target_ce_config = ath11k_target_ce_config_wlan_ipq8074, .target_ce_config = ath11k_target_ce_config_wlan_ipq8074,
...@@ -68,6 +69,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -68,6 +69,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.idle_ps = false, .idle_ps = false,
.cold_boot_calib = true, .cold_boot_calib = true,
.supports_suspend = false, .supports_suspend = false,
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
}, },
{ {
.hw_rev = ATH11K_HW_IPQ6018_HW10, .hw_rev = ATH11K_HW_IPQ6018_HW10,
...@@ -83,6 +85,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -83,6 +85,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.ring_mask = &ath11k_hw_ring_mask_ipq8074, .ring_mask = &ath11k_hw_ring_mask_ipq8074,
.internal_sleep_clock = false, .internal_sleep_clock = false,
.regs = &ipq8074_regs, .regs = &ipq8074_regs,
.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074,
.host_ce_config = ath11k_host_ce_config_ipq8074, .host_ce_config = ath11k_host_ce_config_ipq8074,
.ce_count = 12, .ce_count = 12,
.target_ce_config = ath11k_target_ce_config_wlan_ipq8074, .target_ce_config = ath11k_target_ce_config_wlan_ipq8074,
...@@ -106,6 +109,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -106,6 +109,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.idle_ps = false, .idle_ps = false,
.cold_boot_calib = true, .cold_boot_calib = true,
.supports_suspend = false, .supports_suspend = false,
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
}, },
{ {
.name = "qca6390 hw2.0", .name = "qca6390 hw2.0",
...@@ -121,6 +125,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -121,6 +125,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.ring_mask = &ath11k_hw_ring_mask_qca6390, .ring_mask = &ath11k_hw_ring_mask_qca6390,
.internal_sleep_clock = true, .internal_sleep_clock = true,
.regs = &qca6390_regs, .regs = &qca6390_regs,
.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390,
.host_ce_config = ath11k_host_ce_config_qca6390, .host_ce_config = ath11k_host_ce_config_qca6390,
.ce_count = 9, .ce_count = 9,
.target_ce_config = ath11k_target_ce_config_wlan_qca6390, .target_ce_config = ath11k_target_ce_config_wlan_qca6390,
...@@ -143,6 +148,44 @@ static const struct ath11k_hw_params ath11k_hw_params[] = { ...@@ -143,6 +148,44 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.idle_ps = true, .idle_ps = true,
.cold_boot_calib = false, .cold_boot_calib = false,
.supports_suspend = true, .supports_suspend = true,
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
},
{
.name = "qcn9074 hw1.0",
.hw_rev = ATH11K_HW_QCN9074_HW10,
.fw = {
.dir = "QCN9074/hw1.0",
.board_size = 256 * 1024,
.cal_size = 256 * 1024,
},
.max_radios = 1,
.single_pdev_only = false,
.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074,
.hw_ops = &qcn9074_ops,
.ring_mask = &ath11k_hw_ring_mask_qcn9074,
.internal_sleep_clock = false,
.regs = &qcn9074_regs,
.host_ce_config = ath11k_host_ce_config_qcn9074,
.ce_count = 6,
.target_ce_config = ath11k_target_ce_config_wlan_qcn9074,
.target_ce_count = 9,
.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qcn9074,
.svc_to_ce_map_len = 18,
.rxdma1_enable = true,
.num_rxmda_per_pdev = 1,
.rx_mac_buf_ring = false,
.vdev_start_delay = false,
.htt_peer_map_v2 = true,
.tcl_0_only = false,
.interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
BIT(NL80211_IFTYPE_MESH_POINT),
.supports_monitor = true,
.supports_shadow_regs = false,
.idle_ps = false,
.cold_boot_calib = false,
.supports_suspend = false,
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
}, },
}; };
...@@ -974,7 +1017,7 @@ static int ath11k_init_hw_params(struct ath11k_base *ab) ...@@ -974,7 +1017,7 @@ static int ath11k_init_hw_params(struct ath11k_base *ab)
ab->hw_params = *hw_params; ab->hw_params = *hw_params;
ath11k_dbg(ab, ATH11K_DBG_BOOT, "Hardware name %s\n", ab->hw_params.name); ath11k_info(ab, "%s\n", ab->hw_params.name);
return 0; return 0;
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#define ATH11K_PRB_RSP_DROP_THRESHOLD ((ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI * 3) / 4) #define ATH11K_PRB_RSP_DROP_THRESHOLD ((ATH11K_TX_MGMT_TARGET_MAX_SUPPORT_WMI * 3) / 4)
#define ATH11K_INVALID_HW_MAC_ID 0xFF #define ATH11K_INVALID_HW_MAC_ID 0xFF
#define ATH11K_CONNECTION_LOSS_HZ (3 * HZ)
extern unsigned int ath11k_frame_mode; extern unsigned int ath11k_frame_mode;
...@@ -105,6 +106,7 @@ enum ath11k_hw_rev { ...@@ -105,6 +106,7 @@ enum ath11k_hw_rev {
ATH11K_HW_IPQ8074, ATH11K_HW_IPQ8074,
ATH11K_HW_QCA6390_HW20, ATH11K_HW_QCA6390_HW20,
ATH11K_HW_IPQ6018_HW10, ATH11K_HW_IPQ6018_HW10,
ATH11K_HW_QCN9074_HW10,
}; };
enum ath11k_firmware_mode { enum ath11k_firmware_mode {
...@@ -234,6 +236,7 @@ struct ath11k_vif { ...@@ -234,6 +236,7 @@ struct ath11k_vif {
u32 aid; u32 aid;
u8 bssid[ETH_ALEN]; u8 bssid[ETH_ALEN];
struct cfg80211_bitrate_mask bitrate_mask; struct cfg80211_bitrate_mask bitrate_mask;
struct delayed_work connection_loss_work;
int num_legacy_stations; int num_legacy_stations;
int rtscts_prot_mode; int rtscts_prot_mode;
int txpower; int txpower;
...@@ -607,6 +610,7 @@ struct ath11k_bus_params { ...@@ -607,6 +610,7 @@ struct ath11k_bus_params {
bool m3_fw_support; bool m3_fw_support;
bool fixed_bdf_addr; bool fixed_bdf_addr;
bool fixed_mem_region; bool fixed_mem_region;
bool static_window_map;
}; };
/* IPQ8074 HW channel counters frequency value in hertz */ /* IPQ8074 HW channel counters frequency value in hertz */
...@@ -876,6 +880,8 @@ extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018 ...@@ -876,6 +880,8 @@ extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq6018
extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[]; extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[]; extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[];
extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[];
int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab); int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
int ath11k_core_pre_init(struct ath11k_base *ab); int ath11k_core_pre_init(struct ath11k_base *ab);
int ath11k_core_init(struct ath11k_base *ath11k); int ath11k_core_init(struct ath11k_base *ath11k);
......
...@@ -3851,7 +3851,7 @@ htt_print_pdev_obss_pd_stats_tlv_v(const void *tag_buf, ...@@ -3851,7 +3851,7 @@ htt_print_pdev_obss_pd_stats_tlv_v(const void *tag_buf,
htt_stats_buf->num_non_srg_ppdu_tried); htt_stats_buf->num_non_srg_ppdu_tried);
len += HTT_DBG_OUT(buf + len, buf_len - len, "Non-SRG success PPDU = %u\n", len += HTT_DBG_OUT(buf + len, buf_len - len, "Non-SRG success PPDU = %u\n",
htt_stats_buf->num_non_srg_ppdu_success); htt_stats_buf->num_non_srg_ppdu_success);
len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG Opportunies = %u\n", len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG Opportunities = %u\n",
htt_stats_buf->num_srg_opportunities); htt_stats_buf->num_srg_opportunities);
len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG tried PPDU = %u\n", len += HTT_DBG_OUT(buf + len, buf_len - len, "SRG tried PPDU = %u\n",
htt_stats_buf->num_srg_ppdu_tried); htt_stats_buf->num_srg_ppdu_tried);
......
This diff is collapsed.
...@@ -178,7 +178,7 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif, ...@@ -178,7 +178,7 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
} }
if (ieee80211_vif_is_mesh(arvif->vif)) if (ieee80211_vif_is_mesh(arvif->vif))
ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE, 1); ti.enable_mesh = true;
ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE, 1); ti.flags1 |= FIELD_PREP(HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE, 1);
...@@ -792,8 +792,8 @@ int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id, ...@@ -792,8 +792,8 @@ int ath11k_dp_tx_htt_srng_setup(struct ath11k_base *ab, u32 ring_id,
cmd->ring_tail_off32_remote_addr_hi = (u64)tp_addr >> cmd->ring_tail_off32_remote_addr_hi = (u64)tp_addr >>
HAL_ADDR_MSB_REG_SHIFT; HAL_ADDR_MSB_REG_SHIFT;
cmd->ring_msi_addr_lo = params.msi_addr & 0xffffffff; cmd->ring_msi_addr_lo = lower_32_bits(params.msi_addr);
cmd->ring_msi_addr_hi = ((uint64_t)(params.msi_addr) >> 32) & 0xffffffff; cmd->ring_msi_addr_hi = upper_32_bits(params.msi_addr);
cmd->msi_data = params.msi_data; cmd->msi_data = params.msi_data;
cmd->intr_info = FIELD_PREP( cmd->intr_info = FIELD_PREP(
......
...@@ -89,17 +89,6 @@ static const struct hal_srng_config hw_srng_config_template[] = { ...@@ -89,17 +89,6 @@ static const struct hal_srng_config hw_srng_config_template[] = {
.entry_size = sizeof(struct hal_ce_srng_src_desc) >> 2, .entry_size = sizeof(struct hal_ce_srng_src_desc) >> 2,
.lmac_ring = false, .lmac_ring = false,
.ring_dir = HAL_SRNG_DIR_SRC, .ring_dir = HAL_SRNG_DIR_SRC,
.reg_start = {
(HAL_SEQ_WCSS_UMAC_CE0_SRC_REG +
HAL_CE_DST_RING_BASE_LSB),
HAL_SEQ_WCSS_UMAC_CE0_SRC_REG + HAL_CE_DST_RING_HP,
},
.reg_size = {
(HAL_SEQ_WCSS_UMAC_CE1_SRC_REG -
HAL_SEQ_WCSS_UMAC_CE0_SRC_REG),
(HAL_SEQ_WCSS_UMAC_CE1_SRC_REG -
HAL_SEQ_WCSS_UMAC_CE0_SRC_REG),
},
.max_size = HAL_CE_SRC_RING_BASE_MSB_RING_SIZE, .max_size = HAL_CE_SRC_RING_BASE_MSB_RING_SIZE,
}, },
{ /* CE_DST */ { /* CE_DST */
...@@ -108,17 +97,6 @@ static const struct hal_srng_config hw_srng_config_template[] = { ...@@ -108,17 +97,6 @@ static const struct hal_srng_config hw_srng_config_template[] = {
.entry_size = sizeof(struct hal_ce_srng_dest_desc) >> 2, .entry_size = sizeof(struct hal_ce_srng_dest_desc) >> 2,
.lmac_ring = false, .lmac_ring = false,
.ring_dir = HAL_SRNG_DIR_SRC, .ring_dir = HAL_SRNG_DIR_SRC,
.reg_start = {
(HAL_SEQ_WCSS_UMAC_CE0_DST_REG +
HAL_CE_DST_RING_BASE_LSB),
HAL_SEQ_WCSS_UMAC_CE0_DST_REG + HAL_CE_DST_RING_HP,
},
.reg_size = {
(HAL_SEQ_WCSS_UMAC_CE1_DST_REG -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG),
(HAL_SEQ_WCSS_UMAC_CE1_DST_REG -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG),
},
.max_size = HAL_CE_DST_RING_BASE_MSB_RING_SIZE, .max_size = HAL_CE_DST_RING_BASE_MSB_RING_SIZE,
}, },
{ /* CE_DST_STATUS */ { /* CE_DST_STATUS */
...@@ -127,18 +105,6 @@ static const struct hal_srng_config hw_srng_config_template[] = { ...@@ -127,18 +105,6 @@ static const struct hal_srng_config hw_srng_config_template[] = {
.entry_size = sizeof(struct hal_ce_srng_dst_status_desc) >> 2, .entry_size = sizeof(struct hal_ce_srng_dst_status_desc) >> 2,
.lmac_ring = false, .lmac_ring = false,
.ring_dir = HAL_SRNG_DIR_DST, .ring_dir = HAL_SRNG_DIR_DST,
.reg_start = {
(HAL_SEQ_WCSS_UMAC_CE0_DST_REG +
HAL_CE_DST_STATUS_RING_BASE_LSB),
(HAL_SEQ_WCSS_UMAC_CE0_DST_REG +
HAL_CE_DST_STATUS_RING_HP),
},
.reg_size = {
(HAL_SEQ_WCSS_UMAC_CE1_DST_REG -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG),
(HAL_SEQ_WCSS_UMAC_CE1_DST_REG -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG),
},
.max_size = HAL_CE_DST_STATUS_RING_BASE_MSB_RING_SIZE, .max_size = HAL_CE_DST_STATUS_RING_BASE_MSB_RING_SIZE,
}, },
{ /* WBM_IDLE_LINK */ { /* WBM_IDLE_LINK */
...@@ -147,11 +113,6 @@ static const struct hal_srng_config hw_srng_config_template[] = { ...@@ -147,11 +113,6 @@ static const struct hal_srng_config hw_srng_config_template[] = {
.entry_size = sizeof(struct hal_wbm_link_desc) >> 2, .entry_size = sizeof(struct hal_wbm_link_desc) >> 2,
.lmac_ring = false, .lmac_ring = false,
.ring_dir = HAL_SRNG_DIR_SRC, .ring_dir = HAL_SRNG_DIR_SRC,
.reg_start = {
(HAL_SEQ_WCSS_UMAC_WBM_REG +
HAL_WBM_IDLE_LINK_RING_BASE_LSB),
(HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_HP),
},
.max_size = HAL_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE, .max_size = HAL_WBM_IDLE_LINK_RING_BASE_MSB_RING_SIZE,
}, },
{ /* SW2WBM_RELEASE */ { /* SW2WBM_RELEASE */
...@@ -160,11 +121,6 @@ static const struct hal_srng_config hw_srng_config_template[] = { ...@@ -160,11 +121,6 @@ static const struct hal_srng_config hw_srng_config_template[] = {
.entry_size = sizeof(struct hal_wbm_release_ring) >> 2, .entry_size = sizeof(struct hal_wbm_release_ring) >> 2,
.lmac_ring = false, .lmac_ring = false,
.ring_dir = HAL_SRNG_DIR_SRC, .ring_dir = HAL_SRNG_DIR_SRC,
.reg_start = {
(HAL_SEQ_WCSS_UMAC_WBM_REG +
HAL_WBM_RELEASE_RING_BASE_LSB),
(HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_HP),
},
.max_size = HAL_SW2WBM_RELEASE_RING_BASE_MSB_RING_SIZE, .max_size = HAL_SW2WBM_RELEASE_RING_BASE_MSB_RING_SIZE,
}, },
{ /* WBM2SW_RELEASE */ { /* WBM2SW_RELEASE */
...@@ -173,16 +129,6 @@ static const struct hal_srng_config hw_srng_config_template[] = { ...@@ -173,16 +129,6 @@ static const struct hal_srng_config hw_srng_config_template[] = {
.entry_size = sizeof(struct hal_wbm_release_ring) >> 2, .entry_size = sizeof(struct hal_wbm_release_ring) >> 2,
.lmac_ring = false, .lmac_ring = false,
.ring_dir = HAL_SRNG_DIR_DST, .ring_dir = HAL_SRNG_DIR_DST,
.reg_start = {
(HAL_SEQ_WCSS_UMAC_WBM_REG +
HAL_WBM0_RELEASE_RING_BASE_LSB),
(HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_HP),
},
.reg_size = {
(HAL_WBM1_RELEASE_RING_BASE_LSB -
HAL_WBM0_RELEASE_RING_BASE_LSB),
(HAL_WBM1_RELEASE_RING_HP - HAL_WBM0_RELEASE_RING_HP),
},
.max_size = HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE, .max_size = HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE,
}, },
{ /* RXDMA_BUF */ { /* RXDMA_BUF */
...@@ -955,7 +901,7 @@ void ath11k_hal_setup_link_idle_list(struct ath11k_base *ab, ...@@ -955,7 +901,7 @@ void ath11k_hal_setup_link_idle_list(struct ath11k_base *ab,
/* Enable the SRNG */ /* Enable the SRNG */
ath11k_hif_write32(ab, ath11k_hif_write32(ab,
HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_SEQ_WCSS_UMAC_WBM_REG +
HAL_WBM_IDLE_LINK_RING_MISC_ADDR, 0x40); HAL_WBM_IDLE_LINK_RING_MISC_ADDR(ab), 0x40);
} }
int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type, int ath11k_hal_srng_setup(struct ath11k_base *ab, enum hal_ring_type type,
...@@ -1234,6 +1180,46 @@ static int ath11k_hal_srng_create_config(struct ath11k_base *ab) ...@@ -1234,6 +1180,46 @@ static int ath11k_hal_srng_create_config(struct ath11k_base *ab)
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_BASE_LSB(ab); s->reg_start[0] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_BASE_LSB(ab);
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_HP; s->reg_start[1] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_HP;
s = &hal->srng_config[HAL_CE_SRC];
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_BASE_LSB;
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_HP;
s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) -
HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab);
s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) -
HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab);
s = &hal->srng_config[HAL_CE_DST];
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_BASE_LSB;
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_HP;
s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
s = &hal->srng_config[HAL_CE_DST_STATUS];
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) +
HAL_CE_DST_STATUS_RING_BASE_LSB;
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_STATUS_RING_HP;
s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
s = &hal->srng_config[HAL_WBM_IDLE_LINK];
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_BASE_LSB(ab);
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_IDLE_LINK_RING_HP;
s = &hal->srng_config[HAL_SW2WBM_RELEASE];
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_BASE_LSB(ab);
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM_RELEASE_RING_HP;
s = &hal->srng_config[HAL_WBM2SW_RELEASE];
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_BASE_LSB(ab);
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_WBM_REG + HAL_WBM0_RELEASE_RING_HP;
s->reg_size[0] = HAL_WBM1_RELEASE_RING_BASE_LSB(ab) -
HAL_WBM0_RELEASE_RING_BASE_LSB(ab);
s->reg_size[1] = HAL_WBM1_RELEASE_RING_HP - HAL_WBM0_RELEASE_RING_HP;
return 0; return 0;
} }
......
...@@ -39,14 +39,22 @@ struct ath11k_base; ...@@ -39,14 +39,22 @@ struct ath11k_base;
#define HAL_SHADOW_REG(x) (HAL_SHADOW_BASE_ADDR + (4 * (x))) #define HAL_SHADOW_REG(x) (HAL_SHADOW_BASE_ADDR + (4 * (x)))
/* WCSS Relative address */ /* WCSS Relative address */
#define HAL_SEQ_WCSS_UMAC_OFFSET 0x00a00000
#define HAL_SEQ_WCSS_UMAC_REO_REG 0x00a38000 #define HAL_SEQ_WCSS_UMAC_REO_REG 0x00a38000
#define HAL_SEQ_WCSS_UMAC_TCL_REG 0x00a44000 #define HAL_SEQ_WCSS_UMAC_TCL_REG 0x00a44000
#define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG 0x00a00000 #define HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(x) \
#define HAL_SEQ_WCSS_UMAC_CE0_DST_REG 0x00a01000 (ab->hw_params.regs->hal_seq_wcss_umac_ce0_src_reg)
#define HAL_SEQ_WCSS_UMAC_CE1_SRC_REG 0x00a02000 #define HAL_SEQ_WCSS_UMAC_CE0_DST_REG(x) \
#define HAL_SEQ_WCSS_UMAC_CE1_DST_REG 0x00a03000 (ab->hw_params.regs->hal_seq_wcss_umac_ce0_dst_reg)
#define HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(x) \
(ab->hw_params.regs->hal_seq_wcss_umac_ce1_src_reg)
#define HAL_SEQ_WCSS_UMAC_CE1_DST_REG(x) \
(ab->hw_params.regs->hal_seq_wcss_umac_ce1_dst_reg)
#define HAL_SEQ_WCSS_UMAC_WBM_REG 0x00a34000 #define HAL_SEQ_WCSS_UMAC_WBM_REG 0x00a34000
#define HAL_CE_WFSS_CE_REG_BASE 0x01b80000
#define HAL_WLAON_REG_BASE 0x01f80000
/* SW2TCL(x) R0 ring configuration address */ /* SW2TCL(x) R0 ring configuration address */
#define HAL_TCL1_RING_CMN_CTRL_REG 0x00000014 #define HAL_TCL1_RING_CMN_CTRL_REG 0x00000014
#define HAL_TCL1_RING_DSCP_TID_MAP 0x0000002c #define HAL_TCL1_RING_DSCP_TID_MAP 0x0000002c
...@@ -197,8 +205,10 @@ struct ath11k_base; ...@@ -197,8 +205,10 @@ struct ath11k_base;
#define HAL_REO_STATUS_HP(ab) ab->hw_params.regs->hal_reo_status_hp #define HAL_REO_STATUS_HP(ab) ab->hw_params.regs->hal_reo_status_hp
/* WBM Idle R0 address */ /* WBM Idle R0 address */
#define HAL_WBM_IDLE_LINK_RING_BASE_LSB 0x00000860 #define HAL_WBM_IDLE_LINK_RING_BASE_LSB(x) \
#define HAL_WBM_IDLE_LINK_RING_MISC_ADDR 0x00000870 (ab->hw_params.regs->hal_wbm_idle_link_ring_base_lsb)
#define HAL_WBM_IDLE_LINK_RING_MISC_ADDR(x) \
(ab->hw_params.regs->hal_wbm_idle_link_ring_misc)
#define HAL_WBM_R0_IDLE_LIST_CONTROL_ADDR 0x00000048 #define HAL_WBM_R0_IDLE_LIST_CONTROL_ADDR 0x00000048
#define HAL_WBM_R0_IDLE_LIST_SIZE_ADDR 0x0000004c #define HAL_WBM_R0_IDLE_LIST_SIZE_ADDR 0x0000004c
#define HAL_WBM_SCATTERED_RING_BASE_LSB 0x00000058 #define HAL_WBM_SCATTERED_RING_BASE_LSB 0x00000058
...@@ -213,14 +223,17 @@ struct ath11k_base; ...@@ -213,14 +223,17 @@ struct ath11k_base;
#define HAL_WBM_IDLE_LINK_RING_HP 0x000030b0 #define HAL_WBM_IDLE_LINK_RING_HP 0x000030b0
/* SW2WBM R0 release address */ /* SW2WBM R0 release address */
#define HAL_WBM_RELEASE_RING_BASE_LSB 0x000001d8 #define HAL_WBM_RELEASE_RING_BASE_LSB(x) \
(ab->hw_params.regs->hal_wbm_release_ring_base_lsb)
/* SW2WBM R2 release address */ /* SW2WBM R2 release address */
#define HAL_WBM_RELEASE_RING_HP 0x00003018 #define HAL_WBM_RELEASE_RING_HP 0x00003018
/* WBM2SW R0 release address */ /* WBM2SW R0 release address */
#define HAL_WBM0_RELEASE_RING_BASE_LSB 0x00000910 #define HAL_WBM0_RELEASE_RING_BASE_LSB(x) \
#define HAL_WBM1_RELEASE_RING_BASE_LSB 0x00000968 (ab->hw_params.regs->hal_wbm0_release_ring_base_lsb)
#define HAL_WBM1_RELEASE_RING_BASE_LSB(x) \
(ab->hw_params.regs->hal_wbm1_release_ring_base_lsb)
/* WBM2SW R2 release address */ /* WBM2SW R2 release address */
#define HAL_WBM0_RELEASE_RING_HP 0x000030c0 #define HAL_WBM0_RELEASE_RING_HP 0x000030c0
...@@ -303,8 +316,6 @@ struct ath11k_base; ...@@ -303,8 +316,6 @@ struct ath11k_base;
#define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE 0x000fffff #define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE 0x000fffff
#define HAL_RXDMA_RING_MAX_SIZE 0x0000ffff #define HAL_RXDMA_RING_MAX_SIZE 0x0000ffff
#define HAL_RX_DESC_SIZE (sizeof(struct hal_rx_desc))
/* Add any other errors here and return them in /* Add any other errors here and return them in
* ath11k_hal_rx_desc_get_err(). * ath11k_hal_rx_desc_get_err().
*/ */
......
...@@ -949,16 +949,17 @@ struct hal_reo_flush_cache { ...@@ -949,16 +949,17 @@ struct hal_reo_flush_cache {
#define HAL_TCL_DATA_CMD_INFO1_TO_FW BIT(21) #define HAL_TCL_DATA_CMD_INFO1_TO_FW BIT(21)
#define HAL_TCL_DATA_CMD_INFO1_PKT_OFFSET GENMASK(31, 23) #define HAL_TCL_DATA_CMD_INFO1_PKT_OFFSET GENMASK(31, 23)
#define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP GENMASK(18, 0) #define HAL_TCL_DATA_CMD_INFO2_BUF_TIMESTAMP GENMASK(18, 0)
#define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID BIT(19) #define HAL_TCL_DATA_CMD_INFO2_BUF_T_VALID BIT(19)
#define HAL_TCL_DATA_CMD_INFO2_MESH_ENABLE BIT(20) #define HAL_IPQ8074_TCL_DATA_CMD_INFO2_MESH_ENABLE BIT(20)
#define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE BIT(21) #define HAL_TCL_DATA_CMD_INFO2_TID_OVERWRITE BIT(21)
#define HAL_TCL_DATA_CMD_INFO2_TID GENMASK(25, 22) #define HAL_TCL_DATA_CMD_INFO2_TID GENMASK(25, 22)
#define HAL_TCL_DATA_CMD_INFO2_LMAC_ID GENMASK(27, 26) #define HAL_TCL_DATA_CMD_INFO2_LMAC_ID GENMASK(27, 26)
#define HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX GENMASK(5, 0) #define HAL_TCL_DATA_CMD_INFO3_DSCP_TID_TABLE_IDX GENMASK(5, 0)
#define HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX GENMASK(25, 6) #define HAL_TCL_DATA_CMD_INFO3_SEARCH_INDEX GENMASK(25, 6)
#define HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM GENMASK(29, 26) #define HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM GENMASK(29, 26)
#define HAL_QCN9074_TCL_DATA_CMD_INFO3_MESH_ENABLE GENMASK(31, 30)
#define HAL_TCL_DATA_CMD_INFO4_RING_ID GENMASK(27, 20) #define HAL_TCL_DATA_CMD_INFO4_RING_ID GENMASK(27, 20)
#define HAL_TCL_DATA_CMD_INFO4_LOOPING_COUNT GENMASK(31, 28) #define HAL_TCL_DATA_CMD_INFO4_LOOPING_COUNT GENMASK(31, 28)
......
...@@ -75,6 +75,9 @@ void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd, ...@@ -75,6 +75,9 @@ void ath11k_hal_tx_cmd_desc_setup(struct ath11k_base *ab, void *cmd,
FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM, FIELD_PREP(HAL_TCL_DATA_CMD_INFO3_CACHE_SET_NUM,
ti->bss_ast_hash); ti->bss_ast_hash);
tcl_cmd->info4 = 0; tcl_cmd->info4 = 0;
if (ti->enable_mesh)
ab->hw_params.hw_ops->tx_mesh_enable(ab, tcl_cmd);
} }
void ath11k_hal_tx_set_dscp_tid_map(struct ath11k_base *ab, int id) void ath11k_hal_tx_set_dscp_tid_map(struct ath11k_base *ab, int id)
......
...@@ -34,6 +34,7 @@ struct hal_tx_info { ...@@ -34,6 +34,7 @@ struct hal_tx_info {
u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */ u8 search_type; /* %HAL_TX_ADDR_SEARCH_ */
u8 lmac_id; u8 lmac_id;
u8 dscp_tid_tbl_idx; u8 dscp_tid_tbl_idx;
bool enable_mesh;
}; };
/* TODO: Check if the actual desc macros can be used instead */ /* TODO: Check if the actual desc macros can be used instead */
......
...@@ -28,6 +28,7 @@ struct ath11k_hif_ops { ...@@ -28,6 +28,7 @@ struct ath11k_hif_ops {
u32 *msi_addr_hi); u32 *msi_addr_hi);
void (*ce_irq_enable)(struct ath11k_base *ab); void (*ce_irq_enable)(struct ath11k_base *ab);
void (*ce_irq_disable)(struct ath11k_base *ab); void (*ce_irq_disable)(struct ath11k_base *ab);
void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx);
}; };
static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab) static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab)
...@@ -124,4 +125,13 @@ static inline void ath11k_get_msi_address(struct ath11k_base *ab, u32 *msi_addr_ ...@@ -124,4 +125,13 @@ static inline void ath11k_get_msi_address(struct ath11k_base *ab, u32 *msi_addr_
ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi); ab->hif.ops->get_msi_address(ab, msi_addr_lo, msi_addr_hi);
} }
static inline void ath11k_get_ce_msi_idx(struct ath11k_base *ab, u32 ce_id,
u32 *msi_data_idx)
{
if (ab->hif.ops->get_ce_msi_idx)
ab->hif.ops->get_ce_msi_idx(ab, ce_id, msi_data_idx);
else
*msi_data_idx = ce_id;
}
#endif /* _HIF_H_ */ #endif /* _HIF_H_ */
This diff is collapsed.
...@@ -105,6 +105,9 @@ enum ath11k_bus { ...@@ -105,6 +105,9 @@ enum ath11k_bus {
#define ATH11K_EXT_IRQ_GRP_NUM_MAX 11 #define ATH11K_EXT_IRQ_GRP_NUM_MAX 11
struct hal_rx_desc;
struct hal_tcl_data_cmd;
struct ath11k_hw_ring_mask { struct ath11k_hw_ring_mask {
u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX]; u8 tx[ATH11K_EXT_IRQ_GRP_NUM_MAX];
u8 rx_mon_status[ATH11K_EXT_IRQ_GRP_NUM_MAX]; u8 rx_mon_status[ATH11K_EXT_IRQ_GRP_NUM_MAX];
...@@ -134,6 +137,7 @@ struct ath11k_hw_params { ...@@ -134,6 +137,7 @@ struct ath11k_hw_params {
bool internal_sleep_clock; bool internal_sleep_clock;
const struct ath11k_hw_regs *regs; const struct ath11k_hw_regs *regs;
u32 qmi_service_ins_id;
const struct ce_attr *host_ce_config; const struct ce_attr *host_ce_config;
u32 ce_count; u32 ce_count;
const struct ce_pipe_config *target_ce_config; const struct ce_pipe_config *target_ce_config;
...@@ -157,6 +161,7 @@ struct ath11k_hw_params { ...@@ -157,6 +161,7 @@ struct ath11k_hw_params {
bool idle_ps; bool idle_ps;
bool cold_boot_calib; bool cold_boot_calib;
bool supports_suspend; bool supports_suspend;
u32 hal_desc_sz;
}; };
struct ath11k_hw_ops { struct ath11k_hw_ops {
...@@ -165,14 +170,45 @@ struct ath11k_hw_ops { ...@@ -165,14 +170,45 @@ struct ath11k_hw_ops {
struct target_resource_config *config); struct target_resource_config *config);
int (*mac_id_to_pdev_id)(struct ath11k_hw_params *hw, int mac_id); int (*mac_id_to_pdev_id)(struct ath11k_hw_params *hw, int mac_id);
int (*mac_id_to_srng_id)(struct ath11k_hw_params *hw, int mac_id); int (*mac_id_to_srng_id)(struct ath11k_hw_params *hw, int mac_id);
void (*tx_mesh_enable)(struct ath11k_base *ab,
struct hal_tcl_data_cmd *tcl_cmd);
bool (*rx_desc_get_first_msdu)(struct hal_rx_desc *desc);
bool (*rx_desc_get_last_msdu)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc);
u8 *(*rx_desc_get_hdr_status)(struct hal_rx_desc *desc);
bool (*rx_desc_encrypt_valid)(struct hal_rx_desc *desc);
u32 (*rx_desc_get_encrypt_type)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_decap_type)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_mesh_ctl)(struct hal_rx_desc *desc);
bool (*rx_desc_get_mpdu_seq_ctl_vld)(struct hal_rx_desc *desc);
bool (*rx_desc_get_mpdu_fc_valid)(struct hal_rx_desc *desc);
u16 (*rx_desc_get_mpdu_start_seq_no)(struct hal_rx_desc *desc);
u16 (*rx_desc_get_msdu_len)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_msdu_sgi)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_msdu_rate_mcs)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_msdu_rx_bw)(struct hal_rx_desc *desc);
u32 (*rx_desc_get_msdu_freq)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_msdu_pkt_type)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_msdu_nss)(struct hal_rx_desc *desc);
u8 (*rx_desc_get_mpdu_tid)(struct hal_rx_desc *desc);
u16 (*rx_desc_get_mpdu_peer_id)(struct hal_rx_desc *desc);
void (*rx_desc_copy_attn_end_tlv)(struct hal_rx_desc *fdesc,
struct hal_rx_desc *ldesc);
u32 (*rx_desc_get_mpdu_start_tag)(struct hal_rx_desc *desc);
u32 (*rx_desc_get_mpdu_ppdu_id)(struct hal_rx_desc *desc);
void (*rx_desc_set_msdu_len)(struct hal_rx_desc *desc, u16 len);
struct rx_attention *(*rx_desc_get_attention)(struct hal_rx_desc *desc);
u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc);
}; };
extern const struct ath11k_hw_ops ipq8074_ops; extern const struct ath11k_hw_ops ipq8074_ops;
extern const struct ath11k_hw_ops ipq6018_ops; extern const struct ath11k_hw_ops ipq6018_ops;
extern const struct ath11k_hw_ops qca6390_ops; extern const struct ath11k_hw_ops qca6390_ops;
extern const struct ath11k_hw_ops qcn9074_ops;
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074; extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;
extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074;
static inline static inline
int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw, int ath11k_hw_get_mac_from_pdev_id(struct ath11k_hw_params *hw,
...@@ -261,9 +297,26 @@ struct ath11k_hw_regs { ...@@ -261,9 +297,26 @@ struct ath11k_hw_regs {
u32 hal_reo_status_ring_base_lsb; u32 hal_reo_status_ring_base_lsb;
u32 hal_reo_status_hp; u32 hal_reo_status_hp;
u32 hal_seq_wcss_umac_ce0_src_reg;
u32 hal_seq_wcss_umac_ce0_dst_reg;
u32 hal_seq_wcss_umac_ce1_src_reg;
u32 hal_seq_wcss_umac_ce1_dst_reg;
u32 hal_wbm_idle_link_ring_base_lsb;
u32 hal_wbm_idle_link_ring_misc;
u32 hal_wbm_release_ring_base_lsb;
u32 hal_wbm0_release_ring_base_lsb;
u32 hal_wbm1_release_ring_base_lsb;
u32 pcie_qserdes_sysclk_en_sel;
u32 pcie_pcs_osc_dtct_config_base;
}; };
extern const struct ath11k_hw_regs ipq8074_regs; extern const struct ath11k_hw_regs ipq8074_regs;
extern const struct ath11k_hw_regs qca6390_regs; extern const struct ath11k_hw_regs qca6390_regs;
extern const struct ath11k_hw_regs qcn9074_regs;
#endif #endif
...@@ -829,6 +829,75 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif, ...@@ -829,6 +829,75 @@ static void ath11k_control_beaconing(struct ath11k_vif *arvif,
ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id); ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev %d up\n", arvif->vdev_id);
} }
static void ath11k_mac_handle_beacon_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct sk_buff *skb = data;
struct ieee80211_mgmt *mgmt = (void *)skb->data;
struct ath11k_vif *arvif = (void *)vif->drv_priv;
if (vif->type != NL80211_IFTYPE_STATION)
return;
if (!ether_addr_equal(mgmt->bssid, vif->bss_conf.bssid))
return;
cancel_delayed_work(&arvif->connection_loss_work);
}
void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb)
{
ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_NORMAL,
ath11k_mac_handle_beacon_iter,
skb);
}
static void ath11k_mac_handle_beacon_miss_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
u32 *vdev_id = data;
struct ath11k_vif *arvif = (void *)vif->drv_priv;
struct ath11k *ar = arvif->ar;
struct ieee80211_hw *hw = ar->hw;
if (arvif->vdev_id != *vdev_id)
return;
if (!arvif->is_up)
return;
ieee80211_beacon_loss(vif);
/* Firmware doesn't report beacon loss events repeatedly. If AP probe
* (done by mac80211) succeeds but beacons do not resume then it
* doesn't make sense to continue operation. Queue connection loss work
* which can be cancelled when beacon is received.
*/
ieee80211_queue_delayed_work(hw, &arvif->connection_loss_work,
ATH11K_CONNECTION_LOSS_HZ);
}
void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id)
{
ieee80211_iterate_active_interfaces_atomic(ar->hw,
IEEE80211_IFACE_ITER_NORMAL,
ath11k_mac_handle_beacon_miss_iter,
&vdev_id);
}
static void ath11k_mac_vif_sta_connection_loss_work(struct work_struct *work)
{
struct ath11k_vif *arvif = container_of(work, struct ath11k_vif,
connection_loss_work.work);
struct ieee80211_vif *vif = arvif->vif;
if (!arvif->is_up)
return;
ieee80211_connection_loss(vif);
}
static void ath11k_peer_assoc_h_basic(struct ath11k *ar, static void ath11k_peer_assoc_h_basic(struct ath11k *ar,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
...@@ -1760,7 +1829,7 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw, ...@@ -1760,7 +1829,7 @@ static void ath11k_bss_disassoc(struct ieee80211_hw *hw,
arvif->is_up = false; arvif->is_up = false;
/* TODO: cancel connection_loss_work */ cancel_delayed_work_sync(&arvif->connection_loss_work);
} }
static u32 ath11k_mac_get_rate_hw_value(int bitrate) static u32 ath11k_mac_get_rate_hw_value(int bitrate)
...@@ -3919,8 +3988,6 @@ static int ath11k_mac_copy_he_cap(struct ath11k *ar, ...@@ -3919,8 +3988,6 @@ static int ath11k_mac_copy_he_cap(struct ath11k *ar,
he_cap_elem->phy_cap_info[5] &= he_cap_elem->phy_cap_info[5] &=
~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK; ~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_UNDER_80MHZ_MASK;
he_cap_elem->phy_cap_info[5] &=
~IEEE80211_HE_PHY_CAP5_BEAMFORMEE_NUM_SND_DIM_ABOVE_80MHZ_MASK;
he_cap_elem->phy_cap_info[5] |= ar->num_tx_chains - 1; he_cap_elem->phy_cap_info[5] |= ar->num_tx_chains - 1;
switch (i) { switch (i) {
...@@ -4213,7 +4280,7 @@ static int ath11k_mac_mgmt_tx(struct ath11k *ar, struct sk_buff *skb, ...@@ -4213,7 +4280,7 @@ static int ath11k_mac_mgmt_tx(struct ath11k *ar, struct sk_buff *skb,
return -ENOSPC; return -ENOSPC;
} }
if (skb_queue_len(q) == ATH11K_TX_MGMT_NUM_PENDING_MAX) { if (skb_queue_len_lockless(q) >= ATH11K_TX_MGMT_NUM_PENDING_MAX) {
ath11k_warn(ar->ab, "mgmt tx queue is full\n"); ath11k_warn(ar->ab, "mgmt tx queue is full\n");
return -ENOSPC; return -ENOSPC;
} }
...@@ -4617,10 +4684,8 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw, ...@@ -4617,10 +4684,8 @@ static int ath11k_mac_op_add_interface(struct ieee80211_hw *hw,
arvif->vif = vif; arvif->vif = vif;
INIT_LIST_HEAD(&arvif->list); INIT_LIST_HEAD(&arvif->list);
INIT_DELAYED_WORK(&arvif->connection_loss_work,
/* Should we initialize any worker to handle connection loss indication ath11k_mac_vif_sta_connection_loss_work);
* from firmware in sta mode?
*/
for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) {
arvif->bitrate_mask.control[i].legacy = 0xffffffff; arvif->bitrate_mask.control[i].legacy = 0xffffffff;
...@@ -4829,6 +4894,8 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw, ...@@ -4829,6 +4894,8 @@ static void ath11k_mac_op_remove_interface(struct ieee80211_hw *hw,
int ret; int ret;
int i; int i;
cancel_delayed_work_sync(&arvif->connection_loss_work);
mutex_lock(&ar->conf_mutex); mutex_lock(&ar->conf_mutex);
ath11k_dbg(ab, ATH11K_DBG_MAC, "mac remove interface (vdev %d)\n", ath11k_dbg(ab, ATH11K_DBG_MAC, "mac remove interface (vdev %d)\n",
...@@ -5096,13 +5163,15 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif, ...@@ -5096,13 +5163,15 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,
arg.channel.chan_radar = arg.channel.chan_radar =
!!(chandef->chan->flags & IEEE80211_CHAN_RADAR); !!(chandef->chan->flags & IEEE80211_CHAN_RADAR);
arg.channel.freq2_radar =
!!(chandef->chan->flags & IEEE80211_CHAN_RADAR);
arg.channel.passive = arg.channel.chan_radar; arg.channel.passive = arg.channel.chan_radar;
spin_lock_bh(&ab->base_lock); spin_lock_bh(&ab->base_lock);
arg.regdomain = ar->ab->dfs_region; arg.regdomain = ar->ab->dfs_region;
spin_unlock_bh(&ab->base_lock); spin_unlock_bh(&ab->base_lock);
/* TODO: Notify if secondary 80Mhz also needs radar detection */
if (he_support) { if (he_support) {
ret = ath11k_set_he_mu_sounding_mode(ar, arvif); ret = ath11k_set_he_mu_sounding_mode(ar, arvif);
if (ret) { if (ret) {
...@@ -6082,6 +6151,7 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw, ...@@ -6082,6 +6151,7 @@ static void ath11k_mac_op_sta_statistics(struct ieee80211_hw *hw,
/* TODO: Use real NF instead of default one. */ /* TODO: Use real NF instead of default one. */
sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; sinfo->signal = arsta->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR;
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL);
} }
static const struct ieee80211_ops ath11k_ops = { static const struct ieee80211_ops ath11k_ops = {
......
...@@ -150,4 +150,6 @@ int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx); ...@@ -150,4 +150,6 @@ int ath11k_mac_tx_mgmt_pending_free(int buf_id, void *skb, void *ctx);
u8 ath11k_mac_bw_to_mac80211_bw(u8 bw); u8 ath11k_mac_bw_to_mac80211_bw(u8 bw);
enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw); enum ath11k_supported_bw ath11k_mac_mac80211_bw_to_ath11k_bw(enum rate_info_bw bw);
enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher); enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher);
void ath11k_mac_handle_beacon(struct ath11k *ar, struct sk_buff *skb);
void ath11k_mac_handle_beacon_miss(struct ath11k *ar, u32 vdev_id);
#endif #endif
...@@ -7,10 +7,11 @@ ...@@ -7,10 +7,11 @@
#include "core.h" #include "core.h"
#include "debug.h" #include "debug.h"
#include "mhi.h" #include "mhi.h"
#include "pci.h"
#define MHI_TIMEOUT_DEFAULT_MS 90000 #define MHI_TIMEOUT_DEFAULT_MS 90000
static struct mhi_channel_config ath11k_mhi_channels[] = { static struct mhi_channel_config ath11k_mhi_channels_qca6390[] = {
{ {
.num = 0, .num = 0,
.name = "LOOPBACK", .name = "LOOPBACK",
...@@ -69,7 +70,7 @@ static struct mhi_channel_config ath11k_mhi_channels[] = { ...@@ -69,7 +70,7 @@ static struct mhi_channel_config ath11k_mhi_channels[] = {
}, },
}; };
static struct mhi_event_config ath11k_mhi_events[] = { static struct mhi_event_config ath11k_mhi_events_qca6390[] = {
{ {
.num_elements = 32, .num_elements = 32,
.irq_moderation_ms = 0, .irq_moderation_ms = 0,
...@@ -92,15 +93,108 @@ static struct mhi_event_config ath11k_mhi_events[] = { ...@@ -92,15 +93,108 @@ static struct mhi_event_config ath11k_mhi_events[] = {
}, },
}; };
static struct mhi_controller_config ath11k_mhi_config = { static struct mhi_controller_config ath11k_mhi_config_qca6390 = {
.max_channels = 128, .max_channels = 128,
.timeout_ms = 2000, .timeout_ms = 2000,
.use_bounce_buf = false, .use_bounce_buf = false,
.buf_len = 0, .buf_len = 0,
.num_channels = ARRAY_SIZE(ath11k_mhi_channels), .num_channels = ARRAY_SIZE(ath11k_mhi_channels_qca6390),
.ch_cfg = ath11k_mhi_channels, .ch_cfg = ath11k_mhi_channels_qca6390,
.num_events = ARRAY_SIZE(ath11k_mhi_events), .num_events = ARRAY_SIZE(ath11k_mhi_events_qca6390),
.event_cfg = ath11k_mhi_events, .event_cfg = ath11k_mhi_events_qca6390,
};
static struct mhi_channel_config ath11k_mhi_channels_qcn9074[] = {
{
.num = 0,
.name = "LOOPBACK",
.num_elements = 32,
.event_ring = 1,
.dir = DMA_TO_DEVICE,
.ee_mask = 0x14,
.pollcfg = 0,
.doorbell = MHI_DB_BRST_DISABLE,
.lpm_notify = false,
.offload_channel = false,
.doorbell_mode_switch = false,
.auto_queue = false,
},
{
.num = 1,
.name = "LOOPBACK",
.num_elements = 32,
.event_ring = 1,
.dir = DMA_FROM_DEVICE,
.ee_mask = 0x14,
.pollcfg = 0,
.doorbell = MHI_DB_BRST_DISABLE,
.lpm_notify = false,
.offload_channel = false,
.doorbell_mode_switch = false,
.auto_queue = false,
},
{
.num = 20,
.name = "IPCR",
.num_elements = 32,
.event_ring = 1,
.dir = DMA_TO_DEVICE,
.ee_mask = 0x14,
.pollcfg = 0,
.doorbell = MHI_DB_BRST_DISABLE,
.lpm_notify = false,
.offload_channel = false,
.doorbell_mode_switch = false,
.auto_queue = false,
},
{
.num = 21,
.name = "IPCR",
.num_elements = 32,
.event_ring = 1,
.dir = DMA_FROM_DEVICE,
.ee_mask = 0x14,
.pollcfg = 0,
.doorbell = MHI_DB_BRST_DISABLE,
.lpm_notify = false,
.offload_channel = false,
.doorbell_mode_switch = false,
.auto_queue = true,
},
};
static struct mhi_event_config ath11k_mhi_events_qcn9074[] = {
{
.num_elements = 32,
.irq_moderation_ms = 0,
.irq = 1,
.data_type = MHI_ER_CTRL,
.mode = MHI_DB_BRST_DISABLE,
.hardware_event = false,
.client_managed = false,
.offload_channel = false,
},
{
.num_elements = 256,
.irq_moderation_ms = 1,
.irq = 2,
.mode = MHI_DB_BRST_DISABLE,
.priority = 1,
.hardware_event = false,
.client_managed = false,
.offload_channel = false,
},
};
static struct mhi_controller_config ath11k_mhi_config_qcn9074 = {
.max_channels = 30,
.timeout_ms = 10000,
.use_bounce_buf = false,
.buf_len = 0,
.num_channels = ARRAY_SIZE(ath11k_mhi_channels_qcn9074),
.ch_cfg = ath11k_mhi_channels_qcn9074,
.num_events = ARRAY_SIZE(ath11k_mhi_events_qcn9074),
.event_cfg = ath11k_mhi_events_qcn9074,
}; };
void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab) void ath11k_mhi_set_mhictrl_reset(struct ath11k_base *ab)
...@@ -221,6 +315,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci) ...@@ -221,6 +315,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
{ {
struct ath11k_base *ab = ab_pci->ab; struct ath11k_base *ab = ab_pci->ab;
struct mhi_controller *mhi_ctrl; struct mhi_controller *mhi_ctrl;
struct mhi_controller_config *ath11k_mhi_config;
int ret; int ret;
mhi_ctrl = mhi_alloc_controller(); mhi_ctrl = mhi_alloc_controller();
...@@ -254,7 +349,12 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci) ...@@ -254,7 +349,12 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
mhi_ctrl->read_reg = ath11k_mhi_op_read_reg; mhi_ctrl->read_reg = ath11k_mhi_op_read_reg;
mhi_ctrl->write_reg = ath11k_mhi_op_write_reg; mhi_ctrl->write_reg = ath11k_mhi_op_write_reg;
ret = mhi_register_controller(mhi_ctrl, &ath11k_mhi_config); if (ab->hw_rev == ATH11K_HW_QCA6390_HW20)
ath11k_mhi_config = &ath11k_mhi_config_qca6390;
else if (ab->hw_rev == ATH11K_HW_QCN9074_HW10)
ath11k_mhi_config = &ath11k_mhi_config_qcn9074;
ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config);
if (ret) { if (ret) {
ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret); ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret);
mhi_free_controller(mhi_ctrl); mhi_free_controller(mhi_ctrl);
......
This diff is collapsed.
...@@ -34,16 +34,20 @@ ...@@ -34,16 +34,20 @@
#define PCIE_SMLH_REQ_RST_LINK_DOWN 0x2 #define PCIE_SMLH_REQ_RST_LINK_DOWN 0x2
#define PCIE_INT_CLEAR_ALL 0xffffffff #define PCIE_INT_CLEAR_ALL 0xffffffff
#define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG 0x01e0c0ac #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_REG(x) \
(ab->hw_params.regs->pcie_qserdes_sysclk_en_sel)
#define PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL 0x10 #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_VAL 0x10
#define PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK 0xffffffff #define PCIE_QSERDES_COM_SYSCLK_EN_SEL_MSK 0xffffffff
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_REG 0x01e0c628 #define PCIE_PCS_OSC_DTCT_CONFIG1_REG(x) \
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG1_VAL 0x02 (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base)
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_REG 0x01e0c62c #define PCIE_PCS_OSC_DTCT_CONFIG1_VAL 0x02
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG2_VAL 0x52 #define PCIE_PCS_OSC_DTCT_CONFIG2_REG(x) \
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_REG 0x01e0c634 (ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0x4)
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG4_VAL 0xff #define PCIE_PCS_OSC_DTCT_CONFIG2_VAL 0x52
#define PCIE_USB3_PCS_MISC_OSC_DTCT_CONFIG_MSK 0x000000ff #define PCIE_PCS_OSC_DTCT_CONFIG4_REG(x) \
(ab->hw_params.regs->pcie_pcs_osc_dtct_config_base + 0xc)
#define PCIE_PCS_OSC_DTCT_CONFIG4_VAL 0xff
#define PCIE_PCS_OSC_DTCT_CONFIG_MSK 0x000000ff
#define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c #define WLAON_QFPROM_PWR_CTRL_REG 0x01f8031c
#define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x4 #define QFPROM_PWR_CTRL_VDD4BLOW_MASK 0x4
...@@ -73,6 +77,7 @@ struct ath11k_pci { ...@@ -73,6 +77,7 @@ struct ath11k_pci {
char amss_path[100]; char amss_path[100];
u32 msi_ep_base_data; u32 msi_ep_base_data;
struct mhi_controller *mhi_ctrl; struct mhi_controller *mhi_ctrl;
const struct ath11k_msi_config *msi_config;
unsigned long mhi_state; unsigned long mhi_state;
u32 register_window; u32 register_window;
......
This diff is collapsed.
...@@ -21,11 +21,13 @@ ...@@ -21,11 +21,13 @@
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01 0x02
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCA6390 0x01
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02 #define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074 0x07
#define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32 #define ATH11K_QMI_WLANFW_MAX_TIMESTAMP_LEN_V01 32
#define ATH11K_QMI_RESP_LEN_MAX 8192 #define ATH11K_QMI_RESP_LEN_MAX 8192
#define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 32 #define ATH11K_QMI_WLANFW_MAX_NUM_MEM_SEG_V01 52
#define ATH11K_QMI_CALDB_SIZE 0x480000 #define ATH11K_QMI_CALDB_SIZE 0x480000
#define ATH11K_QMI_BDF_EXT_STR_LENGTH 0x20 #define ATH11K_QMI_BDF_EXT_STR_LENGTH 0x20
#define ATH11K_QMI_FW_MEM_REQ_SEGMENT_CNT 3
#define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035 #define QMI_WLFW_REQUEST_MEM_IND_V01 0x0035
#define QMI_WLFW_FW_MEM_READY_IND_V01 0x0037 #define QMI_WLFW_FW_MEM_READY_IND_V01 0x0037
...@@ -141,6 +143,7 @@ struct ath11k_qmi { ...@@ -141,6 +143,7 @@ struct ath11k_qmi {
#define QMI_IPQ8074_FW_MEM_MODE 0xFF #define QMI_IPQ8074_FW_MEM_MODE 0xFF
#define HOST_DDR_REGION_TYPE 0x1 #define HOST_DDR_REGION_TYPE 0x1
#define BDF_MEM_REGION_TYPE 0x2 #define BDF_MEM_REGION_TYPE 0x2
#define M3_DUMP_REGION_TYPE 0x3
#define CALDB_MEM_REGION_TYPE 0x4 #define CALDB_MEM_REGION_TYPE 0x4
struct qmi_wlanfw_host_cap_req_msg_v01 { struct qmi_wlanfw_host_cap_req_msg_v01 {
...@@ -216,8 +219,8 @@ struct qmi_wlanfw_ind_register_resp_msg_v01 { ...@@ -216,8 +219,8 @@ struct qmi_wlanfw_ind_register_resp_msg_v01 {
u64 fw_status; u64 fw_status;
}; };
#define QMI_WLANFW_REQUEST_MEM_IND_MSG_V01_MAX_LEN 1124 #define QMI_WLANFW_REQUEST_MEM_IND_MSG_V01_MAX_LEN 1824
#define QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN 548 #define QMI_WLANFW_RESPOND_MEM_REQ_MSG_V01_MAX_LEN 888
#define QMI_WLANFW_RESPOND_MEM_RESP_MSG_V01_MAX_LEN 7 #define QMI_WLANFW_RESPOND_MEM_RESP_MSG_V01_MAX_LEN 7
#define QMI_WLANFW_REQUEST_MEM_IND_V01 0x0035 #define QMI_WLANFW_REQUEST_MEM_IND_V01 0x0035
#define QMI_WLANFW_RESPOND_MEM_REQ_V01 0x0036 #define QMI_WLANFW_RESPOND_MEM_REQ_V01 0x0036
......
...@@ -414,7 +414,7 @@ struct rx_attention { ...@@ -414,7 +414,7 @@ struct rx_attention {
#define RX_MPDU_START_RAW_MPDU BIT(0) #define RX_MPDU_START_RAW_MPDU BIT(0)
struct rx_mpdu_start { struct rx_mpdu_start_ipq8074 {
__le16 info0; __le16 info0;
__le16 phy_ppdu_id; __le16 phy_ppdu_id;
__le16 ast_index; __le16 ast_index;
...@@ -440,6 +440,112 @@ struct rx_mpdu_start { ...@@ -440,6 +440,112 @@ struct rx_mpdu_start {
__le32 raw; __le32 raw;
} __packed; } __packed;
#define RX_MPDU_START_INFO7_REO_DEST_IND GENMASK(4, 0)
#define RX_MPDU_START_INFO7_LMAC_PEER_ID_MSB GENMASK(6, 5)
#define RX_MPDU_START_INFO7_FLOW_ID_TOEPLITZ BIT(7)
#define RX_MPDU_START_INFO7_PKT_SEL_FP_UCAST_DATA BIT(8)
#define RX_MPDU_START_INFO7_PKT_SEL_FP_MCAST_DATA BIT(9)
#define RX_MPDU_START_INFO7_PKT_SEL_FP_CTRL_BAR BIT(10)
#define RX_MPDU_START_INFO7_RXDMA0_SRC_RING_SEL GENMASK(12, 11)
#define RX_MPDU_START_INFO7_RXDMA0_DST_RING_SEL GENMASK(14, 13)
#define RX_MPDU_START_INFO8_REO_QUEUE_DESC_HI GENMASK(7, 0)
#define RX_MPDU_START_INFO8_RECV_QUEUE_NUM GENMASK(23, 8)
#define RX_MPDU_START_INFO8_PRE_DELIM_ERR_WARN BIT(24)
#define RX_MPDU_START_INFO8_FIRST_DELIM_ERR BIT(25)
#define RX_MPDU_START_INFO9_EPD_EN BIT(0)
#define RX_MPDU_START_INFO9_ALL_FRAME_ENCPD BIT(1)
#define RX_MPDU_START_INFO9_ENC_TYPE GENMASK(5, 2)
#define RX_MPDU_START_INFO9_VAR_WEP_KEY_WIDTH GENMASK(7, 6)
#define RX_MPDU_START_INFO9_MESH_STA GENMASK(9, 8)
#define RX_MPDU_START_INFO9_BSSID_HIT BIT(10)
#define RX_MPDU_START_INFO9_BSSID_NUM GENMASK(14, 11)
#define RX_MPDU_START_INFO9_TID GENMASK(18, 15)
#define RX_MPDU_START_INFO10_RXPCU_MPDU_FLTR GENMASK(1, 0)
#define RX_MPDU_START_INFO10_SW_FRAME_GRP_ID GENMASK(8, 2)
#define RX_MPDU_START_INFO10_NDP_FRAME BIT(9)
#define RX_MPDU_START_INFO10_PHY_ERR BIT(10)
#define RX_MPDU_START_INFO10_PHY_ERR_MPDU_HDR BIT(11)
#define RX_MPDU_START_INFO10_PROTO_VER_ERR BIT(12)
#define RX_MPDU_START_INFO10_AST_LOOKUP_VALID BIT(13)
#define RX_MPDU_START_INFO11_MPDU_FCTRL_VALID BIT(0)
#define RX_MPDU_START_INFO11_MPDU_DUR_VALID BIT(1)
#define RX_MPDU_START_INFO11_MAC_ADDR1_VALID BIT(2)
#define RX_MPDU_START_INFO11_MAC_ADDR2_VALID BIT(3)
#define RX_MPDU_START_INFO11_MAC_ADDR3_VALID BIT(4)
#define RX_MPDU_START_INFO11_MAC_ADDR4_VALID BIT(5)
#define RX_MPDU_START_INFO11_MPDU_SEQ_CTRL_VALID BIT(6)
#define RX_MPDU_START_INFO11_MPDU_QOS_CTRL_VALID BIT(7)
#define RX_MPDU_START_INFO11_MPDU_HT_CTRL_VALID BIT(8)
#define RX_MPDU_START_INFO11_ENCRYPT_INFO_VALID BIT(9)
#define RX_MPDU_START_INFO11_MPDU_FRAG_NUMBER GENMASK(13, 10)
#define RX_MPDU_START_INFO11_MORE_FRAG_FLAG BIT(14)
#define RX_MPDU_START_INFO11_FROM_DS BIT(16)
#define RX_MPDU_START_INFO11_TO_DS BIT(17)
#define RX_MPDU_START_INFO11_ENCRYPTED BIT(18)
#define RX_MPDU_START_INFO11_MPDU_RETRY BIT(19)
#define RX_MPDU_START_INFO11_MPDU_SEQ_NUM GENMASK(31, 20)
#define RX_MPDU_START_INFO12_KEY_ID GENMASK(7, 0)
#define RX_MPDU_START_INFO12_NEW_PEER_ENTRY BIT(8)
#define RX_MPDU_START_INFO12_DECRYPT_NEEDED BIT(9)
#define RX_MPDU_START_INFO12_DECAP_TYPE GENMASK(11, 10)
#define RX_MPDU_START_INFO12_VLAN_TAG_C_PADDING BIT(12)
#define RX_MPDU_START_INFO12_VLAN_TAG_S_PADDING BIT(13)
#define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_C BIT(14)
#define RX_MPDU_START_INFO12_STRIP_VLAN_TAG_S BIT(15)
#define RX_MPDU_START_INFO12_PRE_DELIM_COUNT GENMASK(27, 16)
#define RX_MPDU_START_INFO12_AMPDU_FLAG BIT(28)
#define RX_MPDU_START_INFO12_BAR_FRAME BIT(29)
#define RX_MPDU_START_INFO12_RAW_MPDU BIT(30)
#define RX_MPDU_START_INFO13_MPDU_LEN GENMASK(13, 0)
#define RX_MPDU_START_INFO13_FIRST_MPDU BIT(14)
#define RX_MPDU_START_INFO13_MCAST_BCAST BIT(15)
#define RX_MPDU_START_INFO13_AST_IDX_NOT_FOUND BIT(16)
#define RX_MPDU_START_INFO13_AST_IDX_TIMEOUT BIT(17)
#define RX_MPDU_START_INFO13_POWER_MGMT BIT(18)
#define RX_MPDU_START_INFO13_NON_QOS BIT(19)
#define RX_MPDU_START_INFO13_NULL_DATA BIT(20)
#define RX_MPDU_START_INFO13_MGMT_TYPE BIT(21)
#define RX_MPDU_START_INFO13_CTRL_TYPE BIT(22)
#define RX_MPDU_START_INFO13_MORE_DATA BIT(23)
#define RX_MPDU_START_INFO13_EOSP BIT(24)
#define RX_MPDU_START_INFO13_FRAGMENT BIT(25)
#define RX_MPDU_START_INFO13_ORDER BIT(26)
#define RX_MPDU_START_INFO13_UAPSD_TRIGGER BIT(27)
#define RX_MPDU_START_INFO13_ENCRYPT_REQUIRED BIT(28)
#define RX_MPDU_START_INFO13_DIRECTED BIT(29)
#define RX_MPDU_START_INFO13_AMSDU_PRESENT BIT(30)
struct rx_mpdu_start_qcn9074 {
__le32 info7;
__le32 reo_queue_desc_lo;
__le32 info8;
__le32 pn[4];
__le32 info9;
__le32 peer_meta_data;
__le16 info10;
__le16 phy_ppdu_id;
__le16 ast_index;
__le16 sw_peer_id;
__le32 info11;
__le32 info12;
__le32 info13;
__le16 frame_ctrl;
__le16 duration;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
__le16 seq_ctrl;
u8 addr4[ETH_ALEN];
__le16 qos_ctrl;
__le32 ht_ctrl;
} __packed;
/* rx_mpdu_start /* rx_mpdu_start
* *
* rxpcu_mpdu_filter_in_category * rxpcu_mpdu_filter_in_category
...@@ -672,7 +778,19 @@ enum rx_msdu_start_reception_type { ...@@ -672,7 +778,19 @@ enum rx_msdu_start_reception_type {
#define RX_MSDU_START_INFO3_RECEPTION_TYPE GENMASK(23, 21) #define RX_MSDU_START_INFO3_RECEPTION_TYPE GENMASK(23, 21)
#define RX_MSDU_START_INFO3_MIMO_SS_BITMAP GENMASK(31, 24) #define RX_MSDU_START_INFO3_MIMO_SS_BITMAP GENMASK(31, 24)
struct rx_msdu_start { struct rx_msdu_start_ipq8074 {
__le16 info0;
__le16 phy_ppdu_id;
__le32 info1;
__le32 info2;
__le32 toeplitz_hash;
__le32 flow_id_toeplitz;
__le32 info3;
__le32 ppdu_start_timestamp;
__le32 phy_meta_data;
} __packed;
struct rx_msdu_start_qcn9074 {
__le16 info0; __le16 info0;
__le16 phy_ppdu_id; __le16 phy_ppdu_id;
__le32 info1; __le32 info1;
...@@ -682,6 +800,8 @@ struct rx_msdu_start { ...@@ -682,6 +800,8 @@ struct rx_msdu_start {
__le32 info3; __le32 info3;
__le32 ppdu_start_timestamp; __le32 ppdu_start_timestamp;
__le32 phy_meta_data; __le32 phy_meta_data;
__le16 vlan_ctag_c1;
__le16 vlan_stag_c1;
} __packed; } __packed;
/* rx_msdu_start /* rx_msdu_start
...@@ -894,7 +1014,7 @@ struct rx_msdu_start { ...@@ -894,7 +1014,7 @@ struct rx_msdu_start {
#define RX_MSDU_END_INFO5_REO_DEST_IND GENMASK(5, 1) #define RX_MSDU_END_INFO5_REO_DEST_IND GENMASK(5, 1)
#define RX_MSDU_END_INFO5_FLOW_IDX GENMASK(25, 6) #define RX_MSDU_END_INFO5_FLOW_IDX GENMASK(25, 6)
struct rx_msdu_end { struct rx_msdu_end_ipq8074 {
__le16 info0; __le16 info0;
__le16 phy_ppdu_id; __le16 phy_ppdu_id;
__le16 ip_hdr_cksum; __le16 ip_hdr_cksum;
...@@ -917,6 +1037,58 @@ struct rx_msdu_end { ...@@ -917,6 +1037,58 @@ struct rx_msdu_end {
__le16 sa_sw_peer_id; __le16 sa_sw_peer_id;
} __packed; } __packed;
#define RX_MSDU_END_MPDU_LENGTH_INFO GENMASK(13, 0)
#define RX_MSDU_END_INFO2_DA_OFFSET GENMASK(5, 0)
#define RX_MSDU_END_INFO2_SA_OFFSET GENMASK(11, 6)
#define RX_MSDU_END_INFO2_DA_OFFSET_VALID BIT(12)
#define RX_MSDU_END_INFO2_SA_OFFSET_VALID BIT(13)
#define RX_MSDU_END_INFO2_L3_TYPE GENMASK(31, 16)
#define RX_MSDU_END_INFO4_SA_IDX_TIMEOUT BIT(0)
#define RX_MSDU_END_INFO4_DA_IDX_TIMEOUT BIT(1)
#define RX_MSDU_END_INFO4_MSDU_LIMIT_ERR BIT(2)
#define RX_MSDU_END_INFO4_FLOW_IDX_TIMEOUT BIT(3)
#define RX_MSDU_END_INFO4_FLOW_IDX_INVALID BIT(4)
#define RX_MSDU_END_INFO4_WIFI_PARSER_ERR BIT(5)
#define RX_MSDU_END_INFO4_AMSDU_PARSER_ERR BIT(6)
#define RX_MSDU_END_INFO4_SA_IS_VALID BIT(7)
#define RX_MSDU_END_INFO4_DA_IS_VALID BIT(8)
#define RX_MSDU_END_INFO4_DA_IS_MCBC BIT(9)
#define RX_MSDU_END_INFO4_L3_HDR_PADDING GENMASK(11, 10)
#define RX_MSDU_END_INFO4_FIRST_MSDU BIT(12)
#define RX_MSDU_END_INFO4_LAST_MSDU BIT(13)
#define RX_MSDU_END_INFO6_AGGR_COUNT GENMASK(7, 0)
#define RX_MSDU_END_INFO6_FLOW_AGGR_CONTN BIT(8)
#define RX_MSDU_END_INFO6_FISA_TIMEOUT BIT(9)
struct rx_msdu_end_qcn9074 {
__le16 info0;
__le16 phy_ppdu_id;
__le16 ip_hdr_cksum;
__le16 mpdu_length_info;
__le32 info1;
__le32 rule_indication[2];
__le32 info2;
__le32 ipv6_options_crc;
__le32 tcp_seq_num;
__le32 tcp_ack_num;
__le16 info3;
__le16 window_size;
__le16 tcp_udp_cksum;
__le16 info4;
__le16 sa_idx;
__le16 da_idx;
__le32 info5;
__le32 fse_metadata;
__le16 cce_metadata;
__le16 sa_sw_peer_id;
__le32 info6;
__le16 cum_l4_cksum;
__le16 cum_ip_length;
} __packed;
/* rx_msdu_end /* rx_msdu_end
* *
* rxpcu_mpdu_filter_in_category * rxpcu_mpdu_filter_in_category
...@@ -1190,16 +1362,16 @@ struct rx_mpdu_end { ...@@ -1190,16 +1362,16 @@ struct rx_mpdu_end {
#define HAL_RX_DESC_HDR_STATUS_LEN 120 #define HAL_RX_DESC_HDR_STATUS_LEN 120
struct hal_rx_desc { struct hal_rx_desc_ipq8074 {
__le32 msdu_end_tag; __le32 msdu_end_tag;
struct rx_msdu_end msdu_end; struct rx_msdu_end_ipq8074 msdu_end;
__le32 rx_attn_tag; __le32 rx_attn_tag;
struct rx_attention attention; struct rx_attention attention;
__le32 msdu_start_tag; __le32 msdu_start_tag;
struct rx_msdu_start msdu_start; struct rx_msdu_start_ipq8074 msdu_start;
u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES]; u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES];
__le32 mpdu_start_tag; __le32 mpdu_start_tag;
struct rx_mpdu_start mpdu_start; struct rx_mpdu_start_ipq8074 mpdu_start;
__le32 mpdu_end_tag; __le32 mpdu_end_tag;
struct rx_mpdu_end mpdu_end; struct rx_mpdu_end mpdu_end;
u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES]; u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
...@@ -1209,6 +1381,32 @@ struct hal_rx_desc { ...@@ -1209,6 +1381,32 @@ struct hal_rx_desc {
u8 msdu_payload[0]; u8 msdu_payload[0];
} __packed; } __packed;
struct hal_rx_desc_qcn9074 {
__le32 msdu_end_tag;
struct rx_msdu_end_qcn9074 msdu_end;
__le32 rx_attn_tag;
struct rx_attention attention;
__le32 msdu_start_tag;
struct rx_msdu_start_qcn9074 msdu_start;
u8 rx_padding0[HAL_RX_DESC_PADDING0_BYTES];
__le32 mpdu_start_tag;
struct rx_mpdu_start_qcn9074 mpdu_start;
__le32 mpdu_end_tag;
struct rx_mpdu_end mpdu_end;
u8 rx_padding1[HAL_RX_DESC_PADDING1_BYTES];
__le32 hdr_status_tag;
__le32 phy_ppdu_id;
u8 hdr_status[HAL_RX_DESC_HDR_STATUS_LEN];
u8 msdu_payload[0];
} __packed;
struct hal_rx_desc {
union {
struct hal_rx_desc_ipq8074 ipq8074;
struct hal_rx_desc_qcn9074 qcn9074;
} u;
} __packed;
#define HAL_RX_RU_ALLOC_TYPE_MAX 6 #define HAL_RX_RU_ALLOC_TYPE_MAX 6
#define RU_26 1 #define RU_26 1
#define RU_52 2 #define RU_52 2
......
...@@ -5417,31 +5417,6 @@ int ath11k_wmi_pull_fw_stats(struct ath11k_base *ab, struct sk_buff *skb, ...@@ -5417,31 +5417,6 @@ int ath11k_wmi_pull_fw_stats(struct ath11k_base *ab, struct sk_buff *skb,
return 0; return 0;
} }
static int
ath11k_pull_pdev_temp_ev(struct ath11k_base *ab, u8 *evt_buf,
u32 len, const struct wmi_pdev_temperature_event *ev)
{
const void **tb;
int ret;
tb = ath11k_wmi_tlv_parse_alloc(ab, evt_buf, len, GFP_ATOMIC);
if (IS_ERR(tb)) {
ret = PTR_ERR(tb);
ath11k_warn(ab, "failed to parse tlv: %d\n", ret);
return ret;
}
ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
if (!ev) {
ath11k_warn(ab, "failed to fetch pdev temp ev");
kfree(tb);
return -EPROTO;
}
kfree(tb);
return 0;
}
size_t ath11k_wmi_fw_stats_num_vdevs(struct list_head *head) size_t ath11k_wmi_fw_stats_num_vdevs(struct list_head *head)
{ {
struct ath11k_fw_stats_vdev *i; struct ath11k_fw_stats_vdev *i;
...@@ -6196,10 +6171,8 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb) ...@@ -6196,10 +6171,8 @@ static void ath11k_mgmt_rx_event(struct ath11k_base *ab, struct sk_buff *skb)
} }
} }
/* TODO: Pending handle beacon implementation if (ieee80211_is_beacon(hdr->frame_control))
*if (ieee80211_is_beacon(hdr->frame_control)) ath11k_mac_handle_beacon(ar, skb);
* ath11k_mac_handle_beacon(ar, skb);
*/
ath11k_dbg(ab, ATH11K_DBG_MGMT, ath11k_dbg(ab, ATH11K_DBG_MGMT,
"event mgmt rx skb %pK len %d ftype %02x stype %02x\n", "event mgmt rx skb %pK len %d ftype %02x stype %02x\n",
...@@ -6418,10 +6391,7 @@ static void ath11k_roam_event(struct ath11k_base *ab, struct sk_buff *skb) ...@@ -6418,10 +6391,7 @@ static void ath11k_roam_event(struct ath11k_base *ab, struct sk_buff *skb)
switch (roam_ev.reason) { switch (roam_ev.reason) {
case WMI_ROAM_REASON_BEACON_MISS: case WMI_ROAM_REASON_BEACON_MISS:
/* TODO: Pending beacon miss and connection_loss_work ath11k_mac_handle_beacon_miss(ar, roam_ev.vdev_id);
* implementation
* ath11k_mac_handle_beacon_miss(ar, vdev_id);
*/
break; break;
case WMI_ROAM_REASON_BETTER_AP: case WMI_ROAM_REASON_BETTER_AP:
case WMI_ROAM_REASON_LOW_RSSI: case WMI_ROAM_REASON_LOW_RSSI:
...@@ -6849,23 +6819,37 @@ ath11k_wmi_pdev_temperature_event(struct ath11k_base *ab, ...@@ -6849,23 +6819,37 @@ ath11k_wmi_pdev_temperature_event(struct ath11k_base *ab,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct ath11k *ar; struct ath11k *ar;
struct wmi_pdev_temperature_event ev = {0}; const void **tb;
const struct wmi_pdev_temperature_event *ev;
int ret;
if (ath11k_pull_pdev_temp_ev(ab, skb->data, skb->len, &ev) != 0) { tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC);
ath11k_warn(ab, "failed to extract pdev temperature event"); if (IS_ERR(tb)) {
ret = PTR_ERR(tb);
ath11k_warn(ab, "failed to parse tlv: %d\n", ret);
return;
}
ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
if (!ev) {
ath11k_warn(ab, "failed to fetch pdev temp ev");
kfree(tb);
return; return;
} }
ath11k_dbg(ab, ATH11K_DBG_WMI, ath11k_dbg(ab, ATH11K_DBG_WMI,
"pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id); "pdev temperature ev temp %d pdev_id %d\n", ev->temp, ev->pdev_id);
ar = ath11k_mac_get_ar_by_pdev_id(ab, ev.pdev_id); ar = ath11k_mac_get_ar_by_pdev_id(ab, ev->pdev_id);
if (!ar) { if (!ar) {
ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id); ath11k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev->pdev_id);
kfree(tb);
return; return;
} }
ath11k_thermal_event_temperature(ar, ev.temp); ath11k_thermal_event_temperature(ar, ev->temp);
kfree(tb);
} }
static void ath11k_fils_discovery_event(struct ath11k_base *ab, static void ath11k_fils_discovery_event(struct ath11k_base *ab,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment