mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
qcacld-3.0: Internalize validate session Id logs
Nearly all the callers of wlan_hdd_validate_session_id() log largely the same message. Such copy-pasted code has poor maintainability. Instead, internalize these failure logs into the function itself, which allows us to control the logs driver-wide much more easily. Change-Id: Ib7bfa8020492a5cb1df2283f99b827095dfb7578 CRs-Fixed: 2292702
This commit is contained in:
parent
810927e8d5
commit
6350061075
11 changed files with 76 additions and 141 deletions
|
|
@ -2210,6 +2210,17 @@ int __wlan_hdd_validate_context(struct hdd_context *hdd_ctx, const char *func);
|
|||
*/
|
||||
int hdd_validate_adapter(struct hdd_adapter *adapter);
|
||||
|
||||
/**
|
||||
* wlan_hdd_validate_session_id() - ensure the given session Id is valid
|
||||
* @session_id: the session Id to validate
|
||||
*
|
||||
* Return: Errno
|
||||
*/
|
||||
#define wlan_hdd_validate_session_id(session_id) \
|
||||
__wlan_hdd_validate_session_id(session_id, __func__)
|
||||
|
||||
int __wlan_hdd_validate_session_id(uint8_t session_id, const char *func);
|
||||
|
||||
bool hdd_is_valid_mac_address(const uint8_t *pMacAddr);
|
||||
QDF_STATUS hdd_issta_p2p_clientconnected(struct hdd_context *hdd_ctx);
|
||||
bool wlan_hdd_validate_modules_state(struct hdd_context *hdd_ctx);
|
||||
|
|
@ -2837,14 +2848,6 @@ hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value)
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline int wlan_hdd_validate_session_id(u8 session_id)
|
||||
{
|
||||
if (session_id < CSR_ROAM_SESSION_MAX)
|
||||
return 0;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
* hdd_roam_profile() - Get adapter's roam profile
|
||||
* @adapter: The adapter being queried
|
||||
|
|
|
|||
|
|
@ -8360,10 +8360,8 @@ __wlan_hdd_cfg80211_monitor_rssi(struct wiphy *wiphy,
|
|||
|
||||
hdd_enter_dev(dev);
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (ret)
|
||||
|
|
@ -15973,10 +15971,8 @@ static int __wlan_hdd_cfg80211_change_bss(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_CHANGE_BSS,
|
||||
|
|
@ -16395,10 +16391,8 @@ static int __wlan_hdd_change_station(struct wiphy *wiphy,
|
|||
TRACE_CODE_HDD_CHANGE_STATION,
|
||||
adapter->session_id, params->listen_interval));
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
|
|
@ -16506,10 +16500,8 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_ADD_KEY,
|
||||
|
|
@ -16840,10 +16832,8 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_debug("Device_mode %s(%d)",
|
||||
hdd_device_mode_to_string(adapter->device_mode),
|
||||
|
|
@ -17031,10 +17021,8 @@ static int __wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_SET_DEFAULT_KEY,
|
||||
|
|
@ -19563,10 +19551,8 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_CONNECT,
|
||||
|
|
@ -19939,10 +19925,8 @@ static int __wlan_hdd_cfg80211_disconnect(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_DISCONNECT,
|
||||
|
|
@ -20187,10 +20171,8 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_JOIN_IBSS,
|
||||
|
|
@ -20393,10 +20375,8 @@ static int __wlan_hdd_cfg80211_leave_ibss(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_LEAVE_IBSS,
|
||||
|
|
@ -20685,10 +20665,8 @@ int __wlan_hdd_cfg80211_del_station(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_DEL_STA,
|
||||
|
|
@ -20921,10 +20899,8 @@ static int __wlan_hdd_cfg80211_add_station(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_ADD_STA,
|
||||
|
|
@ -21109,10 +21085,8 @@ static int __wlan_hdd_cfg80211_set_pmksa(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!pmksa) {
|
||||
hdd_err("pmksa is NULL");
|
||||
|
|
@ -21206,10 +21180,8 @@ static int __wlan_hdd_cfg80211_del_pmksa(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!pmksa) {
|
||||
hdd_err("pmksa is NULL");
|
||||
|
|
@ -21295,10 +21267,8 @@ static int __wlan_hdd_cfg80211_flush_pmksa(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_debug("Flushing PMKSA");
|
||||
|
||||
|
|
@ -21372,10 +21342,8 @@ __wlan_hdd_cfg80211_update_ft_ies(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_UPDATE_FT_IES,
|
||||
|
|
@ -21520,7 +21488,6 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
|
|||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
result = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -21948,10 +21915,9 @@ __wlan_hdd_cfg80211_set_ap_channel_width(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(adapter->device_mode == QDF_SAP_MODE ||
|
||||
adapter->device_mode == QDF_P2P_GO_MODE))
|
||||
return -EOPNOTSUPP;
|
||||
|
|
@ -22024,10 +21990,8 @@ static int __wlan_hdd_cfg80211_channel_switch(struct wiphy *wiphy,
|
|||
hdd_debug("Set Freq %d",
|
||||
csa_params->chandef.chan->center_freq);
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
|
|
@ -22352,10 +22316,8 @@ __wlan_hdd_cfg80211_update_connect_params(struct wiphy *wiphy,
|
|||
|
||||
hdd_enter_dev(dev);
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (ret)
|
||||
|
|
@ -22492,10 +22454,8 @@ __wlan_hdd_cfg80211_external_auth(struct wiphy *wiphy,
|
|||
return -EPERM;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -5223,10 +5223,8 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_STOP_AP,
|
||||
|
|
@ -5533,10 +5531,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("Invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_START_AP, adapter->session_id,
|
||||
|
|
@ -5838,10 +5834,8 @@ static int __wlan_hdd_cfg80211_change_beacon(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_CHANGE_BEACON,
|
||||
|
|
|
|||
|
|
@ -105,10 +105,8 @@ static int wlan_hdd_gen_wlan_status_pack(struct wlan_status_data *data,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
if (hdd_ctx->lpss_support && hdd_ctx->config->enable_lpass_support)
|
||||
|
|
|
|||
|
|
@ -932,6 +932,21 @@ int hdd_validate_adapter(struct hdd_adapter *adapter)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int __wlan_hdd_validate_session_id(uint8_t session_id, const char *func)
|
||||
{
|
||||
if (session_id == CSR_SESSION_ID_INVALID) {
|
||||
hdd_debug_rl("adapter is not up (via %s)", func);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (session_id >= CSR_ROAM_SESSION_MAX) {
|
||||
hdd_err("bad session Id:%u (via %s)", session_id, func);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* wlan_hdd_validate_modules_state() - Check modules status
|
||||
* @hdd_ctx: HDD context pointer
|
||||
|
|
|
|||
|
|
@ -142,10 +142,8 @@ static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wlan_cfg80211_roc(adapter->hdd_vdev, chan,
|
||||
duration, cookie);
|
||||
|
|
@ -188,10 +186,8 @@ __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wlan_cfg80211_cancel_roc(adapter->hdd_vdev, cookie);
|
||||
hdd_debug("cancel remain on channel, status:%d", status);
|
||||
|
|
@ -236,10 +232,8 @@ static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (ret) {
|
||||
|
|
@ -320,10 +314,8 @@ static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wlan_cfg80211_mgmt_tx_cancel(adapter->hdd_vdev,
|
||||
cookie);
|
||||
|
|
@ -666,8 +658,7 @@ struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy,
|
|||
}
|
||||
|
||||
adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
|
||||
if ((adapter != NULL) &&
|
||||
!(wlan_hdd_validate_session_id(adapter->session_id))) {
|
||||
if (adapter && !wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
if (ucfg_scan_get_vdev_status(adapter->hdd_vdev) !=
|
||||
SCAN_NOT_IN_PROGRESS) {
|
||||
wlan_abort_scan(hdd_ctx->hdd_pdev, INVAL_PDEV_ID,
|
||||
|
|
|
|||
|
|
@ -1121,10 +1121,9 @@ static int hdd_resume_wlan(void)
|
|||
|
||||
/*loop through all adapters. Concurrency */
|
||||
hdd_for_each_adapter(hdd_ctx, adapter) {
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Disable supported OffLoads */
|
||||
hdd_disable_host_offloads(adapter, pmo_apps_resume);
|
||||
|
||||
|
|
@ -1639,10 +1638,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy,
|
|||
* until CAC is done for a SoftAP which is in started state.
|
||||
*/
|
||||
hdd_for_each_adapter(hdd_ctx, adapter) {
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_debug("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (QDF_SAP_MODE == adapter->device_mode) {
|
||||
if (BSS_START ==
|
||||
|
|
@ -1854,10 +1851,8 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_SET_POWER_MGMT,
|
||||
|
|
@ -2022,24 +2017,23 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
|
|||
int status;
|
||||
struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
|
||||
|
||||
hdd_enter();
|
||||
hdd_enter_dev(ndev);
|
||||
|
||||
if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
||||
hdd_err("Command not allowed in FTM mode");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*dbm = 0;
|
||||
|
||||
status = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (0 != status) {
|
||||
*dbm = 0;
|
||||
if (status)
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Validate adapter sessionId */
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
status = wlan_hdd_validate_session_id(adapter->session_id);
|
||||
if (status)
|
||||
return status;
|
||||
|
||||
if (sta_ctx->hdd_reassoc_scenario) {
|
||||
hdd_debug("Roaming is in progress, rej this req");
|
||||
|
|
@ -2058,8 +2052,6 @@ static int __wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy,
|
|||
|
||||
if (sta_ctx->conn_info.connState != eConnectionState_Associated) {
|
||||
hdd_debug("Not associated");
|
||||
/*To keep GUI happy */
|
||||
*dbm = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -468,10 +468,8 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
status = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (0 != status)
|
||||
|
|
@ -1255,10 +1253,8 @@ static int __wlan_hdd_cfg80211_sched_scan_start(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (QDF_NDI_MODE == adapter->device_mode) {
|
||||
hdd_err("Command not allowed for NDI interface");
|
||||
|
|
@ -1321,10 +1317,8 @@ int wlan_hdd_sched_scan_stop(struct net_device *dev)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
hdd_ctx = WLAN_HDD_GET_CTX(adapter);
|
||||
if (NULL == hdd_ctx) {
|
||||
|
|
@ -1448,10 +1442,8 @@ static void __wlan_hdd_cfg80211_abort_scan(struct wiphy *wiphy,
|
|||
return;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return;
|
||||
}
|
||||
|
||||
ret = wlan_hdd_validate_context(hdd_ctx);
|
||||
if (ret)
|
||||
|
|
|
|||
|
|
@ -69,10 +69,8 @@ static int __wlan_hdd_cfg80211_spectral_scan_start(struct wiphy *wiphy,
|
|||
}
|
||||
|
||||
adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wlan_cfg80211_spectral_scan_config_and_start(wiphy,
|
||||
hdd_ctx->hdd_pdev,
|
||||
|
|
|
|||
|
|
@ -1523,10 +1523,8 @@ __wlan_hdd_cfg80211_ll_stats_get(struct wiphy *wiphy,
|
|||
|
||||
LinkLayerStatsGetReq.staId = adapter->session_id;
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = wlan_hdd_send_ll_stats_req(hdd_ctx, &LinkLayerStatsGetReq);
|
||||
if (0 != ret) {
|
||||
|
|
@ -4474,10 +4472,8 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy,
|
|||
if (status)
|
||||
return status;
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (adapter->device_mode == QDF_SAP_MODE)
|
||||
return wlan_hdd_get_sap_stats(adapter, sinfo);
|
||||
|
|
|
|||
|
|
@ -457,10 +457,8 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
MTRACE(qdf_trace(QDF_MODULE_ID_HDD,
|
||||
TRACE_CODE_HDD_CFG80211_TDLS_MGMT,
|
||||
|
|
@ -641,10 +639,8 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id)) {
|
||||
hdd_err("invalid session id: %d", adapter->session_id);
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cfg_tdls_get_support_enable(hdd_ctx->hdd_psoc, &tdls_support);
|
||||
if (!tdls_support) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue