diff --git a/core/hdd/inc/qc_sap_ioctl.h b/core/hdd/inc/qc_sap_ioctl.h index 9e43d6af95..545db0ddcd 100644 --- a/core/hdd/inc/qc_sap_ioctl.h +++ b/core/hdd/inc/qc_sap_ioctl.h @@ -101,21 +101,22 @@ struct channel_list_info { #define QCSAP_IOCTL_GET_STA_INFO (SIOCIWFIRSTPRIV + 21) #define QCSAP_IOCTL_SET_MAX_TX_POWER (SIOCIWFIRSTPRIV + 22) #define QCSAP_IOCTL_GET_INI_CFG (SIOCIWFIRSTPRIV + 25) -#define QCSAP_IOCTL_SET_INI_CFG (SIOCIWFIRSTPRIV + 26) + #define QCSAP_IOCTL_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) -#define QCSAP_IOCTL_PRIV_GET_RSSI (SIOCIWFIRSTPRIV + 29) -#define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31) -#define QCSAP_IOCTL_GET_BA_AGEING_TIMEOUT (SIOCIWFIRSTPRIV + 32) +/* QCSAP_IOCTL_SET_TWO_INT_GET_NONE sub commands */ #define QCSAP_IOCTL_SET_FW_CRASH_INJECT 1 #define QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL 2 #define QCSAP_ENABLE_FW_PROFILE 3 #define QCSAP_SET_FW_PROFILE_HIST_INTVL 4 - /* Private sub-ioctl for initiating WoW suspend without Apps suspend */ #define QCSAP_SET_WLAN_SUSPEND 5 #define QCSAP_SET_WLAN_RESUME 6 #define QCSAP_SET_BA_AGEING_TIMEOUT 7 +#define QCSAP_IOCTL_PRIV_GET_RSSI (SIOCIWFIRSTPRIV + 29) +#define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31) +#define QCSAP_IOCTL_GET_BA_AGEING_TIMEOUT (SIOCIWFIRSTPRIV + 32) + #define MAX_VAR_ARGS 7 #define QCSAP_IOCTL_MAX_STR_LEN 1024 diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 4779e8c218..00b304004c 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -278,12 +278,6 @@ struct hdd_config { */ #define VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT (1 << 2) -/* - * Bit 3 indicates that the config item can be modified dynamicially - * on a running system - */ -#define VAR_FLAGS_DYNAMIC_CFG (1 << 3) - enum wlan_parameter_type { WLAN_PARAM_Integer, WLAN_PARAM_SignedInteger, @@ -307,37 +301,6 @@ enum wlan_parameter_type { NULL \ } -#define REG_DYNAMIC_VARIABLE(_Name, _Type, _Struct, _VarName, \ - _Flags, _Default, _Min, _Max, \ - _CBFunc, _CBParam) \ - { \ - (_Name), \ - (_Type), \ - (VAR_FLAGS_DYNAMIC_CFG | (_Flags)), \ - (_CBParam), \ - VAR_OFFSET(_Struct, _VarName), \ - VAR_SIZE(_Struct, _VarName), \ - (_Default), \ - (_Min), \ - (_Max), \ - (_CBFunc) \ - } - -#define REG_VARIABLE_STRING(_Name, _Type, _Struct, _VarName, \ - _Flags, _Default) \ - { \ - (_Name), \ - (_Type), \ - (_Flags), \ - 0, \ - VAR_OFFSET(_Struct, _VarName), \ - VAR_SIZE(_Struct, _VarName), \ - (unsigned long)(_Default), \ - 0, \ - 0, \ - NULL \ - } - struct reg_table_entry { char *RegName; /* variable name in the qcom_cfg.ini file */ unsigned char RegType; /* variable type in hdd_config struct */ @@ -374,8 +337,6 @@ void hdd_cfg_get_global_config(struct hdd_context *hdd_ctx, char *buf, int buflen); eCsrPhyMode hdd_cfg_xlate_to_csr_phy_mode(enum hdd_dot11_mode dot11Mode); -QDF_STATUS hdd_execute_global_config_command(struct hdd_context *hdd_ctx, - char *command); QDF_STATUS hdd_set_idle_ps_config(struct hdd_context *hdd_ctx, bool val); void hdd_get_pmkid_modes(struct hdd_context *hdd_ctx, diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 81b72d3121..6ed523a566 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -565,208 +565,6 @@ static QDF_STATUS hdd_apply_cfg_ini(struct hdd_context *hdd_ctx, return ret_status; } -/** - * hdd_execute_config_command() - executes an arbitrary configuration command - * @reg_table: the pointer to configuration table - * @tableSize: the size of the configuration table - * @ini_struct: pointer to the hdd config knob - * @hdd_ctx: the pointer to hdd context - * @command: the command to run - * - * Return: QDF_STATUS_SUCCESS if the command is found and able to execute, - * otherwise the appropriate QDF_STATUS will be returned - */ -static QDF_STATUS hdd_execute_config_command(struct reg_table_entry *reg_table, - unsigned long tableSize, - uint8_t *ini_struct, - struct hdd_context *hdd_ctx, - char *command) -{ - struct reg_table_entry *pRegEntry; - char *clone; - char *pCmd; - void *pField; - char *name; - char *value_str; - uint32_t value; - int32_t svalue; - size_t len_value_str; - unsigned int idx; - unsigned int i; - QDF_STATUS vstatus; - int rv; - - /* assume failure until proven otherwise */ - vstatus = QDF_STATUS_E_FAILURE; - - /* clone the command so that we can manipulate it */ - clone = kstrdup(command, GFP_ATOMIC); - if (NULL == clone) - return vstatus; - - /* 'clone' will point to the beginning of the string so it can be freed - * 'pCmd' will be used to walk/parse the command - */ - pCmd = clone; - - /* get rid of leading/trailing whitespace */ - pCmd = i_trim(pCmd); - if ('\0' == *pCmd) { - /* only whitespace */ - hdd_err("invalid command, only whitespace:[%s]", command); - goto done; - } - /* parse the = */ - name = pCmd; - while (('=' != *pCmd) && ('\0' != *pCmd)) - pCmd++; - - if ('\0' == *pCmd) { - /* did not find '=' */ - hdd_err("invalid command, no '=':[%s]", command); - goto done; - } - /* replace '=' with NUL to terminate the */ - *pCmd++ = '\0'; - name = i_trim(name); - if ('\0' == *name) { - /* did not find a name */ - hdd_err("invalid command, no :[%s]", command); - goto done; - } - - value_str = i_trim(pCmd); - if ('\0' == *value_str) { - /* did not find a value */ - hdd_err("invalid command, no :[%s]", command); - goto done; - } - /* lookup the configuration item */ - for (idx = 0; idx < tableSize; idx++) { - if (0 == strcmp(name, reg_table[idx].RegName)) { - /* found a match */ - break; - } - } - if (tableSize == idx) { - /* did not match the name */ - hdd_err("invalid command, unknown configuration item:[%s]", command); - goto done; - } - - pRegEntry = ®_table[idx]; - if (!(pRegEntry->Flags & VAR_FLAGS_DYNAMIC_CFG)) { - /* does not support dynamic configuration */ - hdd_err("Global_Registry_Table. %s does not support " - "dynamic configuration", name); - vstatus = QDF_STATUS_E_PERM; - goto done; - } - - pField = ini_struct + pRegEntry->VarOffset; - - switch (pRegEntry->RegType) { - case WLAN_PARAM_Integer: - rv = kstrtou32(value_str, 10, &value); - if (rv < 0) - goto done; - if (value < pRegEntry->VarMin) { - /* out of range */ - hdd_err("Invalid command, value %u < min value %lu", value, pRegEntry->VarMin); - goto done; - } - if (value > pRegEntry->VarMax) { - /* out of range */ - hdd_err("Invalid command, value %u > max value %lu", value, pRegEntry->VarMax); - goto done; - } - memcpy(pField, &value, pRegEntry->VarSize); - break; - - case WLAN_PARAM_HexInteger: - rv = kstrtou32(value_str, 16, &value); - if (rv < 0) - goto done; - if (value < pRegEntry->VarMin) { - /* out of range */ - hdd_err("Invalid command, value %x < min value %lx", value, pRegEntry->VarMin); - goto done; - } - if (value > pRegEntry->VarMax) { - /* out of range */ - hdd_err("Invalid command, value %x > max value %lx", value, pRegEntry->VarMax); - goto done; - } - memcpy(pField, &value, pRegEntry->VarSize); - break; - - case WLAN_PARAM_SignedInteger: - rv = kstrtos32(value_str, 10, &svalue); - if (rv < 0) - goto done; - if (svalue < (int32_t) pRegEntry->VarMin) { - /* out of range */ - hdd_err("Invalid command, value %d < min value %d", svalue, (int)pRegEntry->VarMin); - goto done; - } - if (svalue > (int32_t) pRegEntry->VarMax) { - /* out of range */ - hdd_err("Invalid command, value %d > max value %d", svalue, (int)pRegEntry->VarMax); - goto done; - } - memcpy(pField, &svalue, pRegEntry->VarSize); - break; - - case WLAN_PARAM_String: - len_value_str = strlen(value_str); - if (len_value_str > (pRegEntry->VarSize - 1)) { - /* too big */ - hdd_err("Invalid command, string [%s] length " - "%zu exceeds maximum length %u", value_str, - len_value_str, (pRegEntry->VarSize - 1)); - goto done; - } - /* copy string plus NUL */ - memcpy(pField, value_str, (len_value_str + 1)); - break; - - case WLAN_PARAM_MacAddr: - len_value_str = strlen(value_str); - if (len_value_str != (QDF_MAC_ADDR_SIZE * 2)) { - /* out of range */ - hdd_err("Invalid command, MAC address [%s] length " - "%zu is not expected length %u", value_str, - len_value_str, (QDF_MAC_ADDR_SIZE * 2)); - goto done; - } - /* parse the string and store it in the byte array */ - for (i = 0; i < QDF_MAC_ADDR_SIZE; i++) { - ((char *)pField)[i] = (char) - ((parse_hex_digit(value_str[(i * 2)]) * 16) + - parse_hex_digit(value_str[(i * 2) + 1])); - } - break; - - default: - goto done; - } - - /* if we get here, we had a successful modification */ - vstatus = QDF_STATUS_SUCCESS; - - /* config table has been modified, is there a notifier? */ - if (NULL != pRegEntry->pfnDynamicnotify) - (pRegEntry->pfnDynamicnotify)(hdd_ctx, pRegEntry->notifyId); - - /* note that this item was explicitly configured */ - if (idx < MAX_CFG_INI_ITEMS) - set_bit(idx, (void *)&hdd_ctx->config->bExplicitCfg); - -done: - kfree(clone); - return vstatus; -} - /** * hdd_set_power_save_offload_config() - set power save offload configuration * @hdd_ctx: the pointer to hdd context @@ -1617,22 +1415,6 @@ QDF_STATUS hdd_set_sme_config(struct hdd_context *hdd_ctx) return status; } -/** - * hdd_execute_global_config_command() - execute the global config command - * @hdd_ctx: the pointer to hdd context - * @command: the command to run - * - * Return: the QDF_STATUS return from hdd_execute_config_command - */ -QDF_STATUS hdd_execute_global_config_command(struct hdd_context *hdd_ctx, - char *command) -{ - return hdd_execute_config_command(g_registry_table, - ARRAY_SIZE(g_registry_table), - (uint8_t *) hdd_ctx->config, - hdd_ctx, command); -} - static void print_info_handler(const char *buf) { hdd_nofl_info("%s", buf); diff --git a/core/hdd/src/wlan_hdd_hostapd_wext.c b/core/hdd/src/wlan_hdd_hostapd_wext.c index a284d334ea..64cb8f1202 100644 --- a/core/hdd/src/wlan_hdd_hostapd_wext.c +++ b/core/hdd/src/wlan_hdd_hostapd_wext.c @@ -57,69 +57,6 @@ #define SAP_24GHZ_CH_COUNT (14) -static int __iw_softap_set_ini_cfg(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) -{ - QDF_STATUS status; - int errno; - struct hdd_adapter *adapter; - struct hdd_context *hdd_ctx; - char *value; - size_t len; - - hdd_enter_dev(dev); - - adapter = netdev_priv(dev); - errno = hdd_validate_adapter(adapter); - if (errno) - return errno; - - hdd_ctx = WLAN_HDD_GET_CTX(adapter); - errno = wlan_hdd_validate_context(hdd_ctx); - if (errno) - return errno; - - errno = hdd_check_private_wext_control(hdd_ctx, info); - if (errno) - return errno; - - /* ensure null termination by copying into a larger, zeroed buffer */ - len = min_t(size_t, wrqu->data.length, QCSAP_IOCTL_MAX_STR_LEN); - value = qdf_mem_malloc(len + 1); - if (!value) - return -ENOMEM; - - qdf_mem_copy(value, extra, len); - hdd_debug("Received data %s", value); - status = hdd_execute_global_config_command(hdd_ctx, value); - qdf_mem_free(value); - - hdd_exit(); - - return qdf_status_to_os_return(status); -} - -int -static iw_softap_set_ini_cfg(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int errno; - struct osif_vdev_sync *vdev_sync; - - errno = osif_vdev_sync_op_start(dev, &vdev_sync); - if (errno) - return errno; - - errno = __iw_softap_set_ini_cfg(dev, info, wrqu, extra); - - osif_vdev_sync_op_stop(vdev_sync); - - return errno; -} - static int hdd_sap_get_chan_width(struct hdd_adapter *adapter, int *value) { struct sap_context *sap_ctx; @@ -3227,12 +3164,6 @@ static const struct iw_priv_args hostapd_private_args[] = { 0, "pktlog" } , - /* Set HDD CFG Ini param */ - { - QCSAP_IOCTL_SET_INI_CFG, - IW_PRIV_TYPE_CHAR | QCSAP_IOCTL_MAX_STR_LEN, 0, "setConfig" - } - , /* Get HDD CFG Ini param */ { QCSAP_IOCTL_GET_INI_CFG, @@ -3384,8 +3315,6 @@ static const iw_handler hostapd_private[] = { iw_softap_set_max_tx_power, [QCSAP_IOCTL_SET_PKTLOG - SIOCIWFIRSTPRIV] = iw_softap_set_pktlog, - [QCSAP_IOCTL_SET_INI_CFG - SIOCIWFIRSTPRIV] = - iw_softap_set_ini_cfg, [QCSAP_IOCTL_GET_INI_CFG - SIOCIWFIRSTPRIV] = iw_softap_get_ini_cfg, [QCSAP_IOCTL_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 84dbedaa20..97a5bd6551 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -1854,7 +1854,8 @@ * */ #define WE_SET_AP_WPS_IE 4 -#define WE_SET_CONFIG 5 + +/* 5 is unused */ /* * @@ -5934,7 +5935,6 @@ static int __iw_setchar_getnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - QDF_STATUS status; int sub_cmd; int ret; char *str_arg = NULL; @@ -6045,12 +6045,6 @@ static int __iw_setchar_getnone(struct net_device *dev, break; case WE_SET_AP_WPS_IE: hdd_debug("Received WE_SET_AP_WPS_IE, won't process"); - break; - case WE_SET_CONFIG: - status = hdd_execute_global_config_command(hdd_ctx, str_arg); - if (QDF_IS_STATUS_ERROR(status)) - ret = -EINVAL; - break; case WE_UNIT_TEST: ret = hdd_we_unit_test(hdd_ctx, str_arg); @@ -10713,11 +10707,6 @@ static const struct iw_priv_args we_private_args[] = { 0, "set_ap_wps_ie"}, - {WE_SET_CONFIG, - IW_PRIV_TYPE_CHAR | 512, - 0, - "setConfig"}, - #ifdef WLAN_UNIT_TEST {WE_UNIT_TEST, IW_PRIV_TYPE_CHAR | 512,