diff options
| author | Michael Bestas <mkbestas@lineageos.org> | 2018-06-19 23:14:16 +0300 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2018-06-19 23:14:16 +0300 |
| commit | 22a6dc7fdff62a4400c52797a9c026142fa132ac (patch) | |
| tree | cec00ea44f89772561b71a7fa44ddb7789267dd3 | |
| parent | de6dac6df6807f901bac8e29de24a6a7981aea2d (diff) | |
| parent | e29df7abc913e11f51e11b055a5dce7982cd96cd (diff) | |
Merge tag 'LA.UM.6.6.r1-08900-89xx.0' of vendor/qcom-opensource/wlan/prima into lineage-15.1-caf-8996
22 files changed, 1049 insertions, 513 deletions
diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h index 4ea1c4a64ba9..8ca4e674ca9b 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -212,6 +212,9 @@ enum qca_nl80211_vendor_subcmds { /* Wi-Fi Configuration subcommands */ QCA_NL80211_VENDOR_SUBCMD_SET_WIFI_CONFIGURATION = 74, QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION = 75, + + QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET = 76, + QCA_NL80211_VENDOR_SUBCMD_GET_RING_DATA = 77, QCA_NL80211_VENDOR_SUBCMD_MONITOR_RSSI = 80, @@ -1430,6 +1433,27 @@ enum qca_wlan_vendor_config { QCA_WLAN_VENDOR_ATTR_CONFIG_LAST - 1 }; +/** + * enum qca_wlan_vendor_attr_get_logger_features - value for logger + * supported features + * @QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID - Invalid + * @QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED - Indicate the supported features + * @QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - To keep track of the last enum + * @QCA_WLAN_VENDOR_ATTR_LOGGER_MAX - max value possible for this type + * + * enum values are used for NL attributes for data used by + * QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET sub command. + */ +enum qca_wlan_vendor_attr_get_logger_features { + QCA_WLAN_VENDOR_ATTR_LOGGER_INVALID = 0, + QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED = 1, + + /* keep last */ + QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST, + QCA_WLAN_VENDOR_ATTR_LOGGER_MAX = + QCA_WLAN_VENDOR_ATTR_LOGGER_AFTER_LAST - 1, +}; + /* Feature defines */ #define WIFI_FEATURE_INFRA 0x0001 /* Basic infrastructure mode */ #define WIFI_FEATURE_INFRA_5G 0x0002 /* Support for 5 GHz Band */ @@ -1596,6 +1620,24 @@ enum qca_wlan_vendor_attr_offloaded_packets }; #endif +/** + * enum wifi_logger_supported_features - values for supported logger features + * @WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED - Per packet statistics + * @WIFI_LOGGER_CONNECT_EVENT_SUPPORTED - Logging of Connectivity events + * @WIFI_LOGGER_POWER_EVENT_SUPPORTED - Power of driver + * @WIFI_LOGGER_WAKE_LOCK_SUPPORTED - Wakelock of driver + * @WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED - monitor FW health + */ +enum wifi_logger_supported_features { + WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)), + WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)), + WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)), + WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)), + WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)), + WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)), + WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)), +}; + struct cfg80211_bss* wlan_hdd_cfg80211_update_bss_db( hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo ); diff --git a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h index eca0d144f60f..ebf0a8c693dd 100644 --- a/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h +++ b/drivers/staging/prima/CORE/HDD/inc/wlan_hdd_main.h @@ -1562,7 +1562,7 @@ struct hdd_offloaded_packets_ctx struct hdd_cache_channel_info { int channel_num; - int reg_status; + eNVChannelEnabledType reg_status; int wiphy_status; }; @@ -1859,7 +1859,7 @@ struct hdd_context_s uint32_t track_arp_ip; - struct hdd_cache_channels *orginal_channels; + struct hdd_cache_channels *original_channels; struct mutex cache_channel_lock; }; @@ -1997,9 +1997,9 @@ tANI_U8* wlan_hdd_get_intf_addr(hdd_context_t* pHddCtx); void wlan_hdd_release_intf_addr(hdd_context_t* pHddCtx, tANI_U8* releaseAddr); v_U8_t hdd_get_operating_channel( hdd_context_t *pHddCtx, device_mode_t mode ); void wlan_hdd_mon_set_typesubtype( hdd_mon_ctx_t *pMonCtx,int type); -void hdd_monPostMsgCb(tANI_U32 *magic, struct completion *cmpVar); -VOS_STATUS wlan_hdd_mon_postMsg(tANI_U32 *magic, struct completion *cmpVar, - hdd_mon_ctx_t *pMonCtx , void* callback); +void hdd_mon_post_msg_cb(void *context); +VOS_STATUS wlan_hdd_mon_postMsg(void *cookie, hdd_mon_ctx_t *pMonCtx, + void* callback); void hdd_set_conparam ( v_UINT_t newParam ); tVOS_CON_MODE hdd_get_conparam( void ); @@ -2372,6 +2372,16 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr); * @return: length of data copied to buf */ int hdd_get_disable_ch_list(hdd_context_t *hdd_ctx, tANI_U8 *buf, - tANI_U8 buf_len); + uint32_t buf_len); + +/** + * hdd_is_memdump_supported() - to check if memdump feature support + * + * This function is used to check if memdump feature is supported in + * the host driver + * + * Return: true if supported and false otherwise + */ +bool hdd_is_memdump_supported(void); #endif // end #if !defined( WLAN_HDD_MAIN_H ) diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c index e76b50dbe7bf..eea32d0b11d5 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_assoc.c @@ -1678,7 +1678,8 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * * to cfg80211_disconnected */ if ((eConnectionState_Disconnecting == pHddStaCtx->conn_info.connState) || - (eConnectionState_NotConnected == pHddStaCtx->conn_info.connState)) + (eConnectionState_NotConnected == pHddStaCtx->conn_info.connState) || + (eConnectionState_Connecting == pHddStaCtx->conn_info.connState)) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, FL(" HDD has initiated a disconnect, no need to send" @@ -1909,10 +1910,15 @@ static eHalStatus hdd_DisConnectHandler( hdd_adapter_t *pAdapter, tCsrRoamInfo * // Clear saved connection information in HDD hdd_connRemoveConnectInfo( pHddStaCtx ); - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - "%s: Set HDD connState to eConnectionState_NotConnected", - __func__); - hdd_connSetConnectionState( pHddStaCtx, eConnectionState_NotConnected ); + + /* + * eConnectionState_Connecting state mean that connection is in progress so + * no need to set state to eConnectionState_NotConnected + */ + if ((eConnectionState_Connecting != pHddStaCtx->conn_info.connState)) { + hddLog(LOG1, FL("Set HDD connState to eConnectionState_NotConnected")); + hdd_connSetConnectionState(pHddStaCtx, eConnectionState_NotConnected); + } #ifdef WLAN_FEATURE_GTK_OFFLOAD if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) || (WLAN_HDD_P2P_CLIENT == pAdapter->device_mode)) diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c index 9f32185bdda1..f9ef7a0144c2 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -8519,6 +8519,93 @@ static int wlan_hdd_cfg80211_apfind_cmd(struct wiphy *wiphy, return ret; } #endif /* WLAN_FEATURE_APFIND */ + +/** + * __wlan_hdd_cfg80211_get_logger_supp_feature() - Get the wifi logger features + * @wiphy: pointer to wireless wiphy structure. + * @wdev: pointer to wireless_dev structure. + * @data: Pointer to the data to be passed via vendor interface + * @data_len:Length of the data to be passed + * + * This is called by userspace to know the supported logger features + * + * Return: Return the Success or Failure code. + */ +static int +__wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + hdd_context_t *hdd_ctx = wiphy_priv(wiphy); + int status; + uint32_t features; + struct sk_buff *reply_skb = NULL; + + if (VOS_FTM_MODE == hdd_get_conparam()) { + hddLog(LOGE, FL("Command not allowed in FTM mode")); + return -EINVAL; + } + + status = wlan_hdd_validate_context(hdd_ctx); + if (0 != status) + return -EINVAL; + + features = 0; + + if (hdd_is_memdump_supported()) + features |= WIFI_LOGGER_MEMORY_DUMP_SUPPORTED; + + if (hdd_ctx->cfg_ini->wlanLoggingEnable && + hdd_ctx->cfg_ini->enableFatalEvent && + hdd_ctx->is_fatal_event_log_sup) { + features |= WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED; + features |= WIFI_LOGGER_CONNECT_EVENT_SUPPORTED; + } + + reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, + sizeof(uint32_t) + NLA_HDRLEN + NLMSG_HDRLEN); + if (!reply_skb) { + hddLog(LOGE, FL("cfg80211_vendor_cmd_alloc_reply_skb failed")); + return -ENOMEM; + } + + hddLog(LOG1, FL("Supported logger features: 0x%0x"), features); + if (nla_put_u32(reply_skb, QCA_WLAN_VENDOR_ATTR_LOGGER_SUPPORTED, + features)) { + hddLog(LOGE, FL("nla put fail")); + kfree_skb(reply_skb); + return -EINVAL; + } + + return cfg80211_vendor_cmd_reply(reply_skb); +} + +/** + * wlan_hdd_cfg80211_get_logger_supp_feature() - Get the wifi logger features + * @wiphy: pointer to wireless wiphy structure. + * @wdev: pointer to wireless_dev structure. + * @data: Pointer to the data to be passed via vendor interface + * @data_len:Length of the data to be passed + * + * This is called by userspace to know the supported logger features + * + * Return: Return the Success or Failure code. + */ +static int +wlan_hdd_cfg80211_get_logger_supp_feature(struct wiphy *wiphy, + struct wireless_dev *wdev, + const void *data, int data_len) +{ + int ret; + + vos_ssr_protect(__func__); + ret = __wlan_hdd_cfg80211_get_logger_supp_feature(wiphy, wdev, + data, data_len); + vos_ssr_unprotect(__func__); + + return ret; +} + const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = { { @@ -8782,6 +8869,14 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = WIPHY_VENDOR_CMD_NEED_RUNNING, .doit = hdd_cfg80211_get_station_cmd }, + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_LOGGER_FEATURE_SET, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV | + WIPHY_VENDOR_CMD_NEED_RUNNING, + .doit = wlan_hdd_cfg80211_get_logger_supp_feature + }, }; /* vendor specific events */ @@ -10722,7 +10817,7 @@ int wlan_hdd_restore_channels(hdd_context_t *hdd_ctx) mutex_lock(&hdd_ctx->cache_channel_lock); - cache_chann = hdd_ctx->orginal_channels; + cache_chann = hdd_ctx->original_channels; if (!cache_chann || !cache_chann->num_channels) { hddLog(VOS_TRACE_LEVEL_INFO, @@ -10801,7 +10896,7 @@ static int wlan_hdd_disable_channels(hdd_context_t *hdd_ctx) wiphy = hdd_ctx->wiphy; mutex_lock(&hdd_ctx->cache_channel_lock); - cache_chann = hdd_ctx->orginal_channels; + cache_chann = hdd_ctx->original_channels; if (!cache_chann || !cache_chann->num_channels) { hddLog(VOS_TRACE_LEVEL_INFO, @@ -14162,7 +14257,8 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, struct ieee80211_channel *chan; struct ieee80211_mgmt *mgmt = NULL; struct cfg80211_bss *bss_status = NULL; - size_t frame_len = sizeof (struct ieee80211_mgmt) + ie_length; + size_t frame_len = ie_length + offsetof(struct ieee80211_mgmt, + u.probe_resp.variable); int rssi = 0; hdd_context_t *pHddCtx; int status; @@ -14178,7 +14274,7 @@ wlan_hdd_cfg80211_inform_bss_frame( hdd_adapter_t *pAdapter, return NULL; } - mgmt = kzalloc((sizeof (struct ieee80211_mgmt) + ie_length), GFP_KERNEL); + mgmt = kzalloc(frame_len, GFP_KERNEL); if (!mgmt) { VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -18098,6 +18194,11 @@ static int __wlan_hdd_cfg80211_get_station(struct wiphy *wiphy, struct net_devic (int) pAdapter->hdd_stats.ClassA_stat.mcs_index); #endif //LINKSPEED_DEBUG_ENABLED +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)) || defined(WITH_BACKPORTS) + /* assume basic BW. anything else will override this later */ + sinfo->txrate.bw = RATE_INFO_BW_20; +#endif + if (eHDD_LINK_SPEED_REPORT_ACTUAL != pCfg->reportMaxLinkSpeed) { // we do not want to necessarily report the current speed diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c index 03573ec03a69..7d3037f8d9db 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_hostapd.c @@ -4524,7 +4524,7 @@ static int __iw_get_ap_freq(struct net_device *dev, else { status = hdd_wlan_get_freq(channel, &freq); - if( TRUE == status) + if( 0 == status) { /* Set Exponent parameter as 6 (MHZ) in struct iw_freq * iwlist & iwconfig command shows frequency into proper @@ -4538,7 +4538,7 @@ static int __iw_get_ap_freq(struct net_device *dev, { channel = pHddApCtx->operatingChannel; status = hdd_wlan_get_freq(channel, &freq); - if( TRUE == status) + if( 0 == status) { /* Set Exponent parameter as 6 (MHZ) in struct iw_freq * iwlist & iwconfig command shows frequency into proper @@ -4565,50 +4565,6 @@ static int iw_get_ap_freq(struct net_device *dev, return ret; } -static int __iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int status = 0; - hdd_adapter_t *pAdapter; - hdd_context_t *pHddCtx; - - ENTER(); - - pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - if (NULL == pAdapter) - { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: Adapter is NULL",__func__); - return -EINVAL; - } - pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) - { - return status; - } - - wrqu->mode = IW_MODE_MASTER; - - EXIT(); - return status; -} - -static int iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - vos_ssr_protect(__func__); - ret = __iw_get_mode(dev, info, wrqu, extra); - vos_ssr_unprotect(__func__); - - return ret; -} - - static int __iw_softap_stopbss(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, @@ -5103,7 +5059,7 @@ static const iw_handler hostapd_handler[] = (iw_handler) NULL, /* SIOCSIWFREQ */ (iw_handler) iw_get_ap_freq, /* SIOCGIWFREQ */ (iw_handler) NULL, /* SIOCSIWMODE */ - (iw_handler) iw_get_mode, /* SIOCGIWMODE */ + (iw_handler) NULL, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c index 22ea01b386a9..b57119d262e0 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_main.c @@ -151,7 +151,6 @@ static struct kparam_string fwpath = { static char *country_code; static int enable_11d = -1; static int enable_dfs_chan_scan = -1; -static int gbcnMissRate = -1; #ifndef MODULE static int wlan_hdd_inited; @@ -2707,18 +2706,38 @@ hdd_parse_reassoc(hdd_adapter_t *pAdapter, const char *command, int total_len) } #endif /* WLAN_FEATURE_VOWIFI_11R || FEATURE_WLAN_ESE FEATURE_WLAN_LFR */ -static void get_bcn_miss_rate_cb(VOS_STATUS status, int bcnMissRate, void *data) +struct bcn_miss_rate_priv { + int bcn_miss_rate; +}; + +/** + * get_bcn_miss_rate_cb() callback invoked on receiving beacon miss + * rate from firmware + * @status: Status of get beacon miss rate operation + * @bcnMissRate: Beacon miss rate + * @context: Context passed while registering callback + * + * This function is invoked by WDA layer on receiving + * WDI_GET_BCN_MISS_RATE_RSP + * + * Return: None + */ +static void get_bcn_miss_rate_cb(VOS_STATUS status, int bcnMissRate, + void *context) { struct hdd_request *request; + struct bcn_miss_rate_priv *priv; - request = hdd_request_get(data); + request = hdd_request_get(context); if (!request) { hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); return; - } + } + + priv = hdd_request_priv(request); if (VOS_STATUS_SUCCESS == status) - gbcnMissRate = bcnMissRate; + priv->bcn_miss_rate = bcnMissRate; else hddLog(VOS_TRACE_LEVEL_ERROR, FL("failed to get bcnMissRate")); @@ -2732,7 +2751,19 @@ struct fw_stats_priv { tSirFwStatsResult *fw_stats; }; -void hdd_fw_statis_cb(VOS_STATUS status, +/** + * hdd_fw_stats_cb() callback invoked on receiving firmware stats + * from firmware + * @status: Status of get firmware stats operation + * @fwStatsResult: firmware stats + * @context: Context passed while registering callback + * + * This function is invoked by WDA layer on receiving + * WDI_GET_FW_STATS_RSP + * + * Return: None + */ +static void hdd_fw_stats_cb(VOS_STATUS status, tSirFwStatsResult *fwStatsResult, void *context) { struct hdd_request *request; @@ -2747,7 +2778,7 @@ void hdd_fw_statis_cb(VOS_STATUS status, } priv = hdd_request_priv(request); - if (VOS_STATUS_SUCCESS != status) + if (VOS_STATUS_SUCCESS == status) *priv->fw_stats = *fwStatsResult; else priv->fw_stats = NULL; @@ -2856,6 +2887,67 @@ static int hdd_get_dwell_time(hdd_config_t *pCfg, tANI_U8 *command, char *extra, return ret; } +/** + * hdd_btc_get_dwell_time() - Get BTC dwell time parameters + * @pCfg: Pointer to HDD context + * @command: ASCII text command that is received + * @extra: Pointer to copy data sent to user + * @n: size of 'extra' buffer + * @len: length copied to 'extra' buffer + * + * Driver commands: + * wpa_cli DRIVER BTCGETDWELLTIME ESCO MAX + * wpa_cli DRIVER BTCGETDWELLTIME ESCO MIN + * wpa_cli DRIVER BTCGETDWELLTIME SCO MAX + * wpa_cli DRIVER BTCGETDWELLTIME SCO MIN + * + * Return: 0 for success non-zero for failure + */ + +static int hdd_btc_get_dwell_time(hdd_config_t *pCfg, tANI_U8 *command, + char *extra, tANI_U8 n, tANI_U8 *len) +{ + int ret = 0; + + if (!pCfg || !command || !extra || !len) + { + hddLog(LOGE, FL("Argument passsed for BTCGETDWELLTIME is incorrect")); + ret = -EINVAL; + return ret; + } + + if (strncmp(command, "BTCGETDWELLTIME ESCO MAX", 24) == 0) + { + *len = scnprintf(extra, n, "BTCGETDWELLTIME ESCO MAX %u\n", + (int)pCfg->max_chntime_btc_esco); + return ret; + } + else if (strncmp(command, "BTCGETDWELLTIME ESCO MIN", 24) == 0) + { + *len = scnprintf(extra, n, "BTCGETDWELLTIME ESCO MIN %u\n", + (int)pCfg->min_chntime_btc_esco); + return ret; + } + else if (strncmp(command, "BTCGETDWELLTIME SCO MAX", 23) == 0) + { + *len = scnprintf(extra, n, "BTCGETDWELLTIME SCO MAX %u\n", + (int)pCfg->max_chntime_btc_sco); + return ret; + } + else if (strncmp(command, "BTCGETDWELLTIME SCO MIN", 23) == 0) + { + *len = scnprintf(extra, n, "BTCGETDWELLTIME SCO MIN %u\n", + (int)pCfg->min_chntime_btc_sco); + return ret; + } + else + { + ret = -EINVAL; + } + + return ret; +} + int hdd_drv_cmd_validate(tANI_U8 *command, int len) { if (command[len] != ' ') @@ -2864,6 +2956,313 @@ int hdd_drv_cmd_validate(tANI_U8 *command, int len) return 0; } +#ifdef WLAN_AP_STA_CONCURRENCY + +/** + * hdd_conc_get_dwell_time() - Get concurrency dwell time parameters + * @pCfg: Pointer to HDD context + * @command: ASCII text command that is received + * @extra: Pointer to copy data sent to user + * @n: size of 'extra' buffer + * @len: length copied to 'extra' buffer + * + * Driver commands: + * wpa_cli DRIVER CONCGETDWELLTIME ACTIVE MAX + * wpa_cli DRIVER CONCGETDWELLTIME ACTIVE MIN + * wpa_cli DRIVER CONCGETDWELLTIME PASSIVE MAX + * wpa_cli DRIVER CONCGETDWELLTIME PASSIVE MIN + * + * Return: 0 for success non-zero for failure + */ + +static int hdd_conc_get_dwell_time(hdd_config_t *pCfg, tANI_U8 *command, + char *extra, tANI_U8 n, tANI_U8 *len) +{ + int ret = 0; + + if (!pCfg || !command || !extra || !len) + { + hddLog(LOGE, FL("Argument passsed for CONCGETDWELLTIME is incorrect")); + ret = -EINVAL; + return ret; + } + + if (strncmp(command, "CONCGETDWELLTIME ACTIVE MAX", 27) == 0) + { + *len = scnprintf(extra, n, "CONCGETDWELLTIME ACTIVE MAX %u\n", + (int)pCfg->nActiveMaxChnTimeConc); + return ret; + } + else if (strncmp(command, "CONCGETDWELLTIME ACTIVE MIN", 27) == 0) + { + *len = scnprintf(extra, n, "CONCGETDWELLTIME ACTIVE MIN %u\n", + (int)pCfg->nActiveMinChnTimeConc); + return ret; + } + else if (strncmp(command, "CONCGETDWELLTIME PASSIVE MAX", 28) == 0) + { + *len = scnprintf(extra, n, "CONCGETDWELLTIME PASSIVE MAX %u\n", + (int)pCfg->nPassiveMaxChnTimeConc); + return ret; + } + else if (strncmp(command, "CONCGETDWELLTIME PASSIVE MIN", 28) == 0) + { + *len = scnprintf(extra, n, "CONCGETDWELLTIME PASSIVE MIN %u\n", + (int)pCfg->nPassiveMinChnTimeConc); + return ret; + } + else + { + ret = -EINVAL; + } + + return ret; +} + +/** + * hdd_conc_set_dwell_time() - Set concurrency dwell time parameters + * @pAdapter: Adapter upon which the command was received + * @command: ASCII text command that is received + * + * Driver commands: + * wpa_cli DRIVER CONCSETDWELLTIME ACTIVE MAX <value> + * wpa_cli DRIVER CONCSETDWELLTIME ACTIVE MIN <value> + * wpa_cli DRIVER CONCSETDWELLTIME PASSIVE MAX <value + * wpa_cli DRIVER CONCSETDWELLTIME PASSIVE MIN <value> + * + * Return: 0 for success non-zero for failure + */ + +static int hdd_conc_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) +{ + tHalHandle hHal; + hdd_config_t *pCfg; + tANI_U8 *value = command; + int val = 0, ret = 0, temp = 0; + tSmeConfigParams smeConfig; + + if (!pAdapter || !command || !(pCfg = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini) + || !(hHal = (WLAN_HDD_GET_HAL_CTX(pAdapter)))) + { + hddLog(LOGE, FL("Argument passed for CONCSETDWELLTIME is incorrect")); + ret = -EINVAL; + return ret; + } + + vos_mem_zero(&smeConfig, sizeof(smeConfig)); + sme_GetConfigParam(hHal, &smeConfig); + + if (strncmp(command, "CONCSETDWELLTIME ACTIVE MAX", 27) == 0 ) + { + if (hdd_drv_cmd_validate(command, 27)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 28; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MIN || + val > CFG_ACTIVE_MAX_CHANNEL_TIME_CONC_MAX) + { + hddLog(LOGE, FL("Argument passed for CONCSETDWELLTIME ACTIVE MAX is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->nActiveMaxChnTimeConc = val; + smeConfig.csrConfig.nActiveMaxChnTimeConc = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else if (strncmp(command, "CONCSETDWELLTIME ACTIVE MIN", 27) == 0) + { + if (hdd_drv_cmd_validate(command, 27)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 28; + temp = kstrtou32(value, 10, &val); + if (temp !=0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MIN || + val > CFG_ACTIVE_MIN_CHANNEL_TIME_CONC_MAX) + { + hddLog(LOGE, FL("Argument passsed for CONCSETDWELLTIME ACTIVE MIN is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->nActiveMinChnTimeConc = val; + smeConfig.csrConfig.nActiveMinChnTimeConc = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else if (strncmp(command, "CONCSETDWELLTIME PASSIVE MAX", 28) == 0) + { + if (hdd_drv_cmd_validate(command, 28)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 29; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MIN || + val > CFG_PASSIVE_MAX_CHANNEL_TIME_CONC_MAX) + { + hddLog(LOGE, FL("Argument passed for CONCSETDWELLTIME PASSIVE MAX is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->nPassiveMaxChnTimeConc = val; + smeConfig.csrConfig.nPassiveMaxChnTimeConc = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else if (strncmp(command, "CONCSETDWELLTIME PASSIVE MIN", 28) == 0) + { + if (hdd_drv_cmd_validate(command, 28)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 29; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MIN || + val > CFG_PASSIVE_MIN_CHANNEL_TIME_CONC_MAX ) + { + hddLog(LOGE, FL("Argument passed for CONCSETDWELLTIME PASSIVE MIN is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->nPassiveMinChnTimeConc = val; + smeConfig.csrConfig.nPassiveMinChnTimeConc = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else + { + ret = -EINVAL; + } + + return ret; +} + +#endif + +/** + * hdd_btc_set_dwell_time() - Set BTC dwell time parameters + * @pAdapter: Adapter upon which the command was received + * @command: ASCII text command that is received + * + * Driver commands: + * wpa_cli DRIVER BTCSETDWELLTIME ESCO MAX <value> + * wpa_cli DRIVER BTCSETDWELLTIME ESCO MIN <value> + * wpa_cli DRIVER BTCSETDWELLTIME SCO MAX <value> + * wpa_cli DRIVER BTCSETDWELLTIME SCO MIN <value> + * + * Return: 0 for success non-zero for failure + */ + +static int hdd_btc_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) +{ + tHalHandle hHal; + hdd_config_t *pCfg; + tANI_U8 *value = command; + int val = 0, ret = 0, temp = 0; + tSmeConfigParams smeConfig; + + if (!pAdapter || !command || !(pCfg = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini) + || !(hHal = (WLAN_HDD_GET_HAL_CTX(pAdapter)))) + { + hddLog(LOGE, FL("Argument passed for BTCSETDWELLTIME is incorrect")); + ret = -EINVAL; + return ret; + } + + vos_mem_zero(&smeConfig, sizeof(smeConfig)); + sme_GetConfigParam(hHal, &smeConfig); + + if (strncmp(command, "BTCSETDWELLTIME ESCO MAX", 24) == 0) + { + if (hdd_drv_cmd_validate(command, 24)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 25; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_BTC_MIN || + val > CFG_ACTIVE_MAX_CHANNEL_TIME_BTC_MAX) + { + hddLog(LOGE, FL("Argument passed for BTCSETDWELLTIME ESCO MAX is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->max_chntime_btc_esco = val; + smeConfig.csrConfig.max_chntime_btc_esco = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else if (strncmp(command, "BTCSETDWELLTIME ESCO MIN", 24) == 0) + { + if (hdd_drv_cmd_validate(command, 24)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 25; + temp = kstrtou32(value, 10, &val); + if (temp !=0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_BTC_MIN || + val > CFG_ACTIVE_MIN_CHANNEL_TIME_BTC_MAX) + { + hddLog(LOGE, FL("Argument passsed for BTCSETDWELLTIME ESCO MIN is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->min_chntime_btc_esco = val; + smeConfig.csrConfig.min_chntime_btc_esco = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else if (strncmp(command, "BTCSETDWELLTIME SCO MAX", 23) == 0) + { + if (hdd_drv_cmd_validate(command, 23)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 24; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_ACTIVE_MAX_CHANNEL_TIME_BTC_SCO_MIN || + val > CFG_ACTIVE_MAX_CHANNEL_TIME_BTC_SCO_MAX) + { + hddLog(LOGE, FL("Argument passed for BTCSETDWELLTIME SCO MAX is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->max_chntime_btc_sco = val; + smeConfig.csrConfig.max_chntime_btc_sco = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else if (strncmp(command, "BTCSETDWELLTIME SCO MIN", 23) == 0) + { + if (hdd_drv_cmd_validate(command, 23)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + value = value + 24; + temp = kstrtou32(value, 10, &val); + if (temp != 0 || val < CFG_ACTIVE_MIN_CHANNEL_TIME_BTC_SCO_MIN || + val > CFG_ACTIVE_MIN_CHANNEL_TIME_BTC_SCO_MAX) + { + hddLog(LOGE, FL("Argument passed for BTCSETDWELLTIME SCO MIN is incorrect")); + ret = -EFAULT; + return ret; + } + pCfg->min_chntime_btc_sco = val; + smeConfig.csrConfig.min_chntime_btc_sco = val; + sme_UpdateConfig(hHal, &smeConfig); + } + else + { + ret = -EINVAL; + } + + return ret; +} + static int hdd_set_dwell_time(hdd_adapter_t *pAdapter, tANI_U8 *command) { tHalHandle hHal; @@ -3198,12 +3597,15 @@ static inline void hdd_assign_reassoc_handoff(tCsrHandoffRequest *handoffInfo) static void wlan_hdd_free_cache_channels(hdd_context_t *hdd_ctx) { + if(!hdd_ctx || !hdd_ctx->original_channels) + return; + mutex_lock(&hdd_ctx->cache_channel_lock); - hdd_ctx->orginal_channels->num_channels = 0; - vos_mem_free(hdd_ctx->orginal_channels->channel_info); - hdd_ctx->orginal_channels->channel_info = NULL; - vos_mem_free(hdd_ctx->orginal_channels); - hdd_ctx->orginal_channels = NULL; + hdd_ctx->original_channels->num_channels = 0; + vos_mem_free(hdd_ctx->original_channels->channel_info); + hdd_ctx->original_channels->channel_info = NULL; + vos_mem_free(hdd_ctx->original_channels); + hdd_ctx->original_channels = NULL; mutex_unlock(&hdd_ctx->cache_channel_lock); } @@ -3219,58 +3621,24 @@ static void wlan_hdd_free_cache_channels(hdd_context_t *hdd_ctx) int hdd_alloc_chan_cache(hdd_context_t *hdd_ctx, int num_chan) { - if (NULL == hdd_ctx->orginal_channels) { - hdd_ctx->orginal_channels = + hdd_ctx->original_channels = vos_mem_malloc(sizeof(struct hdd_cache_channels)); - if (NULL == hdd_ctx->orginal_channels) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "In %s, VOS_MALLOC_ERR", __func__); - return -EINVAL; - } - hdd_ctx->orginal_channels->num_channels = num_chan; - hdd_ctx->orginal_channels->channel_info = + if (!hdd_ctx->original_channels) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "In %s, VOS_MALLOC_ERR", __func__); + return -EINVAL; + } + hdd_ctx->original_channels->num_channels = num_chan; + hdd_ctx->original_channels->channel_info = vos_mem_malloc(num_chan * sizeof(struct hdd_cache_channel_info)); - if (NULL == hdd_ctx->orginal_channels->channel_info) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "In %s, VOS_MALLOC_ERR", __func__); - hdd_ctx->orginal_channels->num_channels = 0; - vos_mem_free(hdd_ctx->orginal_channels); - hdd_ctx->orginal_channels = NULL; - return -EINVAL; - } - } else { - /* Same command comes multiple times */ - struct hdd_cache_channel_info *temp_chan_info; - - if (hdd_ctx->orginal_channels->num_channels + num_chan > - MAX_CHANNEL) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "%s: Invalid Number of channel received", - __func__); - return -EINVAL; - } - - temp_chan_info = vos_mem_malloc(( - hdd_ctx->orginal_channels-> - num_channels + num_chan) * - sizeof(struct hdd_cache_channel_info)); - if (NULL == temp_chan_info) { - hddLog(VOS_TRACE_LEVEL_ERROR, - "In %s, VOS_MALLOC_ERR", - __func__); - return -EINVAL; - } - - vos_mem_copy(temp_chan_info, hdd_ctx->orginal_channels-> - channel_info, hdd_ctx->orginal_channels-> - num_channels * - sizeof(struct hdd_cache_channel_info)); - - hdd_ctx->orginal_channels->num_channels += num_chan; - vos_mem_free(hdd_ctx->orginal_channels->channel_info); - hdd_ctx->orginal_channels->channel_info = temp_chan_info; - temp_chan_info = NULL; + if (!hdd_ctx->original_channels->channel_info) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "In %s, VOS_MALLOC_ERR", __func__); + hdd_ctx->original_channels->num_channels = 0; + vos_mem_free(hdd_ctx->original_channels); + hdd_ctx->original_channels = NULL; + return -ENOMEM; } return 0; @@ -3282,7 +3650,9 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_HDD, NULL); hdd_context_t *hdd_ctx = vos_get_context(VOS_MODULE_ID_HDD, pvosGCtx); tANI_U8 *param; - int j, tempInt, index = 0, ret = 0; + int j, tempInt, ret = 0, i, num_channels; + int parsed_channels[MAX_CHANNEL]; + bool is_command_repeated = false; if (NULL == pvosGCtx) { hddLog(VOS_TRACE_LEVEL_FATAL, @@ -3344,13 +3714,25 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) } mutex_lock(&hdd_ctx->cache_channel_lock); - if (hdd_alloc_chan_cache(hdd_ctx, tempInt)) { - ret = -ENOMEM; - goto parse_done; + if (!hdd_ctx->original_channels) { + if (hdd_alloc_chan_cache(hdd_ctx, tempInt)) { + ret = -ENOMEM; + goto mem_alloc_failed; + } + } else if (hdd_ctx->original_channels->num_channels != tempInt) { + hddLog(VOS_TRACE_LEVEL_ERROR, + "%s, Invalid No of channel provided in the list", + __func__); + ret = -EINVAL; + is_command_repeated = true; + goto parse_failed; + } else { + is_command_repeated = true; } - index = hdd_ctx->orginal_channels->num_channels - tempInt; - for (j = index; j < hdd_ctx->orginal_channels->num_channels; j++) { + num_channels = tempInt; + + for (j = 0; j < num_channels; j++) { /* * param pointing to the beginning of first space * after number of channels @@ -3362,7 +3744,7 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) "%s, Invalid No of channel provided in the list", __func__); ret = -EINVAL; - goto parse_done; + goto parse_failed; } param++; @@ -3376,7 +3758,7 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) "%s, No channel is provided in the list", __func__); ret = -EINVAL; - goto parse_done; + goto parse_failed; } @@ -3385,7 +3767,7 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) "%s: Cannot read channel number", __func__); ret = -EINVAL; - goto parse_done; + goto parse_failed; } @@ -3394,14 +3776,14 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) "%s: Invalid channel number received", __func__); ret = -EINVAL; - goto parse_done; + goto parse_failed; } hddLog(VOS_TRACE_LEVEL_INFO, "%s: channel[%d] = %d", __func__, j, tempInt); - hdd_ctx->orginal_channels->channel_info[j].channel_num = - tempInt; + + parsed_channels[j] = tempInt; } /*extra arguments check*/ @@ -3414,48 +3796,70 @@ int hdd_parse_disable_chan_cmd(hdd_adapter_t *adapter, tANI_U8 *ptr) hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Invalid argument received", __func__); ret = -EINVAL; - goto parse_done; + goto parse_failed; + } + } + + /* + * If command is received first time, cache the channels to + * be disabled else compare the channels received in the + * command with the cached channels, if channel list matches + * return success otherewise return failure. + */ + if (!is_command_repeated) + for (j = 0; j < num_channels; j++) + hdd_ctx->original_channels-> + channel_info[j].channel_num = + parsed_channels[j]; + else { + for (i = 0; i < num_channels; i++) { + for (j = 0; j < num_channels; j++) + if (hdd_ctx->original_channels-> + channel_info[i].channel_num == + parsed_channels[j]) + break; + if (j == num_channels) { + ret = -EINVAL; + goto parse_failed; + } } + ret = 0; } -parse_done: +mem_alloc_failed: mutex_unlock(&hdd_ctx->cache_channel_lock); EXIT(); return ret; + +parse_failed: + mutex_unlock(&hdd_ctx->cache_channel_lock); + if (!is_command_repeated) + wlan_hdd_free_cache_channels(hdd_ctx); + EXIT(); + return ret; + } int hdd_get_disable_ch_list(hdd_context_t *hdd_ctx, tANI_U8 *buf, - tANI_U8 buf_len) + uint32_t buf_len) { struct hdd_cache_channel_info *ch_list; unsigned char i, num_ch; int len = 0; mutex_lock(&hdd_ctx->cache_channel_lock); - if (hdd_ctx->orginal_channels && - hdd_ctx->orginal_channels->num_channels) { - num_ch = hdd_ctx->orginal_channels->num_channels; - - if (num_ch == 0) { - mutex_unlock(&hdd_ctx->cache_channel_lock); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - FL("no disable channels programed")); - return 0; - } + if (hdd_ctx->original_channels && + hdd_ctx->original_channels->num_channels && + hdd_ctx->original_channels->channel_info) { + num_ch = hdd_ctx->original_channels->num_channels; len = scnprintf(buf, buf_len, "%s %hhu", "GET_DISABLE_CHANNEL_LIST", num_ch); - ch_list = hdd_ctx->orginal_channels->channel_info; - if (!ch_list) { - mutex_unlock(&hdd_ctx->cache_channel_lock); - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, - FL("disable channel list is NULL")); - return 0; - } + ch_list = hdd_ctx->original_channels->channel_info; - for (i = 0; (i < num_ch) && len <= buf_len; i++) { + for (i = 0; (i < num_ch) && (len < buf_len-1); i++) { len += scnprintf(buf + len, buf_len - len, " %d", ch_list[i].channel_num); } @@ -5230,6 +5634,68 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, { ret = hdd_set_dwell_time(pAdapter, command); } + else if (strncmp(command, "BTCGETDWELLTIME", 15) == 0) + { + hdd_config_t *pCfg = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini; + char extra[32]; + tANI_U8 len = 0; + + if (hdd_drv_cmd_validate(command, 15)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + memset(extra, 0, sizeof(extra)); + ret = hdd_btc_get_dwell_time(pCfg, command, extra, + sizeof(extra), &len); + len = VOS_MIN(priv_data.total_len, len + 1); + if (ret != 0 || copy_to_user(priv_data.buf, &extra, len)) { + hddLog(LOGE, FL("Failed to copy data to user buffer")); + ret = -EFAULT; + goto exit; + } + ret = len; + } + else if (strncmp(command, "BTCSETDWELLTIME", 15) == 0) + { + if (hdd_drv_cmd_validate(command, 15)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + ret = hdd_btc_set_dwell_time(pAdapter, command); + } +#ifdef WLAN_AP_STA_CONCURRENCY + else if (strncmp(command, "CONCGETDWELLTIME", 16) == 0) + { + hdd_config_t *pCfg = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini; + char extra[32]; + tANI_U8 len = 0; + + if (hdd_drv_cmd_validate(command, 16)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + + memset(extra, 0, sizeof(extra)); + ret = hdd_conc_get_dwell_time(pCfg, command, extra, + sizeof(extra), &len); + len = VOS_MIN(priv_data.total_len, len + 1); + if (ret != 0 || copy_to_user(priv_data.buf, &extra, len)) { + hddLog(LOGE, FL("Failed to copy data to user buffer")); + ret = -EFAULT; + goto exit; + } + ret = len; + } + else if (strncmp(command, "CONCSETDWELLTIME", 16) == 0) + { + if (hdd_drv_cmd_validate(command, 16)) { + hddLog(LOGE, FL("Invalid driver command")); + return -EINVAL; + } + ret = hdd_conc_set_dwell_time(pAdapter, command); + } +#endif else if ( strncasecmp(command, "MIRACAST", 8) == 0 ) { tANI_U8 filterType = 0; @@ -6270,8 +6736,9 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, char buf[32], len; void *cookie; struct hdd_request *request; + struct bcn_miss_rate_priv *priv; static const struct hdd_request_params params = { - .priv_size = 0, + .priv_size = sizeof(*priv), .timeout_ms = WLAN_WAIT_TIME_STATS, }; @@ -6291,6 +6758,8 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, goto exit; } cookie = hdd_request_cookie(request); + priv = hdd_request_priv(request); + priv->bcn_miss_rate = -1; status = sme_getBcnMissRate((tHalHandle)(pHddCtx->hHal), pAdapter->sessionId, @@ -6315,9 +6784,15 @@ static int hdd_driver_command(hdd_adapter_t *pAdapter, } hddLog(VOS_TRACE_LEVEL_INFO, - FL("GETBCNMISSRATE: bcnMissRate: %d"), gbcnMissRate); + FL("GETBCNMISSRATE: bcnMissRate: %d"), priv->bcn_miss_rate); - len = snprintf(buf, sizeof(buf), "GETBCNMISSRATE %d", gbcnMissRate); + if (priv->bcn_miss_rate == -1) { + ret = -EFAULT; + goto free_bcn_miss_rate_req; + } + + len = snprintf(buf, sizeof(buf), "GETBCNMISSRATE %d", + priv->bcn_miss_rate); if (copy_to_user(priv_data.buf, &buf, len + 1)) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -6458,9 +6933,10 @@ free_bcn_miss_rate_req: ret = -ENOMEM; goto exit; } + cookie = hdd_request_cookie(request); status = sme_GetFwStats( (tHalHandle)pHddCtx->hHal, stats, - cookie, hdd_fw_statis_cb); + cookie, hdd_fw_stats_cb); if (eHAL_STATUS_SUCCESS != status) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -6600,25 +7076,25 @@ free_bcn_miss_rate_req: goto exit; } else if (strncmp(command, "GET_DISABLE_CHANNEL_LIST", 24) == 0) { - char extra[128] = {0}; - int len; + char extra[512] = {0}; + int max_len, copied_length; - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, " Received Command to get disable Channels list %s", __func__); - len = hdd_get_disable_ch_list(pHddCtx, extra, sizeof(extra)); - if (len == 0) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, + max_len = VOS_MIN(priv_data.total_len, sizeof(extra)); + copied_length = hdd_get_disable_ch_list(pHddCtx, extra, max_len); + if (copied_length == 0) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("disable channel list are not yet programed")); ret = -EINVAL; goto exit; } - len = VOS_MIN(priv_data.total_len, len + 1); - if (copy_to_user(priv_data.buf, &extra, len)) { - VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - "%s: failed to copy data to user buffer", __func__); + if (copy_to_user(priv_data.buf, &extra, copied_length + 1)) { + VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: failed to copy data to user buffer", __func__); ret = -EFAULT; goto exit; } @@ -9199,23 +9675,21 @@ VOS_STATUS hdd_disable_bmps_imps(hdd_context_t *pHddCtx, tANI_U8 session_type) return status; } -void hdd_monPostMsgCb(tANI_U32 *magic, struct completion *cmpVar) +void hdd_mon_post_msg_cb(void *context) { - if (magic == NULL || cmpVar == NULL) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("invalid arguments %pK %pK"), magic, cmpVar); - return; - } - if (*magic != MON_MODE_MSG_MAGIC) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("maic: %x"), *magic); - return; - } + struct hdd_request *request; - complete(cmpVar); - return; + request = hdd_request_get(context); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Obsolete request")); + return; + } + + hdd_request_complete(request); + hdd_request_put(request); } + void hdd_init_mon_mode (hdd_adapter_t *pAdapter) { hdd_mon_ctx_t *pMonCtx = NULL; @@ -9532,9 +10006,9 @@ hdd_adapter_t* hdd_open_adapter( hdd_context_t *pHddCtx, tANI_U8 session_type, return pAdapter; err_free_netdev: - free_netdev(pAdapter->dev); wlan_hdd_release_intf_addr( pHddCtx, pAdapter->macAddressCurrent.bytes ); + free_netdev(pAdapter->dev); resume_bmps: //If bmps disabled enable it @@ -9676,12 +10150,16 @@ VOS_STATUS hdd_cleanup_ap_events(hdd_adapter_t *adapter) int wlan_hdd_stop_mon(hdd_context_t *hdd_ctx, bool wait) { - hdd_mon_ctx_t *mon_ctx; - long ret; - v_U32_t magic; - struct completion cmp_var; - void (*func_ptr)(tANI_U32 *magic, struct completion *cmpVar) = NULL; hdd_adapter_t *adapter; + hdd_mon_ctx_t *mon_ctx; + void (*func_ptr)(void *context) = NULL; + int ret = 0; + void *cookie = NULL; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; adapter = hdd_get_adapter(hdd_ctx, WLAN_HDD_MONITOR); if (!adapter) { @@ -9698,28 +10176,37 @@ int wlan_hdd_stop_mon(hdd_context_t *hdd_ctx, bool wait) mon_ctx->state = MON_MODE_STOP; if (wait) { - func_ptr = hdd_monPostMsgCb; - magic = MON_MODE_MSG_MAGIC; - init_completion(&cmp_var); + func_ptr = hdd_mon_post_msg_cb; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, + FL("Request allocation failure")); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); } - if (VOS_STATUS_SUCCESS != wlan_hdd_mon_postMsg(&magic, &cmp_var, + /* + * If func_ptr is NULL, on receiving WDI_MON_START_RSP or + * WDI_MON_STOP_RSP hdd_mon_post_msg_cb() won't be invoked + * and so uninitialized cookie won't be accessed. + */ + if (VOS_STATUS_SUCCESS != wlan_hdd_mon_postMsg(cookie, mon_ctx, - hdd_monPostMsgCb)) { + func_ptr)) { hddLog(LOGE, FL("failed to stop MON MODE")); - mon_ctx->state = MON_MODE_START; - magic = 0; - return -EINVAL; + ret = -EINVAL; } if (!wait) goto bmps_roaming; - ret = wait_for_completion_timeout(&cmp_var, MON_MODE_MSG_TIMEOUT); - magic = 0; - if (ret <= 0 ) { + if (!ret) + ret = hdd_request_wait_for_response(request); + hdd_request_put(request); + if (ret) { hddLog(LOGE, - FL("timeout on stop monitor mode completion %ld"), ret); + FL("timeout on stop monitor mode completion %d"), ret); return -EINVAL; } @@ -11483,8 +11970,8 @@ void wlan_hdd_mon_set_typesubtype( hdd_mon_ctx_t *pMonCtx,int type) pMonCtx->typeSubtypeBitmap |= 0xFFFF00000000; } -VOS_STATUS wlan_hdd_mon_postMsg(tANI_U32 *magic, struct completion *cmpVar, - hdd_mon_ctx_t *pMonCtx , void* callback) +VOS_STATUS wlan_hdd_mon_postMsg(void *context, hdd_mon_ctx_t *pMonCtx, + void* callback) { vos_msg_t monMsg; tSirMonModeReq *pMonModeReq; @@ -11506,8 +11993,7 @@ VOS_STATUS wlan_hdd_mon_postMsg(tANI_U32 *magic, struct completion *cmpVar, return VOS_STATUS_E_FAILURE; } - pMonModeReq->magic = magic; - pMonModeReq->cmpVar = cmpVar; + pMonModeReq->context = context; pMonModeReq->data = pMonCtx; pMonModeReq->callback = callback; @@ -11527,10 +12013,14 @@ void wlan_hdd_mon_close(hdd_context_t *pHddCtx) { VOS_STATUS vosStatus; v_CONTEXT_t pVosContext = pHddCtx->pvosContext; - long ret; hdd_mon_ctx_t *pMonCtx = NULL; - v_U32_t magic; - struct completion cmpVar; + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; hdd_adapter_t *pAdapter = hdd_get_adapter(pHddCtx,WLAN_HDD_MONITOR); if(pAdapter == NULL || pVosContext == NULL) @@ -11542,23 +12032,29 @@ void wlan_hdd_mon_close(hdd_context_t *pHddCtx) pMonCtx = WLAN_HDD_GET_MONITOR_CTX_PTR(pAdapter); if (pMonCtx!= NULL && pMonCtx->state == MON_MODE_START) { pMonCtx->state = MON_MODE_STOP; - magic = MON_MODE_MSG_MAGIC; - init_completion(&cmpVar); + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return; + } + cookie = hdd_request_cookie(request); + if (VOS_STATUS_SUCCESS != - wlan_hdd_mon_postMsg(&magic, &cmpVar, - pMonCtx, hdd_monPostMsgCb)) { + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("failed to post MON MODE REQ")); pMonCtx->state = MON_MODE_START; - magic = 0; - return; + goto req_put; } - ret = wait_for_completion_timeout(&cmpVar, MON_MODE_MSG_TIMEOUT); - magic = 0; - if (ret <= 0 ) { + + ret = hdd_request_wait_for_response(request); + if (ret) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("timeout on monitor mode completion %ld"), ret); - } + FL("timeout on monitor mode completion %d"), ret); + +req_put: + hdd_request_put(request); } hdd_UnregisterWext(pAdapter->dev); @@ -11975,6 +12471,9 @@ free_hdd_ctx: __func__); } + /* Free the cache channels of the command SET_DISABLE_CHANNEL_LIST */ + wlan_hdd_free_cache_channels(pHddCtx); + //Free up dynamically allocated members inside HDD Adapter if (pHddCtx->cfg_ini) { @@ -14207,13 +14706,13 @@ static void __exit hdd_module_exit(void) #ifdef MODULE static int fwpath_changed_handler(const char *kmessage, - struct kernel_param *kp) + const struct kernel_param *kp) { return param_set_copystring(kmessage, kp); } static int con_mode_handler(const char *kmessage, - struct kernel_param *kp) + const struct kernel_param *kp) { return param_set_int(kmessage, kp); } @@ -14260,7 +14759,7 @@ static int kickstart_driver(void) --------------------------------------------------------------------------*/ static int fwpath_changed_handler(const char *kmessage, - struct kernel_param *kp) + const struct kernel_param *kp) { int ret; @@ -14283,7 +14782,8 @@ static int fwpath_changed_handler(const char *kmessage, \return - --------------------------------------------------------------------------*/ -static int con_mode_handler(const char *kmessage, struct kernel_param *kp) +static int con_mode_handler(const char *kmessage, + const struct kernel_param *kp) { int ret; @@ -17912,6 +18412,14 @@ void wlan_hdd_tsf_init(hdd_adapter_t *adapter) #endif +bool hdd_is_memdump_supported(void) +{ +#ifdef WLAN_FEATURE_MEMDUMP + return true; +#endif + return false; +} + //Register the module init/exit functions module_init(hdd_module_init); module_exit(hdd_module_exit); @@ -17920,10 +18428,20 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_AUTHOR("Qualcomm Atheros, Inc."); MODULE_DESCRIPTION("WLAN HOST DEVICE DRIVER"); -module_param_call(con_mode, con_mode_handler, param_get_int, &con_mode, +static const struct kernel_param_ops con_mode_ops = { + .set = con_mode_handler, + .get = param_get_int, +}; + +static const struct kernel_param_ops fwpath_ops = { + .set = fwpath_changed_handler, + .get = param_get_string, +}; + +module_param_cb(con_mode, &con_mode_ops, &con_mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); -module_param_call(fwpath, fwpath_changed_handler, param_get_string, &fwpath, +module_param_cb(fwpath, &fwpath_ops, &fwpath, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); module_param(enable_dfs_chan_scan, int, diff --git a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c index f5b34250b73a..bdf63665a020 100644 --- a/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c +++ b/drivers/staging/prima/CORE/HDD/src/wlan_hdd_wext.c @@ -839,7 +839,7 @@ int hdd_wlan_get_freq(v_U32_t channel, v_U32_t *pfreq) if (channel == freq_chan_map[i].chan) { *pfreq = freq_chan_map[i].freq; - return 1; + return 0; } } } @@ -1632,189 +1632,6 @@ static int iw_get_name(struct net_device *dev, return ret; } -static int __iw_set_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter; - hdd_context_t *pHddCtx; - tCsrRoamProfile *pRoamProfile; - eCsrRoamBssType LastBSSType; - eMib_dot11DesiredBssType connectedBssType; - hdd_config_t *pConfig; - struct wireless_dev *wdev; - int status = 0; - - ENTER(); - - pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - if (NULL == pAdapter) - { - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter", __func__); - return 0; - } - pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - status = wlan_hdd_validate_context(pHddCtx); - if (0 != status) - { - return status; - } - - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - if (pWextState == NULL) - { - hddLog(LOGE, "%s ERROR: Data Storage Corruption", __func__); - return -EINVAL; - } - - wdev = dev->ieee80211_ptr; - pRoamProfile = &pWextState->roamProfile; - LastBSSType = pRoamProfile->BSSType; - - hddLog(LOG1, "%s Old Bss type = %d", __func__, LastBSSType); - - switch (wrqu->mode) - { - case IW_MODE_ADHOC: - hddLog(LOG1, "%s Setting AP Mode as IW_MODE_ADHOC", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_START_IBSS; - // Set the phymode correctly for IBSS. - pConfig = (WLAN_HDD_GET_CTX(pAdapter))->cfg_ini; - pWextState->roamProfile.phyMode = hdd_cfg_xlate_to_csr_phy_mode(pConfig->dot11Mode); - pAdapter->device_mode = WLAN_HDD_IBSS; - wdev->iftype = NL80211_IFTYPE_ADHOC; - break; - case IW_MODE_INFRA: - hddLog(LOG1, "%s Setting AP Mode as IW_MODE_INFRA", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_INFRASTRUCTURE; - wdev->iftype = NL80211_IFTYPE_STATION; - break; - case IW_MODE_AUTO: - hddLog(LOG1, "%s Setting AP Mode as IW_MODE_AUTO", __func__); - pRoamProfile->BSSType = eCSR_BSS_TYPE_ANY; - break; - default: - hddLog(LOGE, "%s Unknown AP Mode value %d ", __func__, wrqu->mode); - return -EOPNOTSUPP; - } - - if ( LastBSSType != pRoamProfile->BSSType ) - { - //the BSS mode changed - // We need to issue disconnect if connected or in IBSS disconnect state - if ( hdd_connGetConnectedBssType( WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), &connectedBssType ) || - ( eCSR_BSS_TYPE_START_IBSS == LastBSSType ) ) - { - VOS_STATUS vosStatus; - // need to issue a disconnect to CSR. - INIT_COMPLETION(pAdapter->disconnect_comp_var); - vosStatus = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), - pAdapter->sessionId, - eCSR_DISCONNECT_REASON_IBSS_LEAVE ); - if(VOS_STATUS_SUCCESS == vosStatus) - { - long ret; - ret = wait_for_completion_interruptible_timeout( - &pAdapter->disconnect_comp_var, - msecs_to_jiffies(WLAN_WAIT_TIME_DISCONNECT)); - if (ret <= 0) - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("failed wait on disconnect_comp_var %ld"), ret); - } - } - } - - EXIT(); - return 0; -} - -static int iw_set_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) -{ - int ret; - - vos_ssr_protect(__func__); - ret = __iw_set_mode(dev, info, wrqu, extra); - vos_ssr_unprotect(__func__); - - return ret; -} - -static int __iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) -{ - - hdd_wext_state_t *pWextState; - hdd_adapter_t *pAdapter; - hdd_context_t *pHddCtx; - int ret = 0; - - ENTER(); - - pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - if (NULL == pAdapter) - { - hddLog(VOS_TRACE_LEVEL_WARN, - "%s: Invalid context, pAdapter", __func__); - return 0; - } - - pHddCtx = WLAN_HDD_GET_CTX(pAdapter); - ret = wlan_hdd_validate_context(pHddCtx); - if (0 != ret) - { - return ret; - } - pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); - if (pWextState == NULL) - { - hddLog(LOGE, "%s ERROR: Data Storage Corruption", __func__); - return -EINVAL; - } - - switch (pWextState->roamProfile.BSSType) - { - case eCSR_BSS_TYPE_INFRASTRUCTURE: - hddLog(LOG1, "%s returns IW_MODE_INFRA", __func__); - wrqu->mode = IW_MODE_INFRA; - break; - case eCSR_BSS_TYPE_IBSS: - case eCSR_BSS_TYPE_START_IBSS: - hddLog(LOG1, "%s returns IW_MODE_ADHOC", __func__); - wrqu->mode = IW_MODE_ADHOC; - break; - case eCSR_BSS_TYPE_ANY: - hddLog(LOG1, "%s returns IW_MODE_AUTO", __func__); - wrqu->mode = IW_MODE_AUTO; - break; - default: - hddLog(LOG1, "%s returns APMODE_UNKNOWN", __func__); - break; - } - - EXIT(); - return 0; -} - -static int iw_get_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, - char *extra) -{ - int ret; - - vos_ssr_protect(__func__); - ret = __iw_get_mode(dev, info, wrqu, extra); - vos_ssr_unprotect(__func__); - - return ret; -} - static int __iw_set_freq(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -2024,7 +1841,7 @@ static int __iw_get_freq(struct net_device *dev, else { status = hdd_wlan_get_freq(channel, &freq); - if( TRUE == status ) + if( 0 == status ) { /* Set Exponent parameter as 6 (MHZ) in struct iw_freq * iwlist & iwconfig command shows frequency into proper @@ -5619,9 +5436,12 @@ static int __iw_mon_setint_getnone(struct net_device *dev, case WE_SET_MONITOR_STATE: { - v_U32_t magic = 0; - struct completion cmp_var; - long waitRet = 0; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; mon_ctx = WLAN_HDD_GET_MONITOR_CTX_PTR(adapter); if(!mon_ctx) { @@ -5642,30 +5462,33 @@ static int __iw_mon_setint_getnone(struct net_device *dev, break; mon_ctx->state = set_value; - magic = MON_MODE_MSG_MAGIC; - init_completion(&cmp_var); - if (wlan_hdd_mon_postMsg(&magic, &cmp_var, mon_ctx, - hdd_monPostMsgCb) != VOS_STATUS_SUCCESS) { + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + ret = -ENOMEM; + break; + } + cookie = hdd_request_cookie(request); + if (wlan_hdd_mon_postMsg(cookie, mon_ctx, + hdd_mon_post_msg_cb) + != VOS_STATUS_SUCCESS) { hddLog(LOGE, FL("failed to post MON MODE REQ")); mon_ctx->state = (mon_ctx->state==MON_MODE_START) ? MON_MODE_STOP : MON_MODE_START; - magic = 0; ret = -EIO; - break; - } - - waitRet = wait_for_completion_timeout(&cmp_var, - MON_MODE_MSG_TIMEOUT); - magic = 0; - if (waitRet <= 0 ){ - hddLog(LOGE, FL("failed to wait on monitor mode completion %ld"), - waitRet); - } else if (mon_ctx->state == MON_MODE_STOP) { - hddLog(LOG1, FL("Enable BMPS")); - hdd_enable_bmps_imps(hdd_ctx); - hdd_restore_roaming(hdd_ctx); + } else { + ret = hdd_request_wait_for_response(request); + if (ret){ + hddLog(LOGE, FL("failed to wait on monitor mode completion %d"), + ret); + } else if (mon_ctx->state == MON_MODE_STOP) { + hddLog(LOG1, FL("Enable BMPS")); + hdd_enable_bmps_imps(hdd_ctx); + hdd_restore_roaming(hdd_ctx); + } } + hdd_request_put(request); } break; @@ -6279,10 +6102,14 @@ static int __iw_setint_getnone(struct net_device *dev, } case WE_SET_MONITOR_STATE: { - v_U32_t magic = 0; - struct completion cmpVar; - long waitRet = 0; tVOS_CON_MODE mode = hdd_get_conparam(); + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; if( VOS_MONITOR_MODE != mode) { @@ -6306,26 +6133,31 @@ static int __iw_setint_getnone(struct net_device *dev, break; } pMonCtx->state = set_value; - magic = MON_MODE_MSG_MAGIC; - init_completion(&cmpVar); + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + ret = -ENOMEM; + break; + } + cookie = hdd_request_cookie(request); + if (VOS_STATUS_SUCCESS != - wlan_hdd_mon_postMsg(&magic, &cmpVar, - pMonCtx, hdd_monPostMsgCb)) { + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("failed to post MON MODE REQ")); pMonCtx->state = (pMonCtx->state==MON_MODE_START)? MON_MODE_STOP : MON_MODE_START; - magic = 0; ret = -EIO; - break; - } - waitRet = wait_for_completion_timeout(&cmpVar, MON_MODE_MSG_TIMEOUT); - magic = 0; - if (waitRet <= 0 ){ - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("failed to wait on monitor mode completion %ld"), - waitRet); + } else { + ret = hdd_request_wait_for_response(request); + if (ret) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on monitor mode completion %d"), + ret); + } } + hdd_request_put(request); break; } case WE_SET_PKT_STATS_ENABLE_DISABLE: @@ -6704,6 +6536,7 @@ static VOS_STATUS wlan_hdd_get_current_antenna_index(hdd_adapter_t *pAdapter, else { /* request was sent -- wait for the response */ + ret = hdd_request_wait_for_response(request); if (ret) { hddLog(VOS_TRACE_LEVEL_ERROR, @@ -8085,10 +7918,14 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, #endif case WE_CONFIGURE_MONITOR_MODE: { - v_U32_t magic = 0; - struct completion cmpVar; - long waitRet = 0; tVOS_CON_MODE mode = hdd_get_conparam(); + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; if (VOS_MONITOR_MODE != mode) { hddLog(LOGE, FL("invalid mode %d"), mode); @@ -8122,34 +7959,41 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, pMonCtx->typeSubtypeBitmap = 0xFFFF00000000; } if (MON_MODE_START == pMonCtx->state) { - magic = MON_MODE_MSG_MAGIC; - init_completion(&cmpVar); + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return -ENOMEM; + } + cookie = hdd_request_cookie(request); + if (VOS_STATUS_SUCCESS != - wlan_hdd_mon_postMsg(&magic, &cmpVar, - pMonCtx, hdd_monPostMsgCb)) { + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, FL("failed to post MON MODE REQ")); - magic = 0; - return -EIO; - } - waitRet = wait_for_completion_timeout(&cmpVar, - MON_MODE_MSG_TIMEOUT); - magic = 0; - if (waitRet <= 0 ) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("failed to wait on monitor mode completion %ld"), - waitRet); - } - } + ret = -EIO; + } else { + ret = hdd_request_wait_for_response(request); + if (ret) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on monitor mode completion %d"), + ret); + } + hdd_request_put(request); + } } break; case WE_SET_MONITOR_MODE_FILTER: { - v_U32_t magic = 0; - struct completion cmpVar; - long waitRet = 0; tVOS_CON_MODE mode = hdd_get_conparam(); + int ret; + void *cookie; + struct hdd_request *request; + static const struct hdd_request_params params = { + .priv_size = 0, + .timeout_ms = MON_MODE_MSG_TIMEOUT, + }; if (VOS_MONITOR_MODE != mode) { hddLog(LOGE, FL("invalid mode %d"), mode); @@ -8177,24 +8021,23 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, __func__, pMonCtx->mmFilters[0].macAddr.bytes, apps_args[6], apps_args[7], apps_args[8]); if (MON_MODE_START == pMonCtx->state) { - magic = MON_MODE_MSG_MAGIC; - init_completion(&cmpVar); - if (VOS_STATUS_SUCCESS != - wlan_hdd_mon_postMsg(&magic, &cmpVar, - pMonCtx, hdd_monPostMsgCb)) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("failed to post MON MODE REQ")); - magic = 0; - return -EIO; + request = hdd_request_alloc(¶ms); + if (!request) { + hddLog(VOS_TRACE_LEVEL_ERROR, FL("Request allocation failure")); + return -ENOMEM; } - waitRet = wait_for_completion_timeout(&cmpVar, - MON_MODE_MSG_TIMEOUT); - magic = 0; - if (waitRet <= 0 ) { - VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, - FL("failed to wait on monitor mode completion %ld"), - waitRet); + cookie = hdd_request_cookie(request); + + if (VOS_STATUS_SUCCESS == + wlan_hdd_mon_postMsg(cookie, pMonCtx, + hdd_mon_post_msg_cb)) { + ret = hdd_request_wait_for_response(request); + if (ret) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + FL("failed to wait on monitor mode completion %d"), + ret); } + hdd_request_put(request); } } break; @@ -8207,7 +8050,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, break; } EXIT(); - return 0; + return ret; } static int iw_hdd_set_var_ints_getnone(struct net_device *dev, @@ -9324,6 +9167,7 @@ int wlan_hdd_set_filter(hdd_adapter_t *pAdapter, tpPacketFilterCfg pRequest) { hddLog(VOS_TRACE_LEVEL_ERROR, "%s: Failure to execute Clear Filter", __func__); + hdd_request_put(request); return -EINVAL; } @@ -11096,8 +10940,8 @@ static const iw_handler we_handler[] = (iw_handler) NULL, /* SIOCGIWNWID */ (iw_handler) iw_set_freq, /* SIOCSIWFREQ */ (iw_handler) iw_get_freq, /* SIOCGIWFREQ */ - (iw_handler) iw_set_mode, /* SIOCSIWMODE */ - (iw_handler) iw_get_mode, /* SIOCGIWMODE */ + (iw_handler) NULL, /* SIOCSIWMODE */ + (iw_handler) NULL, /* SIOCGIWMODE */ (iw_handler) NULL, /* SIOCSIWSENS */ (iw_handler) NULL, /* SIOCGIWSENS */ (iw_handler) NULL, /* SIOCSIWRANGE */ diff --git a/drivers/staging/prima/CORE/MAC/inc/sirApi.h b/drivers/staging/prima/CORE/MAC/inc/sirApi.h index 4b054bf79c6d..2e8a8ef0239d 100644 --- a/drivers/staging/prima/CORE/MAC/inc/sirApi.h +++ b/drivers/staging/prima/CORE/MAC/inc/sirApi.h @@ -6106,12 +6106,11 @@ typedef struct tSirMacAddr bssid; }tSirDelAllTdlsPeers, *ptSirDelAllTdlsPeers; -typedef void (*tSirMonModeCb)(tANI_U32 *magic, struct completion *cmpVar); +typedef void (*tSirMonModeCb)(void *context); typedef struct { - tANI_U32 *magic; - struct completion *cmpVar; void *data; + void *context; tSirMonModeCb callback; }tSirMonModeReq, *ptSirMonModeReq; diff --git a/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h b/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h index 5a2a6e0a2fd9..75ff4f408624 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h +++ b/drivers/staging/prima/CORE/MAC/src/pe/include/limSession.h @@ -371,6 +371,7 @@ typedef struct sPESession // Added to Support BT-AMP tDot11fIEHTInfo ht_operation; tDot11fIEVHTOperation vht_operation; bool force_24ghz_in_ht20; + int8_t def_max_tx_pwr; }tPESession, *tpPESession; #define LIM_MAX_ACTIVE_SESSIONS 4 diff --git a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c index 59934c6d0f6c..65ec3c36e5fc 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c @@ -2094,7 +2094,7 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf) TX_POWER_DEFAULT); psessionEntry->maxTxPower = TX_POWER_DEFAULT; } - + psessionEntry->def_max_tx_pwr = psessionEntry->maxTxPower; VOS_TRACE(VOS_MODULE_ID_PE, VOS_TRACE_LEVEL_INFO, "Regulatory max = %d, local power constraint = %d," " max tx = %d", regMax, localPowerConstraint, diff --git a/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c b/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c index 5bba7e7df264..a3970698036c 100644 --- a/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c +++ b/drivers/staging/prima/CORE/MAC/src/pe/rrm/rrmApi.c @@ -282,7 +282,7 @@ rrmProcessLinkMeasurementRequest( tpAniSirGlobal pMac, return eSIR_FAILURE; } pHdr = WDA_GET_RX_MAC_HEADER( pRxPacketInfo ); - LinkReport.txPower = limGetMaxTxPower (pSessionEntry->maxTxPower, + LinkReport.txPower = limGetMaxTxPower (pSessionEntry->def_max_tx_pwr, pLinkReq->MaxTxPower.maxTxPower, pMac->roam.configParam.nTxPowerCap); diff --git a/drivers/staging/prima/CORE/SAP/src/sapModule.c b/drivers/staging/prima/CORE/SAP/src/sapModule.c index 6268e7de0e9b..e6109599ec62 100644 --- a/drivers/staging/prima/CORE/SAP/src/sapModule.c +++ b/drivers/staging/prima/CORE/SAP/src/sapModule.c @@ -173,6 +173,8 @@ WLANSAP_Open return VOS_STATUS_E_FAULT; } + init_completion(&pSapCtx->ecsa_info.chan_switch_comp); + if (!VOS_IS_STATUS_SUCCESS( vos_spin_lock_init(&pSapCtx->ecsa_info.ecsa_lock))) { @@ -648,7 +650,6 @@ WLANSAP_StartBss pSapCtx->scanBandPreference = pConfig->scanBandPreference; pSapCtx->acsBandSwitchThreshold = pConfig->acsBandSwitchThreshold; pSapCtx->pUsrContext = pUsrContext; - init_completion(&pSapCtx->ecsa_info.chan_switch_comp); //Set the BSSID to your "self MAC Addr" read the mac address from Configuation ITEM received from HDD pSapCtx->csrRoamProfile.BSSIDs.numOfBSSIDs = 1; diff --git a/drivers/staging/prima/CORE/SME/inc/btcApi.h b/drivers/staging/prima/CORE/SME/inc/btcApi.h index c6da770b5fff..444ec2ffca39 100644 --- a/drivers/staging/prima/CORE/SME/inc/btcApi.h +++ b/drivers/staging/prima/CORE/SME/inc/btcApi.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2012-2013, 2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 2016, 2018 The Linux Foundation. All rights + * reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -372,6 +373,7 @@ typedef struct sSmeBtcInfo bool btc_scan_compromise_sco; v_U8_t btcBssfordisableaggr[VOS_MAC_ADDRESS_LEN]; vos_timer_t enableUapsdTimer; + bool agg_disabled; } tSmeBtcInfo, *tpSmeBtcInfo; diff --git a/drivers/staging/prima/CORE/SME/src/btc/btcApi.c b/drivers/staging/prima/CORE/SME/src/btc/btcApi.c index 32c1dd6e34be..0aec164218a0 100644 --- a/drivers/staging/prima/CORE/SME/src/btc/btcApi.c +++ b/drivers/staging/prima/CORE/SME/src/btc/btcApi.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -98,6 +98,7 @@ VOS_STATUS btcOpen (tHalHandle hHal) pMac->btc.btcHBActive = VOS_TRUE; pMac->btc.btc_scan_compromise_esco = false; pMac->btc.btc_scan_compromise_sco = false; + pMac->btc.agg_disabled = false; for (i = 0; i < MWS_COEX_MAX_VICTIM_TABLE; i++) { diff --git a/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c b/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c index cb131b029ade..efe8f1cce217 100644 --- a/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c +++ b/drivers/staging/prima/CORE/SME/src/csr/csrApiRoam.c @@ -2731,12 +2731,11 @@ void csr_roam_remove_duplicate_cmd_from_list(tpAniSirGlobal pMac, pNextEntry = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); pDupCommand = GET_BASE_ADDR(pEntry, tSmeCmd, Link); /* - * Remove the previous command if.. - * - the new roam command is for the same RoamReason... - * - the new roam command is a NewProfileList. - * - the new roam command is a Forced Dissoc - * - the new roam command is from an 802.11 OID - * (OID_SSID or OID_BSSID). + * If pCommand is not NULL remove the similar duplicate cmd for same + * reason as pCommand. If pCommand is NULL then check if eRoamReason is + * eCsrForcedDisassoc (disconnect) and remove all roam command for the + * sessionId, else if eRoamReason is eCsrHddIssued (connect) remove all + * connect (non disconenct) commands. */ if ((pCommand && (pCommand->sessionId == pDupCommand->sessionId) && ((pCommand->command == pDupCommand->command) && @@ -2755,7 +2754,8 @@ void csr_roam_remove_duplicate_cmd_from_list(tpAniSirGlobal pMac, ((sessionId == pDupCommand->sessionId) && (eSmeCommandRoam == pDupCommand->command) && ((eCsrForcedDisassoc == eRoamReason) || - (eCsrHddIssued == eRoamReason)))) + (eCsrHddIssued == eRoamReason && + !CSR_IS_DISCONNECT_COMMAND(pDupCommand))))) { smsLog(pMac, LOGW, FL("RoamReason = %d"), pDupCommand->u.roamCmd.roamReason); diff --git a/drivers/staging/prima/CORE/SME/src/pmc/pmc.c b/drivers/staging/prima/CORE/SME/src/pmc/pmc.c index f5539ff66927..b391aacea501 100644 --- a/drivers/staging/prima/CORE/SME/src/pmc/pmc.c +++ b/drivers/staging/prima/CORE/SME/src/pmc/pmc.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2012-2014, 2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2014, 2016, 2018 The Linux Foundation. All rights + * reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -2518,6 +2519,11 @@ eHalStatus pmcEnterBmpsCheck( tpAniSirGlobal pMac ) } } + if (pMac->btc.agg_disabled) { + pmcLog(pMac, LOG1, FL("Aggregation disabled. BMPS can't be started")); + return eHAL_STATUS_FAILURE; + } + return ( eHAL_STATUS_SUCCESS ); } @@ -2558,6 +2564,12 @@ tANI_BOOLEAN pmcShouldBmpsTimerRun( tpAniSirGlobal pMac ) pmcLog(pMac, LOG1, FL("No Infra Session. BMPS can't be started")); return eANI_BOOLEAN_FALSE; } + + if (pMac->btc.agg_disabled) { + pmcLog(pMac, LOG1, FL("Aggregation disabled. BMPS can't be started")); + return eANI_BOOLEAN_FALSE; + } + return eANI_BOOLEAN_TRUE; } diff --git a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c index df43cdb5efbb..87855866584a 100644 --- a/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c +++ b/drivers/staging/prima/CORE/SME/src/sme_common/sme_Api.c @@ -2540,6 +2540,30 @@ static VOS_STATUS sme_ecsa_msg_processor(tpAniSirGlobal mac_ctx, return VOS_STATUS_SUCCESS; } +static bool sme_get_sessionid_from_scan_cmd(tpAniSirGlobal mac, + tANI_U32 *session_id) +{ + tListElem *entry = NULL; + tSmeCmd *command = NULL; + bool active_scan = false; + + if (!mac->fScanOffload) { + entry = csrLLPeekHead(&mac->sme.smeCmdActiveList, LL_ACCESS_LOCK); + } else { + entry = csrLLPeekHead(&mac->sme.smeScanCmdActiveList, LL_ACCESS_LOCK); + } + + if (entry) { + command = GET_BASE_ADDR(entry, tSmeCmd, Link); + if (command->command == eSmeCommandScan) { + *session_id = command->sessionId; + active_scan = true; + } + } + + return active_scan; +} + /*-------------------------------------------------------------------------- \brief sme_ProcessMsg() - The main message processor for SME. @@ -2736,10 +2760,18 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) { tSirSmeCoexInd *pSmeCoexInd = (tSirSmeCoexInd *)pMsg->bodyptr; vos_msg_t vosMessage = {0}; + tANI_U32 session_id = 0; + bool active_scan; if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4) { + pMac->btc.agg_disabled = true; smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4")); + active_scan = sme_get_sessionid_from_scan_cmd(pMac, + &session_id); + if (active_scan) + sme_AbortMacScan(hHal, session_id, + eCSR_SCAN_ABORT_DEFAULT); sme_RequestFullPower(hHal, NULL, NULL, eSME_REASON_OTHER); pMac->isCoexScoIndSet = 1; pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; @@ -2750,6 +2782,7 @@ eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) } else if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4) { + pMac->btc.agg_disabled = false; smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4")); pMac->isCoexScoIndSet = 0; sme_RequestBmps(hHal, NULL, NULL); diff --git a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c index b125cc183691..4668f62a1453 100644 --- a/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c +++ b/drivers/staging/prima/CORE/TL/src/wlan_qct_tl.c @@ -6142,10 +6142,18 @@ static void WLANTL_CacheEapol(WLANTL_CbType* pTLCb, vos_pkt_t* vosTempBuff) static void WLANTL_SampleRxRSSI(WLANTL_CbType* pTLCb, void * pBDHeader, uint8_t sta_id) { - WLANTL_STAClientType *pClientSTA = pTLCb->atlSTAClients[sta_id]; - uint8_t count = pClientSTA->rssi_sample_cnt; - uint8_t old_idx = pClientSTA->rssi_stale_idx; + uint8_t count; + uint8_t old_idx; s8 curr_RSSI, curr_RSSI0, curr_RSSI1; + WLANTL_STAClientType *pClientSTA = pTLCb->atlSTAClients[sta_id]; + + if(pClientSTA == NULL) { + TLLOGE(VOS_TRACE( VOS_MODULE_ID_TL, VOS_TRACE_LEVEL_ERROR, + " %s: pClientSTA is NULL", __func__)); + return; + } + count = pClientSTA->rssi_sample_cnt; + old_idx = pClientSTA->rssi_stale_idx; curr_RSSI0 = WLANTL_GETRSSI0(pBDHeader); curr_RSSI1 = WLANTL_GETRSSI1(pBDHeader); diff --git a/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h b/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h index 3880855fa2e9..f86bf809cba6 100644 --- a/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h +++ b/drivers/staging/prima/CORE/VOSS/inc/vos_nvitem.h @@ -745,7 +745,8 @@ eNVChannelEnabledType vos_nv_getChannelEnabledState * DFS * Return - Void */ -void vos_nv_set_channel_state(v_U32_t rfChannel, int channel_state); +void vos_nv_set_channel_state(v_U32_t rfChannel, + eNVChannelEnabledType channel_state); VOS_STATUS vos_init_wiphy_from_nv_bin(void); diff --git a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c index 175bb82cb511..2251e8a2efcb 100644 --- a/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c +++ b/drivers/staging/prima/CORE/VOSS/src/vos_nvitem.c @@ -2643,7 +2643,8 @@ VOS_STATUS vos_nv_setNVEncodedBuffer(v_U8_t *pNvBuffer, v_SIZE_t size) * DFS * Return - Void */ -void vos_nv_set_channel_state(v_U32_t rfChannel, int channel_state) +void vos_nv_set_channel_state(v_U32_t rfChannel, + eNVChannelEnabledType channel_state) { v_U32_t channelLoop; eRfChannels channelEnum = INVALID_RF_CHANNEL; diff --git a/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c b/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c index 14c6eadf5242..8d23e6852e80 100644 --- a/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c +++ b/drivers/staging/prima/CORE/VOSS/src/wlan_nv_template_builtin.c @@ -587,8 +587,8 @@ _NV_TEMPLATE_TABLE NvTablesBuiltIn[/*TABLES_MAX*/][TABLE_ENTRIES_MAX] = { ((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) - (char *)&nvDefaults.tables.hwCalValues.calData),"psSlpTimeOvrHdxLNA5G"}, {"ed",_ID_U8,SINGULAR,0,0,0, - (((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) + - sizeof(uint16)) - (char *)&nvDefaults.tables.hwCalValues.calData), + ((char *)&(nvDefaults.tables.hwCalValues.calData.psSlpTimeOvrHdxLNA5G) - + (char *)&nvDefaults.tables.hwCalValues.calData) + sizeof(uint16), "nv_TxBBFSel9MHz"}, {"ee",_ID_U8,SINGULAR,0,0,0, ((char *)&(nvDefaults.tables.hwCalValues.calData.hwParam2) - diff --git a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c index 0a9384bf5c36..a3dfa7bef91c 100644 --- a/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c +++ b/drivers/staging/prima/CORE/WDA/src/wlan_qct_wda.c @@ -22990,8 +22990,8 @@ void WDA_MonModeRspCallback(void *pEventData, void* pUserData) return ; } pData = (tSirMonModeReq *)pWdaParams->wdaMsgParam; - if (pData != NULL) { - pData->callback(pData->magic, pData->cmpVar); + if (pData != NULL && pData->callback != NULL) { + pData->callback(pData->context); vos_mem_free(pWdaParams->wdaMsgParam); } vos_mem_free(pWdaParams) ; |
