diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 0a684f0b14..2f53dbfe29 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1762,6 +1762,42 @@ static bool dp_reo_remap_config(struct dp_soc *soc, } #endif +/* + * dp_reo_frag_dst_set() - configure reo register to set the + * fragment destination ring + * @soc : Datapath soc + * @frag_dst_ring : output parameter to set fragment destination ring + * + * Based on offload_radio below fragment destination rings is selected + * 0 - TCL + * 1 - SW1 + * 2 - SW2 + * 3 - SW3 + * 4 - SW4 + * 5 - Release + * 6 - FW + * 7 - alternate select + * + * return: void + */ +static void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring) +{ + uint8_t offload_radio = wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx); + + switch (offload_radio) { + case 0: + *frag_dst_ring = HAL_SRNG_REO_EXCEPTION; + break; + case 3: + *frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT; + break; + default: + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR, + FL("dp_reo_frag_dst_set invalid offload radio config")); + break; + } +} + /* * dp_soc_cmn_setup() - Common SoC level initializion * @soc: Datapath SOC handle @@ -1973,6 +2009,11 @@ static int dp_soc_cmn_setup(struct dp_soc *soc) wlan_cfg_get_defrag_timeout_check(soc->wlan_cfg_ctx); out: + /* + * set the fragment destination ring + */ + dp_reo_frag_dst_set(soc, &reo_params.frag_dst_ring); + hal_reo_setup(soc->hal_soc, &reo_params); qdf_atomic_set(&soc->cmn_init_done, 1); diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index 57c0d6b6b5..8e0302ba7e 100644 --- a/hal/wifi3.0/hal_api.h +++ b/hal/wifi3.0/hal_api.h @@ -1003,12 +1003,16 @@ extern void hal_setup_link_idle_list(void *hal_soc, /* REO parameters to be passed to hal_reo_setup */ struct hal_reo_params { - /* rx hash steering enabled or disabled */ + /** rx hash steering enabled or disabled */ bool rx_hash_enabled; - /* reo remap 1 register */ + /** reo remap 1 register */ uint32_t remap1; - /* reo remap 2 register */ + /** reo remap 2 register */ uint32_t remap2; + /** fragment destination ring */ + uint8_t frag_dst_ring; + /** padding */ + uint8_t padding[3]; }; /** diff --git a/hal/wifi3.0/hal_internal.h b/hal/wifi3.0/hal_internal.h index 1147215eb3..db2c86ff3b 100644 --- a/hal/wifi3.0/hal_internal.h +++ b/hal/wifi3.0/hal_internal.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -182,6 +182,7 @@ enum hal_srng_ring_id { }; #define HAL_SRNG_REO_EXCEPTION HAL_SRNG_REO2SW1 +#define HAL_SRNG_REO_ALTERNATE_SELECT 0x7 #define HAL_MAX_LMACS 3 #define HAL_MAX_RINGS_PER_LMAC (HAL_SRNG_LMAC1_ID_END - HAL_SRNG_LMAC1_ID_START) diff --git a/hal/wifi3.0/hal_rx.c b/hal/wifi3.0/hal_rx.c index d1fef97357..52db986dfd 100644 --- a/hal/wifi3.0/hal_rx.c +++ b/hal/wifi3.0/hal_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -231,7 +231,7 @@ void hal_reo_setup(void *hal_soc, HAL_REG_WRITE(soc, HWIO_REO_R0_GENERAL_ENABLE_ADDR( SEQ_WCSS_UMAC_REO_REG_OFFSET), HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, - FRAGMENT_DEST_RING, HAL_SRNG_REO_EXCEPTION) | + FRAGMENT_DEST_RING, reo_params->frag_dst_ring) | HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, AGING_LIST_ENABLE, 1) | HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, AGING_FLUSH_ENABLE, 1)); /* Other ring enable bits and REO_ENABLE will be set by FW */