|
@@ -3490,7 +3490,6 @@ void hif_unconfig_ce(struct hif_softc *hif_sc)
|
|
*/
|
|
*/
|
|
static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
{
|
|
{
|
|
- void *target_va;
|
|
|
|
phys_addr_t target_pa;
|
|
phys_addr_t target_pa;
|
|
struct ce_info *ce_info_ptr;
|
|
struct ce_info *ce_info_ptr;
|
|
uint32_t msi_data_start;
|
|
uint32_t msi_data_start;
|
|
@@ -3499,15 +3498,19 @@ static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
uint32_t i = 0;
|
|
uint32_t i = 0;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- target_va = qdf_mem_alloc_consistent(scn->qdf_dev,
|
|
|
|
- scn->qdf_dev->dev,
|
|
|
|
- FW_SHARED_MEM +
|
|
|
|
- sizeof(struct ce_info),
|
|
|
|
- &target_pa);
|
|
|
|
- if (!target_va)
|
|
|
|
|
|
+ scn->vaddr_qmi_bypass =
|
|
|
|
+ (uint32_t *)qdf_mem_alloc_consistent(scn->qdf_dev,
|
|
|
|
+ scn->qdf_dev->dev,
|
|
|
|
+ FW_SHARED_MEM,
|
|
|
|
+ &target_pa);
|
|
|
|
+ if (!scn->vaddr_qmi_bypass) {
|
|
|
|
+ hif_err("Memory allocation failed could not post target buf");
|
|
return;
|
|
return;
|
|
|
|
+ }
|
|
|
|
|
|
- ce_info_ptr = (struct ce_info *)target_va;
|
|
|
|
|
|
+ scn->paddr_qmi_bypass = target_pa;
|
|
|
|
+
|
|
|
|
+ ce_info_ptr = (struct ce_info *)scn->vaddr_qmi_bypass;
|
|
|
|
|
|
if (scn->vaddr_rri_on_ddr) {
|
|
if (scn->vaddr_rri_on_ddr) {
|
|
ce_info_ptr->rri_over_ddr_low_paddr =
|
|
ce_info_ptr->rri_over_ddr_low_paddr =
|
|
@@ -3531,7 +3534,26 @@ static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
}
|
|
}
|
|
|
|
|
|
hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, target_pa);
|
|
hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, target_pa);
|
|
- hif_info("target va %pK target pa %pa", target_va, &target_pa);
|
|
|
|
|
|
+ hif_info("target va %pK target pa %pa", scn->vaddr_qmi_bypass,
|
|
|
|
+ &target_pa);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * hif_cleanup_static_buf_to_target() - clean up static buffer to WLAN FW
|
|
|
|
+ * @scn: pointer to HIF structure
|
|
|
|
+ *
|
|
|
|
+ *
|
|
|
|
+ * Return: void
|
|
|
|
+ */
|
|
|
|
+void hif_cleanup_static_buf_to_target(struct hif_softc *scn)
|
|
|
|
+{
|
|
|
|
+ void *target_va = scn->vaddr_qmi_bypass;
|
|
|
|
+ phys_addr_t target_pa = scn->paddr_qmi_bypass;
|
|
|
|
+
|
|
|
|
+ qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev,
|
|
|
|
+ FW_SHARED_MEM, target_va,
|
|
|
|
+ target_pa, 0);
|
|
|
|
+ hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, 0);
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
/**
|
|
/**
|
|
@@ -3544,17 +3566,38 @@ static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
*/
|
|
*/
|
|
static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
{
|
|
{
|
|
- void *target_va;
|
|
|
|
- phys_addr_t target_pa;
|
|
|
|
-
|
|
|
|
- target_va = qdf_mem_alloc_consistent(scn->qdf_dev, scn->qdf_dev->dev,
|
|
|
|
- FW_SHARED_MEM, &target_pa);
|
|
|
|
- if (!target_va) {
|
|
|
|
|
|
+ qdf_dma_addr_t target_pa;
|
|
|
|
+
|
|
|
|
+ scn->vaddr_qmi_bypass =
|
|
|
|
+ (uint32_t *)qdf_mem_alloc_consistent(scn->qdf_dev,
|
|
|
|
+ scn->qdf_dev->dev,
|
|
|
|
+ FW_SHARED_MEM,
|
|
|
|
+ &target_pa);
|
|
|
|
+ if (!scn->vaddr_qmi_bypass) {
|
|
hif_err("Memory allocation failed could not post target buf");
|
|
hif_err("Memory allocation failed could not post target buf");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ scn->paddr_qmi_bypass = target_pa;
|
|
hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, target_pa);
|
|
hif_write32_mb(scn, scn->mem + BYPASS_QMI_TEMP_REGISTER, target_pa);
|
|
- hif_info("target va %pK target pa %pa", target_va, &target_pa);
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * hif_cleanup_static_buf_to_target() - clean up static buffer to WLAN FW
|
|
|
|
+ * @scn: pointer to HIF structure
|
|
|
|
+ *
|
|
|
|
+ *
|
|
|
|
+ * Return: void
|
|
|
|
+ */
|
|
|
|
+void hif_cleanup_static_buf_to_target(struct hif_softc *scn)
|
|
|
|
+{
|
|
|
|
+ void *target_va = scn->vaddr_qmi_bypass;
|
|
|
|
+ phys_addr_t target_pa = scn->paddr_qmi_bypass;
|
|
|
|
+
|
|
|
|
+ qdf_mem_free_consistent(scn->qdf_dev, scn->qdf_dev->dev,
|
|
|
|
+ FW_SHARED_MEM, target_va,
|
|
|
|
+ target_pa, 0);
|
|
|
|
+ hif_write32_mb(snc, scn->mem + BYPASS_QMI_TEMP_REGISTER, 0);
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -3562,6 +3605,10 @@ static void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
static inline void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
static inline void hif_post_static_buf_to_target(struct hif_softc *scn)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void hif_cleanup_static_buf_to_target(struct hif_softc *scn)
|
|
|
|
+{
|
|
|
|
+}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
static int hif_srng_sleep_state_adjust(struct hif_softc *scn, bool sleep_ok,
|
|
static int hif_srng_sleep_state_adjust(struct hif_softc *scn, bool sleep_ok,
|