diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2014-11-25 10:22:30 -0800 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-25 10:22:30 -0800 |
| commit | be07ffc6af562ae7b666618e599f8b3f90ff1fc6 (patch) | |
| tree | 4278d70e329573c20280ce0abd0fd2208772c0b9 | |
| parent | 4ec3d636a1217347cbb8b66eb63a04ff53204693 (diff) | |
| parent | 6f9ba5cfab5fc2a5ae4b654293c356e3cf3eb24d (diff) | |
Merge "Release 1.0.0.243 QCACLD WLAN Driver"
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_cfg80211.h | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 43 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 18 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tx_rx.c | 4 | ||||
| -rw-r--r-- | CORE/MAC/inc/qwlan_version.h | 4 | ||||
| -rw-r--r-- | CORE/MAC/src/include/sirParams.h | 4 | ||||
| -rw-r--r-- | CORE/SERVICES/COMMON/wlan_tgt_def_config_hl.h | 4 | ||||
| -rw-r--r-- | CORE/SERVICES/HIF/USB/if_usb.c | 2 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 113 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 11 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 49 | ||||
| -rw-r--r-- | CORE/SYS/legacy/src/system/src/macInitApi.c | 9 | ||||
| -rw-r--r-- | CORE/SYS/legacy/src/utils/src/macTrace.c | 3 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_api.c | 11 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_sched.c | 112 | ||||
| -rw-r--r-- | CORE/VOSS/src/vos_sched.h | 1 | ||||
| -rw-r--r-- | CORE/WDA/inc/legacy/halMsgApi.h | 8 | ||||
| -rw-r--r-- | CORE/WDA/inc/wlan_qct_wda.h | 4 | ||||
| -rw-r--r-- | Kbuild | 1 |
20 files changed, 384 insertions, 20 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_cfg80211.h b/CORE/HDD/inc/wlan_hdd_cfg80211.h index 49aaeb0018b8..633f30d8fa8d 100644 --- a/CORE/HDD/inc/wlan_hdd_cfg80211.h +++ b/CORE/HDD/inc/wlan_hdd_cfg80211.h @@ -174,6 +174,7 @@ enum qca_nl80211_vendor_subcmds { /* Get Concurrency Matrix */ QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX = 42, + QCA_NL80211_VENDOR_SUBCMD_APFIND = 52, }; enum qca_nl80211_vendor_subcmds_index { diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 5d5c909e2c2d..92820ad89044 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -989,6 +989,39 @@ void wlan_hdd_cfg80211_nan_init(hdd_context_t *pHddCtx) #endif +#ifdef WLAN_FEATURE_APFIND +/** + * wlan_hdd_cfg80211_apfind_cmd() - set configuration to firmware + * @wiphy: pointer to wireless wiphy structure. + * @wdev: pointer to wireless_dev structure. + * @data: pointer to apfind configuration data. + * @data_len: the length in byte of apfind data. + * + * This is called when wlan driver needs to send APFIND configuations to + * firmware. + * + * Return: An error code or 0 on success. + */ +static int wlan_hdd_cfg80211_apfind_cmd(struct wiphy *wiphy, + struct wireless_dev *wdev, + void *data, int data_len) +{ + struct sme_ap_find_request_req apfind_req; + VOS_STATUS status; + int ret_val = -EIO; + + apfind_req.request_data_len = data_len; + apfind_req.request_data = data; + + status = sme_apfind_set_cmd(&apfind_req); + if (VOS_STATUS_SUCCESS == status) { + ret_val = 0; + } + return ret_val; +} +#endif /* WLAN_FEATURE_APFIND */ + + /* vendor specific events */ static const struct nl80211_vendor_cmd_info wlan_hdd_cfg80211_vendor_events[] = { @@ -4386,6 +4419,16 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = WIPHY_VENDOR_CMD_NEED_NETDEV, .doit = wlan_hdd_cfg80211_get_concurrency_matrix }, +#ifdef WLAN_FEATURE_APFIND + { + .info.vendor_id = QCA_NL80211_VENDOR_ID, + .info.subcmd = QCA_NL80211_VENDOR_SUBCMD_APFIND, + .flags = WIPHY_VENDOR_CMD_NEED_WDEV | + WIPHY_VENDOR_CMD_NEED_NETDEV, + .doit = wlan_hdd_cfg80211_apfind_cmd + }, +#endif /* WLAN_FEATURE_APFIND */ + }; diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 5405e66f3793..4f4371ee2f4e 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -1003,6 +1003,13 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa || pHddCtx->dev_dfs_cac_status == DFS_CAC_ALREADY_DONE) { pHddApCtx->dfs_cac_block_tx = VOS_FALSE; + } else { + /* + * DFS requirement: Do not transmit during CAC. + * This flag will be reset when BSS starts + * (if not in a DFS channel) or CAC ends. + */ + pHddApCtx->dfs_cac_block_tx = VOS_TRUE; } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_MED, @@ -1073,9 +1080,12 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa } } #endif - /* reset the dfs_cac status only when the last BSS is stopped */ + /* reset the dfs_cac_status and dfs_cac_block_tx flag only when + * the last BSS is stopped + */ con_sap_adapter = hdd_get_con_sap_adapter(pHostapdAdapter); if (!con_sap_adapter) { + pHddApCtx->dfs_cac_block_tx = TRUE; pHddCtx->dev_dfs_cac_status = DFS_CAC_NEVER_DONE; } goto stopbss; @@ -5036,12 +5046,6 @@ VOS_STATUS hdd_init_ap_mode( hdd_adapter_t *pAdapter ) pAdapter->sessionCtx.ap.sapContext = sapContext; - /* - * DFS requirement: Do not transmit during CAC. This flag will be reset - * when BSS starts(if not in a DFS channel) or CAC ends. - */ - pAdapter->sessionCtx.ap.dfs_cac_block_tx = VOS_TRUE; - status = WLANSAP_Start(sapContext); if ( ! VOS_IS_STATUS_SUCCESS( status ) ) { diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 8a1b4a93c673..b3523716baf5 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -12643,6 +12643,8 @@ static int hdd_driver_init( void) #ifdef HDD_TRACE_RECORD MTRACE(hddTraceInit()); #endif + vos_ssr_protect_init(); + pr_info("%s: loading driver v%s\n", WLAN_MODULE_NAME, QWLAN_VERSIONSTR TIMER_MANAGER_STR MEMORY_DEBUG_STR); diff --git a/CORE/HDD/src/wlan_hdd_tx_rx.c b/CORE/HDD/src/wlan_hdd_tx_rx.c index 4e028b5d364e..6c6891fa203e 100644 --- a/CORE/HDD/src/wlan_hdd_tx_rx.c +++ b/CORE/HDD/src/wlan_hdd_tx_rx.c @@ -1665,7 +1665,11 @@ bool drop_ip6_mcast(struct sk_buff *skb) eth = eth_hdr(skb); if (unlikely(skb->pkt_type == PACKET_MULTICAST)) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)) if (unlikely(ether_addr_equal(eth->h_source, skb->dev->dev_addr))) +#else + if (unlikely(!compare_ether_addr(eth->h_source, skb->dev->dev_addr))) +#endif return true; } return false; diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index b4c36c50427a..b939356df0b6 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 0 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 242 +#define QWLAN_VERSION_BUILD 243 -#define QWLAN_VERSIONSTR "1.0.0.242" +#define QWLAN_VERSIONSTR "1.0.0.243" #define AR6320_REV1_VERSION 0x5000000 diff --git a/CORE/MAC/src/include/sirParams.h b/CORE/MAC/src/include/sirParams.h index 3a9f2e6da09f..2985779e5544 100644 --- a/CORE/MAC/src/include/sirParams.h +++ b/CORE/MAC/src/include/sirParams.h @@ -688,6 +688,10 @@ typedef struct sSirMbMsgP2p #define SIR_HAL_SAP_OFL_DEL_STA (SIR_HAL_ITC_MSG_TYPES_BEGIN + 305) #endif +#ifdef WLAN_FEATURE_APFIND +#define SIR_HAL_APFIND_SET_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 306) +#endif /* WLAN_FEATURE_APFIND */ + #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) // CFG message types diff --git a/CORE/SERVICES/COMMON/wlan_tgt_def_config_hl.h b/CORE/SERVICES/COMMON/wlan_tgt_def_config_hl.h index f0c558ccc314..45426855e3dc 100644 --- a/CORE/SERVICES/COMMON/wlan_tgt_def_config_hl.h +++ b/CORE/SERVICES/COMMON/wlan_tgt_def_config_hl.h @@ -240,7 +240,11 @@ /* * Maximum number of VDEV that beacon tx offload will support */ +#ifdef HIF_SDIO #define CFG_TGT_DEFAULT_BEACON_TX_OFFLOAD_MAX_VDEV 2 +#else +#define CFG_TGT_DEFAULT_BEACON_TX_OFFLOAD_MAX_VDEV 1 +#endif /* * ht enable highest MCS by default diff --git a/CORE/SERVICES/HIF/USB/if_usb.c b/CORE/SERVICES/HIF/USB/if_usb.c index 4a09589f72a3..e1bca0d0536f 100644 --- a/CORE/SERVICES/HIF/USB/if_usb.c +++ b/CORE/SERVICES/HIF/USB/if_usb.c @@ -272,6 +272,7 @@ static void hif_usb_remove(struct usb_interface *interface) __hdd_wlan_exit(); usb_sc->hdd_removed_processing = 0; } + atomic_set(&hif_usb_hdd_remove, 0); } hif_nointrs(sc); HIF_USBDeviceDetached(interface, 1); @@ -513,6 +514,7 @@ void hif_unregister_driver(void) __hdd_wlan_exit(); usb_sc->hdd_removed_processing = 0; } + atomic_set(&hif_usb_hdd_remove, 0); } } is_usb_driver_register = 0; diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index cd878e8b3d80..8964a79aa3b9 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -18466,6 +18466,69 @@ int wma_is_wow_mode_selected(WMA_HANDLE handle) return wma->wow.wow_enable; } +#ifdef WLAN_FEATURE_APFIND + +/** + * wma_apfind_set_cmd() - set APFIND configuration to firmware + * @wda_handle: pointer to wma handle. + * @apfind_req: pointer to apfind configuration request. + * + * This is called to send APFIND configuations to firmware via WMI command. + * + * Return: VOS_STATUS. + */ +static VOS_STATUS wma_apfind_set_cmd(void *wda_handle, + struct hal_apfind_request *apfind_req) +{ + int ret; + tp_wma_handle wma_handle = (tp_wma_handle)wda_handle; + wmi_apfind_cmd_param *cmd; + wmi_buf_t buf; + u_int16_t len = sizeof(*cmd); + u_int16_t apfind_data_len, apfind_data_len_aligned; + u_int8_t *buf_ptr; + + if (!apfind_req) { + WMA_LOGE("%s:apfind req is not valid", __func__); + return VOS_STATUS_E_FAILURE; + } + apfind_data_len = apfind_req->request_data_len; + apfind_data_len_aligned = roundup(apfind_req->request_data_len, + sizeof(u_int32_t)); + len += WMI_TLV_HDR_SIZE + apfind_data_len_aligned; + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s:wmi_buf_alloc failed", __func__); + return VOS_STATUS_E_NOMEM; + } + buf_ptr = (u_int8_t *) wmi_buf_data(buf); + cmd = (wmi_apfind_cmd_param *) buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_apfind_cmd_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_apfind_cmd_param)); + cmd->data_len = apfind_req->request_data_len; + WMA_LOGD("%s: The data len value is %u", + __func__, apfind_req->request_data_len); + buf_ptr += sizeof(wmi_apfind_cmd_param); + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, apfind_data_len_aligned); + buf_ptr += WMI_TLV_HDR_SIZE; + vos_mem_copy(buf_ptr, apfind_req->request_data, + cmd->data_len); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_APFIND_CMDID); + if (ret != EOK) { + WMA_LOGE("%s Failed to send set param command ret = %d", __func__, ret); + wmi_buf_free(buf); + } + return ret; +} +#endif /* WLAN_FEATURE_APFIND */ + tAniGetPEStatsRsp * wma_get_stats_rsp_buf(tAniGetPEStatsReq *get_stats_param) { tAniGetPEStatsRsp *stats_rsp_params; @@ -23160,6 +23223,13 @@ VOS_STATUS wma_mc_process_msg(v_VOID_t *vos_context, vos_msg_t *msg) vos_mem_free(msg->bodyptr); break; #endif /* SAP_AUTH_OFFLOAD */ +#ifdef WLAN_FEATURE_APFIND + case WDA_APFIND_SET_CMD: + wma_apfind_set_cmd(wma_handle, + (struct hal_apfind_request *)msg->bodyptr); + vos_mem_free(msg->bodyptr); + break; +#endif /* WLAN_FEATURE_APFIND */ default: WMA_LOGD("unknow msg type %x", msg->type); /* Do Nothing? MSG Body should be freed at here */ @@ -23698,7 +23768,37 @@ skip_pno_cmp_ind: } #endif +#ifdef WLAN_FEATURE_APFIND +/* Record APFIND event comes from FW. + */ +static int wma_apfind_evt_handler(void *handle, u_int8_t *event, + u_int32_t len) +{ + wmi_apfind_event_hdr *apfind_event_hdr; + WMI_APFIND_EVENTID_param_tlvs *param_buf = + (WMI_APFIND_EVENTID_param_tlvs *) event; + u_int8_t *buf; + u_int8_t ssid_tmp[WMI_MAX_SSID_LEN + 1]; + if (!param_buf) { + WMA_LOGE("Invalid APFIND event buffer"); + return -EINVAL; + } + + apfind_event_hdr = param_buf->hdr; + WMA_LOGD("APFIND event received, id=%d, data_length=%d", + apfind_event_hdr->event_type, apfind_event_hdr->data_len); + buf = param_buf->data; + A_MEMZERO(ssid_tmp, sizeof(ssid_tmp)); + A_MEMCPY(ssid_tmp, buf, sizeof(ssid_tmp)); + WMA_LOGD("%s, APFIND match, dump ssid=%s\n", __func__, ssid_tmp); + + buf = ¶m_buf->data[WMI_MAX_SSID_LEN]; + WMA_LOGD("%s, APFIND dump mac=0x%08X-0x%08X\n", + __func__, *(u_int32_t *)buf, *(u_int32_t *)(buf + sizeof(u_int32_t))); + return 0; +} +#endif /* WLAN_FEATURE_APFIND */ #if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL) /* Handle TX pause event from FW */ static int wma_mcc_vdev_tx_pause_evt_handler(void *handle, u_int8_t *event, @@ -24514,6 +24614,19 @@ VOS_STATUS wma_start(v_VOID_t *vos_ctx) } #endif +#ifdef WLAN_FEATURE_APFIND + WMA_LOGD("APFIND event handler register"); + status = wmi_unified_register_event_handler( + wma_handle->wmi_handle, + WMI_APFIND_EVENTID, + wma_apfind_evt_handler); + if (status) { + WMA_LOGE("Failed to register APFIND event cb"); + vos_status = VOS_STATUS_E_FAILURE; + goto end; + } +#endif /* WLAN_FEATURE_APFIND*/ + #if defined(CONFIG_HL_SUPPORT) || defined(QCA_SUPPORT_TXRX_VDEV_PAUSE_LL) WMA_LOGE("MCC TX Pause Event Handler register"); status = wmi_unified_register_event_handler( diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 33f58e6bec94..cfc06565d4f0 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -200,6 +200,13 @@ typedef struct { u_int32_t smeThrottlePeriod; } tSmeThermalParams; +#ifdef WLAN_FEATURE_APFIND +struct sme_ap_find_request_req{ + u_int16_t request_data_len; + u_int8_t* request_data; +}; +#endif /* WLAN_FEATURE_APFIND */ + /*------------------------------------------------------------------------- Function declarations and documentation ------------------------------------------------------------------------*/ @@ -4204,4 +4211,8 @@ eHalStatus sme_set_sap_auth_offload(tHalHandle hHal, struct tSirSapOffloadInfo *sap_auth_offload_info); #endif /* SAP_AUTH_OFFLOAD */ +#ifdef WLAN_FEATURE_APFIND +VOS_STATUS sme_apfind_set_cmd(struct sme_ap_find_request_req *input); +#endif /* WLAN_FEATURE_APFIND */ + #endif //#if !defined( __SME_API_H ) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 5d4fdca1b034..63771a4255fb 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -5416,9 +5416,10 @@ eHalStatus sme_getLinkStatus(tHalHandle hHal, pMac->sme.linkStatusCallback = NULL; status = eHAL_STATUS_FAILURE; } + + sme_ReleaseGlobalLock(&pMac->sme); } - sme_ReleaseGlobalLock(&pMac->sme); return (status); } @@ -14711,3 +14712,49 @@ eHalStatus sme_set_sap_auth_offload(tHalHandle hHal, } #endif /* SAP_AUTH_OFFLOAD */ +#ifdef WLAN_FEATURE_APFIND +/** + * sme_apfind_set_cmd() - set apfind configuration to firmware + * @input: pointer to apfind request data. + * + * SME API to set APFIND configuations to firmware. + * + * Return: VOS_STATUS. + */ +VOS_STATUS sme_apfind_set_cmd(struct sme_ap_find_request_req *input) +{ + vos_msg_t msg; + struct hal_apfind_request *data; + size_t data_len; + + data_len = sizeof(struct hal_apfind_request) + input->request_data_len; + data = vos_mem_malloc(data_len); + + if (data == NULL) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Memory allocation failure")); + return VOS_STATUS_E_FAULT; + } + + vos_mem_zero(data, data_len); + data->request_data_len = input->request_data_len; + if (input->request_data_len) { + vos_mem_copy(data->request_data, + input->request_data, input->request_data_len); + } + + msg.type = WDA_APFIND_SET_CMD; + msg.reserved = 0; + msg.bodyptr = data; + + if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) { + VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, + FL("Not able to post WDA_APFIND_SET_CMD message to WDA")); + vos_mem_free(data); + return VOS_STATUS_SUCCESS; + } + + return VOS_STATUS_SUCCESS; +} +#endif /* WLAN_FEATURE_APFIND */ + diff --git a/CORE/SYS/legacy/src/system/src/macInitApi.c b/CORE/SYS/legacy/src/system/src/macInitApi.c index 286ebd9d0e48..9ae0b5e877a5 100644 --- a/CORE/SYS/legacy/src/system/src/macInitApi.c +++ b/CORE/SYS/legacy/src/system/src/macInitApi.c @@ -228,11 +228,10 @@ tSirRetStatus macOpen(tHalHandle *pHalHandle, tHddHandle hHdd, tMacOpenParameter sysInitGlobals(p_mac); } - /* Set the Powersave Offload Capability */ - if (pMacOpenParms->powersaveOffloadEnabled) - p_mac->psOffloadEnabled = TRUE; - else - p_mac->psOffloadEnabled = FALSE; + /* Set the Powersave Offload Capability to TRUE irrespective of + * INI param as it should be always enabled for qca-cld driver + */ + p_mac->psOffloadEnabled = TRUE; p_mac->scan.nextScanID = 1; /* FW: 0 to 2047 and Host: 2048 to 4095 */ diff --git a/CORE/SYS/legacy/src/utils/src/macTrace.c b/CORE/SYS/legacy/src/utils/src/macTrace.c index 79ba5905d1b8..72d4aba5bf56 100644 --- a/CORE/SYS/legacy/src/utils/src/macTrace.c +++ b/CORE/SYS/legacy/src/utils/src/macTrace.c @@ -831,6 +831,9 @@ tANI_U8* macTraceGetWdaMsgString( tANI_U16 wdaMsg ) CASE_RETURN_STRING(WDA_SET_MDNS_RESPONSE_CMD); CASE_RETURN_STRING(WDA_GET_MDNS_STATUS_CMD); #endif +#ifdef WLAN_FEATURE_APFIND + CASE_RETURN_STRING(WDA_APFIND_SET_CMD); +#endif /*WLAN_FEATURE_APFIND*/ default: return((tANI_U8*) "UNKNOWN" ); break; diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c index 03a80faec410..bb539886f0ca 100644 --- a/CORE/VOSS/src/vos_api.c +++ b/CORE/VOSS/src/vos_api.c @@ -100,7 +100,7 @@ #define VOS_WDA_RESP_TIMEOUT WDA_STOP_TIMEOUT /* Maximum number of vos message queue get wrapper failures to cause panic */ -#define VOS_WRAPPER_MAX_FAIL_COUNT (1000) +#define VOS_WRAPPER_MAX_FAIL_COUNT (2000) /*--------------------------------------------------------------------------- * Data definitions @@ -108,6 +108,9 @@ static VosContextType gVosContext; static pVosContextType gpVosContext; +/* Debug variable to detect MC thread stuck */ +static atomic_t vos_wrapper_empty_count; + /*--------------------------------------------------------------------------- * Forward declaration * ------------------------------------------------------------------------*/ @@ -1594,7 +1597,7 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) { pVosMqType pTargetMq = NULL; pVosMsgWrapper pMsgWrapper = NULL; - static uint32_t debug_count = 0; + uint32_t debug_count; if ((gpVosContext == NULL) || (pMsg == NULL)) { @@ -1664,7 +1667,7 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) pMsgWrapper = vos_mq_get(&gpVosContext->freeVosMq); if (NULL == pMsgWrapper) { - debug_count++; + debug_count = atomic_inc_return(&vos_wrapper_empty_count); VOS_TRACE(VOS_MODULE_ID_VOSS, VOS_TRACE_LEVEL_ERROR, "%s: VOS Core run out of message wrapper %d", __func__, debug_count); @@ -1676,7 +1679,7 @@ VOS_STATUS vos_mq_post_message( VOS_MQ_ID msgQueueId, vos_msg_t *pMsg ) return VOS_STATUS_E_RESOURCES; } - debug_count = 0; + atomic_set(&vos_wrapper_empty_count, 0); /* ** Copy the message now diff --git a/CORE/VOSS/src/vos_sched.c b/CORE/VOSS/src/vos_sched.c index 266992bd4751..e653cdc4f6dc 100644 --- a/CORE/VOSS/src/vos_sched.c +++ b/CORE/VOSS/src/vos_sched.c @@ -71,9 +71,19 @@ * we proceed with SSR in WD Thread */ #define MAX_SSR_WAIT_ITERATIONS 100 +#define MAX_SSR_PROTECT_LOG (16) static atomic_t ssr_protect_entry_count; +struct ssr_protect { + const char* func; + bool free; + uint32_t pid; +}; + +static spinlock_t ssr_protect_lock; +static struct ssr_protect ssr_protect_log[MAX_SSR_PROTECT_LOG]; + /*--------------------------------------------------------------------------- * Type Declarations * ------------------------------------------------------------------------*/ @@ -2077,6 +2087,53 @@ VOS_STATUS vos_watchdog_wlan_re_init(void) } /** + * vos_ssr_protect_init() - initialize ssr protection debug functionality + * + * Return: + * void + */ +void vos_ssr_protect_init(void) +{ + int i = 0; + + spin_lock_init(&ssr_protect_lock); + + while (i < MAX_SSR_PROTECT_LOG) { + ssr_protect_log[i].func = NULL; + ssr_protect_log[i].free = true; + ssr_protect_log[i].pid = 0; + i++; + } +} + +/** + * vos_print_external_threads() - print external threads stuck in driver + * + * Return: + * void + */ + +static void vos_print_external_threads(void) +{ + int i = 0; + unsigned long irq_flags; + + spin_lock_irqsave(&ssr_protect_lock, irq_flags); + + while (i < MAX_SSR_PROTECT_LOG) { + if (!ssr_protect_log[i].free) { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "PID %d is stuck at %s", ssr_protect_log[i].pid, + ssr_protect_log[i].func); + } + i++; + } + + spin_unlock_irqrestore(&ssr_protect_lock, irq_flags); +} + + +/** @brief vos_ssr_protect() This function is called to keep track of active driver entry points @@ -2089,9 +2146,34 @@ VOS_STATUS vos_watchdog_wlan_re_init(void) void vos_ssr_protect(const char *caller_func) { int count; + int i = 0; + bool status = false; + unsigned long irq_flags; + count = atomic_inc_return(&ssr_protect_entry_count); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: ENTRY ACTIVE %d", caller_func, count); + + spin_lock_irqsave(&ssr_protect_lock, irq_flags); + + while (i < MAX_SSR_PROTECT_LOG) { + if (ssr_protect_log[i].free) { + ssr_protect_log[i].func = caller_func; + ssr_protect_log[i].free = false; + ssr_protect_log[i].pid = current->pid; + status = true; + break; + } + i++; + } + + spin_unlock_irqrestore(&ssr_protect_lock, irq_flags); + + if (!status) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "Could not track PID %d call %s: log is full", + current->pid, caller_func); + } /** @@ -2105,9 +2187,35 @@ void vos_ssr_protect(const char *caller_func) void vos_ssr_unprotect(const char *caller_func) { int count; + int i = 0; + bool status = false; + unsigned long irq_flags; + count = atomic_dec_return(&ssr_protect_entry_count); VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: ENTRY INACTIVE %d", caller_func, count); + + spin_lock_irqsave(&ssr_protect_lock, irq_flags); + + while (i < MAX_SSR_PROTECT_LOG) { + if (!ssr_protect_log[i].free) { + if ((ssr_protect_log[i].pid == current->pid) && + !strcmp(ssr_protect_log[i].func, caller_func)) { + ssr_protect_log[i].func = NULL; + ssr_protect_log[i].free = true; + ssr_protect_log[i].pid = 0; + status = true; + break; + } + } + i++; + } + + spin_unlock_irqrestore(&ssr_protect_lock, irq_flags); + + if (!status) + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "Untracked call %s", caller_func); } /** @@ -2137,8 +2245,10 @@ bool vos_is_ssr_ready(const char *caller_func) } } /* at least one external thread is executing */ - if (!count) + if (!count) { + vos_print_external_threads(); return false; + } VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "Allowing SSR for %s", caller_func); diff --git a/CORE/VOSS/src/vos_sched.h b/CORE/VOSS/src/vos_sched.h index 169730aa4148..5b7b5094386c 100644 --- a/CORE/VOSS/src/vos_sched.h +++ b/CORE/VOSS/src/vos_sched.h @@ -626,6 +626,7 @@ void vos_timer_module_init( void ); VOS_STATUS vos_watchdog_wlan_shutdown(void); VOS_STATUS vos_watchdog_wlan_re_init(void); v_BOOL_t isWDresetInProgress(void); +void vos_ssr_protect_init(void); void vos_ssr_protect(const char *caller_func); void vos_ssr_unprotect(const char *caller_func); bool vos_is_ssr_ready(const char *caller_func); diff --git a/CORE/WDA/inc/legacy/halMsgApi.h b/CORE/WDA/inc/legacy/halMsgApi.h index 253c523b4d76..ed1332daa4bb 100644 --- a/CORE/WDA/inc/legacy/halMsgApi.h +++ b/CORE/WDA/inc/legacy/halMsgApi.h @@ -1590,4 +1590,12 @@ struct sap_offload_del_sta_req }; #endif /* SAP_AUTH_OFFLOAD */ +#ifdef WLAN_FEATURE_APFIND +struct hal_apfind_request +{ + u_int16_t request_data_len; + u_int8_t request_data[]; +}; +#endif + #endif /* _HALMSGAPI_H_ */ diff --git a/CORE/WDA/inc/wlan_qct_wda.h b/CORE/WDA/inc/wlan_qct_wda.h index ab66db5d85d0..4adeca3d5e24 100644 --- a/CORE/WDA/inc/wlan_qct_wda.h +++ b/CORE/WDA/inc/wlan_qct_wda.h @@ -1016,6 +1016,10 @@ tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); #define WDA_SET_SAP_AUTH_OFL SIR_HAL_SET_SAP_AUTH_OFL #endif /* SAP_AUTH_OFFLOAD */ +#ifdef WLAN_FEATURE_APFIND +#define WDA_APFIND_SET_CMD SIR_HAL_APFIND_SET_CMD +#endif /* WLAN_FEATURE_APFIND */ + tSirRetStatus wdaPostCtrlMsg(tpAniSirGlobal pMac, tSirMsgQ *pMsg); #define HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME 0x40 // Bit 6 will be used to control BD rate for Management frames @@ -928,6 +928,7 @@ ifeq ($(CONFIG_QCA_WIFI_SDIO), 1) CDEFINES += -DFEATURE_WLAN_FORCE_SAP_SCC CDEFINES += -DDHCP_SERVER_OFFLOAD CDEFINES += -DWLAN_FEATURE_GPIO_LED_FLASHING +CDEFINES += -DWLAN_FEATURE_APFIND ifneq ($(CONFIG_NON_QC_PLATFORM), y) CDEFINES += -DDFS_MASTER_OFFLOAD_IND_SUPPORT endif |
