diff --git a/hif/inc/hif.h b/hif/inc/hif.h index 6ce3a09769..2368f2de6e 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -510,6 +510,18 @@ enum hif_target_status { TARGET_STATUS_SUSPEND /*target got suspend */ }; +/** + * enum hif_attribute_flags: configure hif + * + * @HIF_LOWDESC_CE_CFG: Configure HIF with Low descriptor CE + * @HIF_LOWDESC_CE_NO_PKTLOG_CFG: Configure HIF with Low descriptor + * + No pktlog CE + */ +enum hif_attribute_flags { + HIF_LOWDESC_CE_CFG = 1, + HIF_LOWDESC_CE_NO_PKTLOG_CFG +}; + #define HIF_DATA_ATTR_SET_TX_CLASSIFY(attr, v) \ (attr |= (v & 0x01) << 5) #define HIF_DATA_ATTR_SET_ENCAPSULATION_TYPE(attr, v) \ @@ -723,6 +735,8 @@ void hif_set_bundle_mode(struct hif_opaque_softc *scn, bool enabled, int rx_bundle_cnt); int hif_bus_reset_resume(struct hif_opaque_softc *scn); +void hif_set_attribute(struct hif_opaque_softc *osc, uint8_t hif_attrib); + #ifdef WLAN_SUSPEND_RESUME_TEST typedef void (*hif_fake_resume_callback)(uint32_t val); void hif_fake_apps_suspend(struct hif_opaque_softc *hif_ctx, diff --git a/hif/src/ce/ce_assignment.h b/hif/src/ce/ce_assignment.h index be7a0501a2..d1be4d4002 100644 --- a/hif/src/ce/ce_assignment.h +++ b/hif/src/ce/ce_assignment.h @@ -364,6 +364,78 @@ static struct CE_attr host_ce_config_wlan_ar900b[] = { { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ }; +static struct CE_attr host_lowdesc_ce_cfg_wlan_ar9888[] = { + { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ + /* could be moved to share CE3 */ +#if WLAN_FEATURE_FASTPATH + { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */ +#else + { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ +#endif + { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ + { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ + { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, + CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ +#if WLAN_FEATURE_FASTPATH + { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ +#else /* WLAN_FEATURE_FASTPATH */ + { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ +#endif /* WLAN_FEATURE_FASTPATH */ + { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ + { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ +}; + +static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b[] = { + { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ + /* could be moved to share CE3 */ +#if WLAN_FEATURE_FASTPATH + { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */ +#else + { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ +#endif + { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ + { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ + { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, + CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ +#if WLAN_FEATURE_FASTPATH + { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ +#else /* WLAN_FEATURE_FASTPATH */ + { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ +#endif /* WLAN_FEATURE_FASTPATH */ + { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ + { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host pktlog */ + { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ +}; + +static struct CE_attr host_lowdesc_ce_cfg_wlan_ar900b_nopktlog[] = { + { /* CE0 */ CE_ATTR_FLAGS, 0, 16, 256, 0, NULL, }, /* host->target HTC control and raw streams */ + /* could be moved to share CE3 */ +#if WLAN_FEATURE_FASTPATH + { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 64, NULL, },/* target->host BMI + HTC control */ +#else + { /* CE1 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, },/* target->host BMI + HTC control */ +#endif + { /* CE2 */ CE_ATTR_FLAGS, 0, 0, 2048, 128, NULL, },/* target->host WMI */ + { /* CE3 */ CE_ATTR_FLAGS, 0, 32, 2048, 0, NULL, },/* host->target WMI */ + { /* CE4 */ CE_ATTR_FLAGS | CE_ATTR_DISABLE_INTR, 0, + CE_HTT_H2T_MSG_SRC_NENTRIES_AR900B, 256, 0, NULL, }, /* host->target HTT */ +#if WLAN_FEATURE_FASTPATH + { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 512, 512, NULL, }, /* target->host HTT messages */ +#else /* WLAN_FEATURE_FASTPATH */ + { /* CE5 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* unused */ +#endif /* WLAN_FEATURE_FASTPATH */ + { /* CE6 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE7 */ CE_ATTR_FLAGS, 0, 2, DIAG_TRANSFER_LIMIT, 2, NULL, }, /* ce_diag, the Diagnostic Window */ + { /* CE8 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, },/* target->host pktlog */ + { /* CE9 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE10 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ + { /* CE11 */ CE_ATTR_FLAGS, 0, 0, 0, 0, NULL, }, /* Target autonomous HIF_memcpy */ +}; + static struct CE_pipe_config target_ce_config_wlan_ar9888[] = { { /* CE0 */ 0, PIPEDIR_OUT, 32, 256, CE_ATTR_FLAGS, 0, }, /* host->target HTC control and raw streams */ { /* CE1 */ 1, PIPEDIR_IN, 32, 512, CE_ATTR_FLAGS, 0, }, /* target->host HTC control */ diff --git a/hif/src/ce/ce_main.c b/hif/src/ce/ce_main.c index 5aa62821d4..91ad5bb33f 100644 --- a/hif/src/ce/ce_main.c +++ b/hif/src/ce/ce_main.c @@ -2038,7 +2038,16 @@ void hif_ce_prepare_config(struct hif_softc *scn) case TARGET_TYPE_QCA9984: case TARGET_TYPE_IPQ4019: case TARGET_TYPE_QCA9888: - hif_state->host_ce_config = host_ce_config_wlan_ar900b; + if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_NO_PKTLOG_CFG)) { + hif_state->host_ce_config = + host_lowdesc_ce_cfg_wlan_ar900b_nopktlog; + } else if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_CFG)) { + hif_state->host_ce_config = + host_lowdesc_ce_cfg_wlan_ar900b; + } else { + hif_state->host_ce_config = host_ce_config_wlan_ar900b; + } + hif_state->target_ce_config = target_ce_config_wlan_ar900b; hif_state->target_ce_config_sz = sizeof(target_ce_config_wlan_ar900b); @@ -2050,7 +2059,12 @@ void hif_ce_prepare_config(struct hif_softc *scn) case TARGET_TYPE_AR9888: case TARGET_TYPE_AR9888V2: - hif_state->host_ce_config = host_ce_config_wlan_ar9888; + if (hif_is_attribute_set(scn, HIF_LOWDESC_CE_CFG)) { + hif_state->host_ce_config = host_lowdesc_ce_cfg_wlan_ar9888; + } else { + hif_state->host_ce_config = host_ce_config_wlan_ar9888; + } + hif_state->target_ce_config = target_ce_config_wlan_ar9888; hif_state->target_ce_config_sz = sizeof(target_ce_config_wlan_ar9888); @@ -2891,6 +2905,12 @@ uint32_t hif_set_nss_wifiol_mode(struct hif_opaque_softc *osc, uint32_t mode) #endif +void hif_set_attribute(struct hif_opaque_softc *osc, uint8_t hif_attrib) +{ + struct hif_softc *scn = HIF_GET_SOFTC(osc); + scn->hif_attribute = hif_attrib; +} + void hif_disable_interrupt(struct hif_opaque_softc *osc, uint32_t pipe_num) { struct hif_softc *scn = HIF_GET_SOFTC(osc); diff --git a/hif/src/hif_main.h b/hif/src/hif_main.h index d3b51d3f5c..cf5c632920 100644 --- a/hif/src/hif_main.h +++ b/hif/src/hif_main.h @@ -173,6 +173,7 @@ struct hif_softc { #ifdef WLAN_SUSPEND_RESUME_TEST struct fake_apps_context fake_apps_ctx; #endif /* WLAN_SUSPEND_RESUME_TEST */ + uint32_t hif_attribute; }; #ifdef QCA_NSS_WIFI_OFFLOAD_SUPPORT @@ -187,6 +188,12 @@ static inline bool hif_is_nss_wifi_enabled(struct hif_softc *sc) } #endif +static inline uint8_t hif_is_attribute_set(struct hif_softc *sc, + uint32_t hif_attrib) +{ + return sc->hif_attribute == hif_attrib; +} + A_target_id_t hif_get_target_id(struct hif_softc *scn); void hif_dump_pipe_debug_count(struct hif_softc *scn); void hif_display_bus_stats(struct hif_opaque_softc *scn);