Merge "qcacld-3.0: Add CFG INI item to control various unit test features" into wlan-cld3.driver.lnx.2.0

This commit is contained in:
CNSS_WLAN Service
2018-04-14 18:19:46 -07:00
committed by Gerrit - the friendly Code Review server
4 changed files with 48 additions and 4 deletions

View File

@@ -13919,6 +13919,22 @@ enum hdd_external_acs_freq_band {
#define CFG_TX_SCH_DELAY_MAX (5) #define CFG_TX_SCH_DELAY_MAX (5)
#define CFG_TX_SCH_DELAY_DEFAULT (2) #define CFG_TX_SCH_DELAY_DEFAULT (2)
/*
* <ini>
* gEnableUnitTestFramework - Enable/Disable unit test framework
* @Min: 0
* @Max: 1
* @Default: 0
*
* Usage: Internal (only for dev and test team)
*
* </ini>
*/
#define CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME "gEnableUnitTestFramework"
#define CFG_ENABLE_UNIT_TEST_FRAMEWORK_MIN (0)
#define CFG_ENABLE_UNIT_TEST_FRAMEWORK_MAX (1)
#define CFG_ENABLE_UINT_TEST_FRAMEWORK_DEFAULT (0)
/* /*
* Type declarations * Type declarations
*/ */
@@ -14795,6 +14811,7 @@ struct hdd_config {
bool enable_bt_chain_separation; bool enable_bt_chain_separation;
uint8_t enable_tx_sch_delay; uint8_t enable_tx_sch_delay;
HDD_GREEN_AP_CFG_FIELDS HDD_GREEN_AP_CFG_FIELDS
bool is_unit_test_framework_enabled;
}; };
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

View File

@@ -5330,6 +5330,14 @@ struct reg_table_entry g_registry_table[] = {
CFG_TX_SCH_DELAY_MAX), CFG_TX_SCH_DELAY_MAX),
HDD_GREEN_AP_REG_VARIABLES HDD_GREEN_AP_REG_VARIABLES
REG_VARIABLE(CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME,
WLAN_PARAM_Integer,
struct hdd_config, is_unit_test_framework_enabled,
VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
CFG_ENABLE_UINT_TEST_FRAMEWORK_DEFAULT,
CFG_ENABLE_UNIT_TEST_FRAMEWORK_MIN,
CFG_ENABLE_UNIT_TEST_FRAMEWORK_MAX),
}; };
@@ -7203,6 +7211,9 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
hdd_ctx->config->channel_select_logic_conc); hdd_ctx->config->channel_select_logic_conc);
hdd_nud_cfg_print(hdd_ctx); hdd_nud_cfg_print(hdd_ctx);
hdd_debug("Name = [%s] value = [0x%x]",
CFG_ENABLE_UNIT_TEST_FRAMEWORK_NAME,
hdd_ctx->config->is_unit_test_framework_enabled);
} }

View File

@@ -2285,15 +2285,24 @@ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy, struct net_device *dev,
enum wow_interface_pause pause_setting, enum wow_interface_pause pause_setting,
enum wow_resume_trigger resume_setting) enum wow_resume_trigger resume_setting)
{ {
int errno;
qdf_device_t qdf_dev; qdf_device_t qdf_dev;
struct hif_opaque_softc *hif_ctx; struct hif_opaque_softc *hif_ctx;
int errno; struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
struct wow_enable_params wow_params = { struct wow_enable_params wow_params = {
.is_unit_test = true, .is_unit_test = true,
.interface_pause = pause_setting, .interface_pause = pause_setting,
.resume_trigger = resume_setting .resume_trigger = resume_setting
}; };
if (wlan_hdd_validate_context(hdd_ctx))
return -EINVAL;
if (!hdd_ctx->config->is_unit_test_framework_enabled) {
hdd_warn_rl("UT framework is disabled");
return -EINVAL;
}
hdd_info("Unit-test suspend WLAN"); hdd_info("Unit-test suspend WLAN");
if (pause_setting < WOW_INTERFACE_PAUSE_DEFAULT || if (pause_setting < WOW_INTERFACE_PAUSE_DEFAULT ||
@@ -2393,6 +2402,15 @@ link_down:
int hdd_wlan_fake_apps_resume(struct wiphy *wiphy, struct net_device *dev) int hdd_wlan_fake_apps_resume(struct wiphy *wiphy, struct net_device *dev)
{ {
struct hif_opaque_softc *hif_ctx; struct hif_opaque_softc *hif_ctx;
struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
if (wlan_hdd_validate_context(hdd_ctx))
return -EINVAL;
if (!hdd_ctx->config->is_unit_test_framework_enabled) {
hdd_warn_rl("UT framework is disabled");
return -EINVAL;
}
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
if (!hif_ctx) { if (!hif_ctx) {

View File

@@ -9354,12 +9354,10 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
case WE_SET_MON_MODE_CHAN: case WE_SET_MON_MODE_CHAN:
ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]); ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]);
break; break;
case WE_SET_WLAN_SUSPEND: { case WE_SET_WLAN_SUSPEND:
hdd_info("STA unit-test suspend(%d, %d)", value[1], value[2]);
ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev, ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy, dev,
value[1], value[2]); value[1], value[2]);
break; break;
}
case WE_SET_WLAN_RESUME: case WE_SET_WLAN_RESUME:
ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev); ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy, dev);
break; break;