diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2015-04-16 11:21:56 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-04-16 11:21:56 -0700 |
| commit | 28da3e5ace9c392bc02760798da6925fdfe0d577 (patch) | |
| tree | 34904e266e6bd4d5f19de54efabb614e33c4a60e | |
| parent | e82e0cc4413ba15de33d9a754bc86cb696a34d5b (diff) | |
| parent | 3c1675f179cf289e03f9231b144e32193e03ce3c (diff) | |
Merge "Release 4.0.10.77 QCACLD WLAN Driver"
25 files changed, 430 insertions, 335 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h index 9ee845756c78..64ad0ffdff15 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg.h +++ b/CORE/HDD/inc/wlan_hdd_cfg.h @@ -2775,7 +2775,7 @@ enum dot11p_mode { #define CFG_ROAM_SCAN_HI_RSSI_DELTA_NAME "gRoamScanHiRssiDelta" #define CFG_ROAM_SCAN_HI_RSSI_DELTA_MIN (0) #define CFG_ROAM_SCAN_HI_RSSI_DELTA_MAX (16) -#define CFG_ROAM_SCAN_HI_RSSI_DELTA_DEFAULT (0) +#define CFG_ROAM_SCAN_HI_RSSI_DELTA_DEFAULT (10) /* Delay between consecutive scans in milliseconds */ #define CFG_ROAM_SCAN_HI_RSSI_DELAY_NAME "gRoamScanHiRssiDelay" diff --git a/CORE/HDD/inc/wlan_hdd_tdls.h b/CORE/HDD/inc/wlan_hdd_tdls.h index 04d8398914c4..3f85a586a8f7 100644 --- a/CORE/HDD/inc/wlan_hdd_tdls.h +++ b/CORE/HDD/inc/wlan_hdd_tdls.h @@ -34,10 +34,10 @@ \brief Linux HDD TDLS include file ==========================================================================*/ -#define MAX_NUM_TDLS_PEER 3 - #ifdef FEATURE_WLAN_TDLS +#define MAX_NUM_TDLS_PEER 3 + #define TDLS_SUB_DISCOVERY_PERIOD 100 #define TDLS_MAX_DISCOVER_REQS_PER_TIMER 1 diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index d79a46416826..813cc3f26e5a 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -3076,23 +3076,53 @@ static int hdd_extscan_start_fill_bucket_channel_spec( return 0; } +/* + * define short names for the global vendor params + * used by wlan_hdd_cfg80211_extscan_start() + */ +#define PARAM_MAX \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +#define PARAM_REQUEST_ID \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID +#define PARAM_BASE_PERIOD \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD +#define PARAM_MAX_AP_PER_SCAN \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN +#define PARAM_RPT_THRHLD_PERCENT \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT +#define PARAM_RPT_THRHLD_NUM_SCANS \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS +#define PARAM_NUM_BUCKETS \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS + +/** + * wlan_hdd_cfg80211_extscan_start() - start extscan + * @wiphy: Pointer to wireless phy. + * @wdev: Pointer to wireless device. + * @data: Pointer to input data. + * @data_len: Length of @data. + * + * Return: 0 on success, negative errno on failure + */ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, - struct wireless_dev *wdev, - const void *data, - int data_len) + struct wireless_dev *wdev, + const void *data, + int data_len) { - tpSirWifiScanCmdReqParams pReqMsg = NULL; - struct net_device *dev = wdev->netdev; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *pHddCtx = wiphy_priv(wiphy); - struct nlattr *tb[ - QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; + tpSirWifiScanCmdReqParams pReqMsg = NULL; + struct net_device *dev = wdev->netdev; + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + struct nlattr *tb[PARAM_MAX + 1]; + struct hdd_ext_scan_context *context; + uint32_t request_id; eHalStatus status; + int retval; + unsigned long rc; ENTER(); - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, + if (nla_parse(tb, PARAM_MAX, data, data_len, wlan_hdd_extscan_config_policy)) { hddLog(LOGE, FL("Invalid ATTR")); return -EINVAL; @@ -3105,65 +3135,59 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, } /* Parse and fetch request Id */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) { + if (!tb[PARAM_REQUEST_ID]) { hddLog(LOGE, FL("attr request id failed")); goto fail; } - pReqMsg->requestId = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]); - hddLog(LOG1, FL("Req Id (%d)"), pReqMsg->requestId); - + pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]); pReqMsg->sessionId = pAdapter->sessionId; - hddLog(LOG1, FL("Session Id (%d)"), pReqMsg->sessionId); + hddLog(LOG1, FL("Req Id (%d) Session Id (%d)"), + pReqMsg->requestId, + pReqMsg->sessionId); /* Parse and fetch base period */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD]) { + if (!tb[PARAM_BASE_PERIOD]) { hddLog(LOGE, FL("attr base period failed")); goto fail; } - pReqMsg->basePeriod = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_BASE_PERIOD]); - hddLog(LOG1, FL("Base Period (%d)"), - pReqMsg->basePeriod); + pReqMsg->basePeriod = nla_get_u32(tb[PARAM_BASE_PERIOD]); + hddLog(LOG1, FL("Base Period (%d)"), pReqMsg->basePeriod); /* Parse and fetch max AP per scan */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN]) { + if (!tb[PARAM_MAX_AP_PER_SCAN]) { hddLog(LOGE, FL("attr max_ap_per_scan failed")); goto fail; } - pReqMsg->maxAPperScan = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_MAX_AP_PER_SCAN]); - hddLog(LOG1, FL("Max AP per Scan (%d)"), - pReqMsg->maxAPperScan); + pReqMsg->maxAPperScan = nla_get_u32(tb[PARAM_MAX_AP_PER_SCAN]); + hddLog(LOG1, FL("Max AP per Scan (%d)"), pReqMsg->maxAPperScan); /* Parse and fetch report threshold percent */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT]) { + if (!tb[PARAM_RPT_THRHLD_PERCENT]) { hddLog(LOGE, FL("attr report_threshold percent failed")); goto fail; } pReqMsg->report_threshold_percent = nla_get_u8( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_PERCENT]); + tb[PARAM_RPT_THRHLD_PERCENT]); hddLog(LOG1, FL("Report Threshold percent(%d)"), pReqMsg->report_threshold_percent); /* Parse and fetch report threshold num scans */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS]) { + if (!tb[PARAM_RPT_THRHLD_NUM_SCANS]) { hddLog(LOGE, FL("attr report_threshold num scans failed")); goto fail; } pReqMsg->report_threshold_num_scans = nla_get_u8( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_REPORT_THRESHOLD_NUM_SCANS]); + tb[PARAM_RPT_THRHLD_NUM_SCANS]); hddLog(LOG1, FL("Report Threshold num scans(%d)"), pReqMsg->report_threshold_num_scans); /* Parse and fetch number of buckets */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS]) { + if (!tb[PARAM_NUM_BUCKETS]) { hddLog(LOGE, FL("attr number of buckets failed")); goto fail; } - pReqMsg->numBuckets = nla_get_u8( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SCAN_CMD_PARAMS_NUM_BUCKETS]); + pReqMsg->numBuckets = nla_get_u8(tb[PARAM_NUM_BUCKETS]); if (pReqMsg->numBuckets > WLAN_EXTSCAN_MAX_BUCKETS) { hddLog(LOGW, FL("Exceeded MAX number of buckets " "Setting numBuckets to %u"), WLAN_EXTSCAN_MAX_BUCKETS); @@ -3179,76 +3203,156 @@ static int wlan_hdd_cfg80211_extscan_start(struct wiphy *wiphy, if (hdd_extscan_start_fill_bucket_channel_spec(pHddCtx, pReqMsg, tb)) goto fail; + context = &pHddCtx->ext_scan_context; + spin_lock(&hdd_context_lock); + INIT_COMPLETION(context->response_event); + context->request_id = request_id = pReqMsg->requestId; + spin_unlock(&hdd_context_lock); + status = sme_ExtScanStart(pHddCtx->hHal, pReqMsg); if (!HAL_STATUS_SUCCESS(status)) { hddLog(LOGE, FL("sme_ExtScanStart failed(err=%d)"), status); - vos_mem_free(pReqMsg); - return -EINVAL; + goto fail; } - return 0; + /* request was sent -- wait for the response */ + rc = wait_for_completion_timeout(&context->response_event, + msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN)); + + if (!rc) { + hddLog(LOGE, FL("sme_ExtScanStart timed out")); + retval = -ETIMEDOUT; + } else { + spin_lock(&hdd_context_lock); + if (context->request_id == request_id) + retval = context->response_status; + else + retval = -EINVAL; + spin_unlock(&hdd_context_lock); + } + + return retval; fail: vos_mem_free(pReqMsg); return -EINVAL; } +/* + * done with short names for the global vendor params + * used by wlan_hdd_cfg80211_extscan_start() + */ +#undef PARAM_MAX +#undef PARAM_REQUEST_ID +#undef PARAM_BASE_PERIOD +#undef PARAMS_MAX_AP_PER_SCAN +#undef PARAMS_RPT_THRHLD_PERCENT +#undef PARAMS_RPT_THRHLD_NUM_SCANS +#undef PARAMS_NUM_BUCKETS +/* + * define short names for the global vendor params + * used by wlan_hdd_cfg80211_extscan_stop() + */ +#define PARAM_MAX \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +#define PARAM_REQUEST_ID \ + QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID + +/** + * wlan_hdd_cfg80211_extscan_stop() - stop extscan + * @wiphy: Pointer to wireless phy. + * @wdev: Pointer to wireless device. + * @data: Pointer to input data. + * @data_len: Length of @data. + * + * Return: 0 on success, negative errno on failure + */ static int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy, - struct wireless_dev *wdev, - const void *data, - int data_len) + struct wireless_dev *wdev, + const void *data, + int data_len) { - tpSirExtScanStopReqParams pReqMsg = NULL; - struct net_device *dev = wdev->netdev; - hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); - hdd_context_t *pHddCtx = wiphy_priv(wiphy); - struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX + 1]; - eHalStatus status; + tpSirExtScanStopReqParams pReqMsg = NULL; + struct net_device *dev = wdev->netdev; + hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); + hdd_context_t *pHddCtx = wiphy_priv(wiphy); + struct hdd_ext_scan_context *context; + struct nlattr *tb[PARAM_MAX + 1]; + uint32_t request_id; + eHalStatus status; + int retval; + unsigned long rc; - ENTER(); + ENTER(); - if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX, - data, data_len, - wlan_hdd_extscan_config_policy)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("Invalid ATTR")); - return -EINVAL; - } + if (nla_parse(tb, PARAM_MAX, data, data_len, + wlan_hdd_extscan_config_policy)) { + hddLog(LOGE, FL("Invalid ATTR")); + return -EINVAL; + } - pReqMsg = vos_mem_malloc(sizeof(*pReqMsg)); - if (!pReqMsg) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("vos_mem_malloc failed")); - return -ENOMEM; - } + pReqMsg = vos_mem_malloc(sizeof(*pReqMsg)); + if (!pReqMsg) { + hddLog(LOGE, FL("vos_mem_malloc failed")); + return -ENOMEM; + } - /* Parse and fetch request Id */ - if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("attr request id failed")); - goto fail; - } + /* Parse and fetch request Id */ + if (!tb[PARAM_REQUEST_ID]) { + hddLog(LOGE, FL("attr request id failed")); + goto fail; + } - pReqMsg->requestId = nla_get_u32( - tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]); - hddLog(VOS_TRACE_LEVEL_INFO, FL("Req Id (%d)"), pReqMsg->requestId); + pReqMsg->requestId = nla_get_u32(tb[PARAM_REQUEST_ID]); + pReqMsg->sessionId = pAdapter->sessionId; + hddLog(LOG1, FL("Req Id (%d) Session Id (%d)"), + pReqMsg->requestId, + pReqMsg->sessionId); - pReqMsg->sessionId = pAdapter->sessionId; - hddLog(VOS_TRACE_LEVEL_INFO, FL("Session Id (%d)"), pReqMsg->sessionId); + context = &pHddCtx->ext_scan_context; + spin_lock(&hdd_context_lock); + INIT_COMPLETION(context->response_event); + context->request_id = request_id = pReqMsg->requestId; + spin_unlock(&hdd_context_lock); - status = sme_ExtScanStop(pHddCtx->hHal, pReqMsg); - if (!HAL_STATUS_SUCCESS(status)) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("sme_ExtScanStop failed(err=%d)"), status); - vos_mem_free(pReqMsg); - return -EINVAL; - } + status = sme_ExtScanStop(pHddCtx->hHal, pReqMsg); + if (!HAL_STATUS_SUCCESS(status)) { + hddLog(LOGE, + FL("sme_ExtScanStop failed(err=%d)"), status); + goto fail; + } - return 0; + /* request was sent -- wait for the response */ + rc = wait_for_completion_timeout(&context->response_event, + msecs_to_jiffies(WLAN_WAIT_TIME_EXTSCAN)); + + if (!rc) { + hddLog(LOGE, FL("sme_ExtScanStop timed out")); + retval = -ETIMEDOUT; + } else { + spin_lock(&hdd_context_lock); + if (context->request_id == request_id) + retval = context->response_status; + else + retval = -EINVAL; + spin_unlock(&hdd_context_lock); + } + + return retval; fail: vos_mem_free(pReqMsg); return -EINVAL; } +/* + * done with short names for the global vendor params + * used by wlan_hdd_cfg80211_extscan_stop() + */ +#undef PARAM_MAX +#undef PARAM_REQUEST_ID + static int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, @@ -17851,89 +17955,6 @@ wlan_hdd_cfg80211_extscan_get_capabilities_rsp(void *ctx, return; } -static void -wlan_hdd_cfg80211_extscan_start_rsp(void *ctx, tpSirExtScanStartRspParams pData) -{ - hdd_context_t *pHddCtx = (hdd_context_t *)ctx; - struct sk_buff *skb = NULL; - - ENTER(); - - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); - return; - } - - skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - NULL, - EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_START_INDEX, - GFP_KERNEL); - - if (!skb) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("cfg80211_vendor_event_alloc failed")); - return; - } - hddLog(VOS_TRACE_LEVEL_INFO, "Req Id (%u)", pData->requestId); - - if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, - pData->requestId) || - nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS, pData->status)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla put fail")); - goto nla_put_failure; - } - - cfg80211_vendor_event(skb, GFP_KERNEL); - return; - -nla_put_failure: - kfree_skb(skb); - return; -} - - -static void -wlan_hdd_cfg80211_extscan_stop_rsp(void *ctx, tpSirExtScanStopRspParams pData) -{ - hdd_context_t *pHddCtx = (hdd_context_t *)ctx; - struct sk_buff *skb = NULL; - - if (wlan_hdd_validate_context(pHddCtx) || !pData) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("HDD context is not valid " - "or pData(%p) is null"), pData); - return; - } - - skb = cfg80211_vendor_event_alloc(pHddCtx->wiphy, - NULL, - EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN, - QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_STOP_INDEX, - GFP_KERNEL); - - if (!skb) { - hddLog(VOS_TRACE_LEVEL_ERROR, - FL("cfg80211_vendor_event_alloc failed")); - return; - } - hddLog(LOG1, "Req Id (%u) Status (%u)", pData->requestId, pData->status); - - if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, - pData->requestId) || - nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_STATUS, pData->status)) { - hddLog(VOS_TRACE_LEVEL_ERROR, FL("nla put fail")); - goto nla_put_failure; - } - - cfg80211_vendor_event(skb, GFP_KERNEL); - return; - -nla_put_failure: - kfree_skb(skb); - return; -} - /* * define short names for the global vendor params * used by hdd_extscan_nl_fill_bss() @@ -19130,16 +19151,6 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, hddLog(VOS_TRACE_LEVEL_INFO, FL("Rcvd Event (%d)"), evType); switch (evType) { - case eSIR_EXTSCAN_START_RSP: - wlan_hdd_cfg80211_extscan_start_rsp(ctx, - (tpSirExtScanStartRspParams)pMsg); - break; - - case eSIR_EXTSCAN_STOP_RSP: - wlan_hdd_cfg80211_extscan_stop_rsp(ctx, - (tpSirExtScanStopRspParams)pMsg); - break; - case eSIR_EXTSCAN_CACHED_RESULTS_RSP: /* There is no need to send this response to upper layer Just log the message */ @@ -19191,6 +19202,8 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const tANI_U16 evType, (struct wifi_passpoint_match *) pMsg); break; + case eSIR_EXTSCAN_START_RSP: + case eSIR_EXTSCAN_STOP_RSP: case eSIR_EXTSCAN_SET_BSSID_HOTLIST_RSP: case eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP: case eSIR_EXTSCAN_SET_SIGNIFICANT_WIFI_CHANGE_RSP: diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c index 41fc8e912a41..9fa85268c024 100644 --- a/CORE/HDD/src/wlan_hdd_p2p.c +++ b/CORE/HDD/src/wlan_hdd_p2p.c @@ -2177,10 +2177,12 @@ struct net_device* __wlan_hdd_add_virtual_intf( eCSR_SCAN_ABORT_DEFAULT); hddLog(LOG1, FL("Abort Scan while adding virtual interface")); } - wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); } pAdapter = NULL; + + wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); + if (pHddCtx->cfg_ini->isP2pDeviceAddrAdministrated && ((NL80211_IFTYPE_P2P_GO == type) || (NL80211_IFTYPE_P2P_CLIENT == type))) diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index 52fa70ce5aa1..a8c2f142a5d4 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -42,9 +42,9 @@ BRIEF DESCRIPTION: #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 10 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 76 +#define QWLAN_VERSION_BUILD 77 -#define QWLAN_VERSIONSTR "4.0.10.76" +#define QWLAN_VERSIONSTR "4.0.10.77" #define AR6320_REV1_VERSION 0x5000000 diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index a9efd7650308..887f18b975a0 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -5089,21 +5089,9 @@ struct sir_extscan_generic_response { typedef struct { tANI_U32 requestId; - tANI_U32 status; -} tSirExtScanStartRspParams, *tpSirExtScanStartRspParams; - -typedef struct -{ - tANI_U32 requestId; tANI_U8 sessionId; } tSirExtScanStopReqParams, *tpSirExtScanStopReqParams; -typedef struct -{ - tANI_U32 requestId; - tANI_U32 status; -} tSirExtScanStopRspParams, *tpSirExtScanStopRspParams; - /** * struct tSirExtScanSetBssidHotListReqParams - set hotlist request * @requestId: request identifier diff --git a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c index 60d3bf4ee359..42d32555e1a3 100644 --- a/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c +++ b/CORE/MAC/src/pe/lim/limLinkMonitoringAlgo.c @@ -469,7 +469,10 @@ void limHandleHeartBeatFailure(tpAniSirGlobal pMac,tpPESession psessionEntry) if(!limIsconnectedOnDFSChannel(psessionEntry->currentOperChannel)) { /*** Detected continuous Beacon Misses ***/ - psessionEntry->LimHBFailureStatus= eANI_BOOLEAN_TRUE; + psessionEntry->LimHBFailureStatus= eANI_BOOLEAN_TRUE; + + /*Reset the HB packet count before sending probe*/ + limResetHBPktCount(psessionEntry); /** * Send Probe Request frame to AP to see if * it is still around. Wait until certain diff --git a/CORE/MAC/src/pe/lim/limUtils.c b/CORE/MAC/src/pe/lim/limUtils.c index 18dccbcc8f26..073320661700 100644 --- a/CORE/MAC/src/pe/lim/limUtils.c +++ b/CORE/MAC/src/pe/lim/limUtils.c @@ -6695,7 +6695,8 @@ void limHandleHeartBeatFailureTimeout(tpAniSirGlobal pMac) #endif if (psessionEntry->limMlmState == eLIM_MLM_LINK_ESTABLISHED_STATE) { - if ((psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && + if ((!LIM_IS_CONNECTION_ACTIVE(psessionEntry))&& + (psessionEntry->limSmeState != eLIM_SME_WT_DISASSOC_STATE) && (psessionEntry->limSmeState != eLIM_SME_WT_DEAUTH_STATE)) { limLog(pMac, LOGE, FL("Probe_hb_failure: for session:%d " ),psessionEntry->peSessionId); diff --git a/CORE/MAC/src/pe/sch/schApi.c b/CORE/MAC/src/pe/sch/schApi.c index 84a4e19c4af3..8052338b18bd 100644 --- a/CORE/MAC/src/pe/sch/schApi.c +++ b/CORE/MAC/src/pe/sch/schApi.c @@ -618,6 +618,7 @@ int schGenTimingAdvertFrame(tpAniSirGlobal mac_ctx, tSirMacAddr self_addr, *buf = vos_mem_malloc(buf_size); if (*buf == NULL) { schLog(mac_ctx, LOGE, FL("Cannot allocate memory")); + return eSIR_FAILURE; } vos_mem_zero(*buf, buf_size); diff --git a/CORE/SAP/src/sapFsm.c b/CORE/SAP/src/sapFsm.c index aedd6de42abf..e7fff13a4b85 100644 --- a/CORE/SAP/src/sapFsm.c +++ b/CORE/SAP/src/sapFsm.c @@ -66,6 +66,7 @@ #include "pmcApi.h" #include "wlan_nv.h" #include "vos_utils.h" +#include "_ieee80211_common.h" /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants @@ -1208,37 +1209,6 @@ static v_U8_t sapPopulateAvailableChannels(chan_bonding_bitmap *pBitmap, } /* - * FUNCTION sapFetchRegulatoryDomain - * - * DESCRIPTION Fetches the Regulatory domain based up on the coutry code. - * - * DEPENDENCIES PARAMETERS - * IN hHAL : HAL pointer - * - * RETURN VALUE : v_REGDOMAIN_t, returns the regulatory domain - * - * SIDE EFFECTS - */ -v_REGDOMAIN_t sapFetchRegulatoryDomain(tHalHandle hHal) -{ - tpAniSirGlobal pMac; - v_COUNTRYCODE_t country_code; - v_REGDOMAIN_t regDomain; - pMac = PMAC_STRUCT(hHal); - - /* - * Fetch the REG DOMAIN from the country code. - */ - country_code[0] = pMac->scan.countryCodeCurrent[0]; - country_code[1] = pMac->scan.countryCodeCurrent[1]; - - vos_nv_getRegDomainFromCountryCode(®Domain, - country_code, COUNTRY_QUERY); - - return regDomain; -} - -/* * FUNCTION sapDfsIsW53Invalid * * DESCRIPTION Checks if the passed channel is W53 and returns if @@ -1378,8 +1348,8 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext) tpAniSirGlobal pMac; tANI_U32 chanWidth; ePhyChanBondState cbModeCurrent; - v_REGDOMAIN_t regDomain; v_U8_t *tempChannels = NULL; + uint8_t dfs_region; if (NULL == hHal) { VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_ERROR, @@ -1433,7 +1403,7 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext) return target_channel; } - regDomain = sapFetchRegulatoryDomain(hHal); + vos_nv_get_dfs_region(&dfs_region); /* * valid_chnl_count will be used to find number of valid channels @@ -1462,7 +1432,7 @@ static v_U8_t sapRandomChannelSel(ptSapContext sapContext) * channels only based up on the SAP Channel location * indicated by "sap_operating_channel_location" param. */ - if (REGDOMAIN_JAPAN == regDomain) + if (DFS_MKK4_DOMAIN == dfs_region) { /* * Check for JAPAN W53 Channel operation capability @@ -4702,9 +4672,9 @@ int sapStartDfsCacTimer(ptSapContext sapContext) { VOS_STATUS status; v_U32_t cacTimeOut; - v_REGDOMAIN_t regDomain; tHalHandle hHal = NULL; tpAniSirGlobal pMac = NULL; + uint8_t dfs_region; if (sapContext == NULL) { @@ -4729,9 +4699,10 @@ int sapStartDfsCacTimer(ptSapContext sapContext) return 2; } cacTimeOut = DEFAULT_CAC_TIMEOUT; - vos_nv_getRegDomainFromCountryCode(®Domain, - sapContext->csrRoamProfile.countryCode, COUNTRY_QUERY); - if ((regDomain == REGDOMAIN_ETSI) && + + vos_nv_get_dfs_region(&dfs_region); + + if ((dfs_region == DFS_ETSI_DOMAIN) && ((IS_ETSI_WEATHER_CH(sapContext->channel)) || (sap_is_channel_bonding_etsi_weather_channel(sapContext)))) { diff --git a/CORE/SAP/src/sapInternal.h b/CORE/SAP/src/sapInternal.h index 2a910153050b..64878e1c3796 100644 --- a/CORE/SAP/src/sapInternal.h +++ b/CORE/SAP/src/sapInternal.h @@ -1042,19 +1042,6 @@ v_BOOL_t is_concurrent_sap_ready_for_channel_change(tHalHandle hHal, * */ v_U8_t sap_get_total_number_sap_intf(tHalHandle hHal); -/*--------------------------------------------------------------------------- -FUNCTION sapFetchRegulatoryDomain - -DESCRIPTION Fetches the Regulatory domain based up on the coutry code. - -DEPENDENCIES PARAMETERS -IN hHAL : HAL pointer - -RETURN VALUE : v_REGDOMAIN_t, returns the regulatory domain - -SIDE EFFECTS ----------------------------------------------------------------------------*/ -v_REGDOMAIN_t sapFetchRegulatoryDomain(tHalHandle hHal); /*--------------------------------------------------------------------------- FUNCTION sapDfsIsW53Invalid diff --git a/CORE/SAP/src/sapModule.c b/CORE/SAP/src/sapModule.c index aae6f10fde95..c190f30e6b38 100644 --- a/CORE/SAP/src/sapModule.c +++ b/CORE/SAP/src/sapModule.c @@ -74,6 +74,7 @@ #include "sapInternal.h" #include "smeInside.h" #include "regdomain_common.h" +#include "_ieee80211_common.h" /*---------------------------------------------------------------------------- * Preprocessor Definitions and Constants @@ -3376,8 +3377,8 @@ VOS_STATUS WLANSAP_set_Dfs_Restrict_JapanW53(tHalHandle hHal, v_U8_t disable_Dfs_W53) { tpAniSirGlobal pMac = NULL; - v_REGDOMAIN_t regDomain; VOS_STATUS status; + uint8_t dfs_region; if (NULL != hHal) { @@ -3390,13 +3391,13 @@ WLANSAP_set_Dfs_Restrict_JapanW53(tHalHandle hHal, v_U8_t disable_Dfs_W53) return VOS_STATUS_E_FAULT; } - regDomain = sapFetchRegulatoryDomain(hHal); + vos_nv_get_dfs_region(&dfs_region); /* * Set the JAPAN W53 restriction only if the current * regulatory domain is JAPAN. */ - if (REGDOMAIN_JAPAN == regDomain) + if (DFS_MKK4_DOMAIN == dfs_region) { pMac->sap.SapDfsInfo.is_dfs_w53_disabled = disable_Dfs_W53; VOS_TRACE(VOS_MODULE_ID_SAP, @@ -3448,8 +3449,9 @@ WLANSAP_set_Dfs_Preferred_Channel_location(tHalHandle hHal, v_U8_t dfs_Preferred_Channels_location) { tpAniSirGlobal pMac = NULL; - v_REGDOMAIN_t regDomain; VOS_STATUS status; + uint8_t dfs_region; + if (NULL != hHal) { pMac = PMAC_STRUCT( hHal ); @@ -3461,14 +3463,14 @@ WLANSAP_set_Dfs_Preferred_Channel_location(tHalHandle hHal, return VOS_STATUS_E_FAULT; } - regDomain = sapFetchRegulatoryDomain(hHal); + vos_nv_get_dfs_region(&dfs_region); /* * The Indoor/Outdoor only random channel selection * restriction is currently enforeced only for * JAPAN regulatory domain. */ - if (REGDOMAIN_JAPAN == regDomain) + if (DFS_MKK4_DOMAIN == dfs_region) { pMac->sap.SapDfsInfo.sap_operating_chan_preferred_location = dfs_Preferred_Channels_location; diff --git a/CORE/SERVICES/COMMON/wmi_unified_api.h b/CORE/SERVICES/COMMON/wmi_unified_api.h index 62797d90a575..7cbcf986d974 100644 --- a/CORE/SERVICES/COMMON/wmi_unified_api.h +++ b/CORE/SERVICES/COMMON/wmi_unified_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,14 +41,9 @@ typedef adf_nbuf_t wmi_buf_t; #define wmi_buf_free(_buf) adf_nbuf_free(_buf) #define wmi_buf_data(_buf) adf_nbuf_data(_buf) -/** - * attach for unified WMI - * - * @param scn_handle : handle to SCN. - * @return opaque handle. - */ void * -wmi_unified_attach(void *scn_handle, void (*func) (void*)); +wmi_unified_attach(void *scn_handle, void (*func) (void*), + adf_os_device_t osdev); /** * detach for unified WMI * diff --git a/CORE/SERVICES/HTC/htc_internal.h b/CORE/SERVICES/HTC/htc_internal.h index 4035baa619c5..ebd6cceca50c 100644 --- a/CORE/SERVICES/HTC/htc_internal.h +++ b/CORE/SERVICES/HTC/htc_internal.h @@ -104,6 +104,8 @@ extern "C" { typedef enum { HTC_REQUEST_CREDIT, HTC_PROCESS_CREDIT_REPORT, + HTC_SUSPEND_ACK, + HTC_SUSPEND_NACK, } htc_credit_exchange_type; typedef struct { @@ -266,6 +268,8 @@ void HTCProcessCreditRpt(HTC_TARGET *target, void HTCFwEventHandler(void *context, A_STATUS status); void HTCSendCompleteCheckCleanup(void *context); +void htc_credit_record(htc_credit_exchange_type type, A_UINT32 tx_credit, + A_UINT32 htc_tx_queue_depth); static inline void HTCSendCompletePollTimerStop(HTC_ENDPOINT *pEndpoint) { diff --git a/CORE/SERVICES/HTC/htc_recv.c b/CORE/SERVICES/HTC/htc_recv.c index 5387c89f74e3..8e346c474b60 100644 --- a/CORE/SERVICES/HTC/htc_recv.c +++ b/CORE/SERVICES/HTC/htc_recv.c @@ -411,11 +411,19 @@ A_STATUS HTCRxCompletionHandler( break; case HTC_MSG_SEND_SUSPEND_COMPLETE: wow_nack = 0; + LOCK_HTC_CREDIT(target); + htc_credit_record(HTC_SUSPEND_ACK, pEndpoint->TxCredits, + HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue)); + UNLOCK_HTC_CREDIT(target); target->HTCInitInfo.TargetSendSuspendComplete((void *)&wow_nack); HTCsuspendwow(target); break; case HTC_MSG_NACK_SUSPEND: wow_nack = 1; + LOCK_HTC_CREDIT(target); + htc_credit_record(HTC_SUSPEND_NACK, pEndpoint->TxCredits, + HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue)); + UNLOCK_HTC_CREDIT(target); target->HTCInitInfo.TargetSendSuspendComplete((void *)&wow_nack); break; } diff --git a/CORE/SERVICES/HTC/htc_send.c b/CORE/SERVICES/HTC/htc_send.c index 3402a815392b..610e9b8b89a2 100644 --- a/CORE/SERVICES/HTC/htc_send.c +++ b/CORE/SERVICES/HTC/htc_send.c @@ -55,16 +55,20 @@ static unsigned ep_debug_mask = (1 << ENDPOINT_0) | (1 << ENDPOINT_1) | (1 << EN A_UINT32 g_htc_credit_history_idx = 0; HTC_CREDIT_HISTORY htc_credit_history_buffer[HTC_CREDIT_HISTORY_MAX]; -#define HTC_CREDIT_RECORD(a, b, c) { \ - if (HTC_CREDIT_HISTORY_MAX <= g_htc_credit_history_idx) \ - g_htc_credit_history_idx = 0; \ - htc_credit_history_buffer[g_htc_credit_history_idx].type = a; \ - htc_credit_history_buffer[g_htc_credit_history_idx].time = \ - adf_get_boottime(); \ - htc_credit_history_buffer[g_htc_credit_history_idx].tx_credit = b; \ - htc_credit_history_buffer[g_htc_credit_history_idx].htc_tx_queue_depth = c; \ - g_htc_credit_history_idx++; \ -} \ +void htc_credit_record(htc_credit_exchange_type type, A_UINT32 tx_credit, + A_UINT32 htc_tx_queue_depth) +{ + if (HTC_CREDIT_HISTORY_MAX <= g_htc_credit_history_idx) + g_htc_credit_history_idx = 0; + + htc_credit_history_buffer[g_htc_credit_history_idx].type = type; + htc_credit_history_buffer[g_htc_credit_history_idx].time = + adf_get_boottime(); + htc_credit_history_buffer[g_htc_credit_history_idx].tx_credit = tx_credit; + htc_credit_history_buffer[g_htc_credit_history_idx].htc_tx_queue_depth = + htc_tx_queue_depth; + g_htc_credit_history_idx++; +} void HTC_dump_counter_info(HTC_HANDLE HTCHandle) { @@ -728,7 +732,7 @@ void GetHTCSendPacketsCreditBased(HTC_TARGET *target, if (pEndpoint->ServiceID == WMI_CONTROL_SVC) { LOCK_HTC_CREDIT(target); - HTC_CREDIT_RECORD(HTC_REQUEST_CREDIT, pEndpoint->TxCredits, + htc_credit_record(HTC_REQUEST_CREDIT, pEndpoint->TxCredits, HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue)); UNLOCK_HTC_CREDIT(target); } @@ -1634,7 +1638,7 @@ void HTCProcessCreditRpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt, int NumEnt if (pEndpoint->ServiceID == WMI_CONTROL_SVC) { LOCK_HTC_CREDIT(target); - HTC_CREDIT_RECORD(HTC_PROCESS_CREDIT_REPORT, pEndpoint->TxCredits, + htc_credit_record(HTC_PROCESS_CREDIT_REPORT, pEndpoint->TxCredits, HTC_PACKET_QUEUE_DEPTH(&pEndpoint->TxQueue)); UNLOCK_HTC_CREDIT(target); } diff --git a/CORE/SERVICES/WMA/regdomain.c b/CORE/SERVICES/WMA/regdomain.c index 5385bf6ec48c..0e2318860a71 100644 --- a/CORE/SERVICES/WMA/regdomain.c +++ b/CORE/SERVICES/WMA/regdomain.c @@ -552,10 +552,35 @@ void regdmn_get_ctl_info(struct regulatory *reg, u_int32_t modesAvail, if (rd == regdomain5G) ctl_5g = ctl; } + + /* save the ctl information for future reference */ + reg->ctl_5g = ctl_5g; + reg->ctl_2g = ctl_2g; + wma_send_regdomain_info(reg->reg_domain, regpair->regDmn2GHz, regpair->regDmn5GHz, ctl_2g, ctl_5g); } +/* regdmn_set_dfs_region() - to set the dfs region to wma + * + * @reg: the regulatory handle + * + * Return: none + */ +void regdmn_set_dfs_region(struct regulatory *reg) +{ + void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); + tp_wma_handle wma = vos_get_context(VOS_MODULE_ID_WDA, vos_context); + + if (!wma) { + WMA_LOGE("%s: Unable to get WMA handle", __func__); + return; + } + + WMA_LOGE("%s: dfs_region: %d", __func__, reg->dfs_region); + wma_set_dfs_regdomain(wma, reg->dfs_region); +} + void regdmn_set_regval(struct regulatory *reg) { void *vos_context = vos_get_global_context(VOS_MODULE_ID_WDA, NULL); diff --git a/CORE/SERVICES/WMA/regdomain.h b/CORE/SERVICES/WMA/regdomain.h index d9f671d21c02..de71a92b1531 100644 --- a/CORE/SERVICES/WMA/regdomain.h +++ b/CORE/SERVICES/WMA/regdomain.h @@ -314,10 +314,13 @@ typedef enum } COUNTRY_CODE_SOURCE; struct regulatory { - u_int32_t reg_domain; - u_int32_t eeprom_rd_ext; - u_int16_t country_code; - u_int8_t alpha2[3]; + uint32_t reg_domain; + uint32_t eeprom_rd_ext; + uint16_t country_code; + uint8_t alpha2[3]; + uint8_t dfs_region; + uint8_t ctl_2g; + uint8_t ctl_5g; const void *regpair; COUNTRY_CODE_SOURCE cc_src; }; @@ -1092,4 +1095,6 @@ enum CountryCode { int32_t regdmn_get_country_alpha2(struct regulatory *reg); void regdmn_set_regval(struct regulatory *reg); int32_t regdmn_find_ctry_by_name(u_int8_t *alpha2); +void regdmn_set_dfs_region(struct regulatory *reg); + #endif /* REGULATORY_H */ diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index 0311cdea4973..f85ee10a0961 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -341,8 +341,6 @@ void wma_process_roam_synch_complete(WMA_HANDLE handle, void wma_process_roam_synch_fail(WMA_HANDLE handle, tSirRoamOffloadSynchFail *synchfail); #endif -/* Configure the regulatory domain for DFS radar filter initialization*/ -void wma_set_dfs_regdomain(tp_wma_handle wma); static VOS_STATUS wma_set_thermal_mgmt(tp_wma_handle wma_handle, t_thermal_cmd_params thermal_info); @@ -2589,7 +2587,7 @@ static int wma_extscan_start_stop_event_handler(void *handle, tp_wma_handle wma = (tp_wma_handle)handle; WMI_EXTSCAN_START_STOP_EVENTID_param_tlvs *param_buf; wmi_extscan_start_stop_event_fixed_param *event; - tSirExtScanStartRspParams *extscan_ind; + struct sir_extscan_generic_response *extscan_ind; u_int16_t event_type; tpAniSirGlobal pMac = (tpAniSirGlobal)vos_get_context( VOS_MODULE_ID_PE, wma->vos_context); @@ -2617,16 +2615,16 @@ static int wma_extscan_start_stop_event_handler(void *handle, case WMI_EXTSCAN_START_CMDID: event_type = eSIR_EXTSCAN_START_RSP; extscan_ind->status = event->status; - extscan_ind->requestId = event->request_id; + extscan_ind->request_id = event->request_id; break; case WMI_EXTSCAN_STOP_CMDID: event_type = eSIR_EXTSCAN_STOP_RSP; extscan_ind->status = event->status; - extscan_ind->requestId = event->request_id; + extscan_ind->request_id = event->request_id; break; case WMI_EXTSCAN_CONFIGURE_WLAN_CHANGE_MONITOR_CMDID: extscan_ind->status = event->status; - extscan_ind->requestId = event->request_id; + extscan_ind->request_id = event->request_id; if (event->mode == WMI_EXTSCAN_MODE_STOP) { event_type = eSIR_EXTSCAN_RESET_SIGNIFICANT_WIFI_CHANGE_RSP; @@ -2637,7 +2635,7 @@ static int wma_extscan_start_stop_event_handler(void *handle, break; case WMI_EXTSCAN_CONFIGURE_HOTLIST_MONITOR_CMDID: extscan_ind->status = event->status; - extscan_ind->requestId = event->request_id; + extscan_ind->request_id = event->request_id; if (event->mode == WMI_EXTSCAN_MODE_STOP) { event_type = eSIR_EXTSCAN_RESET_BSSID_HOTLIST_RSP; @@ -2648,12 +2646,12 @@ static int wma_extscan_start_stop_event_handler(void *handle, break; case WMI_EXTSCAN_GET_CACHED_RESULTS_CMDID: extscan_ind->status = event->status; - extscan_ind->requestId = event->request_id; + extscan_ind->request_id = event->request_id; event_type = eSIR_EXTSCAN_CACHED_RESULTS_RSP; break; case WMI_EXTSCAN_CONFIGURE_HOTLIST_SSID_MONITOR_CMDID: extscan_ind->status = event->status; - extscan_ind->requestId = event->request_id; + extscan_ind->request_id = event->request_id; if (event->mode == WMI_EXTSCAN_MODE_STOP) { event_type = eSIR_EXTSCAN_RESET_SSID_HOTLIST_RSP; @@ -2672,7 +2670,7 @@ static int wma_extscan_start_stop_event_handler(void *handle, event_type, extscan_ind); WMA_LOGD("%s: sending event to umac for requestid %x" "with status %d", __func__, - extscan_ind->requestId, extscan_ind->status); + extscan_ind->request_id, extscan_ind->status); vos_mem_free(extscan_ind); return 0; } @@ -5773,7 +5771,8 @@ VOS_STATUS WDA_open(v_VOID_t *vos_context, v_VOID_t *os_ctx, } /* attach the wmi */ - wmi_handle = wmi_unified_attach(wma_handle, wma_wow_tx_complete); + wmi_handle = wmi_unified_attach(wma_handle, wma_wow_tx_complete, + adf_dev); if (!wmi_handle) { WMA_LOGP("%s: failed to attach WMI", __func__); vos_status = VOS_STATUS_E_NOMEM; @@ -18335,6 +18334,7 @@ VOS_STATUS wma_enable_d0wow_in_fw(tp_wma_handle wma) cmd->enable = 1; vos_event_reset(&wma->target_suspend); + wma->wow_nack = 0; host_credits = wmi_get_host_credits(wma->wmi_handle); wmi_pending_cmds = wmi_get_pending_cmds(wma->wmi_handle); @@ -18364,6 +18364,11 @@ VOS_STATUS wma_enable_d0wow_in_fw(tp_wma_handle wma) return VOS_STATUS_E_FAILURE; } + if (wma->wow_nack) { + WMA_LOGE("FW not ready for D0WOW."); + return VOS_STATUS_E_AGAIN; + } + host_credits = wmi_get_host_credits(wma->wmi_handle); wmi_pending_cmds = wmi_get_pending_cmds(wma->wmi_handle); if (host_credits < WMI_WOW_REQUIRED_CREDITS) { @@ -27280,8 +27285,6 @@ v_VOID_t wma_rx_ready_event(WMA_HANDLE handle, void *cmd_param_info) vos_event_set(&wma_handle->wma_ready_event); - wma_set_dfs_regdomain(wma_handle); - WMA_LOGD("Exit"); } @@ -29260,53 +29263,17 @@ wma_dfs_configure_channel(struct ieee80211com *dfs_ic, /* * Configure the regulatory domain for DFS radar filter initialization */ -void wma_set_dfs_regdomain(tp_wma_handle wma) +void wma_set_dfs_regdomain(tp_wma_handle wma, uint8_t dfs_region) { - u_int8_t ctl; - u_int32_t regdmn = wma->reg_cap.eeprom_rd; - u_int32_t regdmn5G; - - if (regdmn < 0) - { - WMA_LOGE("%s:DFS-Invalid regdomain",__func__); - /* - * Set the DFS reg domain to unintlialized domain - * to indicate dfs regdomain configuration failure - */ - wma->dfs_ic->current_dfs_regdomain = DFS_UNINIT_DOMAIN; - return; - } - - regdmn5G = get_regdmn_5g(regdmn); - ctl = regdmn_get_ctl_for_regdmn(regdmn5G); - - if (!ctl) - { - WMA_LOGI("%s:DFS-Invalid CTL",__func__); - /* - * Set the DFS reg domain to unintlialized domain - * to indicate dfs regdomain configuration failure - */ - wma->dfs_ic->current_dfs_regdomain = DFS_UNINIT_DOMAIN; - return; - } - if (ctl == FCC) - { - WMA_LOGI("%s:DFS- CTL = FCC",__func__); + /* dfs information is passed */ + if (dfs_region > DFS_MKK4_DOMAIN || dfs_region == DFS_UNINIT_DOMAIN) + /* assign DFS_FCC_DOMAIN as default domain*/ wma->dfs_ic->current_dfs_regdomain = DFS_FCC_DOMAIN; - } - else if (ctl == ETSI) - { - WMA_LOGI("%s:DFS- CTL = ETSI",__func__); - wma->dfs_ic->current_dfs_regdomain = DFS_ETSI_DOMAIN; - } - else if (ctl == MKK) - { - WMA_LOGI("%s:DFS- CTL = MKK",__func__); - wma->dfs_ic->current_dfs_regdomain = DFS_MKK4_DOMAIN; - } - WMA_LOGI("%s: ****** Current Reg Domain: %d *******", __func__, - wma->dfs_ic->current_dfs_regdomain); + else + wma->dfs_ic->current_dfs_regdomain = dfs_region; + + WMA_LOGI("%s: DFS Region Domain: %d", __func__, + wma->dfs_ic->current_dfs_regdomain); } int wma_get_channels(struct ieee80211_channel *ichan, diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 231f7ec1109a..1ec3d402d5ec 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -1119,6 +1119,7 @@ extern void wma_send_regdomain_info(u_int32_t reg_dmn, u_int16_t regdmn2G, u_int16_t regdmn5G, int8_t ctl2G, int8_t ctl5G); void wma_get_modeselect(tp_wma_handle wma, u_int32_t *modeSelect); +void wma_set_dfs_regdomain(tp_wma_handle wma, uint8_t dfs_region); /** * Frame index diff --git a/CORE/SERVICES/WMI/wmi_unified.c b/CORE/SERVICES/WMI/wmi_unified.c index a7fb4f692d90..9b033d37f9e3 100644 --- a/CORE/SERVICES/WMI/wmi_unified.c +++ b/CORE/SERVICES/WMI/wmi_unified.c @@ -857,12 +857,26 @@ void wmi_control_rx(void *ctx, HTC_PACKET *htc_packet) if (idx == -1) { wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr); +#ifdef HTC_CRP_DEBUG + adf_nbuf_unmap_single(wmi_handle->osdev, evt_buf, + ADF_OS_DMA_BIDIRECTIONAL); +#else + adf_nbuf_unmap_single(wmi_handle->osdev, evt_buf, + ADF_OS_DMA_FROM_DEVICE); +#endif adf_nbuf_free(evt_buf); return; } wmi_handle->event_handler[idx](wmi_handle->scn_handle, wmi_cmd_struct_ptr, len); wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr); +#ifdef HTC_CRP_DEBUG + adf_nbuf_unmap_single(wmi_handle->osdev, evt_buf, + ADF_OS_DMA_BIDIRECTIONAL); +#else + adf_nbuf_unmap_single(wmi_handle->osdev, evt_buf, + ADF_OS_DMA_FROM_DEVICE); +#endif adf_nbuf_free(evt_buf); return; } @@ -952,6 +966,13 @@ void __wmi_control_rx(struct wmi_unified *wmi_handle, wmi_buf_t evt_buf) } end: wmitlv_free_allocated_event_tlvs(id, &wmi_cmd_struct_ptr); +#ifdef HTC_CRP_DEBUG + adf_nbuf_unmap_single(wmi_handle->osdev, evt_buf, + ADF_OS_DMA_BIDIRECTIONAL); +#else + adf_nbuf_unmap_single(wmi_handle->osdev, evt_buf, + ADF_OS_DMA_FROM_DEVICE); +#endif adf_nbuf_free(evt_buf); } @@ -972,10 +993,18 @@ void wmi_rx_event_work(struct work_struct *work) } } -/* WMI Initialization functions */ +/** + * wmi_unified_attach() - wmi initialization function + * @scn_handle: Scn handle + * @func: Tx complete callback + * @osdev: Pointer to adf context + * + * Return: none + */ void * -wmi_unified_attach(ol_scn_t scn_handle, wma_wow_tx_complete_cbk func) +wmi_unified_attach(ol_scn_t scn_handle, wma_wow_tx_complete_cbk func, + adf_os_device_t osdev) { struct wmi_unified *wmi_handle; wmi_handle = (struct wmi_unified *)OS_MALLOC(NULL, sizeof(struct wmi_unified), GFP_ATOMIC); @@ -998,6 +1027,7 @@ wmi_unified_attach(ol_scn_t scn_handle, wma_wow_tx_complete_cbk func) adf_os_spinlock_init(&wmi_handle->wmi_record_lock); #endif wmi_handle->wma_wow_tx_complete_cbk = func; + wmi_handle->osdev = osdev; return wmi_handle; } @@ -1010,6 +1040,13 @@ wmi_unified_detach(struct wmi_unified* wmi_handle) adf_os_spin_lock_bh(&wmi_handle->eventq_lock); buf = adf_nbuf_queue_remove(&wmi_handle->event_queue); while (buf) { +#ifdef HTC_CRP_DEBUG + adf_nbuf_unmap_single(wmi_handle->osdev, buf, + ADF_OS_DMA_BIDIRECTIONAL); +#else + adf_nbuf_unmap_single(wmi_handle->osdev, buf, + ADF_OS_DMA_FROM_DEVICE); +#endif adf_nbuf_free(buf); buf = adf_nbuf_queue_remove(&wmi_handle->event_queue); } @@ -1039,6 +1076,8 @@ void wmi_htc_tx_complete(void *ctx, HTC_PACKET *htc_pkt) ((u_int32_t *)adf_nbuf_data(wmi_cmd_buf) + 2)); adf_os_spin_unlock_bh(&wmi_handle->wmi_record_lock); #endif + adf_nbuf_unmap(wmi_handle->osdev, wmi_cmd_buf, + ADF_OS_DMA_FROM_DEVICE); adf_nbuf_free(wmi_cmd_buf); adf_os_mem_free(htc_pkt); adf_os_atomic_dec(&wmi_handle->pending_cmds); diff --git a/CORE/SERVICES/WMI/wmi_unified_priv.h b/CORE/SERVICES/WMI/wmi_unified_priv.h index 83a37d6b0fe4..160e0eb42c3a 100644 --- a/CORE/SERVICES/WMI/wmi_unified_priv.h +++ b/CORE/SERVICES/WMI/wmi_unified_priv.h @@ -94,5 +94,6 @@ struct wmi_unified { #ifdef FEATURE_WLAN_D0WOW A_BOOL in_d0wow; #endif + adf_os_device_t osdev; }; #endif diff --git a/CORE/VOSS/inc/vos_nvitem.h b/CORE/VOSS/inc/vos_nvitem.h index 9b33deb52799..319c960a9432 100644 --- a/CORE/VOSS/inc/vos_nvitem.h +++ b/CORE/VOSS/inc/vos_nvitem.h @@ -244,6 +244,9 @@ VOS_STATUS vos_nv_setRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, -------------------------------------------------------------------------*/ eNVChannelEnabledType vos_nv_getChannelEnabledState(v_U32_t rfChannel); +VOS_STATUS vos_nv_get_dfs_region(uint8_t *dfs_region); +VOS_STATUS vos_nv_set_dfs_region(uint8_t dfs_region); + #define VOS_IS_DFS_CH(channel) (vos_nv_getChannelEnabledState((channel)) == \ NV_CHANNEL_DFS) diff --git a/CORE/VOSS/src/vos_nvitem.c b/CORE/VOSS/src/vos_nvitem.c index bd2410b06698..aa3179ecfe7f 100644 --- a/CORE/VOSS/src/vos_nvitem.c +++ b/CORE/VOSS/src/vos_nvitem.c @@ -1101,6 +1101,75 @@ VOS_STATUS vos_nv_setRegDomain(void * clientCtxt, v_REGDOMAIN_t regId, return VOS_STATUS_SUCCESS; } +/* vos_nv_set_dfs_region() - set the dfs_region + * + * @dfs_region: the dfs_region to set + * + * Return: VOS_STATUS_SUCCESS if dfs_region set correctly + * VOS_STATUS_E_EXISTS if vos_context not found + */ +VOS_STATUS vos_nv_set_dfs_region(uint8_t dfs_region) +{ + v_CONTEXT_t vos_ctx_ptr = NULL; + hdd_context_t *hdd_ctx_ptr= NULL; + + vos_ctx_ptr = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + if (NULL != vos_ctx_ptr) + hdd_ctx_ptr = vos_get_context(VOS_MODULE_ID_HDD, vos_ctx_ptr); + else + return VOS_STATUS_E_EXISTS; + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + + hdd_ctx_ptr->reg.dfs_region = dfs_region; + +#else + + /* remap the ctl code to dfs region code */ + switch(hdd_ctx_ptr->reg.ctl_5g) { + case REGDOMAIN_FCC: + hdd_ctx_ptr->reg.dfs_region = DFS_FCC_DOMAIN; + break; + case REGDOMAIN_ETSI: + hdd_ctx_ptr->reg.dfs_region = DFS_ETSI_DOMAIN; + break; + case REGDOMAIN_JAPAN: + hdd_ctx_ptr->reg.dfs_region = DFS_MKK4_DOMAIN; + break; + default: + /* set default dfs_region to FCC */ + hdd_ctx_ptr->reg.dfs_region = DFS_FCC_DOMAIN; + break; + } +#endif + return VOS_STATUS_SUCCESS; +} + +/* vos_nv_get_dfs_region() - get the dfs_region + * + * @dfs_region: the dfs_region to return + * + * Return: VOS_STATUS_SUCCESS if dfs_region set correctly + * VOS_STATUS_E_EXISTS if vos_context not found + */ +VOS_STATUS vos_nv_get_dfs_region(uint8_t *dfs_region) +{ + v_CONTEXT_t vos_ctx_ptr = NULL; + hdd_context_t *hdd_ctx_ptr = NULL; + + vos_ctx_ptr = vos_get_global_context(VOS_MODULE_ID_SYS, NULL); + + if (NULL != vos_ctx_ptr) + hdd_ctx_ptr = vos_get_context(VOS_MODULE_ID_HDD, vos_ctx_ptr); + else + return VOS_STATUS_E_EXISTS; + + *dfs_region = hdd_ctx_ptr->reg.dfs_region; + + return VOS_STATUS_SUCCESS; +} + /**------------------------------------------------------------------------ \brief vos_nv_getRegDomainFromCountryCode() - get the regulatory domain of a country given its country code @@ -1610,7 +1679,11 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, v_BOOL_t isVHT80Allowed; VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_INFO, - "cfg80211 reg notifier callback for country for initiator %d", request->initiator); + FL("country: %c%c, initiator %d, dfs_region: %d"), + request->alpha2[0], + request->alpha2[1], + request->initiator, + request->dfs_region); if (TRUE == isWDresetInProgress()) { @@ -1747,6 +1820,12 @@ int wlan_hdd_linux_reg_notifier(struct wiphy *wiphy, /* send CTL info to firmware */ regdmn_set_regval(&pHddCtx->reg); + + /* set dfs_region info */ + vos_nv_set_dfs_region(request->dfs_region); + + regdmn_set_dfs_region(&pHddCtx->reg); + default: break; } diff --git a/firmware_bin/WCNSS_qcom_cfg.ini b/firmware_bin/WCNSS_qcom_cfg.ini index 163130ae28d3..91a8534cab90 100755 --- a/firmware_bin/WCNSS_qcom_cfg.ini +++ b/firmware_bin/WCNSS_qcom_cfg.ini @@ -642,10 +642,6 @@ gEnableMacAddrSpoof=0 # 1 - enable gEnableBusAutoSuspend=0 -# Enable HI_RSSI feature using delta value. A value of Zero will disable -# the feature. -gRoamScanHiRssiDelta=10 - END # Note: Configuration parser would not read anything past the END marker |
