diff options
| -rw-r--r-- | CORE/HDD/inc/qc_sap_ioctl.h | 7 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_wext.h | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 66 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_wext.c | 102 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 23 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 1 |
6 files changed, 136 insertions, 65 deletions
diff --git a/CORE/HDD/inc/qc_sap_ioctl.h b/CORE/HDD/inc/qc_sap_ioctl.h index b9acabb97589..2f4391804287 100644 --- a/CORE/HDD/inc/qc_sap_ioctl.h +++ b/CORE/HDD/inc/qc_sap_ioctl.h @@ -173,6 +173,10 @@ typedef struct #define QCSAP_IOCTL_SET_TRAFFIC_MONITOR (SIOCIWFIRSTPRIV+24) #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) +#ifdef DEBUG +#define QCSAP_IOCTL_SET_FW_CRASH_INJECT 1 +#endif #define MAX_VAR_ARGS 7 #define QCSAP_IOCTL_PRIV_GET_SOFTAP_LINK_SPEED (SIOCIWFIRSTPRIV + 31) @@ -206,9 +210,6 @@ enum { QCSAP_DBGLOG_MOD_LOG_LEVEL, QCSAP_DBGLOG_TYPE, QCSAP_DBGLOG_REPORT_ENABLE, -#ifdef DEBUG - QCSAP_FW_CRASH_INJECT, -#endif QCASAP_TXRX_FWSTATS_RESET, QCSAP_PARAM_RTSCTS, QCASAP_SET_11N_RATE, diff --git a/CORE/HDD/inc/wlan_hdd_wext.h b/CORE/HDD/inc/wlan_hdd_wext.h index b4667a1da119..69e12046b395 100644 --- a/CORE/HDD/inc/wlan_hdd_wext.h +++ b/CORE/HDD/inc/wlan_hdd_wext.h @@ -439,4 +439,6 @@ int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, int new_phymode, hdd_context_t *phddctx); +int process_wma_set_command_twoargs(int sessid, int paramid, + int sval, int ssecval, int vpdev); #endif // __WEXT_IW_H__ diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 2e18c5f7fbb2..b551a7df565b 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -1798,6 +1798,42 @@ static iw_softap_get_ini_cfg(struct net_device *dev, return 0; } +static int iw_softap_set_two_ints_getnone(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) +{ + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx; + int *value = (int *)extra; + int sub_cmd = value[0]; + int ret = 0; + + pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + ret = wlan_hdd_validate_context(pHddCtx); + if (ret != 0) { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: HDD context is not valid!", __func__); + goto out; + } + + switch(sub_cmd) { +#ifdef DEBUG + case QCSAP_IOCTL_SET_FW_CRASH_INJECT: + hddLog(LOGE, "WE_SET_FW_CRASH_INJECT: %d %d", value[1], value[2]); + ret = process_wma_set_command_twoargs((int) pAdapter->sessionId, + (int) GEN_PARAM_CRASH_INJECT, + value[1], value[2], GEN_CMD); + break; +#endif + default: + hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd); + break; + } + +out: + return ret; +} + static void print_mac_list(v_MACADDR_t *macList, v_U8_t size) { int i; @@ -2137,16 +2173,6 @@ static iw_softap_setparam(struct net_device *dev, set_value, DBG_CMD); break; } -#ifdef DEBUG - case QCSAP_FW_CRASH_INJECT: - { - hddLog(LOGE, "WE_FW_CRASH_INJECT %d", set_value); - ret = process_wma_set_command((int)pHostapdAdapter->sessionId, - (int)GEN_PARAM_CRASH_INJECT, - set_value, GEN_CMD); - break; - } -#endif case QCSAP_PARAM_SET_MCC_CHANNEL_LATENCY: { tVOS_CONCURRENCY_MODE concurrent_state = 0; @@ -4585,12 +4611,6 @@ static const struct iw_priv_args hostapd_private_args[] = { IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "dl_report" }, -#ifdef DEBUG - { QCSAP_FW_CRASH_INJECT, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - 0, - "crash_inject" }, -#endif { QCASAP_TXRX_FWSTATS_RESET, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, @@ -4880,6 +4900,18 @@ static const struct iw_priv_args hostapd_private_args[] = { 0, "setTrafficMon" }, + /* handlers for main ioctl */ + { QCSAP_IOCTL_SET_TWO_INT_GET_NONE, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, + 0, + "" }, + /* handlers for sub-ioctl */ +#ifdef DEBUG + { QCSAP_IOCTL_SET_FW_CRASH_INJECT, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, + 0, + "crash_inject" }, +#endif }; static const iw_handler hostapd_private[] = { @@ -4907,6 +4939,8 @@ static const iw_handler hostapd_private[] = { [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_TRAFFIC_MONITOR - SIOCIWFIRSTPRIV] = iw_softap_set_trafficmonitor, + [QCSAP_IOCTL_SET_TWO_INT_GET_NONE - SIOCIWFIRSTPRIV] = + iw_softap_set_two_ints_getnone, }; const struct iw_handler_def hostapd_handler_def = { .num_standard = sizeof(hostapd_handler) / sizeof(hostapd_handler[0]), diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index 2394753d95b2..e21d394d6bcf 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -240,7 +240,6 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, #define WE_SET_EARLY_RX_DRIFT_SAMPLE 82 /* Private ioctl for packet power save */ #define WE_PPS_5G_EBT 83 -#define WE_SET_FW_CRASH_INJECT 84 /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_NONE_GET_INT (SIOCIWFIRSTPRIV + 1) @@ -443,6 +442,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { {2412, 1}, {2417, 2}, /* Private ioctls and their sub-ioctls */ #define WLAN_PRIV_SET_TWO_INT_GET_NONE (SIOCIWFIRSTPRIV + 28) #define WE_SET_SMPS_PARAM 1 +#ifdef DEBUG +#define WE_SET_FW_CRASH_INJECT 2 +#endif #define WLAN_STATS_INVALID 0 #define WLAN_STATS_RETRY_CNT 1 @@ -4303,6 +4305,40 @@ int process_wma_set_command(int sessid, int paramid, return ret; } +int process_wma_set_command_twoargs(int sessid, int paramid, + int sval, int ssecval, int vpdev) +{ + int ret = 0; + vos_msg_t msg = {0}; + wda_cli_set_cmd_t *iwcmd = vos_mem_malloc(sizeof(*iwcmd)); + + if (NULL == iwcmd) { + hddLog(VOS_TRACE_LEVEL_FATAL, "%s: vos_mem_alloc failed!", __func__); + ret = -EINVAL; + goto out; + } + + vos_mem_zero(iwcmd, sizeof(*iwcmd)); + iwcmd->param_value = sval; + iwcmd->param_sec_value = ssecval; + iwcmd->param_vdev_id = sessid; + iwcmd->param_id = paramid; + iwcmd->param_vp_dev = vpdev; + msg.type = WDA_CLI_SET_CMD; + msg.reserved = 0; + msg.bodyptr = iwcmd; + + if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, "%s: " + "Not able to post wda_cli_set_cmd message to WDA", __func__); + vos_mem_free(iwcmd); + ret = -EIO; + } + +out: + return ret; +} + int wlan_hdd_update_phymode(struct net_device *net, tHalHandle hal, int new_phymode, hdd_context_t *phddctx) @@ -5881,16 +5917,6 @@ static int iw_setint_getnone(struct net_device *dev, struct iw_request_info *inf set_value, VDEV_CMD); break; } -#ifdef DEBUG - case WE_SET_FW_CRASH_INJECT: - { - hddLog(LOGE, "WE_FW_CRASH_INJECT: %d", set_value); - ret = process_wma_set_command((int) pAdapter->sessionId, - (int) GEN_PARAM_CRASH_INJECT, - set_value, GEN_CMD); - break; - } -#endif default: { hddLog(LOGE, "%s: Invalid sub command %d", __func__, sub_cmd); @@ -9433,38 +9459,41 @@ VOS_STATUS iw_set_power_params(struct net_device *dev, struct iw_request_info *i return VOS_STATUS_SUCCESS; }/*iw_set_power_params*/ -int iw_set_two_ints_getnone(struct net_device *dev, struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +int iw_set_two_ints_getnone(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); int *value = (int *)extra; int sub_cmd = value[0]; int ret = 0; - if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) - { + if ((WLAN_HDD_GET_CTX(pAdapter))->isLogpInProgress) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_FATAL, "%s:LOGP in Progress. Ignore!!!", __func__); return -EBUSY; } - switch(sub_cmd) - { - case WE_SET_SMPS_PARAM: - { - hddLog(LOG1, "WE_SET_SMPS_PARAM val %d %d", value[1], value[2]); - ret = process_wma_set_command((int)pAdapter->sessionId, - (int)WMI_STA_SMPS_PARAM_CMDID, - value[1] << WMA_SMPS_PARAM_VALUE_S | value[2], VDEV_CMD); - break; - } - - default: - { - hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd ); - break; - } + switch(sub_cmd) { + case WE_SET_SMPS_PARAM: + hddLog(LOG1, "WE_SET_SMPS_PARAM val %d %d", value[1], value[2]); + ret = process_wma_set_command((int)pAdapter->sessionId, + (int)WMI_STA_SMPS_PARAM_CMDID, + value[1] << WMA_SMPS_PARAM_VALUE_S | value[2], VDEV_CMD); + break; +#ifdef DEBUG + case WE_SET_FW_CRASH_INJECT: + hddLog(LOGE, "WE_SET_FW_CRASH_INJECT: %d %d", value[1], value[2]); + ret = process_wma_set_command_twoargs((int) pAdapter->sessionId, + (int) GEN_PARAM_CRASH_INJECT, + value[1], value[2], GEN_CMD); + break; +#endif + default: + hddLog(LOGE, "%s: Invalid IOCTL command %d", __func__, sub_cmd); + break; } + return ret; } @@ -9985,11 +10014,6 @@ static const struct iw_priv_args we_private_args[] = { { WE_SET_EARLY_RX_DRIFT_SAMPLE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "erx_dri_sample" }, -#ifdef DEBUG - { WE_SET_FW_CRASH_INJECT, - IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, - 0, "crash_inject" }, -#endif { WLAN_PRIV_SET_NONE_GET_INT, 0, @@ -10603,7 +10627,11 @@ static const struct iw_priv_args we_private_args[] = { { WE_SET_SMPS_PARAM, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, 0, "set_smps_param" }, - +#ifdef DEBUG + { WE_SET_FW_CRASH_INJECT, + IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2, + 0, "crash_inject" }, +#endif }; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 97911a2505f7..518407ca222e 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -10917,7 +10917,8 @@ static int32_t wma_set_priv_cfg(tp_wma_handle wma_handle, return ret; } -static int wmi_crash_inject(wmi_unified_t wmi_handle, u_int32_t delay_time_ms) +static int wmi_crash_inject(wmi_unified_t wmi_handle, u_int32_t type, + u_int32_t delay_time_ms) { int ret = 0; WMI_FORCE_FW_HANG_CMD_fixed_param *cmd; @@ -10934,7 +10935,7 @@ static int wmi_crash_inject(wmi_unified_t wmi_handle, u_int32_t delay_time_ms) WMITLV_SET_HDR(&cmd->tlv_header, WMITLV_TAG_STRUC_WMI_FORCE_FW_HANG_CMD_fixed_param, WMITLV_GET_STRUCT_TLVLEN(WMI_FORCE_FW_HANG_CMD_fixed_param)); - cmd->type = 1; + cmd->type = type; cmd->delay_time_ms = delay_time_ms; ret = wmi_unified_cmd_send(wmi_handle, buf, len, WMI_FORCE_FW_HANG_CMDID); @@ -11167,7 +11168,8 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, HTCDump(wma->htc_handle, WD_DUMP, false); break; case GEN_PARAM_CRASH_INJECT: - ret = wmi_crash_inject(wma->wmi_handle, privcmd->param_value); + ret = wmi_crash_inject(wma->wmi_handle, + privcmd->param_value, privcmd->param_sec_value); break; #ifdef CONFIG_ATH_PCIE_ACCESS_DEBUG case GEN_PARAM_DUMP_PCIE_ACCESS_LOG: @@ -23495,15 +23497,18 @@ VOS_STATUS wma_stop(v_VOID_t *vos_ctx, tANI_U8 reason) WMA_LOGE("Failed to destroy the scan completion timer"); } + /* There's no need suspend target which is already down during SSR. */ + if (!vos_is_logp_in_progress(VOS_MODULE_ID_HIF, NULL)) { #ifdef HIF_USB - /* Suspend the target and enable interrupt */ - if (wma_suspend_target(wma_handle, 0)) - WMA_LOGE("Failed to suspend target"); + /* Suspend the target and enable interrupt */ + if (wma_suspend_target(wma_handle, 0)) + WMA_LOGE("Failed to suspend target"); #else - /* Suspend the target and disable interrupt */ - if (wma_suspend_target(wma_handle, 1)) - WMA_LOGE("Failed to suspend target"); + /* Suspend the target and disable interrupt */ + if (wma_suspend_target(wma_handle, 1)) + WMA_LOGE("Failed to suspend target"); #endif + } vos_status = wma_tx_detach(wma_handle); if(vos_status != VOS_STATUS_SUCCESS) { diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index 286247baadfe..9fca6c40d1e8 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -407,6 +407,7 @@ typedef struct typedef struct { v_UINT_t param_id; v_UINT_t param_value; + v_UINT_t param_sec_value; v_UINT_t param_vdev_id; v_UINT_t param_vp_dev; } wda_cli_set_cmd_t; |
