mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
Merge "qcacld-3.0: Add support for WMI_PDEV_WAL_POWER_DEBUG_CMD" into wlan-cld3.driver.lnx.1.1-dev
This commit is contained in:
commit
a58b6df0a9
7 changed files with 165 additions and 1 deletions
|
|
@ -339,8 +339,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = {
|
|||
#define WLAN_PRIV_SET_VAR_INT_GET_NONE (SIOCIWFIRSTPRIV + 7)
|
||||
|
||||
#define WE_P2P_NOA_CMD 2
|
||||
/* subcommands 3 is unused */
|
||||
|
||||
/* subcommands 3 and 4 are unused */
|
||||
#define WE_MAC_PWR_DEBUG_CMD 4
|
||||
|
||||
#ifdef FEATURE_WLAN_TDLS
|
||||
#define WE_TDLS_CONFIG_PARAMS 5
|
||||
|
|
@ -8039,6 +8040,46 @@ static int __iw_set_var_ints_getnone(struct net_device *dev,
|
|||
}
|
||||
break;
|
||||
#endif
|
||||
case WE_MAC_PWR_DEBUG_CMD:
|
||||
{
|
||||
struct sir_mac_pwr_dbg_cmd mac_pwr_dbg_args;
|
||||
tHalHandle hal = WLAN_HDD_GET_HAL_CTX(pAdapter);
|
||||
int i, j;
|
||||
|
||||
if (num_args < 3) {
|
||||
hdd_err("number of arguments can't be null %d",
|
||||
num_args);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (num_args - 3 != apps_args[2]) {
|
||||
hdd_err("arg list of size %d doesn't match num_args %d",
|
||||
num_args-3, apps_args[2]);
|
||||
return -EINVAL;
|
||||
}
|
||||
if ((apps_args[1] < WLAN_MODULE_ID_MIN) ||
|
||||
(apps_args[1] >= WLAN_MODULE_ID_MAX)) {
|
||||
hdd_err("Invalid MODULE ID %d", apps_args[1]);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (apps_args[2] > (MAX_POWER_DBG_ARGS_SUPPORTED)) {
|
||||
hdd_err("Too Many args %d", apps_args[2]);
|
||||
return -EINVAL;
|
||||
}
|
||||
mac_pwr_dbg_args.pdev_id = apps_args[0];
|
||||
mac_pwr_dbg_args.module_id = apps_args[1];
|
||||
mac_pwr_dbg_args.num_args = apps_args[2];
|
||||
|
||||
for (i = 0, j = 3; i < mac_pwr_dbg_args.num_args; i++, j++)
|
||||
mac_pwr_dbg_args.args[i] = apps_args[j];
|
||||
|
||||
if (QDF_STATUS_SUCCESS !=
|
||||
sme_process_mac_pwr_dbg_cmd(hal, pAdapter->sessionId,
|
||||
&mac_pwr_dbg_args)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
hdd_err("Invalid IOCTL command %d", sub_cmd);
|
||||
|
|
@ -10730,6 +10771,12 @@ static const struct iw_priv_args we_private_args[] = {
|
|||
0,
|
||||
"setUnitTestCmd"
|
||||
},
|
||||
{
|
||||
WE_MAC_PWR_DEBUG_CMD,
|
||||
IW_PRIV_TYPE_INT | MAX_VAR_ARGS,
|
||||
0,
|
||||
"halPwrDebug"
|
||||
},
|
||||
|
||||
#ifdef WLAN_FEATURE_GPIO_LED_FLASHING
|
||||
{WE_LED_FLASHING_PARAM,
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@ typedef uint8_t tSirVersionString[SIR_VERSION_STRING_LEN];
|
|||
/* This should not be greater than MAX_NUMBER_OF_CONC_CONNECTIONS */
|
||||
#define MAX_VDEV_SUPPORTED 4
|
||||
|
||||
#define MAX_POWER_DBG_ARGS_SUPPORTED 8
|
||||
|
||||
/**
|
||||
* enum sir_conn_update_reason: Reason for conc connection update
|
||||
* @SIR_UPDATE_REASON_SET_OPER_CHAN: Set probable operating channel
|
||||
|
|
@ -6331,4 +6333,19 @@ struct sir_p2p_lo_event {
|
|||
uint32_t vdev_id;
|
||||
uint32_t reason_code;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sir_hal_pwr_dbg_cmd - unit test command parameters
|
||||
* @pdev_id: pdev id
|
||||
* @module_id: module id
|
||||
* @num_args: number of arguments
|
||||
* @args: arguments
|
||||
*/
|
||||
struct sir_mac_pwr_dbg_cmd {
|
||||
uint32_t pdev_id;
|
||||
uint32_t module_id;
|
||||
uint32_t num_args;
|
||||
uint32_t args[MAX_POWER_DBG_ARGS_SUPPORTED];
|
||||
};
|
||||
|
||||
#endif /* __SIR_API_H */
|
||||
|
|
|
|||
|
|
@ -629,6 +629,8 @@ typedef struct sSirMbMsgP2p {
|
|||
#define SIR_HAL_NDP_CONFIRM (SIR_HAL_ITC_MSG_TYPES_BEGIN + 356)
|
||||
#define SIR_HAL_NDP_END_IND (SIR_HAL_ITC_MSG_TYPES_BEGIN + 357)
|
||||
|
||||
#define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 347)
|
||||
|
||||
#define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF)
|
||||
|
||||
/* CFG message types */
|
||||
|
|
|
|||
|
|
@ -1131,4 +1131,9 @@ void sme_update_vdev_type_nss(tHalHandle hal, uint8_t max_supp_nss,
|
|||
uint32_t vdev_type_nss, eCsrBand band);
|
||||
void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
|
||||
p2p_lo_callback callback);
|
||||
|
||||
QDF_STATUS sme_process_mac_pwr_dbg_cmd(tHalHandle hal, uint32_t session_id,
|
||||
struct sir_mac_pwr_dbg_cmd*
|
||||
dbg_args);
|
||||
|
||||
#endif /* #if !defined( __SME_API_H ) */
|
||||
|
|
|
|||
|
|
@ -15800,3 +15800,51 @@ void sme_register_p2p_lo_event(tHalHandle hHal, void *context,
|
|||
pMac->sme.p2p_lo_event_context = context;
|
||||
sme_release_global_lock(&pMac->sme);
|
||||
}
|
||||
|
||||
/**
|
||||
* sme_process_mac_pwr_dbg_cmd() - enable mac pwr debugging
|
||||
* @hal: The handle returned by macOpen
|
||||
* @session_id: session id
|
||||
* @dbg_args: args for mac pwr debug command
|
||||
* Return: Return QDF_STATUS, otherwise appropriate failure code
|
||||
*/
|
||||
QDF_STATUS sme_process_mac_pwr_dbg_cmd(tHalHandle hal, uint32_t session_id,
|
||||
struct sir_mac_pwr_dbg_cmd*
|
||||
dbg_args)
|
||||
{
|
||||
cds_msg_t message;
|
||||
tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal);
|
||||
struct sir_mac_pwr_dbg_cmd *req;
|
||||
int i;
|
||||
|
||||
if (!CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
|
||||
sms_log(mac_ctx, LOGE,
|
||||
"CSR session not valid: %d",
|
||||
session_id);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
req = qdf_mem_malloc(sizeof(*req));
|
||||
if (NULL == req) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: fail to alloc mac_pwr_dbg_args", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
req->module_id = dbg_args->module_id;
|
||||
req->pdev_id = dbg_args->pdev_id;
|
||||
req->num_args = dbg_args->num_args;
|
||||
for (i = 0; i < req->num_args; i++)
|
||||
req->args[i] = dbg_args->args[i];
|
||||
|
||||
message.type = SIR_HAL_POWER_DBG_CMD;
|
||||
message.bodyptr = req;
|
||||
|
||||
if (!QDF_IS_STATUS_SUCCESS(cds_mq_post_message
|
||||
(QDF_MODULE_ID_WMA, &message))) {
|
||||
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
|
||||
"%s: Not able to post msg to WDA!",
|
||||
__func__);
|
||||
qdf_mem_free(req);
|
||||
}
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1216,4 +1216,9 @@ void wma_remove_req(tp_wma_handle wma, uint8_t vdev_id,
|
|||
uint8_t type);
|
||||
int wma_p2p_lo_event_handler(void *handle, uint8_t *event_buf,
|
||||
uint32_t len);
|
||||
|
||||
QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
|
||||
struct sir_mac_pwr_dbg_cmd *
|
||||
sir_pwr_dbg_params);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1469,6 +1469,41 @@ static int wma_process_fw_event_tasklet_ctx(void *ctx, void *ev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_process_hal_pwr_dbg_cmd() - send hal pwr dbg cmd to fw.
|
||||
* @handle: wma handle
|
||||
* @sir_pwr_dbg_params: unit test command
|
||||
*
|
||||
* This function send unit test command to fw.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS wma_process_hal_pwr_dbg_cmd(WMA_HANDLE handle,
|
||||
struct sir_mac_pwr_dbg_cmd *
|
||||
sir_pwr_dbg_params)
|
||||
{
|
||||
tp_wma_handle wma_handle = (tp_wma_handle)handle;
|
||||
int i;
|
||||
struct wmi_power_dbg_params wmi_pwr_dbg_params;
|
||||
QDF_STATUS status;
|
||||
|
||||
if (!sir_pwr_dbg_params) {
|
||||
WMA_LOGE("%s: sir_pwr_dbg_params is null", __func__);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
wmi_pwr_dbg_params.module_id = sir_pwr_dbg_params->module_id;
|
||||
wmi_pwr_dbg_params.pdev_id = sir_pwr_dbg_params->pdev_id;
|
||||
wmi_pwr_dbg_params.num_args = sir_pwr_dbg_params->num_args;
|
||||
|
||||
for (i = 0; i < wmi_pwr_dbg_params.num_args; i++)
|
||||
wmi_pwr_dbg_params.args[i] = sir_pwr_dbg_params->args[i];
|
||||
|
||||
status = wmi_unified_send_power_dbg_cmd(wma_handle->wmi_handle,
|
||||
&wmi_pwr_dbg_params);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* wma_process_fw_event_handler() - common event handler to serialize
|
||||
* event processing through mc_thread
|
||||
|
|
@ -5959,6 +5994,11 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg)
|
|||
wma_handle_ndp_end_req(wma_handle, msg->bodyptr);
|
||||
qdf_mem_free(msg->bodyptr);
|
||||
break;
|
||||
case SIR_HAL_POWER_DBG_CMD:
|
||||
wma_process_hal_pwr_dbg_cmd(wma_handle,
|
||||
msg->bodyptr);
|
||||
qdf_mem_free(msg->bodyptr);
|
||||
break;
|
||||
default:
|
||||
WMA_LOGD("unknow msg type %x", msg->type);
|
||||
/* Do Nothing? MSG Body should be freed at here */
|
||||
|
|
|
|||
Loading…
Reference in a new issue