From acf3561f35f3ad3d3da282f44b91dd7e7a42e863 Mon Sep 17 00:00:00 2001 From: Manjunathappa Prakash Date: Mon, 3 Oct 2016 17:22:16 -0700 Subject: [PATCH 001/113] qcacld-3.0: Do NULL check on adapter->dev in hdd_lro_flush Fix the issue due NULL pointer access on adapter->dev. One of the instance this happened is inside __hdd_hostapd_uninit(). Change-Id: Ie2a3e41d446261cd32729b8eb8f12e23134a8828 CRs-Fixed: 1073808 --- core/hdd/src/wlan_hdd_lro.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index 857d2c154a7a..35902f28fee5 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -461,7 +461,9 @@ void hdd_lro_flush(void *data) while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { adapter = adapter_node->pAdapter; hdd_lro = &adapter->lro_info; - if (adapter->dev->features & NETIF_F_LRO) { + if (adapter->dev == NULL) { + hdd_err("vdev interface going down"); + } else if (adapter->dev->features & NETIF_F_LRO) { qdf_spin_lock_bh(&hdd_lro->lro_mgr_arr_access_lock); for (i = 0; i < hdd_lro->lro_mgr->max_desc; i++) { if (hdd_lro->lro_mgr->lro_arr[i].active) { From a2bbaddd9d0e70c535b86503b47b713aa30f9586 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 11:55:31 -0700 Subject: [PATCH 002/113] Release 5.1.0.29K Release 5.1.0.29K Change-Id: Icdfe0c05382e946e76f3e34bc7a5542aba5f4da8 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7e897c074a79..c11b0d1c1d6d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29J" +#define QWLAN_VERSIONSTR "5.1.0.29K" #endif /* QWLAN_VERSION_H */ From 75c1ca7de8c66042ee8b316714665d69f835befc Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Mon, 22 Aug 2016 17:20:25 -0700 Subject: [PATCH 003/113] qcacld-3.0: Fix HDD logging API in wlan_hdd_assoc HDD should use new logging API i.e., hdd_* CRs-Fixed: 937586 Change-Id: Iabe36591e6aae45cb837f0f434ccafd743f3b746 --- core/hdd/src/wlan_hdd_assoc.c | 703 +++++++++++++++------------------- 1 file changed, 314 insertions(+), 389 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 312349735478..196a20ecf74e 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -32,6 +32,9 @@ * */ +/* denote that this file does not allow legacy hddLog */ +#define HDD_DISALLOW_LEGACY_HDDLOG 1 + #include "wlan_hdd_includes.h" #include #include "dot11f.h" @@ -142,9 +145,8 @@ hdd_conn_set_authenticated(hdd_adapter_t *pAdapter, uint8_t authState) hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); /* save the new connection state */ - hddLog(LOG1, - FL("Authenticated state Changed from oldState:%d to State:%d"), - pHddStaCtx->conn_info.uIsAuthenticated, authState); + hdd_notice("Authenticated state Changed from oldState:%d to State:%d", + pHddStaCtx->conn_info.uIsAuthenticated, authState); pHddStaCtx->conn_info.uIsAuthenticated = authState; /* Check is pending ROC request or not when auth state changed */ @@ -972,9 +974,8 @@ hdd_send_ft_assoc_response(struct net_device *dev, u8 *pFTAssocRsp = NULL; if (pCsrRoamInfo->nAssocRspLength == 0) { - hddLog(LOGE, - FL("pCsrRoamInfo->nAssocRspLength=%d"), - (int)pCsrRoamInfo->nAssocRspLength); + hdd_err("pCsrRoamInfo->nAssocRspLength=%d", + (int)pCsrRoamInfo->nAssocRspLength); return; } @@ -982,18 +983,19 @@ hdd_send_ft_assoc_response(struct net_device *dev, (u8 *) (pCsrRoamInfo->pbFrames + pCsrRoamInfo->nBeaconLength + pCsrRoamInfo->nAssocReqLength); if (pFTAssocRsp == NULL) { - hddLog(LOGE, FL("AssocReq or AssocRsp is NULL")); + hdd_err("AssocReq or AssocRsp is NULL"); return; } /* pFTAssocRsp needs to point to the IEs */ pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET; - hddLog(LOG1, FL("AssocRsp is now at %02x%02x"), - (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]); + hdd_notice("AssocRsp is now at %02x%02x", + (unsigned int)pFTAssocRsp[0], + (unsigned int)pFTAssocRsp[1]); /* We need to send the IEs to the supplicant. */ buff = kmalloc(IW_GENERIC_IE_MAX, GFP_ATOMIC); if (buff == NULL) { - hddLog(LOGE, FL("kmalloc unable to allocate memory")); + hdd_err("kmalloc unable to allocate memory"); return; } /* Send the Assoc Resp, the supplicant needs this for initial Auth. */ @@ -1042,20 +1044,19 @@ static void hdd_send_ft_event(hdd_adapter_t *pAdapter) sme_get_rici_es(pHddCtx->hHal, pAdapter->sessionId, (u8 *) ricIe, DOT11F_IE_RICDESCRIPTOR_MAX_LEN, &ric_ies_length); if (ric_ies_length == 0) { - hddLog(LOGW, - FL("RIC IEs is of length 0 not sending RIC Information for now")); + hdd_warn("RIC IEs is of length 0 not sending RIC Information for now"); } ftEvent.ric_ies = ricIe; ftEvent.ric_ies_len = ric_ies_length; - hddLog(LOG1, FL("RIC IEs is of length %d"), (int)ric_ies_length); + hdd_notice("RIC IEs is of length %d", (int)ric_ies_length); sme_get_ft_pre_auth_response(pHddCtx->hHal, pAdapter->sessionId, (u8 *) ftIe, DOT11F_IE_FTINFO_MAX_LEN, &auth_resp_len); if (auth_resp_len == 0) { - hddLog(LOGE, FL("AuthRsp FTIES is of length 0")); + hdd_err("AuthRsp FTIES is of length 0"); return; } @@ -1066,9 +1067,9 @@ static void hdd_send_ft_event(hdd_adapter_t *pAdapter) ftEvent.ies = (u8 *) (ftIe + QDF_MAC_ADDR_SIZE); ftEvent.ies_len = auth_resp_len - QDF_MAC_ADDR_SIZE; - hddLog(LOG1, FL("ftEvent.ies_len %zu"), ftEvent.ies_len); - hddLog(LOG1, FL("ftEvent.ric_ies_len %zu"), ftEvent.ric_ies_len); - hddLog(LOG1, FL("ftEvent.target_ap %2x-%2x-%2x-%2x-%2x-%2x"), + hdd_notice("ftEvent.ies_len %zu", ftEvent.ies_len); + hdd_notice("ftEvent.ric_ies_len %zu", ftEvent.ric_ies_len); + hdd_notice("ftEvent.target_ap %2x-%2x-%2x-%2x-%2x-%2x", ftEvent.target_ap[0], ftEvent.target_ap[1], ftEvent.target_ap[2], ftEvent.target_ap[3], ftEvent.target_ap[4], ftEvent.target_ap[5]); @@ -1079,7 +1080,7 @@ static void hdd_send_ft_event(hdd_adapter_t *pAdapter) /* We need to send the IEs to the supplicant */ buff = kmalloc(IW_CUSTOM_MAX, GFP_ATOMIC); if (buff == NULL) { - hddLog(LOGE, FL("kmalloc unable to allocate memory")); + hdd_err("kmalloc unable to allocate memory"); return; } qdf_mem_zero(buff, IW_CUSTOM_MAX); @@ -1090,8 +1091,7 @@ static void hdd_send_ft_event(hdd_adapter_t *pAdapter) (u8 *) &(buff[str_len]), (IW_CUSTOM_MAX - str_len), &ric_ies_length); if (ric_ies_length == 0) { - hddLog(LOGW, - FL("RIC IEs is of length 0 not sending RIC Information for now")); + hdd_warn("RIC IEs is of length 0 not sending RIC Information for now"); } else { wrqu.data.length = str_len + ric_ies_length; wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff); @@ -1106,7 +1106,7 @@ static void hdd_send_ft_event(hdd_adapter_t *pAdapter) if (auth_resp_len == 0) { kfree(buff); - hddLog(LOGE, FL("AuthRsp FTIES is of length 0")); + hdd_err("AuthRsp FTIES is of length 0"); return; } @@ -1139,15 +1139,15 @@ hdd_send_new_ap_channel_info(struct net_device *dev, hdd_adapter_t *pAdapter, tSirBssDescription *descriptor = pCsrRoamInfo->pBssDesc; if (descriptor == NULL) { - hddLog(LOGE, FL("pCsrRoamInfo->pBssDesc(%p)"), descriptor); + hdd_err("pCsrRoamInfo->pBssDesc(%p)", descriptor); return; } /* * Send the Channel event, the supplicant needs this to generate * the Adjacent AP report. */ - hddLog(LOGW, FL("Sending up an SIOCGIWFREQ, channelId(%d)"), - descriptor->channelId); + hdd_warn("Sending up an SIOCGIWFREQ, channelId(%d)", + descriptor->channelId); memset(&wrqu, '\0', sizeof(wrqu)); wrqu.freq.m = descriptor->channelId; wrqu.freq.e = 0; @@ -1177,24 +1177,25 @@ hdd_send_update_beacon_ies_event(hdd_adapter_t *pAdapter, memset(&wrqu, '\0', sizeof(wrqu)); if (0 == pCsrRoamInfo->nBeaconLength) { - hddLog(LOGW, FL("pCsrRoamInfo->nBeaconFrameLength = 0")); + hdd_warn("pCsrRoamInfo->nBeaconFrameLength = 0"); return; } pBeaconIes = (u8 *) (pCsrRoamInfo->pbFrames + BEACON_FRAME_IES_OFFSET); if (pBeaconIes == NULL) { - hddLog(LOGW, FL("Beacon IEs is NULL")); + hdd_warn("Beacon IEs is NULL"); return; } /* pBeaconIes needs to point to the IEs */ - hddLog(LOG1, FL("Beacon IEs is now at %02x%02x"), - (unsigned int)pBeaconIes[0], (unsigned int)pBeaconIes[1]); - hddLog(LOG1, FL("Beacon IEs length = %d"), - pCsrRoamInfo->nBeaconLength - BEACON_FRAME_IES_OFFSET); + hdd_notice("Beacon IEs is now at %02x%02x", + (unsigned int)pBeaconIes[0], + (unsigned int)pBeaconIes[1]); + hdd_notice("Beacon IEs length = %d", + pCsrRoamInfo->nBeaconLength - BEACON_FRAME_IES_OFFSET); /* We need to send the IEs to the supplicant. */ buff = kmalloc(IW_CUSTOM_MAX, GFP_ATOMIC); if (buff == NULL) { - hddLog(LOGE, FL("kmalloc unable to allocate memory")); + hdd_err("kmalloc unable to allocate memory"); return; } qdf_mem_zero(buff, IW_CUSTOM_MAX); @@ -1222,8 +1223,8 @@ hdd_send_update_beacon_ies_event(hdd_adapter_t *pAdapter, else buff[strLen] = 0; /* last chunk */ - hddLog(LOG1, FL("Beacon IEs length to supplicant = %d"), - currentLen); + hdd_notice("Beacon IEs length to supplicant = %d", + currentLen); wireless_send_event(pAdapter->dev, IWEVCUSTOM, &wrqu, buff); } while (totalIeLen > 0); @@ -1261,13 +1262,13 @@ static void hdd_send_association_event(struct net_device *dev, if (NULL != pCsrRoamInfo) if (pCsrRoamInfo->roamSynchInProgress) /* change logging before release */ - hddLog(LOG4, "LFR3:hdd_send_association_event"); + hdd_info("LFR3:hdd_send_association_event"); #endif if (eConnectionState_Associated == pHddStaCtx->conn_info.connState) { tSirSmeChanInfo chan_info; if (!pCsrRoamInfo) { - hddLog(LOGE, FL("STA in associated state but pCsrRoamInfo is null")); + hdd_err("STA in associated state but pCsrRoamInfo is null"); return; } @@ -1283,14 +1284,12 @@ static void hdd_send_association_event(struct net_device *dev, P2P_CLIENT_CONNECTING_STATE_1) { global_p2p_connection_status = P2P_CLIENT_CONNECTED_STATE_1; - hddLog(LOGE, - "[P2P State] Changing state from Connecting state to Connected State for 8-way Handshake"); + hdd_err("[P2P State] Changing state from Connecting state to Connected State for 8-way Handshake"); } else if (global_p2p_connection_status == P2P_CLIENT_CONNECTING_STATE_2) { global_p2p_connection_status = P2P_CLIENT_COMPLETED_STATE; - hddLog(LOGE, - "[P2P State] Changing state from Connecting state to P2P Client Connection Completed"); + hdd_err("[P2P State] Changing state from Connecting state to P2P Client Connection Completed"); } } #endif @@ -1497,8 +1496,7 @@ QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId) qdf_status = ol_txrx_clear_peer(staId); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - hddLog(LOGE, - FL("ol_txrx_clear_peer() failed for staID %d. Status(%d) [0x%08X]"), + hdd_err("ol_txrx_clear_peer() failed for staID %d. Status(%d) [0x%08X]", staId, qdf_status, qdf_status); } return qdf_status; @@ -1579,11 +1577,11 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, bool sendDisconInd = true; if (dev == NULL) { - hddLog(LOGE, FL("net_dev is released return")); + hdd_err("net_dev is released return"); return QDF_STATUS_E_FAILURE; } /* notify apps that we can't pass traffic anymore */ - hddLog(LOG1, FL("Disabling queues")); + hdd_notice("Disabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); @@ -1609,8 +1607,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, pHddStaCtx->conn_info.connState) || (eConnectionState_NotConnected == pHddStaCtx->conn_info.connState)) { - hddLog(LOG1, - FL("HDD has initiated a disconnect, no need to send disconnect indication to kernel")); + hdd_notice("HDD has initiated a disconnect, no need to send disconnect indication to kernel"); sendDisconInd = false; } @@ -1665,14 +1662,12 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, P2P_CLIENT_CONNECTED_STATE_1) { global_p2p_connection_status = P2P_CLIENT_DISCONNECTED_STATE; - hddLog(LOGE, - "[P2P State] 8 way Handshake completed and moved to disconnected state"); + hdd_err("[P2P State] 8 way Handshake completed and moved to disconnected state"); } else if (global_p2p_connection_status == P2P_CLIENT_COMPLETED_STATE) { global_p2p_connection_status = P2P_NOT_ACTIVE; - hddLog(LOGE, - "[P2P State] P2P Client is removed and moved to inactive state"); + hdd_err("[P2P State] P2P Client is removed and moved to inactive state"); } } #endif @@ -1700,11 +1695,10 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, if (0 == pHddStaCtx->conn_info.staId[i]) continue; sta_id = pHddStaCtx->conn_info.staId[i]; - hddLog(LOG1, FL("Deregister StaID %d"), sta_id); + hdd_info("Deregister StaID %d", sta_id); vstatus = hdd_roam_deregister_sta(pAdapter, sta_id); if (!QDF_IS_STATUS_SUCCESS(vstatus)) { - hddLog(LOGE, - FL("hdd_roamDeregisterSTA() failed to for staID %d. Status= %d [0x%x]"), + hdd_err("hdd_roamDeregisterSTA() failed to for staID %d. Status= %d [0x%x]", sta_id, status, status); status = QDF_STATUS_E_FAILURE; } @@ -1733,8 +1727,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, */ vstatus = hdd_roam_deregister_sta(pAdapter, sta_id); if (!QDF_IS_STATUS_SUCCESS(vstatus)) { - hddLog(LOGE, - FL("hdd_roam_deregister_sta() failed to for staID %d. Status= %d [0x%x]"), + hdd_err("hdd_roam_deregister_sta() failed to for staID %d. Status= %d [0x%x]", sta_id, status, status); status = QDF_STATUS_E_FAILURE; } @@ -1782,8 +1775,7 @@ void hdd_set_peer_authorized_event(uint32_t vdev_id) adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id); if (adapter == NULL) { - hddLog(LOGE, - "%s: Invalid vdev_id", __func__); + hdd_err("Invalid vdev_id"); } complete(&adapter->sta_authorized_event); } @@ -1812,7 +1804,7 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter, } if (sta_id >= WLAN_MAX_STA_COUNT) { - hddLog(LOGE, "Invalid sta id :%d", sta_id); + hdd_err("Invalid sta id :%d", sta_id); return QDF_STATUS_E_INVAL; } @@ -1822,13 +1814,13 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter, peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer); if (peer_mac_addr == NULL) { - hddLog(LOGE, "peer mac addr is NULL"); + hdd_err("peer mac addr is NULL"); return QDF_STATUS_E_FAULT; } err = ol_txrx_peer_state_update(pdev, peer_mac_addr, sta_state); if (err != QDF_STATUS_SUCCESS) { - hddLog(LOGE, "peer state update failed"); + hdd_err("peer state update failed"); return QDF_STATUS_E_FAULT; } #ifdef WLAN_FEATURE_ROAM_OFFLOAD @@ -1846,7 +1838,7 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter, hdd_set_peer_authorized_event, pAdapter->sessionId); if (err != QDF_STATUS_SUCCESS) { - hddLog(LOGE, "Failed to set the peer state to authorized"); + hdd_err("Failed to set the peer state to authorized"); return QDF_STATUS_E_FAULT; } @@ -1861,8 +1853,7 @@ QDF_STATUS hdd_change_peer_state(hdd_adapter_t *pAdapter, &pAdapter->sta_authorized_event, msecs_to_jiffies(HDD_PEER_AUTHORIZE_WAIT)); if (!rc) { - hddLog(LOG1, "%s: timeout waiting for sta_authorized_event", - __func__); + hdd_notice("timeout waiting for sta_authorized_event"); } vdev = ol_txrx_get_vdev_for_peer(peer); ol_txrx_vdev_unpause(vdev, @@ -1907,8 +1898,8 @@ QDF_STATUS hdd_roam_register_sta(hdd_adapter_t *pAdapter, staDesc.is_qos_enabled = 0; #ifdef FEATURE_WLAN_WAPI - hddLog(LOG1, FL("WAPI STA Registered: %d"), - pAdapter->wapi_info.fIsWapiSta); + hdd_notice("WAPI STA Registered: %d", + pAdapter->wapi_info.fIsWapiSta); if (pAdapter->wapi_info.fIsWapiSta) staDesc.is_wapi_supported = 1; else @@ -1926,9 +1917,8 @@ QDF_STATUS hdd_roam_register_sta(hdd_adapter_t *pAdapter, qdf_status = ol_txrx_register_peer(&staDesc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - hddLog(LOGW, - "ol_txrx_register_peer() failed to register. Status=%d [0x%08X]", - qdf_status, qdf_status); + hdd_warn("ol_txrx_register_peer() failed to register. Status=%d [0x%08X]", + qdf_status, qdf_status); return qdf_status; } @@ -1949,8 +1939,7 @@ QDF_STATUS hdd_roam_register_sta(hdd_adapter_t *pAdapter, hdd_conn_set_authenticated(pAdapter, true); } else { - hddLog(LOG3, - "ULA auth StaId= %d. Changing TL state to CONNECTED at Join time", + hdd_info("ULA auth StaId= %d. Changing TL state to CONNECTED at Join time", pHddStaCtx->conn_info.staId[0]); qdf_status = hdd_change_peer_state(pAdapter, staDesc.sta_id, @@ -1995,7 +1984,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev, tHalHandle hal_handle = WLAN_HDD_GET_HAL_CTX(pAdapter); if (!rspRsnIe) { - hddLog(LOGE, FL("Unable to allocate RSN IE")); + hdd_err("Unable to allocate RSN IE"); goto done; } @@ -2004,12 +1993,12 @@ static void hdd_send_re_assoc_event(struct net_device *dev, goto done; } if (pCsrRoamInfo == NULL) { - hddLog(LOGE, FL("Invalid CSR roam info")); + hdd_err("Invalid CSR roam info"); goto done; } if (pCsrRoamInfo->nAssocRspLength == 0) { - hddLog(LOGE, FL("Invalid assoc response length")); + hdd_err("Invalid assoc response length"); goto done; } @@ -2021,8 +2010,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev, /* pFTAssocRsp needs to point to the IEs */ pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET; - hddLog(LOG1, FL("AssocRsp is now at %02x%02x"), - (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]); + hdd_info("AssocRsp is now at %02x%02x", + (unsigned int)pFTAssocRsp[0], (unsigned int)pFTAssocRsp[1]); /* * Active session count is decremented upon disconnection, but during @@ -2058,7 +2047,7 @@ static void hdd_send_re_assoc_event(struct net_device *dev, #endif if (bss == NULL) - hddLog(LOGE, FL("Get BSS returned NULL")); + hdd_err("Get BSS returned NULL"); buf_ptr = buf_ssid_ie; *buf_ptr = SIR_MAC_SSID_EID; buf_ptr++; @@ -2146,9 +2135,8 @@ static int hdd_change_sta_state_authenticated(hdd_adapter_t *adapter, AUTO_PS_ENTRY_TIMER_DEFAULT_VALUE : AUTO_DEFERRED_PS_ENTRY_TIMER_DEFAULT_VALUE; - hddLog(LOG1, - "Changing TL state to AUTHENTICATED for StaId= %d", - hddstactx->conn_info.staId[0]); + hdd_info("Changing TL state to AUTHENTICATED for StaId= %d", + hddstactx->conn_info.staId[0]); /* Connections that do not need Upper layer authentication, * transition TL to 'Authenticated' state after the keys are set @@ -2195,7 +2183,7 @@ static QDF_STATUS hdd_roam_set_key_complete_handler(hdd_adapter_t *pAdapter, ENTER(); if (NULL == pRoamInfo) { - hddLog(LOG2, FL("pRoamInfo is NULL")); + hdd_info("pRoamInfo is NULL"); return QDF_STATUS_E_FAILURE; } /* @@ -2204,7 +2192,7 @@ static QDF_STATUS hdd_roam_set_key_complete_handler(hdd_adapter_t *pAdapter, * (those that do not require upper layer authentication) we can put TL * directly into 'authenticated' state. */ - hddLog(LOG2, "Set Key completion roamStatus =%d roamResult=%d " + hdd_info("Set Key completion roamStatus =%d roamResult=%d " MAC_ADDRESS_STR, roamStatus, roamResult, MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes)); @@ -2223,8 +2211,7 @@ static QDF_STATUS hdd_roam_set_key_complete_handler(hdd_adapter_t *pAdapter, &pRoamInfo->peerMac, &staId); if (QDF_STATUS_SUCCESS == qdf_status) { - hddLog(LOG2, - "WLAN TL STA Ptk Installed for STAID=%d", + hdd_info("WLAN TL STA Ptk Installed for STAID=%d", staId); pHddStaCtx->roam_info.roamingState = HDD_ROAM_STATE_NONE; @@ -2329,7 +2316,7 @@ void hdd_perform_roam_set_key_complete(hdd_adapter_t *pAdapter) pHddStaCtx->roam_info.roamStatus, eCSR_ROAM_RESULT_AUTHENTICATED); if (qdf_ret_status != QDF_STATUS_SUCCESS) - hddLog(LOGE, FL("Set Key complete failure")); + hdd_err("Set Key complete failure"); pHddStaCtx->roam_info.deferKeyComplete = false; } @@ -2379,13 +2366,13 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, pHddStaCtx->conn_info.connState)) && ((eCSR_ROAM_RESULT_ASSOCIATED == roamResult) || (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus))) { - hddLog(LOG1, FL("Disconnect from HDD in progress")); + hdd_info("Disconnect from HDD in progress"); hddDisconInProgress = true; } if (eCSR_ROAM_RESULT_ASSOCIATED == roamResult) { if (NULL == pRoamInfo) { - hddLog(LOGE, FL("pRoamInfo is NULL")); + hdd_err("pRoamInfo is NULL"); return QDF_STATUS_E_FAILURE; } if (!hddDisconInProgress) { @@ -2464,8 +2451,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, if ((WLAN_MAX_STA_COUNT + 3) > pRoamInfo->staId) pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter; else - hddLog(LOGE, "%s: Wrong Staid: %d", __func__, - pRoamInfo->staId); + hdd_err("Wrong Staid: %d", pRoamInfo->staId); pHddCtx->sta_to_adapter[pRoamInfo->staId] = pAdapter; @@ -2543,15 +2529,14 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, * pFTAssocRsp needs to point to the IEs */ pFTAssocRsp += FT_ASSOC_RSP_IES_OFFSET; - hddLog(LOG1, - FL("AssocRsp is now at %02x%02x"), - (unsigned int)pFTAssocRsp[0], - (unsigned int)pFTAssocRsp[1]); + hdd_info("AssocRsp is now at %02x%02x", + (unsigned int)pFTAssocRsp[0], + (unsigned int)pFTAssocRsp[1]); assocRsplen = pRoamInfo->nAssocRspLength - FT_ASSOC_RSP_IES_OFFSET; } else { - hddLog(LOGE, FL("AssocRsp is NULL")); + hdd_err("AssocRsp is NULL"); assocRsplen = 0; } @@ -2566,12 +2551,11 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, */ pFTAssocReq += FT_ASSOC_REQ_IES_OFFSET; - hddLog(LOG1, - FL("pFTAssocReq is now at %02x%02x"), - (unsigned int) - pFTAssocReq[0], - (unsigned int) - pFTAssocReq[1]); + hdd_info("pFTAssocReq is now at %02x%02x", + (unsigned int) + pFTAssocReq[0], + (unsigned int) + pFTAssocReq[1]); assocReqlen = pRoamInfo->nAssocReqLength - FT_ASSOC_REQ_IES_OFFSET; @@ -2584,7 +2568,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, pRoamInfo->nAssocReqLength; } } else { - hddLog(LOGE, FL("AssocReq is NULL")); + hdd_err("AssocReq is NULL"); assocReqlen = 0; } @@ -2607,18 +2591,17 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, cds_decr_session_set_pcl (pAdapter->device_mode, pAdapter->sessionId); - hddLog(LOG1, - FL("ft_carrier_on is %d, sending roamed indication"), - ft_carrier_on); + hdd_info("ft_carrier_on is %d, sending roamed indication", + ft_carrier_on); chan = ieee80211_get_channel (pAdapter->wdev.wiphy, (int)pRoamInfo->pBssDesc-> channelId); - hddLog(LOG1, - "assocReqlen %d assocRsplen %d", - assocReqlen, - assocRsplen); + hdd_info( + "assocReqlen %d assocRsplen %d", + assocReqlen, + assocRsplen); hdd_notice( "Reassoc Req IE dump"); @@ -2672,9 +2655,8 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, deferKeyComplete = true; } } else if (!hddDisconInProgress) { - hddLog(LOG1, - FL("ft_carrier_on is %d, sending connect indication"), - ft_carrier_on); + hdd_info("ft_carrier_on is %d, sending connect indication", + ft_carrier_on); hdd_connect_result(dev, pRoamInfo-> bssid.bytes, @@ -2711,13 +2693,12 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, reqRsnIe, reqRsnLength); else { - hddLog(LOG1, - FL("sending connect indication to nl80211:for bssid " - MAC_ADDRESS_STR - " result:%d and Status:%d"), - MAC_ADDR_ARRAY - (pRoamInfo->bssid.bytes), - roamResult, roamStatus); + hdd_info("sending connect indication to nl80211:for bssid " + MAC_ADDRESS_STR + " result:%d and Status:%d", + MAC_ADDR_ARRAY + (pRoamInfo->bssid.bytes), + roamResult, roamStatus); /* inform connect result to nl80211 */ hdd_connect_result(dev, @@ -2752,7 +2733,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, * hdd_roam_register_sta will flush any cached * data frames immediately. */ - hddLog(LOG1, FL("Enabling queues")); + hdd_info("Enabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); @@ -2796,9 +2777,8 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, ); hdd_conn_set_authenticated(pAdapter, false); } else { - hddLog(LOG2, - FL("staId: %d Changing TL state to AUTHENTICATED"), - pHddStaCtx->conn_info.staId[0]); + hdd_info("staId: %d Changing TL state to AUTHENTICATED", + pHddStaCtx->conn_info.staId[0]); qdf_status = hdd_change_peer_state(pAdapter, pHddStaCtx->conn_info.staId[0], @@ -2824,9 +2804,9 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, /* Start the tx queues */ #ifdef WLAN_FEATURE_ROAM_OFFLOAD if (pRoamInfo->roamSynchInProgress) - hddLog(LOG3, "LFR3:netif_tx_wake_all_queues"); + hdd_info("LFR3:netif_tx_wake_all_queues"); #endif - hddLog(LOG1, FL("Enabling queues")); + hdd_info("Enabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_WAKE_ALL_NETIF_QUEUE, WLAN_CONTROL_PATH); @@ -2837,8 +2817,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, #endif if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - hddLog(LOGE, - "STA register with TL failed. status(=%d) [%08X]", + hdd_err("STA register with TL failed. status(=%d) [%08X]", qdf_status, qdf_status); } #ifdef WLAN_FEATURE_11W @@ -2886,21 +2865,19 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, if (eCSR_ROAM_ASSOCIATION_FAILURE == roamStatus && !hddDisconInProgress) { if (pRoamInfo) { - hddLog(LOGE, - FL("send connect failure to nl80211: for bssid " - MAC_ADDRESS_STR - " result:%d and Status:%d reasoncode %d"), - MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes), - roamResult, roamStatus, - pRoamInfo->reasonCode); + hdd_err("send connect failure to nl80211: for bssid " + MAC_ADDRESS_STR + " result:%d and Status:%d reasoncode %d", + MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes), + roamResult, roamStatus, + pRoamInfo->reasonCode); pHddStaCtx->conn_info.assoc_status_code = pRoamInfo->statusCode; } else - hddLog(LOGE, - FL("connect failed: for bssid " + hdd_err("connect failed: for bssid " MAC_ADDRESS_STR - " result:%d and Status:%d "), + " result:%d and Status:%d ", MAC_ADDR_ARRAY(pWextState->req_bssId.bytes), roamResult, roamStatus); @@ -2990,7 +2967,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter, } hdd_wmm_init(pAdapter); - hddLog(LOG1, FL("Disabling queues")); + hdd_info("Disabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); @@ -3030,8 +3007,9 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, eRoamCmdStatus roamStatus, eCsrRoamResult roamResult) { - hddLog(LOG1, "%s: id %d, status %d, result %d", - pAdapter->dev->name, roamId, roamStatus, roamResult); + hdd_info("%s: id %d, status %d, result %d", + pAdapter->dev->name, roamId, + roamStatus, roamResult); switch (roamResult) { /* both IBSS Started and IBSS Join should come in here. */ @@ -3078,21 +3056,20 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, unsigned int freq; #endif /* we created the IBSS, notify supplicant */ - hddLog(LOG1, - FL("%s: created ibss " MAC_ADDRESS_STR), - pAdapter->dev->name, - MAC_ADDR_ARRAY(pRoamInfo->pBssDesc->bssId)); + hdd_info("%s: created ibss " MAC_ADDRESS_STR, + pAdapter->dev->name, + MAC_ADDR_ARRAY( + pRoamInfo->pBssDesc->bssId)); /* we must first give cfg80211 the BSS information */ bss = wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo); if (NULL == bss) { - hddLog(LOGE, - FL("%s: unable to create IBSS entry"), - pAdapter->dev->name); + hdd_err("%s: unable to create IBSS entry", + pAdapter->dev->name); return; } - hddLog(LOG1, FL("Enabling queues")); + hdd_info("Enabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); @@ -3114,9 +3091,9 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, bss->bssid, chan, GFP_KERNEL); else - hddLog(LOGE, FL("%s: chanId: %d, can't find channel"), - pAdapter->dev->name, - (int)pRoamInfo->pBssDesc->channelId); + hdd_err("%s: chanId: %d, can't find channel", + pAdapter->dev->name, + (int)pRoamInfo->pBssDesc->channelId); #else cfg80211_ibss_joined(pAdapter->dev, bss->bssid, GFP_KERNEL); @@ -3137,14 +3114,13 @@ static void hdd_roam_ibss_indication_handler(hdd_adapter_t *pAdapter, case eCSR_ROAM_RESULT_IBSS_START_FAILED: { - hddLog(LOGE, - FL("%s: unable to create IBSS"), pAdapter->dev->name); + hdd_err("%s: unable to create IBSS", pAdapter->dev->name); break; } default: - hddLog(LOGE, FL("%s: unexpected result %d"), - pAdapter->dev->name, (int)roamResult); + hdd_err("%s: unexpected result %d", + pAdapter->dev->name, (int)roamResult); break; } @@ -3169,8 +3145,8 @@ bool hdd_save_peer(hdd_station_ctx_t *sta_ctx, uint8_t sta_id, for (idx = 0; idx < SIR_MAX_NUM_STA_IN_IBSS; idx++) { if (0 == sta_ctx->conn_info.staId[idx]) { - hddLog(LOG1, FL("adding peer: %pM, sta_id: %d, at idx: %d"), - peer_mac_addr, sta_id, idx); + hdd_info("adding peer: %pM, sta_id: %d, at idx: %d", + peer_mac_addr, sta_id, idx); sta_ctx->conn_info.staId[idx] = sta_id; qdf_copy_macaddr( &sta_ctx->conn_info.peerMacAddress[idx], @@ -3250,7 +3226,7 @@ static bool roam_remove_ibss_station(hdd_adapter_t *pAdapter, uint8_t staId) /* Last peer departed, set the IBSS state appropriately */ pHddStaCtx->conn_info.connState = eConnectionState_IbssDisconnected; - hddLog(LOGE, "Last IBSS Peer Departed!!!"); + hdd_err("Last IBSS Peer Departed!!!"); } /* Find next active staId, to have a valid sta trigger for TL. */ if (fSuccess == true) { @@ -3299,8 +3275,7 @@ static QDF_STATUS roam_ibss_connect_handler(hdd_adapter_t *pAdapter, /* add bss_id to cfg80211 data base */ bss = wlan_hdd_cfg80211_update_bss_db(pAdapter, pRoamInfo); if (NULL == bss) { - hddLog(LOGE, - FL("%s: unable to create IBSS entry"), + hdd_err("%s: unable to create IBSS entry", pAdapter->dev->name); return QDF_STATUS_E_FAILURE; } @@ -3342,8 +3317,8 @@ hdd_roam_mic_error_indication_handler(hdd_adapter_t *pAdapter, memcpy(msg.src_addr.sa_data, pRoamInfo->u.pMICFailureInfo->taMacAddr, sizeof(pRoamInfo->u.pMICFailureInfo->taMacAddr)); - hddLog(LOG1, "MIC MAC " MAC_ADDRESS_STR, - MAC_ADDR_ARRAY(msg.src_addr.sa_data)); + hdd_info("MIC MAC " MAC_ADDRESS_STR, + MAC_ADDR_ARRAY(msg.src_addr.sa_data)); if (pRoamInfo->u.pMICFailureInfo->multicast == eSIR_TRUE) msg.flags = IW_MICFAILURE_GROUP; @@ -3412,7 +3387,7 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pRoamInfo->staId, &pRoamInfo->peerMac)) { - hddLog(LOGW, "Max reached: Can't register new IBSS peer"); + hdd_warn("Max reached: Can't register new IBSS peer"); break; } @@ -3425,8 +3400,7 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, &pRoamInfo->peerMac, pRoamInfo->pBssDesc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - hddLog(LOGE, - "Cannot register STA with TL for IBSS. Failed with qdf_status = %d [%08X]", + hdd_err("Cannot register STA with TL for IBSS. Failed with qdf_status = %d [%08X]", qdf_status, qdf_status); } pHddStaCtx->ibss_sta_generation++; @@ -3451,8 +3425,8 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, qdf_copy_macaddr(&pHddStaCtx->ibss_enc_key.peerMac, &pRoamInfo->peerMac); - hddLog(LOG2, "New peer joined set PTK encType=%d", - pHddStaCtx->ibss_enc_key.encType); + hdd_info("New peer joined set PTK encType=%d", + pHddStaCtx->ibss_enc_key.encType); qdf_status = sme_roam_set_key(WLAN_HDD_GET_HAL_CTX @@ -3462,13 +3436,12 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, &roamId); if (QDF_STATUS_SUCCESS != qdf_status) { - hddLog(LOGE, - FL("sme_roam_set_key failed, status=%d"), - qdf_status); + hdd_err("sme_roam_set_key failed, status=%d", + qdf_status); return QDF_STATUS_E_FAILURE; } } - hddLog(LOG1, FL("Enabling queues")); + hdd_info("Enabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_START_ALL_NETIF_QUEUE_N_CARRIER, WLAN_CONTROL_PATH); @@ -3488,8 +3461,7 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); if (!roam_remove_ibss_station(pAdapter, pRoamInfo->staId)) - hddLog(LOGW, - "IBSS peer departed by cannot find peer in our registration table with TL"); + hdd_warn("IBSS peer departed by cannot find peer in our registration table with TL"); hdd_err("IBSS Peer Departed from SME " "with peerMac " MAC_ADDRESS_STR " BSSID: " @@ -3510,10 +3482,9 @@ roam_roam_connect_status_update_handler(hdd_adapter_t *pAdapter, } case eCSR_ROAM_RESULT_IBSS_INACTIVE: { - hddLog(LOG3, - "Received eCSR_ROAM_RESULT_IBSS_INACTIVE from SME"); + hdd_info("Received eCSR_ROAM_RESULT_IBSS_INACTIVE from SME"); /* Stop only when we are inactive */ - hddLog(LOG1, FL("Disabling queues")); + hdd_info("Disabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); @@ -3574,7 +3545,7 @@ QDF_STATUS hdd_roam_register_tdlssta(hdd_adapter_t *pAdapter, /* Register the Station with TL... */ qdf_status = ol_txrx_register_peer(&staDesc); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - hddLog(LOGE, FL("ol_txrx_register_peer() failed to register. Status=%d [0x%08X]"), + hdd_err("ol_txrx_register_peer() failed to register. Status=%d [0x%08X]", qdf_status, qdf_status); return qdf_status; } @@ -3595,8 +3566,8 @@ static QDF_STATUS hdd_roam_deregister_tdlssta(hdd_adapter_t *pAdapter, QDF_STATUS qdf_status; qdf_status = ol_txrx_clear_peer(staId); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { - hddLog(LOGW, FL("ol_txrx_clear_peer() failed for staID %d. Status=%d [0x%08X]"), - staId, qdf_status, qdf_status); + hdd_warn("ol_txrx_clear_peer() failed for staID %d. Status=%d [0x%08X]", + staId, qdf_status, qdf_status); } return qdf_status; } @@ -3688,8 +3659,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, hddTdlsPeer_t *curr_peer; uint32_t reason; - hddLog(LOG2, - ("hdd_tdlsStatusUpdate: %s staIdx %d " MAC_ADDRESS_STR), + hdd_info("hdd_tdlsStatusUpdate: %s staIdx %d " MAC_ADDRESS_STR, roamResult == eCSR_ROAM_RESULT_ADD_TDLS_PEER ? "ADD_TDLS_PEER" : roamResult == @@ -3712,9 +3682,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes)); if (!pHddTdlsCtx) { - hddLog(LOG1, - FL("TDLS ctx is null, ignore roamResult (%d)"), - roamResult); + hdd_info("TDLS ctx is null, ignore roamResult (%d)", + roamResult); return status; } @@ -3722,7 +3691,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, case eCSR_ROAM_RESULT_ADD_TDLS_PEER: { if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) { - hddLog(LOGE, FL("Add Sta failed. status code(=%d)"), + hdd_err("Add Sta failed. status code(=%d)", pRoamInfo->statusCode); } else { /* @@ -3741,10 +3710,9 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, pHddCtx->tdlsConnInfo[staIdx]. staId = pRoamInfo->staId; - hddLog(LOGW, - ("TDLS: STA IDX at %d is %d " + hdd_warn("TDLS: STA IDX at %d is %d " "of mac " - MAC_ADDRESS_STR), + MAC_ADDRESS_STR, staIdx, pHddCtx-> tdlsConnInfo[staIdx]. @@ -3769,8 +3737,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, peerMac.bytes, pRoamInfo-> staId)) { - hddLog(LOGE, - "wlan_hdd_tdls_set_sta_id() failed"); + hdd_err("wlan_hdd_tdls_set_sta_id() failed"); return QDF_STATUS_E_FAILURE; } @@ -3789,8 +3756,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, ucastSig); } else { status = QDF_STATUS_E_FAILURE; - hddLog(LOGE, - FL("no available slot in conn_info. staId %d cannot be stored"), + hdd_err("no available slot in conn_info. staId %d cannot be stored", pRoamInfo->staId); } pAdapter->tdlsAddStaStatus = status; @@ -3801,8 +3767,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, case eCSR_ROAM_RESULT_UPDATE_TDLS_PEER: { if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) { - hddLog(LOGE, - FL("Add Sta failed. status code(=%d)"), + hdd_err("Add Sta failed. status code(=%d)", pRoamInfo->statusCode); } /* store the ucast signature which will be used later when @@ -3815,8 +3780,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, case eCSR_ROAM_RESULT_LINK_ESTABLISH_REQ_RSP: { if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) { - hddLog(LOGE, - FL("Link Establish Request failed. status(=%d)"), + hdd_err("Link Establish Request failed. status(=%d)", pRoamInfo->statusCode); } complete(&pAdapter->tdls_link_establish_req_comp); @@ -3830,9 +3794,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, pRoamInfo->sessionId) && pRoamInfo->staId == pHddCtx->tdlsConnInfo[staIdx].staId) { - hddLog(LOGW, - ("HDD: del STA IDX = %x"), - pRoamInfo->staId); + hdd_warn("HDD: del STA IDX = %x", + pRoamInfo->staId); curr_peer = wlan_hdd_tdls_find_peer(pAdapter, @@ -3876,8 +3839,7 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, break; case eCSR_ROAM_RESULT_TEARDOWN_TDLS_PEER_IND: { - hddLog(LOGE, - FL("Sending teardown to supplicant with reason code %u"), + hdd_err("Sending teardown to supplicant with reason code %u", pRoamInfo->reasonCode); curr_peer = @@ -3898,16 +3860,15 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, if ((pHddCtx->tdlsConnInfo[staIdx].sessionId == pRoamInfo->sessionId) && pHddCtx->tdlsConnInfo[staIdx].staId) { - hddLog(LOGW, - ("hdd_tdlsStatusUpdate: staIdx %d " - MAC_ADDRESS_STR), - pHddCtx->tdlsConnInfo[staIdx]. - staId, - MAC_ADDR_ARRAY(pHddCtx-> - tdlsConnInfo - [staIdx]. - peerMac. - bytes)); + hdd_warn("hdd_tdlsStatusUpdate: staIdx %d " + MAC_ADDRESS_STR, + pHddCtx->tdlsConnInfo[staIdx]. + staId, + MAC_ADDR_ARRAY(pHddCtx-> + tdlsConnInfo + [staIdx]. + peerMac. + bytes)); wlan_hdd_tdls_reset_peer(pAdapter, pHddCtx-> tdlsConnInfo @@ -3933,12 +3894,11 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, smeTdlsPeerStateParams.peerState = eSME_TDLS_PEER_STATE_TEARDOWN; - hddLog(LOG1, - FL("calling sme_update_tdls_peer_state for staIdx %d " - MAC_ADDRESS_STR), - pHddCtx->tdlsConnInfo[staIdx]. - staId, - MAC_ADDR_ARRAY(pHddCtx-> + hdd_info("calling sme_update_tdls_peer_state for staIdx %d " + MAC_ADDRESS_STR, + pHddCtx->tdlsConnInfo[staIdx]. + staId, + MAC_ADDR_ARRAY(pHddCtx-> tdlsConnInfo [staIdx]. peerMac. @@ -3948,13 +3908,12 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, pHddCtx->hHal, &smeTdlsPeerStateParams); if (QDF_STATUS_SUCCESS != status) { - hddLog(LOGE, - FL("sme_update_tdls_peer_state failed for " - MAC_ADDRESS_STR), - MAC_ADDR_ARRAY - (pHddCtx-> - tdlsConnInfo[staIdx]. - peerMac.bytes)); + hdd_err("sme_update_tdls_peer_state failed for " + MAC_ADDRESS_STR, + MAC_ADDR_ARRAY + (pHddCtx-> + tdlsConnInfo[staIdx]. + peerMac.bytes)); } wlan_hdd_tdls_decrement_peer_count (pAdapter); @@ -3992,13 +3951,12 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, pRoamInfo->peerMac.bytes, true); if (!curr_peer) { - hddLog(LOGE, FL("curr_peer is null")); + hdd_err("curr_peer is null"); status = QDF_STATUS_E_FAILURE; } else { if (eTDLS_LINK_CONNECTED == curr_peer->link_status) { - hddLog(LOGE, - FL("TDLS link status is connected, ignore SHOULD_DISCOVER")); + hdd_err("TDLS link status is connected, ignore SHOULD_DISCOVER"); } else { /* * If external control is enabled then initiate @@ -4009,15 +3967,11 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, fTDLSExternalControl && (false == curr_peer->isForcedPeer)) { - hddLog(LOG2, - FL - ("TDLS ExternalControl enabled but curr_peer is not forced, ignore SHOULD_DISCOVER")); + hdd_info("TDLS ExternalControl enabled but curr_peer is not forced, ignore SHOULD_DISCOVER"); status = QDF_STATUS_SUCCESS; break; } else { - hddLog(LOG2, - FL - ("initiate TDLS setup on SHOULD_DISCOVER, fTDLSExternalControl: %d, curr_peer->isForcedPeer: %d, reason: %d"), + hdd_info("initiate TDLS setup on SHOULD_DISCOVER, fTDLSExternalControl: %d, curr_peer->isForcedPeer: %d, reason: %d", pHddCtx->config-> fTDLSExternalControl, curr_peer->isForcedPeer, @@ -4037,20 +3991,18 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac.bytes, true); if (!curr_peer) { - hddLog(LOGE, FL("curr_peer is null")); + hdd_err("curr_peer is null"); status = QDF_STATUS_E_FAILURE; } else { if (eTDLS_LINK_CONNECTED == curr_peer->link_status) { - hddLog(LOGE, - FL - ("Received SHOULD_TEARDOWN for peer " - MAC_ADDRESS_STR - " staId: %d, reason: %d"), - MAC_ADDR_ARRAY(pRoamInfo-> - peerMac.bytes), - pRoamInfo->staId, - pRoamInfo->reasonCode); + hdd_err("Received SHOULD_TEARDOWN for peer " + MAC_ADDRESS_STR + " staId: %d, reason: %d", + MAC_ADDR_ARRAY(pRoamInfo-> + peerMac.bytes), + pRoamInfo->staId, + pRoamInfo->reasonCode); if (pRoamInfo->reasonCode == eWNI_TDLS_TEARDOWN_REASON_RSSI || @@ -4073,10 +4025,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, eTDLS_TEARDOWN_BSS_DISCONNECT, curr_peer->peerMac); } else { - hddLog(LOGE, - FL - ("TDLS link is not connected, ignore SHOULD_TEARDOWN, reason: %d"), - pRoamInfo->reasonCode); + hdd_err("TDLS link is not connected, ignore SHOULD_TEARDOWN, reason: %d", + pRoamInfo->reasonCode); } status = QDF_STATUS_SUCCESS; } @@ -4089,19 +4039,17 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, wlan_hdd_tdls_find_peer(pAdapter, pRoamInfo->peerMac.bytes, true); if (!curr_peer) { - hddLog(LOGE, FL("curr_peer is null")); + hdd_err("curr_peer is null"); status = QDF_STATUS_E_FAILURE; } else { if (eTDLS_LINK_CONNECTED == curr_peer->link_status) { - hddLog(LOGE, - FL - ("Received SHOULD_PEER_DISCONNECTED for peer " - MAC_ADDRESS_STR - " staId: %d, reason: %d"), - MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes), - pRoamInfo->staId, - pRoamInfo->reasonCode); + hdd_err("Received SHOULD_PEER_DISCONNECTED for peer " + MAC_ADDRESS_STR + " staId: %d, reason: %d", + MAC_ADDR_ARRAY(pRoamInfo->peerMac.bytes), + pRoamInfo->staId, + pRoamInfo->reasonCode); if (pRoamInfo->reasonCode == eWNI_TDLS_TEARDOWN_REASON_RSSI || @@ -4124,10 +4072,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, eTDLS_TEARDOWN_BSS_DISCONNECT, curr_peer->peerMac); } else { - hddLog(LOGE, - FL - ("TDLS link is not connected, ignore SHOULD_PEER_DISCONNECTED, reason: %d"), - pRoamInfo->reasonCode); + hdd_err("TDLS link is not connected, ignore SHOULD_PEER_DISCONNECTED, reason: %d", + pRoamInfo->reasonCode); } status = QDF_STATUS_SUCCESS; } @@ -4169,32 +4115,32 @@ hdd_indicate_unprot_mgmt_frame(hdd_adapter_t *pAdapter, uint32_t nFrameLength, uint8_t type = 0; uint8_t subType = 0; - hddLog(LOG1, FL("Frame Type = %d Frame Length = %d"), - frameType, nFrameLength); + hdd_info("Frame Type = %d Frame Length = %d", + frameType, nFrameLength); /* Sanity Checks */ if (NULL == pAdapter) { - hddLog(LOGE, FL("pAdapter is NULL")); + hdd_err("pAdapter is NULL"); return; } if (NULL == pAdapter->dev) { - hddLog(LOGE, FL("pAdapter->dev is NULL")); + hdd_err("pAdapter->dev is NULL"); return; } if (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic) { - hddLog(LOGE, FL("pAdapter has invalid magic")); + hdd_err("pAdapter has invalid magic"); return; } if (!nFrameLength) { - hddLog(LOGE, FL("Frame Length is Invalid ZERO")); + hdd_err("Frame Length is Invalid ZERO"); return; } if (NULL == pbFrames) { - hddLog(LOGE, FL("pbFrames is NULL")); + hdd_err("pbFrames is NULL"); return; } @@ -4222,8 +4168,8 @@ hdd_indicate_unprot_mgmt_frame(hdd_adapter_t *pAdapter, uint32_t nFrameLength, #endif pAdapter->hdd_stats.hddPmfStats.numUnprotDeauthRx++; } else { - hddLog(LOGE, FL("Frame type %d and subtype %d are not valid"), - type, subType); + hdd_err("Frame type %d and subtype %d are not valid", + type, subType); return; } } @@ -4257,8 +4203,8 @@ hdd_indicate_tsm_ie(hdd_adapter_t *pAdapter, uint8_t tid, memset(&wrqu, '\0', sizeof(wrqu)); memset(buf, '\0', sizeof(buf)); - hddLog(LOG1, "TSM Ind tid(%d) state(%d) MeasInt(%d)", - tid, state, measInterval); + hdd_info("TSM Ind tid(%d) state(%d) MeasInt(%d)", + tid, state, measInterval); nBytes = snprintf(buf, IW_CUSTOM_MAX, "TSMIE=%d:%d:%d", tid, state, @@ -4296,10 +4242,9 @@ hdd_indicate_cckm_pre_auth(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo) memset(buf, '\0', sizeof(buf)); /* Timestamp0 is lower 32 bits and Timestamp1 is upper 32 bits */ - hddLog(LOG1, - "CCXPREAUTHNOTIFY=" MAC_ADDRESS_STR " %d:%d", - MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes), - pRoamInfo->timestamp[0], pRoamInfo->timestamp[1]); + hdd_info("CCXPREAUTHNOTIFY=" MAC_ADDRESS_STR " %d:%d", + MAC_ADDR_ARRAY(pRoamInfo->bssid.bytes), + pRoamInfo->timestamp[0], pRoamInfo->timestamp[1]); nBytes = snprintf(pos, freeBytes, "CCXPREAUTHNOTIFY="); pos += nBytes; @@ -4342,7 +4287,7 @@ hdd_indicate_ese_adj_ap_rep_ind(hdd_adapter_t *pAdapter, memset(&wrqu, '\0', sizeof(wrqu)); memset(buf, '\0', sizeof(buf)); - hddLog(LOG1, "CCXADJAPREP=%u", pRoamInfo->tsmRoamDelay); + hdd_info("CCXADJAPREP=%u", pRoamInfo->tsmRoamDelay); nBytes = snprintf(buf, IW_CUSTOM_MAX, "CCXADJAPREP=%u", @@ -4380,8 +4325,8 @@ hdd_indicate_ese_bcn_report_no_results(const hdd_adapter_t *pAdapter, memset(&wrqu, '\0', sizeof(wrqu)); memset(buf, '\0', sizeof(buf)); - hddLog(LOG1, FL("CCXBCNREP=%d %d %d"), measurementToken, - flag, numBss); + hdd_info("CCXBCNREP=%d %d %d", measurementToken, + flag, numBss); nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d", measurementToken, @@ -4439,8 +4384,7 @@ hdd_indicate_ese_bcn_report_ind(const hdd_adapter_t *pAdapter, if ((pRoamInfo->pEseBcnReportRsp->flag >> 1) && (!pRoamInfo->pEseBcnReportRsp->numBss)) { - hddLog(LOG1, - "Measurement Done but no scan results"); + hdd_info("Measurement Done but no scan results"); /* If the measurement is none and no scan results found, indicate the supplicant about measurement done */ hdd_indicate_ese_bcn_report_no_results( @@ -4470,18 +4414,17 @@ hdd_indicate_ese_bcn_report_ind(const hdd_adapter_t *pAdapter, } tot_bcn_ieLen += len; sendBss++; - hddLog(LOG1, "i(%d) sizeof bcnReportFields(%d) IeLength(%d) Length of Ie(%d) totLen(%d)", - i, bcnRepFieldSize, 1, - pRoamInfo->pEseBcnReportRsp-> - bcnRepBssInfo[i].ieLen, tot_bcn_ieLen); + hdd_info("i(%d) sizeof bcnReportFields(%d) IeLength(%d) Length of Ie(%d) totLen(%d)", + i, bcnRepFieldSize, 1, + pRoamInfo->pEseBcnReportRsp-> + bcnRepBssInfo[i].ieLen, tot_bcn_ieLen); } - hddLog(LOG1, "Sending %d BSS Info", - sendBss); - hddLog(LOG1, "CCXBCNREP=%d %d %d %d", - pRoamInfo->pEseBcnReportRsp->measurementToken, - pRoamInfo->pEseBcnReportRsp->flag, sendBss, - tot_bcn_ieLen); + hdd_info("Sending %d BSS Info", sendBss); + hdd_info("CCXBCNREP=%d %d %d %d", + pRoamInfo->pEseBcnReportRsp->measurementToken, + pRoamInfo->pEseBcnReportRsp->flag, sendBss, + tot_bcn_ieLen); nBytes = snprintf(pos, freeBytes, "CCXBCNREP=%d %d %d ", pRoamInfo->pEseBcnReportRsp-> @@ -4498,8 +4441,7 @@ hdd_indicate_ese_bcn_report_ind(const hdd_adapter_t *pAdapter, freeBytes -= sizeof(tot_bcn_ieLen); for (i = 0; i < sendBss; i++) { - hddLog(LOG1, - "ChanNum(%d) Spare(%d) MeasDuration(%d)" + hdd_info("ChanNum(%d) Spare(%d) MeasDuration(%d)" " PhyType(%d) RecvSigPower(%d) ParentTSF(%u)" " TargetTSF[0](%u) TargetTSF[1](%u) BeaconInterval(%u)" " CapabilityInfo(%d) BSSID(%02X:%02X:%02X:%02X:%02X:%02X)", @@ -4657,13 +4599,12 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, struct hdd_chan_change_params chan_change; struct cfg80211_bss *bss_status; - hddLog(LOG2, - "CSR Callback: status= %d result= %d roamID=%d", - roamStatus, roamResult, roamId); + hdd_info("CSR Callback: status= %d result= %d roamID=%d", + roamStatus, roamResult, roamId); /* Sanity check */ if ((NULL == pAdapter) || (WLAN_HDD_ADAPTER_MAGIC != pAdapter->magic)) { - hddLog(LOGP, "invalid adapter or adapter has invalid magic"); + hdd_alert("invalid adapter or adapter has invalid magic"); return QDF_STATUS_E_FAILURE; } @@ -4687,10 +4628,8 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, * interface down. */ case eCSR_ROAM_FT_REASSOC_FAILED: - hddLog(LOGE, - FL - ("Reassoc Failed with roamStatus: %d roamResult: %d SessionID: %d"), - roamStatus, roamResult, pAdapter->sessionId); + hdd_err("Reassoc Failed with roamStatus: %d roamResult: %d SessionID: %d", + roamStatus, roamResult, pAdapter->sessionId); qdf_ret_status = hdd_dis_connect_handler(pAdapter, pRoamInfo, roamId, roamStatus, roamResult); @@ -4705,9 +4644,8 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, } pHddStaCtx->ft_carrier_on = false; pHddStaCtx->hdd_ReassocScenario = false; - hddLog(LOG1, - FL("hdd_ReassocScenario set to: %d, ReAssoc Failed, session: %d"), - pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); + hdd_info("hdd_ReassocScenario set to: %d, ReAssoc Failed, session: %d", + pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); break; case eCSR_ROAM_FT_START: @@ -4720,7 +4658,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, * doing disassoc at this time. This saves 30-60 msec * after reassoc. */ - hddLog(LOG1, FL("Disabling queues")); + hdd_info("Disabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE, WLAN_CONTROL_PATH); @@ -4730,13 +4668,12 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, qdf_ret_status = QDF_STATUS_E_FAILURE; pHddStaCtx->ft_carrier_on = true; pHddStaCtx->hdd_ReassocScenario = true; - hddLog(LOG1, - FL("hdd_ReassocScenario set to: %d, due to eCSR_ROAM_FT_START, session: %d"), - pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); + hdd_info("hdd_ReassocScenario set to: %d, due to eCSR_ROAM_FT_START, session: %d", + pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); break; case eCSR_ROAM_SHOULD_ROAM: /* notify apps that we can't pass traffic anymore */ - hddLog(LOG1, FL("Disabling queues")); + hdd_info("Disabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE, WLAN_CONTROL_PATH); @@ -4748,8 +4685,8 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, break; case eCSR_ROAM_LOSTLINK: if (roamResult == eCSR_ROAM_RESULT_LOSTLINK) { - hddLog(LOG2, "Roaming started due to connection lost"); - hddLog(LOG1, FL("Disabling queues")); + hdd_info("Roaming started due to connection lost"); + hdd_info("Disabling queues"); wlan_hdd_netif_queue_control(pAdapter, WLAN_NETIF_TX_DISABLE_N_CARRIER, WLAN_CONTROL_PATH); @@ -4757,7 +4694,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, } case eCSR_ROAM_DISASSOCIATED: { - hddLog(LOG1, "****eCSR_ROAM_DISASSOCIATED****"); + hdd_info("****eCSR_ROAM_DISASSOCIATED****"); qdf_ret_status = hdd_dis_connect_handler(pAdapter, pRoamInfo, roamId, roamStatus, roamResult); @@ -4775,13 +4712,10 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, false; } - hddLog(LOG1, - "offload: disassociation happening, restoring configuredMcastBcastFilter"); - hddLog(LOG1, - "McastBcastFilter = %d", - pHddCtx->configuredMcastBcastFilter); - hddLog(LOG1, - "offload: already called mcastbcast filter"); + hdd_info("offload: disassociation happening, restoring configuredMcastBcastFilter"); + hdd_info("McastBcastFilter = %d", + pHddCtx->configuredMcastBcastFilter); + hdd_info("offload: already called mcastbcast filter"); (WLAN_HDD_GET_CTX(pAdapter))-> hdd_mcastbcast_filter_set = false; } @@ -4792,13 +4726,13 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, } break; case eCSR_ROAM_IBSS_LEAVE: - hddLog(LOG1, "****eCSR_ROAM_IBSS_LEAVE****"); + hdd_info("****eCSR_ROAM_IBSS_LEAVE****"); qdf_ret_status = hdd_dis_connect_handler(pAdapter, pRoamInfo, roamId, roamStatus, roamResult); break; case eCSR_ROAM_ASSOCIATION_COMPLETION: - hddLog(LOG1, "****eCSR_ROAM_ASSOCIATION_COMPLETION****"); + hdd_info("****eCSR_ROAM_ASSOCIATION_COMPLETION****"); /* * To Do - address probable memory leak with WEP encryption upon * successful association. @@ -4857,8 +4791,7 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, roamResult); if (eCSR_ROAM_RESULT_AUTHENTICATED == roamResult) { pHddStaCtx->hdd_ReassocScenario = false; - hddLog(LOG1, - FL("hdd_ReassocScenario set to: %d, set key complete, session: %d"), + hdd_info("hdd_ReassocScenario set to: %d, set key complete, session: %d", pHddStaCtx->hdd_ReassocScenario, pAdapter->sessionId); } @@ -5101,7 +5034,7 @@ eCsrAuthType hdd_translate_wpa_to_csr_auth_type(uint8_t auth_suite[4]) { auth_type = eCSR_AUTH_TYPE_UNKNOWN; } - hddLog(LOG1, FL("auth_type: %d"), auth_type); + hdd_info("auth_type: %d", auth_type); return auth_type; } @@ -5130,7 +5063,7 @@ hdd_translate_rsn_to_csr_encryption_type(uint8_t cipher_suite[4]) else cipher_type = eCSR_ENCRYPT_TYPE_FAILED; - hddLog(LOG1, FL("cipher_type: %d"), cipher_type); + hdd_info("cipher_type: %d", cipher_type); return cipher_type; } @@ -5159,7 +5092,7 @@ hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4]) else cipher_type = eCSR_ENCRYPT_TYPE_FAILED; - hddLog(LOG1, FL("cipher_type: %d"), cipher_type); + hdd_info("cipher_type: %d", cipher_type); return cipher_type; } @@ -5205,8 +5138,8 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, /* Validity checks */ if ((gen_ie_len < DOT11F_IE_RSN_MIN_LEN) || (gen_ie_len > DOT11F_IE_RSN_MAX_LEN)) { - hddLog(LOGE, FL("Invalid DOT11F RSN IE length :%d"), - gen_ie_len); + hdd_err("Invalid DOT11F RSN IE length :%d", + gen_ie_len); return -EINVAL; } /* Skip past the EID byte and length byte */ @@ -5216,10 +5149,10 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, dot11f_unpack_ie_rsn((tpAniSirGlobal) halHandle, pRsnIe, RSNIeLen, &dot11RSNIE); /* Copy out the encryption and authentication types */ - hddLog(LOG1, FL("pairwise cipher suite count: %d"), - dot11RSNIE.pwise_cipher_suite_count); - hddLog(LOG1, FL("authentication suite count: %d"), - dot11RSNIE.akm_suite_count); + hdd_info("pairwise cipher suite count: %d", + dot11RSNIE.pwise_cipher_suite_count); + hdd_info("authentication suite count: %d", + dot11RSNIE.akm_suite_count); /*Here we have followed the apple base code, but probably I suspect we can do something different */ /* dot11RSNIE.akm_suite_count */ @@ -5242,7 +5175,7 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, /* Set the PMKSA ID Cache for this interface */ for (i = 0; i < dot11RSNIE.pmkid_count; i++) { if (is_zero_ether_addr(bssid)) { - hddLog(LOGE, FL("MAC address is all zeroes")); + hdd_err("MAC address is all zeroes"); break; } updatePMKCache = true; @@ -5261,9 +5194,8 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, * Calling csr_roam_set_pmkid_cache to configure the * PMKIDs into the cache. */ - hddLog(LOG1, - FL("Calling sme_roam_set_pmkid_cache with cache entry %d."), - i); + hdd_info("Calling sme_roam_set_pmkid_cache with cache entry %d.", + i); /* Finally set the PMKSA ID Cache in CSR */ result = sme_roam_set_pmkid_cache(halHandle, @@ -5276,8 +5208,8 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, /* Validity checks */ if ((gen_ie_len < DOT11F_IE_WPA_MIN_LEN) || (gen_ie_len > DOT11F_IE_WPA_MAX_LEN)) { - hddLog(LOGE, FL("Invalid DOT11F WPA IE length :%d"), - gen_ie_len); + hdd_err("Invalid DOT11F WPA IE length :%d", + gen_ie_len); return -EINVAL; } /* Skip past the EID and length byte - and four byte WiFi OUI */ @@ -5287,10 +5219,10 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, dot11f_unpack_ie_wpa((tpAniSirGlobal) halHandle, pRsnIe, RSNIeLen, &dot11WPAIE); /* Copy out the encryption and authentication types */ - hddLog(LOG1, FL("WPA unicast cipher suite count: %d"), - dot11WPAIE.unicast_cipher_count); - hddLog(LOG1, FL("WPA authentication suite count: %d"), - dot11WPAIE.auth_suite_count); + hdd_info("WPA unicast cipher suite count: %d", + dot11WPAIE.unicast_cipher_count); + hdd_info("WPA authentication suite count: %d", + dot11WPAIE.auth_suite_count); /* dot11WPAIE.auth_suite_count */ /* Just translate the FIRST one */ *pAuthType = @@ -5305,7 +5237,7 @@ static int32_t hdd_process_genie(hdd_adapter_t *pAdapter, hdd_translate_wpa_to_csr_encryption_type( dot11WPAIE.multicast_cipher); } else { - hddLog(LOGW, FL("gen_ie[0]: %d"), gen_ie[0]); + hdd_warn("gen_ie[0]: %d", gen_ie[0]); return -EINVAL; } return 0; @@ -5378,14 +5310,13 @@ int hdd_set_genie_to_csr(hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType) = mcRSNEncryptType; } #ifdef WLAN_FEATURE_11W - hddLog(LOG1, FL("RSNMfpRequired = %d, RSNMfpCapable = %d"), - RSNMfpRequired, RSNMfpCapable); + hdd_info("RSNMfpRequired = %d, RSNMfpCapable = %d", + RSNMfpRequired, RSNMfpCapable); pWextState->roamProfile.MFPRequired = RSNMfpRequired; pWextState->roamProfile.MFPCapable = RSNMfpCapable; #endif - hddLog(LOG1, - FL("CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d"), - *RSNAuthType, RSNEncryptType, mcRSNEncryptType); + hdd_info("CSR AuthType = %d, EncryptionType = %d mcEncryptionType = %d", + *RSNAuthType, RSNEncryptType, mcRSNEncryptType); } return 0; } @@ -5404,8 +5335,8 @@ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); pRoamProfile->AuthType.numEntries = 1; - hddLog(LOG1, FL("pHddStaCtx->conn_info.authType = %d"), - pHddStaCtx->conn_info.authType); + hdd_info("pHddStaCtx->conn_info.authType = %d", + pHddStaCtx->conn_info.authType); switch (pHddStaCtx->conn_info.authType) { case eCSR_AUTH_TYPE_OPEN_SYSTEM: @@ -5423,13 +5354,11 @@ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA) && ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) == IW_AUTH_KEY_MGMT_802_1X)) { - hddLog(LOG1, - FL("set authType to CCKM WPA. AKM also 802.1X.")); + hdd_info("set authType to CCKM WPA. AKM also 802.1X."); pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_WPA; } else if (RSNAuthType == eCSR_AUTH_TYPE_CCKM_WPA) { - hddLog(LOG1, - FL("Last chance to set authType to CCKM WPA.")); + hdd_info("Last chance to set authType to CCKM WPA."); pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_WPA; } else @@ -5454,13 +5383,11 @@ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) if ((RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN) && ((pWextState->authKeyMgmt & IW_AUTH_KEY_MGMT_802_1X) == IW_AUTH_KEY_MGMT_802_1X)) { - hddLog(LOG1, - FL("set authType to CCKM RSN. AKM also 802.1X.")); + hdd_info("set authType to CCKM RSN. AKM also 802.1X."); pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_RSN; } else if (RSNAuthType == eCSR_AUTH_TYPE_CCKM_RSN) { - hddLog(LOG1, - FL("Last chance to set authType to CCKM RSN.")); + hdd_info("Last chance to set authType to CCKM RSN."); pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_CCKM_RSN; } else @@ -5516,14 +5443,14 @@ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType) default: #ifdef FEATURE_WLAN_ESE - hddLog(LOG1, FL("In default, unknown auth type.")); + hdd_info("In default, unknown auth type."); #endif /* FEATURE_WLAN_ESE */ pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_UNKNOWN; break; } - hddLog(LOG1, FL("Set roam Authtype to %d"), - pWextState->roamProfile.AuthType.authType[0]); + hdd_info("Set roam Authtype to %d", + pWextState->roamProfile.AuthType.authType[0]); return 0; } @@ -5565,16 +5492,16 @@ static int __iw_set_essid(struct net_device *dev, if (pAdapter->device_mode != QDF_STA_MODE && pAdapter->device_mode != QDF_P2P_CLIENT_MODE) { - hddLog(LOGW, FL("device mode %s(%d) is not allowed"), - hdd_device_mode_to_string(pAdapter->device_mode), - pAdapter->device_mode); + hdd_warn("device mode %s(%d) is not allowed", + hdd_device_mode_to_string(pAdapter->device_mode), + pAdapter->device_mode); return -EINVAL; } pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); if (pWextState->mTKIPCounterMeasures == TKIP_COUNTER_MEASURE_STARTED) { - hddLog(LOG2, FL("Counter measure is in progress")); + hdd_info("Counter measure is in progress"); return -EBUSY; } if (SIR_MAC_MAX_SSID_LENGTH < wrqu->essid.length) @@ -5597,7 +5524,7 @@ static int __iw_set_essid(struct net_device *dev, msecs_to_jiffies (WLAN_WAIT_TIME_DISCONNECT)); if (!rc) - hddLog(LOGE, FL("Disconnect event timed out")); + hdd_err("Disconnect event timed out"); } } @@ -5634,13 +5561,13 @@ static int __iw_set_essid(struct net_device *dev, hdd_set_csr_auth_type(pAdapter, RSNAuthType); } #ifdef FEATURE_WLAN_WAPI - hddLog(LOG1, FL("Setting WAPI AUTH Type and Encryption Mode values")); + hdd_notice("Setting WAPI AUTH Type and Encryption Mode values"); if (pAdapter->wapi_info.nWapiMode) { switch (pAdapter->wapi_info.wapiAuthMode) { case WAPI_AUTH_MODE_PSK: { - hddLog(LOG1, FL("WAPI AUTH TYPE: PSK: %d"), - pAdapter->wapi_info.wapiAuthMode); + hdd_notice("WAPI AUTH TYPE: PSK: %d", + pAdapter->wapi_info.wapiAuthMode); pRoamProfile->AuthType.numEntries = 1; pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WAPI_WAI_PSK; @@ -5648,8 +5575,8 @@ static int __iw_set_essid(struct net_device *dev, } case WAPI_AUTH_MODE_CERT: { - hddLog(LOG1, FL("WAPI AUTH TYPE: CERT: %d"), - pAdapter->wapi_info.wapiAuthMode); + hdd_notice("WAPI AUTH TYPE: CERT: %d", + pAdapter->wapi_info.wapiAuthMode); pRoamProfile->AuthType.numEntries = 1; pRoamProfile->AuthType.authType[0] = eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE; @@ -5658,7 +5585,7 @@ static int __iw_set_essid(struct net_device *dev, } /* End of switch */ if (pAdapter->wapi_info.wapiAuthMode == WAPI_AUTH_MODE_PSK || pAdapter->wapi_info.wapiAuthMode == WAPI_AUTH_MODE_CERT) { - hddLog(LOG1, FL("WAPI PAIRWISE/GROUP ENCRYPTION: WPI")); + hdd_notice("WAPI PAIRWISE/GROUP ENCRYPTION: WPI"); pRoamProfile->EncryptionType.numEntries = 1; pRoamProfile->EncryptionType.encryptionType[0] = eCSR_ENCRYPT_TYPE_WPI; @@ -5908,8 +5835,8 @@ static int __iw_set_auth(struct net_device *dev, struct iw_request_info *info, ucEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; } else { - hddLog(LOGW, FL("value %d UNKNOWN IW_AUTH_CIPHER"), - wrqu->param.value); + hdd_warn("value %d UNKNOWN IW_AUTH_CIPHER", + wrqu->param.value); return -EINVAL; } @@ -5953,7 +5880,7 @@ static int __iw_set_auth(struct net_device *dev, struct iw_request_info *info, eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; } } else { - hddLog(LOGW, FL("value %d UNKNOWN IW_AUTH_CIPHER"), + hdd_warn("value %d UNKNOWN IW_AUTH_CIPHER", wrqu->param.value); return -EINVAL; } @@ -5991,7 +5918,7 @@ static int __iw_set_auth(struct net_device *dev, struct iw_request_info *info, #define IW_AUTH_KEY_MGMT_CCKM 8 /* Should be in linux/wireless.h */ /*Check for CCKM AKM type */ if (wrqu->param.value & IW_AUTH_KEY_MGMT_CCKM) { - hddLog(LOG1, FL("CCKM AKM Set %d"), wrqu->param.value); + hdd_info("CCKM AKM Set %d", wrqu->param.value); /* Set the CCKM bit in authKeyMgmt */ /* * Right now, this breaks all ref to authKeyMgmt because @@ -6035,14 +5962,12 @@ static int __iw_set_auth(struct net_device *dev, struct iw_request_info *info, case IW_AUTH_TKIP_COUNTERMEASURES: { if (wrqu->param.value) { - hddLog(LOG2, - "Counter Measure started %d", + hdd_info("Counter Measure started %d", wrqu->param.value); pWextState->mTKIPCounterMeasures = TKIP_COUNTER_MEASURE_STARTED; } else { - hddLog(LOG2, - "Counter Measure stopped=%d", + hdd_info("Counter Measure stopped=%d", wrqu->param.value); pWextState->mTKIPCounterMeasures = TKIP_COUNTER_MEASURE_STOPED; @@ -6057,8 +5982,8 @@ static int __iw_set_auth(struct net_device *dev, struct iw_request_info *info, default: - hddLog(LOGW, FL("called with unsupported auth type %d"), - wrqu->param.flags & IW_AUTH_INDEX); + hdd_warn("called with unsupported auth type %d", + wrqu->param.flags & IW_AUTH_INDEX); break; } @@ -6134,14 +6059,14 @@ static int __iw_get_auth(struct net_device *dev, struct iw_request_info *info, wrqu->param.value = IW_AUTH_ALG_SHARED_KEY; break; case eCSR_AUTH_TYPE_UNKNOWN: - hddLog(LOG1, FL("called with unknown auth type")); + hdd_info("called with unknown auth type"); wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; break; case eCSR_AUTH_TYPE_AUTOSWITCH: wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; break; case eCSR_AUTH_TYPE_WPA_PSK: - hddLog(LOG1, FL("called with WPA PSK auth type")); + hdd_info("called with WPA PSK auth type"); wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; return -EIO; @@ -6151,11 +6076,11 @@ static int __iw_get_auth(struct net_device *dev, struct iw_request_info *info, case eCSR_AUTH_TYPE_RSN_PSK_SHA256: case eCSR_AUTH_TYPE_RSN_8021X_SHA256: #endif - hddLog(LOG1, FL("called with RSN PSK auth type")); + hdd_info("called with RSN PSK auth type"); wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; return -EIO; default: - hddLog(LOGE, FL("called with unknown auth type")); + hdd_err("called with unknown auth type"); wrqu->param.value = IW_AUTH_ALG_OPEN_SYSTEM; return -EIO; } @@ -6179,8 +6104,8 @@ static int __iw_get_auth(struct net_device *dev, struct iw_request_info *info, wrqu->param.value = IW_AUTH_CIPHER_CCMP; break; default: - hddLog(LOG1, FL("called with unknown auth type %d"), - pRoamProfile->negotiatedUCEncryptionType); + hdd_notice("called with unknown auth type %d", + pRoamProfile->negotiatedUCEncryptionType); return -EIO; } } @@ -6205,14 +6130,14 @@ static int __iw_get_auth(struct net_device *dev, struct iw_request_info *info, wrqu->param.value = IW_AUTH_CIPHER_CCMP; break; default: - hddLog(LOG1, FL("called with unknown auth type %d"), - pRoamProfile->negotiatedMCEncryptionType); + hdd_info("called with unknown auth type %d", + pRoamProfile->negotiatedMCEncryptionType); return -EIO; } } - hddLog(LOG1, FL("called with auth type %d"), - pRoamProfile->AuthType.authType[0]); + hdd_info("called with auth type %d", + pRoamProfile->AuthType.authType[0]); EXIT(); return 0; } @@ -6272,7 +6197,7 @@ static int __iw_set_ap_address(struct net_device *dev, return ret; pMacAddress = (uint8_t *) wrqu->ap_addr.sa_data; - hddLog(LOG1, FL(" " MAC_ADDRESS_STR), MAC_ADDR_ARRAY(pMacAddress)); + hdd_info(" " MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pMacAddress)); qdf_mem_copy(pHddStaCtx->conn_info.bssId.bytes, pMacAddress, sizeof(struct qdf_mac_addr)); EXIT(); From 55780b5599ef7dbc61cd09009c91d67f3120dfbe Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 13:54:07 -0700 Subject: [PATCH 004/113] Release 5.1.0.29L Release 5.1.0.29L Change-Id: Id70f535bab06f14d17eb8e774475010768a57481 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c11b0d1c1d6d..60946e9a1bb1 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29K" +#define QWLAN_VERSIONSTR "5.1.0.29L" #endif /* QWLAN_VERSION_H */ From 38f2b5584c1dcf6226ad6b2a7d047d026aa13c6f Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 4 Oct 2016 13:57:46 -0700 Subject: [PATCH 005/113] qcacld-3.0: Fill regulatory info before wiphy init Currently, some regulatory information is being populated after it may be needed by wiphy for initialization. Reorder the order of execution to populate this data before it is needed by wiphy. Change-Id: I218c19c84b6c7f0f62a94b211201281939838438 CRs-Fixed: 1074146 --- core/hdd/src/wlan_hdd_regulatory.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index 69218fba8a9e..bda6e48d4b6d 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -488,18 +488,18 @@ int hdd_regulatory_init(hdd_context_t *hdd_ctx, struct wiphy *wiphy) reg_info = &hdd_ctx->reg; - hdd_regulatory_wiphy_init(hdd_ctx, reg_info, wiphy); - - hdd_process_regulatory_data(hdd_ctx, wiphy, true); - - reg_info->cc_src = SOURCE_DRIVER; - ret_val = cds_fill_some_regulatory_info(reg_info); if (ret_val) { hdd_err("incorrect BDF regulatory data"); return ret_val; } + hdd_regulatory_wiphy_init(hdd_ctx, reg_info, wiphy); + + hdd_process_regulatory_data(hdd_ctx, wiphy, true); + + reg_info->cc_src = SOURCE_DRIVER; + cds_put_default_country(reg_info->alpha2); init_completion(&hdd_ctx->reg_init); From 05910db713702df80ea5116260e833ea824af16c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 5 Oct 2016 15:02:41 -0700 Subject: [PATCH 006/113] Release 5.1.0.29M Release 5.1.0.29M Change-Id: I5a16e164585382540061d911a7afc90d62b06cbf CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 60946e9a1bb1..c5081d7cbae2 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29L" +#define QWLAN_VERSIONSTR "5.1.0.29M" #endif /* QWLAN_VERSION_H */ From b2d1a45a783034beddc500b30ee0f23e507b3bad Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Thu, 5 May 2016 12:23:58 +0530 Subject: [PATCH 007/113] qcacld-3.0: Add support for legacy off channel notification in case of p2p-GO qcacld-2.0 to qcacld-3.0 propagation In this feature, 1) When a legacy client connects to P2P GO, Host will indicate FW to stop NOA and start CTS2SELF. 2) Ini Support for this feature. Change-Id: If76d8ef454633d9a02dd6057b5d6ca3e9e639ea4 CRs-Fixed: 932264 --- core/hdd/inc/wlan_hdd_cfg.h | 11 +++++++++++ core/hdd/src/wlan_hdd_cfg.c | 11 +++++++++++ core/hdd/src/wlan_hdd_main.c | 2 ++ core/mac/src/include/sir_params.h | 2 ++ core/sme/inc/sme_api.h | 7 +++++++ core/sme/src/common/sme_api.c | 25 +++++++++++++++++++++++++ core/wma/inc/wma_api.h | 13 +++++++++++++ core/wma/inc/wma_types.h | 1 + core/wma/src/wma_main.c | 2 ++ core/wma/src/wma_mgmt.c | 28 ++++++++++++++++++++++++++++ 10 files changed, 102 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 9cfeeb3cf36a..c0b065f4b761 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2917,6 +2917,16 @@ enum dot11p_mode { #define CFG_EXTSCAN_ACTIVE_MIN_CHANNEL_TIME_DEFAULT (20) #endif +/* When gEnable_go_cts2self_for_sta is + * enabled then if a legacy client connects to P2P GO, + * Host will send a WMI VDEV command to FW to stop using NOA for P2P GO + * and start using CTS2SELF. + */ +#define CFG_ENABLE_GO_CTS2SELF_FOR_STA "gEnable_go_cts2self_for_sta" +#define CFG_ENABLE_GO_CTS2SELF_FOR_STA_DEFAULT (0) +#define CFG_ENABLE_GO_CTS2SELF_FOR_STA_MIN (0) +#define CFG_ENABLE_GO_CTS2SELF_FOR_STA_MAX (1) + #define CFG_CE_CLASSIFY_ENABLE_NAME "gCEClassifyEnable" #define CFG_CE_CLASSIFY_ENABLE_MIN (0) #define CFG_CE_CLASSIFY_ENABLE_MAX (1) @@ -4152,6 +4162,7 @@ struct hdd_config { /* parameter for indicating sifs burst duration to fw */ uint8_t sifs_burst_duration; bool goptimize_chan_avoid_event; + bool enable_go_cts2self_for_sta; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 4a21c6cbf385..d22a5f8bde3f 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3734,6 +3734,14 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_ENABLE_EDCA_INI_MIN, CFG_ENABLE_EDCA_INI_MAX), + REG_VARIABLE(CFG_ENABLE_GO_CTS2SELF_FOR_STA, WLAN_PARAM_Integer, + struct hdd_config, enable_go_cts2self_for_sta, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_GO_CTS2SELF_FOR_STA_DEFAULT, + CFG_ENABLE_GO_CTS2SELF_FOR_STA_MIN, + CFG_ENABLE_GO_CTS2SELF_FOR_STA_MAX), + REG_VARIABLE(CFG_EDCA_VO_CWMIN_VALUE_NAME, WLAN_PARAM_Integer, struct hdd_config, edca_vo_cwmin, VAR_FLAGS_OPTIONAL | @@ -5646,6 +5654,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%d]", CFG_FILTER_MULTICAST_REPLAY_NAME, pHddCtx->config->multicast_replay_filter); + hdd_info("Name = [%s] Value = [%u]", + CFG_ENABLE_GO_CTS2SELF_FOR_STA, + pHddCtx->config->enable_go_cts2self_for_sta); } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 82be6b96f3f3..47b3c6470000 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7817,6 +7817,8 @@ int hdd_wlan_startup(struct device *dev) hdd_release_rtnl_lock(); rtnl_held = false; + if (hdd_ctx->config->enable_go_cts2self_for_sta) + sme_set_cts2self_for_p2p_go(hdd_ctx->hHal); #ifdef FEATURE_WLAN_AP_AP_ACS_OPTIMIZE status = qdf_mc_timer_init(&hdd_ctx->skip_acs_scan_timer, QDF_TIMER_TYPE_SW, diff --git a/core/mac/src/include/sir_params.h b/core/mac/src/include/sir_params.h index 2b71b5143209..b11343f2be9b 100644 --- a/core/mac/src/include/sir_params.h +++ b/core/mac/src/include/sir_params.h @@ -606,6 +606,7 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_ADD_BCN_FILTER_CMDID (SIR_HAL_ITC_MSG_TYPES_BEGIN + 339) #define SIR_HAL_REMOVE_BCN_FILTER_CMDID (SIR_HAL_ITC_MSG_TYPES_BEGIN + 340) + #define SIR_HAL_BPF_GET_CAPABILITIES_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 341) #define SIR_HAL_BPF_SET_INSTRUCTIONS_REQ (SIR_HAL_ITC_MSG_TYPES_BEGIN + 342) @@ -634,6 +635,7 @@ typedef struct sSirMbMsgP2p { #define SIR_HAL_POWER_DBG_CMD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 362) #define SIR_HAL_SET_DTIM_PERIOD (SIR_HAL_ITC_MSG_TYPES_BEGIN + 363) #define SIR_HAL_ENCRYPT_DECRYPT_MSG (SIR_HAL_ITC_MSG_TYPES_BEGIN + 364) +#define SIR_HAL_SET_CTS2SELF_FOR_STA (SIR_HAL_ITC_MSG_TYPES_BEGIN + 368) #define SIR_HAL_MSG_TYPES_END (SIR_HAL_MSG_TYPES_BEGIN + 0x1FF) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index 15f845510ef9..cfbbe22ec405 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1316,4 +1316,11 @@ QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal); QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal, struct encrypt_decrypt_req_params *encrypt_decrypt_params); +/** + * sme_set_cts2self_for_p2p_go() - sme function to set ini parms to FW. + * @hal: reference to the HAL + * + * Return: QDF_STATUS + */ +QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 57c167a44b1f..738ba4302f88 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -16715,3 +16715,28 @@ QDF_STATUS sme_encrypt_decrypt_msg_deregister_callback(tHalHandle h_hal) } return status; } + +QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal_handle) +{ + cds_msg_t message; + void *wma_handle; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + if (!wma_handle) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "wma_handle is NULL"); + return QDF_STATUS_E_FAILURE; + } + + message.bodyptr = NULL; + message.type = WMA_SET_CTS2SELF_FOR_STA; + + if (QDF_STATUS_SUCCESS != + wma_set_cts2self_for_p2p_go(wma_handle, true)) { + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, + "%s: Failed to set cts2self for p2p GO to firmware", + __func__); + return QDF_STATUS_E_FAILURE; + } + return QDF_STATUS_SUCCESS; +} diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index dcd121e37fdb..ecbead7e438f 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -303,4 +303,17 @@ void wma_process_pdev_hw_mode_trans_ind(void *wma, QDF_STATUS wma_set_powersave_config(uint8_t val); QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma, struct encrypt_decrypt_req_params *encrypt_decrypt_params); + +/** + * wma_set_cts2self_for_p2p_go() - set CTS2SELF command for P2P GO. + * @wma_handle: pointer to wma handle. + * @cts2self_for_p2p_go: value needs to set to firmware. + * + * At the time of driver startup, inform about ini parma to FW that + * if legacy client connects to P2P GO, stop using NOA for P2P GO. + * + * Return: QDF_STATUS. + */ +QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle, + uint32_t cts2self_for_p2p_go); #endif diff --git a/core/wma/inc/wma_types.h b/core/wma/inc/wma_types.h index 89f06c9db0b5..143bc5b53d9a 100644 --- a/core/wma/inc/wma_types.h +++ b/core/wma/inc/wma_types.h @@ -467,6 +467,7 @@ #define WMA_ADD_BCN_FILTER_CMDID SIR_HAL_ADD_BCN_FILTER_CMDID #define WMA_REMOVE_BCN_FILTER_CMDID SIR_HAL_REMOVE_BCN_FILTER_CMDID #define WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS SIR_HAL_SET_ADAPT_DWELLTIME_PARAMS +#define WMA_SET_CTS2SELF_FOR_STA SIR_HAL_SET_CTS2SELF_FOR_STA #define WDA_BPF_GET_CAPABILITIES_REQ SIR_HAL_BPF_GET_CAPABILITIES_REQ #define WDA_BPF_SET_INSTRUCTIONS_REQ SIR_HAL_BPF_SET_INSTRUCTIONS_REQ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 00f1735cc44e..296bbe3bda9d 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -6280,6 +6280,8 @@ QDF_STATUS wma_mc_process_msg(void *cds_context, cds_msg_t *msg) case WDA_BPF_SET_INSTRUCTIONS_REQ: wma_set_bpf_instructions(wma_handle, msg->bodyptr); qdf_mem_free(msg->bodyptr); + case WMA_SET_CTS2SELF_FOR_STA: + wma_set_cts2self_for_p2p_go(wma_handle, true); break; case SIR_HAL_NDP_INITIATOR_REQ: wma_handle_ndp_initiator_req(wma_handle, msg->bodyptr); diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c index 5a4690eb576c..a3223b2f6814 100644 --- a/core/wma/src/wma_mgmt.c +++ b/core/wma/src/wma_mgmt.c @@ -965,6 +965,8 @@ QDF_STATUS wma_send_peer_assoc(tp_wma_handle wma, cmd->peer_flags |= WMI_PEER_160MHZ; cmd->peer_vht_caps = params->vht_caps; + if (params->p2pCapableSta) + cmd->peer_flags |= WMI_PEER_IS_P2P_CAPABLE; if (params->rmfEnabled) cmd->peer_flags |= WMI_PEER_PMF; @@ -2655,6 +2657,32 @@ void wma_process_update_userpos(tp_wma_handle wma_handle, } +QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle, + uint32_t cts2self_for_p2p_go) +{ + int32_t ret; + tp_wma_handle wma = (tp_wma_handle)wma_handle; + struct pdev_params pdevparam; + + pdevparam.param_id = WMI_PDEV_PARAM_CTS2SELF_FOR_P2P_GO_CONFIG; + pdevparam.param_value = cts2self_for_p2p_go; + + ret = wmi_unified_pdev_param_send(wma->wmi_handle, + &pdevparam, + WMA_WILDCARD_PDEV_ID); + if (ret) { + WMA_LOGE("Fail to Set CTS2SELF for p2p GO %d", + cts2self_for_p2p_go); + return QDF_STATUS_E_FAILURE; + } + + WMA_LOGD("Successfully Set CTS2SELF for p2p GO %d", + cts2self_for_p2p_go); + + return QDF_STATUS_SUCCESS; +} + + /** * wma_set_htconfig() - set ht config parameters to target * @vdev_id: vdev id From 06e76d29092b3d38221da27f067f1d4ccf87e9b2 Mon Sep 17 00:00:00 2001 From: Agrawal Ashish Date: Thu, 18 Aug 2016 16:44:48 +0530 Subject: [PATCH 008/113] qcacld-3.0: Populate correct supported rates from hostapd.conf file qcacld-2.0 to qcacld-3.0 propagation Currently driver populates default supported and extended supported rates in beacons even if hostapd.conf file wants to change supported and extended supported rates. Fix this by parsing beacon head and tail to get supported and extended rates and populate them in sap config. If Driver force acs is enabled, driver acs will get priority. In case of driver based acs, driver should ignore basic and extended rates from hostapd.conf and should populate default rates. Change-Id: I3226438b908a96f1b1bd3c2968a0c20eef81a799 CRs-Fixed: 1035768 --- core/hdd/src/wlan_hdd_hostapd.c | 34 ++++++ core/sap/inc/sap_api.h | 4 +- core/sap/src/sap_fsm.c | 16 +++ core/sme/inc/csr_api.h | 5 +- core/sme/src/csr/csr_api_roam.c | 188 ++++++++++++++++++++++---------- 5 files changed, 187 insertions(+), 60 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 3f20e4e160af..94af9c09e7cf 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7250,6 +7250,40 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, acl_entry++; } } + if (!pHddCtx->config->force_sap_acs) { + pIe = wlan_hdd_cfg80211_get_ie_ptr( + &pMgmt_frame->u.beacon.variable[0], + pBeacon->head_len, WLAN_EID_SUPP_RATES); + + if (pIe != NULL) { + pIe++; + pConfig->supported_rates.numRates = pIe[0]; + pIe++; + for (i = 0; + i < pConfig->supported_rates.numRates; i++) { + if (pIe[i]) { + pConfig->supported_rates.rate[i] = pIe[i]; + hdd_info("Configured Supported rate is %2x", + pConfig->supported_rates.rate[i]); + } + } + } + pIe = wlan_hdd_cfg80211_get_ie_ptr(pBeacon->tail, + pBeacon->tail_len, + WLAN_EID_EXT_SUPP_RATES); + if (pIe != NULL) { + pIe++; + pConfig->extended_rates.numRates = pIe[0]; + pIe++; + for (i = 0; i < pConfig->extended_rates.numRates; i++) { + if (pIe[i]) { + pConfig->extended_rates.rate[i] = pIe[i]; + hdd_info("Configured ext Supported rate is %2x", + pConfig->extended_rates.rate[i]); + } + } + } + } wlan_hdd_set_sap_hwmode(pHostapdAdapter); qdf_mem_zero(&sme_config, sizeof(tSmeConfigParams)); diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index d9f06b8bf7c3..1087fe2c44e0 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -589,8 +589,8 @@ typedef struct sap_Config { uint8_t short_retry_limit; uint8_t long_retry_limit; uint8_t ampdu_size; - tSirMacRateSet supp_rate_set; - tSirMacRateSet extended_rate_set; + tSirMacRateSet supported_rates; + tSirMacRateSet extended_rates; enum sap_acs_dfs_mode acs_dfs_mode; } tsap_Config_t; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 8eef7af80814..1ed36bbdef35 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -4199,6 +4199,22 @@ sapconvert_to_csr_profile(tsap_Config_t *pconfig_params, eCsrRoamBssType bssType } profile->sap_dot11mc = pconfig_params->sap_dot11mc; + if (pconfig_params->supported_rates.numRates) { + qdf_mem_copy(profile->supported_rates.rate, + pconfig_params->supported_rates.rate, + pconfig_params->supported_rates.numRates); + profile->supported_rates.numRates = + pconfig_params->supported_rates.numRates; + } + + if (pconfig_params->extended_rates.numRates) { + qdf_mem_copy(profile->extended_rates.rate, + pconfig_params->extended_rates.rate, + pconfig_params->extended_rates.numRates); + profile->extended_rates.numRates = + pconfig_params->extended_rates.numRates; + } + return eSAP_STATUS_SUCCESS; /* Success. */ } diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 07e9874784d9..47d654b8d06c 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -965,9 +965,10 @@ typedef struct tagCsrRoamProfile { tSirAddIeParams addIeParams; uint8_t sap_dot11mc; uint8_t beacon_tx_rate; - tSirMacRateSet supp_rate_set; - tSirMacRateSet extended_rate_set; + tSirMacRateSet supported_rates; + tSirMacRateSet extended_rates; bool do_not_roam; + } tCsrRoamProfile; #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index ad3768c3b13e..74a0f586f26d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -7315,6 +7315,20 @@ QDF_STATUS csr_roam_copy_profile(tpAniSirGlobal pMac, } qdf_mem_copy(&pDstProfile->addIeParams, &pSrcProfile->addIeParams, sizeof(tSirAddIeParams)); + if (pSrcProfile->supported_rates.numRates) { + qdf_mem_copy(pDstProfile->supported_rates.rate, + pSrcProfile->supported_rates.rate, + pSrcProfile->supported_rates.numRates); + pDstProfile->supported_rates.numRates = + pSrcProfile->supported_rates.numRates; + } + if (pSrcProfile->extended_rates.numRates) { + qdf_mem_copy(pDstProfile->extended_rates.rate, + pSrcProfile->extended_rates.rate, + pSrcProfile->extended_rates.numRates); + pDstProfile->extended_rates.numRates = + pSrcProfile->extended_rates.numRates; + } end: if (!QDF_IS_STATUS_SUCCESS(status)) { csr_release_profile(pMac, pDstProfile); @@ -12517,12 +12531,11 @@ uint8_t csr_roam_get_ibss_start_channel_number24(tpAniSirGlobal pMac) return channel; } - /** * csr_populate_basic_rates() - populates OFDM or CCK rates * @rates: rate struct to populate - * @type: true: ofdm rates, false: cck rates - * @masked: indicates if rates are to be masked with + * @is_ofdm_rates: true: ofdm rates, false: cck rates + * @is_basic_rates: indicates if rates are to be masked with * CSR_DOT11_BASIC_RATE_MASK * * This function will populate OFDM or CCK rates @@ -12530,8 +12543,10 @@ uint8_t csr_roam_get_ibss_start_channel_number24(tpAniSirGlobal pMac) * Return: void */ static void -csr_populate_basic_rates(tSirMacRateSet *rate_set, bool type, bool masked) +csr_populate_basic_rates(tSirMacRateSet *rate_set, bool is_ofdm_rates, + bool is_basic_rates) { + int i = 0; uint8_t ofdm_rates[8] = { SIR_MAC_RATE_6, SIR_MAC_RATE_9, @@ -12549,23 +12564,30 @@ csr_populate_basic_rates(tSirMacRateSet *rate_set, bool type, bool masked) SIR_MAC_RATE_11 }; - if (type == true) { + if (is_ofdm_rates == true) { rate_set->numRates = 8; qdf_mem_copy(rate_set->rate, ofdm_rates, sizeof(ofdm_rates)); - if (masked) { + if (is_basic_rates) { rate_set->rate[0] |= CSR_DOT11_BASIC_RATE_MASK; rate_set->rate[2] |= CSR_DOT11_BASIC_RATE_MASK; rate_set->rate[4] |= CSR_DOT11_BASIC_RATE_MASK; } + for (i = 0; i < rate_set->numRates; i++) + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("Default OFDM rate is %2x"), rate_set->rate[i]); } else { rate_set->numRates = 4; qdf_mem_copy(rate_set->rate, cck_rates, sizeof(cck_rates)); - if (masked) { + if (is_basic_rates) { rate_set->rate[0] |= CSR_DOT11_BASIC_RATE_MASK; rate_set->rate[1] |= CSR_DOT11_BASIC_RATE_MASK; rate_set->rate[2] |= CSR_DOT11_BASIC_RATE_MASK; rate_set->rate[3] |= CSR_DOT11_BASIC_RATE_MASK; } + for (i = 0; i < rate_set->numRates; i++) + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("Default CCK rate is %2x"), rate_set->rate[i]); + } } @@ -12600,6 +12622,41 @@ csr_convert_mode_to_nw_type(eCsrCfgDot11Mode dot11_mode, eCsrBand band) return eSIR_DONOT_USE_NW_TYPE; } +/** + * csr_populate_supported_rates_from_hostapd() - populates operational + * and extended rates. + * from hostapd.conf file + * @opr_rates: rate struct to populate operational rates + * @ext_rates: rate struct to populate extended rates + * @profile: bss profile + * + * Return: void + */ +static void csr_populate_supported_rates_from_hostapd(tSirMacRateSet *opr_rates, + tSirMacRateSet *ext_rates, + tCsrRoamProfile *pProfile) +{ + int i = 0; + if (pProfile->supported_rates.numRates) { + opr_rates->numRates = pProfile->supported_rates.numRates; + qdf_mem_copy(opr_rates->rate, + pProfile->supported_rates.rate, + pProfile->supported_rates.numRates); + for (i = 0; i < opr_rates->numRates; i++) + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("Supported Rate is %2x"), opr_rates->rate[i]); + } + if (pProfile->extended_rates.numRates) { + ext_rates->numRates = + pProfile->extended_rates.numRates; + qdf_mem_copy(ext_rates->rate, + pProfile->extended_rates.rate, + pProfile->extended_rates.numRates); + for (i = 0; i < ext_rates->numRates; i++) + QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, + FL("Extended Rate is %2x"), ext_rates->rate[i]); + } +} /** * csr_roam_get_bss_start_parms() - get bss start param from profile * @pMac: mac global context @@ -12642,58 +12699,77 @@ csr_roam_get_bss_start_parms(tpAniSirGlobal pMac, nw_type = csr_convert_mode_to_nw_type(pParam->uCfgDot11Mode, band); ext_rates->numRates = 0; - - switch (nw_type) { - default: - sms_log(pMac, LOGE, FL("sees an unknown pSirNwType (%d)"), - nw_type); - case eSIR_11A_NW_TYPE: - csr_populate_basic_rates(opr_rates, true, true); - if (eCSR_OPERATING_CHANNEL_ANY != tmp_opr_ch) { - opr_ch = tmp_opr_ch; + /* + * hostapd.conf will populate its basic and extended rates + * as per hw_mode but if acs in ini is enabled, driver should + * ignore basic and extended rates from hostapd.conf and should + * populate default rates. + */ + if (pProfile->supported_rates.numRates || + pProfile->extended_rates.numRates) { + csr_populate_supported_rates_from_hostapd(opr_rates, + ext_rates, pProfile); + pParam->operationChn = tmp_opr_ch; + } else { + switch (nw_type) { + default: + sms_log(pMac, LOGE, + FL("sees an unknown pSirNwType (%d)"), + nw_type); + case eSIR_11A_NW_TYPE: + csr_populate_basic_rates(opr_rates, true, true); + if (eCSR_OPERATING_CHANNEL_ANY != tmp_opr_ch) { + opr_ch = tmp_opr_ch; + break; + } + opr_ch = csr_roam_get_ibss_start_channel_number50(pMac); + if (0 == opr_ch && + CSR_IS_PHY_MODE_DUAL_BAND(pProfile->phyMode) && + CSR_IS_PHY_MODE_DUAL_BAND( + pMac->roam.configParam.phyMode)) { + /* + * We could not find a 5G channel by auto pick, + * let's try 2.4G channels. We only do this here + * because csr_roam_get_phy_mode_band_for_bss + * always picks 11a for AUTO + */ + nw_type = eSIR_11B_NW_TYPE; + opr_ch = + csr_roam_get_ibss_start_channel_number24(pMac); + csr_populate_basic_rates(opr_rates, false, + true); + } + break; + case eSIR_11B_NW_TYPE: + csr_populate_basic_rates(opr_rates, false, true); + if (eCSR_OPERATING_CHANNEL_ANY == tmp_opr_ch) + opr_ch = + csr_roam_get_ibss_start_channel_number24(pMac); + else + opr_ch = tmp_opr_ch; + break; + case eSIR_11G_NW_TYPE: + /* For P2P Client and P2P GO, disable 11b rates */ + if ((pProfile->csrPersona == QDF_P2P_CLIENT_MODE) || + (pProfile->csrPersona == QDF_P2P_GO_MODE) || + (eCSR_CFG_DOT11_MODE_11G_ONLY == + pParam->uCfgDot11Mode)) { + csr_populate_basic_rates(opr_rates, true, true); + } else { + csr_populate_basic_rates(opr_rates, false, + true); + csr_populate_basic_rates(ext_rates, true, + false); + } + if (eCSR_OPERATING_CHANNEL_ANY == tmp_opr_ch) + opr_ch = + csr_roam_get_ibss_start_channel_number24(pMac); + else + opr_ch = tmp_opr_ch; break; } - opr_ch = csr_roam_get_ibss_start_channel_number50(pMac); - if (0 == opr_ch && - CSR_IS_PHY_MODE_DUAL_BAND(pProfile->phyMode) && - CSR_IS_PHY_MODE_DUAL_BAND(pMac->roam.configParam.phyMode)) { - /* - * We could not find a 5G channel by auto pick, let's - * try 2.4G channels. We only do this here because - * csr_roam_get_phy_mode_band_for_bss always picks 11a - * for AUTO - */ - nw_type = eSIR_11B_NW_TYPE; - opr_ch = csr_roam_get_ibss_start_channel_number24(pMac); - csr_populate_basic_rates(opr_rates, false, true); - } - break; - case eSIR_11B_NW_TYPE: - csr_populate_basic_rates(opr_rates, false, true); - if (eCSR_OPERATING_CHANNEL_ANY == tmp_opr_ch) - opr_ch = csr_roam_get_ibss_start_channel_number24(pMac); - else - opr_ch = tmp_opr_ch; - break; - case eSIR_11G_NW_TYPE: - /* For P2P Client and P2P GO, disable 11b rates */ - if ((pProfile->csrPersona == QDF_P2P_CLIENT_MODE) - || (pProfile->csrPersona == QDF_P2P_GO_MODE) - || (eCSR_CFG_DOT11_MODE_11G_ONLY == - pParam->uCfgDot11Mode)) { - csr_populate_basic_rates(opr_rates, true, true); - } else { - csr_populate_basic_rates(opr_rates, false, true); - csr_populate_basic_rates(ext_rates, true, false); - } - - if (eCSR_OPERATING_CHANNEL_ANY == tmp_opr_ch) - opr_ch = csr_roam_get_ibss_start_channel_number24(pMac); - else - opr_ch = tmp_opr_ch; - break; + pParam->operationChn = opr_ch; } - pParam->operationChn = opr_ch; pParam->sirNwType = nw_type; pParam->ch_params.ch_width = pProfile->ch_params.ch_width; pParam->ch_params.center_freq_seg0 = From 71e0316edaf0250f71a34e29e2872fa100d9f687 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 6 Oct 2016 04:08:58 -0700 Subject: [PATCH 009/113] Release 5.1.0.29N Release 5.1.0.29N Change-Id: I593a4500492dfb1d713fe604cbb892b6a2b3af3a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c5081d7cbae2..5d9329269101 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29M" +#define QWLAN_VERSIONSTR "5.1.0.29N" #endif /* QWLAN_VERSION_H */ From d6e4b639f84f8270a45a3f230d4bb6ccc1ec81f7 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 3 Oct 2016 13:49:27 -0700 Subject: [PATCH 010/113] qcacld-3.0: Cleanup strange behaviors in __iw_set_essid() __iw_set_essid() currently has a few strange behaviors: * It currently rejects any request when in IBSS mode. * It currently uses hdd_conn_get_connected_bss_type() to see if the adapter is connected, discarding the connectedBssType returned by the function. * It currently uses the conn_info.connDot11DesiredBssType field to determine the BSS type, but this field is being deprecated. Clean up these behaviors by allowing IBSS mode, by using hdd_conn_is_connected() to see if the adapter is connected, and by using the adapter device_mode to determine the BSS type. Change-Id: I0180eb70487dd664c1cb85eee9a4d53eb7cb14a9 CRs-Fixed: 1073739 --- core/hdd/src/wlan_hdd_assoc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 196a20ecf74e..518565ab8418 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -5477,7 +5477,6 @@ static int __iw_set_essid(struct net_device *dev, hdd_context_t *hdd_ctx; uint32_t roamId; tCsrRoamProfile *pRoamProfile; - eMib_dot11DesiredBssType connectedBssType; eCsrAuthType RSNAuthType; tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); @@ -5491,7 +5490,8 @@ static int __iw_set_essid(struct net_device *dev, return ret; if (pAdapter->device_mode != QDF_STA_MODE && - pAdapter->device_mode != QDF_P2P_CLIENT_MODE) { + pAdapter->device_mode != QDF_IBSS_MODE && + pAdapter->device_mode != QDF_P2P_CLIENT_MODE) { hdd_warn("device mode %s(%d) is not allowed", hdd_device_mode_to_string(pAdapter->device_mode), pAdapter->device_mode); @@ -5508,9 +5508,8 @@ static int __iw_set_essid(struct net_device *dev, return -EINVAL; pRoamProfile = &pWextState->roamProfile; - if (hdd_conn_get_connected_bss_type(pHddStaCtx, &connectedBssType) || - (eMib_dot11DesiredBssType_independent == - pHddStaCtx->conn_info.connDot11DesiredBssType)) { + if (hdd_conn_is_connected(pHddStaCtx) || + (pAdapter->device_mode == QDF_IBSS_MODE)) { QDF_STATUS qdf_status; /* Need to issue a disconnect to CSR. */ From 9eeed0aedb6958ed2c685ea826433929da4b7252 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 3 Oct 2016 15:04:57 -0700 Subject: [PATCH 011/113] qcacld-3.0: Cleanup strange behavior in __iw_set_mode() __iw_set_mode() currently uses hdd_conn_get_connected_bss_type() to see if the adapter is connected, discarding the connectedBssType returned by the function. That is not the correct API for this use case. Clean up this strange behavior by using hdd_conn_is_connected() to see if the adapter is connected. Change-Id: I66f85fb8275ae2885012ebf8710187b2b886dfb0 CRs-Fixed: 1073739 --- core/hdd/src/wlan_hdd_wext.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 7074de2d6bd2..9992c4b41a8d 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -2037,7 +2037,6 @@ static int __iw_set_mode(struct net_device *dev, hdd_context_t *hdd_ctx; tCsrRoamProfile *pRoamProfile; eCsrRoamBssType LastBSSType; - eMib_dot11DesiredBssType connectedBssType; struct hdd_config *pConfig; struct wireless_dev *wdev; int ret; @@ -2085,8 +2084,8 @@ static int __iw_set_mode(struct net_device *dev, /* the BSS mode changed. We need to issue disconnect * if connected or in IBSS disconnect state */ - if (hdd_conn_get_connected_bss_type - (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), &connectedBssType) + if (hdd_conn_is_connected + (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter)) || (eCSR_BSS_TYPE_START_IBSS == LastBSSType)) { QDF_STATUS qdf_status; /* need to issue a disconnect to CSR. */ From 9edf957229a15dad34f2f1bc8c1d9b095a78bcbd Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 3 Oct 2016 15:24:49 -0700 Subject: [PATCH 012/113] qcacld-3.0: Avoid eMib_dot11DesiredBssType in cfg80211 Currently in wlan_hdd_cfg80211.c wlan_hdd_try_disconnect() calls hdd_conn_get_connected_bss_type() which returns a value of eMib_dot11DesiredBssType. This type is being deprecated so directly use the adapter's device_mode. Change-Id: Ib8981750475bd27818a0c7e4e386396869d90e69 CRs-Fixed: 1073739 --- core/hdd/src/wlan_hdd_cfg80211.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1da11ee297d6..2e6c4af0de56 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -12079,14 +12079,11 @@ static int wlan_hdd_try_disconnect(hdd_adapter_t *pAdapter) { unsigned long rc; hdd_station_ctx_t *pHddStaCtx; - eMib_dot11DesiredBssType connectedBssType; int status, result = 0; pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); - hdd_conn_get_connected_bss_type(pHddStaCtx, &connectedBssType); - - if ((eMib_dot11DesiredBssType_independent == connectedBssType) || + if ((QDF_IBSS_MODE == pAdapter->device_mode) || (eConnectionState_Associated == pHddStaCtx->conn_info.connState) || (eConnectionState_Connecting == pHddStaCtx->conn_info.connState) || (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState)) { From 229416002f30760f5fb19f7c5aa9b136e6751bb2 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 3 Oct 2016 15:33:12 -0700 Subject: [PATCH 013/113] qcacld-3.0: Remove obsolete hdd_conn_get_connected_bss_type() Function hdd_conn_get_connected_bss_type() is no longer being used, so remove it. Change-Id: I0aafea43631d0ab8d3a99d8e913392f6090cd124 CRs-Fixed: 1073739 --- core/hdd/inc/wlan_hdd_assoc.h | 11 ----------- core/hdd/src/wlan_hdd_assoc.c | 23 ----------------------- 2 files changed, 34 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index 549b68d5deef..860a1e6fbe1f 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -260,17 +260,6 @@ QDF_STATUS hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, eRoamCmdStatus roamStatus, eCsrRoamResult roamResult); -/** - * hdd_conn_get_connected_bss_type() - get current bss type - * @pHddStaCtx: pointer to global HDD Station context - * @pConnectedBssType: pointer to connected bss type - * - * Return: false if any errors encountered, true otherwise - */ -bool -hdd_conn_get_connected_bss_type(hdd_station_ctx_t *pHddStaCtx, - eMib_dot11DesiredBssType *pConnectedBssType); - /** * hdd_set_genie_to_csr() - set genie to csr * @pAdapter: pointer to adapter diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 518565ab8418..cf7845b3570c 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -276,29 +276,6 @@ hdd_conn_get_connected_cipher_algo(hdd_station_ctx_t *pHddStaCtx, return fConnected; } -/** - * hdd_conn_get_connected_bss_type() - get current bss type - * @pHddStaCtx: pointer to global HDD Station context - * @pConnectedBssType: pointer to connected bss type - * - * Return: false if any errors encountered, true otherwise - */ -inline bool -hdd_conn_get_connected_bss_type(hdd_station_ctx_t *pHddStaCtx, - eMib_dot11DesiredBssType *pConnectedBssType) -{ - bool fConnected = false; - - fConnected = hdd_conn_get_connection_state(pHddStaCtx, NULL); - - if (pConnectedBssType) { - *pConnectedBssType = - pHddStaCtx->conn_info.connDot11DesiredBssType; - } - - return fConnected; -} - /** * hdd_conn_save_connected_bss_type() - set connected bss type * @pHddStaCtx: pointer to global HDD Station context From 6716a4ad9e2495e5b0a6b088a091767a784e5709 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 3 Oct 2016 15:36:23 -0700 Subject: [PATCH 014/113] qcacld-3.0: Remove obsolete connDot11DesiredBssType All users of connDot11DesiredBssType have been converted to better supported interfaces, so remove all traces of this field. Change-Id: Iabfc4642a500587abd1f10d4fbc3f9e88f627a83 CRs-Fixed: 1073739 --- core/hdd/inc/wlan_hdd_assoc.h | 6 ------ core/hdd/src/wlan_hdd_assoc.c | 36 ----------------------------------- 2 files changed, 42 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index 860a1e6fbe1f..f49cb125ed54 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -34,7 +34,6 @@ */ /* Include files */ -#include #include #include #include "ol_txrx_ctrl_api.h" @@ -149,10 +148,6 @@ struct hdd_conn_flag { /** * typedef connection_info_t - structure to store connection information * @connState: connection state of the NIC - * @connDot11DesiredBssType: BSS type of the current connection. - * Comes from the MIB at the time the connect request is issued - * in combination with the BssDescription from the - * associated entity * @bssId: BSSID * @SSID: SSID Info * @staId: Station ID @@ -182,7 +177,6 @@ struct hdd_conn_flag { */ typedef struct connection_info_s { eConnectionState connState; - eMib_dot11DesiredBssType connDot11DesiredBssType; struct qdf_mac_addr bssId; tCsrSSIDInfo SSID; uint8_t staId[MAX_PEERS]; diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index cf7845b3570c..e008534fb224 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -276,38 +276,6 @@ hdd_conn_get_connected_cipher_algo(hdd_station_ctx_t *pHddStaCtx, return fConnected; } -/** - * hdd_conn_save_connected_bss_type() - set connected bss type - * @pHddStaCtx: pointer to global HDD Station context - * @csr_roamBssType: bss type - * - * Return: none - */ -static inline void -hdd_conn_save_connected_bss_type(hdd_station_ctx_t *pHddStaCtx, - eCsrRoamBssType csr_roamBssType) -{ - switch (csr_roamBssType) { - case eCSR_BSS_TYPE_INFRASTRUCTURE: - pHddStaCtx->conn_info.connDot11DesiredBssType = - eMib_dot11DesiredBssType_infrastructure; - break; - - case eCSR_BSS_TYPE_IBSS: - case eCSR_BSS_TYPE_START_IBSS: - pHddStaCtx->conn_info.connDot11DesiredBssType = - eMib_dot11DesiredBssType_independent; - break; - - /** We will never set the BssType to 'any' when attempting a connection - so CSR should never send this back to us.*/ - case eCSR_BSS_TYPE_ANY: - default: - QDF_ASSERT(0); - break; - } -} - /** * hdd_remove_beacon_filter() - remove beacon filter * @adapter: Pointer to the hdd adapter @@ -920,8 +888,6 @@ hdd_conn_save_connect_info(hdd_adapter_t *pAdapter, tCsrRoamInfo *pRoamInfo, } hdd_save_bss_info(pAdapter, pRoamInfo); } - /* save the connected BssType */ - hdd_conn_save_connected_bss_type(pHddStaCtx, eBssType); } /** @@ -1444,8 +1410,6 @@ static void hdd_conn_remove_connect_info(hdd_station_ctx_t *pHddStaCtx) qdf_mem_zero(&pHddStaCtx->conn_info.Keys, sizeof(tCsrKeys)); qdf_mem_zero(&pHddStaCtx->ibss_enc_key, sizeof(tCsrRoamSetKey)); - /* Set not-connected state */ - pHddStaCtx->conn_info.connDot11DesiredBssType = eCSR_BSS_TYPE_ANY; pHddStaCtx->conn_info.proxyARPService = 0; qdf_mem_zero(&pHddStaCtx->conn_info.SSID, sizeof(tCsrSSIDInfo)); From db6f9c45e2acbbcb2c32135f3dce0102d3d619d9 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 4 Oct 2016 09:47:18 -0700 Subject: [PATCH 015/113] qcacld-3.0: Remove obsolete wlan_hdd_mib.h All in-code references to wlan_hdd_mib data structures have been removed from the driver, so delete the mib structure from the adapter context and the remove the header file itself. Change-Id: I774d16df363d069eae1616807ce6f80da4800bb4 CRs-Fixed: 1073739 --- core/hdd/inc/wlan_hdd_includes.h | 3 +- core/hdd/inc/wlan_hdd_main.h | 2 - core/hdd/inc/wlan_hdd_mib.h | 190 ------------------------------- 3 files changed, 1 insertion(+), 194 deletions(-) delete mode 100644 core/hdd/inc/wlan_hdd_mib.h diff --git a/core/hdd/inc/wlan_hdd_includes.h b/core/hdd/inc/wlan_hdd_includes.h index cb2e63e85830..4eead672404f 100644 --- a/core/hdd/inc/wlan_hdd_includes.h +++ b/core/hdd/inc/wlan_hdd_includes.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The Linux Foundation. All rights reserved. + * Copyright (c) 2014, 2016 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -54,7 +54,6 @@ #include #include #include "wlan_hdd_assoc.h" -#include "wlan_hdd_mib.h" #include "wlan_hdd_wext.h" #include "wlan_hdd_main.h" #include "wlan_hdd_tx_rx.h" diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 577f1f9d84e0..16dcc8cc01b4 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -905,8 +905,6 @@ struct hdd_adapter_s { hdd_stats_t hdd_stats; /** linkspeed statistics */ tSirLinkSpeedInfo ls_stats; - /**Mib information*/ - sHddMib_t hdd_mib; uint8_t sessionId; diff --git a/core/hdd/inc/wlan_hdd_mib.h b/core/hdd/inc/wlan_hdd_mib.h deleted file mode 100644 index 6d9482d7708e..000000000000 --- a/core/hdd/inc/wlan_hdd_mib.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. - * - * Previously licensed under the ISC license by Qualcomm Atheros, Inc. - * - * - * Permission to use, copy, modify, and/or distribute this software for - * any purpose with or without fee is hereby granted, provided that the - * above copyright notice and this permission notice appear in all - * copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE - * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -/* - * This file was originally distributed by Qualcomm Atheros, Inc. - * under proprietary terms before Copyright ownership was assigned - * to the Linux Foundation. - */ - -#if !defined(WLAN_HDD_MIB_h__) -#define WLAN_HDD_MIB_h__ - -#include - -typedef enum { - eMib_dot11DesiredBssType_infrastructure = 1, - eMib_dot11DesiredBssType_independent = 2, - eMib_dot11DesiredBssType_infra_ap = 3, - eMib_dot11DesiredBssType_any = 4 -} eMib_dot11DesiredBssType; - -/** This is the maximum number of BSSIDs supported in the - dot11DesiredBssidList. All the code operates off of - this maximum BSSID list count. */ -#define MIB_DOT11_DESIRED_BSSID_LIST_MAX_COUNT 1 - -typedef struct { - uint32_t cEntries; - - struct qdf_mac_addr BSSIDs[MIB_DOT11_DESIRED_BSSID_LIST_MAX_COUNT]; - -} sMib_dot11DesiredBssidList; - -/** This is the maximum number of SSIDs supported in the - dot11DesiredSsidList. All the code operates off of - this maximum SSID list count. */ - -#define MIB_DOT11_DESIRED_SSID_LIST_MAX_COUNT 1 - -#define MIB_DOT11_SSID_MAX_LENGTH 32 - -typedef struct { - uint32_t ssidLength; - uint8_t ssid[MIB_DOT11_SSID_MAX_LENGTH]; - -} sDot11Ssid; - -typedef struct { - uint32_t cEntries; - - sDot11Ssid SSIDs[MIB_DOT11_DESIRED_SSID_LIST_MAX_COUNT]; - -} sMib_dot11DesiredSsidList; - -typedef enum { - /* these are bitmasks.... */ - eMib_dot11AutoConfigEnabled_None = 0U, - eMib_dot11AutoConfigEnabled_Phy = 0x00000001U, - eMib_dot11AutoConfigEnabled_Mac = 0x00000002U -} eMib_dot11AutoConfigEnabled; - -#define MIB_DOT11_SUPPORTED_PHY_TYPES_MAX_COUNT 3 - -typedef enum tagMib_dot11PhyType { - eMib_dot11PhyType_11b, - eMib_dot11PhyType_11a, - eMib_dot11PhyType_11g, - eMib_dot11PhyType_all -} eMib_dot11PhyType; - -typedef struct tagMib_dot11SupportedPhyTypes { - uint32_t cEntries; - eMib_dot11PhyType phyTypes[MIB_DOT11_SUPPORTED_PHY_TYPES_MAX_COUNT]; -} sMib_dot11SupportedPhyTypes; - -typedef enum { - eMib_DevicePowerState_D0, - eMib_DevicePowerState_D1, - eMib_DevicePowerState_D2, - eMib_DevicePowerState_D3 -} eMib_DevicePowerState; - -typedef enum { - eMib_dot11NICPowerState_OFF = false, - eMib_dot11NICPowerState_ON = true -} eMib_dot11NICPowerState; - -typedef enum { - eMib_dot11HardwarePHYState_OFF = false, - eMib_dot11HardwarePHYState_ON = true -} eMib_dot11HardwarePHYState; - -typedef enum { - eMib_dot11PowerSavingLevel_None, - eMib_dot11PowerSavingLevel_MaxPS, - eMib_dot11PowerSavingLevel_FastPS, - eMib_dot11PowerSavingLevel_MaximumLevel -} eMib_dot11PowerSavingLevel; - -#define MIB_DOT11_MAC_EXCLUSION_LIST_MAX_COUNT 4 -typedef struct { - uint32_t cEntries; - - struct qdf_mac_addr macAddrs[MIB_DOT11_MAC_EXCLUSION_LIST_MAX_COUNT]; - -} sMib_dot11MacExcludeList; - -#define MIB_DOT11_PRIVACY_EXEMPT_LIST_MAX_COUNT 32 - -typedef enum { - eMib_dot11ExemptionAction_Always, - eMib_dot11ExemptionAction_OnKeyMapUnavailable -} eMib_dot11ExemptAction; - -typedef enum { - eMib_dot11ExemptPacket_Unicast, - eMib_dot11ExemptPacket_Multicast, - eMib_dot11ExemptPacket_Both -} eMib_dot11ExemptPacket; - -typedef struct { - uint16_t uEtherType; - eMib_dot11ExemptAction exemptAction; - eMib_dot11ExemptPacket exemptPacket; - -} sMib_dot11PrivacyExemption; - -typedef struct { - uint32_t cEntries; - - sMib_dot11PrivacyExemption - privacyExemptList[MIB_DOT11_PRIVACY_EXEMPT_LIST_MAX_COUNT]; - -} sMib_dot11PrivacyExemptionList; - -typedef struct sHddMib_s { - eMib_dot11DesiredBssType mibDot11DesiredBssType; - - sMib_dot11DesiredBssidList mibDot11DesiredBssidList; - - sMib_dot11DesiredSsidList mibDot11DesiredSsidList; - - eMib_dot11AutoConfigEnabled mibDot11AutoConfigEnabled; - - /* the device power state for the device (the D-state... you know D0, D1, D2, etc. */ - eMib_DevicePowerState mibDevicePowerState; - - /* dot11NICPowerState is really the on/off state of the PHY. This can be */ - /* mamipulated through OIDs like a software control for radio on/off. */ - eMib_dot11NICPowerState mibDot11NICPowerState; - - /* Hardware PHY state is the on/off state of the hardware PHY. */ - eMib_dot11HardwarePHYState mibDot11HardwarePHYState; - - /* dot11 Power Saving level is the 802.11 power saving level/state for the 802.11 */ - /* NIC. Typically this is mapped to 802.11 BMPS in some fashion. We are not going */ - /* to disappoint; the Libra NIC maps these to different BMPS settings. */ - eMib_dot11PowerSavingLevel mibDot11PowerSavingLevel; - - sMib_dot11MacExcludeList mibDot11MacExcludeList; - - sMib_dot11PrivacyExemptionList mibDot11PrivacyExemptionList; - - sMib_dot11SupportedPhyTypes mibDot11SupportedPhyTypes; - eMib_dot11PhyType mibDot11CurrentPhyType; - - bool dot11IbssJoinOnly; - bool HiddenNetworkEnabled; - -} sHddMib_t; - -#endif From 489e79b0995b32fbd2371f591ad46a4ed42e4c6b Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 6 Oct 2016 08:14:45 -0700 Subject: [PATCH 016/113] Release 5.1.0.29O Release 5.1.0.29O Change-Id: Idb4a6f647a160cf9d76a98f1ff59a0542598eb08 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5d9329269101..7f016007b400 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29N" +#define QWLAN_VERSIONSTR "5.1.0.29O" #endif /* QWLAN_VERSION_H */ From 47d2926b35b27a2d13f3c287be6049e2da09dac2 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Mon, 3 Oct 2016 16:08:04 +0530 Subject: [PATCH 017/113] qcacld-3.0: In FTM mode, don't update config param, max peer limit Presently, driver configuration from FTM mode to any other mode is failing due to start module is failing, because configuration parameter(max peer limit) is set to zero during FTM mode initialization. In FTM mode, during start modules, don't update configuration parameter, max peer limit. Change-Id: Ie5adea45b2dac099e797a1e25536cc959f3d5525 CRs-Fixed: 1073593 --- core/cds/src/cds_api.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index bcc146f1e1d4..0e6974a782ee 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -323,7 +323,13 @@ QDF_STATUS cds_open(void) * and keeps correct limit in cds_cfg.max_station. So, make sure * config entry pHddCtx->config->maxNumberOfPeers has adjusted value */ - pHddCtx->config->maxNumberOfPeers = cds_cfg->max_station; + /* In FTM mode cds_cfg->max_stations will be zero. On updating same + * into hdd context config entry, leads to pe_open() to fail, if + * con_mode change happens from FTM mode to any other mode. + */ + if (DRIVER_TYPE_PRODUCTION == cds_cfg->driver_type) + pHddCtx->config->maxNumberOfPeers = cds_cfg->max_station; + HTCHandle = cds_get_context(QDF_MODULE_ID_HTC); if (!HTCHandle) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, From 45d62ce21f37326e767d0ac588cca3913659cd3e Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Thu, 6 Oct 2016 11:24:31 -0700 Subject: [PATCH 018/113] Release 5.1.0.29P Release 5.1.0.29P Change-Id: I290bcc4977b1c9267c4885750a1707386605be18 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7f016007b400..dd570f3ff273 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29O" +#define QWLAN_VERSIONSTR "5.1.0.29P" #endif /* QWLAN_VERSION_H */ From 9bb2e85aff1b93205f5a82e636d5dcea9289b116 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Sat, 24 Sep 2016 12:29:25 -0700 Subject: [PATCH 019/113] qcacld-3.0: Power offload unit test framework enhancements Recently host power offload suspend/resume has switched to 3 stage process. Enhance power offload unit test framework accordingly, and improve error handling. Change-Id: I8cc1e955fbaca631ee7fd76b0c907d1e68c836bf CRs-Fixed: 1072423 --- core/hdd/inc/wlan_hdd_driver_ops.h | 2 + core/hdd/inc/wlan_hdd_power.h | 22 ++++ core/hdd/src/wlan_hdd_power.c | 157 +++++++++++++++++++++++++++++ core/hdd/src/wlan_hdd_wext.c | 40 +------- core/pld/inc/pld_common.h | 3 + 5 files changed, 188 insertions(+), 36 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_driver_ops.h b/core/hdd/inc/wlan_hdd_driver_ops.h index 3ea44449b55c..f919e8decf1c 100644 --- a/core/hdd/inc/wlan_hdd_driver_ops.h +++ b/core/hdd/inc/wlan_hdd_driver_ops.h @@ -38,7 +38,9 @@ int wlan_hdd_register_driver(void); void wlan_hdd_unregister_driver(void); int wlan_hdd_bus_suspend(pm_message_t state); +int wlan_hdd_bus_suspend_noirq(void); int wlan_hdd_bus_resume(void); +int wlan_hdd_bus_resume_noirq(void); void hdd_hif_close(void *hif_ctx); int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid, enum qdf_bus_type bus_type, bool reinit); diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index e173d4f517db..61f4d6d490c9 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -200,4 +200,26 @@ void hdd_wlan_suspend_resume_event(uint8_t state) {} #endif /* FEATURE_WLAN_DIAG_SUPPORT */ +/* + * Unit-test suspend/resume is a testing feature that allows putting firmware + * into WoW suspend irrespective of Apps suspend status. It emulates the chain + * of events that occur durring normal system-level suspend/resume, such as + * initiating all of the suspend/resume stages in the correct order, and + * enabling/disabling appropriate copy engine irqs. + */ +#ifdef WLAN_SUSPEND_RESUME_TEST +int hdd_wlan_fake_apps_resume(struct wiphy *wiphy); +int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy); +#else +static inline int hdd_wlan_fake_apps_resume(struct wiphy *wiphy) +{ + return 0; +} + +static inline int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy) +{ + return 0; +} +#endif /* WLAN_SUSPEND_RESUME_TEST */ + #endif /* __WLAN_HDD_POWER_H */ diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 7e82be6f9ae7..26e5f6641987 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -74,6 +74,7 @@ #include "cds_concurrency.h" #include "cdp_txrx_flow_ctrl_v2.h" #include "pld_common.h" +#include "wlan_hdd_driver_ops.h" /* Preprocessor definitions and constants */ #define HDD_SSR_BRING_UP_TIME 30000 @@ -2349,3 +2350,159 @@ int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter, } return 0; } + +#ifdef WLAN_SUSPEND_RESUME_TEST +/* + * On Rome/iHelium there are 12 CE irqs and #2 is the wake irq. This may not be + * a valid assumption on future platforms. + */ +#define CE_IRQ_COUNT 12 +#define CE_WAKE_IRQ 2 +static struct wiphy *g_wiphy; + +#define HDD_FA_SUSPENDED_BIT (0) +static unsigned long fake_apps_state; + +static int __hdd_wlan_fake_apps_resume(struct wiphy *wiphy); + +/** + * hdd_wlan_fake_apps_resume_irq_callback() - Irq callback function for resuming + * from unit-test initiated suspend from irq wakeup signal + * @val: interrupt val + * + * Resume wlan after getting very 1st CE interrupt from target + * + * Return: none + */ +static void hdd_wlan_fake_apps_resume_irq_callback(uint32_t val) +{ + hdd_info("Trigger unit-test resume WLAN; val: 0x%x", val); + + QDF_BUG(g_wiphy); + __hdd_wlan_fake_apps_resume(g_wiphy); + g_wiphy = NULL; +} + +/** + * hdd_wlan_fake_apps_suspend() - Initiate a unit-test triggered suspend + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, suspend related non-zero error code on failure + */ +int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy) +{ + qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + struct hif_opaque_softc *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + pm_message_t state; + int i, resume_err, suspend_err; + + hdd_info("Unit-test suspend WLAN"); + if (test_and_set_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) { + hdd_info("Already unit-test suspended; Nothing to do"); + return 0; + } + + suspend_err = wlan_hdd_cfg80211_suspend_wlan(wiphy, NULL); + if (suspend_err) + goto resume_done; + + state.event = PM_EVENT_SUSPEND; + suspend_err = wlan_hdd_bus_suspend(state); + if (suspend_err) + goto cfg80211_resume; + + /* simulate kernel disabling irqs */ + for (i = 0; i < CE_IRQ_COUNT; i++) + pld_disable_irq(qdf_dev->dev, i); + + suspend_err = wlan_hdd_bus_suspend_noirq(); + if (suspend_err) + goto enable_irqs_and_bus_resume; + + /* re-enable wake irq */ + pld_enable_irq(qdf_dev->dev, CE_WAKE_IRQ); + + /* pass wiphy to callback via global variable */ + g_wiphy = wiphy; + hif_fake_apps_suspend(hif_ctx, hdd_wlan_fake_apps_resume_irq_callback); + + return 0; + +enable_irqs_and_bus_resume: + /* re-enable irqs */ + for (i = 0; i < CE_IRQ_COUNT; i++) + pld_enable_irq(qdf_dev->dev, i); + + resume_err = wlan_hdd_bus_resume(); + QDF_BUG(resume_err == 0); + +cfg80211_resume: + resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy); + QDF_BUG(resume_err == 0); + +resume_done: + clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state); + hdd_err("Unit-test suspend failed: %d", suspend_err); + return suspend_err; +} + +/** + * hdd_wlan_fake_apps_resume() - Resume from unit-test triggered suspend + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, calls QDF_BUG() on failure + */ +int hdd_wlan_fake_apps_resume(struct wiphy *wiphy) +{ + struct hif_opaque_softc *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); + int err; + + hif_fake_apps_resume(hif_ctx); + err = __hdd_wlan_fake_apps_resume(wiphy); + if (err) { + hif_fake_apps_suspend(hif_ctx, + hdd_wlan_fake_apps_resume_irq_callback); + return err; + } + + return 0; +} + +/** + * __hdd_wlan_fake_apps_resume() - The core logic for + * hdd_wlan_fake_apps_resume() skipping the call to hif_fake_apps_resume(), + * which is only need for non-irq resume + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, calls QDF_BUG() on failure + */ +static int __hdd_wlan_fake_apps_resume(struct wiphy *wiphy) +{ + qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + int i, resume_err; + + hdd_info("Unit-test resume WLAN"); + if (!test_and_clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) { + hdd_info("Not unit-test suspended; Nothing to do"); + return 0; + } + + /* disable wake irq */ + pld_disable_irq(qdf_dev->dev, CE_WAKE_IRQ); + + resume_err = wlan_hdd_bus_resume_noirq(); + QDF_BUG(resume_err == 0); + + /* simulate kernel enable irqs */ + for (i = 0; i < CE_IRQ_COUNT; i++) + pld_enable_irq(qdf_dev->dev, i); + + resume_err = wlan_hdd_bus_resume(); + QDF_BUG(resume_err == 0); + + resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy); + QDF_BUG(resume_err == 0); + + return 0; +} +#endif diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 9992c4b41a8d..397bdcd2d019 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -92,6 +92,7 @@ #ifdef WLAN_SUSPEND_RESUME_TEST #include "wlan_hdd_driver_ops.h" #include "hif.h" +#include "pld_common.h" #endif #define HDD_FINISH_ULA_TIME_OUT 800 @@ -439,10 +440,9 @@ static const hdd_freq_chan_map_t freq_chan_map[] = { #define WE_ENABLE_FW_PROFILE 4 #define WE_SET_FW_PROFILE_HIST_INTVL 5 -#ifdef WLAN_SUSPEND_RESUME_TEST +/* Private sub-ioctl for initiating WoW suspend without Apps suspend */ #define WE_SET_WLAN_SUSPEND 6 #define WE_SET_WLAN_RESUME 7 -#endif /* (SIOCIWFIRSTPRIV + 29) is currently unused */ @@ -9782,25 +9782,6 @@ static int wlan_hdd_set_mon_chan(hdd_adapter_t *adapter, uint32_t chan, return qdf_status_to_os_return(status); } -#ifdef WLAN_SUSPEND_RESUME_TEST -static void *g_wiphy; - -/** - * hdd_wlan_trigger_resume() - resume wlan - * @val: interrupt val - * - * Resume wlan after getting very 1st CE interrupt from target - * - * Return: none - */ -static void hdd_wlan_trigger_resume(uint32_t val) -{ - hdd_err("Resume WLAN val 0x%x", val); - wlan_hdd_bus_resume(); - wlan_hdd_cfg80211_resume_wlan(g_wiphy); -} -#endif - static int __iw_set_two_ints_getnone(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) @@ -9810,10 +9791,6 @@ static int __iw_set_two_ints_getnone(struct net_device *dev, int sub_cmd = value[0]; int ret; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); -#ifdef WLAN_SUSPEND_RESUME_TEST - pm_message_t state; -#endif - ENTER_DEV(dev); @@ -9877,21 +9854,12 @@ static int __iw_set_two_ints_getnone(struct net_device *dev, case WE_SET_MON_MODE_CHAN: ret = wlan_hdd_set_mon_chan(pAdapter, value[1], value[2]); break; -#ifdef WLAN_SUSPEND_RESUME_TEST case WE_SET_WLAN_SUSPEND: - hdd_err("Suspend WLAN"); - g_wiphy = hdd_ctx->wiphy; - state.event = PM_EVENT_SUSPEND; - ret = wlan_hdd_cfg80211_suspend_wlan(hdd_ctx->wiphy, NULL); - wlan_hdd_bus_suspend(state); - hif_fake_apps_suspend(hdd_wlan_trigger_resume); + ret = hdd_wlan_fake_apps_suspend(hdd_ctx->wiphy); break; case WE_SET_WLAN_RESUME: - hdd_err("Resume WLAN"); - wlan_hdd_bus_resume(); - ret = wlan_hdd_cfg80211_resume_wlan(hdd_ctx->wiphy); + ret = hdd_wlan_fake_apps_resume(hdd_ctx->wiphy); break; -#endif default: hdd_err("Invalid IOCTL command %d", sub_cmd); break; diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index bcf647b0b1a4..4bb77b27cb94 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -379,4 +379,7 @@ void *pld_smmu_get_mapping(struct device *dev); int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); unsigned int pld_socinfo_get_serial_number(struct device *dev); + +void pld_enable_irq(struct device *dev, unsigned int ce_id); +void pld_disable_irq(struct device *dev, unsigned int ce_id); #endif From a546aea62da119ab885cf36501951e8365f304b3 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 08:32:06 -0700 Subject: [PATCH 020/113] Release 5.1.0.29Q Release 5.1.0.29Q Change-Id: I3faed7c8d2e5e2c6b331ea79a8ac3e988c542579 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index dd570f3ff273..08e825f6b615 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "P" +#define QWLAN_VERSION_EXTRA "Q" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29P" +#define QWLAN_VERSIONSTR "5.1.0.29Q" #endif /* QWLAN_VERSION_H */ From d60bde2bb6d1ffb4716149821069d5cd8c98f8f3 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Thu, 29 Sep 2016 17:24:09 +0530 Subject: [PATCH 021/113] qcacld-3.0: Move a cds log to appropriate log level A cds log for cds_get_channel_list() is printing quite often and spamming the kernel logs. This log is not for error. Hence moving this to appropriate log level. Change-Id: I5d037f47729b612d6754e64f46b627998ec026f8 CRs-Fixed: 1072651 --- core/cds/src/cds_concurrency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 946dc819b45a..76831e3d58ca 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -4644,7 +4644,7 @@ QDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl, if (CDS_NONE == pcl) { /* msg */ - cds_err("pcl is 0"); + cds_info("pcl is 0"); return QDF_STATUS_SUCCESS; } /* get the channel list for current domain */ From 877ad5d74dc92cd3ad9ac1206fb8da9da1825c92 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Thu, 22 Sep 2016 19:27:58 +0530 Subject: [PATCH 022/113] qcacld-3.0: Update hw_mode_list as per WMI_SERVICE_READY_EXT_EVENT Driver updates its hw_mode_list entries as per hw_mode_list given by firmware during WMI_SERVICE_READY_EVENT. The enhancement is to update hw_mode_list entries in the driver using the values received in WMI_SERVICE_READY_EXT_EVENT from the firmware. Change-Id: I5e4d97523cb7fd018767d5d2fda841f03b2406f6 CRs-Fixed: 1070005 --- core/wma/inc/wma.h | 12 +++ core/wma/inc/wma_api.h | 2 - core/wma/src/wma_main.c | 205 ++++++++++++++++++++++++++++++++++++++- core/wma/src/wma_utils.c | 97 ++---------------- 4 files changed, 221 insertions(+), 95 deletions(-) diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index f22aea6dac5d..c1be1096a6f2 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -1070,6 +1070,18 @@ struct dbs_hw_mode_info { uint32_t *hw_mode_list; }; +/** + * struct mac_ss_bw_info - hw_mode_list PHY/MAC params for each MAC + * @mac_tx_stream: Max TX stream + * @mac_rx_stream: Max RX stream + * @mac_bw: Max bandwidth + */ +struct mac_ss_bw_info { + uint32_t mac_tx_stream; + uint32_t mac_rx_stream; + uint32_t mac_bw; +}; + /* Current HTC credit is 2, pool size of 50 is sufficient */ #define WMI_DESC_POOL_MAX 50 diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index ecbead7e438f..0f2355335324 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -192,7 +192,6 @@ QDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx, struct sir_hw_mode_params *hw_mode); int8_t wma_get_num_dbs_hw_modes(void); bool wma_is_hw_dbs_capable(void); -bool wma_is_hw_agile_dfs_capable(void); int8_t wma_get_mac_id_of_vdev(uint32_t vdev_id); void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id, uint32_t cfgd_hw_mode_index); @@ -202,7 +201,6 @@ void wma_set_dbs_capability_ut(uint32_t dbs); QDF_STATUS wma_get_dbs_hw_modes(bool *one_by_one_dbs, bool *two_by_two_dbs); QDF_STATUS wma_get_current_hw_mode(struct sir_hw_mode_params *hw_mode); bool wma_is_dbs_enable(void); -bool wma_is_agile_dfs_enable(void); QDF_STATUS wma_get_updated_scan_config(uint32_t *scan_config, bool dbs_scan, bool dbs_plus_agile_scan, diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 296bbe3bda9d..ef657c461bab 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4159,9 +4159,8 @@ void wma_dump_dbs_hw_mode(tp_wma_handle wma_handle) WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param), WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param), WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET(param)); - WMA_LOGA("%s:[%d] DBS:%d Agile DFS:%d", __func__, i, - WMI_DBS_HW_MODE_DBS_MODE_GET(param), - WMI_DBS_HW_MODE_AGILE_DFS_GET(param)); + WMA_LOGA("%s:[%d] DBS:%d", __func__, i, + WMI_DBS_HW_MODE_DBS_MODE_GET(param)); } } @@ -4800,6 +4799,200 @@ static void wma_print_populate_soc_caps(t_wma_handle *wma_handle) WMA_LOGI("%s: <====== HW mode cap printing ends ======>\n", __func__); } +/** + * wma_map_wmi_channel_width_to_hw_mode_bw() - returns bandwidth + * in terms of hw_mode_bandwidth + * @width: bandwidth in terms of wmi_channel_width + * + * This function returns the bandwidth in terms of hw_mode_bandwidth. + * + * Return: BW in terms of hw_mode_bandwidth. + */ +enum hw_mode_bandwidth wma_map_wmi_channel_width_to_hw_mode_bw( + wmi_channel_width width) +{ + switch (width) { + case WMI_CHAN_WIDTH_20: + return HW_MODE_20_MHZ; + case WMI_CHAN_WIDTH_40: + return HW_MODE_40_MHZ; + case WMI_CHAN_WIDTH_80: + return HW_MODE_80_MHZ; + case WMI_CHAN_WIDTH_160: + return HW_MODE_160_MHZ; + case WMI_CHAN_WIDTH_80P80: + return HW_MODE_80_PLUS_80_MHZ; + case WMI_CHAN_WIDTH_5: + return HW_MODE_5_MHZ; + case WMI_CHAN_WIDTH_10: + return HW_MODE_10_MHZ; + default: + return HW_MODE_BW_NONE; + } + + return HW_MODE_BW_NONE; +} + +/** + * wma_get_hw_mode_params() - get TX-RX stream and bandwidth + * supported from the capabilities. + * @caps: PHY capability + * @info: param to store TX-RX stream and BW information + * + * This function will calculate TX-RX stream and bandwidth supported + * as per the PHY capability, and assign to mac_ss_bw_info. + * + * Return: none + */ +static void wma_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, + struct mac_ss_bw_info *info) +{ + if (!caps) { + WMA_LOGE("%s: Invalid capabilities", __func__); + return; + } + + info->mac_tx_stream = wma_get_num_of_setbits_from_bitmask( + QDF_MAX(caps->tx_chain_mask_2G, + caps->tx_chain_mask_5G)); + info->mac_rx_stream = wma_get_num_of_setbits_from_bitmask( + QDF_MAX(caps->rx_chain_mask_2G, + caps->rx_chain_mask_5G)); + info->mac_bw = wma_map_wmi_channel_width_to_hw_mode_bw( + QDF_MAX(caps->max_bw_supported_2G, + caps->max_bw_supported_5G)); +} + +/** + * wma_set_hw_mode_params() - sets TX-RX stream, bandwidth and + * DBS in hw_mode_list + * @wma_handle: pointer to wma global structure + * @mac0_ss_bw_info: TX-RX streams, BW for MAC0 + * @mac1_ss_bw_info: TX-RX streams, BW for MAC1 + * @pos: refers to hw_mode_index + * @dbs_mode: dbs_mode for the dbs_hw_mode + * + * This function sets TX-RX stream, bandwidth and DBS mode in + * hw_mode_list. + * + * Return: none + */ +static void wma_set_hw_mode_params(t_wma_handle *wma_handle, + struct mac_ss_bw_info mac0_ss_bw_info, + struct mac_ss_bw_info mac1_ss_bw_info, + uint32_t pos, uint32_t dbs_mode) +{ + WMI_DBS_HW_MODE_MAC0_TX_STREAMS_SET( + wma_handle->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_tx_stream); + WMI_DBS_HW_MODE_MAC0_RX_STREAMS_SET( + wma_handle->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_rx_stream); + WMI_DBS_HW_MODE_MAC0_BANDWIDTH_SET( + wma_handle->hw_mode.hw_mode_list[pos], + mac0_ss_bw_info.mac_bw); + WMI_DBS_HW_MODE_MAC1_TX_STREAMS_SET( + wma_handle->hw_mode.hw_mode_list[pos], + mac1_ss_bw_info.mac_tx_stream); + WMI_DBS_HW_MODE_MAC1_RX_STREAMS_SET( + wma_handle->hw_mode.hw_mode_list[pos], + mac1_ss_bw_info.mac_rx_stream); + WMI_DBS_HW_MODE_MAC1_BANDWIDTH_SET( + wma_handle->hw_mode.hw_mode_list[pos], + mac1_ss_bw_info.mac_bw); + WMI_DBS_HW_MODE_DBS_MODE_SET( + wma_handle->hw_mode.hw_mode_list[pos], + dbs_mode); + WMI_DBS_HW_MODE_AGILE_DFS_SET( + wma_handle->hw_mode.hw_mode_list[pos], + 0); +} + +/** + * wma_update_hw_mode_list() - updates hw_mode_list + * @wma_handle: pointer to wma global structure + * + * This function updates hw_mode_list with tx_streams, rx_streams, + * bandwidth, dbs and agile dfs for each hw_mode. + * + * Returns: 0 for success else failure. + */ +static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) +{ + struct extended_caps *phy_caps; + WMI_MAC_PHY_CAPABILITIES *tmp; + uint32_t i, dbs_mode, hw_config_type, j = 0; + struct mac_ss_bw_info mac0_ss_bw_info = {0}; + struct mac_ss_bw_info mac1_ss_bw_info = {0}; + + if (!wma_handle) { + WMA_LOGE("%s: Invalid wma handle", __func__); + return QDF_STATUS_E_FAILURE; + } + + phy_caps = &wma_handle->phy_caps; + if (!phy_caps) { + WMA_LOGE("%s: Invalid phy capabilities", __func__); + return QDF_STATUS_SUCCESS; + } + + if (!phy_caps->num_hw_modes.num_hw_modes) { + WMA_LOGE("%s: Number of HW modes: %d", + __func__, phy_caps->num_hw_modes.num_hw_modes); + return QDF_STATUS_SUCCESS; + } + + /* + * This list was updated as part of service ready event. Re-populate + * HW mode list from the device capabilities. + */ + if (wma_handle->hw_mode.hw_mode_list) { + qdf_mem_free(wma_handle->hw_mode.hw_mode_list); + wma_handle->hw_mode.hw_mode_list = NULL; + WMA_LOGI("%s: DBS list is freed", __func__); + } + + wma_handle->num_dbs_hw_modes = phy_caps->num_hw_modes.num_hw_modes; + wma_handle->hw_mode.hw_mode_list = + qdf_mem_malloc(sizeof(*wma_handle->hw_mode.hw_mode_list) * + wma_handle->num_dbs_hw_modes); + if (!wma_handle->hw_mode.hw_mode_list) { + WMA_LOGE("%s: Memory allocation failed for DBS", __func__); + return QDF_STATUS_E_FAILURE; + } + + WMA_LOGA("%s: Updated HW mode list: Num modes:%d", + __func__, wma_handle->num_dbs_hw_modes); + + for (i = 0; i < wma_handle->num_dbs_hw_modes; i++) { + /* Update for MAC0 */ + tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; + wma_get_hw_mode_params(tmp, &mac0_ss_bw_info); + hw_config_type = + phy_caps->each_hw_mode_cap[i].hw_mode_config_type; + dbs_mode = 0; + mac1_ss_bw_info.mac_tx_stream = 0; + mac1_ss_bw_info.mac_rx_stream = 0; + mac1_ss_bw_info.mac_bw = 0; + + /* SBS and DBS have dual MAC. Upto 2 MACs are considered. */ + if ((hw_config_type == WMI_HW_MODE_DBS) || + (hw_config_type == WMI_HW_MODE_SBS_PASSIVE) || + (hw_config_type == WMI_HW_MODE_SBS)) { + /* Update for MAC1 */ + tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; + wma_get_hw_mode_params(tmp, &mac1_ss_bw_info); + dbs_mode = 1; + } + + /* Updating HW mode list */ + wma_set_hw_mode_params(wma_handle, mac0_ss_bw_info, + mac1_ss_bw_info, i, dbs_mode); + } + wma_dump_dbs_hw_mode(wma_handle); + return QDF_STATUS_SUCCESS; +} + /** * wma_populate_soc_caps() - populate entire SOC's capabilities * @wma_handle: pointer to wma global structure @@ -4988,6 +5181,12 @@ int wma_rx_service_ready_ext_event(void *handle, uint8_t *event, } wma_populate_soc_caps(wma_handle, param_buf); + ret = wma_update_hw_mode_list(wma_handle); + if (QDF_IS_STATUS_ERROR(ret)) { + WMA_LOGE("Failed to update hw mode list"); + return -EINVAL; + } + WMA_LOGA("WMA --> WMI_INIT_CMDID"); status = wmi_unified_send_saved_init_cmd(wma_handle->wmi_handle); if (status != EOK) diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 945e139adfc2..b4aab11b8e34 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2572,7 +2572,12 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, t_mac0_bw = WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET( wma->hw_mode.hw_mode_list[i]); - if (t_mac0_bw != mac0_bw) + /* + * Firmware advertises max bw capability as CBW 80+80 + * for single MAC. Thus CBW 20/40/80 should also be + * supported, if CBW 80+80 is supported. + */ + if (t_mac0_bw < mac0_bw) continue; t_mac1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET( @@ -2587,7 +2592,7 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, t_mac1_bw = WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET( wma->hw_mode.hw_mode_list[i]); - if (t_mac1_bw != mac1_bw) + if (t_mac1_bw < mac1_bw) continue; dbs_mode = WMI_DBS_HW_MODE_DBS_MODE_GET( @@ -2771,58 +2776,6 @@ bool wma_is_hw_dbs_capable(void) return false; } -/** - * wma_is_hw_agile_dfs_capable() - Check if HW is agile DFS capable - * - * Checks if the HW is agile DFS capable - * - * Return: true if the HW is agile DFS capable - */ -bool wma_is_hw_agile_dfs_capable(void) -{ - tp_wma_handle wma; - uint32_t param, i, found = 0; - - wma = cds_get_context(QDF_MODULE_ID_WMA); - if (!wma) { - WMA_LOGE("%s: Invalid WMA handle", __func__); - return false; - } - - if (!wma_is_agile_dfs_enable()) { - WMA_LOGI("%s: Agile DFS is disabled", __func__); - return false; - } - - WMA_LOGI("%s: DBS service bit map: %d", __func__, - WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap, - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)); - - /* The agreement with FW is that to know if the target is Agile DFS - * capable, DBS needs to be supported in the service bit map and - * Agile DFS needs to be supported in the HW mode list - */ - if (!(WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap, - WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT))) - return false; - - for (i = 0; i < wma->num_dbs_hw_modes; i++) { - param = wma->hw_mode.hw_mode_list[i]; - WMA_LOGI("%s: HW param: %x", __func__, param); - if (WMI_DBS_HW_MODE_AGILE_DFS_GET(param)) { - WMA_LOGI("%s: HW %d is agile DFS capable", - __func__, i); - found = 1; - break; - } - } - - if (found) - return true; - - return false; -} - /** * wma_get_mac_id_of_vdev() - Get MAC id corresponding to a vdev * @vdev_id: VDEV whose MAC ID is required @@ -3092,42 +3045,6 @@ bool wma_is_dbs_enable(void) return false; } -/** - * wma_is_agile_dfs_enable() - Check if master Agile DFS control is enabled - * - * Checks if the master Agile DFS control is enabled. This will be used - * to override any other Agile DFS capability - * - * Return: True if master Agile DFS control is enabled - */ -bool wma_is_agile_dfs_enable(void) -{ - tp_wma_handle wma; - - if (wma_is_dual_mac_disabled_in_ini()) - return false; - - wma = cds_get_context(QDF_MODULE_ID_WMA); - if (!wma) { - WMA_LOGE("%s: Invalid WMA handle", __func__); - return false; - } - - WMA_LOGD("%s: DFS=%d Single mac with DFS=%d", __func__, - WMI_DBS_FW_MODE_CFG_AGILE_DFS_GET( - wma->dual_mac_cfg.cur_fw_mode_config), - WMI_DBS_CONC_SCAN_CFG_AGILE_DFS_SCAN_GET( - wma->dual_mac_cfg.cur_scan_config)); - - if ((WMI_DBS_FW_MODE_CFG_AGILE_DFS_GET( - wma->dual_mac_cfg.cur_fw_mode_config)) && - (WMI_DBS_CONC_SCAN_CFG_AGILE_DFS_SCAN_GET( - wma->dual_mac_cfg.cur_scan_config))) - return true; - - return false; -} - /** * wma_get_updated_scan_config() - Get the updated scan configuration * @scan_config: Pointer containing the updated scan config From 4c48af3db1dc6b55004c1a3de102946e496626df Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Mon, 3 Oct 2016 15:57:08 +0530 Subject: [PATCH 023/113] qcacld-3.0: Update BW for interface when moving to single MAC mode If the device is operating in MAC0 and MAC1. If the interface present is MAC0 is removed, the interface in MAC1 moves to MAC0. But the bandwidth for the interface is not updated properly. The fix is to update the bandwidth of the MAC1's interface when the MAC0's interface is removed, and is replaced by MAC1's interface. Change-Id: If114167f66d13a3660f9b92b72706bfc2e782b50 CRs-Fixed: 1073581 --- core/cds/src/cds_concurrency.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 76831e3d58ca..25155c2c18d5 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -4364,6 +4364,8 @@ QDF_STATUS cds_decr_connection_count(uint32_t vdev_id) conc_connection_list[next_conn_index].mac; conc_connection_list[conn_index].chan = conc_connection_list[next_conn_index].chan; + conc_connection_list[conn_index].bw = + conc_connection_list[next_conn_index].bw; conc_connection_list[conn_index].chain_mask = conc_connection_list[next_conn_index].chain_mask; conc_connection_list[conn_index].original_nss = From 81eb2b3f6e73487380d8d8e4e1673180d2902794 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 09:49:04 -0700 Subject: [PATCH 024/113] Release 5.1.0.29R Release 5.1.0.29R Change-Id: I7d4d89b51ab0e2e0b0b258c41fa14699cdfcb982 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 08e825f6b615..c5038b641024 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Q" +#define QWLAN_VERSION_EXTRA "R" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29Q" +#define QWLAN_VERSIONSTR "5.1.0.29R" #endif /* QWLAN_VERSION_H */ From a89d3b4d800423443c46b70aaa1e4ded851e2eff Mon Sep 17 00:00:00 2001 From: Bhargav Shah Date: Wed, 20 Apr 2016 13:04:56 +0530 Subject: [PATCH 025/113] qcacld-3.0: Avoid race condition when vdev is deleted qcacld-2.0 to qcacld-3.0 propagation If SME posts message to WMI after vdev_detach happens, there can be a race condition. In this case VDEV_SET_PARAM will be called after VDEV_DELETE. Fix this with introduction of new Boolean flag "is_vdev_valid" which will be true after VDEV_CREATE is done. This flag will be false when deletion of vdev happens. WMI will do VDEV_SET_PARAM only if "is_vdev_valid" true. Change-Id: Idffd0979bd9bdefa1225d2ea6a24180d81000f48 CRs-Fixed: 964146 --- core/wma/inc/wma.h | 1 + core/wma/src/wma_dev_if.c | 8 ++++++++ core/wma/src/wma_main.c | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index c1be1096a6f2..d2f86a0838ac 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -991,6 +991,7 @@ struct wma_txrx_node { uint8_t wep_default_key_idx; tSirHostOffloadReq arp_offload_req; tSirHostOffloadReq ns_offload_req; + bool is_vdev_valid; }; #if defined(QCA_WIFI_FTM) diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index d3d479e8f427..8813cbed84d2 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -546,6 +546,8 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle, if (!generate_rsp) { WMA_LOGE("Call txrx detach w/o callback for vdev %d", vdev_id); ol_txrx_vdev_detach(iface->handle, NULL, NULL); + iface->handle = NULL; + wma_handle->interfaces[vdev_id].is_vdev_valid = false; goto out; } @@ -573,6 +575,8 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle, } WMA_LOGD("Call txrx detach with callback for vdev %d", vdev_id); ol_txrx_vdev_detach(iface->handle, NULL, NULL); + iface->handle = NULL; + wma_handle->interfaces[vdev_id].is_vdev_valid = false; /* * send the response immediately if WMI_SERVICE_SYNC_DELETE_CMDS @@ -1525,6 +1529,7 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, tSirMacHTCapabilityInfo *phtCapInfo; cds_msg_t sme_msg = { 0 }; struct vdev_create_params params = { 0 }; + u_int8_t vdev_id; if (NULL == mac) { WMA_LOGE("%s: Failed to get mac", __func__); @@ -1547,6 +1552,8 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, goto end; } + vdev_id = self_sta_req->session_id; + txrx_vdev_type = wma_get_txrx_vdev_type(self_sta_req->type); if (wlan_op_mode_unknown == txrx_vdev_type) { @@ -1652,6 +1659,7 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, } } + wma_handle->interfaces[vdev_id].is_vdev_valid = true; ret = wma_vdev_set_param(wma_handle->wmi_handle, self_sta_req->session_id, WMI_VDEV_PARAM_MCC_RTSCTS_PROTECTION_ENABLE, diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index ef657c461bab..ebafc4418589 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -872,6 +872,11 @@ static void wma_process_cli_set_cmd(tp_wma_handle wma, switch (privcmd->param_vp_dev) { case VDEV_CMD: + if (!wma->interfaces[privcmd->param_vdev_id].is_vdev_valid) { + WMA_LOGE("%s Vdev id is not valid", __func__); + return ; + } + WMA_LOGD("vdev id %d pid %d pval %d", privcmd->param_vdev_id, privcmd->param_id, privcmd->param_value); ret = wma_vdev_set_param(wma->wmi_handle, From a71196710cedc2d56342b8f06f891aa254d4d8b7 Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Tue, 16 Aug 2016 16:05:14 +0530 Subject: [PATCH 026/113] qcacld-3.0: Set Tx/Rx aggregation size qcacld-2.0 to qcacld-3.0 propagation Add changes to set Tx/Rx aggregation size. Also, add ini parameters for Tx/Rx aggregation sizes. Change-Id: Ia5811bf7cf7081989fde5c8cdcca84b42120b90c CRs-Fixed: 990161 --- core/hdd/inc/wlan_hdd_cfg.h | 20 ++++++ core/hdd/src/wlan_hdd_cfg.c | 19 ++++++ core/hdd/src/wlan_hdd_cfg80211.c | 42 ++++++++++++ core/hdd/src/wlan_hdd_cfg80211.h | 8 +++ core/mac/inc/sir_api.h | 12 ++++ .../src/pe/lim/lim_process_mlm_req_messages.c | 4 ++ core/sme/inc/csr_api.h | 2 + core/sme/inc/csr_internal.h | 2 + core/sme/src/csr/csr_api_roam.c | 13 ++++ core/wma/inc/wma_api.h | 2 + core/wma/inc/wma_if.h | 4 ++ core/wma/src/wma_dev_if.c | 12 ++++ core/wma/src/wma_features.c | 65 +++++++++++++++++++ 13 files changed, 205 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index c0b065f4b761..a7408810cd73 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2822,6 +2822,24 @@ typedef enum { #define CFG_SELF_GEN_FRM_PWR_MAX (0xffff) #define CFG_SELF_GEN_FRM_PWR_DEFAULT (0) +/* + * gTxAggregationSize gives an option to configure Tx aggregation size + * in no of MPDUs. This can be useful in debugging throughput issues + */ +#define CFG_TX_AGGREGATION_SIZE "gTxAggregationSize" +#define CFG_TX_AGGREGATION_SIZE_MIN (0) +#define CFG_TX_AGGREGATION_SIZE_MAX (64) +#define CFG_TX_AGGREGATION_SIZE_DEFAULT (64) + +/* + * gRxAggregationSize gives an option to configure Rx aggregation size + * in no of MPDUs. This can be useful in debugging throughput issues + */ +#define CFG_RX_AGGREGATION_SIZE "gRxAggregationSize" +#define CFG_RX_AGGREGATION_SIZE_MIN (1) +#define CFG_RX_AGGREGATION_SIZE_MAX (64) +#define CFG_RX_AGGREGATION_SIZE_DEFAULT (64) + /* * fine timing measurement capability information * @@ -4163,6 +4181,8 @@ struct hdd_config { uint8_t sifs_burst_duration; bool goptimize_chan_avoid_event; bool enable_go_cts2self_for_sta; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index d22a5f8bde3f..0c017df08a37 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3985,6 +3985,20 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_OPTIMIZE_CA_EVENT_DEFAULT, CFG_OPTIMIZE_CA_EVENT_DISABLE, CFG_OPTIMIZE_CA_EVENT_ENABLE), + + REG_VARIABLE(CFG_TX_AGGREGATION_SIZE, WLAN_PARAM_Integer, + struct hdd_config, tx_aggregation_size, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_TX_AGGREGATION_SIZE_DEFAULT, + CFG_TX_AGGREGATION_SIZE_MIN, + CFG_TX_AGGREGATION_SIZE_MAX), + + REG_VARIABLE(CFG_RX_AGGREGATION_SIZE, WLAN_PARAM_Integer, + struct hdd_config, rx_aggregation_size, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_RX_AGGREGATION_SIZE_DEFAULT, + CFG_RX_AGGREGATION_SIZE_MIN, + CFG_RX_AGGREGATION_SIZE_MAX), }; /** @@ -7154,6 +7168,11 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) CSR_STA_ROAM_POLICY_DFS_ENABLED; smeConfig->csrConfig.sta_roam_policy_params.skip_unsafe_channels = 0; + smeConfig->csrConfig.tx_aggregation_size = + pHddCtx->config->tx_aggregation_size; + smeConfig->csrConfig.rx_aggregation_size = + pHddCtx->config->rx_aggregation_size; + status = sme_update_config(pHddCtx->hHal, smeConfig); if (!QDF_IS_STATUS_SUCCESS(status)) { hddLog(LOGE, "sme_update_config() return failure %d", diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 2e6c4af0de56..1d40f77e2804 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3870,6 +3870,8 @@ wlan_hdd_wifi_config_policy[QCA_WLAN_VENDOR_ATTR_CONFIG_MAX + 1] = { [QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR] = {.type = NLA_U16 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME] = {.type = NLA_U32 }, [QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION] = {.type = NLA_U8 }, + [QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION] = {.type = NLA_U8 }, }; /** @@ -3938,6 +3940,8 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, bool vendor_ie_present = false, access_policy_present = false; uint16_t scan_ie_len = 0; uint8_t *scan_ie; + struct sir_set_tx_rx_aggregation_size request; + QDF_STATUS qdf_status; ENTER_DEV(dev); @@ -4096,6 +4100,44 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, } else ret_val = -EPERM; } + + if (tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION] || + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]) { + /* if one is specified, both must be specified */ + if (!tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION] || + !tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]) { + hdd_err("Both TX and RX MPDU Aggregation required"); + return -EINVAL; + } + + request.tx_aggregation_size = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION]); + request.rx_aggregation_size = nla_get_u8( + tb[QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION]); + request.vdev_id = adapter->sessionId; + + if (request.tx_aggregation_size >= + CFG_TX_AGGREGATION_SIZE_MIN && + request.tx_aggregation_size <= + CFG_TX_AGGREGATION_SIZE_MAX && + request.rx_aggregation_size >= + CFG_RX_AGGREGATION_SIZE_MIN && + request.rx_aggregation_size <= + CFG_RX_AGGREGATION_SIZE_MAX) { + qdf_status = wma_set_tx_rx_aggregation_size(&request); + if (qdf_status != QDF_STATUS_SUCCESS) { + hdd_err("failed to set aggr sizes err %d", + qdf_status); + ret_val = -EPERM; + } + } else { + hdd_err("TX %d RX %d MPDU aggr size not in range", + request.tx_aggregation_size, + request.rx_aggregation_size); + ret_val = -EINVAL; + } + } + return ret_val; } diff --git a/core/hdd/src/wlan_hdd_cfg80211.h b/core/hdd/src/wlan_hdd_cfg80211.h index 80dbc428c50b..37fa4e6ab79a 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.h +++ b/core/hdd/src/wlan_hdd_cfg80211.h @@ -2319,6 +2319,10 @@ enum qca_access_policy { * @QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR: stats avg. factor * @QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME: guard time * @QCA_WLAN_VENDOR_ATTR_CONFIG_FINE_TIME_MEASUREMENT: fine time measurement + * @QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION: + * Tx aggregation size (8-bit unsigned value) + * @QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION: + * Rx aggregation size (8-bit unsigned value) * @QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES: Update the default scan IEs * @QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_COMMAND: * Unsigned 32-bit value attribute for generic commands @@ -2349,6 +2353,10 @@ enum qca_wlan_vendor_config { QCA_WLAN_VENDOR_ATTR_CONFIG_FINE_TIME_MEASUREMENT, QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS, QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND, + + QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION, + QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION, + /* Attribute used to set scan default IEs to the driver. * * These IEs can be used by scan operations that will be initiated by diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 362275c14bd3..b31a834a5399 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -6450,6 +6450,18 @@ struct sme_ndp_peer_ind { #endif /* WLAN_FEATURE_NAN_DATAPATH */ +/** + * struct sir_set_tx_rx_aggregation_size - sets tx rx aggregation size + * @vdev_id: vdev id of the session + * @tx_aggregation_size: Tx aggregation size + * @rx_aggregation_size: Rx aggregation size + */ +struct sir_set_tx_rx_aggregation_size { + uint8_t vdev_id; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; +}; + /** * struct sir_p2p_lo_start - p2p listen offload start * @vdev_id: vdev identifier diff --git a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c index 1c914142c3d6..09e5c52f867e 100644 --- a/core/mac/src/pe/lim/lim_process_mlm_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_mlm_req_messages.c @@ -595,6 +595,10 @@ lim_mlm_add_bss(tpAniSirGlobal mac_ctx, if (QDF_IBSS_MODE == addbss_param->halPersona) { addbss_param->nss_2g = mac_ctx->vdev_type_nss_2g.ibss; addbss_param->nss_5g = mac_ctx->vdev_type_nss_5g.ibss; + addbss_param->tx_aggregation_size = + mac_ctx->roam.configParam.tx_aggregation_size; + addbss_param->rx_aggregation_size = + mac_ctx->roam.configParam.rx_aggregation_size; } lim_log(mac_ctx, LOG2, FL("dot11_mode:%d nss value:%d"), addbss_param->dot11_mode, addbss_param->nss); diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 47d654b8d06c..105682b6ed65 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1305,6 +1305,8 @@ typedef struct tagCsrConfigParam { enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy_params; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; } tCsrConfigParam; /* Tush */ diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index dd9dffafea2c..959a1ea019ed 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -666,6 +666,8 @@ typedef struct tagCsrConfig { enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; } tCsrConfig; typedef struct tagCsrChannelPowerInfo { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 74a0f586f26d..a401224bb099 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2518,6 +2518,11 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pMac->roam.configParam.sta_roam_policy.skip_unsafe_channels = pParam->sta_roam_policy_params.skip_unsafe_channels; + pMac->roam.configParam.tx_aggregation_size = + pParam->tx_aggregation_size; + pMac->roam.configParam.rx_aggregation_size = + pParam->rx_aggregation_size; + } return status; } @@ -2726,6 +2731,10 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pMac->roam.configParam.sta_roam_policy.dfs_mode; pParam->sta_roam_policy_params.skip_unsafe_channels = pMac->roam.configParam.sta_roam_policy.skip_unsafe_channels; + pParam->tx_aggregation_size = + pMac->roam.configParam.tx_aggregation_size; + pParam->rx_aggregation_size = + pMac->roam.configParam.rx_aggregation_size; return QDF_STATUS_SUCCESS; } @@ -15300,6 +15309,10 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, add_sta_self_req->sub_type = pAddStaReq->subType; add_sta_self_req->nss_2g = nss_2g; add_sta_self_req->nss_5g = nss_5g; + add_sta_self_req->tx_aggregation_size = + pMac->roam.configParam.tx_aggregation_size; + add_sta_self_req->rx_aggregation_size = + pMac->roam.configParam.rx_aggregation_size; msg.type = WMA_ADD_STA_SELF_REQ; msg.reserved = 0; diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 0f2355335324..295973ba2bc7 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -314,4 +314,6 @@ QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma, */ QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle, uint32_t cts2self_for_p2p_go); +QDF_STATUS wma_set_tx_rx_aggregation_size + (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); #endif diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 31939b60a393..ac553511ed98 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -514,6 +514,8 @@ typedef struct { uint8_t nss_2g; uint8_t nss_5g; uint8_t beacon_tx_rate; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; } tAddBssParams, *tpAddBssParams; /** @@ -1151,6 +1153,8 @@ struct add_sta_self_params { uint8_t nss_2g; uint8_t nss_5g; uint32_t status; + uint32_t tx_aggregation_size; + uint32_t rx_aggregation_size; }; /** diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 8813cbed84d2..6a7d2084b79c 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1530,6 +1530,7 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, cds_msg_t sme_msg = { 0 }; struct vdev_create_params params = { 0 }; u_int8_t vdev_id; + struct sir_set_tx_rx_aggregation_size tx_rx_aggregation_size; if (NULL == mac) { WMA_LOGE("%s: Failed to get mac", __func__); @@ -1609,6 +1610,17 @@ ol_txrx_vdev_handle wma_vdev_attach(tp_wma_handle wma_handle, self_sta_req->self_mac_addr, sizeof(wma_handle->interfaces[self_sta_req->session_id]. addr)); + + tx_rx_aggregation_size.tx_aggregation_size = + self_sta_req->tx_aggregation_size; + tx_rx_aggregation_size.rx_aggregation_size = + self_sta_req->rx_aggregation_size; + tx_rx_aggregation_size.vdev_id = self_sta_req->session_id; + + status = wma_set_tx_rx_aggregation_size(&tx_rx_aggregation_size); + if (status != QDF_STATUS_SUCCESS) + WMA_LOGE("failed to set aggregation sizes(err=%d)", status); + switch (self_sta_req->type) { case WMI_VDEV_TYPE_STA: if (wlan_cfg_get_int(mac, WNI_CFG_INFRA_STA_KEEP_ALIVE_PERIOD, diff --git a/core/wma/src/wma_features.c b/core/wma/src/wma_features.c index 567ed6e7abe4..7bd92da1bd99 100644 --- a/core/wma/src/wma_features.c +++ b/core/wma/src/wma_features.c @@ -7918,6 +7918,71 @@ QDF_STATUS wma_set_bpf_instructions(tp_wma_handle wma, return QDF_STATUS_SUCCESS; } +/** + * wma_set_tx_rx_aggregation_size() - sets tx rx aggregation sizes + * @tx_rx_aggregation_size: aggregation size parameters + * + * This function sets tx rx aggregation sizes + * + * Return: VOS_STATUS_SUCCESS on success, error number otherwise + */ +QDF_STATUS wma_set_tx_rx_aggregation_size( + struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size) +{ + tp_wma_handle wma_handle; + wmi_vdev_set_custom_aggr_size_cmd_fixed_param *cmd; + int32_t len; + wmi_buf_t buf; + u_int8_t *buf_ptr; + int ret; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + + if (!tx_rx_aggregation_size) { + WMA_LOGE("%s: invalid pointer", __func__); + return QDF_STATUS_E_INVAL; + } + + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return QDF_STATUS_E_INVAL; + } + + len = sizeof(*cmd); + buf = wmi_buf_alloc(wma_handle->wmi_handle, len); + + if (!buf) { + WMA_LOGE("%s: Failed allocate wmi buffer", __func__); + return QDF_STATUS_E_NOMEM; + } + + buf_ptr = (u_int8_t *) wmi_buf_data(buf); + cmd = (wmi_vdev_set_custom_aggr_size_cmd_fixed_param *) buf_ptr; + + WMITLV_SET_HDR(&cmd->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_set_custom_aggr_size_cmd_fixed_param, + WMITLV_GET_STRUCT_TLVLEN( + wmi_vdev_set_custom_aggr_size_cmd_fixed_param)); + + cmd->vdev_id = tx_rx_aggregation_size->vdev_id; + cmd->tx_aggr_size = tx_rx_aggregation_size->tx_aggregation_size; + cmd->rx_aggr_size = tx_rx_aggregation_size->rx_aggregation_size; + + WMA_LOGI("tx aggr: %d rx aggr: %d vdev: %d", + cmd->tx_aggr_size, cmd->rx_aggr_size, cmd->vdev_id); + + ret = wmi_unified_cmd_send(wma_handle->wmi_handle, buf, len, + WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID); + if (ret) { + WMA_LOGE("%s: Failed to send aggregation size command", + __func__); + wmi_buf_free(buf); + return QDF_STATUS_E_FAILURE; + } + + return QDF_STATUS_SUCCESS; +} + /** * wma_p2p_lo_start() - P2P listen offload start * @params: p2p listen offload parameters From c846f3a36a4a0acb20551964b54826c7c460e863 Mon Sep 17 00:00:00 2001 From: "Kondabattini, Ganesh" Date: Wed, 5 Oct 2016 15:01:18 +0530 Subject: [PATCH 027/113] qcacld-3.0: Consider ACS override params only if ACS is enabled qcacld-2.0 to qcacld-3.0 propagation Consider the parameters 'acs_channel' and 'acs_dfs_mode' only when ACS is enabled for that SAP. Otherwise driver is going to override the channel even if user configures a fixed channel in hostapd.conf file. Change-Id: Ibe24828690ace91338ade10fd00c49fc4acdbd81 CRs-Fixed: 1026420 --- core/hdd/src/wlan_hdd_hostapd.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 94af9c09e7cf..5ca394f7fcb3 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -6942,10 +6942,21 @@ int wlan_hdd_cfg80211_start_bss(hdd_adapter_t *pHostapdAdapter, pConfig->enOverLapCh = iniConfig->gEnableOverLapCh; pConfig->dtim_period = pBeacon->dtim_period; - if (pHddCtx->acs_policy.acs_channel) - pConfig->channel = pHddCtx->acs_policy.acs_channel; - mode = pHddCtx->acs_policy.acs_dfs_mode; - pConfig->acs_dfs_mode = wlan_hdd_get_dfs_mode(mode); + hdd_info("acs_mode %d", pConfig->acs_cfg.acs_mode); + + if (pConfig->acs_cfg.acs_mode == true) { + hdd_info("acs_channel %d, acs_dfs_mode %d", + pHddCtx->acs_policy.acs_channel, + pHddCtx->acs_policy.acs_dfs_mode); + + if (pHddCtx->acs_policy.acs_channel) + pConfig->channel = pHddCtx->acs_policy.acs_channel; + mode = pHddCtx->acs_policy.acs_dfs_mode; + pConfig->acs_dfs_mode = wlan_hdd_get_dfs_mode(mode); + } + + hdd_info("pConfig->channel %d, pConfig->acs_dfs_mode %d", + pConfig->channel, pConfig->acs_dfs_mode); hdd_info("****pConfig->dtim_period=%d***", pConfig->dtim_period); From 9aba02f52c9b4a0bac618e5b3974a8d19bd2d7ac Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Thu, 11 Aug 2016 16:30:25 +0530 Subject: [PATCH 028/113] qcacld-3.0: Dump driver information qcacld-2.0 to qcacld-3.0 propagation Dump state information of HDD, SME, PE and WMA layers into a buffer. Contents of this buffer will be copied into user space using proc entry /proc/debugdriver/ driverdump. Change-Id: Ifbb102e440d7df20defa1a397964cb9b55082bf9 CRs-Fixed: 955357 --- core/cds/src/cds_api.c | 1 + core/hdd/inc/wlan_hdd_main.h | 2 + core/hdd/inc/wlan_hdd_memdump.h | 18 +++ core/hdd/src/wlan_hdd_main.c | 76 +++++++++++ core/hdd/src/wlan_hdd_memdump.c | 234 ++++++++++++++++++++++++++++++++ core/mac/src/pe/lim/lim_api.c | 59 ++++++++ core/sme/src/common/sme_api.c | 99 ++++++++++++++ core/wma/src/wma_main.c | 142 +++++++++++++++++++ 8 files changed, 631 insertions(+) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 0e6974a782ee..43a8ea336611 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -101,6 +101,7 @@ v_CONTEXT_t cds_init(void) #if defined(TRACE_RECORD) qdf_trace_init(); #endif + qdf_register_debugcb_init(); cds_ssr_protect_init(); diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 16dcc8cc01b4..6f263d2b1b64 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1469,6 +1469,8 @@ struct hdd_context_s { bool memdump_in_progress; bool memdump_init_done; #endif /* WLAN_FEATURE_MEMDUMP */ + uint16_t driver_dump_size; + uint8_t *driver_dump_mem; bool connection_in_progress; qdf_spinlock_t connection_status_lock; diff --git a/core/hdd/inc/wlan_hdd_memdump.h b/core/hdd/inc/wlan_hdd_memdump.h index 529f4c772380..5e670fe72785 100644 --- a/core/hdd/inc/wlan_hdd_memdump.h +++ b/core/hdd/inc/wlan_hdd_memdump.h @@ -37,6 +37,10 @@ #include "wlan_hdd_main.h" +/* Assigned size of driver memory dump is 4096 bytes */ +#define DRIVER_MEM_DUMP_SIZE 4096 + + #ifdef WLAN_FEATURE_MEMDUMP /** * enum qca_wlan_vendor_attr_memory_dump - values for memory dump attributes @@ -72,6 +76,10 @@ int wlan_hdd_cfg80211_get_fw_mem_dump(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, struct fw_dump_rsp *dump_rsp); + +int hdd_driver_memdump_init(void); +void hdd_driver_memdump_deinit(void); + #else static inline int memdump_init(void) { @@ -95,6 +103,16 @@ static inline void wlan_hdd_cfg80211_fw_mem_dump_cb(void *ctx, *dump_rsp) { } + +static inline int hdd_driver_memdump_init(void) +{ + return -ENOTSUPP; +} + +static inline void hdd_driver_memdump_deinit(void) +{ +} + #endif #endif /* if !defined(WLAN_HDD_MEMDUMP_H)*/ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 47b3c6470000..fda3035e02ab 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -4795,6 +4795,7 @@ void __hdd_wlan_exit(void) hdd_ipa_uc_force_pipe_shutdown(hdd_ctx); memdump_deinit(); + hdd_driver_memdump_deinit(); /* Do all the cleanup before deregistering the driver */ hdd_wlan_exit(hdd_ctx); @@ -7723,6 +7724,79 @@ static void hdd_iface_change_callback(void *priv) EXIT(); } +/** + * hdd_state_info_dump() - prints state information of hdd layer + * @buf: buffer pointer + * @size: size of buffer to be filled + * + * This function is used to dump state information of hdd layer + * + * Return: None + */ +static void hdd_state_info_dump(char **buf_ptr, uint16_t *size) +{ + hdd_context_t *hdd_ctx; + hdd_adapter_list_node_t *adapter_node = NULL, *next = NULL; + QDF_STATUS status; + hdd_station_ctx_t *hdd_sta_ctx; + hdd_adapter_t *adapter; + uint16_t len = 0; + char *buf = *buf_ptr; + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + hdd_err("Failed to get hdd context "); + return; + } + + hdd_notice("size of buffer: %d", *size); + + len += scnprintf(buf + len, *size - len, + "\n isWiphySuspended %d", hdd_ctx->isWiphySuspended); + len += scnprintf(buf + len, *size - len, + "\n isMcThreadSuspended %d", + hdd_ctx->isMcThreadSuspended); + + status = hdd_get_front_adapter(hdd_ctx, &adapter_node); + + while (NULL != adapter_node && QDF_STATUS_SUCCESS == status) { + adapter = adapter_node->pAdapter; + if (adapter->dev) + len += scnprintf(buf + len, *size - len, + "\n device name: %s", adapter->dev->name); + len += scnprintf(buf + len, *size - len, + "\n device_mode: %d", adapter->device_mode); + switch (adapter->device_mode) { + case QDF_STA_MODE: + case QDF_P2P_CLIENT_MODE: + hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + len += scnprintf(buf + len, *size - len, + "\n connState: %d", + hdd_sta_ctx->conn_info.connState); + break; + + default: + break; + } + status = hdd_get_next_adapter(hdd_ctx, adapter_node, &next); + adapter_node = next; + } + + *size -= len; + *buf_ptr += len; +} + +/** + * hdd_register_debug_callback() - registration function for hdd layer + * to print hdd state information + * + * Return: None + */ +static void hdd_register_debug_callback(void) +{ + qdf_register_debug_callback(QDF_MODULE_ID_HDD, &hdd_state_info_dump); +} + /** * hdd_wlan_startup() - HDD init function * @dev: Pointer to the underlying device @@ -7854,6 +7928,7 @@ int hdd_wlan_startup(struct device *dev) memdump_init(); hdd_encrypt_decrypt_init(hdd_ctx); + hdd_driver_memdump_init(); if (hdd_ctx->config->fIsImpsEnabled) hdd_set_idle_ps_config(hdd_ctx, true); @@ -8804,6 +8879,7 @@ int hdd_init(void) } hdd_trace_init(); + hdd_register_debug_callback(); err_out: return ret; diff --git a/core/hdd/src/wlan_hdd_memdump.c b/core/hdd/src/wlan_hdd_memdump.c index 1afe3fd7569c..195d066018b2 100644 --- a/core/hdd/src/wlan_hdd_memdump.c +++ b/core/hdd/src/wlan_hdd_memdump.c @@ -630,3 +630,237 @@ void memdump_deinit(void) if (!QDF_IS_STATUS_SUCCESS(qdf_status)) hdd_err("Failed to deallocate timer"); } + +#ifdef MULTI_IF_NAME +#define PROCFS_DRIVER_DUMP_DIR "debugdriver" MULTI_IF_NAME +#else +#define PROCFS_DRIVER_DUMP_DIR "debugdriver" +#endif +#define PROCFS_DRIVER_DUMP_NAME "driverdump" +#define PROCFS_DRIVER_DUMP_PERM 0444 + +static struct proc_dir_entry *proc_file_driver, *proc_dir_driver; + +/** + * hdd_driver_mem_cleanup() - Frees memory allocated for + * driver dump + * + * This function unallocates driver dump memory. + * + * Return: None + */ +static void hdd_driver_mem_cleanup(void) +{ + hdd_context_t *hdd_ctx; + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + hdd_err("Invalid HDD context"); + return; + } + + if (hdd_ctx->driver_dump_mem) { + qdf_mem_free(hdd_ctx->driver_dump_mem); + hdd_ctx->driver_dump_mem = NULL; + } +} + + +/** + * hdd_driver_memdump_read() - perform read operation in driver + * memory dump proc file + * @file - handle for the proc file. + * @buf - pointer to user space buffer. + * @count - number of bytes to be read. + * @pos - offset in the from buffer. + * + * This function performs read operation for the driver memory dump proc file. + * + * Return: number of bytes read on success, error code otherwise. + */ +static ssize_t hdd_driver_memdump_read(struct file *file, char __user *buf, + size_t count, loff_t *pos) +{ + int status; + QDF_STATUS qdf_status; + hdd_context_t *hdd_ctx; + size_t no_of_bytes_read = 0; + + hdd_ctx = memdump_get_file_data(file); + + hdd_notice("Read req for size:%zu pos:%llu", count, *pos); + status = wlan_hdd_validate_context(hdd_ctx); + if (status != 0) + return -EINVAL; + + if (*pos < 0) { + hdd_err("Invalid start offset for memdump read"); + return -EINVAL; + } else if (!count || (hdd_ctx->driver_dump_size && + (*pos >= hdd_ctx->driver_dump_size))) { + hdd_err("No more data to copy"); + return 0; + } else if ((*pos == 0) || (hdd_ctx->driver_dump_mem == NULL)) { + /* + * Allocate memory for Driver memory dump. + */ + if (!hdd_ctx->driver_dump_mem) { + hdd_ctx->driver_dump_mem = + qdf_mem_malloc(DRIVER_MEM_DUMP_SIZE); + if (!hdd_ctx->driver_dump_mem) { + hdd_err("qdf_mem_malloc failed"); + return -ENOMEM; + } + } + + qdf_status = qdf_state_info_dump_all(hdd_ctx->driver_dump_mem, + DRIVER_MEM_DUMP_SIZE, + &hdd_ctx->driver_dump_size); + /* + * If qdf_status is QDF_STATUS_E_NOMEM, then memory allocated is + * insufficient to dump driver information. This print can give + * information to allocate more memory if more information from + * each layer is added in future. + */ + if (qdf_status != QDF_STATUS_SUCCESS) + hdd_err("Error in dump driver information, status %d", + qdf_status); + hdd_notice("driver_dump_size: %d", + hdd_ctx->driver_dump_size); + } + + if (count > hdd_ctx->driver_dump_size - *pos) + no_of_bytes_read = hdd_ctx->driver_dump_size - *pos; + else + no_of_bytes_read = count; + + if (copy_to_user(buf, hdd_ctx->driver_dump_mem + *pos, + no_of_bytes_read)) { + hdd_err("copy to user space failed"); + return -EFAULT; + } + + /* offset(pos) should be updated here based on the copy done */ + *pos += no_of_bytes_read; + + /* Entire driver memory dump copy completed */ + if (*pos >= hdd_ctx->driver_dump_size) + hdd_driver_mem_cleanup(); + + return no_of_bytes_read; +} + + +/** + * struct driver_dump_fops - file operations for driver dump feature + * @read - read function for driver dump operation. + * + * This structure initialize the file operation handle for memory + * dump feature + */ +static const struct file_operations driver_dump_fops = { +read: hdd_driver_memdump_read +}; + +/** + * hdd_driver_memdump_procfs_init() - Initialize procfs for driver memory dump + * + * This function create file under proc file system to be used later for + * processing driver memory dump + * + * Return: 0 on success, error code otherwise. + */ +static int hdd_driver_memdump_procfs_init(void) +{ + hdd_context_t *hdd_ctx; + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + hdd_err("Invalid HDD context"); + return -EINVAL; + } + + proc_dir_driver = proc_mkdir(PROCFS_DRIVER_DUMP_DIR, NULL); + if (proc_dir_driver == NULL) { + pr_debug("Error: Could not initialize /proc/%s\n", + PROCFS_DRIVER_DUMP_DIR); + return -ENOMEM; + } + + proc_file_driver = proc_create_data(PROCFS_DRIVER_DUMP_NAME, + PROCFS_DRIVER_DUMP_PERM, proc_dir_driver, + &driver_dump_fops, hdd_ctx); + if (proc_file_driver == NULL) { + remove_proc_entry(PROCFS_DRIVER_DUMP_NAME, proc_dir_driver); + pr_debug("Error: Could not initialize /proc/%s\n", + PROCFS_DRIVER_DUMP_NAME); + return -ENOMEM; + } + + pr_debug("/proc/%s/%s created\n", PROCFS_DRIVER_DUMP_DIR, + PROCFS_DRIVER_DUMP_NAME); + return 0; +} + +/** + * hdd_driver_memdump_procfs_remove() - Remove file/dir under procfs + * for driver memory dump + * + * This function removes file/dir under proc file system that was + * processing driver memory dump + * + * Return: None + */ +static void hdd_driver_memdump_procfs_remove(void) +{ + remove_proc_entry(PROCFS_DRIVER_DUMP_NAME, proc_dir_driver); + pr_debug("/proc/%s/%s removed\n", PROCFS_DRIVER_DUMP_DIR, + PROCFS_DRIVER_DUMP_NAME); + remove_proc_entry(PROCFS_DRIVER_DUMP_DIR, NULL); + pr_debug("/proc/%s removed\n", PROCFS_DRIVER_DUMP_DIR); +} + +/** + * hdd_driver_memdump_init() - Intialization function for driver + * memory dump feature + * + * This function creates proc file for driver memdump feature + * + * Return - 0 on success, error otherwise + */ +int hdd_driver_memdump_init(void) +{ + int status; + + if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) { + hdd_err("Not initializing memdump in FTM mode"); + return -EINVAL; + } + + status = hdd_driver_memdump_procfs_init(); + if (status) { + hdd_err("Failed to create proc file"); + return status; + } + + return 0; +} + +/** + * hdd_driver_memdump_deinit() - De initialize driver memdump feature + * + * This function removes proc file created for driver memdump feature. + * + * Return: None + */ +void hdd_driver_memdump_deinit(void) +{ + if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) { + hdd_err("Not deinitializing memdump in FTM mode"); + return; + } + + hdd_driver_memdump_procfs_remove(); + + hdd_driver_mem_cleanup(); +} diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index a1e05650a5c5..2700e9ad55b7 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -681,6 +681,63 @@ void lim_cleanup(tpAniSirGlobal pMac) } /*** end lim_cleanup() ***/ +/** + * lim_state_info_dump() - print state information of lim layer + * @buf: buffer pointer + * @size: size of buffer to be filled + * + * This function is used to print state information of lim layer + * + * Return: None + */ +static void lim_state_info_dump(char **buf_ptr, uint16_t *size) +{ + tHalHandle hal; + tpAniSirGlobal mac; + uint16_t len = 0; + char *buf = *buf_ptr; + + hal = cds_get_context(QDF_MODULE_ID_PE); + if (hal == NULL) { + QDF_ASSERT(0); + return; + } + + mac = PMAC_STRUCT(hal); + + lim_log(mac, LOG1, FL("size of buffer: %d"), *size); + + len += qdf_scnprintf(buf + len, *size - len, + "\n SmeState: %d", mac->lim.gLimSmeState); + len += qdf_scnprintf(buf + len, *size - len, + "\n PrevSmeState: %d", mac->lim.gLimPrevSmeState); + len += qdf_scnprintf(buf + len, *size - len, + "\n MlmState: %d", mac->lim.gLimMlmState); + len += qdf_scnprintf(buf + len, *size - len, + "\n PrevMlmState: %d", mac->lim.gLimPrevMlmState); + len += qdf_scnprintf(buf + len, *size - len, + "\n SystemInScanLearnMode: %d", + mac->lim.gLimSystemInScanLearnMode); + len += qdf_scnprintf(buf + len, *size - len, + "\n ProcessDefdMsgs: %d", mac->lim.gLimProcessDefdMsgs); + len += qdf_scnprintf(buf + len, *size - len, + "\n gLimHalScanState: %d", mac->lim.gLimHalScanState); + + *size -= len; + *buf_ptr += len; +} + +/** + * lim_register_debug_callback() - registration function for lim layer + * to print lim state information + * + * Return: None + */ +static void lim_register_debug_callback(void) +{ + qdf_register_debug_callback(QDF_MODULE_ID_PE, &lim_state_info_dump); +} + /** ------------------------------------------------------------- \fn pe_open \brief will be called in Open sequence from mac_open @@ -746,6 +803,8 @@ tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg) #ifdef LIM_TRACE_RECORD MTRACE(lim_trace_init(pMac)); #endif + lim_register_debug_callback(); + return status; /* status here will be eSIR_SUCCESS */ pe_open_lock_fail: diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 738ba4302f88..7bfe3c9ff9a4 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1073,6 +1073,104 @@ bool sme_command_pending(tpAniSirGlobal pMac) LL_ACCESS_NOLOCK); } +/** + * sme_get_sessionid_from_activelist() - gets session id + * @mac: mac context + * + * This function is used to get session id from sme command + * active list + * + * Return: returns session id + */ +uint32_t sme_get_sessionid_from_activelist(tpAniSirGlobal mac) +{ + tListElem *entry; + tSmeCmd *command; + uint32_t session_id = CSR_SESSION_ID_INVALID; + + entry = csr_ll_peek_head(&mac->sme.smeCmdActiveList, LL_ACCESS_LOCK); + if (entry) { + command = GET_BASE_ADDR(entry, tSmeCmd, Link); + session_id = command->sessionId; + } + + return session_id; +} + +/** + * sme_state_info_dump() - prints state information of sme layer + * @buf: buffer pointer + * @size: size of buffer to be filled + * + * This function is used to dump state information of sme layer + * + * Return: None + */ +static void sme_state_info_dump(char **buf_ptr, uint16_t *size) +{ + uint32_t session_id, active_session_id; + tHalHandle hal; + tpAniSirGlobal mac; + uint16_t len = 0; + char *buf = *buf_ptr; + eCsrConnectState connect_state; + + hal = cds_get_context(QDF_MODULE_ID_SME); + if (hal == NULL) { + QDF_ASSERT(0); + return; + } + + mac = PMAC_STRUCT(hal); + sms_log(mac, LOG1, FL("size of buffer: %d"), *size); + + active_session_id = sme_get_sessionid_from_activelist(mac); + if (active_session_id != CSR_SESSION_ID_INVALID) { + len += qdf_scnprintf(buf + len, *size - len, + "\n active command sessionid %d", active_session_id); + } + + for (session_id = 0; session_id < CSR_ROAM_SESSION_MAX; session_id++) { + if (CSR_IS_SESSION_VALID(mac, session_id)) { + connect_state = + mac->roam.roamSession[session_id].connectState; + if ((eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED == + connect_state) + || (eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED == + connect_state)) { + len += qdf_scnprintf(buf + len, *size - len, + "\n NeighborRoamState: %d", + mac->roam.neighborRoamInfo[session_id]. + neighborRoamState); + len += qdf_scnprintf(buf + len, *size - len, + "\n RoamState: %d", mac->roam. + curState[session_id]); + len += qdf_scnprintf(buf + len, *size - len, + "\n RoamSubState: %d", mac->roam. + curSubState[session_id]); + len += qdf_scnprintf(buf + len, *size - len, + "\n ConnectState: %d", + connect_state); + } + } + } + + *size -= len; + *buf_ptr += len; +} + +/** + * sme_register_debug_callback() - registration function sme layer + * to print sme state information + * + * Return: None + */ +static void sme_register_debug_callback(void) +{ + qdf_register_debug_callback(QDF_MODULE_ID_SME, &sme_state_info_dump); +} + + /* Global APIs */ /** @@ -1134,6 +1232,7 @@ QDF_STATUS sme_open(tHalHandle hHal) } sme_p2p_open(pMac); sme_trace_init(pMac); + sme_register_debug_callback(); return status; } diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index ebafc4418589..3b5f543c30ac 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -1672,6 +1672,146 @@ static void wma_init_max_no_of_peers(tp_wma_handle wma_handle, struct wma_version_info g_wmi_version_info; +/** + * wma_state_info_dump() - prints state information of wma layer + * @buf: buffer pointer + * @size: size of buffer to be filled + * + * This function is used to dump state information of wma layer + * + * Return: None + */ +static void wma_state_info_dump(char **buf_ptr, uint16_t *size) +{ + tp_wma_handle wma_handle; + uint16_t len = 0; + char *buf = *buf_ptr; + struct wma_txrx_node *iface; + uint8_t vdev_id; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + if (!wma_handle) { + WMA_LOGE("%s: WMA context is invald!", __func__); + return; + } + + WMA_LOGI("%s: size of buffer: %d", __func__, *size); + + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_pno_match_wake_up_count %d", + wma_handle->wow_pno_match_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_pno_complete_wake_up_count %d", + wma_handle->wow_pno_complete_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_gscan_wake_up_count %d", + wma_handle->wow_gscan_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_low_rssi_wake_up_count %d", + wma_handle->wow_low_rssi_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_rssi_breach_wake_up_count %d", + wma_handle->wow_rssi_breach_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_ucast_wake_up_count %d", + wma_handle->wow_ucast_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_bcast_wake_up_count %d", + wma_handle->wow_bcast_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_ipv4_mcast_wake_up_count %d", + wma_handle->wow_ipv4_mcast_wake_up_count); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_ipv6_mcast_ra_stats %d", + wma_handle->wow_ipv6_mcast_ra_stats); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_ipv6_mcast_ns_stats %d", + wma_handle->wow_ipv6_mcast_ns_stats); + len += qdf_scnprintf(buf + len, *size - len, + "\n wow_ipv6_mcast_na_stats %d", + wma_handle->wow_ipv6_mcast_na_stats); + + for (vdev_id = 0; vdev_id < wma_handle->max_bssid; vdev_id++) { + if (!wma_handle->interfaces[vdev_id].handle) + continue; + + iface = &wma_handle->interfaces[vdev_id]; + + len += qdf_scnprintf(buf + len, *size - len, + "\n vdev_id %d", + vdev_id); + len += qdf_scnprintf(buf + len, *size - len, + "\n conn_state %d", + iface->conn_state); + len += qdf_scnprintf(buf + len, *size - len, + "\n dtimPeriod %d", + iface->dtimPeriod); + len += qdf_scnprintf(buf + len, *size - len, + "\n chanmode %d", + iface->chanmode); + len += qdf_scnprintf(buf + len, *size - len, + "\n vht_capable %d", + iface->vht_capable); + len += qdf_scnprintf(buf + len, *size - len, + "\n ht_capable %d", + iface->ht_capable); + len += qdf_scnprintf(buf + len, *size - len, + "\n chan_width %d", + iface->chan_width); + len += qdf_scnprintf(buf + len, *size - len, + "\n vdev_active %d", + iface->vdev_active); + len += qdf_scnprintf(buf + len, *size - len, + "\n vdev_up %d", + iface->vdev_up); + len += qdf_scnprintf(buf + len, *size - len, + "\n aid %d", + iface->aid); + len += qdf_scnprintf(buf + len, *size - len, + "\n rate_flags %d", + iface->rate_flags); + len += qdf_scnprintf(buf + len, *size - len, + "\n nss %d", + iface->nss); + len += qdf_scnprintf(buf + len, *size - len, + "\n tx_power %d", + iface->tx_power); + len += qdf_scnprintf(buf + len, *size - len, + "\n max_tx_power %d", + iface->max_tx_power); + len += qdf_scnprintf(buf + len, *size - len, + "\n nwType %d", + iface->nwType); + len += qdf_scnprintf(buf + len, *size - len, + "\n tx_streams %d", + iface->tx_streams); + len += qdf_scnprintf(buf + len, *size - len, + "\n rx_streams %d", + iface->rx_streams); + len += qdf_scnprintf(buf + len, *size - len, + "\n chain_mask %d", + iface->chain_mask); + len += qdf_scnprintf(buf + len, *size - len, + "\n nss_2g %d", + iface->nss_2g); + len += qdf_scnprintf(buf + len, *size - len, + "\n nss_5g %d", + iface->nss_5g); + } + + *size -= len; + *buf_ptr += len; +} + +/** + * wma_register_debug_callback() - registration function for wma layer + * to print wma state information + */ +static void wma_register_debug_callback(void) +{ + qdf_register_debug_callback(QDF_MODULE_ID_WMA, &wma_state_info_dump); +} + /** * wma_open() - Allocate wma context and initialize it. * @cds_context: cds context @@ -2157,6 +2297,8 @@ QDF_STATUS wma_open(void *cds_context, wma_encrypt_decrypt_msg_handler, WMA_RX_SERIALIZER_CTX); wma_ndp_register_all_event_handlers(wma_handle); + wma_register_debug_callback(); + return QDF_STATUS_SUCCESS; err_dbglog_init: From 022892105c574e1487110443baa69ec46f5bffea Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Fri, 30 Sep 2016 13:30:08 +0530 Subject: [PATCH 029/113] qcacld-3.0: Fix status code during disassociation qcacld-2.0 to qcacld-3.0 propagation Currently status code is mapped same as reason code which results in wrong status code mapping. Fix this by adding appropriate status code. Change-Id: I75a66601c33b4e93fcac674415f38d5a8184c8f3 CRs-Fixed: 1062308 --- core/mac/src/pe/lim/lim_send_sme_rsp_messages.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 26d0190c47d5..60ee95534a28 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1030,7 +1030,7 @@ lim_send_sme_disassoc_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, pSirSmeDisassocInd->sessionId = psessionEntry->smeSessionId; pSirSmeDisassocInd->transactionId = psessionEntry->transactionId; - pSirSmeDisassocInd->statusCode = pStaDs->mlmStaContext.disassocReason; + pSirSmeDisassocInd->statusCode = eSIR_SME_DEAUTH_STATUS; pSirSmeDisassocInd->reasonCode = pStaDs->mlmStaContext.disassocReason; qdf_mem_copy(pSirSmeDisassocInd->bssid.bytes, psessionEntry->bssId, From 4b2efbbb0c2bb185f929771b07501974538fee04 Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Mon, 3 Oct 2016 13:07:20 +0530 Subject: [PATCH 030/113] qcacld-3.0: Add support for 2.4G VHT Interop in SAP qcacld-2.0 to qcacld-3.0 propagation In 2.4GHz some stations advertise VHT capability IE in Assoc Req frame. Add support to detect the VHT capability in vendor specific IE in Assoc Req frame and establish the connection with VHT mode to improve performance. Change-Id: I08dbcb3ce1895aa2108924d7a672e5d9be514e3d CRs-Fixed: 924814 --- core/hdd/inc/wlan_hdd_cfg.h | 11 ++ core/hdd/src/wlan_hdd_cfg.c | 13 ++ core/mac/inc/sir_api.h | 1 + core/mac/src/cfg/cfgUtil/dot11f.frms | 18 +-- core/mac/src/include/dot11f.h | 40 ++--- core/mac/src/include/parser_api.h | 5 +- core/mac/src/pe/include/lim_session.h | 1 + core/mac/src/pe/lim/lim_assoc_utils.c | 48 +++--- .../src/pe/lim/lim_process_assoc_req_frame.c | 39 ++++- .../src/pe/lim/lim_process_assoc_rsp_frame.c | 4 +- .../src/pe/lim/lim_process_sme_req_messages.c | 2 + core/mac/src/pe/lim/lim_prop_exts_utils.c | 2 +- .../src/pe/lim/lim_send_frames_host_roam.c | 10 +- .../src/pe/lim/lim_send_management_frames.c | 29 +++- .../mac/src/sys/legacy/src/utils/src/dot11f.c | 137 +++++++++--------- .../src/sys/legacy/src/utils/src/parser_api.c | 103 +++++++------ core/sme/inc/csr_api.h | 1 + core/sme/inc/csr_internal.h | 1 + core/sme/src/csr/csr_api_roam.c | 15 +- core/sme/src/csr/csr_util.c | 2 +- 20 files changed, 291 insertions(+), 191 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index a7408810cd73..7bbc547e51c0 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1974,6 +1974,16 @@ typedef enum { #define CFG_ENABLE_VHT_FOR_24GHZ_MAX (1) #define CFG_ENABLE_VHT_FOR_24GHZ_DEFAULT (0) +/* + * Parameter to control VHT support based on vendor ie in 2.4 GHz band + * This parameter will enable SAP to read VHT capability in vendor ie in Assoc + * Req and send VHT caps in Resp to establish connection in VHT Mode. + */ +#define CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_NAME "gEnableVendorVhtFor24GHzBand" +#define CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_MIN (0) +#define CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_MAX (1) +#define CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_DEFAULT (1) + #define CFG_MAX_MEDIUM_TIME "gMaxMediumTime" #define CFG_MAX_MEDIUM_TIME_STAMIN WNI_CFG_MAX_MEDIUM_TIME_STAMIN #define CFG_MAX_MEDIUM_TIME_STAMAX WNI_CFG_MAX_MEDIUM_TIME_STAMAX @@ -3889,6 +3899,7 @@ struct hdd_config { bool enableSSR; uint32_t cfgMaxMediumTime; bool enableVhtFor24GHzBand; + bool enable_sap_vendor_vht; /* Flag indicating whether legacy fast roam during concurrency is enabled in cfg.ini or not */ bool bFastRoamInConIniFeatureEnabled; bool fEnableAdaptRxDrain; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 0c017df08a37..27b227ec7751 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2468,6 +2468,14 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_ENABLE_VHT_FOR_24GHZ_MIN, CFG_ENABLE_VHT_FOR_24GHZ_MAX), + + REG_VARIABLE(CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_NAME, WLAN_PARAM_Integer, + struct hdd_config, enable_sap_vendor_vht, + VAR_FLAGS_OPTIONAL, + CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_DEFAULT, + CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_MIN, + CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_MAX), + REG_DYNAMIC_VARIABLE(CFG_ENABLE_FAST_ROAM_IN_CONCURRENCY, WLAN_PARAM_Integer, struct hdd_config, bFastRoamInConIniFeatureEnabled, @@ -5567,6 +5575,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%u]", CFG_IGNORE_PEER_HT_MODE_NAME, pHddCtx->config->ignore_peer_ht_opmode); + hdd_info("Name = [%s] Value = [%u]", + CFG_ENABLE_VENDOR_VHT_FOR_24GHZ_NAME, + pHddCtx->config->enable_sap_vendor_vht); hdd_info("Name = [%s] Value = [%u]", CFG_ENABLE_FATAL_EVENT_TRIGGER, pHddCtx->config->enable_fatal_event); @@ -6918,6 +6929,8 @@ QDF_STATUS hdd_set_sme_config(hdd_context_t *pHddCtx) pConfig->enable_txbf_sap_mode; smeConfig->csrConfig.enable2x2 = pConfig->enable2x2; smeConfig->csrConfig.enableVhtFor24GHz = pConfig->enableVhtFor24GHzBand; + smeConfig->csrConfig.vendor_vht_sap = + pConfig->enable_sap_vendor_vht; smeConfig->csrConfig.enableMuBformee = pConfig->enableMuBformee; smeConfig->csrConfig.enableVhtpAid = pConfig->enableVhtpAid; smeConfig->csrConfig.enableVhtGid = pConfig->enableVhtGid; diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index b31a834a5399..58d0cd20635c 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -695,6 +695,7 @@ typedef struct sSirSmeStartBssReq { bool obssEnabled; uint8_t sap_dot11mc; uint8_t beacon_tx_rate; + bool vendor_vht_sap; } tSirSmeStartBssReq, *tpSirSmeStartBssReq; diff --git a/core/mac/src/cfg/cfgUtil/dot11f.frms b/core/mac/src/cfg/cfgUtil/dot11f.frms index 80509932738c..01568e477771 100644 --- a/core/mac/src/cfg/cfgUtil/dot11f.frms +++ b/core/mac/src/cfg/cfgUtil/dot11f.frms @@ -2894,7 +2894,7 @@ MULTIIE P2PDisAssoc ( EID_VENDOR_SPECIFIC ) OUI( 0x50, 0x6F, 0x9A, 0x09 ) MANDATORYTLV MinorReasonCode; } -IE vendor2_ie (EID_VENDOR_SPECIFIC) OUI (0x00, 0x90, 0x4c) +IE vendor_vht_ie (EID_VENDOR_SPECIFIC) OUI (0x00, 0x90, 0x4c) { type, 1; sub_type, 1; @@ -2957,7 +2957,7 @@ FRAME Beacon // C.f. Sec. 7.2.3.1 OPTIE WiderBWChanSwitchAnn; OPTIE OBSSScanParameters; OPTIE Vendor1IE; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; OPTIE Vendor3IE; OPTIE hs20vendor_ie; OPTIE ChannelSwitchWrapper; @@ -3046,7 +3046,7 @@ FRAME Beacon2 OPTIE WiderBWChanSwitchAnn; OPTIE OBSSScanParameters; OPTIE Vendor1IE; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; OPTIE Vendor3IE; OPTIE hs20vendor_ie; OPTIE ChannelSwitchWrapper; @@ -3111,7 +3111,7 @@ FRAME BeaconIEs OPTIE WiderBWChanSwitchAnn; OPTIE OBSSScanParameters; OPTIE Vendor1IE; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; OPTIE Vendor3IE; OPTIE hs20vendor_ie; OPTIE ChannelSwitchWrapper; @@ -3153,7 +3153,7 @@ FRAME AssocRequest // 7.2.3.4 OPTIE ExtCap; OPTIE OperatingMode; OPTIE QosMapSet; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; OPTIE hs20vendor_ie; } // End frame AssocRequest. @@ -3188,7 +3188,7 @@ FRAME AssocResponse // 7.2.3.5 OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE QosMapSet; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; } // End frame AssocResponse. FRAME ReAssocRequest // 7.2.3.6 @@ -3225,7 +3225,7 @@ FRAME ReAssocRequest // 7.2.3.6 OPTIE ExtCap; OPTIE OperatingMode; OPTIE QosMapSet; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; OPTIE hs20vendor_ie; } // End frame ReAssocRequest. @@ -3261,7 +3261,7 @@ FRAME ReAssocResponse // 7.2.3.7 OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE QosMapSet; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; } // End frame ReAssocResponse. FRAME ProbeRequest // 7.2.3.8 @@ -3328,7 +3328,7 @@ FRAME ProbeResponse // 7.2.3.9 OPTIE ExtCap; OPTIE OBSSScanParameters; OPTIE Vendor1IE; - OPTIE vendor2_ie; + OPTIE vendor_vht_ie; OPTIE Vendor3IE; OPTIE hs20vendor_ie; OPTIE ChannelSwitchWrapper; diff --git a/core/mac/src/include/dot11f.h b/core/mac/src/include/dot11f.h index 006fd880785d..7d52f2508ba6 100644 --- a/core/mac/src/include/dot11f.h +++ b/core/mac/src/include/dot11f.h @@ -35,7 +35,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Sep 19 14:42:34 2016 from the following file(s): + * Mon Oct 3 12:40:25 2016 from the following file(s): * * dot11f.frms * @@ -7612,40 +7612,40 @@ uint32_t dot11f_get_packed_ie_sec_chan_offset_ele( #endif /* C++ */ /* EID 221 (0xdd) {OUI 0x00, 0x90, 0x4c} */ -typedef struct sDot11fIEvendor2_ie { +typedef struct sDot11fIEvendor_vht_ie { uint8_t present; uint8_t type; uint8_t sub_type; tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; -} tDot11fIEvendor2_ie; +} tDot11fIEvendor_vht_ie; -#define DOT11F_EID_VENDOR2_IE (221) +#define DOT11F_EID_VENDOR_VHT_IE (221) /* N.B. These #defines do *not* include the EID & length */ -#define DOT11F_IE_VENDOR2_IE_MIN_LEN (5) +#define DOT11F_IE_VENDOR_VHT_IE_MIN_LEN (5) -#define DOT11F_IE_VENDOR2_IE_MAX_LEN (26) +#define DOT11F_IE_VENDOR_VHT_IE_MAX_LEN (26) #ifdef __cplusplus extern "C" { #endif /* C++ */ -uint32_t dot11f_unpack_ie_vendor2_ie( +uint32_t dot11f_unpack_ie_vendor_vht_ie( tpAniSirGlobal, uint8_t *, uint8_t, - tDot11fIEvendor2_ie*); + tDot11fIEvendor_vht_ie*); -uint32_t dot11f_pack_ie_vendor2_ie( +uint32_t dot11f_pack_ie_vendor_vht_ie( tpAniSirGlobal, - tDot11fIEvendor2_ie *, + tDot11fIEvendor_vht_ie *, uint8_t *, uint32_t, uint32_t*); -uint32_t dot11f_get_packed_ie_vendor2_ie( +uint32_t dot11f_get_packed_ie_vendor_vht_ie( tpAniSirGlobal, - tDot11fIEvendor2_ie *, + tDot11fIEvendor_vht_ie *, uint32_t*); #ifdef __cplusplus @@ -7757,7 +7757,7 @@ typedef struct sDot11fAssocRequest{ tDot11fIEExtCap ExtCap; tDot11fIEOperatingMode OperatingMode; tDot11fIEQosMapSet QosMapSet; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEhs20vendor_ie hs20vendor_ie; } tDot11fAssocRequest; @@ -7813,7 +7813,7 @@ typedef struct sDot11fAssocResponse{ tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEQosMapSet QosMapSet; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; } tDot11fAssocResponse; #define DOT11F_ASSOCRESPONSE (4) @@ -7919,7 +7919,7 @@ typedef struct sDot11fBeacon{ tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEVendor1IE Vendor1IE; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEVendor3IE Vendor3IE; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper; @@ -8014,7 +8014,7 @@ typedef struct sDot11fBeacon2{ tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEVendor1IE Vendor1IE; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEVendor3IE Vendor3IE; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper; @@ -8090,7 +8090,7 @@ typedef struct sDot11fBeaconIEs{ tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEVendor1IE Vendor1IE; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEVendor3IE Vendor3IE; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper; @@ -8501,7 +8501,7 @@ typedef struct sDot11fProbeResponse{ tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEVendor1IE Vendor1IE; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEVendor3IE Vendor3IE; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEChannelSwitchWrapper ChannelSwitchWrapper; @@ -8648,7 +8648,7 @@ typedef struct sDot11fReAssocRequest{ tDot11fIEExtCap ExtCap; tDot11fIEOperatingMode OperatingMode; tDot11fIEQosMapSet QosMapSet; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEhs20vendor_ie hs20vendor_ie; } tDot11fReAssocRequest; @@ -8705,7 +8705,7 @@ typedef struct sDot11fReAssocResponse{ tDot11fIEExtCap ExtCap; tDot11fIEOBSSScanParameters OBSSScanParameters; tDot11fIEQosMapSet QosMapSet; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; } tDot11fReAssocResponse; #define DOT11F_REASSOCRESPONSE (27) diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index da8c3bc36840..bede0ad11946 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -164,7 +164,7 @@ typedef struct sSirProbeRespBeacon { uint8_t WiderBWChanSwitchAnnPresent; tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; uint8_t Vendor1IEPresent; - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; uint8_t Vendor3IEPresent; tDot11fIEhs20vendor_ie hs20vendor_ie; tDot11fIEIBSSParams IBSSParams; @@ -245,6 +245,7 @@ typedef struct sSirAssocReq { tDot11fIEVHTCaps VHTCaps; tDot11fIEOperatingMode operMode; tDot11fIEExtCap ExtCap; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEhs20vendor_ie hs20vendor_ie; } tSirAssocReq, *tpSirAssocReq; @@ -294,7 +295,7 @@ typedef struct sSirAssocRsp { #ifdef WLAN_FEATURE_11W tDot11fIETimeoutInterval TimeoutInterval; #endif - tDot11fIEvendor2_ie vendor2_ie; + tDot11fIEvendor_vht_ie vendor_vht_ie; tDot11fIEOBSSScanParameters obss_scanparams; } tSirAssocRsp, *tpSirAssocRsp; diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index f12cc19a7619..b8b34a98fb79 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -464,6 +464,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ bool is_vendor_specific_vhtcaps; uint8_t vendor_specific_vht_ie_type; uint8_t vendor_specific_vht_ie_sub_type; + bool vendor_vht_sap; /* HS 2.0 Indication */ tDot11fIEhs20vendor_ie hs20vendor_ie; /* flag to indicate country code in beacon */ diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 31818d187df1..4aae611d0787 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3224,12 +3224,12 @@ lim_check_and_announce_join_success(tpAniSirGlobal mac_ctx, wlan_cfg_get_int(mac_ctx, WNI_CFG_DOT11_MODE, &selfStaDot11Mode); if ((IS_DOT11_MODE_VHT(selfStaDot11Mode)) && - beacon_probe_rsp->vendor2_ie.VHTCaps.present) { + beacon_probe_rsp->vendor_vht_ie.VHTCaps.present) { session_entry->is_vendor_specific_vhtcaps = true; session_entry->vendor_specific_vht_ie_type = - beacon_probe_rsp->vendor2_ie.type; + beacon_probe_rsp->vendor_vht_ie.type; session_entry->vendor_specific_vht_ie_sub_type = - beacon_probe_rsp->vendor2_ie.sub_type; + beacon_probe_rsp->vendor_vht_ie.sub_type; lim_log(mac_ctx, LOG1, FL( "VHT caps are present in vendor specific IE")); } @@ -3678,13 +3678,13 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, vht_caps = &pAssocRsp->VHTCaps; vht_oper = &pAssocRsp->VHTOperation; } else if (psessionEntry->vhtCapability && - pAssocRsp->vendor2_ie.VHTCaps.present){ + pAssocRsp->vendor_vht_ie.VHTCaps.present){ pAddBssParams->vhtCapable = - pAssocRsp->vendor2_ie.VHTCaps.present; + pAssocRsp->vendor_vht_ie.VHTCaps.present; lim_log(pMac, LOG1, FL("VHT Caps and Operation are present in vendor Specfic IE")); - vht_caps = &pAssocRsp->vendor2_ie.VHTCaps; - vht_oper = &pAssocRsp->vendor2_ie.VHTOperation; + vht_caps = &pAssocRsp->vendor_vht_ie.VHTCaps; + vht_oper = &pAssocRsp->vendor_vht_ie.VHTOperation; } else { pAddBssParams->vhtCapable = 0; } @@ -3757,15 +3757,15 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, pAddBssParams->staContext.lsigTxopProtection); if (psessionEntry->vhtCapability && (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) || - IS_BSS_VHT_CAPABLE( - pBeaconStruct->vendor2_ie.VHTCaps))) { + IS_BSS_VHT_CAPABLE(pBeaconStruct-> + vendor_vht_ie.VHTCaps))) { pAddBssParams->staContext.vhtCapable = 1; pAddBssParams->staContext.vhtSupportedRxNss = pStaDs->vhtSupportedRxNss; if (pAssocRsp->VHTCaps.present) vht_caps = &pAssocRsp->VHTCaps; - else if (pAssocRsp->vendor2_ie.VHTCaps.present) { - vht_caps = &pAssocRsp->vendor2_ie.VHTCaps; + else if (pAssocRsp->vendor_vht_ie.VHTCaps.present) { + vht_caps = &pAssocRsp->vendor_vht_ie.VHTCaps; lim_log(pMac, LOG1, FL( "VHT Caps are in vendor Specfic IE")); } @@ -3790,8 +3790,9 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, pAssocRsp->HTInfo.recommendedTxWidthSet; if (pAssocRsp->VHTCaps.present) vht_oper = &pAssocRsp->VHTOperation; - else if (pAssocRsp->vendor2_ie.VHTCaps.present) { - vht_oper = &pAssocRsp->vendor2_ie.VHTOperation; + else if (pAssocRsp->vendor_vht_ie.VHTCaps.present) { + vht_oper = &pAssocRsp-> + vendor_vht_ie.VHTOperation; lim_log(pMac, LOG1, FL( "VHT Op IE is in vendor Specfic IE")); } @@ -3874,8 +3875,8 @@ tSirRetStatus lim_sta_send_add_bss(tpAniSirGlobal pMac, tpSirAssocRsp pAssocRsp, if (pAssocRsp->VHTCaps.present) vht_caps = &pAssocRsp->VHTCaps; - else if (pAssocRsp->vendor2_ie.VHTCaps.present) { - vht_caps = &pAssocRsp->vendor2_ie.VHTCaps; + else if (pAssocRsp->vendor_vht_ie.VHTCaps.present) { + vht_caps = &pAssocRsp->vendor_vht_ie.VHTCaps; lim_log(pMac, LOG1, FL( "VHT Caps is in vendor Specfic IE")); } @@ -4218,13 +4219,13 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update pAddBssParams->currentOperChannel); if (psessionEntry->vhtCapability && (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) || - IS_BSS_VHT_CAPABLE(pBeaconStruct->vendor2_ie.VHTCaps))) { + IS_BSS_VHT_CAPABLE(pBeaconStruct->vendor_vht_ie.VHTCaps))) { pAddBssParams->vhtCapable = 1; if (pBeaconStruct->VHTOperation.present) vht_oper = &pBeaconStruct->VHTOperation; - else if (pBeaconStruct->vendor2_ie.VHTOperation.present) { - vht_oper = &pBeaconStruct->vendor2_ie.VHTOperation; + else if (pBeaconStruct->vendor_vht_ie.VHTOperation.present) { + vht_oper = &pBeaconStruct->vendor_vht_ie.VHTOperation; lim_log(pMac, LOG1, FL("VHT Operation is present in vendor Specfic IE")); } @@ -4301,12 +4302,13 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update if (psessionEntry->vhtCapability && (IS_BSS_VHT_CAPABLE(pBeaconStruct->VHTCaps) || IS_BSS_VHT_CAPABLE( - pBeaconStruct->vendor2_ie.VHTCaps))) { + pBeaconStruct->vendor_vht_ie.VHTCaps))) { pAddBssParams->staContext.vhtCapable = 1; if (pBeaconStruct->VHTCaps.present) vht_caps = &pBeaconStruct->VHTCaps; - else if (pBeaconStruct->vendor2_ie.VHTCaps.present) - vht_caps = &pBeaconStruct->vendor2_ie.VHTCaps; + else if (pBeaconStruct->vendor_vht_ie.VHTCaps.present) + vht_caps = &pBeaconStruct-> + vendor_vht_ie.VHTCaps; if ((vht_caps != NULL) && (vht_caps->suBeamFormerCap || vht_caps->muBeamformerCap) && @@ -4389,9 +4391,9 @@ tSirRetStatus lim_sta_send_add_bss_pre_assoc(tpAniSirGlobal pMac, uint8_t update if (pBeaconStruct->VHTCaps.present) vht_caps = &pBeaconStruct->VHTCaps; - else if (pBeaconStruct->vendor2_ie.VHTCaps.present) { + else if (pBeaconStruct->vendor_vht_ie.VHTCaps.present) { vht_caps = - &pBeaconStruct->vendor2_ie.VHTCaps; + &pBeaconStruct->vendor_vht_ie.VHTCaps; lim_log(pMac, LOG1, FL( "VHT Caps are in vendor Specfic IE")); } diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index f60e43231eed..c1d77bfb5f9c 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -504,9 +504,19 @@ static bool lim_chk_11ac_only(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, tpPESession session, tpSirAssocReq assoc_req, uint8_t sub_type) { + tDot11fIEVHTCaps *vht_caps; + + if (assoc_req->VHTCaps.present) + vht_caps = &assoc_req->VHTCaps; + else if (assoc_req->vendor_vht_ie.VHTCaps.present && + session->vendor_vht_sap) + vht_caps = &assoc_req->vendor_vht_ie.VHTCaps; + else + vht_caps = NULL; + if (LIM_IS_AP_ROLE(session) && (session->dot11mode == WNI_CFG_DOT11_MODE_11AC_ONLY) && - (!assoc_req->VHTCaps.present)) { + ((vht_caps != NULL) && (!vht_caps->present))) { lim_send_assoc_rsp_mgmt_frame(mac_ctx, eSIR_MAC_CAPABILITIES_NOT_SUPPORTED_STATUS, 1, hdr->sa, sub_type, 0, session); @@ -1231,6 +1241,16 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, tPmfSaQueryTimerId timer_id; uint32_t retry_interval; #endif + tDot11fIEVHTCaps *vht_caps; + + if (assoc_req->VHTCaps.present) + vht_caps = &assoc_req->VHTCaps; + else if (assoc_req->vendor_vht_ie.VHTCaps.present && + session->vendor_vht_sap) + vht_caps = &assoc_req->vendor_vht_ie.VHTCaps; + else + vht_caps = NULL; + /* * check here if the parsedAssocReq already pointing to the assoc_req * and free it before assigning this new assoc_req @@ -1252,7 +1272,10 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, } sta_ds->mlmStaContext.htCapability = assoc_req->HTCaps.present; - sta_ds->mlmStaContext.vhtCapability = assoc_req->VHTCaps.present; + if ((vht_caps != NULL) && vht_caps->present) + sta_ds->mlmStaContext.vhtCapability = vht_caps->present; + else + sta_ds->mlmStaContext.vhtCapability = false; sta_ds->qos.addtsPresent = (assoc_req->addtsPresent == 0) ? false : true; sta_ds->qos.addts = assoc_req->addtsReq; @@ -1348,7 +1371,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, (uint8_t) (assoc_req->operMode.chanWidth ? eHT_CHANNEL_WIDTH_40MHZ : eHT_CHANNEL_WIDTH_20MHZ); - } else if (assoc_req->VHTCaps.present) { + } else if ((vht_caps != NULL) && vht_caps->present) { /* * Check if STA has enabled it's channel bonding mode. * If channel bonding mode is enabled, we decide based @@ -1360,7 +1383,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, WNI_CFG_VHT_CHANNEL_WIDTH_20_40MHZ : session->ch_width - 1); sta_ds->htMaxRxAMpduFactor = - assoc_req->VHTCaps.maxAMPDULenExp; + vht_caps->maxAMPDULenExp; } /* Lesser among the AP and STA bandwidth of operation. */ sta_ds->htSupportedChannelWidthSet = @@ -1373,9 +1396,10 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, (uint8_t) assoc_req->HTCaps.advCodingCap; } - if (assoc_req->VHTCaps.present && assoc_req->wmeInfoPresent) { + if ((vht_caps != NULL) && vht_caps->present && + assoc_req->wmeInfoPresent) { sta_ds->vhtLdpcCapable = - (uint8_t) assoc_req->VHTCaps.ldpcCodingCap; + (uint8_t) vht_caps->ldpcCodingCap; } if (!assoc_req->wmeInfoPresent) { @@ -1398,8 +1422,7 @@ static bool lim_update_sta_ds(tpAniSirGlobal mac_ctx, tpSirMacMgmtHdr hdr, &(assoc_req->supportedRates), &(assoc_req->extendedRates), assoc_req->HTCaps.supportedMCSSet, - session, &assoc_req->VHTCaps) != eSIR_SUCCESS) - { + session, vht_caps) != eSIR_SUCCESS) { /* Could not update hash table entry at DPH with rateset */ lim_log(mac_ctx, LOGE, FL("Couldn't update hash entry for aid=%d, MacAddr: " diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index 8e267663c73d..81f8714bfab8 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -172,8 +172,8 @@ void lim_update_assoc_sta_datas(tpAniSirGlobal mac_ctx, if (assoc_rsp->VHTCaps.present) vht_caps = &assoc_rsp->VHTCaps; - else if (assoc_rsp->vendor2_ie.VHTCaps.present) - vht_caps = &assoc_rsp->vendor2_ie.VHTCaps; + else if (assoc_rsp->vendor_vht_ie.VHTCaps.present) + vht_caps = &assoc_rsp->vendor_vht_ie.VHTCaps; if (IS_DOT11_MODE_VHT(session_entry->dot11mode)) { if ((vht_caps != NULL) && vht_caps->present) { diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index 347198956135..df4cd348ad20 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -610,6 +610,8 @@ lim_configure_ap_start_bss_session(tpAniSirGlobal mac_ctx, tpPESession session, session->ssidHidden = sme_start_bss_req->ssidHidden; session->wps_state = sme_start_bss_req->wps_state; session->sap_dot11mc = sme_start_bss_req->sap_dot11mc; + session->vendor_vht_sap = + sme_start_bss_req->vendor_vht_sap; lim_get_short_slot_from_phy_mode(mac_ctx, session, session->gLimPhyMode, &session->shortSlotTimeSupported); session->isCoalesingInIBSSAllowed = diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 26aa7ca55e9f..1f367b75a469 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -167,7 +167,7 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, session->vhtCapability) { session->vhtCapabilityPresentInBeacon = 1; if (((beacon_struct->Vendor1IEPresent && - beacon_struct->vendor2_ie.present && + beacon_struct->vendor_vht_ie.present && beacon_struct->Vendor3IEPresent)) && (((beacon_struct->VHTCaps.txMCSMap & VHT_MCS_3x3_MASK) == VHT_MCS_3x3_MASK) && diff --git a/core/mac/src/pe/lim/lim_send_frames_host_roam.c b/core/mac/src/pe/lim/lim_send_frames_host_roam.c index 5594dfc78843..50c86a6ff657 100644 --- a/core/mac/src/pe/lim/lim_send_frames_host_roam.c +++ b/core/mac/src/pe/lim/lim_send_frames_host_roam.c @@ -304,14 +304,14 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(tpAniSirGlobal mac_ctx, pe_session->is_vendor_specific_vhtcaps) { lim_log(mac_ctx, LOG1, FL("Populate Vendor VHT IEs in Re-Assoc Request")); - frm.vendor2_ie.present = 1; - frm.vendor2_ie.type = + frm.vendor_vht_ie.present = 1; + frm.vendor_vht_ie.type = pe_session->vendor_specific_vht_ie_type; - frm.vendor2_ie.sub_type = + frm.vendor_vht_ie.sub_type = pe_session->vendor_specific_vht_ie_sub_type; - frm.vendor2_ie.VHTCaps.present = 1; + frm.vendor_vht_ie.VHTCaps.present = 1; populate_dot11f_vht_caps(mac_ctx, pe_session, - &frm.vendor2_ie.VHTCaps); + &frm.vendor_vht_ie.VHTCaps); vht_enabled = true; } status = dot11f_get_packed_re_assoc_request_size(mac_ctx, &frm, diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 93408fc9f590..b10e5847a4aa 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1243,7 +1243,24 @@ lim_send_assoc_rsp_mgmt_frame(tpAniSirGlobal mac_ctx, populate_dot11f_vht_caps(mac_ctx, pe_session, &frm.VHTCaps); populate_dot11f_vht_operation(mac_ctx, pe_session, - &frm.VHTOperation); + &frm.VHTOperation); + is_vht = true; + } + if (pe_session->vhtCapability && + pe_session->vendor_vht_sap && + (assoc_req != NULL) && + assoc_req->vendor_vht_ie.VHTCaps.present) { + lim_log(mac_ctx, LOG1, + FL("Populate Vendor VHT IEs in Assoc Rsponse")); + frm.vendor_vht_ie.present = 1; + frm.vendor_vht_ie.type = + pe_session->vendor_specific_vht_ie_type; + frm.vendor_vht_ie.sub_type = + pe_session->vendor_specific_vht_ie_sub_type; + + frm.vendor_vht_ie.VHTCaps.present = 1; + populate_dot11f_vht_caps(mac_ctx, pe_session, + &frm.vendor_vht_ie.VHTCaps); is_vht = true; } populate_dot11f_ext_cap(mac_ctx, is_vht, &frm.ExtCap, @@ -1812,15 +1829,15 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, pe_session->is_vendor_specific_vhtcaps) { lim_log(mac_ctx, LOG1, FL("Populate Vendor VHT IEs in Assoc Request")); - frm->vendor2_ie.present = 1; - frm->vendor2_ie.type = + frm->vendor_vht_ie.present = 1; + frm->vendor_vht_ie.type = pe_session->vendor_specific_vht_ie_type; - frm->vendor2_ie.sub_type = + frm->vendor_vht_ie.sub_type = pe_session->vendor_specific_vht_ie_sub_type; - frm->vendor2_ie.VHTCaps.present = 1; + frm->vendor_vht_ie.VHTCaps.present = 1; populate_dot11f_vht_caps(mac_ctx, pe_session, - &frm->vendor2_ie.VHTCaps); + &frm->vendor_vht_ie.VHTCaps); vht_enabled = true; } if (pe_session->is_ext_caps_present) diff --git a/core/mac/src/sys/legacy/src/utils/src/dot11f.c b/core/mac/src/sys/legacy/src/utils/src/dot11f.c index d5068aae9b91..458e073c088d 100644 --- a/core/mac/src/sys/legacy/src/utils/src/dot11f.c +++ b/core/mac/src/sys/legacy/src/utils/src/dot11f.c @@ -33,7 +33,7 @@ * * * This file was automatically generated by 'framesc' - * Mon Sep 19 14:42:34 2016 from the following file(s): + * Mon Oct 3 12:40:25 2016 from the following file(s): * * dot11f.frms * @@ -5949,25 +5949,25 @@ uint32_t dot11f_unpack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx, #define SigIesec_chan_offset_ele (0x007f) -static const tFFDefn FFS_vendor2_ie[] = { +static const tFFDefn FFS_vendor_vht_ie[] = { { NULL, 0, 0, 0,}, }; -static const tIEDefn IES_vendor2_ie[] = { - { offsetof(tDot11fIEvendor2_ie, VHTCaps), offsetof(tDot11fIEVHTCaps, +static const tIEDefn IES_vendor_vht_ie[] = { + { offsetof(tDot11fIEvendor_vht_ie, VHTCaps), offsetof(tDot11fIEVHTCaps, present), 0, "VHTCaps", 0, 14, 14, SigIeVHTCaps, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTCAPS, 0, }, - { offsetof(tDot11fIEvendor2_ie, VHTOperation), + { offsetof(tDot11fIEvendor_vht_ie, VHTOperation), offsetof(tDot11fIEVHTOperation, present), 0, "VHTOperation", 0, 7, 7, SigIeVHTOperation, {0, 0, 0, 0, 0}, 0, DOT11F_EID_VHTOPERATION, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, }, }; -uint32_t dot11f_unpack_ie_vendor2_ie(tpAniSirGlobal pCtx, - uint8_t *pBuf, - uint8_t ielen, - tDot11fIEvendor2_ie *pDst) +uint32_t dot11f_unpack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, + uint8_t *pBuf, + uint8_t ielen, + tDot11fIEvendor_vht_ie *pDst) { uint32_t status = DOT11F_PARSE_SUCCESS; (void) pBuf; (void)ielen; /* Shutup the compiler */ @@ -5984,14 +5984,14 @@ uint32_t dot11f_unpack_ie_vendor2_ie(tpAniSirGlobal pCtx, status |= unpack_core(pCtx, pBuf, ielen, - FFS_vendor2_ie, - IES_vendor2_ie, + FFS_vendor_vht_ie, + IES_vendor_vht_ie, (uint8_t *)pDst, sizeof(*pDst)); return status; -} /* End dot11f_unpack_ie_vendor2_ie. */ +} /* End dot11f_unpack_ie_vendor_vht_ie. */ -#define SigIevendor2_ie (0x0080) +#define SigIevendor_vht_ie (0x0080) static const tFFDefn FFS_AddTSRequest[] = { @@ -6208,10 +6208,10 @@ static const tIEDefn IES_AssocRequest[] = { { offsetof(tDot11fAssocRequest, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet", 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, - { offsetof(tDot11fAssocRequest, vendor2_ie), - offsetof(tDot11fIEvendor2_ie, present), 0, "vendor2_ie", - 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fAssocRequest, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, { offsetof(tDot11fAssocRequest, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, @@ -6336,10 +6336,10 @@ static const tIEDefn IES_AssocResponse[] = { { offsetof(tDot11fAssocResponse, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet", 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, - { offsetof(tDot11fAssocResponse, vendor2_ie), - offsetof(tDot11fIEvendor2_ie, present), 0, "vendor2_ie", - 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fAssocResponse, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },}; uint32_t dot11f_unpack_assoc_response(tpAniSirGlobal pCtx, @@ -6567,9 +6567,10 @@ static const tIEDefn IES_Beacon[] = { { offsetof(tDot11fBeacon, Vendor1IE), offsetof(tDot11fIEVendor1IE, present), 0, "Vendor1IE", 0, 5, 5, SigIeVendor1IE, {0, 16, 24, 0, 0}, 3, DOT11F_EID_VENDOR1IE, 0, }, - { offsetof(tDot11fBeacon, vendor2_ie), offsetof(tDot11fIEvendor2_ie, - present), 0, "vendor2_ie", 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fBeacon, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, { offsetof(tDot11fBeacon, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, }, @@ -6768,9 +6769,10 @@ static const tIEDefn IES_Beacon2[] = { { offsetof(tDot11fBeacon2, Vendor1IE), offsetof(tDot11fIEVendor1IE, present), 0, "Vendor1IE", 0, 5, 5, SigIeVendor1IE, {0, 16, 24, 0, 0}, 3, DOT11F_EID_VENDOR1IE, 0, }, - { offsetof(tDot11fBeacon2, vendor2_ie), offsetof(tDot11fIEvendor2_ie, - present), 0, "vendor2_ie", 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fBeacon2, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, { offsetof(tDot11fBeacon2, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, }, @@ -6965,9 +6967,10 @@ static const tIEDefn IES_BeaconIEs[] = { { offsetof(tDot11fBeaconIEs, Vendor1IE), offsetof(tDot11fIEVendor1IE, present), 0, "Vendor1IE", 0, 5, 5, SigIeVendor1IE, {0, 16, 24, 0, 0}, 3, DOT11F_EID_VENDOR1IE, 0, }, - { offsetof(tDot11fBeaconIEs, vendor2_ie), offsetof(tDot11fIEvendor2_ie, - present), 0, "vendor2_ie", 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fBeaconIEs, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, { offsetof(tDot11fBeaconIEs, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, }, @@ -7573,10 +7576,10 @@ static const tIEDefn IES_ProbeResponse[] = { { offsetof(tDot11fProbeResponse, Vendor1IE), offsetof(tDot11fIEVendor1IE, present), 0, "Vendor1IE", 0, 5, 5, SigIeVendor1IE, {0, 16, 24, 0, 0}, 3, DOT11F_EID_VENDOR1IE, 0, }, - { offsetof(tDot11fProbeResponse, vendor2_ie), - offsetof(tDot11fIEvendor2_ie, present), 0, "vendor2_ie", - 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fProbeResponse, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, { offsetof(tDot11fProbeResponse, Vendor3IE), offsetof(tDot11fIEVendor3IE, present), 0, "Vendor3IE", 0, 5, 5, SigIeVendor3IE, {0, 22, 50, 0, 0}, 3, DOT11F_EID_VENDOR3IE, 0, }, @@ -7831,10 +7834,10 @@ static const tIEDefn IES_ReAssocRequest[] = { { offsetof(tDot11fReAssocRequest, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet", 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, - { offsetof(tDot11fReAssocRequest, vendor2_ie), - offsetof(tDot11fIEvendor2_ie, present), 0, "vendor2_ie", - 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fReAssocRequest, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, { offsetof(tDot11fReAssocRequest, hs20vendor_ie), offsetof(tDot11fIEhs20vendor_ie, present), 0, "hs20vendor_ie", 0, 7, 9, SigIehs20vendor_ie, {80, 111, 154, 16, 0}, @@ -7965,10 +7968,10 @@ static const tIEDefn IES_ReAssocResponse[] = { { offsetof(tDot11fReAssocResponse, QosMapSet), offsetof(tDot11fIEQosMapSet, present), 0, "QosMapSet", 0, 2, 62, SigIeQosMapSet, {0, 0, 0, 0, 0}, 0, DOT11F_EID_QOSMAPSET, 0, }, - { offsetof(tDot11fReAssocResponse, vendor2_ie), - offsetof(tDot11fIEvendor2_ie, present), 0, "vendor2_ie", - 0, 7, 28, SigIevendor2_ie, {0, 144, 76, 0, 0}, - 3, DOT11F_EID_VENDOR2_IE, 0, }, + { offsetof(tDot11fReAssocResponse, vendor_vht_ie), + offsetof(tDot11fIEvendor_vht_ie, present), 0, "vendor_vht_ie", + 0, 7, 28, SigIevendor_vht_ie, {0, 144, 76, 0, 0}, + 3, DOT11F_EID_VENDOR_VHT_IE, 0, }, {0, 0, 0, NULL, 0, 0, 0, 0, {0, 0, 0, 0, 0}, 0, 0xff, 0, },}; uint32_t dot11f_unpack_re_assoc_response(tpAniSirGlobal pCtx, @@ -10274,13 +10277,13 @@ static uint32_t unpack_core(tpAniSirGlobal pCtx, sizeof(tDot11fIEsec_chan_offset_ele) * countOffset)); break; - case SigIevendor2_ie: + case SigIevendor_vht_ie: status |= - dot11f_unpack_ie_vendor2_ie( + dot11f_unpack_ie_vendor_vht_ie( pCtx, pBufRemaining, len, - (tDot11fIEvendor2_ie *) + (tDot11fIEvendor_vht_ie *) (pFrm + pIe->offset + - sizeof(tDot11fIEvendor2_ie) * + sizeof(tDot11fIEvendor_vht_ie) * countOffset)); break; default: @@ -11453,8 +11456,8 @@ uint32_t dot11f_get_packed_ie_hs20vendor_ie(tpAniSirGlobal pCtx, return status; } /* End dot11f_get_packed_ie_hs20vendor_ie. */ -uint32_t dot11f_get_packed_ie_vendor2_ie(tpAniSirGlobal pCtx, - tDot11fIEvendor2_ie *pIe, uint32_t *pnNeeded) +uint32_t dot11f_get_packed_ie_vendor_vht_ie(tpAniSirGlobal pCtx, + tDot11fIEvendor_vht_ie *pIe, uint32_t *pnNeeded) { uint32_t status = DOT11F_PARSE_SUCCESS; (void)pCtx; @@ -11462,11 +11465,11 @@ uint32_t dot11f_get_packed_ie_vendor2_ie(tpAniSirGlobal pCtx, *pnNeeded += 1; *pnNeeded += 1; status = get_packed_size_core(pCtx, (uint8_t *)pIe, pnNeeded, - IES_vendor2_ie); + IES_vendor_vht_ie); break; } return status; -} /* End dot11f_get_packed_ie_vendor2_ie. */ +} /* End dot11f_get_packed_ie_vendor_vht_ie. */ uint32_t dot11f_get_packed_add_ts_request_size(tpAniSirGlobal pCtx, tDot11fAddTSRequest *pFrm, uint32_t *pnNeeded) @@ -12949,11 +12952,11 @@ static uint32_t get_packed_size_core(tpAniSirGlobal pCtx, (pFrm + pIe->offset + offset * i))-> present; break; - case SigIevendor2_ie: - offset = sizeof(tDot11fIEvendor2_ie); + case SigIevendor_vht_ie: + offset = sizeof(tDot11fIEvendor_vht_ie); status |= - dot11f_get_packed_ie_vendor2_ie( - pCtx, (tDot11fIEvendor2_ie *) + dot11f_get_packed_ie_vendor_vht_ie( + pCtx, (tDot11fIEvendor_vht_ie *) (pFrm + pIe->offset + offset * i), pnNeeded); break; @@ -20413,17 +20416,17 @@ uint32_t dot11f_pack_ie_sec_chan_offset_ele(tpAniSirGlobal pCtx, return DOT11F_PARSE_SUCCESS; } /* End dot11f_pack_ie_sec_chan_offset_ele. */ -uint32_t dot11f_pack_ie_vendor2_ie(tpAniSirGlobal pCtx, - tDot11fIEvendor2_ie *pSrc, - uint8_t *pBuf, - uint32_t nBuf, - uint32_t *pnConsumed) +uint32_t dot11f_pack_ie_vendor_vht_ie(tpAniSirGlobal pCtx, + tDot11fIEvendor_vht_ie *pSrc, + uint8_t *pBuf, + uint32_t nBuf, + uint32_t *pnConsumed) { uint8_t *pIeLen = 0; uint32_t nConsumedOnEntry = *pnConsumed; uint32_t nNeeded = 0U; uint32_t status = DOT11F_PARSE_SUCCESS; - status = dot11f_get_packed_ie_vendor2_ie(pCtx, pSrc, &nNeeded); + status = dot11f_get_packed_ie_vendor_vht_ie(pCtx, pSrc, &nNeeded); if (!DOT11F_SUCCEEDED(status)) return status; while (pSrc->present) { @@ -20450,8 +20453,8 @@ uint32_t dot11f_pack_ie_vendor2_ie(tpAniSirGlobal pCtx, pBuf, nBuf, pnConsumed, - FFS_vendor2_ie, - IES_vendor2_ie); + FFS_vendor_vht_ie, + IES_vendor_vht_ie); break; } (void)pCtx; @@ -20459,7 +20462,7 @@ uint32_t dot11f_pack_ie_vendor2_ie(tpAniSirGlobal pCtx, *pIeLen = *pnConsumed - nConsumedOnEntry - 2; } return status; -} /* End dot11f_pack_ie_vendor2_ie. */ +} /* End dot11f_pack_ie_vendor_vht_ie. */ uint32_t dot11f_pack_add_ts_request(tpAniSirGlobal pCtx, tDot11fAddTSRequest *pFrm, @@ -22402,12 +22405,12 @@ static uint32_t pack_core(tpAniSirGlobal pCtx, sizeof(tDot11fIEsec_chan_offset_ele) * i), pBufRemaining, nBufRemaining, &len); break; - case SigIevendor2_ie: + case SigIevendor_vht_ie: status |= - dot11f_pack_ie_vendor2_ie( - pCtx, (tDot11fIEvendor2_ie *) + dot11f_pack_ie_vendor_vht_ie( + pCtx, (tDot11fIEvendor_vht_ie *) (pSrc + pIe->offset + - sizeof(tDot11fIEvendor2_ie) * i), + sizeof(tDot11fIEvendor_vht_ie) * i), pBufRemaining, nBufRemaining, &len); break; default: diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 360c76a1df92..4cfb1fff3c6f 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -2561,19 +2561,19 @@ tSirRetStatus sir_convert_probe_frame2_struct(tpAniSirGlobal pMac, pProbeResp->Vendor1IEPresent = pr->Vendor1IE.present; pProbeResp->Vendor3IEPresent = pr->Vendor3IE.present; - pProbeResp->vendor2_ie.present = pr->vendor2_ie.present; - if (pr->vendor2_ie.present) { - pProbeResp->vendor2_ie.type = pr->vendor2_ie.type; - pProbeResp->vendor2_ie.sub_type = pr->vendor2_ie.sub_type; + pProbeResp->vendor_vht_ie.present = pr->vendor_vht_ie.present; + if (pr->vendor_vht_ie.present) { + pProbeResp->vendor_vht_ie.type = pr->vendor_vht_ie.type; + pProbeResp->vendor_vht_ie.sub_type = pr->vendor_vht_ie.sub_type; } - if (pr->vendor2_ie.VHTCaps.present) { - qdf_mem_copy(&pProbeResp->vendor2_ie.VHTCaps, - &pr->vendor2_ie.VHTCaps, + if (pr->vendor_vht_ie.VHTCaps.present) { + qdf_mem_copy(&pProbeResp->vendor_vht_ie.VHTCaps, + &pr->vendor_vht_ie.VHTCaps, sizeof(tDot11fIEVHTCaps)); } - if (pr->vendor2_ie.VHTOperation.present) { - qdf_mem_copy(&pProbeResp->vendor2_ie.VHTOperation, - &pr->vendor2_ie.VHTOperation, + if (pr->vendor_vht_ie.VHTOperation.present) { + qdf_mem_copy(&pProbeResp->vendor_vht_ie.VHTOperation, + &pr->vendor_vht_ie.VHTOperation, sizeof(tDot11fIEVHTOperation)); } /* Update HS 2.0 Information Element */ @@ -2798,6 +2798,22 @@ sir_convert_assoc_req_frame2_struct(tpAniSirGlobal pMac, ext_cap->timing_meas, ext_cap->fine_time_meas_initiator, ext_cap->fine_time_meas_responder); } + + pAssocReq->vendor_vht_ie.present = ar->vendor_vht_ie.present; + if (ar->vendor_vht_ie.present) { + pAssocReq->vendor_vht_ie.type = ar->vendor_vht_ie.type; + pAssocReq->vendor_vht_ie.sub_type = ar->vendor_vht_ie.sub_type; + + if (ar->vendor_vht_ie.VHTCaps.present) { + qdf_mem_copy(&pAssocReq->vendor_vht_ie.VHTCaps, + &ar->vendor_vht_ie.VHTCaps, + sizeof(tDot11fIEVHTCaps)); + lim_log(pMac, LOG1, + FL("Received Assoc Request with Vendor specific VHT Cap")); + lim_log_vht_cap(pMac, &pAssocReq->VHTCaps); + } + } + qdf_mem_free(ar); return eSIR_SUCCESS; @@ -2998,27 +3014,27 @@ sir_convert_assoc_resp_frame2_struct(tpAniSirGlobal pMac, lim_log_qos_map_set(pMac, &pAssocRsp->QosMapSet); } - pAssocRsp->vendor2_ie.present = ar.vendor2_ie.present; - if (ar.vendor2_ie.present) { - pAssocRsp->vendor2_ie.type = ar.vendor2_ie.type; - pAssocRsp->vendor2_ie.sub_type = ar.vendor2_ie.sub_type; + pAssocRsp->vendor_vht_ie.present = ar.vendor_vht_ie.present; + if (ar.vendor_vht_ie.present) { + pAssocRsp->vendor_vht_ie.type = ar.vendor_vht_ie.type; + pAssocRsp->vendor_vht_ie.sub_type = ar.vendor_vht_ie.sub_type; } if (ar.OBSSScanParameters.present) { qdf_mem_copy(&pAssocRsp->obss_scanparams, &ar.OBSSScanParameters, sizeof(struct sDot11fIEOBSSScanParameters)); } - if (ar.vendor2_ie.VHTCaps.present) { - qdf_mem_copy(&pAssocRsp->vendor2_ie.VHTCaps, - &ar.vendor2_ie.VHTCaps, + if (ar.vendor_vht_ie.VHTCaps.present) { + qdf_mem_copy(&pAssocRsp->vendor_vht_ie.VHTCaps, + &ar.vendor_vht_ie.VHTCaps, sizeof(tDot11fIEVHTCaps)); lim_log(pMac, LOG1, FL("Received Assoc Response with Vendor specific VHT Cap")); lim_log_vht_cap(pMac, &pAssocRsp->VHTCaps); } - if (ar.vendor2_ie.VHTOperation.present) { - qdf_mem_copy(&pAssocRsp->vendor2_ie.VHTOperation, - &ar.vendor2_ie.VHTOperation, + if (ar.vendor_vht_ie.VHTOperation.present) { + qdf_mem_copy(&pAssocRsp->vendor_vht_ie.VHTOperation, + &ar.vendor_vht_ie.VHTOperation, sizeof(tDot11fIEVHTOperation)); lim_log(pMac, LOG1, FL("Received Assoc Response with Vendor specific VHT Oper")); @@ -3733,22 +3749,23 @@ sir_parse_beacon_ie(tpAniSirGlobal pMac, pBeaconStruct->Vendor1IEPresent = pBies->Vendor1IE.present; pBeaconStruct->Vendor3IEPresent = pBies->Vendor3IE.present; - pBeaconStruct->vendor2_ie.present = pBies->vendor2_ie.present; - if (pBies->vendor2_ie.present) { - pBeaconStruct->vendor2_ie.type = pBies->vendor2_ie.type; - pBeaconStruct->vendor2_ie.sub_type = pBies->vendor2_ie.sub_type; + pBeaconStruct->vendor_vht_ie.present = pBies->vendor_vht_ie.present; + if (pBies->vendor_vht_ie.present) { + pBeaconStruct->vendor_vht_ie.type = pBies->vendor_vht_ie.type; + pBeaconStruct->vendor_vht_ie.sub_type = + pBies->vendor_vht_ie.sub_type; } - if (pBies->vendor2_ie.VHTCaps.present) { - pBeaconStruct->vendor2_ie.VHTCaps.present = 1; - qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTCaps, - &pBies->vendor2_ie.VHTCaps, + if (pBies->vendor_vht_ie.VHTCaps.present) { + pBeaconStruct->vendor_vht_ie.VHTCaps.present = 1; + qdf_mem_copy(&pBeaconStruct->vendor_vht_ie.VHTCaps, + &pBies->vendor_vht_ie.VHTCaps, sizeof(tDot11fIEVHTCaps)); } - if (pBies->vendor2_ie.VHTOperation.present) { - pBeaconStruct->vendor2_ie.VHTOperation.present = 1; - qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTOperation, - &pBies->vendor2_ie.VHTOperation, + if (pBies->vendor_vht_ie.VHTOperation.present) { + pBeaconStruct->vendor_vht_ie.VHTOperation.present = 1; + qdf_mem_copy(&pBeaconStruct->vendor_vht_ie.VHTOperation, + &pBies->vendor_vht_ie.VHTOperation, sizeof(tDot11fIEVHTOperation)); } if (pBies->ExtCap.present) { @@ -4090,24 +4107,24 @@ sir_convert_beacon_frame2_struct(tpAniSirGlobal pMac, pBeaconStruct->Vendor1IEPresent = pBeacon->Vendor1IE.present; pBeaconStruct->Vendor3IEPresent = pBeacon->Vendor3IE.present; - pBeaconStruct->vendor2_ie.present = pBeacon->vendor2_ie.present; - if (pBeacon->vendor2_ie.present) { - pBeaconStruct->vendor2_ie.type = pBeacon->vendor2_ie.type; - pBeaconStruct->vendor2_ie.sub_type = - pBeacon->vendor2_ie.sub_type; + pBeaconStruct->vendor_vht_ie.present = pBeacon->vendor_vht_ie.present; + if (pBeacon->vendor_vht_ie.present) { + pBeaconStruct->vendor_vht_ie.type = pBeacon->vendor_vht_ie.type; + pBeaconStruct->vendor_vht_ie.sub_type = + pBeacon->vendor_vht_ie.sub_type; } - if (pBeacon->vendor2_ie.present) { + if (pBeacon->vendor_vht_ie.present) { PELOG1(lim_log(pMac, LOG1, FL("Vendor Specific VHT caps present in Beacon Frame!")); ) } - if (pBeacon->vendor2_ie.VHTCaps.present) { - qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTCaps, - &pBeacon->vendor2_ie.VHTCaps, + if (pBeacon->vendor_vht_ie.VHTCaps.present) { + qdf_mem_copy(&pBeaconStruct->vendor_vht_ie.VHTCaps, + &pBeacon->vendor_vht_ie.VHTCaps, sizeof(tDot11fIEVHTCaps)); } - if (pBeacon->vendor2_ie.VHTOperation.present) { - qdf_mem_copy(&pBeaconStruct->vendor2_ie.VHTOperation, + if (pBeacon->vendor_vht_ie.VHTOperation.present) { + qdf_mem_copy(&pBeaconStruct->vendor_vht_ie.VHTOperation, &pBeacon->VHTOperation, sizeof(tDot11fIEVHTOperation)); } diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 105682b6ed65..517a01185aab 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -1216,6 +1216,7 @@ typedef struct tagCsrConfigParam { uint8_t enable_txbf_sap_mode; uint8_t enable2x2; bool enableVhtFor24GHz; + bool vendor_vht_sap; uint8_t enableMuBformee; uint8_t enableVhtpAid; uint8_t enableVhtGid; diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index 959a1ea019ed..89bf7b20a3e9 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -663,6 +663,7 @@ typedef struct tagCsrConfig { uint32_t edca_bk_aifs; uint32_t edca_be_aifs; bool enable_fatal_event; + bool vendor_vht_sap; enum wmi_dwelltime_adaptive_mode scan_adaptive_dwell_mode; enum wmi_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode; struct csr_sta_roam_policy_params sta_roam_policy; diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index a401224bb099..300ce13d1556 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -2427,6 +2427,8 @@ QDF_STATUS csr_change_default_config_param(tpAniSirGlobal pMac, pParam->isRoamOffloadEnabled; #endif pMac->roam.configParam.obssEnabled = pParam->obssEnabled; + pMac->roam.configParam.vendor_vht_sap = + pParam->vendor_vht_sap; pMac->roam.configParam.conc_custom_rule1 = pParam->conc_custom_rule1; pMac->roam.configParam.conc_custom_rule2 = @@ -2653,8 +2655,10 @@ QDF_STATUS csr_get_config_param(tpAniSirGlobal pMac, tCsrConfigParam *pParam) pParam->enable_dot11p = pMac->enable_dot11p; csr_set_channels(pMac, pParam); pParam->obssEnabled = cfg_params->obssEnabled; + pParam->vendor_vht_sap = + pMac->roam.configParam.vendor_vht_sap; pParam->roam_dense_rssi_thresh_offset = - cfg_params->roam_params.dense_rssi_thresh_offset; + cfg_params->roam_params.dense_rssi_thresh_offset; pParam->roam_dense_min_aps = cfg_params->roam_params.dense_min_aps_cnt; pParam->roam_dense_traffic_thresh = @@ -14282,10 +14286,11 @@ QDF_STATUS csr_send_join_req_msg(tpAniSirGlobal pMac, uint32_t sessionId, pIes->VHTCaps.numSoundingDim) txBFCsnValue = QDF_MIN(txBFCsnValue, pIes->VHTCaps.numSoundingDim); - else if (IS_BSS_VHT_CAPABLE(pIes->vendor2_ie.VHTCaps) - && pIes->vendor2_ie.VHTCaps.numSoundingDim) + else if (IS_BSS_VHT_CAPABLE(pIes->vendor_vht_ie.VHTCaps) + && pIes->vendor_vht_ie.VHTCaps.numSoundingDim) txBFCsnValue = QDF_MIN(txBFCsnValue, - pIes->vendor2_ie.VHTCaps.numSoundingDim); + pIes->vendor_vht_ie. + VHTCaps.numSoundingDim); } csr_join_req->vht_config.csnof_beamformer_antSup = txBFCsnValue; @@ -15074,6 +15079,8 @@ QDF_STATUS csr_send_mb_start_bss_req_msg(tpAniSirGlobal pMac, uint32_t sessionId sizeof(pParam->addIeParams)); pMsg->obssEnabled = pMac->roam.configParam.obssEnabled; pMsg->sap_dot11mc = pParam->sap_dot11mc; + pMsg->vendor_vht_sap = + pMac->roam.configParam.vendor_vht_sap; return cds_send_mb_message_to_mac(pMsg); } diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index bbcecf077bec..5aadb0a1f0b1 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1467,7 +1467,7 @@ QDF_STATUS csr_get_phy_mode_from_bss(tpAniSirGlobal pMac, if (pIes->HTCaps.present) { phyMode = eCSR_DOT11_MODE_11n; if (IS_BSS_VHT_CAPABLE(pIes->VHTCaps) || - IS_BSS_VHT_CAPABLE(pIes->vendor2_ie.VHTCaps)) + IS_BSS_VHT_CAPABLE(pIes->vendor_vht_ie.VHTCaps)) phyMode = eCSR_DOT11_MODE_11ac; } *pPhyMode = phyMode; From 6485e1a40755d0ce5f429dd68c14ce98829a99e2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 12:54:41 -0700 Subject: [PATCH 031/113] Release 5.1.0.29S Release 5.1.0.29S Change-Id: Ifaeb43ba3ef6e851e3e5e0462dfd28ebb4dc29b3 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c5038b641024..d4785941ed5e 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "R" +#define QWLAN_VERSION_EXTRA "S" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29R" +#define QWLAN_VERSIONSTR "5.1.0.29S" #endif /* QWLAN_VERSION_H */ From ba71da4f6cc822763cbd7c2f9542d6ce1a87ef43 Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Tue, 4 Oct 2016 17:36:32 -0700 Subject: [PATCH 032/113] qcacld-3.0: Detect duplicate session open request Detect duplicate session request with same mac address and return failure to requestor. Change-Id: I0155f29e879e1c2a46a8b9efbcaf160353bf9c05 CRs-Fixed: 1072885 --- core/sme/src/csr/csr_api_roam.c | 155 +++++++++++++++++--------------- 1 file changed, 83 insertions(+), 72 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 300ce13d1556..fab7f0e48638 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -15340,59 +15340,67 @@ QDF_STATUS csr_process_add_sta_session_command(tpAniSirGlobal pMac, return status; } -QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac, +QDF_STATUS csr_roam_open_session(tpAniSirGlobal mac_ctx, csr_roam_completeCallback callback, void *pContext, uint8_t *pSelfMacAddr, uint8_t *pbSessionId, uint32_t type, uint32_t subType) { QDF_STATUS status = QDF_STATUS_SUCCESS; - uint32_t i, value = 0; + uint32_t i, value = 0, session_id; union { uint16_t nCfgValue16; tSirMacHTCapabilityInfo htCapInfo; } uHTCapabilityInfo; uint32_t nCfgValue = 0; - tCsrRoamSession *pSession; + tCsrRoamSession *session; *pbSessionId = CSR_SESSION_ID_INVALID; - for (i = 0; i < pMac->sme.max_intf_count; i++) { - sms_log(pMac, LOG1, FL("session:%d active:%d"), i, - pMac->roam.roamSession[i].sessionActive); - if (!CSR_IS_SESSION_VALID(pMac, i)) { - pSession = CSR_GET_SESSION(pMac, i); - if (!pSession) { - sms_log(pMac, LOGE, - FL - ("Session does not exist for interface %d"), + if (QDF_STATUS_SUCCESS == csr_roam_get_session_id_from_bssid(mac_ctx, + (struct qdf_mac_addr *)pSelfMacAddr, + &session_id)) { + sms_log(mac_ctx, LOGE, + FL("Session %d exists with mac address" + MAC_ADDRESS_STR), + session_id, MAC_ADDR_ARRAY(pSelfMacAddr)); + return QDF_STATUS_E_FAILURE; + } + + for (i = 0; i < mac_ctx->sme.max_intf_count; i++) { + sms_log(mac_ctx, LOG1, FL("session:%d active:%d"), i, + mac_ctx->roam.roamSession[i].sessionActive); + if (!CSR_IS_SESSION_VALID(mac_ctx, i)) { + session = CSR_GET_SESSION(mac_ctx, i); + if (!session) { + sms_log(mac_ctx, LOGE, + FL("Session does not exist for interface %d"), i); break; } status = QDF_STATUS_SUCCESS; - pSession->sessionActive = true; - pSession->sessionId = (uint8_t) i; + session->sessionActive = true; + session->sessionId = (uint8_t) i; /* Initialize FT related data structures only in STA mode */ - sme_ft_open(pMac, pSession->sessionId); + sme_ft_open(mac_ctx, session->sessionId); - pSession->callback = callback; - pSession->pContext = pContext; - qdf_mem_copy(&pSession->selfMacAddr, pSelfMacAddr, + session->callback = callback; + session->pContext = pContext; + qdf_mem_copy(&session->selfMacAddr, pSelfMacAddr, sizeof(struct qdf_mac_addr)); *pbSessionId = (uint8_t) i; status = - qdf_mc_timer_init(&pSession->hTimerRoaming, + qdf_mc_timer_init(&session->hTimerRoaming, QDF_TIMER_TYPE_SW, csr_roam_roaming_timer_handler, - &pSession->roamingTimerInfo); + &session->roamingTimerInfo); if (!QDF_IS_STATUS_SUCCESS(status)) { - sms_log(pMac, LOGE, - FL - ("cannot allocate memory for Roaming timer")); + sms_log(mac_ctx, LOGE, + FL("cannot allocate memory for Roaming timer")); break; } /* get the HT capability info */ - if (wlan_cfg_get_int(pMac, WNI_CFG_HT_CAP_INFO, &value) + if (wlan_cfg_get_int(mac_ctx, WNI_CFG_HT_CAP_INFO, &value) != eSIR_SUCCESS) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, @@ -15401,134 +15409,137 @@ QDF_STATUS csr_roam_open_session(tpAniSirGlobal pMac, break; } #ifdef FEATURE_WLAN_BTAMP_UT_RF - status = qdf_mc_timer_init(&pSession->hTimerJoinRetry, + status = qdf_mc_timer_init(&session->hTimerJoinRetry, QDF_TIMER_TYPE_SW, csr_roam_join_retry_timer_handler, - &pSession-> + &session-> joinRetryTimerInfo); if (!QDF_IS_STATUS_SUCCESS(status)) { - sms_log(pMac, LOGE, + sms_log(mac_ctx, LOGE, FL ("cannot allocate memory for join retry timer")); break; } #endif uHTCapabilityInfo.nCfgValue16 = 0xFFFF & value; - pSession->htConfig.ht_rx_ldpc = + session->htConfig.ht_rx_ldpc = uHTCapabilityInfo.htCapInfo.advCodingCap; - pSession->htConfig.ht_tx_stbc = + session->htConfig.ht_tx_stbc = uHTCapabilityInfo.htCapInfo.txSTBC; - pSession->htConfig.ht_rx_stbc = + session->htConfig.ht_rx_stbc = uHTCapabilityInfo.htCapInfo.rxSTBC; - pSession->htConfig.ht_sgi20 = + session->htConfig.ht_sgi20 = uHTCapabilityInfo.htCapInfo.shortGI20MHz; - pSession->htConfig.ht_sgi40 = + session->htConfig.ht_sgi40 = uHTCapabilityInfo.htCapInfo.shortGI40MHz; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_MAX_MPDU_LENGTH, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_MAX_MPDU_LENGTH, &nCfgValue); - pSession->vht_config.max_mpdu_len = nCfgValue; + session->vht_config.max_mpdu_len = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SUPPORTED_CHAN_WIDTH_SET, &nCfgValue); - pSession->vht_config.supported_channel_widthset = + session->vht_config.supported_channel_widthset = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_LDPC_CODING_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_LDPC_CODING_CAP, &nCfgValue); - pSession->vht_config.ldpc_coding = nCfgValue; + session->vht_config.ldpc_coding = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_SHORT_GI_80MHZ, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SHORT_GI_80MHZ, &nCfgValue); - pSession->vht_config.shortgi80 = nCfgValue; + session->vht_config.shortgi80 = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SHORT_GI_160_AND_80_PLUS_80MHZ, &nCfgValue); - pSession->vht_config.shortgi160and80plus80 = nCfgValue; + session->vht_config.shortgi160and80plus80 = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_TXSTBC, &nCfgValue); - pSession->vht_config.tx_stbc = nCfgValue; + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_TXSTBC, + &nCfgValue); + session->vht_config.tx_stbc = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_RXSTBC, &nCfgValue); - pSession->vht_config.rx_stbc = nCfgValue; + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_RXSTBC, + &nCfgValue); + session->vht_config.rx_stbc = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_SU_BEAMFORMER_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SU_BEAMFORMER_CAP, &nCfgValue); - pSession->vht_config.su_beam_former = nCfgValue; + session->vht_config.su_beam_former = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_SU_BEAMFORMEE_CAP, &nCfgValue); - pSession->vht_config.su_beam_formee = nCfgValue; + session->vht_config.su_beam_formee = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_CSN_BEAMFORMEE_ANT_SUPPORTED, &nCfgValue); - pSession->vht_config.csnof_beamformer_antSup = + session->vht_config.csnof_beamformer_antSup = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_NUM_SOUNDING_DIMENSIONS, &nCfgValue); - pSession->vht_config.num_soundingdim = nCfgValue; + session->vht_config.num_soundingdim = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_MU_BEAMFORMER_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_MU_BEAMFORMER_CAP, &nCfgValue); - pSession->vht_config.mu_beam_former = nCfgValue; + session->vht_config.mu_beam_former = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_MU_BEAMFORMEE_CAP, &nCfgValue); - pSession->vht_config.mu_beam_formee = nCfgValue; + session->vht_config.mu_beam_formee = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_TXOP_PS, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_TXOP_PS, &nCfgValue); - pSession->vht_config.vht_txops = nCfgValue; + session->vht_config.vht_txops = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_HTC_VHTC_CAP, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_HTC_VHTC_CAP, &nCfgValue); - pSession->vht_config.htc_vhtcap = nCfgValue; + session->vht_config.htc_vhtcap = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_RX_ANT_PATTERN, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_RX_ANT_PATTERN, &nCfgValue); - pSession->vht_config.rx_antpattern = nCfgValue; + session->vht_config.rx_antpattern = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_TX_ANT_PATTERN, + wlan_cfg_get_int(mac_ctx, WNI_CFG_VHT_TX_ANT_PATTERN, &nCfgValue); - pSession->vht_config.tx_antpattern = nCfgValue; + session->vht_config.tx_antpattern = nCfgValue; nCfgValue = 0; - wlan_cfg_get_int(pMac, WNI_CFG_VHT_AMPDU_LEN_EXPONENT, + wlan_cfg_get_int(mac_ctx, + WNI_CFG_VHT_AMPDU_LEN_EXPONENT, &nCfgValue); - pSession->vht_config.max_ampdu_lenexp = nCfgValue; + session->vht_config.max_ampdu_lenexp = nCfgValue; - status = csr_issue_add_sta_for_session_req(pMac, i, + status = csr_issue_add_sta_for_session_req(mac_ctx, i, pSelfMacAddr, type, subType); break; } } - if (pMac->sme.max_intf_count == i) { + if (mac_ctx->sme.max_intf_count == i) { /* No session is available */ - sms_log(pMac, LOGE, + sms_log(mac_ctx, LOGE, "%s: Reached max interfaces: %d! Session creation will fail", - __func__, pMac->sme.max_intf_count); + __func__, mac_ctx->sme.max_intf_count); status = QDF_STATUS_E_RESOURCES; } return status; From ccd00e89a0ff4cbc29980f41f638e7ab532a76f4 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 14:14:45 -0700 Subject: [PATCH 033/113] Release 5.1.0.29T Release 5.1.0.29T Change-Id: I94e9f3abe6498420711e832526d003ff2f443bc0 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index d4785941ed5e..34c184099133 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "S" +#define QWLAN_VERSION_EXTRA "T" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29S" +#define QWLAN_VERSIONSTR "5.1.0.29T" #endif /* QWLAN_VERSION_H */ From 5d95e631e3248e088f1034a7e53da1c0477c2bca Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 14 Sep 2016 17:00:38 +0530 Subject: [PATCH 034/113] qcacld-3.0: Fix consecutive TDLS connection failure after TDLS add sta failure qcacld-2.0 to qcacld-3.0 propagation. Currently, Failure of TDLS add sta is leading to failure of next consecutive tdls connection. Fix is to update the failure info to HDD and return error to supplicant. Change-Id: I0d46a198f2abb87b4a4350b454deb98c5e3b8211 CRs-Fixed: 958534 --- core/hdd/src/wlan_hdd_assoc.c | 2 ++ core/hdd/src/wlan_hdd_tdls.c | 11 +++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index e008534fb224..8810512e169b 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -3634,6 +3634,8 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, if (eSIR_SME_SUCCESS != pRoamInfo->statusCode) { hdd_err("Add Sta failed. status code(=%d)", pRoamInfo->statusCode); + pAdapter->tdlsAddStaStatus = QDF_STATUS_E_FAILURE; + } else { /* * Check if there is available index for this new TDLS diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 6204e72aee8b..eaac53a0a77f 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -3624,7 +3624,7 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy, hddTdlsPeer_t *pTdlsPeer; uint16_t numCurrTdlsPeers; unsigned long rc; - long ret; + int ret; int rate_idx; ENTER(); @@ -3763,16 +3763,15 @@ int wlan_hdd_tdls_add_station(struct wiphy *wiphy, (WAIT_TIME_TDLS_ADD_STA)); if (!rc) { - QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, - "%s: timeout waiting for tdls add station indication", - __func__); - return -EPERM; + hdd_err("timeout waiting for tdls add station indication %ld peer link status %u", + rc, pTdlsPeer->link_status); + goto error; } if (QDF_STATUS_SUCCESS != pAdapter->tdlsAddStaStatus) { QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR, "%s: Add Station is unsuccessful", __func__); - return -EPERM; + goto error; } return 0; From e9199ab7c701cd5ebd1b6ca184a64242c67bb2c7 Mon Sep 17 00:00:00 2001 From: "Selvaraj, Sridhar" Date: Wed, 14 Sep 2016 17:13:22 +0530 Subject: [PATCH 035/113] qcacld-3.0: Fix to send TDLS frames on peer sta index qcacld-2.0 to qcacld-3.0 propagation Currently, After p2p disconnection system role changes to unknown and due to which tx flag uses self station index which would send TDLS frames on self station index thus leading to TDLS connection failure after p2p session teardown. Fix is to use peer station index in tx flag while sending TDLS frames except TDLS discovery response which should go on self station index. Change-Id: I87ea8806a47730b553055e47bb3e7bdf0266b48f CRs-Fixed: 970761 --- core/mac/src/pe/lim/lim_process_tdls.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 58a0addfb16e..1e87bd405276 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -520,14 +520,16 @@ tSirRetStatus lim_send_tdls_dis_req_frame(tpAniSirGlobal pMac, MAC_ADDR_ARRAY(peer_mac.bytes)); pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; - qdf_status = wma_tx_frameWithTxComplete(pMac, pPacket, (uint16_t) nBytes, - TXRX_FRM_802_11_DATA, - ANI_TXDIR_TODS, - TID_AC_VI, - lim_tx_complete, pFrame, - lim_mgmt_tdls_tx_complete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, - smeSessionId, false, 0); + qdf_status = wma_tx_frameWithTxComplete(pMac, pPacket, + (uint16_t) nBytes, + TXRX_FRM_802_11_DATA, + ANI_TXDIR_TODS, + TID_AC_VI, + lim_tx_complete, pFrame, + lim_mgmt_tdls_tx_complete, + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME | + HAL_USE_PEER_STA_REQUESTED_MASK, + smeSessionId, false, 0); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { pMac->lim.tdls_frm_session_id = NO_SESSION; lim_log(pMac, LOGE, @@ -935,7 +937,8 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket, tid, lim_tx_complete, pFrame, lim_mgmt_tdls_tx_complete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME + | HAL_USE_PEER_STA_REQUESTED_MASK, smeSessionId, flag, 0); } #else @@ -954,7 +957,8 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket, tid, lim_tx_complete, pFrame, lim_mgmt_tdls_tx_complete, - HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME, + HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME + | HAL_USE_PEER_STA_REQUESTED_MASK, smeSessionId, false, 0); } #endif From 405ba71ae747eadc292eee02a5c2e9ff4d44fa47 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 15:52:49 -0700 Subject: [PATCH 036/113] Release 5.1.0.29U Release 5.1.0.29U Change-Id: Ia7f974a488976d3a1d88332a9fee0d6525b6289a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 34c184099133..beff24740296 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "T" +#define QWLAN_VERSION_EXTRA "U" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29T" +#define QWLAN_VERSIONSTR "5.1.0.29U" #endif /* QWLAN_VERSION_H */ From 2df78cc9c3867c072712cd5844984cf859ad09e7 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Thu, 6 Oct 2016 16:45:12 -0700 Subject: [PATCH 037/113] qcacld-3.0: Clean up obsolete WMA power API wma_set_qpower_force_sleep WMA qpower API wma_set_qpower_force_sleep is obsolete and is no longer used. Clean up unused API wma_set_qpower_force_sleep. Change-Id: Iad32be5e11c345a542b8f8f6660987a4aff837c7 CRs-Fixed: 1075289 --- core/wma/src/wma_power.c | 113 --------------------------------------- 1 file changed, 113 deletions(-) diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index db0ba9243088..4c139f7b186a 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -715,119 +715,6 @@ static QDF_STATUS wma_set_force_sleep(tp_wma_handle wma, return QDF_STATUS_SUCCESS; } -/** - * wma_set_qpower_force_sleep() - set qpower params in fw - * @wma: wma handle - * @vdev_id: vdev id - * @enable: value - * - * Return: QDF_STATUS_SUCCESS for success or error code - */ -QDF_STATUS wma_set_qpower_force_sleep(tp_wma_handle wma, uint32_t vdev_id, - uint8_t enable) -{ - QDF_STATUS ret; - uint32_t cfg_data_val = 0; - /* get mac to acess CFG data base */ - struct sAniSirGlobal *mac = cds_get_context(QDF_MODULE_ID_PE); - uint32_t pspoll_count = WMA_DEFAULT_MAX_PSPOLL_BEFORE_WAKE; - - WMA_LOGE("Set QPower Force(1)/Normal(0) Sleep vdevId %d val %d", - vdev_id, enable); - - if (NULL == mac) { - WMA_LOGE("%s: Unable to get PE context", __func__); - return QDF_STATUS_E_NOMEM; - } - - /* Get Configured Ps Poll Count */ - if (wlan_cfg_get_int(mac, WNI_CFG_MAX_PS_POLL, - &cfg_data_val) != eSIR_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get value for WNI_CFG_MAX_PS_POLL"); - } - if (cfg_data_val) { - pspoll_count = (uint32_t) cfg_data_val; - } - - /* Enable QPower */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_ENABLE_QPOWER, 1); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Enable QPower Failed vdevId %d", vdev_id); - return ret; - } - WMA_LOGD("QPower Enabled vdevId %d", vdev_id); - - /* Set the Wake Policy to WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_PARAM_RX_WAKE_POLICY, - WMI_STA_PS_RX_WAKE_POLICY_POLL_UAPSD); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Setting wake policy to pspoll/uapsd Failed vdevId %d", - vdev_id); - return ret; - } - WMA_LOGD("Wake policy set to to pspoll/uapsd vdevId %d", vdev_id); - - if (enable) { - /* Set the Tx Wake Threshold */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_PARAM_TX_WAKE_THRESHOLD, - WMI_STA_PS_TX_WAKE_THRESHOLD_NEVER); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Setting TxWake Threshold vdevId %d", vdev_id); - return ret; - } - WMA_LOGD("TxWake Threshold set to TX_WAKE_THRESHOLD_NEVER %d", - vdev_id); - } - - /* Set the QPower Ps Poll Count */ - ret = wma_unified_set_sta_ps_param(wma->wmi_handle, vdev_id, - WMI_STA_PS_PARAM_QPOWER_PSPOLL_COUNT, - pspoll_count); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Set QPower Ps Poll Count Failed vdevId %d ps poll cnt %d", - vdev_id, pspoll_count); - return ret; - } - WMA_LOGD("Set QPower Ps Poll Count vdevId %d ps poll cnt %d", - vdev_id, pspoll_count); - - /* Enable Sta Mode Power save */ - ret = wmi_unified_set_sta_ps(wma->wmi_handle, vdev_id, true); - - if (QDF_IS_STATUS_ERROR(ret)) { - WMA_LOGE("Enable Sta Mode Ps Failed vdevId %d", vdev_id); - return ret; - } - - /* Set Listen Interval */ - if (wlan_cfg_get_int(mac, WNI_CFG_LISTEN_INTERVAL, - &cfg_data_val) != eSIR_SUCCESS) { - QDF_TRACE(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_ERROR, - "Failed to get value for WNI_CFG_LISTEN_INTERVAL"); - cfg_data_val = POWERSAVE_DEFAULT_LISTEN_INTERVAL; - } - - ret = wma_vdev_set_param(wma->wmi_handle, vdev_id, - WMI_VDEV_PARAM_LISTEN_INTERVAL, - cfg_data_val); - if (QDF_IS_STATUS_ERROR(ret)) { - /* Even it fails continue Fw will take default LI */ - WMA_LOGE("Failed to Set Listen Interval vdevId %d", vdev_id); - } - WMA_LOGD("Set Listen Interval vdevId %d Listen Intv %d", - vdev_id, cfg_data_val); - - return QDF_STATUS_SUCCESS; -} - /** * wma_get_qpower_config() - get qpower configuration * @wma: WMA handle From e62940e9d65f84deddfd9a70cf63ea90a7e2d69e Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 17:35:01 -0700 Subject: [PATCH 038/113] Release 5.1.0.29V Release 5.1.0.29V Change-Id: I372c04ea7e873dc5216225c827d02757a998cb08 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index beff24740296..b917a7540656 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "U" +#define QWLAN_VERSION_EXTRA "V" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29U" +#define QWLAN_VERSIONSTR "5.1.0.29V" #endif /* QWLAN_VERSION_H */ From ae6ae24d5000bbebe078b9303c4e6bc8b8d28b21 Mon Sep 17 00:00:00 2001 From: "Padma, Santhosh Kumar" Date: Wed, 5 Oct 2016 19:45:07 +0530 Subject: [PATCH 039/113] qcacld-3.0: Fix mgmtFrameSessionId in lim_send_p2p_action_frame Cleanup as part of lim_p2p_action_cnf triggers only when mgmtFrameSessionId is not 0xff. If cleanup does not happen in error scenario, it can result in not clearing cfgState->buf which can lead to dropping of further action frames in __wlan_hdd_mgmt_tx. Fix this by filling mgmtFrameSessionId with proper session id. Change-Id: Icc0f5b576ff71776dc448a673b6e12defe0c514e CRs-Fixed: 1074565 --- core/mac/src/pe/lim/lim_p2p.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_p2p.c b/core/mac/src/pe/lim/lim_p2p.c index 9485f127d6e1..096f78a16581 100644 --- a/core/mac/src/pe/lim/lim_p2p.c +++ b/core/mac/src/pe/lim/lim_p2p.c @@ -468,6 +468,7 @@ static void lim_tx_action_frame(tpAniSirGlobal mac_ctx, * need to go at OFDM rates. And BD rate2 we configured at 6Mbps. */ tx_flag |= HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME; + mac_ctx->lim.mgmtFrameSessionId = sme_session_id; if ((SIR_MAC_MGMT_PROBE_RSP == fc->subType) || (mb_msg->noack)) { @@ -483,7 +484,6 @@ static void lim_tx_action_frame(tpAniSirGlobal mac_ctx, true : false); mac_ctx->lim.mgmtFrameSessionId = 0xff; } else { - mac_ctx->lim.mgmtFrameSessionId = mb_msg->sessionId; qdf_status = wma_tx_frameWithTxComplete(mac_ctx, packet, (uint16_t) msg_len, @@ -550,7 +550,9 @@ void lim_send_p2p_action_frame(tpAniSirGlobal mac_ctx, if ((!mac_ctx->lim.gpLimRemainOnChanReq) && (0 != mb_msg->wait)) { lim_log(mac_ctx, LOGE, FL("RemainOnChannel is not running")); + mac_ctx->lim.mgmtFrameSessionId = mb_msg->sessionId; lim_p2p_action_cnf(mac_ctx, false); + mac_ctx->lim.mgmtFrameSessionId = 0xff; return; } sme_session_id = mb_msg->sessionId; From f754bee3890abbd595189e24534b2136faa3a01f Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 18:46:05 -0700 Subject: [PATCH 040/113] Release 5.1.0.29W Release 5.1.0.29W Change-Id: I3af91053db071b62137116ecd62c782fa9d05b7c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b917a7540656..48eebffd2f06 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "V" +#define QWLAN_VERSION_EXTRA "W" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29V" +#define QWLAN_VERSIONSTR "5.1.0.29W" #endif /* QWLAN_VERSION_H */ From fef4c02f2c2e127292e360f18adec7f62fe92365 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Mon, 26 Sep 2016 12:11:30 -0700 Subject: [PATCH 041/113] qcacld-3.0: Make lim_process* messages static functions lim_process_messages() and lim_process_deferred_message_queue are currently a global functions, but they are only referenced from within lim_process_message_queue.c. Making lim_process_messages() and lim_process_deferred_message_queue to be a static function and rearrange it to avoid any forward reference of it. Change-Id: I30c5b388814de5fc02fd0352ef41c324216af705 CRs-Fixed: 1071312 --- core/mac/src/pe/include/lim_api.h | 1 - .../src/pe/lim/lim_process_message_queue.c | 76 ++++++++----------- core/mac/src/pe/lim/lim_types.h | 3 - 3 files changed, 33 insertions(+), 47 deletions(-) diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 9e77bcc44fce..9afa50d2fcc2 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -136,7 +136,6 @@ uint32_t lim_post_msg_high_priority(tpAniSirGlobal mac, tSirMsgQ *msg); * and dispatch to various sub modules within LIM module. */ extern void lim_message_processor(tpAniSirGlobal, tpSirMsgQ); -extern void lim_process_messages(tpAniSirGlobal, tpSirMsgQ); /* DT test alt deferred 2 */ /** * Function to check the LIM state if system is in Scan/Learn state. */ diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 37b326b6e863..728fda23726d 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1256,34 +1256,6 @@ void lim_process_abort_scan_ind(tpAniSirGlobal mac_ctx, return; } -/** - * lim_message_processor() - Process messages from LIM. - * - * @mac_ctx: Pointer to the Global Mac Context. - * @msg: Received LIM message. - * - * Wrapper function for lim_process_messages when handling messages received by - * LIM.Could either defer messages or process them. - * - * Return: None. - */ -void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) -{ - if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) { - pe_free_msg(mac_ctx, msg); - return; - } - - if (!def_msg_decision(mac_ctx, msg)) { - lim_process_messages(mac_ctx, msg); - /* process deferred message queue if allowed */ - if ((!(mac_ctx->lim.gLimAddtsSent)) && - (!(lim_is_system_in_scan_state(mac_ctx))) && - (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx))) - lim_process_deferred_message_queue(mac_ctx); - } -} - static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx, struct sSirMsgQ *msg) { @@ -1319,12 +1291,12 @@ static void lim_process_sme_obss_scan_ind(tpAniSirGlobal mac_ctx, /** * lim_process_messages() - Process messages from upper layers. * - * @mac_ctx: Pointer to the Global Mac Context. - * @msg: Received message. + * @mac_ctx: Pointer to the Global Mac Context. + * @msg: Received message. * * Return: None. */ -void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) +static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) { #ifdef FEATURE_AP_MCC_CH_AVOIDANCE uint8_t vdev_id = 0; @@ -2043,26 +2015,17 @@ void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) } /*** end lim_process_messages() ***/ /** - * lim_process_deferred_message_queue + * lim_process_deferred_message_queue() * - ***FUNCTION: * This function is called by LIM while exiting from Learn * mode. This function fetches messages posted to the LIM * deferred message queue limDeferredMsgQ. * - ***LOGIC: - * - ***ASSUMPTIONS: - * NA - * - ***NOTE: - * NA - * - * @param pMac - Pointer to Global MAC structure + * @pMac: Pointer to Global MAC structure * @return None */ -void lim_process_deferred_message_queue(tpAniSirGlobal pMac) +static void lim_process_deferred_message_queue(tpAniSirGlobal pMac) { tSirMsgQ limMsg = { 0, 0, 0 }; @@ -2089,6 +2052,33 @@ void lim_process_deferred_message_queue(tpAniSirGlobal pMac) } } /*** end lim_process_deferred_message_queue() ***/ +/** + * lim_message_processor() - Process messages from LIM. + * @mac_ctx: Pointer to the Global Mac Context. + * @msg: Received LIM message. + * + * Wrapper function for lim_process_messages when handling messages received by + * LIM. Could either defer messages or process them. + * + * Return: None. + */ +void lim_message_processor(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) +{ + if (eLIM_MLM_OFFLINE_STATE == mac_ctx->lim.gLimMlmState) { + pe_free_msg(mac_ctx, msg); + return; + } + + if (!def_msg_decision(mac_ctx, msg)) { + lim_process_messages(mac_ctx, msg); + /* process deferred message queue if allowed */ + if ((!(mac_ctx->lim.gLimAddtsSent)) && + (!(lim_is_system_in_scan_state(mac_ctx))) && + (true == GET_LIM_PROCESS_DEFD_MESGS(mac_ctx))) + lim_process_deferred_message_queue(mac_ctx); + } +} + /** * lim_process_normal_hdd_msg() - Process the message and defer if needed * @mac_ctx : Pointer to Global MAC structure diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 571579dc4d87..2dd2df5994e7 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -551,9 +551,6 @@ void lim_tear_down_link_with_ap(tpAniSirGlobal, uint8_t, tSirMacReasonCodes); /* / Function that processes Max retries interrupt from TFP */ void limHandleMaxRetriesInterrupt(uint32_t); -/* / Function that processes messages deferred during Learn mode */ -void lim_process_deferred_message_queue(tpAniSirGlobal); - /* / Function that defers the messages received */ uint32_t lim_defer_msg(tpAniSirGlobal, tSirMsgQ *); From d97be644896a7858c2adaeb1c1edf13c667557f3 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Mon, 26 Sep 2016 15:40:34 -0700 Subject: [PATCH 042/113] qcacld-3.0: Remove unused message types lim_process_message() function references to unused message types that starts with eWNI_PMC*. Cleanup the code and remove the unused message type references from the code. Change-Id: I5c88cb2544f74cb8c5e05b9178071ddbfaf2de23 Depends-on: 1727734 CRs-Fixed: 1071366 --- core/mac/inc/wni_api.h | 5 ----- core/mac/src/pe/lim/lim_process_message_queue.c | 7 ------- core/mac/src/sys/legacy/src/utils/src/mac_trace.c | 4 ---- core/sme/src/common/sme_api.c | 2 -- 4 files changed, 18 deletions(-) diff --git a/core/mac/inc/wni_api.h b/core/mac/inc/wni_api.h index 09f6cdb9a044..d55945efa3c1 100644 --- a/core/mac/inc/wni_api.h +++ b/core/mac/inc/wni_api.h @@ -108,11 +108,6 @@ enum eWniMsgTypes { eWNI_SME_UPDATE_NOA, eWNI_SME_CLEAR_DFS_CHANNEL_LIST, eWNI_SME_GET_SNR_REQ, - /* General Power Save Messages */ - eWNI_PMC_MSG_TYPES_BEGIN, - - /* WOWL Messages */ - eWNI_PMC_SMPS_STATE_IND, eWNI_SME_RRM_MSG_TYPE_BEGIN, diff --git a/core/mac/src/pe/lim/lim_process_message_queue.c b/core/mac/src/pe/lim/lim_process_message_queue.c index 728fda23726d..2229f7f9bae7 100644 --- a/core/mac/src/pe/lim/lim_process_message_queue.c +++ b/core/mac/src/pe/lim/lim_process_message_queue.c @@ -1524,13 +1524,6 @@ static void lim_process_messages(tpAniSirGlobal mac_ctx, tpSirMsgQ msg) /* These messages are from HDD.No need to respond to HDD */ lim_process_normal_hdd_msg(mac_ctx, msg, false); break; - - case eWNI_PMC_SMPS_STATE_IND: - if (msg->bodyptr) { - qdf_mem_free(msg->bodyptr); - msg->bodyptr = NULL; - } - break; case eWNI_SME_SEND_ACTION_FRAME_IND: lim_send_p2p_action_frame(mac_ctx, msg); qdf_mem_free(msg->bodyptr); diff --git a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c index 064b17423e52..a76e2b49b6e9 100644 --- a/core/mac/src/sys/legacy/src/utils/src/mac_trace.c +++ b/core/mac/src/sys/legacy/src/utils/src/mac_trace.c @@ -286,10 +286,6 @@ uint8_t *mac_trace_get_sme_msg_string(uint16_t sme_msg) CASE_RETURN_STRING(eWNI_SME_CLEAR_DFS_CHANNEL_LIST); CASE_RETURN_STRING(eWNI_SME_GET_SNR_REQ); CASE_RETURN_STRING(eWNI_SME_LINK_STATUS_IND); - - CASE_RETURN_STRING(eWNI_PMC_MSG_TYPES_BEGIN); - - CASE_RETURN_STRING(eWNI_PMC_SMPS_STATE_IND); CASE_RETURN_STRING(eWNI_SME_RRM_MSG_TYPE_BEGIN); CASE_RETURN_STRING(eWNI_SME_NEIGHBOR_REPORT_REQ_IND); CASE_RETURN_STRING(eWNI_SME_NEIGHBOR_REPORT_IND); diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 7bfe3c9ff9a4..7577d99c6af0 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -2594,8 +2594,6 @@ QDF_STATUS sme_process_msg(tHalHandle hHal, cds_msg_t *pMsg) qdf_mem_free(pMsg->bodyptr); break; #endif - case eWNI_PMC_SMPS_STATE_IND: - break; case WNI_CFG_SET_CNF: case WNI_CFG_DNLD_CNF: case WNI_CFG_GET_RSP: From f1ba31e987229aaf9021bc40936979cf58ee1221 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 19:24:26 -0700 Subject: [PATCH 043/113] Release 5.1.0.29X Release 5.1.0.29X Change-Id: I7625c975d6f1be9198fb080426b46a3b781fd976 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 48eebffd2f06..b1b92fbc062a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "W" +#define QWLAN_VERSION_EXTRA "X" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29W" +#define QWLAN_VERSIONSTR "5.1.0.29X" #endif /* QWLAN_VERSION_H */ From 32eb50281c2d80bbeb50df5267392614d8e23bf5 Mon Sep 17 00:00:00 2001 From: Kabilan Kannan Date: Tue, 4 Oct 2016 12:24:50 -0700 Subject: [PATCH 044/113] qcacld-3.0: Clean up and refactor tdls module Currently the build fails, if we disable TDLS feature flag in the kbuild. Fix all the tdls conditional compilation issues to make a successfull build with tdls feature flag enabled/disabled. Change-Id: I78114474d9ebe65e76840cb581389535f3486e4f CRs-Fixed: 1066077 --- core/cds/inc/cds_concurrency.h | 14 ++++ core/cds/src/cds_concurrency.c | 2 + core/hdd/inc/wlan_hdd_assoc.h | 2 + core/hdd/inc/wlan_hdd_main.h | 2 - core/hdd/inc/wlan_hdd_tdls.h | 42 ++++++++--- core/hdd/src/wlan_hdd_assoc.c | 51 ++++++-------- core/hdd/src/wlan_hdd_ioctl.c | 3 +- core/hdd/src/wlan_hdd_tdls.c | 98 +++++++++++++++++++++++--- core/hdd/src/wlan_hdd_tx_rx.c | 14 +--- core/mac/src/pe/include/lim_api.h | 17 +++++ core/mac/src/pe/include/lim_session.h | 4 ++ core/mac/src/pe/lim/lim_api.c | 5 +- core/mac/src/pe/lim/lim_process_tdls.c | 9 +++ core/mac/src/pe/lim/lim_types.h | 5 ++ core/sme/inc/csr_api.h | 21 ++++-- core/sme/src/csr/csr_api_roam.c | 13 ++-- 16 files changed, 222 insertions(+), 80 deletions(-) diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index efe9f70622e0..429d64e0d35b 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -592,8 +592,22 @@ struct cds_conc_connection_info { bool cds_is_connection_in_progress(void); void cds_dump_concurrency_info(void); + +#ifdef FEATURE_WLAN_TDLS bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode); void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx); +#else +static inline bool cds_check_is_tdls_allowed(enum tQDF_ADAPTER_MODE device_mode) +{ + return false; +} + +static inline void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx) +{ + +} +#endif + void cds_set_concurrency_mode(enum tQDF_ADAPTER_MODE mode); void cds_clear_concurrency_mode(enum tQDF_ADAPTER_MODE mode); uint32_t cds_get_connection_count(void); diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 25155c2c18d5..7504b2315d25 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3340,6 +3340,7 @@ void cds_dump_concurrency_info(void) hdd_ctx->mcc_mode = !cds_current_concurrency_is_scc(); } +#ifdef FEATURE_WLAN_TDLS /* * cds_check_is_tdls_allowed() - check is tdls allowed or not * @adapter: pointer to adapter @@ -3419,6 +3420,7 @@ set_state: cds_info("enable_tdls_connection_tracker %d", hdd_ctx->enable_tdls_connection_tracker); } +#endif /** * cds_set_concurrency_mode() - To set concurrency mode diff --git a/core/hdd/inc/wlan_hdd_assoc.h b/core/hdd/inc/wlan_hdd_assoc.h index f49cb125ed54..bf87fcf37fb1 100644 --- a/core/hdd/inc/wlan_hdd_assoc.h +++ b/core/hdd/inc/wlan_hdd_assoc.h @@ -272,6 +272,7 @@ int hdd_set_genie_to_csr(hdd_adapter_t *pAdapter, eCsrAuthType *RSNAuthType); */ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType); +#ifdef FEATURE_WLAN_TDLS /** * hdd_roam_register_tdlssta() - register new TDLS station * @pAdapter: pointer to adapter @@ -287,6 +288,7 @@ int hdd_set_csr_auth_type(hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType); QDF_STATUS hdd_roam_register_tdlssta(hdd_adapter_t *pAdapter, const uint8_t *peerMac, uint16_t staId, uint8_t ucastSig, uint8_t qos); +#endif /** * hdd_perform_roam_set_key_complete() - perform set key complete diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 6f263d2b1b64..7d9926e58aac 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -54,9 +54,7 @@ #include #endif #include -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" -#endif #include "wlan_hdd_tsf.h" #include "wlan_hdd_cfg80211.h" #include diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 37e6243d572a..7fa22b27002d 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -710,8 +710,33 @@ void hdd_tdls_context_destroy(hdd_context_t *hdd_ctx); int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, uint32_t mode); -hdd_adapter_t *wlan_hdd_tdls_check_and_enable(hdd_context_t *hdd_ctx); +/** + * wlan_hdd_tdls_notify_connect() - Update tdls state for every + * connect event. + * @adapter: hdd adapter + * @csr_roam_info: csr information + * + * After every connect event in the system, check whether TDLS + * can be enabled in the system. If TDLS can be enabled, update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, + tCsrRoamInfo *csr_roam_info); +/** + * wlan_hdd_tdls_notify_disconnect() - Update tdls state for every + * disconnect event. + * @adapter: hdd adapter + * + * After every disconnect event in the system, check whether TDLS + * can be disabled/enabled in the system and update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter); #else static inline void hdd_tdls_notify_mode_change(hdd_adapter_t *adapter, @@ -742,19 +767,18 @@ static inline int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, { return 0; } - -static inline hdd_adapter_t *wlan_hdd_tdls_check_and_enable( - hdd_context_t *hdd_ctx) -{ - return NULL; -} - static inline void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, bool tdls_chan_swit_prohibited) { } - +static inline void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, + tCsrRoamInfo *csr_roam_info) +{ +} +static inline void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter) +{ +} #endif /* End of FEATURE_WLAN_TDLS */ #ifdef FEATURE_WLAN_DIAG_SUPPORT diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 8810512e169b..c5a5fcac0922 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -47,9 +47,7 @@ #include "wlan_hdd_cfg80211.h" #include "csr_inside_api.h" #include "wlan_hdd_p2p.h" -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" -#endif #include "sme_api.h" #include "wlan_hdd_hostapd.h" #include @@ -1191,7 +1189,6 @@ static void hdd_send_association_event(struct net_device *dev, int we_event; char *msg; struct qdf_mac_addr peerMacAddr; - hdd_adapter_t *tdls_adapter; /* Added to find the auth type on the fly at run time */ /* rather than with cfg to see if FT is enabled */ @@ -1282,14 +1279,8 @@ static void hdd_send_association_event(struct net_device *dev, pAdapter->sessionId, &chan_info, pAdapter->device_mode); - - hdd_info("Assoc: Check and enable or disable TDLS state "); - if ((pAdapter->device_mode == QDF_STA_MODE || - pAdapter->device_mode == QDF_P2P_CLIENT_MODE) && - !pHddCtx->concurrency_marked) - wlan_hdd_update_tdls_info(pAdapter, - pCsrRoamInfo->tdls_prohibited, - pCsrRoamInfo->tdls_chan_swit_prohibited); + /* Update tdls module about connection event */ + wlan_hdd_tdls_notify_connect(pAdapter, pCsrRoamInfo); #ifdef MSM_PLATFORM #if defined(CONFIG_ICNSS) || defined(CONFIG_CNSS) @@ -1335,24 +1326,9 @@ static void hdd_send_association_event(struct net_device *dev, pAdapter->device_mode); } hdd_lpass_notify_disconnect(pAdapter); -#ifdef FEATURE_WLAN_TDLS - hdd_info("Disassoc: Check and enable or disable TDLS state "); - if ((pAdapter->device_mode == QDF_STA_MODE || - pAdapter->device_mode == QDF_P2P_CLIENT_MODE) && - !pHddCtx->concurrency_marked) { - wlan_hdd_update_tdls_info(pAdapter, - true, - true); - } - if (!pHddCtx->concurrency_marked) { - tdls_adapter = wlan_hdd_tdls_check_and_enable( - pHddCtx); - if (NULL != tdls_adapter) - wlan_hdd_update_tdls_info(tdls_adapter, - false, - false); - } -#endif + /* Update tdls module about the disconnection event */ + wlan_hdd_tdls_notify_disconnect(pAdapter); + #ifdef MSM_PLATFORM /* stop timer in sta/p2p_cli */ spin_lock_bh(&pHddCtx->bus_bw_lock); @@ -4037,6 +4013,23 @@ hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, return status; } +#else + +static inline QDF_STATUS hdd_roam_deregister_tdlssta(hdd_adapter_t *pAdapter, + uint8_t staId) +{ + return QDF_STATUS_SUCCESS; +} + +static inline QDF_STATUS +hdd_roam_tdls_status_update_handler(hdd_adapter_t *pAdapter, + tCsrRoamInfo *pRoamInfo, + uint32_t roamId, + eRoamCmdStatus roamStatus, + eCsrRoamResult roamResult) +{ + return QDF_STATUS_SUCCESS; +} #endif #ifdef WLAN_FEATURE_11W diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index fcc2f5e0e7b6..61c1a77aec74 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6639,8 +6639,7 @@ static int drv_cmd_set_antenna_mode(hdd_adapter_t *adapter, /* Check TDLS status and update antenna mode */ if ((QDF_STA_MODE == adapter->device_mode) && - cds_is_sta_active_connection_exists() && - (hdd_ctx->connected_peer_count > 0)) { + cds_is_sta_active_connection_exists()) { ret = wlan_hdd_tdls_antenna_switch(hdd_ctx, adapter, mode); if (0 != ret) diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index eaac53a0a77f..4abe1fef943f 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -1768,16 +1768,15 @@ int wlan_hdd_tdls_set_params(struct net_device *dev, } /** - * wlan_hdd_tdls_check_and_enable() - check system state and enable tdls + * wlan_hdd_tdls_get_adapter() - check system state and return hdd adapter * @hdd_ctx: hdd context * - * After every disassociation in the system, check whether TDLS - * can be enabled in the system. If TDLS possible return the - * corresponding hdd adapter to enable TDLS. + * If TDLS possible, return the corresponding hdd adapter + * to enable TDLS in the system. * * Return: hdd adapter pointer or NULL. */ -hdd_adapter_t *wlan_hdd_tdls_check_and_enable(hdd_context_t *hdd_ctx) +static hdd_adapter_t *wlan_hdd_tdls_get_adapter(hdd_context_t *hdd_ctx) { if (cds_get_connection_count() > 1) return NULL; @@ -1951,6 +1950,74 @@ void wlan_hdd_update_tdls_info(hdd_adapter_t *adapter, bool tdls_prohibited, return; } +/** + * wlan_hdd_tdls_notify_connect() - Update tdls state for every + * connect event. + * @adapter: hdd adapter + * @csr_roam_info: csr information + * + * After every connect event in the system, check whether TDLS + * can be enabled in the system. If TDLS can be enabled, update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, + tCsrRoamInfo *csr_roam_info) +{ + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + hdd_info("Check and update TDLS state"); + + /* Association event */ + if ((adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) && + !hdd_ctx->concurrency_marked) { + wlan_hdd_update_tdls_info(adapter, + csr_roam_info->tdls_prohibited, + csr_roam_info->tdls_chan_swit_prohibited); + } +} + +/** + * wlan_hdd_tdls_notify_disconnect() - Update tdls state for every + * disconnect event. + * @adapter: hdd adapter + * + * After every disconnect event in the system, check whether TDLS + * can be disabled/enabled in the system and update the + * TDLS state as needed. + * + * Return: None + */ +void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter) +{ + hdd_adapter_t *temp_adapter; + hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + hdd_info("Check and update TDLS state"); + + /* Disassociation event */ + if ((adapter->device_mode == QDF_STA_MODE || + adapter->device_mode == QDF_P2P_CLIENT_MODE) && + !hdd_ctx->concurrency_marked) { + wlan_hdd_update_tdls_info(adapter, true, true); + } + + /* If concurrency is not marked, then we have to + * check, whether TDLS could be enabled in the + * system after this disassoc event. + */ + if (!hdd_ctx->concurrency_marked) { + temp_adapter = wlan_hdd_tdls_get_adapter( + hdd_ctx); + if (NULL != temp_adapter) + wlan_hdd_update_tdls_info(temp_adapter, + false, + false); + } +} + /** * wlan_hdd_tdls_set_sta_id() - set station ID on a tdls peer * @pAdapter: HDD adapter @@ -2483,7 +2550,7 @@ void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter) hdd_err("TDLS set state is not cleared correctly !!!"); pHddCtx->concurrency_marked = false; } - tdls_adapter = wlan_hdd_tdls_check_and_enable(pHddCtx); + tdls_adapter = wlan_hdd_tdls_get_adapter(pHddCtx); if (tdls_adapter) wlan_hdd_update_tdls_info(tdls_adapter, false, false); } @@ -5134,6 +5201,11 @@ void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, uint8_t valid_mac_entries; struct qdf_mac_addr *mac_addr; + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + if (!hdd_ctx->enable_tdls_connection_tracker) + return; + mac_addr = (struct qdf_mac_addr *)(skb->data+QDF_MAC_ADDR_SIZE); if (qdf_is_macaddr_group(mac_addr)) return; @@ -5143,7 +5215,6 @@ void wlan_hdd_tdls_update_rx_pkt_cnt(hdd_adapter_t *adapter, mac_addr, QDF_MAC_ADDR_SIZE) == 0) return; - hdd_ctx = WLAN_HDD_GET_CTX(adapter); tdls_ctx = adapter->sessionCtx.station.pHddTdlsCtx; qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); @@ -5197,6 +5268,11 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, uint8_t valid_mac_entries; struct qdf_mac_addr *mac_addr; + hdd_ctx = WLAN_HDD_GET_CTX(adapter); + + if (!hdd_ctx->enable_tdls_connection_tracker) + return; + mac_addr = (struct qdf_mac_addr *)skb->data; if (qdf_is_macaddr_group(mac_addr)) return; @@ -5206,7 +5282,6 @@ void wlan_hdd_tdls_update_tx_pkt_cnt(hdd_adapter_t *adapter, QDF_MAC_ADDR_SIZE) == 0) return; - hdd_ctx = WLAN_HDD_GET_CTX(adapter); tdls_ctx = adapter->sessionCtx.station.pHddTdlsCtx; qdf_spin_lock_bh(&hdd_ctx->tdls_ct_spinlock); @@ -5816,9 +5891,12 @@ int wlan_hdd_tdls_antenna_switch(hdd_context_t *hdd_ctx, { uint8_t tdls_peer_cnt; uint32_t vdev_nss; - hdd_station_ctx_t *sta_ctx = - WLAN_HDD_GET_STATION_CTX_PTR(adapter); + hdd_station_ctx_t *sta_ctx; + if (hdd_ctx->connected_peer_count == 0) + return 0; + + sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); /* Check whether TDLS antenna switch is in progress */ if (hdd_ctx->tdls_nss_switch_in_progress) { if (hdd_ctx->tdls_nss_teardown_complete == false) { diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 918973a91cee..0fea7d814579 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -47,18 +47,12 @@ #include #include "sap_api.h" #include "wlan_hdd_wmm.h" - -#ifdef FEATURE_WLAN_TDLS #include "wlan_hdd_tdls.h" -#endif #include - #include "wlan_hdd_ocb.h" #include "wlan_hdd_lro.h" - #include "cdp_txrx_peer_ops.h" #include "ol_txrx.h" - #include "wlan_hdd_nan_datapath.h" #include "pld_common.h" @@ -419,8 +413,8 @@ int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) hdd_station_ctx_t *pHddStaCtx = &pAdapter->sessionCtx.station; #ifdef QCA_PKT_PROTO_TRACE uint8_t proto_type = 0; -#endif /* QCA_PKT_PROTO_TRACE */ hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(pAdapter); +#endif /* QCA_PKT_PROTO_TRACE */ #ifdef QCA_WIFI_FTM if (hdd_get_conparam() == QDF_GLOBAL_FTM_MODE) { @@ -551,8 +545,7 @@ int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) pAdapter->stats.tx_bytes += skb->len; - if (hdd_ctx->enable_tdls_connection_tracker) - wlan_hdd_tdls_update_tx_pkt_cnt(pAdapter, skb); + wlan_hdd_tdls_update_tx_pkt_cnt(pAdapter, skb); ++pAdapter->stats.tx_packets; @@ -965,8 +958,7 @@ QDF_STATUS hdd_rx_packet_cbk(void *context, qdf_nbuf_t rxBuf) qdf_nbuf_data_addr(rxBuf), sizeof(qdf_nbuf_data(rxBuf)), QDF_RX)); - if (pHddCtx->enable_tdls_connection_tracker) - wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb); + wlan_hdd_tdls_update_rx_pkt_cnt(pAdapter, skb); skb->dev = pAdapter->dev; skb->protocol = eth_type_trans(skb, skb->dev); diff --git a/core/mac/src/pe/include/lim_api.h b/core/mac/src/pe/include/lim_api.h index 9afa50d2fcc2..dc78c170d79e 100644 --- a/core/mac/src/pe/include/lim_api.h +++ b/core/mac/src/pe/include/lim_api.h @@ -164,6 +164,23 @@ extern void lim_trigger_sta_deletion(tpAniSirGlobal pMac, tpDphHashNode pStaDs, extern void lim_send_sme_tdls_del_sta_ind(tpAniSirGlobal pMac, tpDphHashNode pStaDs, tpPESession psessionEntry, uint16_t reasonCode); +/** + * lim_set_tdls_flags() - update tdls flags based on newer STA connection + * information + * @roam_sync_ind_ptr: pointer to roam offload structure + * @ft_session_ptr: pointer to PE session + * + * Set TDLS flags as per new STA connection capabilities. + * + * Return: None + */ +void lim_set_tdls_flags(roam_offload_synch_ind *roam_sync_ind_ptr, + tpPESession ft_session_ptr); +#else +static inline void lim_set_tdls_flags(roam_offload_synch_ind *roam_sync_ind_ptr, + tpPESession ft_session_ptr) +{ +} #endif /* / Function that checks for change in AP's capabilties on STA */ diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index b8b34a98fb79..4b36c7ee704c 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -344,6 +344,10 @@ typedef struct sPESession /* Added to Support BT-AMP */ uint8_t freePeerIdxTail; uint16_t gLimNumOfCurrentSTAs; #ifdef FEATURE_WLAN_TDLS + /* TDLS parameters to check whether TDLS + * and TDLS channel switch is allowed in the + * AP network + */ uint32_t peerAIDBitmap[2]; bool tdls_prohibited; bool tdls_chan_swit_prohibited; diff --git a/core/mac/src/pe/lim/lim_api.c b/core/mac/src/pe/lim/lim_api.c index 2700e9ad55b7..136d0e920579 100644 --- a/core/mac/src/pe/lim/lim_api.c +++ b/core/mac/src/pe/lim/lim_api.c @@ -2070,10 +2070,7 @@ QDF_STATUS pe_roam_synch_callback(tpAniSirGlobal mac_ctx, roam_sync_ind_ptr->join_rsp->nss = curr_sta_ds->nss; roam_sync_ind_ptr->join_rsp->max_rate_flags = lim_get_max_rate_flags(mac_ctx, curr_sta_ds); - roam_sync_ind_ptr->join_rsp->tdls_prohibited = - ft_session_ptr->tdls_prohibited; - roam_sync_ind_ptr->join_rsp->tdls_chan_swit_prohibited = - ft_session_ptr->tdls_chan_swit_prohibited; + lim_set_tdls_flags(roam_sync_ind_ptr, ft_session_ptr); roam_sync_ind_ptr->join_rsp->aid = ft_session_ptr->limAID; lim_fill_join_rsp_ht_caps(ft_session_ptr, roam_sync_ind_ptr->join_rsp); ft_session_ptr->limPrevSmeState = ft_session_ptr->limSmeState; diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 1e87bd405276..b2e15757fba5 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -963,6 +963,15 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket, } #endif +void lim_set_tdls_flags(roam_offload_synch_ind *roam_sync_ind_ptr, + tpPESession ft_session_ptr) +{ + roam_sync_ind_ptr->join_rsp->tdls_prohibited = + ft_session_ptr->tdls_prohibited; + roam_sync_ind_ptr->join_rsp->tdls_chan_swit_prohibited = + ft_session_ptr->tdls_chan_swit_prohibited; +} + /* * TDLS setup Request frame on AP link */ diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index 2dd2df5994e7..5b6ec4673827 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -538,6 +538,11 @@ static inline tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, tpPESession session_entry) { return eSIR_SUCCESS; +} +static inline void lim_init_tdls_data(tpAniSirGlobal pMac, + tpPESession pSessionEntry) +{ + } #endif diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 517a01185aab..f36805226cb5 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -476,10 +476,12 @@ typedef enum { eCSR_ROAM_PREAUTH_STATUS_SUCCESS, eCSR_ROAM_PREAUTH_STATUS_FAILURE, eCSR_ROAM_HANDOVER_SUCCESS, -#ifdef FEATURE_WLAN_TDLS + /* + * TDLS callback events + */ eCSR_ROAM_TDLS_STATUS_UPDATE, eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND, -#endif + /* Disaconnect all the clients */ eCSR_ROAM_DISCONNECT_ALL_P2P_CLIENTS, /* Stopbss triggered from SME due to different */ @@ -587,7 +589,7 @@ typedef enum { eCSR_ROAM_RESULT_MAX_ASSOC_EXCEEDED, /* Assoc rejected due to concurrent session running on a diff channel */ eCSR_ROAM_RESULT_ASSOC_FAIL_CON_CHANNEL, -#ifdef FEATURE_WLAN_TDLS + /* TDLS events */ eCSR_ROAM_RESULT_ADD_TDLS_PEER, eCSR_ROAM_RESULT_UPDATE_TDLS_PEER, eCSR_ROAM_RESULT_DELETE_TDLS_PEER, @@ -598,7 +600,6 @@ typedef enum { eCSR_ROAM_RESULT_TDLS_SHOULD_TEARDOWN, eCSR_ROAM_RESULT_TDLS_SHOULD_PEER_DISCONNECTED, eCSR_ROAM_RESULT_TDLS_CONNECTION_TRACKER_NOTIFICATION, -#endif eCSR_ROAM_RESULT_IBSS_PEER_INFO_SUCCESS, eCSR_ROAM_RESULT_IBSS_PEER_INFO_FAILED, @@ -1386,6 +1387,11 @@ typedef struct tagCsrRoamInfo { uint32_t roc_scan_id; uint32_t rxChan; #ifdef FEATURE_WLAN_TDLS + /* + * TDLS parameters to check whether TDLS + * and TDLS channel switch is allowed in the + * AP network + */ uint8_t staType; bool tdls_prohibited; /* per ExtCap in Assoc/Reassoc resp */ bool tdls_chan_swit_prohibited; /* per ExtCap in Assoc/Reassoc resp */ @@ -1740,10 +1746,11 @@ QDF_STATUS csr_roam_issue_ft_roam_offload_synch(tHalHandle hHal, #endif typedef void (*tCsrLinkStatusCallback)(uint8_t status, void *pContext); #ifdef FEATURE_WLAN_TDLS -void csr_roam_fill_tdls_info(tCsrRoamInfo *roam_info, tpSirSmeJoinRsp join_rsp); +void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, + tpSirSmeJoinRsp join_rsp); #else -static inline void csr_roam_fill_tdls_info(tCsrRoamInfo *roam_info, - tpSirSmeJoinRsp join_rsp) +static inline void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, + tpSirSmeJoinRsp join_rsp) {} #endif diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index fab7f0e48638..896fa91b593d 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -19468,11 +19468,16 @@ fail: * * Return: None */ -void csr_roam_fill_tdls_info(tCsrRoamInfo *roam_info, tpSirSmeJoinRsp join_rsp) +void csr_roam_fill_tdls_info(tpAniSirGlobal mac_ctx, tCsrRoamInfo *roam_info, + tpSirSmeJoinRsp join_rsp) { roam_info->tdls_prohibited = join_rsp->tdls_prohibited; roam_info->tdls_chan_swit_prohibited = join_rsp->tdls_chan_swit_prohibited; + sms_log(mac_ctx, LOG1, + FL("tdls:prohibit: %d, chan_swit_prohibit: %d"), + roam_info->tdls_prohibited, + roam_info->tdls_chan_swit_prohibited); } #endif @@ -19717,11 +19722,7 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx, roam_info->chan_info.nss = roam_synch_data->join_rsp->nss; roam_info->chan_info.rate_flags = roam_synch_data->join_rsp->max_rate_flags; - csr_roam_fill_tdls_info(roam_info, roam_synch_data->join_rsp); - sms_log(mac_ctx, LOG1, - FL("tdls:prohibit: %d, chan_swit_prohibit: %d"), - roam_info->tdls_prohibited, - roam_info->tdls_chan_swit_prohibited); + csr_roam_fill_tdls_info(mac_ctx, roam_info, roam_synch_data->join_rsp); #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH src_profile = &roam_synch_data->join_rsp->HTProfile; dst_profile = &conn_profile->HTProfile; From fa2d77387f947807144dfec6470ee2722a92c195 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 19:57:24 -0700 Subject: [PATCH 045/113] Release 5.1.0.29Y Release 5.1.0.29Y Change-Id: I6abc5adbedf2b7184c7d3544f855acd09842a4e2 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b1b92fbc062a..297efd304c3b 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "X" +#define QWLAN_VERSION_EXTRA "Y" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29X" +#define QWLAN_VERSIONSTR "5.1.0.29Y" #endif /* QWLAN_VERSION_H */ From 1e6b9262adeae0f6fac78537759c34c0a0791b6c Mon Sep 17 00:00:00 2001 From: Archana Ramachandran Date: Fri, 30 Sep 2016 15:15:10 -0700 Subject: [PATCH 046/113] qcacld-3.0: Add range check for P2P NOA request parameters Add range check for P2P NOA parameters such as duration and interval to prevent integer overflow from binary operation. Change-Id: Iffa57d592af7ac6af7f67d80b85a276aa8faee4e CRs-Fixed: 1072839 --- core/hdd/src/wlan_hdd_p2p.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index ea3df68c7a47..1700a9c247c9 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -55,6 +55,7 @@ /* Ms to Time Unit Micro Sec */ #define MS_TO_TU_MUS(x) ((x) * 1024) +#define MAX_MUS_VAL (INT_MAX / 1024) static uint8_t *hdd_get_action_string(uint16_t MsgType) { @@ -1741,6 +1742,11 @@ int hdd_set_p2p_noa(struct net_device *dev, uint8_t *command) ret); return -EINVAL; } + if (count < 0 || interval < 0 || duration < 0 || + interval > MAX_MUS_VAL || duration > MAX_MUS_VAL) { + hdd_err("Invalid NOA parameters"); + return -EINVAL; + } hdd_info("P2P_SET GO NoA: count=%d interval=%d duration=%d", count, interval, duration); duration = MS_TO_TU_MUS(duration); From 4f7f2584024877b273135782e15c77df59caaeb2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 20:34:35 -0700 Subject: [PATCH 047/113] Release 5.1.0.29Z Release 5.1.0.29Z Change-Id: I7be14ba7785a0207fef21c2d4461c6c364c10e3d CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 297efd304c3b..058abe50fc47 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Y" +#define QWLAN_VERSION_EXTRA "Z" #define QWLAN_VERSION_BUILD 29 -#define QWLAN_VERSIONSTR "5.1.0.29Y" +#define QWLAN_VERSIONSTR "5.1.0.29Z" #endif /* QWLAN_VERSION_H */ From 561cdb9c4ab836a4da5b6b054803def86327eacc Mon Sep 17 00:00:00 2001 From: Deepak Dhamdhere Date: Fri, 2 Sep 2016 20:12:58 -0700 Subject: [PATCH 048/113] qcacld-3.0: Fix improper use of qdf_event_create Improper use of qdf_event_create caused QDF_ASSERT. Use qdf_event_reset in ol_txrx_peer_attach(). Use correct comparison for return value of qdf_wait_single_event(). CRs-Fixed: 1065451 Change-Id: I735fe12230b6558123f73d68f09fd126bf0406d6 --- core/dp/txrx/ol_txrx.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index 82c2b116b580..a80f6ac84aa8 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -1750,6 +1750,7 @@ ol_txrx_vdev_attach(ol_txrx_pdev_handle pdev, uint8_t vdev_id, enum wlan_op_mode op_mode) { struct ol_txrx_vdev_t *vdev; + QDF_STATUS qdf_status; /* preconditions */ TXRX_ASSERT2(pdev); @@ -1809,6 +1810,7 @@ ol_txrx_vdev_attach(ol_txrx_pdev_handle pdev, /* Default MAX Q depth for every VDEV */ vdev->ll_pause.max_q_depth = ol_tx_cfg_max_tx_queue_depth_ll(vdev->pdev->ctrl_pdev); + qdf_status = qdf_event_create(&vdev->wait_delete_comp); /* add this vdev into the pdev's list */ TAILQ_INSERT_TAIL(&pdev->vdev_list, vdev, vdev_list_elem); @@ -1986,6 +1988,7 @@ ol_txrx_vdev_detach(ol_txrx_vdev_handle vdev, return; } qdf_spin_unlock_bh(&pdev->peer_ref_mutex); + qdf_event_destroy(&vdev->wait_delete_comp); TXRX_PRINT(TXRX_PRINT_LEVEL_INFO1, "%s: deleting vdev obj %p (%02x:%02x:%02x:%02x:%02x:%02x)\n", @@ -2111,7 +2114,7 @@ ol_txrx_peer_attach(ol_txrx_vdev_handle vdev, uint8_t *peer_mac_addr) peer_mac_addr[4], peer_mac_addr[5]); if (qdf_atomic_read(&temp_peer->delete_in_progress)) { vdev->wait_on_peer_id = temp_peer->local_id; - qdf_event_create(&vdev->wait_delete_comp); + qdf_event_reset(&vdev->wait_delete_comp); wait_on_deletion = true; } else { qdf_spin_unlock_bh(&pdev->peer_ref_mutex); @@ -2125,10 +2128,10 @@ ol_txrx_peer_attach(ol_txrx_vdev_handle vdev, uint8_t *peer_mac_addr) /* wait for peer deletion */ rc = qdf_wait_single_event(&vdev->wait_delete_comp, PEER_DELETION_TIMEOUT); - if (!rc) { + if (QDF_STATUS_SUCCESS != rc) { TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, - "timedout waiting for peer(%d) deletion\n", - vdev->wait_on_peer_id); + "error waiting for peer(%d) deletion, status %d\n", + vdev->wait_on_peer_id, (int) rc); vdev->wait_on_peer_id = OL_TXRX_INVALID_LOCAL_PEER_ID; return NULL; } From f74d6f8a97f72758e2e05a5458a6ed9c0a8b79ec Mon Sep 17 00:00:00 2001 From: Deepak Dhamdhere Date: Fri, 16 Sep 2016 02:47:01 -0700 Subject: [PATCH 049/113] qcacld-3.0: Fix peer unmap/map handling during roaming Roam_synch indication processing in host performs peer detach/attach operations after firmware has already moved to the new peer. Out of sequence peer unmap and map events can mess up the reference count for reused peer_id values, which can lead to crash. Solution: While detaching a peer during roam sync indication processing, copy its peer_id_ref_cnt in peer_id_to_obj array to new variable in the same peer map for that peer id. Peer is deleted at that point. When the unmap events come in, decrement the old ref_cnt and map events increment the real ref_cnt. Once the old ref_cnt goes to 0, subsequent unmap operations apply to the real peer. CRs-Fixed: 1063177 Change-Id: I9b20f28f17dea1647a213b9f36060109264addf0 --- core/dp/txrx/ol_txrx.c | 62 ++++++++++---- core/dp/txrx/ol_txrx.h | 1 + core/dp/txrx/ol_txrx_peer_find.c | 134 +++++++++++++++++++++++++++---- core/dp/txrx/ol_txrx_peer_find.h | 3 + core/dp/txrx/ol_txrx_types.h | 12 ++- core/wma/src/wma_dev_if.c | 10 ++- 6 files changed, 186 insertions(+), 36 deletions(-) diff --git a/core/dp/txrx/ol_txrx.c b/core/dp/txrx/ol_txrx.c index a80f6ac84aa8..8f1a565cba35 100644 --- a/core/dp/txrx/ol_txrx.c +++ b/core/dp/txrx/ol_txrx.c @@ -1224,12 +1224,6 @@ ol_txrx_pdev_post_attach(ol_txrx_pdev_handle pdev) c_element->tx_desc.htt_frag_desc = htt_frag_desc; c_element->tx_desc.htt_frag_desc_paddr = frag_paddr; } - QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_LOW, - "%s:%d - %d FRAG VA 0x%p FRAG PA 0x%llx", - __func__, __LINE__, i, - c_element->tx_desc.htt_frag_desc, - (long long unsigned int) - c_element->tx_desc.htt_frag_desc_paddr); #ifdef QCA_SUPPORT_TXDESC_SANITY_CHECKS c_element->tx_desc.pkt_type = 0xff; #ifdef QCA_COMPUTE_TX_DELAY @@ -2790,15 +2784,15 @@ void ol_txrx_peer_unref_delete(ol_txrx_peer_handle peer) * concurrently with the empty check. */ qdf_spin_lock_bh(&pdev->peer_ref_mutex); + if (qdf_atomic_dec_and_test(&peer->ref_cnt)) { u_int16_t peer_id; TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, - "Deleting peer %p (%02x:%02x:%02x:%02x:%02x:%02x)", + "Deleting peer %p (%pM) ref_cnt %d\n", peer, - peer->mac_addr.raw[0], peer->mac_addr.raw[1], - peer->mac_addr.raw[2], peer->mac_addr.raw[3], - peer->mac_addr.raw[4], peer->mac_addr.raw[5]); + peer->mac_addr.raw, + qdf_atomic_read(&peer->ref_cnt)); peer_id = peer->local_id; /* remove the reference to the peer from the hash table */ @@ -2949,14 +2943,15 @@ QDF_STATUS ol_txrx_clear_peer(uint8_t sta_id) } /** - * ol_txrx_peer_detach - Delete a peer's data object. - * @data_peer - the object to delete + * ol_txrx_peer_detach() - Delete a peer's data object. + * @peer - the object to detach * * When the host's control SW disassociates a peer, it calls - * this function to delete the peer's data object. The reference + * this function to detach and delete the peer. The reference * stored in the control peer object to the data peer * object (set up by a call to ol_peer_store()) is provided. * + * Return: None */ void ol_txrx_peer_detach(ol_txrx_peer_handle peer) { @@ -2992,9 +2987,12 @@ void ol_txrx_peer_detach(ol_txrx_peer_handle peer) qdf_spinlock_destroy(&peer->peer_info_lock); qdf_spinlock_destroy(&peer->bufq_lock); - /* set delete_in_progress to identify that wma - * is waiting for unmap massage for this peer */ + /* + * set delete_in_progress to identify that wma + * is waiting for unmap massage for this peer + */ qdf_atomic_set(&peer->delete_in_progress, 1); + /* * Remove the reference added during peer_attach. * The peer will still be left allocated until the @@ -3004,6 +3002,40 @@ void ol_txrx_peer_detach(ol_txrx_peer_handle peer) ol_txrx_peer_unref_delete(peer); } +/** + * ol_txrx_peer_detach_force_delete() - Detach and delete a peer's data object + * @peer - the object to detach + * + * Detach a peer and force the peer object to be removed. It is called during + * roaming scenario when the firmware has already deleted a peer. + * Peer object is freed immediately to avoid duplicate peers during roam sync + * indication processing. + * + * Return: None + */ +void ol_txrx_peer_detach_force_delete(ol_txrx_peer_handle peer) +{ + ol_txrx_pdev_handle pdev = peer->vdev->pdev; + + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s peer %p, peer->ref_cnt %d", + __func__, peer, qdf_atomic_read(&peer->ref_cnt)); + + /* Clear the peer_id_to_obj map entries */ + qdf_spin_lock_bh(&pdev->peer_map_unmap_lock); + ol_txrx_peer_remove_obj_map_entries(pdev, peer); + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); + + /* + * Set ref_cnt = 1 so that ol_txrx_peer_unref_delete() called by + * ol_txrx_peer_detach() will actually delete this peer entry properly. + */ + qdf_spin_lock_bh(&pdev->peer_ref_mutex); + qdf_atomic_set(&peer->ref_cnt, 1); + qdf_spin_unlock_bh(&pdev->peer_ref_mutex); + + ol_txrx_peer_detach(peer); +} + ol_txrx_peer_handle ol_txrx_peer_find_by_addr(struct ol_txrx_pdev_t *pdev, uint8_t *peer_mac_addr) { diff --git a/core/dp/txrx/ol_txrx.h b/core/dp/txrx/ol_txrx.h index e4d463db0e9c..daa4f0fde410 100644 --- a/core/dp/txrx/ol_txrx.h +++ b/core/dp/txrx/ol_txrx.h @@ -134,4 +134,5 @@ void htt_pkt_log_init(struct ol_txrx_pdev_t *handle, void *scn); QDF_STATUS ol_txrx_set_wisa_mode(ol_txrx_vdev_handle vdev, bool enable); void ol_txrx_update_mac_id(uint8_t vdev_id, uint8_t mac_id); +void ol_txrx_peer_detach_force_delete(ol_txrx_peer_handle peer); #endif /* _OL_TXRX__H_ */ diff --git a/core/dp/txrx/ol_txrx_peer_find.c b/core/dp/txrx/ol_txrx_peer_find.c index 37acb70c3aa8..f43670155242 100644 --- a/core/dp/txrx/ol_txrx_peer_find.c +++ b/core/dp/txrx/ol_txrx_peer_find.c @@ -327,14 +327,27 @@ static void ol_txrx_peer_find_map_detach(struct ol_txrx_pdev_t *pdev) qdf_mem_free(pdev->peer_id_to_obj_map); } -static inline void -ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, - uint8_t *peer_mac_addr, uint16_t peer_id) +/* + * ol_txrx_peer_find_add_id() - Add peer_id entry to peer + * + * @pdev: Handle to pdev object + * @peer_mac_addr: MAC address of peer provided by firmware + * @peer_id: peer_id provided by firmware + * + * Search for peer object for the MAC address, add the peer_id to + * its array of peer_id's and update the peer_id_to_obj map entry + * for that peer_id. Increment corresponding reference counts. + * + * Return: None + */ +static inline void ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, + uint8_t *peer_mac_addr, uint16_t peer_id) { struct ol_txrx_peer_t *peer; int status; int del_peer_ref = 0; int i; + bool found = false; /* check if there's already a peer object with this MAC address */ peer = @@ -366,10 +379,18 @@ ol_txrx_peer_find_add_id(struct ol_txrx_pdev_t *pdev, qdf_atomic_inc (&pdev->peer_id_to_obj_map[peer_id].peer_id_ref_cnt); - if (peer->peer_ids[0] == HTT_INVALID_PEER) + /* Check if entire peer_id array is empty */ + for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { + if (peer->peer_ids[i] != HTT_INVALID_PEER) { + found = true; + break; + } + } + if (!found) del_peer_ref = 1; - status = 1; + + /* find a place in peer_id array and insert peer_id */ for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { if (peer->peer_ids[i] == HTT_INVALID_PEER) { peer->peer_ids[i] = peer_id; @@ -506,7 +527,20 @@ void ol_txrx_peer_tx_ready_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) #endif - +/* + * ol_rx_peer_unmap_handler() - Handle peer unmap event from firmware + * + * @pdev: Handle to pdev pbject + * @peer_id: peer_id unmapped by firmware + * + * Decrement reference count for the peer_id in peer_id_to_obj_map, + * decrement reference count in corresponding peer object and clear the entry + * in peer's peer_ids array. + * In case of unmap events for a peer that is already deleted, just decrement + * del_peer_id_ref_cnt. + * + * Return: None + */ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) { struct ol_txrx_peer_t *peer; @@ -518,24 +552,39 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) return; } - qdf_spin_lock(&pdev->peer_map_unmap_lock); + qdf_spin_lock_bh(&pdev->peer_map_unmap_lock); + if (qdf_atomic_read( + &pdev->peer_id_to_obj_map[peer_id].del_peer_id_ref_cnt)) { + /* This peer_id belongs to a peer already deleted */ + qdf_atomic_dec(&pdev->peer_id_to_obj_map[peer_id]. + del_peer_id_ref_cnt); + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: Remove the ID %d reference to deleted peer. del_peer_id_ref_cnt %d", + __func__, peer_id, + qdf_atomic_read(&pdev->peer_id_to_obj_map[peer_id]. + del_peer_id_ref_cnt)); + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); + return; + } peer = pdev->peer_id_to_obj_map[peer_id].peer; if (peer == NULL) { - /* - * Currently peer IDs are assigned for vdevs as well as peers. - * If the peer ID is for a vdev, then the peer pointer stored - * in peer_id_to_obj_map will be NULL. - */ - qdf_spin_unlock(&pdev->peer_map_unmap_lock); + /* + * Currently peer IDs are assigned for vdevs as well as peers. + * If the peer ID is for a vdev, then the peer pointer stored + * in peer_id_to_obj_map will be NULL. + */ + TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, + "%s: peer not found for peer_id %d", + __func__, peer_id); + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); return; } if (qdf_atomic_dec_and_test (&pdev->peer_id_to_obj_map[peer_id].peer_id_ref_cnt)) { pdev->peer_id_to_obj_map[peer_id].peer = NULL; - for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { if (peer->peer_ids[i] == peer_id) { peer->peer_ids[i] = HTT_INVALID_PEER; @@ -543,9 +592,6 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) } } } - - qdf_spin_unlock(&pdev->peer_map_unmap_lock); - TXRX_PRINT(TXRX_PRINT_LEVEL_ERR, "%s: Remove the ID %d reference to peer %p peer_id_ref_cnt %d", __func__, peer_id, peer, @@ -557,6 +603,59 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id) * If there are no more references, delete the peer object. */ ol_txrx_peer_unref_delete(peer); + + qdf_spin_unlock_bh(&pdev->peer_map_unmap_lock); +} + +/** + * ol_txrx_peer_remove_obj_map_entries() - Remove matching pdev peer map entries + * @pdev: pdev handle + * @peer: peer to be removed + * + * Return: None + */ +void ol_txrx_peer_remove_obj_map_entries(ol_txrx_pdev_handle pdev, + struct ol_txrx_peer_t *peer) +{ + int i; + uint16_t peer_id; + int32_t peer_id_ref_cnt; + + for (i = 0; i < MAX_NUM_PEER_ID_PER_PEER; i++) { + peer_id = peer->peer_ids[i]; + if (peer_id == HTT_INVALID_PEER || + pdev->peer_id_to_obj_map[peer_id].peer == NULL) { + /* unused peer_id, or object is already dereferenced */ + continue; + } + if (pdev->peer_id_to_obj_map[peer_id].peer != peer) { + QDF_TRACE(QDF_MODULE_ID_TXRX, + QDF_TRACE_LEVEL_ERROR, + FL("peer pointer mismatch in peer_id_to_obj")); + continue; + } + peer_id_ref_cnt = qdf_atomic_read( + &pdev->peer_id_to_obj_map[peer_id]. + peer_id_ref_cnt); + QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_LOW, + FL("peer_id = %d, peer_id_ref_cnt = %d, index = %d"), + peer_id, peer_id_ref_cnt, i); + /* + * Transfer peer_id_ref_cnt into del_peer_id_ref_cnt so that + * ol_txrx_peer_unref_delete will decrement del_peer_id_ref_cnt + * and any map events will increment peer_id_ref_cnt. Otherwise + * accounting will be messed up. + * + * Add operation will ensure that back to back roaming in the + * middle of unmap/map event sequence will be accounted for. + */ + qdf_atomic_add(peer_id_ref_cnt, + &pdev->peer_id_to_obj_map[peer_id].del_peer_id_ref_cnt); + qdf_atomic_init(&pdev->peer_id_to_obj_map[peer_id]. + peer_id_ref_cnt); + pdev->peer_id_to_obj_map[peer_id].peer = NULL; + peer->peer_ids[i] = HTT_INVALID_PEER; + } } struct ol_txrx_peer_t *ol_txrx_assoc_peer_find(struct ol_txrx_vdev_t *vdev) @@ -623,4 +722,5 @@ void ol_txrx_peer_find_display(ol_txrx_pdev_handle pdev, int indent) } } } + #endif /* if TXRX_DEBUG_LEVEL */ diff --git a/core/dp/txrx/ol_txrx_peer_find.h b/core/dp/txrx/ol_txrx_peer_find.h index 43c2f141aac1..389c1764a3f5 100644 --- a/core/dp/txrx/ol_txrx_peer_find.h +++ b/core/dp/txrx/ol_txrx_peer_find.h @@ -107,6 +107,9 @@ void ol_txrx_peer_find_hash_erase(struct ol_txrx_pdev_t *pdev); struct ol_txrx_peer_t *ol_txrx_assoc_peer_find(struct ol_txrx_vdev_t *vdev); +void ol_txrx_peer_remove_obj_map_entries(ol_txrx_pdev_handle pdev, + struct ol_txrx_peer_t *peer); + #if defined(TXRX_DEBUG_LEVEL) && TXRX_DEBUG_LEVEL > 5 void ol_txrx_peer_find_display(ol_txrx_pdev_handle pdev, int indent); #else diff --git a/core/dp/txrx/ol_txrx_types.h b/core/dp/txrx/ol_txrx_types.h index 26ecfbafe83b..ee1bfb309a37 100644 --- a/core/dp/txrx/ol_txrx_types.h +++ b/core/dp/txrx/ol_txrx_types.h @@ -58,7 +58,7 @@ * multicast key the peer uses, and another ID to represent the * unicast key the peer uses. */ -#define MAX_NUM_PEER_ID_PER_PEER 8 +#define MAX_NUM_PEER_ID_PER_PEER 16 #define OL_TXRX_INVALID_NUM_PEERS (-1) @@ -484,9 +484,19 @@ struct ol_tx_flow_pool_t { #endif +/* + * struct ol_txrx_peer_id_map - Map of firmware peer_ids to peers on host + * @peer: Pointer to peer object + * @peer_id_ref_cnt: No. of firmware references to the peer_id + * @del_peer_id_ref_cnt: No. of outstanding unmap events for peer_id + * after the peer object is deleted on the host. + * + * peer_id is used as an index into the array of ol_txrx_peer_id_map. + */ struct ol_txrx_peer_id_map { struct ol_txrx_peer_t *peer; qdf_atomic_t peer_id_ref_cnt; + qdf_atomic_t del_peer_id_ref_cnt; }; /* diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c index 6a7d2084b79c..49a7a0993cfa 100644 --- a/core/wma/src/wma_dev_if.c +++ b/core/wma/src/wma_dev_if.c @@ -1079,9 +1079,13 @@ void wma_remove_peer(tp_wma_handle wma, uint8_t *bssid, wma->interfaces[vdev_id].peer_count); return; } - if (peer) - ol_txrx_peer_detach(peer); + if (peer) { + if (roam_synch_in_progress) + ol_txrx_peer_detach_force_delete(peer); + else + ol_txrx_peer_detach(peer); + } peer_mac_addr = ol_txrx_peer_get_peer_mac_addr(peer); if (peer_mac_addr == NULL) { WMA_LOGE("%s: peer mac addr is NULL, Can't remove peer with peer_addr %pM vdevid %d peer_count %d", @@ -1146,8 +1150,8 @@ QDF_STATUS wma_create_peer(tp_wma_handle wma, ol_txrx_pdev_handle pdev, WMA_LOGE("%s : Unable to attach peer %pM", __func__, peer_addr); goto err; } - if (roam_synch_in_progress) { + if (roam_synch_in_progress) { WMA_LOGE("%s: LFR3: Created peer %p with peer_addr %pM vdev_id %d," "peer_count - %d", __func__, peer, peer_addr, vdev_id, From e8ddb702e8d41ea27c0ba94f8d7ee67214198663 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Fri, 7 Oct 2016 21:18:47 -0700 Subject: [PATCH 050/113] Release 5.1.0.30 Release 5.1.0.30 Change-Id: I04084060c44f6f732c49533ed074a805606f160e CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 058abe50fc47..4d4eff823d8b 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "Z" -#define QWLAN_VERSION_BUILD 29 +#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.29Z" +#define QWLAN_VERSIONSTR "5.1.0.30" #endif /* QWLAN_VERSION_H */ From 538581282bad92c9421608d29e0c3a9bb1ab6ad6 Mon Sep 17 00:00:00 2001 From: "Poddar, Siddarth" Date: Tue, 6 Sep 2016 19:00:09 +0530 Subject: [PATCH 051/113] qcacld-3.0: Remove the processing for depreciated pktlog msg Remove the processing of following msg types PKTLOG_TYPE_TX_MSDU_ID, PKTLOG_TYPE_TX_FRM_HDR and PKTLOG_TYPE_TX_VIR_ADDR for ihelium as support for these events is removed from FW. Change-Id: Ic526507d8adf87e580bd5c23ad2e68e2154c38a8 CRs-Fixed: 1074043 --- core/utils/pktlog/pktlog_internal.c | 94 ++++++++++++++++++++++------- 1 file changed, 73 insertions(+), 21 deletions(-) diff --git a/core/utils/pktlog/pktlog_internal.c b/core/utils/pktlog/pktlog_internal.c index 4de2086be650..27549c7cfb05 100644 --- a/core/utils/pktlog/pktlog_internal.c +++ b/core/utils/pktlog/pktlog_internal.c @@ -220,6 +220,7 @@ char *pktlog_getbuf(struct ol_pktlog_dev_t *pl_dev, static struct txctl_frm_hdr frm_hdr; +#ifndef HELIUMPLUS static void process_ieee_hdr(void *data) { uint8_t dir; @@ -367,7 +368,9 @@ fill_ieee80211_hdr_data(struct ol_txrx_pdev_t *txrx_pdev, } } +#endif +#ifdef HELIUMPLUS A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) { /* @@ -398,25 +401,86 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) pl_hdr.missed_cnt = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_MISSED_CNT_OFFSET) & ATH_PKTLOG_HDR_MISSED_CNT_MASK) >> ATH_PKTLOG_HDR_MISSED_CNT_SHIFT; -#ifdef HELIUMPLUS pl_hdr.log_type = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_LOG_TYPE_OFFSET) & ATH_PKTLOG_HDR_LOG_TYPE_MASK) >> ATH_PKTLOG_HDR_LOG_TYPE_SHIFT; pl_hdr.macId = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_MAC_ID_OFFSET) & ATH_PKTLOG_HDR_MAC_ID_MASK) >> ATH_PKTLOG_HDR_MAC_ID_SHIFT; -#else - pl_hdr.log_type = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_LOG_TYPE_OFFSET) & - ATH_PKTLOG_HDR_LOG_TYPE_MASK) >> - ATH_PKTLOG_HDR_LOG_TYPE_SHIFT; -#endif pl_hdr.size = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_SIZE_OFFSET) & ATH_PKTLOG_HDR_SIZE_MASK) >> ATH_PKTLOG_HDR_SIZE_SHIFT; pl_hdr.timestamp = *(pl_tgt_hdr + ATH_PKTLOG_HDR_TIMESTAMP_OFFSET); -#ifdef HELIUMPLUS pl_hdr.type_specific_data = *(pl_tgt_hdr + ATH_PKTLOG_HDR_TYPE_SPECIFIC_DATA_OFFSET); -#endif + pl_info = pl_dev->pl_info; + + if (pl_hdr.log_type == PKTLOG_TYPE_TX_CTRL) { + size_t log_size = sizeof(frm_hdr) + pl_hdr.size; + void *txdesc_hdr_ctl = (void *) + pktlog_getbuf(pl_dev, pl_info, log_size, &pl_hdr); + qdf_assert(txdesc_hdr_ctl); + qdf_assert(pl_hdr.size < (370 * sizeof(u_int32_t))); + + qdf_mem_copy(txdesc_hdr_ctl, &frm_hdr, sizeof(frm_hdr)); + qdf_mem_copy((char *)txdesc_hdr_ctl + sizeof(frm_hdr), + ((void *)data + + sizeof(struct ath_pktlog_hdr)), + pl_hdr.size); + } + + if (pl_hdr.log_type == PKTLOG_TYPE_TX_STAT) { + struct ath_pktlog_tx_status txstat_log; + size_t log_size = pl_hdr.size; + + txstat_log.ds_status = (void *) + pktlog_getbuf(pl_dev, pl_info, + log_size, &pl_hdr); + qdf_assert(txstat_log.ds_status); + qdf_mem_copy(txstat_log.ds_status, + ((void *)data + sizeof(struct ath_pktlog_hdr)), + pl_hdr.size); + } + return A_OK; +} + +#else +A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) +{ + /* + * Must include to process different types + * TX_CTL, TX_STATUS, TX_MSDU_ID, TX_FRM_HDR + */ + struct ol_pktlog_dev_t *pl_dev; + struct ath_pktlog_hdr pl_hdr; + struct ath_pktlog_info *pl_info; + uint32_t *pl_tgt_hdr; + + if (!txrx_pdev) { + qdf_print("Invalid pdev in %s\n", __func__); + return A_ERROR; + } + qdf_assert(txrx_pdev->pl_dev); + qdf_assert(data); + pl_dev = txrx_pdev->pl_dev; + + pl_tgt_hdr = (uint32_t *) data; + /* + * Makes the short words (16 bits) portable b/w little endian + * and big endian + */ + pl_hdr.flags = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_FLAGS_OFFSET) & + ATH_PKTLOG_HDR_FLAGS_MASK) >> + ATH_PKTLOG_HDR_FLAGS_SHIFT; + pl_hdr.missed_cnt = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_MISSED_CNT_OFFSET) & + ATH_PKTLOG_HDR_MISSED_CNT_MASK) >> + ATH_PKTLOG_HDR_MISSED_CNT_SHIFT; + pl_hdr.log_type = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_LOG_TYPE_OFFSET) & + ATH_PKTLOG_HDR_LOG_TYPE_MASK) >> + ATH_PKTLOG_HDR_LOG_TYPE_SHIFT; + pl_hdr.size = (*(pl_tgt_hdr + ATH_PKTLOG_HDR_SIZE_OFFSET) & + ATH_PKTLOG_HDR_SIZE_MASK) >> ATH_PKTLOG_HDR_SIZE_SHIFT; + pl_hdr.timestamp = *(pl_tgt_hdr + ATH_PKTLOG_HDR_TIMESTAMP_OFFSET); + pl_info = pl_dev->pl_info; if (pl_hdr.log_type == PKTLOG_TYPE_TX_FRM_HDR) { @@ -454,7 +518,6 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) } if (pl_hdr.log_type == PKTLOG_TYPE_TX_CTRL) { -#if !defined(HELIUMPLUS) struct ath_pktlog_txctl txctl_log; size_t log_size = sizeof(txctl_log.priv); @@ -482,18 +545,6 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) qdf_mem_copy(txctl_log.txdesc_hdr_ctl, &txctl_log.priv, sizeof(txctl_log.priv)); /* Add Protocol information and HT specific information */ -#else - size_t log_size = sizeof(frm_hdr) + pl_hdr.size; - void *txdesc_hdr_ctl = (void *) - pktlog_getbuf(pl_dev, pl_info, log_size, &pl_hdr); - qdf_assert(txdesc_hdr_ctl); - qdf_assert(pl_hdr.size < (370 * sizeof(u_int32_t))); - - qdf_mem_copy(txdesc_hdr_ctl, &frm_hdr, sizeof(frm_hdr)); - qdf_mem_copy((char *)txdesc_hdr_ctl + sizeof(frm_hdr), - ((void *)data + sizeof(struct ath_pktlog_hdr)), - pl_hdr.size); -#endif /* !defined(HELIUMPLUS) */ } if (pl_hdr.log_type == PKTLOG_TYPE_TX_STAT) { @@ -528,6 +579,7 @@ A_STATUS process_tx_info(struct ol_txrx_pdev_t *txrx_pdev, void *data) } return A_OK; } +#endif A_STATUS process_rx_info_remote(void *pdev, void *data) { From 744e152a9a1586d3c4d5ee5144615e8c07954618 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 02:37:42 -0700 Subject: [PATCH 052/113] Release 5.1.0.30A Release 5.1.0.30A Change-Id: Ib38370edae55460eeedd78ec3cbbc6c69c687061 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4d4eff823d8b..cdb2455bdf06 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "" +#define QWLAN_VERSION_EXTRA "A" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30" +#define QWLAN_VERSIONSTR "5.1.0.30A" #endif /* QWLAN_VERSION_H */ From 5b7bae07fc7eb099750bd6791a7f33ff6028a0d3 Mon Sep 17 00:00:00 2001 From: Nitesh Shah Date: Wed, 28 Sep 2016 18:58:33 +0530 Subject: [PATCH 053/113] qcacld-3.0: Add SBS support in hw_mode_list The enhancement is to add SBS (Single Band Simultaneous) support in hw_mode_list. The WMI HW Mode definitions are redefined to use only for host purpose. Change-Id: I8b8c966b0130964c8e7de7967766629c955209d3 CRs-Fixed: 1072234 --- core/cds/inc/cds_concurrency.h | 13 ++++- core/cds/src/cds_concurrency.c | 24 ++++++---- core/hdd/src/wlan_hdd_wext.c | 2 + core/mac/inc/sir_api.h | 1 + core/wma/inc/wma.h | 88 ++++++++++++++++++++++++++++++++++ core/wma/inc/wma_api.h | 3 +- core/wma/src/wma_main.c | 57 +++++++++++++--------- core/wma/src/wma_utils.c | 76 ++++++++++++++++------------- core/wma/src/wma_utils_ut.c | 2 +- 9 files changed, 200 insertions(+), 66 deletions(-) diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h index 429d64e0d35b..951abffa6b0b 100644 --- a/core/cds/inc/cds_concurrency.h +++ b/core/cds/inc/cds_concurrency.h @@ -90,7 +90,7 @@ enum hw_mode_ss_config { /** * enum hw_mode_dbs_capab - DBS HW mode capability * @HW_MODE_DBS_NONE: Non DBS capable - * @HW_MODE_DBS: DFS capable + * @HW_MODE_DBS: DBS capable */ enum hw_mode_dbs_capab { HW_MODE_DBS_NONE, @@ -107,6 +107,16 @@ enum hw_mode_agile_dfs_capab { HW_MODE_AGILE_DFS, }; +/** + * enum hw_mode_sbs_capab - SBS HW mode capability + * @HW_MODE_SBS_NONE: Non SBS capable + * @HW_MODE_SBS: SBS capable + */ +enum hw_mode_sbs_capab { + HW_MODE_SBS_NONE, + HW_MODE_SBS, +}; + /** * enum cds_pcl_group_id - Identifies the pcl groups to be used * @CDS_PCL_GROUP_ID1_ID2: Use weights of group1 and group2 @@ -780,6 +790,7 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs, enum sir_conn_update_reason reason); enum cds_conc_next_action cds_need_opportunistic_upgrade(void); QDF_STATUS cds_next_actions(uint32_t session_id, diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index 7504b2315d25..b7f3ab35172f 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -2485,8 +2485,8 @@ static void cds_pdev_set_hw_mode_cb(uint32_t status, hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); cds_info("MAC1: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); - cds_info("DBS:%d, Agile DFS:%d", - hw_mode.dbs_cap, hw_mode.agile_dfs_cap); + cds_info("DBS:%d, Agile DFS:%d, SBS:%d", + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); /* update conc_connection_list */ cds_update_hw_mode_conn_info(num_vdev_mac_entries, @@ -2544,8 +2544,8 @@ void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, hw_mode.mac0_tx_ss, hw_mode.mac0_rx_ss, hw_mode.mac0_bw); cds_info("MAC1: TxSS:%d, RxSS:%d, Bw:%d", hw_mode.mac1_tx_ss, hw_mode.mac1_rx_ss, hw_mode.mac1_bw); - cds_info("DBS:%d, Agile DFS:%d", - hw_mode.dbs_cap, hw_mode.agile_dfs_cap); + cds_info("DBS:%d, Agile DFS:%d, SBS:%d", + hw_mode.dbs_cap, hw_mode.agile_dfs_cap, hw_mode.sbs_cap); /* update conc_connection_list */ cds_update_hw_mode_conn_info(num_vdev_mac_entries, @@ -2564,6 +2564,7 @@ void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, * @mac1_bw: MAC1 bandwidth configuration * @dbs: HW DBS capability * @dfs: HW Agile DFS capability + * @sbs: HW SBS capability * @reason: Reason for connection update * * Sends the set hw mode to the SME module which will pass on @@ -2572,15 +2573,18 @@ void cds_hw_mode_transition_cb(uint32_t old_hw_mode_index, * e.g.: To configure 2x2_80 * mac0_ss = HW_MODE_SS_2x2, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_0x0, mac1_bw = HW_MODE_BW_NONE - * dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE + * dbs = HW_MODE_DBS_NONE, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE * e.g.: To configure 1x1_80_1x1_40 (DBS) * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ - * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS_NONE, + * sbs = HW_MODE_SBS_NONE * e.g.: To configure 1x1_80_1x1_40 (Agile DFS) * mac0_ss = HW_MODE_SS_1x1, mac0_bw = HW_MODE_80_MHZ * mac1_ss = HW_MODE_SS_1x1, mac1_bw = HW_MODE_40_MHZ - * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS + * dbs = HW_MODE_DBS, dfs = HW_MODE_AGILE_DFS, + * sbs = HW_MODE_SBS_NONE * * Return: Success if the message made it down to the next layer */ @@ -2591,6 +2595,7 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs, enum sir_conn_update_reason reason) { int8_t hw_mode_index; @@ -2618,7 +2623,7 @@ QDF_STATUS cds_pdev_set_hw_mode(uint32_t session_id, } hw_mode_index = wma_get_hw_mode_idx_from_dbs_hw_list(mac0_ss, - mac0_bw, mac1_ss, mac1_bw, dbs, dfs); + mac0_bw, mac1_ss, mac1_bw, dbs, dfs, sbs); if (hw_mode_index < 0) { cds_err("Invalid HW mode index obtained"); return QDF_STATUS_E_FAILURE; @@ -6306,6 +6311,7 @@ QDF_STATUS cds_next_actions(uint32_t session_id, HW_MODE_SS_1x1, HW_MODE_40_MHZ, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, reason); break; case CDS_SINGLE_MAC_UPGRADE: @@ -6318,6 +6324,7 @@ QDF_STATUS cds_next_actions(uint32_t session_id, HW_MODE_SS_0x0, HW_MODE_BW_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, reason); /* * check if we have a beaconing entity that advertised 2x2 @@ -6334,6 +6341,7 @@ QDF_STATUS cds_next_actions(uint32_t session_id, HW_MODE_SS_0x0, HW_MODE_BW_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, reason); break; default: diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 397bdcd2d019..fdb4e5dfdd7e 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -8067,6 +8067,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, HW_MODE_SS_0x0, HW_MODE_BW_NONE, HW_MODE_DBS_NONE, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, SIR_UPDATE_REASON_UT); } else if (apps_args[0] == 1) { hdd_err("set hw mode for dual mac"); @@ -8077,6 +8078,7 @@ static int __iw_set_var_ints_getnone(struct net_device *dev, HW_MODE_SS_1x1, HW_MODE_40_MHZ, HW_MODE_DBS, HW_MODE_AGILE_DFS_NONE, + HW_MODE_SBS_NONE, SIR_UPDATE_REASON_UT); } } diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 58d0cd20635c..9610a2274c47 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3333,6 +3333,7 @@ struct sir_hw_mode_params { uint8_t mac1_bw; uint8_t dbs_cap; uint8_t agile_dfs_cap; + uint8_t sbs_cap; }; /** diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h index d2f86a0838ac..91857844c36c 100644 --- a/core/wma/inc/wma.h +++ b/core/wma/inc/wma.h @@ -389,6 +389,94 @@ enum ds_mode { #define WMA_DEFAULT_HW_MODE_INDEX 0xFFFF +/** + * WMA hardware mode list bit-mask definitions. + * Bits 4:0, 31:29 are unused. + * + * The below definitions are added corresponding to WMI DBS HW mode + * list to make it independent of firmware changes for WMI definitions. + * Currently these definitions have dependency with BIT positions of + * the existing WMI macros. Thus, if the BIT positions are changed for + * WMI macros, then these macros' BIT definitions are also need to be + * changed. + */ +#define WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS (28) +#define WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS (24) +#define WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS (20) +#define WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS (16) +#define WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS (12) +#define WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS (8) +#define WMA_HW_MODE_DBS_MODE_BITPOS (7) +#define WMA_HW_MODE_AGILE_DFS_MODE_BITPOS (6) +#define WMA_HW_MODE_SBS_MODE_BITPOS (5) + +#define WMA_HW_MODE_MAC0_TX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_RX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_TX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_RX_STREAMS_MASK \ + (0xf << WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_BANDWIDTH_MASK \ + (0xf << WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_MAC1_BANDWIDTH_MASK \ + (0xf << WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_DBS_MODE_MASK \ + (0x1 << WMA_HW_MODE_DBS_MODE_BITPOS) +#define WMA_HW_MODE_AGILE_DFS_MODE_MASK \ + (0x1 << WMA_HW_MODE_AGILE_DFS_MODE_BITPOS) +#define WMA_HW_MODE_SBS_MODE_MASK \ + (0x1 << WMA_HW_MODE_SBS_MODE_BITPOS) + +#define WMA_HW_MODE_MAC0_TX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC0_RX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC1_TX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC1_RX_STREAMS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS, 4, value) +#define WMA_HW_MODE_MAC0_BANDWIDTH_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS, 4, value) +#define WMA_HW_MODE_MAC1_BANDWIDTH_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS, 4, value) +#define WMA_HW_MODE_DBS_MODE_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_DBS_MODE_BITPOS, 1, value) +#define WMA_HW_MODE_AGILE_DFS_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_AGILE_DFS_MODE_BITPOS, 1, value) +#define WMA_HW_MODE_SBS_MODE_SET(hw_mode, value) \ + WMI_SET_BITS(hw_mode, WMA_HW_MODE_SBS_MODE_BITPOS, 1, value) + +#define WMA_HW_MODE_MAC0_TX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC0_TX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC0_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_RX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC0_RX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC0_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_TX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC1_TX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC1_TX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC1_RX_STREAMS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC1_RX_STREAMS_MASK) >> \ + WMA_HW_MODE_MAC1_RX_STREAMS_BITPOS) +#define WMA_HW_MODE_MAC0_BANDWIDTH_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC0_BANDWIDTH_MASK) >> \ + WMA_HW_MODE_MAC0_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_MAC1_BANDWIDTH_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_MAC1_BANDWIDTH_MASK) >> \ + WMA_HW_MODE_MAC1_BANDWIDTH_BITPOS) +#define WMA_HW_MODE_DBS_MODE_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_DBS_MODE_MASK) >> \ + WMA_HW_MODE_DBS_MODE_BITPOS) +#define WMA_HW_MODE_AGILE_DFS_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_AGILE_DFS_MODE_MASK) >> \ + WMA_HW_MODE_AGILE_DFS_MODE_BITPOS) +#define WMA_HW_MODE_SBS_MODE_GET(hw_mode) \ + ((hw_mode & WMA_HW_MODE_SBS_MODE_MASK) >> \ + WMA_HW_MODE_SBS_MODE_BITPOS) + + /** * struct probeTime_dwellTime - probe time, dwell time map * @dwell_time: dwell time diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 295973ba2bc7..890622b424e2 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -187,7 +187,8 @@ int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, - enum hw_mode_agile_dfs_capab dfs); + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs); QDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx, struct sir_hw_mode_params *hw_mode); int8_t wma_get_num_dbs_hw_modes(void); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 3b5f543c30ac..3d65f13c23ca 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4298,16 +4298,17 @@ void wma_dump_dbs_hw_mode(tp_wma_handle wma_handle) param = wma_handle->hw_mode.hw_mode_list[i]; WMA_LOGA("%s:[%d]-MAC0: tx_ss:%d rx_ss:%d bw_idx:%d", __func__, i, - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET(param)); + WMA_HW_MODE_MAC0_TX_STREAMS_GET(param), + WMA_HW_MODE_MAC0_RX_STREAMS_GET(param), + WMA_HW_MODE_MAC0_BANDWIDTH_GET(param)); WMA_LOGA("%s:[%d]-MAC1: tx_ss:%d rx_ss:%d bw_idx:%d", __func__, i, - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param), - WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET(param)); - WMA_LOGA("%s:[%d] DBS:%d", __func__, i, - WMI_DBS_HW_MODE_DBS_MODE_GET(param)); + WMA_HW_MODE_MAC1_TX_STREAMS_GET(param), + WMA_HW_MODE_MAC1_RX_STREAMS_GET(param), + WMA_HW_MODE_MAC1_BANDWIDTH_GET(param)); + WMA_LOGA("%s:[%d] DBS:%d SBS:%d", __func__, i, + WMA_HW_MODE_DBS_MODE_GET(param), + WMA_HW_MODE_SBS_MODE_GET(param)); } } @@ -5018,6 +5019,7 @@ static void wma_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, * @mac1_ss_bw_info: TX-RX streams, BW for MAC1 * @pos: refers to hw_mode_index * @dbs_mode: dbs_mode for the dbs_hw_mode + * @sbs_mode: sbs_mode for the sbs_hw_mode * * This function sets TX-RX stream, bandwidth and DBS mode in * hw_mode_list. @@ -5027,32 +5029,36 @@ static void wma_get_hw_mode_params(WMI_MAC_PHY_CAPABILITIES *caps, static void wma_set_hw_mode_params(t_wma_handle *wma_handle, struct mac_ss_bw_info mac0_ss_bw_info, struct mac_ss_bw_info mac1_ss_bw_info, - uint32_t pos, uint32_t dbs_mode) + uint32_t pos, uint32_t dbs_mode, + uint32_t sbs_mode) { - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_SET( + WMA_HW_MODE_MAC0_TX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac0_ss_bw_info.mac_tx_stream); - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_SET( + WMA_HW_MODE_MAC0_RX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac0_ss_bw_info.mac_rx_stream); - WMI_DBS_HW_MODE_MAC0_BANDWIDTH_SET( + WMA_HW_MODE_MAC0_BANDWIDTH_SET( wma_handle->hw_mode.hw_mode_list[pos], mac0_ss_bw_info.mac_bw); - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_SET( + WMA_HW_MODE_MAC1_TX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac1_ss_bw_info.mac_tx_stream); - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_SET( + WMA_HW_MODE_MAC1_RX_STREAMS_SET( wma_handle->hw_mode.hw_mode_list[pos], mac1_ss_bw_info.mac_rx_stream); - WMI_DBS_HW_MODE_MAC1_BANDWIDTH_SET( + WMA_HW_MODE_MAC1_BANDWIDTH_SET( wma_handle->hw_mode.hw_mode_list[pos], mac1_ss_bw_info.mac_bw); - WMI_DBS_HW_MODE_DBS_MODE_SET( + WMA_HW_MODE_DBS_MODE_SET( wma_handle->hw_mode.hw_mode_list[pos], dbs_mode); - WMI_DBS_HW_MODE_AGILE_DFS_SET( + WMA_HW_MODE_AGILE_DFS_SET( wma_handle->hw_mode.hw_mode_list[pos], - 0); + HW_MODE_AGILE_DFS_NONE); + WMA_HW_MODE_SBS_MODE_SET( + wma_handle->hw_mode.hw_mode_list[pos], + sbs_mode); } /** @@ -5068,7 +5074,8 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) { struct extended_caps *phy_caps; WMI_MAC_PHY_CAPABILITIES *tmp; - uint32_t i, dbs_mode, hw_config_type, j = 0; + uint32_t i, hw_config_type, j = 0; + uint32_t dbs_mode, sbs_mode; struct mac_ss_bw_info mac0_ss_bw_info = {0}; struct mac_ss_bw_info mac1_ss_bw_info = {0}; @@ -5117,7 +5124,8 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) wma_get_hw_mode_params(tmp, &mac0_ss_bw_info); hw_config_type = phy_caps->each_hw_mode_cap[i].hw_mode_config_type; - dbs_mode = 0; + dbs_mode = HW_MODE_DBS_NONE; + sbs_mode = HW_MODE_SBS_NONE; mac1_ss_bw_info.mac_tx_stream = 0; mac1_ss_bw_info.mac_rx_stream = 0; mac1_ss_bw_info.mac_bw = 0; @@ -5129,12 +5137,17 @@ static QDF_STATUS wma_update_hw_mode_list(t_wma_handle *wma_handle) /* Update for MAC1 */ tmp = &phy_caps->each_phy_cap_per_hwmode[j++]; wma_get_hw_mode_params(tmp, &mac1_ss_bw_info); - dbs_mode = 1; + if (hw_config_type == WMI_HW_MODE_DBS) + dbs_mode = HW_MODE_DBS; + if ((hw_config_type == WMI_HW_MODE_SBS_PASSIVE) || + (hw_config_type == WMI_HW_MODE_SBS)) + sbs_mode = HW_MODE_SBS; } /* Updating HW mode list */ wma_set_hw_mode_params(wma_handle, mac0_ss_bw_info, - mac1_ss_bw_info, i, dbs_mode); + mac1_ss_bw_info, i, dbs_mode, + sbs_mode); } wma_dump_dbs_hw_mode(wma_handle); return QDF_STATUS_SUCCESS; diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index b4aab11b8e34..fd9254d98a7f 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2534,6 +2534,7 @@ void wma_get_tx_rx_ss_from_config(enum hw_mode_ss_config mac_ss, * @mac1_bw: Bandwidth of MAC1 of type 'hw_mode_bandwidth' * @dbs: DBS capability of type 'hw_mode_dbs_capab' * @dfs: Agile DFS capability of type 'hw_mode_agile_dfs_capab' + * @sbs: SBS capability of type 'hw_mode_sbs_capab' * * Fetches the HW mode index corresponding to the HW mode provided * @@ -2546,12 +2547,13 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, uint32_t mac1_tx_ss, uint32_t mac1_rx_ss, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, - enum hw_mode_agile_dfs_capab dfs) + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs) { uint32_t i; uint32_t t_mac0_tx_ss, t_mac0_rx_ss, t_mac0_bw; uint32_t t_mac1_tx_ss, t_mac1_rx_ss, t_mac1_bw; - uint32_t dbs_mode, agile_dfs_mode; + uint32_t dbs_mode, agile_dfs_mode, sbs_mode; int8_t found = -EINVAL; if (!wma) { @@ -2560,17 +2562,17 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, } for (i = 0; i < wma->num_dbs_hw_modes; i++) { - t_mac0_tx_ss = WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET( + t_mac0_tx_ss = WMA_HW_MODE_MAC0_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac0_tx_ss != mac0_tx_ss) continue; - t_mac0_rx_ss = WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET( + t_mac0_rx_ss = WMA_HW_MODE_MAC0_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac0_rx_ss != mac0_rx_ss) continue; - t_mac0_bw = WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET( + t_mac0_bw = WMA_HW_MODE_MAC0_BANDWIDTH_GET( wma->hw_mode.hw_mode_list[i]); /* * Firmware advertises max bw capability as CBW 80+80 @@ -2580,31 +2582,36 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, if (t_mac0_bw < mac0_bw) continue; - t_mac1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET( + t_mac1_tx_ss = WMA_HW_MODE_MAC1_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac1_tx_ss != mac1_tx_ss) continue; - t_mac1_rx_ss = WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET( + t_mac1_rx_ss = WMA_HW_MODE_MAC1_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac1_rx_ss != mac1_rx_ss) continue; - t_mac1_bw = WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET( + t_mac1_bw = WMA_HW_MODE_MAC1_BANDWIDTH_GET( wma->hw_mode.hw_mode_list[i]); if (t_mac1_bw < mac1_bw) continue; - dbs_mode = WMI_DBS_HW_MODE_DBS_MODE_GET( + dbs_mode = WMA_HW_MODE_DBS_MODE_GET( wma->hw_mode.hw_mode_list[i]); if (dbs_mode != dbs) continue; - agile_dfs_mode = WMI_DBS_HW_MODE_AGILE_DFS_GET( + agile_dfs_mode = WMA_HW_MODE_AGILE_DFS_GET( wma->hw_mode.hw_mode_list[i]); if (agile_dfs_mode != dfs) continue; + sbs_mode = WMA_HW_MODE_SBS_MODE_GET( + wma->hw_mode.hw_mode_list[i]); + if (sbs_mode != sbs) + continue; + found = i; WMA_LOGI("%s: hw_mode index %d found", __func__, i); @@ -2621,9 +2628,10 @@ static int8_t wma_get_matching_hw_mode_index(tp_wma_handle wma, * @mac1_bw: MAC1 bandwidth configuration * @dbs: HW DBS capability * @dfs: HW Agile DFS capability + * @sbs: HW SBS capability * * Get the HW mode index corresponding to the HW modes spatial stream, - * bandwidth, DBS and Agile DFS capability + * bandwidth, DBS, Agile DFS and SBS capability * * Return: Index number if a match is found or -negative value if not found */ @@ -2632,7 +2640,8 @@ int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, enum hw_mode_ss_config mac1_ss, enum hw_mode_bandwidth mac1_bw, enum hw_mode_dbs_capab dbs, - enum hw_mode_agile_dfs_capab dfs) + enum hw_mode_agile_dfs_capab dfs, + enum hw_mode_sbs_capab sbs) { tp_wma_handle wma; uint32_t mac0_tx_ss, mac0_rx_ss; @@ -2651,14 +2660,14 @@ int8_t wma_get_hw_mode_idx_from_dbs_hw_list(enum hw_mode_ss_config mac0_ss, __func__, mac0_tx_ss, mac0_rx_ss, mac0_bw); WMA_LOGI("%s: MAC1: TxSS=%d, RxSS=%d, BW=%d", __func__, mac1_tx_ss, mac1_rx_ss, mac1_bw); - WMA_LOGI("%s: DBS capab=%d, Agile DFS capab=%d", - __func__, dbs, dfs); + WMA_LOGI("%s: DBS=%d, Agile DFS=%d, SBS=%d", + __func__, dbs, dfs, sbs); return wma_get_matching_hw_mode_index(wma, mac0_tx_ss, mac0_rx_ss, mac0_bw, mac1_tx_ss, mac1_rx_ss, mac1_bw, - dbs, dfs); + dbs, dfs, sbs); } /** @@ -2694,14 +2703,15 @@ QDF_STATUS wma_get_hw_mode_from_idx(uint32_t idx, param = wma->hw_mode.hw_mode_list[idx]; - hw_mode->mac0_tx_ss = WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param); - hw_mode->mac0_rx_ss = WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param); - hw_mode->mac0_bw = WMI_DBS_HW_MODE_MAC0_BANDWIDTH_GET(param); - hw_mode->mac1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param); - hw_mode->mac1_rx_ss = WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param); - hw_mode->mac1_bw = WMI_DBS_HW_MODE_MAC1_BANDWIDTH_GET(param); - hw_mode->dbs_cap = WMI_DBS_HW_MODE_DBS_MODE_GET(param); - hw_mode->agile_dfs_cap = WMI_DBS_HW_MODE_AGILE_DFS_GET(param); + hw_mode->mac0_tx_ss = WMA_HW_MODE_MAC0_TX_STREAMS_GET(param); + hw_mode->mac0_rx_ss = WMA_HW_MODE_MAC0_RX_STREAMS_GET(param); + hw_mode->mac0_bw = WMA_HW_MODE_MAC0_BANDWIDTH_GET(param); + hw_mode->mac1_tx_ss = WMA_HW_MODE_MAC1_TX_STREAMS_GET(param); + hw_mode->mac1_rx_ss = WMA_HW_MODE_MAC1_RX_STREAMS_GET(param); + hw_mode->mac1_bw = WMA_HW_MODE_MAC1_BANDWIDTH_GET(param); + hw_mode->dbs_cap = WMA_HW_MODE_DBS_MODE_GET(param); + hw_mode->agile_dfs_cap = WMA_HW_MODE_AGILE_DFS_GET(param); + hw_mode->sbs_cap = WMA_HW_MODE_SBS_MODE_GET(param); return QDF_STATUS_SUCCESS; } @@ -2763,7 +2773,7 @@ bool wma_is_hw_dbs_capable(void) for (i = 0; i < wma->num_dbs_hw_modes; i++) { param = wma->hw_mode.hw_mode_list[i]; WMA_LOGI("%s: HW param: %x", __func__, param); - if (WMI_DBS_HW_MODE_DBS_MODE_GET(param)) { + if (WMA_HW_MODE_DBS_MODE_GET(param)) { WMA_LOGI("%s: HW (%d) is DBS capable", __func__, i); found = 1; break; @@ -2866,14 +2876,14 @@ void wma_update_intf_hw_mode_params(uint32_t vdev_id, uint32_t mac_id, wma->interfaces[vdev_id].mac_id = mac_id; if (mac_id == 0) { wma->interfaces[vdev_id].tx_streams = - WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET(param); + WMA_HW_MODE_MAC0_TX_STREAMS_GET(param); wma->interfaces[vdev_id].rx_streams = - WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET(param); + WMA_HW_MODE_MAC0_RX_STREAMS_GET(param); } else { wma->interfaces[vdev_id].tx_streams = - WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET(param); + WMA_HW_MODE_MAC1_TX_STREAMS_GET(param); wma->interfaces[vdev_id].rx_streams = - WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET(param); + WMA_HW_MODE_MAC1_RX_STREAMS_GET(param); } } @@ -2929,15 +2939,15 @@ QDF_STATUS wma_get_dbs_hw_modes(bool *one_by_one_dbs, bool *two_by_two_dbs) uint32_t t_conf1_tx_ss, t_conf1_rx_ss; uint32_t dbs_mode; - t_conf0_tx_ss = WMI_DBS_HW_MODE_MAC0_TX_STREAMS_GET( + t_conf0_tx_ss = WMA_HW_MODE_MAC0_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - t_conf0_rx_ss = WMI_DBS_HW_MODE_MAC0_RX_STREAMS_GET( + t_conf0_rx_ss = WMA_HW_MODE_MAC0_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - t_conf1_tx_ss = WMI_DBS_HW_MODE_MAC1_TX_STREAMS_GET( + t_conf1_tx_ss = WMA_HW_MODE_MAC1_TX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - t_conf1_rx_ss = WMI_DBS_HW_MODE_MAC1_RX_STREAMS_GET( + t_conf1_rx_ss = WMA_HW_MODE_MAC1_RX_STREAMS_GET( wma->hw_mode.hw_mode_list[i]); - dbs_mode = WMI_DBS_HW_MODE_DBS_MODE_GET( + dbs_mode = WMA_HW_MODE_DBS_MODE_GET( wma->hw_mode.hw_mode_list[i]); if (((((t_conf0_tx_ss == conf1_tx_ss) && diff --git a/core/wma/src/wma_utils_ut.c b/core/wma/src/wma_utils_ut.c index 45db586d9f9f..8eb5e3d302e8 100644 --- a/core/wma/src/wma_utils_ut.c +++ b/core/wma/src/wma_utils_ut.c @@ -73,7 +73,7 @@ void wma_set_dbs_capability_ut(uint32_t dbs) } for (i = 0; i < wma->num_dbs_hw_modes; i++) { - WMI_DBS_HW_MODE_DBS_MODE_SET(wma->hw_mode.hw_mode_list[i], + WMA_HW_MODE_DBS_MODE_SET(wma->hw_mode.hw_mode_list[i], dbs); } From e1e7cd1c40ce8cde6205d0e64df11d5a97802f72 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 03:55:03 -0700 Subject: [PATCH 054/113] Release 5.1.0.30B Release 5.1.0.30B Change-Id: I524c0c9896eedb0e9907efb739d4e8392440de2e CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index cdb2455bdf06..532b170c49c1 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "A" +#define QWLAN_VERSION_EXTRA "B" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30A" +#define QWLAN_VERSIONSTR "5.1.0.30B" #endif /* QWLAN_VERSION_H */ From f7d62e1cccb99204178cae9baf49219d749acbd2 Mon Sep 17 00:00:00 2001 From: Mukul Sharma Date: Sat, 3 Sep 2016 15:16:22 +0530 Subject: [PATCH 055/113] qcacld-3.0: Add ini to raise bug on SSR re-init failure qcacld-2.0 to qcacld-3.0 propagation Currently, If SSR re-init get failed then host raise VOS_BUG. In this type of cases, OEM might prefer not to crash the device instead want wlan recovery using driver unload followed by load. Change-Id: If433aae949326af6a20df2190dd7356f211c4103 CRs-Fixed: 1017278 --- core/hdd/inc/wlan_hdd_cfg.h | 13 +++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 11 +++++++++++ core/hdd/src/wlan_hdd_power.c | 5 ++++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 7bbc547e51c0..ab19c7ac9331 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -3405,6 +3405,18 @@ enum dot11p_mode { #define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_MAX (4) #define CFG_ADAPTIVE_EXTSCAN_DWELL_MODE_DEFAULT (0) +/* + * This parameter will help to debug ssr reinit failure issues + * by raising vos bug so dumps can be collected. If OEM + * wants to avoid this crash, just disable this parameter. + * wlan driver will only recover after driver unload and load. + * Default: Enable + */ +#define CFG_BUG_ON_REINIT_FAILURE_NAME "g_bug_on_reinit_failure" +#define CFG_BUG_ON_REINIT_FAILURE_MIN (0) +#define CFG_BUG_ON_REINIT_FAILURE_MAX (1) +#define CFG_BUG_ON_REINIT_FAILURE_DEFAULT (1) + /* * This parameter will set the algo used in dwell time optimization during * pno scan. see enum wmi_dwelltime_adaptive_mode. @@ -4178,6 +4190,7 @@ struct hdd_config { uint8_t adapt_dwell_passive_mon_intval; uint8_t adapt_dwell_wifi_act_threshold; bool bug_report_for_no_scan_results; + bool bug_on_reinit_failure; #ifdef WLAN_FEATURE_NAN_DATAPATH bool enable_nan_datapath; uint8_t nan_datapath_ndi_channel; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 27b227ec7751..9e944e6d33eb 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3965,6 +3965,14 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_INDOOR_CHANNEL_SUPPORT_MIN, CFG_INDOOR_CHANNEL_SUPPORT_MAX), + REG_VARIABLE(CFG_BUG_ON_REINIT_FAILURE_NAME, WLAN_PARAM_Integer, + struct hdd_config, bug_on_reinit_failure, + VAR_FLAGS_OPTIONAL | + VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_BUG_ON_REINIT_FAILURE_DEFAULT, + CFG_BUG_ON_REINIT_FAILURE_MIN, + CFG_BUG_ON_REINIT_FAILURE_MAX), + REG_VARIABLE(CFG_INTERFACE_CHANGE_WAIT_NAME, WLAN_PARAM_Integer, struct hdd_config, iface_change_wait_time, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK, @@ -5590,6 +5598,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx) hdd_info("Name = [%s] Value = [%u]", CFG_IDLE_TIME_NAME, pHddCtx->config->idle_time_conc); + hdd_info("Name = [%s] Value = [%d]", + CFG_BUG_ON_REINIT_FAILURE_NAME, + pHddCtx->config->bug_on_reinit_failure); hdd_info("Name = [%s] Value = [%u]", CFG_INTERFACE_CHANGE_WAIT_NAME, pHddCtx->config->iface_change_wait_time); diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 26e5f6641987..159346cc0e44 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1495,6 +1495,7 @@ QDF_STATUS hdd_wlan_re_init(void) hdd_adapter_t *pAdapter; QDF_STATUS qdf_status; int ret; + bool bug_on_reinit_failure = CFG_BUG_ON_REINIT_FAILURE_DEFAULT; hdd_prevent_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); @@ -1511,6 +1512,7 @@ QDF_STATUS hdd_wlan_re_init(void) hdd_alert("HDD context is Null"); goto err_re_init; } + bug_on_reinit_failure = pHddCtx->config->bug_on_reinit_failure; /* The driver should always be initialized in STA mode after SSR */ hdd_set_conparam(0); @@ -1591,7 +1593,8 @@ err_wiphy_unregister: err_re_init: /* Allow the phone to go to sleep */ hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_DRIVER_REINIT); - QDF_BUG(0); + if (bug_on_reinit_failure) + QDF_BUG(0); return -EPERM; success: From 61bb0bcd998a3ade96722b8b8e8a23c7fde591df Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 04:33:23 -0700 Subject: [PATCH 056/113] Release 5.1.0.30C Release 5.1.0.30C Change-Id: I403a76b07b94278931713de0018e437f2dd920d8 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 532b170c49c1..f249bb0d40ee 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "B" +#define QWLAN_VERSION_EXTRA "C" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30B" +#define QWLAN_VERSIONSTR "5.1.0.30C" #endif /* QWLAN_VERSION_H */ From 4afc226c491bb4d1a04bd5cbb52ca7024ad942b5 Mon Sep 17 00:00:00 2001 From: Arif Hussain Date: Thu, 6 Oct 2016 13:35:57 -0700 Subject: [PATCH 057/113] qcacld-3.0: Fix uninitialized variable use in cds_set_5g_channel_params Initialize pointers bonded_chan_ptr and bonded_chan_ptr2 in function with NULL and add check to avoid NULL/wild pointer dereference. Change-Id: I48e4417998d75a7a42d6e55106896709016ac61c CRs-Fixed: 1075098 --- core/cds/src/cds_reg_service.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/core/cds/src/cds_reg_service.c b/core/cds/src/cds_reg_service.c index 32cfc719d767..302c670c0aca 100644 --- a/core/cds/src/cds_reg_service.c +++ b/core/cds/src/cds_reg_service.c @@ -449,8 +449,8 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, { enum channel_state chan_state = CHANNEL_STATE_ENABLE; enum channel_state chan_state2 = CHANNEL_STATE_ENABLE; - const struct bonded_chan *bonded_chan_ptr; - const struct bonded_chan *bonded_chan_ptr2; + const struct bonded_chan *bonded_chan_ptr = NULL; + const struct bonded_chan *bonded_chan_ptr2 = NULL; if (CH_WIDTH_MAX <= ch_params->ch_width) ch_params->ch_width = CH_WIDTH_80P80MHZ; @@ -481,16 +481,19 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, bonded_chan_40mhz_array, QDF_ARRAY_SIZE(bonded_chan_40mhz_array), &bonded_chan_ptr2); - if (oper_ch == bonded_chan_ptr2->start_ch) - ch_params->sec_ch_offset = + if (bonded_chan_ptr && bonded_chan_ptr2) { + if (oper_ch == + bonded_chan_ptr2->start_ch) + ch_params->sec_ch_offset = PHY_DOUBLE_CHANNEL_LOW_PRIMARY; - else - ch_params->sec_ch_offset = + else + ch_params->sec_ch_offset = PHY_DOUBLE_CHANNEL_HIGH_PRIMARY; - ch_params->center_freq_seg0 = - (bonded_chan_ptr->start_ch + - bonded_chan_ptr->end_ch)/2; + ch_params->center_freq_seg0 = + (bonded_chan_ptr->start_ch + + bonded_chan_ptr->end_ch)/2; + } } break; } @@ -501,8 +504,10 @@ static void cds_set_5g_channel_params(uint16_t oper_ch, chan_state = cds_search_5g_bonded_channel(oper_ch, CH_WIDTH_80MHZ, &bonded_chan_ptr); - ch_params->center_freq_seg0 = (bonded_chan_ptr->start_ch + - bonded_chan_ptr->end_ch)/2; + if (bonded_chan_ptr) + ch_params->center_freq_seg0 = + (bonded_chan_ptr->start_ch + + bonded_chan_ptr->end_ch)/2; } QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_INFO, "ch %d ch_wd %d freq0 %d freq1 %d", oper_ch, From 0a83fb550ff44e0f5d345a8c506e7d537eca87ff Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 05:12:12 -0700 Subject: [PATCH 058/113] Release 5.1.0.30D Release 5.1.0.30D Change-Id: I480aa1260718be59210d13be56d5d28a9df18a2c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index f249bb0d40ee..fff69542c2ab 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "C" +#define QWLAN_VERSION_EXTRA "D" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30C" +#define QWLAN_VERSIONSTR "5.1.0.30D" #endif /* QWLAN_VERSION_H */ From d53d1a85c67919ebb07b28ec02131576d81b1644 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 3 Oct 2016 12:57:33 -0700 Subject: [PATCH 059/113] qcacld-3.0: Cleanup code related to unit-test framework A previous unit-test framework change contained some outstanding clean code issues. Address the issues to ensure cleaner code is maintained. Change-Id: I889d4e12a7c00b5fc6cb409bc077466019442456 CRs-Fixed: 1073756 --- core/hdd/inc/wlan_hdd_driver_ops.h | 41 +++++++++++++ core/hdd/inc/wlan_hdd_power.h | 13 ++++ core/hdd/src/wlan_hdd_driver_ops.c | 37 ------------ core/hdd/src/wlan_hdd_power.c | 96 ++++++++++++------------------ core/pld/inc/pld_common.h | 3 - 5 files changed, 91 insertions(+), 99 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_driver_ops.h b/core/hdd/inc/wlan_hdd_driver_ops.h index f919e8decf1c..34c8c118c014 100644 --- a/core/hdd/inc/wlan_hdd_driver_ops.h +++ b/core/hdd/inc/wlan_hdd_driver_ops.h @@ -37,9 +37,50 @@ */ int wlan_hdd_register_driver(void); void wlan_hdd_unregister_driver(void); + +/** + * wlan_hdd_bus_suspend() - suspend the wlan bus + * + * This function is called by the platform driver to suspend the + * wlan bus + * + * @state: state + * + * Return: QDF_STATUS + */ int wlan_hdd_bus_suspend(pm_message_t state); + +/** + * wlan_hdd_bus_suspend_noirq() - handle .suspend_noirq callback + * + * This function is called by the platform driver to complete the + * bus suspend callback when device interrupts are disabled by kernel. + * Call HIF and WMA suspend_noirq callbacks to make sure there is no + * wake up pending from FW before allowing suspend. + * + * Return: 0 for success and -EBUSY if FW is requesting wake up + */ int wlan_hdd_bus_suspend_noirq(void); + +/** + * wlan_hdd_bus_resume(): wake up the bus + * + * This function is called by the platform driver to resume wlan + * bus + * + * Return: void + */ int wlan_hdd_bus_resume(void); + +/** + * wlan_hdd_bus_resume_noirq(): handle bus resume no irq + * + * This function is called by the platform driver to do bus + * resume no IRQ before calling resume callback. Call WMA and HIF + * layers to complete the resume_noirq. + * + * Return: 0 for success and negative error code for failure + */ int wlan_hdd_bus_resume_noirq(void); void hdd_hif_close(void *hif_ctx); int hdd_hif_open(struct device *dev, void *bdev, const hif_bus_id *bid, diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index 61f4d6d490c9..fee466599820 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -208,7 +208,20 @@ void hdd_wlan_suspend_resume_event(uint8_t state) {} * enabling/disabling appropriate copy engine irqs. */ #ifdef WLAN_SUSPEND_RESUME_TEST +/** + * hdd_wlan_fake_apps_resume() - Resume from unit-test triggered suspend + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, calls QDF_BUG() on failure + */ int hdd_wlan_fake_apps_resume(struct wiphy *wiphy); + +/** + * hdd_wlan_fake_apps_suspend() - Initiate a unit-test triggered suspend + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, suspend related non-zero error code on failure + */ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy); #else static inline int hdd_wlan_fake_apps_resume(struct wiphy *wiphy) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index a20fcb7b7836..a5a714834542 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -558,16 +558,6 @@ done: return err; } -/** - * wlan_hdd_bus_suspend() - suspend the wlan bus - * - * This function is called by the platform driver to suspend the - * wlan bus - * - * @state: state - * - * Return: QDF_STATUS - */ int wlan_hdd_bus_suspend(pm_message_t state) { int ret; @@ -635,16 +625,6 @@ done: return err; } -/** - * wlan_hdd_bus_suspend_noirq() - handle .suspend_noirq callback - * - * This function is called by the platform driver to complete the - * bus suspend callback when device interrupts are disabled by kernel. - * Call HIF and WMA suspend_noirq callbacks to make sure there is no - * wake up pending from FW before allowing suspend. - * - * Return: 0 for success and -EBUSY if FW is requesting wake up - */ int wlan_hdd_bus_suspend_noirq(void) { int ret; @@ -700,14 +680,6 @@ static int __wlan_hdd_bus_resume(void) return status; } -/** - * wlan_hdd_bus_resume(): wake up the bus - * - * This function is called by the platform driver to resume wlan - * bus - * - * Return: void - */ int wlan_hdd_bus_resume(void) { int ret; @@ -758,15 +730,6 @@ int __wlan_hdd_bus_resume_noirq(void) return status; } -/** - * wlan_hdd_bus_resume_noirq(): handle bus resume no irq - * - * This function is called by the platform driver to do bus - * resume no IRQ before calling resume callback. Call WMA and HIF - * layers to complete the resume_noirq. - * - * Return: 0 for success and negative error code for failure - */ int wlan_hdd_bus_resume_noirq(void) { int ret; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 159346cc0e44..ae0e24fed9c5 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2356,7 +2356,7 @@ int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter, #ifdef WLAN_SUSPEND_RESUME_TEST /* - * On Rome/iHelium there are 12 CE irqs and #2 is the wake irq. This may not be + * On iHelium there are 12 CE irqs and #2 is the wake irq. This may not be * a valid assumption on future platforms. */ #define CE_IRQ_COUNT 12 @@ -2366,7 +2366,41 @@ static struct wiphy *g_wiphy; #define HDD_FA_SUSPENDED_BIT (0) static unsigned long fake_apps_state; -static int __hdd_wlan_fake_apps_resume(struct wiphy *wiphy); +/** + * __hdd_wlan_fake_apps_resume() - The core logic for + * hdd_wlan_fake_apps_resume() skipping the call to hif_fake_apps_resume(), + * which is only need for non-irq resume + * @wiphy: wiphy struct from a validated hdd context + * + * Return: Zero on success, calls QDF_BUG() on failure + */ +static void __hdd_wlan_fake_apps_resume(struct wiphy *wiphy) +{ + qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); + int i, resume_err; + + hdd_info("Unit-test resume WLAN"); + if (!test_and_clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) { + hdd_info("Not unit-test suspended; Nothing to do"); + return; + } + + /* disable wake irq */ + pld_disable_irq(qdf_dev->dev, CE_WAKE_IRQ); + + resume_err = wlan_hdd_bus_resume_noirq(); + QDF_BUG(resume_err == 0); + + /* simulate kernel enable irqs */ + for (i = 0; i < CE_IRQ_COUNT; i++) + pld_enable_irq(qdf_dev->dev, i); + + resume_err = wlan_hdd_bus_resume(); + QDF_BUG(resume_err == 0); + + resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy); + QDF_BUG(resume_err == 0); +} /** * hdd_wlan_fake_apps_resume_irq_callback() - Irq callback function for resuming @@ -2386,12 +2420,6 @@ static void hdd_wlan_fake_apps_resume_irq_callback(uint32_t val) g_wiphy = NULL; } -/** - * hdd_wlan_fake_apps_suspend() - Initiate a unit-test triggered suspend - * @wiphy: wiphy struct from a validated hdd context - * - * Return: Zero on success, suspend related non-zero error code on failure - */ int hdd_wlan_fake_apps_suspend(struct wiphy *wiphy) { qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); @@ -2449,62 +2477,12 @@ resume_done: return suspend_err; } -/** - * hdd_wlan_fake_apps_resume() - Resume from unit-test triggered suspend - * @wiphy: wiphy struct from a validated hdd context - * - * Return: Zero on success, calls QDF_BUG() on failure - */ int hdd_wlan_fake_apps_resume(struct wiphy *wiphy) { struct hif_opaque_softc *hif_ctx = cds_get_context(QDF_MODULE_ID_HIF); - int err; hif_fake_apps_resume(hif_ctx); - err = __hdd_wlan_fake_apps_resume(wiphy); - if (err) { - hif_fake_apps_suspend(hif_ctx, - hdd_wlan_fake_apps_resume_irq_callback); - return err; - } - - return 0; -} - -/** - * __hdd_wlan_fake_apps_resume() - The core logic for - * hdd_wlan_fake_apps_resume() skipping the call to hif_fake_apps_resume(), - * which is only need for non-irq resume - * @wiphy: wiphy struct from a validated hdd context - * - * Return: Zero on success, calls QDF_BUG() on failure - */ -static int __hdd_wlan_fake_apps_resume(struct wiphy *wiphy) -{ - qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); - int i, resume_err; - - hdd_info("Unit-test resume WLAN"); - if (!test_and_clear_bit(HDD_FA_SUSPENDED_BIT, &fake_apps_state)) { - hdd_info("Not unit-test suspended; Nothing to do"); - return 0; - } - - /* disable wake irq */ - pld_disable_irq(qdf_dev->dev, CE_WAKE_IRQ); - - resume_err = wlan_hdd_bus_resume_noirq(); - QDF_BUG(resume_err == 0); - - /* simulate kernel enable irqs */ - for (i = 0; i < CE_IRQ_COUNT; i++) - pld_enable_irq(qdf_dev->dev, i); - - resume_err = wlan_hdd_bus_resume(); - QDF_BUG(resume_err == 0); - - resume_err = wlan_hdd_cfg80211_resume_wlan(wiphy); - QDF_BUG(resume_err == 0); + __hdd_wlan_fake_apps_resume(wiphy); return 0; } diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 4bb77b27cb94..bcf647b0b1a4 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -379,7 +379,4 @@ void *pld_smmu_get_mapping(struct device *dev); int pld_smmu_map(struct device *dev, phys_addr_t paddr, uint32_t *iova_addr, size_t size); unsigned int pld_socinfo_get_serial_number(struct device *dev); - -void pld_enable_irq(struct device *dev, unsigned int ce_id); -void pld_disable_irq(struct device *dev, unsigned int ce_id); #endif From 105d790504fe44853ff8e7d72f1342b62938e172 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 3 Oct 2016 16:27:59 -0700 Subject: [PATCH 060/113] qcacld-3.0: Log suspend failure reasons Increment counters for the various reasons a suspend might fail, and log them via print messages at time of failure. Change-Id: Ie1fb700577aee5f1b3a0d29277b81299a13dbde3 CRs-Fixed: 1073824 --- core/hdd/inc/wlan_hdd_main.h | 22 +++++++++++++++++++++- core/hdd/inc/wlan_hdd_power.h | 14 ++++++++++++++ core/hdd/src/wlan_hdd_driver_ops.c | 8 ++++++-- core/hdd/src/wlan_hdd_power.c | 25 +++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 3 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 7d9926e58aac..284cb7bce939 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1235,8 +1235,25 @@ struct acs_dfs_policy { uint8_t acs_channel; }; -/** Adapter structure definition */ +/** + * enum suspend_fail_reason: Reasons a WLAN suspend might fail + * SUSPEND_FAIL_IPA: IPA in progress + * SUSPEND_FAIL_RADAR: radar scan in progress + * SUSPEND_FAIL_ROAM: roaming in progress + * SUSPEND_FAIL_SCAN: scan in progress + * SUSPEND_FAIL_INITIAL_WAKEUP: received initial wakeup from firmware + * SUSPEND_FAIL_MAX_COUNT: the number of wakeup reasons, always at the end + */ +enum suspend_fail_reason { + SUSPEND_FAIL_IPA, + SUSPEND_FAIL_RADAR, + SUSPEND_FAIL_ROAM, + SUSPEND_FAIL_SCAN, + SUSPEND_FAIL_INITIAL_WAKEUP, + SUSPEND_FAIL_MAX_COUNT +}; +/** Adapter structure definition */ struct hdd_context_s { /** Global CDS context */ v_CONTEXT_t pcds_context; @@ -1510,6 +1527,9 @@ struct hdd_context_s { bool update_mac_addr_to_fw; struct acs_dfs_policy acs_policy; uint16_t wmi_max_len; + + /* counters for failed suspend reasons */ + uint32_t suspend_fail_stats[SUSPEND_FAIL_MAX_COUNT]; }; /*--------------------------------------------------------------------------- diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index fee466599820..abb69bd56e66 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -199,6 +199,20 @@ static inline void hdd_wlan_suspend_resume_event(uint8_t state) {} #endif /* FEATURE_WLAN_DIAG_SUPPORT */ +/** + * wlan_hdd_inc_suspend_stats() - Prints, then increments, then prints suspend + * failed statistics. + * @hdd_ctx: The HDD context to operate on + * @reason: The suspend failed reason to increment + * + * This function prints all of the suspend failed statistics, increments the + * specified suspend fail reason statistic, and prints the them all again. This + * is for easily keeping track of the most common reasons suspend fails. + * + * Return: none + */ +void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx, + enum suspend_fail_reason reason); /* * Unit-test suspend/resume is a testing feature that allows putting firmware diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index a5a714834542..70295b12bcd0 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -618,10 +618,14 @@ resume_hif_noirq: status = hif_bus_resume_noirq(hif_ctx); QDF_BUG(!status); done: - if (err == -EAGAIN) + if (err == -EAGAIN) { hdd_err("Firmware attempting wakeup, try again"); - else + wlan_hdd_inc_suspend_stats(hdd_ctx, + SUSPEND_FAIL_INITIAL_WAKEUP); + } else { hdd_err("suspend_noirq failed, status = %d", err); + } + return err; } diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index ae0e24fed9c5..87fdfdacaa21 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1667,6 +1667,24 @@ static int wlan_hdd_set_powersave(hdd_adapter_t *adapter, return 0; } +static void wlan_hdd_print_suspend_fail_stats(hdd_context_t *hdd_ctx) +{ + hdd_err("ipa:%d, radar:%d, roam:%d, scan:%d, initial_wakeup:%d", + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_IPA], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_RADAR], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_ROAM], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_SCAN], + hdd_ctx->suspend_fail_stats[SUSPEND_FAIL_INITIAL_WAKEUP]); +} + +void wlan_hdd_inc_suspend_stats(hdd_context_t *hdd_ctx, + enum suspend_fail_reason reason) +{ + wlan_hdd_print_suspend_fail_stats(hdd_ctx); + hdd_ctx->suspend_fail_stats[reason]++; + wlan_hdd_print_suspend_fail_stats(hdd_ctx); +} + /** * __wlan_hdd_cfg80211_resume_wlan() - cfg80211 resume callback * @wiphy: Pointer to wiphy @@ -1859,6 +1877,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, WLAN_HDD_GET_AP_CTX_PTR(pAdapter)-> dfs_cac_block_tx) { hdd_err("RADAR detection in progress, do not allow suspend"); + wlan_hdd_inc_suspend_stats(pHddCtx, + SUSPEND_FAIL_RADAR); return -EAGAIN; } else if (!pHddCtx->config->enableSapSuspend) { /* return -EOPNOTSUPP if SAP does not support @@ -1891,6 +1911,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, if (sme_sta_in_middle_of_roaming (pHddCtx->hHal, pAdapter->sessionId)) { hdd_err("Roaming in progress, do not allow suspend"); + wlan_hdd_inc_suspend_stats(pHddCtx, + SUSPEND_FAIL_ROAM); return -EAGAIN; } @@ -1905,6 +1927,8 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, msecs_to_jiffies(WLAN_WAIT_TIME_ABORTSCAN)); if (!status) { hdd_err("Timeout occurred while waiting for abort scan"); + wlan_hdd_inc_suspend_stats(pHddCtx, + SUSPEND_FAIL_SCAN); return -ETIME; } } @@ -1918,6 +1942,7 @@ static int __wlan_hdd_cfg80211_suspend_wlan(struct wiphy *wiphy, */ if (hdd_ipa_suspend(pHddCtx)) { hdd_err("IPA not ready to suspend!"); + wlan_hdd_inc_suspend_stats(pHddCtx, SUSPEND_FAIL_IPA); return -EAGAIN; } From 87c4428fd1af9cde0112b6b7e5bc02046141c6ab Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Thu, 6 Oct 2016 10:17:13 -0700 Subject: [PATCH 061/113] qcacld-3.0: Change RA Filtering to Enabled by Default As a fallback mechanism in case APF is disabled for any reason, ensure RA Filtering is enabled by default. Change-Id: Ib9163ca5dd89a7594c2e02b5f8c099ddbb5b3fc6 CRs-Fixed: 1075102 --- core/hdd/inc/wlan_hdd_cfg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index ab19c7ac9331..4ba70e7ca1cb 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -2370,7 +2370,7 @@ typedef enum { #define CFG_RA_FILTER_ENABLE_NAME "gRAFilterEnable" #define CFG_RA_FILTER_ENABLE_MIN (0) #define CFG_RA_FILTER_ENABLE_MAX (1) -#define CFG_RA_FILTER_ENABLE_DEFAULT (0) +#define CFG_RA_FILTER_ENABLE_DEFAULT (1) #define CFG_RA_RATE_LIMIT_INTERVAL_NAME "gRArateLimitInterval" #define CFG_RA_RATE_LIMIT_INTERVAL_MIN (60) From 14ee4a788a31516d1d814ba3f4493cc4a4e44763 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 13:01:05 -0700 Subject: [PATCH 062/113] Release 5.1.0.30E Release 5.1.0.30E Change-Id: I67fb71a0708ceb0de1bdde815a3d364971d7537b CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index fff69542c2ab..1e1d89827828 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "D" +#define QWLAN_VERSION_EXTRA "E" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30D" +#define QWLAN_VERSIONSTR "5.1.0.30E" #endif /* QWLAN_VERSION_H */ From 43e872901a857966f1fe0d83396164f98633b42f Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Mon, 10 Oct 2016 10:38:25 -0700 Subject: [PATCH 063/113] qcacld-3.0: Parse timer params in setpno iwpriv command Currently, the setpno iwpriv command ignores timer related parameters. Expand the setpno iwpriv command logic to parse timer related parameters. Change-Id: Ib318d3821e7da0fb7b2887d935ec5f5c706e6263 CRs-Fixed: 1076096 --- core/hdd/src/wlan_hdd_wext.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index fdb4e5dfdd7e..6112c7527eae 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -9335,13 +9335,12 @@ void found_pref_network_cb(void *callbackContext, * for each network: * * - * - * for each timer: - * + * + * * * * e.g: - * 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 2 5 2 300 0 1 + * 1 2 4 test 0 0 3 1 6 11 2 40 5 test2 4 4 6 1 2 3 4 5 6 1 0 5 2 1 * * this translates into: * ----------------------------- @@ -9357,10 +9356,8 @@ void found_pref_network_cb(void *callbackContext, * search on 6 channels 1, 2, 3, 4, 5 and 6 * bcast type is non-bcast (directed probe will be sent) * and must not meet any RSSI threshold - * 2 scan timers: * scan every 5 seconds 2 times - * then scan every 300 seconds until stopped - * enable on suspend + * enable on suspend */ static int __iw_set_pno(struct net_device *dev, struct iw_request_info *info, @@ -9526,6 +9523,17 @@ static int __iw_set_pno(struct net_device *dev, ptr += offset; } /* For ucNetworkCount */ + request.fast_scan_period = 0; + if (sscanf(ptr, "%u %n", &(request.fast_scan_period), &offset) > 0) { + request.fast_scan_period *= MSEC_PER_SEC; + ptr += offset; + } + + request.fast_scan_max_cycles = 0; + if (sscanf(ptr, "%hhu %n", &(request.fast_scan_max_cycles), + &offset) > 0) + ptr += offset; + params = sscanf(ptr, "%hhu %n", &(mode), &offset); request.modePNO = mode; From 02e3608a68179f14ac2fdd7698d378d493e8eec2 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 17:16:23 -0700 Subject: [PATCH 064/113] Release 5.1.0.30F Release 5.1.0.30F Change-Id: I973a03e4d88ed9841e81f0609f840f5a6d59d105 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1e1d89827828..dc208815b8ee 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "E" +#define QWLAN_VERSION_EXTRA "F" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30E" +#define QWLAN_VERSIONSTR "5.1.0.30F" #endif /* QWLAN_VERSION_H */ From ac39a10faeeea4634b42fcdd894b05b991b1be6c Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Fri, 7 Oct 2016 10:58:29 -0700 Subject: [PATCH 065/113] qcacld-3.0: Panic when wait for WMI_SERVICE_READY_EXT_EVENT times out Change ASSERT to BUG_ON when wait for WMI_SERVICE_READY_EXT_EVENT times out in insmod thread. Change-Id: Ie666fd0881969a503e6b3635cdc5bb7f223776ec CRs-Fixed: 1075166 --- core/cds/src/cds_api.c | 2 +- core/wma/src/wma_main.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 43a8ea336611..1cfb12871f5b 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -519,8 +519,8 @@ QDF_STATUS cds_pre_enable(v_CONTEXT_t cds_context) if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "Failed to get ready event from target firmware"); + QDF_BUG(0); htc_stop(gp_cds_context->htc_ctx); - QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; } diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 3d65f13c23ca..bc2b52d0b308 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -121,8 +121,8 @@ static void wma_service_ready_ext_evt_timeout(void *data) } end: - /* Panic so that we can debug why FW is not responding */ - QDF_BUG(0); + /* Assert here. Panic is being called in insmod thread */ + QDF_ASSERT(0); } /** From 8cf22ab5afac1c35e022077d149fe3256bad5688 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Mon, 10 Oct 2016 22:12:21 -0700 Subject: [PATCH 066/113] Release 5.1.0.30G Release 5.1.0.30G Change-Id: I566ee17f2d1f05bebb3ddb47c8e30c1a8a8aad6a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index dc208815b8ee..7dd8a95dbf7f 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "F" +#define QWLAN_VERSION_EXTRA "G" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30F" +#define QWLAN_VERSIONSTR "5.1.0.30G" #endif /* QWLAN_VERSION_H */ From 018d7d3f31379852b56ef783fb1ace15f25d00eb Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 14:31:11 -0700 Subject: [PATCH 067/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_assoc We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_assoc. Change-Id: I89f3273ff3d2bf3f68d1e8c39dd967e07637b265 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_assoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index c5a5fcac0922..09aab866e173 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1425,7 +1425,7 @@ QDF_STATUS hdd_roam_deregister_sta(hdd_adapter_t *pAdapter, uint8_t staId) * * Return: None */ -void hdd_print_bss_info(hdd_station_ctx_t *hdd_sta_ctx) +static void hdd_print_bss_info(hdd_station_ctx_t *hdd_sta_ctx) { uint32_t *cap_info; @@ -1685,7 +1685,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter, * * Return: None */ -void hdd_set_peer_authorized_event(uint32_t vdev_id) +static void hdd_set_peer_authorized_event(uint32_t vdev_id) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); hdd_adapter_t *adapter = NULL; From f1bf3a6da093776268add62dbfb3069e5b2e5e97 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 15:48:13 -0700 Subject: [PATCH 068/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_cfg We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_cfg. Change-Id: Ie23da29a1515249c04185ad4e146d8c9f4256c0f CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_cfg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 9e944e6d33eb..4ad684334918 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -5868,7 +5868,7 @@ static void hdd_override_all_ps(hdd_context_t *hdd_ctx) * * Return: none */ -void hdd_set_rx_mode_value(hdd_context_t *hdd_ctx) +static void hdd_set_rx_mode_value(hdd_context_t *hdd_ctx) { if (hdd_ctx->config->rx_mode & CFG_ENABLE_RX_THREAD && hdd_ctx->config->rx_mode & CFG_ENABLE_RPS) { @@ -6136,8 +6136,9 @@ static QDF_STATUS hdd_convert_string_to_array(char *str, uint8_t *array, * * Return: QDF_STATUS */ -QDF_STATUS hdd_hex_string_to_u8_array(char *str, uint8_t *hex_array, - uint8_t *len, uint8_t array_max_len) +static QDF_STATUS hdd_hex_string_to_u8_array(char *str, uint8_t *hex_array, + uint8_t *len, + uint8_t array_max_len) { return hdd_convert_string_to_array(str, hex_array, len, array_max_len, true); From 8b8a04bd1c267baf959d25e0e9b4313f8ae4a001 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 15:49:43 -0700 Subject: [PATCH 069/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_cfg80211 We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_cfg80211. Change-Id: I749b17dfc313fa72da49116a5452a5c63102f718 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_cfg80211.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 1d40f77e2804..ae1d71d7bf2b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2135,7 +2135,8 @@ wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, * This is called to turn ON or SET the feature flag for the requested feature. **/ #define NUM_BITS_IN_BYTE 8 -void wlan_hdd_cfg80211_set_feature(uint8_t *feature_flags, uint8_t feature) +static void wlan_hdd_cfg80211_set_feature(uint8_t *feature_flags, + uint8_t feature) { uint32_t index; uint8_t bit_mask; @@ -6607,10 +6608,10 @@ static int wlan_hdd_sap_get_nol(hdd_adapter_t *ap_adapter, uint8_t *nol, * * Return: Zero on success and non zero value on error */ -int wlan_hdd_validate_and_get_pre_cac_ch(hdd_context_t *hdd_ctx, - hdd_adapter_t *ap_adapter, - uint8_t channel, - uint8_t *pre_cac_chan) +static int wlan_hdd_validate_and_get_pre_cac_ch(hdd_context_t *hdd_ctx, + hdd_adapter_t *ap_adapter, + uint8_t channel, + uint8_t *pre_cac_chan) { uint32_t i, j; QDF_STATUS status; @@ -10423,6 +10424,7 @@ static int wlan_hdd_cfg80211_set_default_key(struct wiphy *wiphy, * Return: bss found in kernel cache */ #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) && !defined(WITH_BACKPORTS) +static struct cfg80211_bss *wlan_hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, size_t ssid_len) @@ -10434,6 +10436,7 @@ struct cfg80211_bss *wlan_hdd_cfg80211_get_bss(struct wiphy *wiphy, WLAN_CAPABILITY_ESS); } #else +static struct cfg80211_bss *wlan_hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, size_t ssid_len) @@ -11664,7 +11667,7 @@ static int wlan_hdd_add_assoc_ie(hdd_wext_state_t *wext_state, * * Return: 0 for success, non-zero for failure */ -int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, +static int wlan_hdd_cfg80211_set_ie(hdd_adapter_t *pAdapter, const uint8_t *ie, size_t ie_len) { hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); @@ -11991,8 +11994,8 @@ static bool hdd_is_wpaie_present(const uint8_t *ie, uint8_t ie_len) * * Return: 0 for success, non-zero for failure */ -int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter, - struct cfg80211_connect_params *req) +static int wlan_hdd_cfg80211_set_privacy(hdd_adapter_t *pAdapter, + struct cfg80211_connect_params *req) { int status = 0; hdd_wext_state_t *pWextState = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); @@ -12364,7 +12367,7 @@ static int wlan_hdd_cfg80211_connect(struct wiphy *wiphy, * * Return: 0 for success, non-zero for failure */ -int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason) +static int wlan_hdd_disconnect(hdd_adapter_t *pAdapter, u16 reason) { int status, result = 0; unsigned long rc; @@ -13929,6 +13932,7 @@ void wlan_hdd_cfg80211_update_replay_counter_callback(void *callbackContext, * * Return: 0 for success, non-zero for failure */ +static int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_gtk_rekey_data *data) @@ -14017,6 +14021,7 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, * * Return: 0 for success, non-zero for failure */ +static int wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_gtk_rekey_data *data) @@ -14182,7 +14187,8 @@ wlan_hdd_cfg80211_set_mac_acl(struct wiphy *wiphy, * * Return: none */ -void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, tSirLPHBInd *lphbInd) +static void wlan_hdd_cfg80211_lphb_ind_handler(void *pHddCtx, + tSirLPHBInd *lphbInd) { struct sk_buff *skb; From 510779e8bf49ee349702e86c6606b619dded6e3e Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 15:51:12 -0700 Subject: [PATCH 070/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_debugfs We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_debugfs. Change-Id: I6ebadd731e4d92a63025567ef75bc939faa0e546 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_debugfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/core/hdd/src/wlan_hdd_debugfs.c b/core/hdd/src/wlan_hdd_debugfs.c index cb1155f8e161..e5652b4f1c53 100644 --- a/core/hdd/src/wlan_hdd_debugfs.c +++ b/core/hdd/src/wlan_hdd_debugfs.c @@ -39,6 +39,7 @@ #define HDD_DISALLOW_LEGACY_HDDLOG 1 #include +#include #include #include From 7782cb90b89f749838b4e2347f43876c04194ab4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 14:22:40 -0700 Subject: [PATCH 071/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_driver_ops We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_driver_ops. Change-Id: I6a941cd82af543d433427b5ce3aad80f7e1c8e57 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_driver_ops.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 70295b12bcd0..57b1ce695434 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -48,6 +48,7 @@ #include "bmi.h" #include "cdp_txrx_bus.h" #include "pld_common.h" +#include "wlan_hdd_driver_ops.h" #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -302,8 +303,9 @@ void hdd_hif_close(void *hif_ctx) * * Return: void */ -void hdd_init_qdf_ctx(struct device *dev, void *bdev, - enum qdf_bus_type bus_type, const struct hif_bus_id *bid) +static void hdd_init_qdf_ctx(struct device *dev, void *bdev, + enum qdf_bus_type bus_type, + const struct hif_bus_id *bid) { qdf_device_t qdf_dev = cds_get_context(QDF_MODULE_ID_QDF_DEVICE); @@ -470,7 +472,7 @@ static void wlan_hdd_shutdown(void) * * Return: void */ -void wlan_hdd_crash_shutdown(void) +static void wlan_hdd_crash_shutdown(void) { hif_crash_shutdown(cds_get_context(QDF_MODULE_ID_HIF)); } @@ -485,7 +487,7 @@ void wlan_hdd_crash_shutdown(void) * * Return: void */ -void wlan_hdd_notify_handler(int state) +static void wlan_hdd_notify_handler(int state) { if (!QDF_IS_EPPING_ENABLED(cds_get_conparam())) { int ret = 0; @@ -579,7 +581,7 @@ int wlan_hdd_bus_suspend(pm_message_t state) * * Return: 0 for success and -EBUSY if FW is requesting wake up */ -int __wlan_hdd_bus_suspend_noirq(void) +static int __wlan_hdd_bus_suspend_noirq(void) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); void *hif_ctx; @@ -704,7 +706,7 @@ int wlan_hdd_bus_resume(void) * * Return: 0 for success and negative error code for failure */ -int __wlan_hdd_bus_resume_noirq(void) +static int __wlan_hdd_bus_resume_noirq(void) { hdd_context_t *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); void *hif_ctx; From cd2a079b97702e8b939a5f64510a9b97da927f63 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 15:17:13 -0700 Subject: [PATCH 072/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_ext_scan We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_ext_scan. Change-Id: I29c7ba3ef4e9eaa8a28268161a10f3b25249601d CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_ext_scan.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 0a172685416e..92241e2687e5 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -2435,8 +2435,8 @@ int wlan_hdd_cfg80211_extscan_set_significant_change(struct wiphy *wiphy, * * Return: none */ -void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list, - uint8_t *num_channels) +static void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list, + uint8_t *num_channels) { uint8_t num_chan_temp = 0; int i; @@ -2460,8 +2460,8 @@ void hdd_remove_dsrc_channels(struct wiphy *wiphy, uint32_t *chan_list, * Return: none */ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)) -void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, - uint8_t *num_channels) +static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, + uint8_t *num_channels) { uint8_t num_chan_temp = 0; int i, j, k; @@ -2485,8 +2485,8 @@ void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, *num_channels = num_chan_temp; } #else -void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, - uint8_t *num_channels) +static void hdd_remove_indoor_channels(struct wiphy *wiphy, uint32_t *chan_list, + uint8_t *num_channels) { *num_channels = 0; } From e4090f7d8796b6ef23c9afb659bc5ede7b09d144 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:00:23 -0700 Subject: [PATCH 073/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_hostapd We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_hostapd. Change-Id: I3b15af337185c28b2066e9d28e9e174cfc5ab76a CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_hostapd.c | 46 +++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5ca394f7fcb3..559a6717f3e9 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -133,8 +133,8 @@ int hdd_sap_context_init(hdd_context_t *hdd_ctx) * * Return: None */ -void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, - uint8_t channel) +static void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, + uint8_t channel) { hdd_context_t *pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx); @@ -169,8 +169,8 @@ void hdd_hostapd_channel_allow_suspend(hdd_adapter_t *pAdapter, * * Return - None */ -void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, - uint8_t channel) +static void hdd_hostapd_channel_prevent_suspend(hdd_adapter_t *pAdapter, + uint8_t channel) { hdd_context_t *pHddCtx = (hdd_context_t *) (pAdapter->pHddCtx); hdd_hostapd_state_t *pHostapdState = @@ -473,9 +473,20 @@ static int hdd_hostapd_set_mac_address(struct net_device *dev, void *addr) return ret; } -void hdd_hostapd_inactivity_timer_cb(void *usrDataForCallback) +/** + * hdd_hostapd_inactivity_timer_cb() - Inactivity timeout handler + * @context: Context registered with qdf_mc_timer_init() + * + * This is the callback function registered with qdf_mc_timer_init() + * to handle the AP inactivity timer. The @context registered is the + * struct net_device associated with the interface. When this + * function is called it means the AP inactivity timer has fired, and + * this function in turn indicates the timeout to userspace. + */ + +static void hdd_hostapd_inactivity_timer_cb(void *context) { - struct net_device *dev = (struct net_device *)usrDataForCallback; + struct net_device *dev = (struct net_device *)context; uint8_t we_custom_event[64]; union iwreq_data wrqu; #ifdef DISABLE_CONCURRENCY_AUTOSAVE @@ -533,8 +544,8 @@ void hdd_hostapd_inactivity_timer_cb(void *usrDataForCallback) EXIT(); } -void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter, - void *usrDataForCallback) +static void hdd_clear_all_sta(hdd_adapter_t *pHostapdAdapter, + void *usrDataForCallback) { uint8_t staId = 0; struct net_device *dev; @@ -729,10 +740,10 @@ QDF_STATUS hdd_chan_change_notify(hdd_adapter_t *adapter, * Return: Success on sending notifying userspace * */ -QDF_STATUS hdd_send_radar_event(hdd_context_t *hdd_context, - eSapHddEvent event, - struct wlan_dfs_info dfs_info, - struct wireless_dev *wdev) +static QDF_STATUS hdd_send_radar_event(hdd_context_t *hdd_context, + eSapHddEvent event, + struct wlan_dfs_info dfs_info, + struct wireless_dev *wdev) { struct sk_buff *vendor_event; @@ -6309,10 +6320,11 @@ static void wlan_hdd_add_extra_ie(hdd_adapter_t *pHostapdAdapter, * * Return: 0 for success non-zero for failure */ -int wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, - beacon_data_t **ppBeacon, - struct cfg80211_beacon_data *params, - int dtim_period) +static int +wlan_hdd_cfg80211_alloc_new_beacon(hdd_adapter_t *pAdapter, + beacon_data_t **ppBeacon, + struct cfg80211_beacon_data *params, + int dtim_period) { int size; beacon_data_t *beacon = NULL; @@ -6761,7 +6773,7 @@ QDF_STATUS wlan_hdd_config_acs(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) * * Return: 0 for Success or Negative error codes. */ -int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) +static int wlan_hdd_setup_driver_overrides(hdd_adapter_t *ap_adapter) { tsap_Config_t *sap_cfg = &ap_adapter->sessionCtx.ap.sapConfig; hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter); From d772063714dd665f0725e7f6c72ceb409a62427a Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:04:32 -0700 Subject: [PATCH 074/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_ipa We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_ipa. Change-Id: Ie789cc0c00ab6553ad4ca1a12968d50078afe763 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_ipa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ipa.c b/core/hdd/src/wlan_hdd_ipa.c index 0fa36477eed6..bb06854696c7 100644 --- a/core/hdd/src/wlan_hdd_ipa.c +++ b/core/hdd/src/wlan_hdd_ipa.c @@ -454,7 +454,7 @@ struct hdd_ipa_priv { * is broken. * This should be OK and IPA is not enabled yet */ -void *wlan_hdd_stub_priv_to_addr(uint32_t priv) +static void *wlan_hdd_stub_priv_to_addr(uint32_t priv) { void *vaddr; uint32_t ipa_priv = priv; @@ -464,7 +464,7 @@ void *wlan_hdd_stub_priv_to_addr(uint32_t priv) return vaddr; } -uint32_t wlan_hdd_stub_addr_to_priv(void *ptr) +static uint32_t wlan_hdd_stub_addr_to_priv(void *ptr) { uint32_t ipa_priv = 0; @@ -838,7 +838,7 @@ static void hdd_ipa_uc_rt_debug_handler(void *ctext) * * Return: none */ -void hdd_ipa_uc_rt_debug_destructor(struct sk_buff *skb) +static void hdd_ipa_uc_rt_debug_destructor(struct sk_buff *skb) { if (!ghdd_ipa) { HDD_IPA_LOG(QDF_TRACE_LEVEL_ERROR, @@ -4163,7 +4163,7 @@ fail_return: * * Return: none */ -void hdd_ipa_cleanup_pending_event(struct hdd_ipa_priv *hdd_ipa) +static void hdd_ipa_cleanup_pending_event(struct hdd_ipa_priv *hdd_ipa) { struct ipa_uc_pending_event *pending_event = NULL; From 64d8618a5304060bea644dc08dca40167e767b03 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:15:36 -0700 Subject: [PATCH 075/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_lro We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_lro. Change-Id: I5f640761078b877732d00b7eddabbd21996bbc71 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_lro.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_lro.c b/core/hdd/src/wlan_hdd_lro.c index 35902f28fee5..a312b8c548be 100644 --- a/core/hdd/src/wlan_hdd_lro.c +++ b/core/hdd/src/wlan_hdd_lro.c @@ -412,8 +412,9 @@ static void hdd_lro_desc_free(struct net_lro_desc *desc, * * Return: none */ -void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, - struct iphdr *iph, struct tcphdr *tcph, hdd_adapter_t *adapter) +static void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, + struct iphdr *iph, struct tcphdr *tcph, + hdd_adapter_t *adapter) { struct net_lro_desc *lro_desc; @@ -434,7 +435,7 @@ void hdd_lro_flush_pkt(struct net_lro_mgr *lro_mgr, * * Return: none */ -void hdd_lro_flush(void *data) +static void hdd_lro_flush(void *data) { hdd_adapter_t *adapter = (hdd_adapter_t *)data; struct hdd_lro_s *hdd_lro; From 590e201405c8c86f9fc6658aa057e9496ae8fed7 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:16:24 -0700 Subject: [PATCH 076/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_main We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_main. Change-Id: Ib96b87acf019bc602adddb36f54792b872e2ad6e CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_main.c | 53 +++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fda3035e02ab..e5bffbaec4f0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -206,7 +206,7 @@ void wlan_hdd_auto_shutdown_cb(void); * * Return: none */ -void hdd_set_rps_cpu_mask(hdd_context_t *hdd_ctx) +static void hdd_set_rps_cpu_mask(hdd_context_t *hdd_ctx) { hdd_adapter_t *adapter; hdd_adapter_list_node_t *adapter_node, *next; @@ -1631,7 +1631,7 @@ static int __hdd_mon_open(struct net_device *dev) * * Return: 0 for success; non-zero for failure */ -int hdd_mon_open(struct net_device *dev) +static int hdd_mon_open(struct net_device *dev) { int ret; @@ -1968,7 +1968,7 @@ static int __hdd_open(struct net_device *dev) * * Return: 0 for success; non-zero for failure */ -int hdd_open(struct net_device *dev) +static int hdd_open(struct net_device *dev) { int ret; @@ -2075,7 +2075,7 @@ static int __hdd_stop(struct net_device *dev) * * Return: 0 for success and error number for failure */ -int hdd_stop(struct net_device *dev) +static int hdd_stop(struct net_device *dev) { int ret; @@ -2524,13 +2524,10 @@ static hdd_adapter_t *hdd_alloc_station_adapter(hdd_context_t *hdd_ctx, return adapter; } -QDF_STATUS hdd_register_interface(hdd_adapter_t *adapter, - bool rtnl_held) +static QDF_STATUS hdd_register_interface(hdd_adapter_t *adapter, + bool rtnl_held) { struct net_device *pWlanDev = adapter->dev; - /* hdd_station_ctx_t *pHddStaCtx = &adapter->sessionCtx.station; */ - /* hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX( adapter ); */ - /* QDF_STATUS qdf_ret_status = QDF_STATUS_SUCCESS; */ if (rtnl_held) { if (strnchr(pWlanDev->name, strlen(pWlanDev->name), '%')) { @@ -2780,14 +2777,16 @@ void hdd_cleanup_actionframe(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) * hdd_station_adapter_deinit() - De-initialize the station adapter * @hdd_ctx: global hdd context * @adapter: HDD adapter + * @rtnl_held: Used to indicate whether or not the caller is holding + * the kernel rtnl_mutex * * This function De-initializes the STA/P2P/OCB adapter. * * Return: None. */ -void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, - hdd_adapter_t *adapter, - bool rtnl_held) +static void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter, + bool rtnl_held) { ENTER_DEV(adapter->dev); @@ -2826,8 +2825,9 @@ void hdd_station_adapter_deinit(hdd_context_t *hdd_ctx, * * Return: None. */ -void hdd_ap_adapter_deinit(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, - bool rtnl_held) +static void hdd_ap_adapter_deinit(hdd_context_t *hdd_ctx, + hdd_adapter_t *adapter, + bool rtnl_held) { ENTER_DEV(adapter->dev); @@ -2872,8 +2872,8 @@ void hdd_deinit_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, EXIT(); } -void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, - bool rtnl_held) +static void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, + bool rtnl_held) { struct net_device *pWlanDev = NULL; @@ -2915,8 +2915,8 @@ void hdd_cleanup_adapter(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter, } } -QDF_STATUS hdd_check_for_existing_macaddr(hdd_context_t *hdd_ctx, - tSirMacAddr macAddr) +static QDF_STATUS hdd_check_for_existing_macaddr(hdd_context_t *hdd_ctx, + tSirMacAddr macAddr) { hdd_adapter_list_node_t *adapterNode = NULL, *pNext = NULL; hdd_adapter_t *adapter; @@ -3766,6 +3766,7 @@ static bool hdd_is_interface_up(hdd_adapter_t *adapter) #if defined CFG80211_CONNECT_BSS #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)) \ && !defined(WITH_BACKPORTS) && !defined(IEEE80211_PRIVACY) +static struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, @@ -3777,6 +3778,7 @@ struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, WLAN_CAPABILITY_ESS); } #else +static struct cfg80211_bss *hdd_cfg80211_get_bss(struct wiphy *wiphy, struct ieee80211_channel *channel, const u8 *bssid, const u8 *ssid, @@ -4654,7 +4656,7 @@ static void hdd_context_destroy(hdd_context_t *hdd_ctx) * * Return: None */ -void hdd_wlan_exit(hdd_context_t *hdd_ctx) +static void hdd_wlan_exit(hdd_context_t *hdd_ctx) { v_CONTEXT_t p_cds_context = hdd_ctx->pcds_context; QDF_STATUS qdf_status; @@ -5134,8 +5136,9 @@ static int hdd_wiphy_init(hdd_context_t *hdd_ctx) * Returns: None */ #ifdef MSM_PLATFORM -void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, - const uint64_t tx_packets, const uint64_t rx_packets) +static void hdd_pld_request_bus_bandwidth(hdd_context_t *hdd_ctx, + const uint64_t tx_packets, + const uint64_t rx_packets) { uint64_t total = tx_packets + rx_packets; uint64_t temp_rx = 0; @@ -5768,7 +5771,7 @@ static uint8_t hdd_get_safe_channel_from_pcl_and_acs_range( * * Return: None */ -void hdd_restart_sap(hdd_adapter_t *adapter, uint8_t channel) +static void hdd_restart_sap(hdd_adapter_t *adapter, uint8_t channel) { hdd_ap_ctx_t *hdd_ap_ctx; tHalHandle *hal_handle; @@ -6339,7 +6342,7 @@ list_destroy: * * Return: HDD context on success and ERR_PTR on failure */ -hdd_context_t *hdd_context_create(struct device *dev) +static hdd_context_t *hdd_context_create(struct device *dev) { QDF_STATUS status; int ret = 0; @@ -6748,7 +6751,7 @@ inline void hdd_ra_populate_cds_config(struct cds_config_info *cds_cfg, * * Return: 0 for Success, errno on failure */ -int hdd_update_cds_config(hdd_context_t *hdd_ctx) +static int hdd_update_cds_config(hdd_context_t *hdd_ctx) { struct cds_config_info *cds_cfg; @@ -7568,7 +7571,7 @@ out: * * Return: 0 on success and errno on failure. */ -int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) +static int hdd_deconfigure_cds(hdd_context_t *hdd_ctx) { QDF_STATUS qdf_status; From d2291047613ef64b38acb4c760143a70b9debb58 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:18:50 -0700 Subject: [PATCH 077/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_p2p We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_p2p. Change-Id: Ifea057311a2fc0ec45d2137c2264311f8c9b2a3b CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_p2p.c | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 1700a9c247c9..1587d02fbb46 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -375,7 +375,7 @@ int wlan_hdd_check_remain_on_channel(hdd_adapter_t *pAdapter) * * Return: None */ -void wlan_hdd_cancel_pending_roc(hdd_adapter_t *adapter) +static void wlan_hdd_cancel_pending_roc(hdd_adapter_t *adapter) { hdd_remain_on_chan_ctx_t *roc_ctx; unsigned long rc; @@ -463,7 +463,7 @@ void wlan_hdd_cleanup_remain_on_channel_ctx(hdd_adapter_t *pAdapter) } -void wlan_hdd_remain_on_chan_timeout(void *data) +static void wlan_hdd_remain_on_chan_timeout(void *data) { hdd_adapter_t *pAdapter = (hdd_adapter_t *) data; hdd_remain_on_chan_ctx_t *pRemainChanCtx; @@ -707,8 +707,8 @@ static int wlan_hdd_roc_request_enqueue(hdd_adapter_t *adapter, * * Return: None */ -void wlan_hdd_indicate_roc_drop(hdd_adapter_t *adapter, - hdd_remain_on_chan_ctx_t *ctx) +static void wlan_hdd_indicate_roc_drop(hdd_adapter_t *adapter, + hdd_remain_on_chan_ctx_t *ctx) { hdd_debug("indicate roc drop to userspace"); cfg80211_ready_on_channel( @@ -886,10 +886,11 @@ static int wlan_hdd_request_remain_on_channel(struct wiphy *wiphy, return 0; } -int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, - struct wireless_dev *wdev, - struct ieee80211_channel *chan, - unsigned int duration, u64 *cookie) +static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy, + struct wireless_dev *wdev, + struct ieee80211_channel *chan, + unsigned int duration, + u64 *cookie) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1027,9 +1028,10 @@ void hdd_remain_chan_ready_handler(hdd_adapter_t *pAdapter, return; } -int __wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, - struct wireless_dev *wdev, - u64 cookie) +static int +__wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, + struct wireless_dev *wdev, + u64 cookie) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1172,11 +1174,11 @@ int wlan_hdd_cfg80211_cancel_remain_on_channel(struct wiphy *wiphy, return ret; } -int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, - struct ieee80211_channel *chan, bool offchan, - unsigned int wait, - const u8 *buf, size_t len, bool no_cck, - bool dont_wait_for_ack, u64 *cookie) +static int __wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, + struct ieee80211_channel *chan, bool offchan, + unsigned int wait, + const u8 *buf, size_t len, bool no_cck, + bool dont_wait_for_ack, u64 *cookie) { struct net_device *dev = wdev->netdev; hdd_adapter_t *pAdapter = WLAN_HDD_GET_PRIV_PTR(dev); @@ -1602,9 +1604,9 @@ int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, return ret; } -int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, - struct wireless_dev *wdev, - u64 cookie) +static int __wlan_hdd_cfg80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, + struct wireless_dev *wdev, + u64 cookie) { return wlan_hdd_cfg80211_cancel_remain_on_channel(wiphy, wdev, cookie); } @@ -1942,6 +1944,7 @@ static uint8_t wlan_hdd_get_session_type(enum nl80211_iftype type) * * Return: the pointer of wireless dev, otherwise ERR_PTR. */ +static struct wireless_dev *__wlan_hdd_add_virtual_intf(struct wiphy *wiphy, const char *name, unsigned char name_assign_type, From c8d0c257305255493b12bef2567918dcbf3206be Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:19:50 -0700 Subject: [PATCH 078/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_power We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_power. Change-Id: I8ebc518eed2c56764eb18ef6881e1fb344b2f0d4 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_power.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 87fdfdacaa21..0efc8cbf05d9 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -52,6 +52,7 @@ #include #include #include +#include #include #include #include @@ -544,7 +545,7 @@ void hdd_conf_ns_offload(hdd_adapter_t *adapter, bool fenable) * * Return: None */ -void __hdd_ipv6_notifier_work_queue(struct work_struct *work) +static void __hdd_ipv6_notifier_work_queue(struct work_struct *work) { hdd_adapter_t *pAdapter = container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue); @@ -663,7 +664,7 @@ void hdd_conf_hostoffload(hdd_adapter_t *pAdapter, bool fenable) * * Return: None */ -void __hdd_ipv4_notifier_work_queue(struct work_struct *work) +static void __hdd_ipv4_notifier_work_queue(struct work_struct *work) { hdd_adapter_t *pAdapter = container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue); From 87a24256c1639e09004bd981fb25f57186704aa9 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:20:52 -0700 Subject: [PATCH 079/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_regulatory We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_regulatory. Change-Id: Ie9252966d9b4bbb49d934516bae16ecc6a03f0f4 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_regulatory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c index bda6e48d4b6d..4487d5dd2500 100644 --- a/core/hdd/src/wlan_hdd_regulatory.c +++ b/core/hdd/src/wlan_hdd_regulatory.c @@ -173,7 +173,7 @@ struct regulatory *reg) * * Return: bool */ -bool hdd_is_world_regdomain(uint32_t reg_domain) +static bool hdd_is_world_regdomain(uint32_t reg_domain) { uint32_t temp_regd = reg_domain & ~WORLDWIDE_ROAMING_FLAG; From 0eed72f1ef8f2f6709b9fb21df4f9467dea33743 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:23:50 -0700 Subject: [PATCH 080/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_scan We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_scan. Change-Id: I877d7e7b7be30a9195daad63d09999bb87f4add4 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 20c53b3c3c97..5feed800683e 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -598,7 +598,7 @@ static int wlan_hdd_scan_request_enqueue(hdd_adapter_t *adapter, * * Return: QDF_STATUS */ -QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx, +static QDF_STATUS wlan_hdd_scan_request_dequeue(hdd_context_t *hdd_ctx, uint32_t scan_id, struct cfg80211_scan_request **req, uint8_t *source, uint32_t *timestamp) { From 6376abe7a4a1b8ac823fed1c86fbca7bb753deb3 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:24:56 -0700 Subject: [PATCH 081/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_softap_tx_rx We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_softap_tx_rx. Change-Id: I26dd53307454d2c4dd887345eb77a9d362b5fdf2 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_softap_tx_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index 8ff10be73848..ab6357535162 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -211,7 +211,8 @@ void hdd_softap_tx_resume_cb(void *adapter_context, bool tx_resume) * * Return: Always returns NETDEV_TX_OK */ -int __hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int __hdd_softap_hard_start_xmit(struct sk_buff *skb, + struct net_device *dev) { sme_ac_enum_type ac = SME_AC_BE; hdd_adapter_t *pAdapter = (hdd_adapter_t *) netdev_priv(dev); From dde34498807a66aed524b92314b257b961c20139 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 16:28:04 -0700 Subject: [PATCH 082/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_tsf We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_tsf. Change-Id: I37e98814da218d9322a8d3ac05a0e19523859281 CRs-Fixed: 1074336 --- core/hdd/inc/wlan_hdd_tsf.h | 1 + core/hdd/src/wlan_hdd_tsf.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h index d53741ef1825..45e25223a505 100644 --- a/core/hdd/inc/wlan_hdd_tsf.h +++ b/core/hdd/inc/wlan_hdd_tsf.h @@ -61,6 +61,7 @@ enum hdd_tsf_capture_state { }; #ifdef WLAN_FEATURE_TSF +void wlan_hdd_tsf_init(struct hdd_context_s *hdd_ctx); int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len); int hdd_indicate_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len); int wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index e230925a7cd7..00ba66a82c59 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -30,6 +30,7 @@ */ #include "wlan_hdd_main.h" +#include "wlan_hdd_tsf.h" #include "wma_api.h" static struct completion tsf_sync_get_completion_evt; @@ -110,13 +111,13 @@ int hdd_capture_tsf(struct hdd_adapter_s *adapter, uint32_t *buf, int len) * Return: TSF_RETURN on Success, TSF_RESET_GPIO_FAIL on failure */ #ifdef QCA_WIFI_3_0 -int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) +static int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) { /* No GPIO Host timer sync for integrated WIFI Device */ return TSF_RETURN; } #else -int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) +static int hdd_tsf_reset_gpio(struct hdd_adapter_s *adapter) { int ret; ret = wma_cli_set_command((int)adapter->sessionId, From 3ae708d442c05ecb919a80178832358403ead284 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 15:45:00 -0700 Subject: [PATCH 083/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_tx_rx We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_tx_rx. Change-Id: Ic1eaf337ff339e979c3f78e667be9539eb47f5dc CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_tx_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_tx_rx.c b/core/hdd/src/wlan_hdd_tx_rx.c index 0fea7d814579..56056938c6d8 100644 --- a/core/hdd/src/wlan_hdd_tx_rx.c +++ b/core/hdd/src/wlan_hdd_tx_rx.c @@ -402,7 +402,7 @@ static void hdd_get_transmit_sta_id(hdd_adapter_t *adapter, * * Return: Always returns NETDEV_TX_OK */ -int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) +static int __hdd_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { QDF_STATUS status; sme_ac_enum_type ac; @@ -1099,7 +1099,7 @@ static void wlan_hdd_update_queue_oper_stats(hdd_adapter_t *adapter, * * Return: none */ -void wlan_hdd_update_txq_timestamp(struct net_device *dev) +static void wlan_hdd_update_txq_timestamp(struct net_device *dev) { struct netdev_queue *txq; int i; From af2a093bf5c07adea76812d0bee5d6382773a3c4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 14:52:57 -0700 Subject: [PATCH 084/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_wext We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_wext. Change-Id: I35f793352b7a166018945f9a9ac8457bf58ee809 CRs-Fixed: 1074336 --- core/hdd/src/wlan_hdd_wext.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 6112c7527eae..445000efdb33 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -810,7 +810,8 @@ hdd_wlan_get_ibss_mac_addr_from_staid(hdd_adapter_t *pAdapter, * Return: QDF_STATUS_STATUS if the peer was found and displayed, * otherwise an appropriate QDF_STATUS_E_* failure code. */ -QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, uint8_t staIdx) +static QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, + uint8_t staIdx) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); @@ -859,7 +860,7 @@ QDF_STATUS hdd_wlan_get_ibss_peer_info(hdd_adapter_t *pAdapter, uint8_t staIdx) * Return: QDF_STATUS_STATUS if the peer information was retrieved and * displayed, otherwise an appropriate QDF_STATUS_E_* failure code. */ -QDF_STATUS hdd_wlan_get_ibss_peer_info_all(hdd_adapter_t *pAdapter) +static QDF_STATUS hdd_wlan_get_ibss_peer_info_all(hdd_adapter_t *pAdapter) { QDF_STATUS status = QDF_STATUS_E_FAILURE; tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); @@ -1558,7 +1559,7 @@ int wlan_hdd_get_link_speed(hdd_adapter_t *sta_adapter, uint32_t *link_speed) * * Return: None */ -void hdd_statistics_cb(void *pStats, void *pContext) +static void hdd_statistics_cb(void *pStats, void *pContext) { hdd_adapter_t *pAdapter = (hdd_adapter_t *) pContext; hdd_stats_t *pStatsCache = NULL; @@ -1956,7 +1957,7 @@ static int __iw_set_commit(struct net_device *dev, struct iw_request_info *info, * * Return: 0 on success, error number otherwise */ -int iw_set_commit(struct net_device *dev, struct iw_request_info *info, +static int iw_set_commit(struct net_device *dev, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { int ret; @@ -3308,8 +3309,8 @@ static int iw_set_frag_threshold(struct net_device *dev, * Return: 0 on success, non-zero on error */ static int __iw_get_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *adapter; hdd_context_t *hdd_ctx; @@ -3335,9 +3336,9 @@ static int __iw_get_power_mode(struct net_device *dev, * * Return: 0 on success, error number otherwise */ -int iw_get_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +static int iw_get_power_mode(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; @@ -3358,8 +3359,8 @@ int iw_get_power_mode(struct net_device *dev, * Return: 0 on success, non-zero on error */ static int __iw_set_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { hdd_adapter_t *adapter; hdd_context_t *hdd_ctx; @@ -3385,9 +3386,9 @@ static int __iw_set_power_mode(struct net_device *dev, * * Return: 0 on success, error number otherwise */ -int iw_set_power_mode(struct net_device *dev, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) +static int iw_set_power_mode(struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret; @@ -9291,8 +9292,8 @@ static int iw_get_statistics(struct net_device *dev, /*Max Len for PNO notification*/ #define MAX_PNO_NOTIFY_LEN 100 -void found_pref_network_cb(void *callbackContext, - tSirPrefNetworkFoundInd *pPrefNetworkFoundInd) +static void found_pref_network_cb(void *callbackContext, + tSirPrefNetworkFoundInd *pPrefNetworkFoundInd) { hdd_adapter_t *pAdapter = (hdd_adapter_t *) callbackContext; union iwreq_data wrqu; @@ -11146,7 +11147,7 @@ const struct iw_handler_def we_handler_def = { * * Returns: none */ -int hdd_set_wext(hdd_adapter_t *pAdapter) +static int hdd_set_wext(hdd_adapter_t *pAdapter) { hdd_wext_state_t *pwextBuf = WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter); hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); From 6c3c2b56aaad5fb3f0c53c49cf77e6fc01a58186 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 09:11:01 -0700 Subject: [PATCH 085/113] qcacld-3.0: Fix -Wmissing-prototypes in BMI We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in BMI. Change-Id: I701a9620ad93b41b5bcfd79d0c048f62e8151a18 CRs-Fixed: 1075533 --- core/bmi/src/bmi.c | 4 ++-- core/bmi/src/ol_fw.c | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/bmi/src/bmi.c b/core/bmi/src/bmi.c index 4b88469782a3..33f5986cca0d 100644 --- a/core/bmi/src/bmi.c +++ b/core/bmi/src/bmi.c @@ -333,7 +333,7 @@ QDF_STATUS bmi_write_soc_register(uint32_t address, uint32_t param, return QDF_STATUS_SUCCESS; } -QDF_STATUS +static QDF_STATUS bmilz_data(uint8_t *buffer, uint32_t length, struct ol_context *ol_ctx) { uint32_t cid; @@ -455,7 +455,7 @@ QDF_STATUS bmi_sign_stream_start(uint32_t address, uint8_t *buffer, return QDF_STATUS_SUCCESS; } -QDF_STATUS +static QDF_STATUS bmilz_stream_start(uint32_t address, struct ol_context *ol_ctx) { uint32_t cid; diff --git a/core/bmi/src/ol_fw.c b/core/bmi/src/ol_fw.c index e6178a43d3ee..a5fbb0222b62 100644 --- a/core/bmi/src/ol_fw.c +++ b/core/bmi/src/ol_fw.c @@ -848,8 +848,8 @@ ol_check_dataset_patch(struct hif_opaque_softc *scn, uint32_t *address) } -QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, - struct cmnos_clock_s *clock_s) +static QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, + struct cmnos_clock_s *clock_s) { if (!clock_s) return QDF_STATUS_E_FAILURE; @@ -913,7 +913,7 @@ QDF_STATUS ol_fw_populate_clk_settings(A_refclk_speed_t refclk, return QDF_STATUS_SUCCESS; } -QDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) +static QDF_STATUS ol_patch_pll_switch(struct ol_context *ol_ctx) { struct hif_opaque_softc *hif = ol_ctx->scn; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -1207,7 +1207,7 @@ end: /* AXI Start Address */ #define TARGET_ADDR (0xa0000) -void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) +static void ol_transfer_codeswap_struct(struct ol_context *ol_ctx) { struct pld_codeswap_codeseg_info wlan_codeswap; QDF_STATUS rv; @@ -1411,8 +1411,8 @@ QDF_STATUS ol_download_firmware(struct ol_context *ol_ctx) return status; } -int ol_diag_read(struct hif_opaque_softc *scn, uint8_t *buffer, - uint32_t pos, size_t count) +static int ol_diag_read(struct hif_opaque_softc *scn, uint8_t *buffer, + uint32_t pos, size_t count) { int result = 0; @@ -1549,6 +1549,7 @@ out: return result; } +static void ol_dump_target_memory(struct hif_opaque_softc *scn, void *memory_block) { char *buffer_loc = memory_block; From a7d169b1dcec1ce41f93d530b8b210a4920869b9 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 09:16:08 -0700 Subject: [PATCH 086/113] qcacld-3.0: Fix -Wmissing-prototypes in CDS We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in CDS. Change-Id: I40141f7a9e7394e0071b84b32a2d2b95cfa3a09b CRs-Fixed: 1075544 --- core/cds/src/cds_concurrency.c | 35 ++++++++++++++++++---------------- core/cds/src/cds_utils.c | 4 ++-- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c index b7f3ab35172f..d0034479540a 100644 --- a/core/cds/src/cds_concurrency.c +++ b/core/cds/src/cds_concurrency.c @@ -3905,7 +3905,7 @@ void cds_decr_active_session(enum tQDF_ADAPTER_MODE mode, * * Return: None */ -void cds_dbs_opportunistic_timer_handler(void *data) +static void cds_dbs_opportunistic_timer_handler(void *data) { enum cds_conc_next_action action = CDS_NOP; cds_context_type *cds_ctx = (cds_context_type *)data; @@ -4063,7 +4063,7 @@ QDF_STATUS cds_init_policy_mgr(struct cds_sme_cbacks *sme_cbacks) * * Return: index in the connection table */ -uint32_t cds_get_connection_for_vdev_id(uint32_t vdev_id) +static uint32_t cds_get_connection_for_vdev_id(uint32_t vdev_id) { uint32_t conn_index = 0; for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS; @@ -4408,6 +4408,7 @@ QDF_STATUS cds_decr_connection_count(uint32_t vdev_id) * * Return: QDF_STATUS */ +static QDF_STATUS cds_get_connection_channels(uint8_t *channels, uint32_t *len, enum cds_pcl_channel_order order, bool skip_dfs_channel, @@ -4619,10 +4620,11 @@ void cds_update_with_safe_channel_list(uint8_t *pcl_channels, uint32_t *len, * * Return: Channel List */ -QDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl, - uint8_t *pcl_channels, uint32_t *len, - enum cds_con_mode mode, - uint8_t *pcl_weights, uint32_t weight_len) +static QDF_STATUS cds_get_channel_list(enum cds_pcl_type pcl, + uint8_t *pcl_channels, uint32_t *len, + enum cds_con_mode mode, + uint8_t *pcl_weights, + uint32_t weight_len) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t num_channels = WNI_CFG_VALID_CHANNEL_LIST_LEN; @@ -5136,7 +5138,7 @@ QDF_STATUS cds_get_pcl(enum cds_con_mode mode, * * Return: True/False */ -bool cds_disallow_mcc(uint8_t channel) +static bool cds_disallow_mcc(uint8_t channel) { uint32_t index = 0; bool match = false; @@ -5171,7 +5173,8 @@ bool cds_disallow_mcc(uint8_t channel) * * Return: True/False */ -bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections) +static bool cds_allow_new_home_channel(uint8_t channel, + uint32_t num_connections) { bool status = true; @@ -5246,7 +5249,7 @@ bool cds_is_ibss_conn_exist(uint8_t *ibss_channel) * * Return: true if vht160 connection exist else false */ -bool cds_vht160_conn_exist(void) +static bool cds_vht160_conn_exist(void) { uint32_t conn_index; bool status = false; @@ -6123,9 +6126,9 @@ done: * * Return: None */ -void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, - uint8_t next_action, - enum sir_conn_update_reason reason) +static void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, + uint8_t next_action, + enum sir_conn_update_reason reason) { cds_context_type *cds_ctx; uint32_t conn_index = 0; @@ -6172,9 +6175,9 @@ void cds_nss_update_cb(void *context, uint8_t tx_status, uint8_t vdev_id, * * Return: QDF_STATUS enum */ -QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action, - enum sir_conn_update_reason reason, - uint32_t session_id) +static QDF_STATUS cds_complete_action(uint8_t new_nss, uint8_t next_action, + enum sir_conn_update_reason reason, + uint32_t session_id) { QDF_STATUS status = QDF_STATUS_E_FAILURE; uint32_t index, count; @@ -8146,7 +8149,7 @@ QDF_STATUS qdf_init_connection_update(void) * Return: No change (CDS_NOP), MCC (CDS_SINGLE_MAC_UPGRADE), * DBS (CDS_DBS_DOWNGRADE) */ -enum cds_conc_next_action cds_get_current_pref_hw_mode(void) +static enum cds_conc_next_action cds_get_current_pref_hw_mode(void) { uint32_t num_connections; uint8_t band1, band2, band3; diff --git a/core/cds/src/cds_utils.c b/core/cds/src/cds_utils.c index 67d6d3f2494f..5ae79e495d9e 100644 --- a/core/cds/src/cds_utils.c +++ b/core/cds/src/cds_utils.c @@ -607,7 +607,7 @@ static void hmac_sha1_complete(struct crypto_async_request *req, int err) complete(&r->completion); } -int +static int hmac_sha1(uint8_t *key, uint8_t ksize, char *plaintext, uint8_t psize, uint8_t *output, uint8_t outlen) { @@ -768,7 +768,7 @@ static void hmac_md5_complete(struct crypto_async_request *req, int err) complete(&r->completion); } -int +static int hmac_md5(uint8_t *key, uint8_t ksize, char *plaintext, uint8_t psize, uint8_t *output, uint8_t outlen) { From 0d3a9d2a180369b25e0bec1d18ea8f8fb4a87ac2 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 09:17:31 -0700 Subject: [PATCH 087/113] qcacld-3.0: Remove unused functions from cds_regdomain.c Functions get_reg_dmn_for_country & cds_get_reg_dmn_5g are no longer being used, so remove them. Change-Id: I03308f6fd7802acf7e80c01f15f42c99bb77ce7e CRs-Fixed: 1075544 --- core/cds/src/cds_regdomain.c | 41 ------------------------------------ 1 file changed, 41 deletions(-) diff --git a/core/cds/src/cds_regdomain.c b/core/cds/src/cds_regdomain.c index e798389a5dd7..d8b90e47eb6c 100644 --- a/core/cds/src/cds_regdomain.c +++ b/core/cds/src/cds_regdomain.c @@ -691,25 +691,6 @@ int32_t cds_fill_some_regulatory_info(struct regulatory *reg) return 0; } -/** - * get_reg_dmn_for_country() - get regulatory domain for country - * @alpha2: country alpha2 - * - * Return: regulatory domain - */ -int32_t get_reg_dmn_for_country(uint8_t *alpha2) -{ - uint8_t i; - - for (i = 0; i < g_reg_dmn_tbl.all_countries_cnt; i++) { - if ((g_reg_dmn_tbl.all_countries[i].alpha2[0] == alpha2[0]) && - (g_reg_dmn_tbl.all_countries[i].alpha2[1] == alpha2[1])) - return g_reg_dmn_tbl.all_countries[i].reg_dmn_pair; - } - - return -1; -} - /** * cds_fill_and_send_ctl_to_fw() - fill and send ctl to firmware * @reg: the regulatory handle @@ -778,28 +759,6 @@ void cds_set_wma_dfs_region(uint8_t dfs_region) wma_set_dfs_region(wma, dfs_region); } -/** - * cds_get_reg_dmn_5g() - get the 5G reg-domain - * @reg_dmn: the complete reg domain - * - * Return: 5 G reg domain - */ -uint16_t cds_get_reg_dmn_5g(uint32_t reg_dmn) -{ - uint16_t i; - - for (i = 0; i < g_reg_dmn_tbl.reg_dmn_pairs_cnt; i++) { - if (g_reg_dmn_tbl.reg_dmn_pairs[i].reg_dmn_pair == reg_dmn) - return g_reg_dmn_tbl.reg_dmn_pairs[i].reg_dmn_5ghz; - } - - QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR, - "invalid regulatory domain/country code 0x%x", - reg_dmn); - - return 0; -} - /** * cds_reg_dmn_get_chanwidth_from_opclass() - return chan width based on opclass * @country: country name From b7102417bf36b75656d57d5f188b66fe2e6e098d Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 11 Oct 2016 10:06:14 -0700 Subject: [PATCH 088/113] Release 5.1.0.30H Release 5.1.0.30H Change-Id: I4f0f44bc22903fb4403c4794bd1b73109d9f6493 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 7dd8a95dbf7f..58e71043df8d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "G" +#define QWLAN_VERSION_EXTRA "H" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30G" +#define QWLAN_VERSIONSTR "5.1.0.30H" #endif /* QWLAN_VERSION_H */ From 10a7b71eccd55594d73eb66df47da3f7eb5895f5 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Fri, 7 Oct 2016 10:31:16 -0700 Subject: [PATCH 089/113] qcacld-3.0: Cleanup qpower vendor command The original qpower vendor command implementation incorrectly configured the qpower setting in firmware. Cleanup the implementation. Change-Id: Id84eb7cf579a29da30f3366edef24821fcd5be55 CRs-Fixed: 1075582 --- core/hdd/src/wlan_hdd_cfg80211.c | 2 +- core/hdd/src/wlan_hdd_power.c | 31 +++++++++---------------------- core/wma/inc/wma_api.h | 10 +++++++++- core/wma/src/wma_power.c | 24 +++++++++--------------- 4 files changed, 28 insertions(+), 39 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index ae1d71d7bf2b..eb8fedd49527 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -3933,7 +3933,7 @@ __wlan_hdd_cfg80211_wifi_configuration_set(struct wiphy *wiphy, u32 guard_time; uint8_t set_value; u32 ftm_capab; - uint8_t qpower; + u8 qpower; QDF_STATUS status; int attr_len; int access_policy = 0; diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 0efc8cbf05d9..55caa12744d3 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2343,40 +2343,27 @@ int wlan_hdd_cfg80211_get_txpower(struct wiphy *wiphy, * Return: 0 on success; Errno on failure */ int hdd_set_qpower_config(hdd_context_t *hddctx, hdd_adapter_t *adapter, - uint8_t qpower) + u8 qpower) { - QDF_STATUS qdf_status; - int status; - bool is_timer_running; + QDF_STATUS status; if (!hddctx->config->enablePowersaveOffload) { hdd_err("qpower is disabled in configuration"); return -EINVAL; } + if (qpower > PS_DUTY_CYCLING_QPOWER || qpower < PS_LEGACY_NODEEPSLEEP) { - hdd_err("invalid qpower value=%d", qpower); + hdd_err("invalid qpower value: %d", qpower); return -EINVAL; } - hdd_info("updating qpower value=%d to wma", qpower); - qdf_status = wma_set_powersave_config(qpower); - if (qdf_status != QDF_STATUS_SUCCESS) { - hdd_err("failed to update qpower %d", - qdf_status); - return -EINVAL; - } - is_timer_running = sme_is_auto_ps_timer_running( - WLAN_HDD_GET_HAL_CTX(adapter), - adapter->sessionId); - if (!is_timer_running) { - status = wlan_hdd_set_powersave(adapter, true, 0); - if (status != 0) { - hdd_err("failed to put device in power save mode %d", - status); - return -EINVAL; - } + status = wma_set_qpower_config(adapter->sessionId, qpower); + if (status != QDF_STATUS_SUCCESS) { + hdd_err("failed to configure qpower: %d", status); + return -EINVAL; } + return 0; } diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 890622b424e2..58d34ec38724 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -299,7 +299,6 @@ void wma_process_pdev_hw_mode_trans_ind(void *wma, wmi_pdev_hw_mode_transition_event_fixed_param *fixed_param, wmi_pdev_set_hw_mode_response_vdev_mac_entry *vdev_mac_entry, struct sir_hw_mode_trans_ind *hw_mode_trans_ind); -QDF_STATUS wma_set_powersave_config(uint8_t val); QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma, struct encrypt_decrypt_req_params *encrypt_decrypt_params); @@ -317,4 +316,13 @@ QDF_STATUS wma_set_cts2self_for_p2p_go(void *wma_handle, uint32_t cts2self_for_p2p_go); QDF_STATUS wma_set_tx_rx_aggregation_size (struct sir_set_tx_rx_aggregation_size *tx_rx_aggregation_size); + +/** + * wma_set_qpower_config() - update qpower config in wma + * @vdev_id: the Id of the vdev to configure + * @qpower: new qpower value + * + * Return: QDF_STATUS_SUCCESS on success, error number otherwise + */ +QDF_STATUS wma_set_qpower_config(uint8_t vdev_id, uint8_t qpower); #endif diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index 4c139f7b186a..e939c5267597 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -856,27 +856,21 @@ void wma_disable_sta_ps_mode(tp_wma_handle wma, tpDisablePsParams ps_req) } } -/** - * wma_set_powersave_config() - update power save config in wma - * @val: new power save value - * - * This function update qpower value in wma layer - * - * Return: QDF_STATUS_SUCCESS on success, error number otherwise - */ -QDF_STATUS wma_set_powersave_config(uint8_t val) +QDF_STATUS wma_set_qpower_config(uint8_t vdev_id, uint8_t qpower) { - tp_wma_handle wma_handle; + tp_wma_handle wma = cds_get_context(QDF_MODULE_ID_WMA); - wma_handle = cds_get_context(QDF_MODULE_ID_WMA); - - if (!wma_handle) { + if (!wma) { WMA_LOGE("%s: WMA context is invald!", __func__); return QDF_STATUS_E_INVAL; } - wma_handle->powersave_mode = val; - return QDF_STATUS_SUCCESS; + WMA_LOGI("configuring qpower: %d", qpower); + wma->powersave_mode = qpower; + return wma_unified_set_sta_ps_param(wma->wmi_handle, + vdev_id, + WMI_STA_PS_ENABLE_QPOWER, + wma_get_qpower_config(wma)); } /** From b4cbcd54235848b37313cce2602a2137d9f74d33 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 11 Oct 2016 10:43:40 -0700 Subject: [PATCH 090/113] Release 5.1.0.30I Release 5.1.0.30I Change-Id: I6136df1242c6f94a3a95129cd58d118a25bf9c15 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 58e71043df8d..cbc7e60fe45a 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "H" +#define QWLAN_VERSION_EXTRA "I" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30H" +#define QWLAN_VERSIONSTR "5.1.0.30I" #endif /* QWLAN_VERSION_H */ From 5e06bd358d95b4f1060671331a8bdf506bfeab41 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 4 Oct 2016 12:49:10 -0700 Subject: [PATCH 091/113] qcacld-3.0: Null-check 5GHz band before configuration There is a null pointer dereference during 5GHz band configure when wifi mode is forced to 802.11b in the ini config file. Perform a null check before 5GHz configuration and skip if needed. Change-Id: I70b7576e7bf49fa66a8c88de49dad9a1643cc7cb CRs-Fixed: 1074146 --- core/hdd/src/wlan_hdd_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index e5bffbaec4f0..75c5aec1d67f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1001,6 +1001,11 @@ static void hdd_update_tgt_vht_cap(hdd_context_t *hdd_ctx, wiphy->bands[IEEE80211_BAND_5GHZ]; uint32_t temp = 0; + if (!band_5g) { + hdd_info("5GHz band disabled, skipping capability population"); + return; + } + /* Get the current MPDU length */ status = sme_cfg_get_int(hdd_ctx->hHal, WNI_CFG_VHT_MAX_MPDU_LENGTH, From d9d97ee5e5f9641b3df081a772367809011f2da5 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 11 Oct 2016 14:56:31 -0700 Subject: [PATCH 092/113] Release 5.1.0.30J Release 5.1.0.30J Change-Id: Ife2c057c1421e36ca09ae2cb14912e25a1cadf2d CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index cbc7e60fe45a..4536fd5f7cc1 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "I" +#define QWLAN_VERSION_EXTRA "J" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30I" +#define QWLAN_VERSIONSTR "5.1.0.30J" #endif /* QWLAN_VERSION_H */ From fdb73435f6ac3b2caed9a6ec45e815c531d1a645 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 11 Oct 2016 08:07:27 -0700 Subject: [PATCH 093/113] qcacld-3.0: Fix potential reference of uninitialized roam profile Currently in hdd_send_re_assoc_event() there are several guard tests which protect the function from executing unless all of the prerequisite information is present. If any of the tests fail then the code performs centralized cleanup. One of the cleanups performed is to free the roam profile. Unfortunately at the time most of the guard tests are performed the roam profile has not been retrieved from SME, and has not been initialized in any other way. This would ultimately result in csr_roam_free_connect_profile() reading "garbage" values for pBssDesc and pAddIEAssoc. Address this issue by relocating the existing qdf_mem_zero() of the roam profile so that the roam profile is initialized before any of the guard tests are performed. Change-Id: I2a2ba92ffb5b73c3ba4f54482d8f2b37f6e2dad6 CRs-Fixed: 1076422 --- core/hdd/src/wlan_hdd_assoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 09aab866e173..d8f35f4ecd79 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1900,6 +1900,8 @@ static void hdd_send_re_assoc_event(struct net_device *dev, tCsrRoamConnectedProfile roam_profile; tHalHandle hal_handle = WLAN_HDD_GET_HAL_CTX(pAdapter); + qdf_mem_zero(&roam_profile, sizeof(roam_profile)); + if (!rspRsnIe) { hdd_err("Unable to allocate RSN IE"); goto done; @@ -1951,7 +1953,6 @@ static void hdd_send_re_assoc_event(struct net_device *dev, chan = ieee80211_get_channel(pAdapter->wdev.wiphy, (int)pCsrRoamInfo->pBssDesc->channelId); - qdf_mem_zero(&roam_profile, sizeof(tCsrRoamConnectedProfile)); sme_roam_get_connect_profile(hal_handle, pAdapter->sessionId, &roam_profile); bss = cfg80211_get_bss(pAdapter->wdev.wiphy, chan, From a2c732086354f31c03fa18fa0b9448b974695b76 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 11 Oct 2016 17:12:50 -0700 Subject: [PATCH 094/113] Release 5.1.0.30K Release 5.1.0.30K Change-Id: I6de44b9fb375325101161ec8a9587591047c5d1a CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 4536fd5f7cc1..5b7338a51058 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "J" +#define QWLAN_VERSION_EXTRA "K" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30J" +#define QWLAN_VERSIONSTR "5.1.0.30K" #endif /* QWLAN_VERSION_H */ From 414e9f39a1cfc76ccacdad79bd017b6739baf52c Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Wed, 5 Oct 2016 15:46:19 -0700 Subject: [PATCH 095/113] qcacld-3.0: Fix -Wmissing-prototypes in wlan_hdd_tdls We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in wlan_hdd_tdls. Change-Id: I27b2be04166a61579d0013766094c660cff304e2 CRs-Fixed: 1074336 --- core/hdd/inc/wlan_hdd_tdls.h | 2 +- core/hdd/src/wlan_hdd_tdls.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 7fa22b27002d..ca4d30cdb2c7 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -567,7 +567,7 @@ void wlan_hdd_tdls_disconnection_callback(hdd_adapter_t *pAdapter); void wlan_hdd_tdls_mgmt_completion_callback(hdd_adapter_t *pAdapter, uint32_t statusCode); -void wlan_hdd_tdls_tncrement_peer_count(hdd_adapter_t *pAdapter); +void wlan_hdd_tdls_increment_peer_count(hdd_adapter_t *pAdapter); void wlan_hdd_tdls_decrement_peer_count(hdd_adapter_t *pAdapter); diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 4abe1fef943f..a433ab503abf 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -1621,8 +1621,8 @@ static void wlan_hdd_tdls_implicit_enable(tdlsCtx_t *pHddTdlsCtx) * * Return: Void */ -void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, - eTDLSSupportMode tdls_mode, bool bUpdateLast) +static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx, + eTDLSSupportMode tdls_mode, bool bUpdateLast) { hdd_adapter_list_node_t *pAdapterNode = NULL, *pNext = NULL; QDF_STATUS status; From 7e5ac8eb10b25e2d0e0f555b0fbd3966719f505c Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 6 Oct 2016 18:37:52 -0700 Subject: [PATCH 096/113] qcacld-3.0: Fix -Wmissing-prototypes in cfg_api We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in cfg_api. Change-Id: I6c282c78da047a9979b90c52fdcfd7b1b7b3b46e CRs-Fixed: 1075090 --- core/mac/src/cfg/cfg_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/cfg/cfg_api.c b/core/mac/src/cfg/cfg_api.c index c351063cff4c..8b15ba20a42f 100644 --- a/core/mac/src/cfg/cfg_api.c +++ b/core/mac/src/cfg/cfg_api.c @@ -71,7 +71,7 @@ uint32_t cfg_need_restart(tpAniSirGlobal pMac, uint16_t cfgId) return !!(pMac->cfg.gCfgEntry[cfgId].control & CFG_CTL_RESTART); } -void cfg_get_strindex(tpAniSirGlobal pMac, uint16_t cfgId) +static void cfg_get_strindex(tpAniSirGlobal pMac, uint16_t cfgId) { uint16_t i = 0; From 9902821db328ba97f55f2a6f9de92835a9f3bdd4 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 6 Oct 2016 18:39:59 -0700 Subject: [PATCH 097/113] qcacld-3.0: Fix -Wmissing-prototypes in dph_hash_table We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in dph_hash_table. Change-Id: I9513060929343a61c329e55e15f7e6ec18d1e166 CRs-Fixed: 1075090 --- core/mac/src/dph/dph_hash_table.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/mac/src/dph/dph_hash_table.c b/core/mac/src/dph/dph_hash_table.c index 6ff817c03b5d..ae22dd7973fb 100644 --- a/core/mac/src/dph/dph_hash_table.c +++ b/core/mac/src/dph/dph_hash_table.c @@ -96,7 +96,8 @@ void dph_hash_table_class_init(tpAniSirGlobal pMac, * @return None */ -uint16_t hash_function(tpAniSirGlobal pMac, uint8_t staAddr[], uint16_t numSta) +static uint16_t hash_function(tpAniSirGlobal pMac, uint8_t staAddr[], + uint16_t numSta) { int i; uint16_t sum = 0; From b9f21bca25df40033925cbf9473a8440cf516a03 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 6 Oct 2016 18:42:43 -0700 Subject: [PATCH 098/113] qcacld-3.0: Fix -Wmissing-prototypes in lim_admit_control We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_admit_control. Change-Id: Ic2ff63f07d59d7242f0c37917201f239b00dfe37 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_admit_control.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/mac/src/pe/lim/lim_admit_control.c b/core/mac/src/pe/lim/lim_admit_control.c index a0644c3938c0..2ed47a0ab019 100644 --- a/core/mac/src/pe/lim/lim_admit_control.c +++ b/core/mac/src/pe/lim/lim_admit_control.c @@ -43,6 +43,7 @@ #include "lim_trace.h" #include "lim_send_sme_rsp_messages.h" #include "lim_types.h" +#include "lim_admit_control.h" #define ADMIT_CONTROL_LOGLEVEL LOG1 #define ADMIT_CONTROL_POLICY_LOGLEVEL LOG1 @@ -348,8 +349,9 @@ lim_admit_policy_oversubscription(tpAniSirGlobal mac_ctx, \return eSirRetStatus - status -------------------------------------------------------------*/ -tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac, - tSirMacTspecIE *pTspec, tpPESession psessionEntry) +static tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac, + tSirMacTspecIE *pTspec, + tpPESession psessionEntry) { tSirRetStatus retval = eSIR_FAILURE; tpLimAdmitPolicyInfo pAdmitPolicy = &pMac->lim.admitPolicyInfo; @@ -395,7 +397,7 @@ tSirRetStatus lim_admit_policy(tpAniSirGlobal pMac, /* ----------------------------------------------------------------------------- */ /* delete the specified tspec */ -void lim_tspec_delete(tpAniSirGlobal pMac, tpLimTspecInfo pInfo) +static void lim_tspec_delete(tpAniSirGlobal pMac, tpLimTspecInfo pInfo) { if (pInfo == NULL) return; @@ -500,7 +502,7 @@ lim_tspec_find_by_assoc_id(tpAniSirGlobal pMac, \return eSirRetStatus - status of the comparison -------------------------------------------------------------*/ -tSirRetStatus +static tSirRetStatus lim_find_tspec(tpAniSirGlobal pMac, uint16_t assocId, tSirMacTSInfo *pTsInfo, From 72c8e7c7e4cf8a7a529c99256c060d1fa27725d1 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 6 Oct 2016 18:43:52 -0700 Subject: [PATCH 099/113] qcacld-3.0: Fix -Wmissing-prototypes in lim_assoc_utils We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_assoc_utils. Change-Id: I28ac7560d042f4d81560d3bbeea8ac18beb5e453 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_assoc_utils.c | 14 +++++++------- core/mac/src/pe/lim/lim_assoc_utils.h | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 4aae611d0787..6fef5dca4475 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -1214,10 +1214,10 @@ lim_decide_ap_protection_on_delete(tpAniSirGlobal mac_ctx, * * Return: None */ -void lim_decide_short_preamble(tpAniSirGlobal mac_ctx, - tpDphHashNode sta_ds, - tpUpdateBeaconParams beacon_params, - tpPESession session_entry) +static void lim_decide_short_preamble(tpAniSirGlobal mac_ctx, + tpDphHashNode sta_ds, + tpUpdateBeaconParams beacon_params, + tpPESession session_entry) { uint32_t i; @@ -1270,7 +1270,7 @@ void lim_decide_short_preamble(tpAniSirGlobal mac_ctx, * the BSS. * Return: None */ -void +static void lim_decide_short_slot(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds, tpUpdateBeaconParams beacon_params, tpPESession session_entry) @@ -3403,7 +3403,7 @@ lim_del_bss(tpAniSirGlobal pMac, tpDphHashNode pStaDs, uint16_t bssIdx, * * Return : void */ -void lim_update_vhtcaps_assoc_resp(tpAniSirGlobal mac_ctx, +static void lim_update_vhtcaps_assoc_resp(tpAniSirGlobal mac_ctx, tpAddBssParams pAddBssParams, tDot11fIEVHTCaps *vht_caps, tpPESession psessionEntry) { @@ -3466,7 +3466,7 @@ void lim_update_vhtcaps_assoc_resp(tpAniSirGlobal mac_ctx, * * Return : void */ -void lim_update_vht_oper_assoc_resp(tpAniSirGlobal mac_ctx, +static void lim_update_vht_oper_assoc_resp(tpAniSirGlobal mac_ctx, tpAddBssParams pAddBssParams, tDot11fIEVHTOperation *vht_oper, tpPESession psessionEntry) { diff --git a/core/mac/src/pe/lim/lim_assoc_utils.h b/core/mac/src/pe/lim/lim_assoc_utils.h index 9e605f16dfa6..80f12be984a0 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.h +++ b/core/mac/src/pe/lim/lim_assoc_utils.h @@ -219,4 +219,10 @@ static inline void lim_send_sme_tsm_ie_ind(tpAniSirGlobal pMac, {} #endif /* FEATURE_WLAN_ESE */ +tSirRetStatus lim_populate_vht_mcs_set(tpAniSirGlobal pMac, + tpSirSupportedRates pRates, + tDot11fIEVHTCaps *pPeerVHTCaps, + tpPESession psessionEntry, + uint8_t nss); + #endif /* __LIM_ASSOC_UTILS_H */ From 5948a1869e19fb6c4e76822e13ae3638aeb58693 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Thu, 6 Oct 2016 18:47:06 -0700 Subject: [PATCH 100/113] qcacld-3.0: Fix -Wmissing-prototypes in lim_ibss_peer_mgmt We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_ibss_peer_mgmt. Change-Id: I399108d2e880631f60afec51d2c6472d623f907d CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_ibss_peer_mgmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c index c6a14ad1df4e..fe04d3f6b952 100644 --- a/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c +++ b/core/mac/src/pe/lim/lim_ibss_peer_mgmt.c @@ -668,7 +668,8 @@ void lim_ibss_init(tpAniSirGlobal pMac) * @return None */ -void lim_ibss_delete_all_peers(tpAniSirGlobal pMac, tpPESession psessionEntry) +static void lim_ibss_delete_all_peers(tpAniSirGlobal pMac, + tpPESession psessionEntry) { tLimIbssPeerNode *pCurrNode, *pTempNode; tpDphHashNode pStaDs; From d3d4b6af4cee16bca52bb78a3720282747e26551 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 7 Oct 2016 07:23:40 -0700 Subject: [PATCH 101/113] qcacld-3.0: Fix -Wmissing-prototypes in lim_process_assoc_rsp_frame We want to enable the compiler's -Wmissing-prototypes switch, but there is existing code that is generating warnings. Fix all warnings in lim_process_assoc_rsp_frame. Change-Id: I232343baf74227d525f1004ab2d57fd3d68702d4 CRs-Fixed: 1075090 --- core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c index 81f8714bfab8..359991de6e14 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_rsp_frame.c @@ -473,7 +473,7 @@ static void lim_update_stads_ext_cap(tpAniSirGlobal mac_ctx, * * Return: None */ -void lim_stop_reassoc_retry_timer(tpAniSirGlobal mac_ctx) +static void lim_stop_reassoc_retry_timer(tpAniSirGlobal mac_ctx) { mac_ctx->lim.reAssocRetryAttempt = 0; if ((NULL != mac_ctx->lim.pSessionEntry) From 901d75a1a14a0e13b68067636b8a11abf0a9955c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Tue, 11 Oct 2016 23:47:21 -0700 Subject: [PATCH 102/113] Release 5.1.0.30L Release 5.1.0.30L Change-Id: I3f16e78cf03ed587ec6c7482c76164f61431640b CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 5b7338a51058..c730c5a56a0b 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "K" +#define QWLAN_VERSION_EXTRA "L" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30K" +#define QWLAN_VERSIONSTR "5.1.0.30L" #endif /* QWLAN_VERSION_H */ From 3370212bf797e4131f077b552abc877fdb349fb2 Mon Sep 17 00:00:00 2001 From: Hanumanth Reddy Pothula Date: Fri, 7 Oct 2016 17:27:04 +0530 Subject: [PATCH 103/113] qcacld-3.0: Invalidate session ID after successful session close Presently, host sets session ID to invalid(0xFF) once it posts the message for sme to close session. During the close session if there are any north bound command pending in queue, Host is sending the command with invalid session ID to firmware, leading to device crash. Set session ID to invalid only once sme session is closed. Change-Id: Ib8a6a8e8a8af842064f6500b4bb62266eae7c1f8 CRs-Fixed: 1074111 --- core/hdd/src/wlan_hdd_hostapd.c | 1 + core/hdd/src/wlan_hdd_main.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 559a6717f3e9..bf299934952b 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -7674,6 +7674,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy, global_p2p_connection_status = P2P_NOT_ACTIVE; } #endif + pAdapter->sessionId = HDD_SESSION_ID_INVALID; EXIT(); return ret; } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 75c5aec1d67f..bfbee90dfc03 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3463,7 +3463,6 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, sme_close_session(hdd_ctx->hHal, adapter->sessionId, hdd_sme_close_session_callback, adapter)) { - adapter->sessionId = HDD_SESSION_ID_INVALID; /* * Block on a completion variable. Can't wait * forever though. @@ -3477,7 +3476,9 @@ static void hdd_wait_for_sme_close_sesion(hdd_context_t *hdd_ctx, if (adapter->device_mode == QDF_NDI_MODE) hdd_ndp_session_end_handler(adapter); clear_bit(SME_SESSION_OPENED, &adapter->event_flags); + return; } + adapter->sessionId = HDD_SESSION_ID_INVALID; } } From 0b18c45266361e0cd88be707b80e4ddb67b8b939 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 00:45:07 -0700 Subject: [PATCH 104/113] Release 5.1.0.30M Release 5.1.0.30M Change-Id: I82211cf75cc0b990207306bffbeb5d2836308d8c CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index c730c5a56a0b..b71ff74a2e42 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "L" +#define QWLAN_VERSION_EXTRA "M" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30L" +#define QWLAN_VERSIONSTR "5.1.0.30M" #endif /* QWLAN_VERSION_H */ From 476deeb893c9917c2c2849ec5d57334fa59d2471 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 19 Jul 2016 16:21:29 -0700 Subject: [PATCH 105/113] qcacld-3.0: Fix buffer overwrite problem in CCXBEACONREQ This is a propagation from qcacld-2.0 to qcacld-3.0. Set the number of IE fields to minimum of input data and SIR_ESE_MAX_MEAS_IE_REQS Change-Id: Ie53cfec7872ab69530bbb8932f9f9e85fb319f92 CRs-Fixed: 993561 --- core/hdd/src/wlan_hdd_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 61c1a77aec74..a45115aa7185 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -2642,7 +2642,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if ('\0' == *inPtr) return -EINVAL; - /* get the first argument ie measurement token */ + /* Getting the first argument ie Number of IE fields */ v = sscanf(inPtr, "%31s ", buf); if (1 != v) return -EINVAL; @@ -2651,10 +2651,10 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if (v < 0) return -EINVAL; + tempInt = QDF_MIN(tempInt, SIR_ESE_MAX_MEAS_IE_REQS); pEseBcnReq->numBcnReqIe = tempInt; - hdd_info("Number of Bcn Req Ie fields(%d)", - pEseBcnReq->numBcnReqIe); + hdd_info("Number of Bcn Req Ie fields: %d", pEseBcnReq->numBcnReqIe); for (j = 0; j < (pEseBcnReq->numBcnReqIe); j++) { for (i = 0; i < 4; i++) { From d79b3454965ff4847de828385dd6919280979b93 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 19 Jul 2016 18:39:46 -0700 Subject: [PATCH 106/113] qcacld-3.0: Add back these ese functions Due to incorrect merge resolve, these functions got removed. Add the functions back. Change-Id: I5bdaab2e93d221ca15179d8b35e9a86619e9b489 CRs-Fixed: 950762 --- core/hdd/src/wlan_hdd_ioctl.c | 125 +++++++++++++++++++++++++++++++++- 1 file changed, 124 insertions(+), 1 deletion(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index a45115aa7185..4f5c3bb0db13 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -5548,6 +5548,127 @@ static int drv_cmd_ccx_beacon_req(hdd_adapter_t *adapter, goto exit; } +exit: + return ret; +} + +/** + * drv_cmd_ccx_plm_req() - Set ESE PLM request + * @adapter: Pointer to the HDD adapter + * @hdd_ctx: Pointer to the HDD context + * @command: Driver command string + * @command_len: Driver command string length + * @priv_data: Private data coming with the driver command. Unused here + * + * This function handles driver command that sets the ESE PLM request + * + * Return: 0 on success; negative errno otherwise + */ +static int drv_cmd_ccx_plm_req(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + uint8_t *command, + uint8_t command_len, + hdd_priv_data_t *priv_data) +{ + int ret = 0; + uint8_t *value = command; + QDF_STATUS status = QDF_STATUS_SUCCESS; + tpSirPlmReq pPlmRequest = NULL; + + pPlmRequest = qdf_mem_malloc(sizeof(tSirPlmReq)); + if (NULL == pPlmRequest) { + ret = -ENOMEM; + goto exit; + } + + status = hdd_parse_plm_cmd(value, pPlmRequest); + if (QDF_STATUS_SUCCESS != status) { + qdf_mem_free(pPlmRequest); + pPlmRequest = NULL; + ret = -EINVAL; + goto exit; + } + pPlmRequest->sessionId = adapter->sessionId; + + status = sme_set_plm_request(hdd_ctx->hHal, pPlmRequest); + if (QDF_STATUS_SUCCESS != status) { + qdf_mem_free(pPlmRequest); + pPlmRequest = NULL; + ret = -EINVAL; + goto exit; + } + +exit: + return ret; +} + +/** + * drv_cmd_set_ccx_mode() - Set ESE mode + * @adapter: Pointer to the HDD adapter + * @hdd_ctx: Pointer to the HDD context + * @command: Driver command string + * @command_len: Driver command string length + * @priv_data: Private data coming with the driver command. Unused here + * + * This function handles driver command that sets ESE mode + * + * Return: 0 on success; negative errno otherwise + */ +static int drv_cmd_set_ccx_mode(hdd_adapter_t *adapter, + hdd_context_t *hdd_ctx, + uint8_t *command, + uint8_t command_len, + hdd_priv_data_t *priv_data) +{ + int ret = 0; + uint8_t *value = command; + uint8_t eseMode = CFG_ESE_FEATURE_ENABLED_DEFAULT; + + /* + * Check if the features OKC/ESE/11R are supported simultaneously, + * then this operation is not permitted (return FAILURE) + */ + if (sme_get_is_ese_feature_enabled(hdd_ctx->hHal) && + hdd_is_okc_mode_enabled(hdd_ctx) && + sme_get_is_ft_feature_enabled(hdd_ctx->hHal)) { + hdd_warn("OKC/ESE/11R are supported simultaneously hence this operation is not permitted!"); + ret = -EPERM; + goto exit; + } + + /* Move pointer to ahead of SETCCXMODE */ + value = value + command_len + 1; + + /* Convert the value from ascii to integer */ + ret = kstrtou8(value, 10, &eseMode); + if (ret < 0) { + /* + * If the input value is greater than max value of datatype, + * then also kstrtou8 fails + */ + hdd_err("kstrtou8 failed range [%d - %d]", + CFG_ESE_FEATURE_ENABLED_MIN, + CFG_ESE_FEATURE_ENABLED_MAX); + ret = -EINVAL; + goto exit; + } + + if ((eseMode < CFG_ESE_FEATURE_ENABLED_MIN) || + (eseMode > CFG_ESE_FEATURE_ENABLED_MAX)) { + hdd_err("Ese mode value %d is out of range (Min: %d Max: %d)", + eseMode, + CFG_ESE_FEATURE_ENABLED_MIN, + CFG_ESE_FEATURE_ENABLED_MAX); + ret = -EINVAL; + goto exit; + } + hdd_info("Received Command to change ese mode = %d", eseMode); + + hdd_ctx->config->isEseIniFeatureEnabled = eseMode; + sme_update_is_ese_feature_enabled(hdd_ctx->hHal, + adapter->sessionId, + eseMode); + exit: return ret; } @@ -7036,7 +7157,9 @@ static const hdd_drv_cmd_t hdd_drv_cmds[] = { {"SETCCXROAMSCANCHANNELS", drv_cmd_set_ccx_roam_scan_channels}, {"GETTSMSTATS", drv_cmd_get_tsm_stats}, {"SETCCKMIE", drv_cmd_set_cckm_ie}, - {"CCXBEACONREQ", drv_cmd_ccx_beacon_req}, + {"CCXBEACONREQ", drv_cmd_ccx_beacon_req}, + {"CCXPLMREQ", drv_cmd_ccx_plm_req}, + {"SETCCXMODE", drv_cmd_set_ccx_mode}, #endif /* FEATURE_WLAN_ESE */ {"SETMCRATE", drv_cmd_set_mc_rate}, {"MAXTXPOWER", drv_cmd_max_tx_power}, From 67e2da67cb054953463b7162e33d95afbc5fc1c9 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Tue, 19 Jul 2016 16:33:01 -0700 Subject: [PATCH 107/113] qcacld-3.0: Validate CCXBEACONREQ IE fields This is a qcacld-2.0 to qcacld-3.0 propagation. Validate CCXBEACONREQ IE fields. Change-Id: Ie64a642abdd7923e91801186aa5743094a739fc9 CRs-Fixed: 1025185 --- core/hdd/src/wlan_hdd_ioctl.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 4f5c3bb0db13..fd4def55ed73 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -2620,7 +2620,8 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, tCsrEseBeaconReq *pEseBcnReq) { uint8_t *inPtr = pValue; - int tempInt = 0; + uint8_t input = 0; + uint32_t tempInt = 0; int j = 0, i = 0, v = 0; char buf[32]; @@ -2647,12 +2648,12 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if (1 != v) return -EINVAL; - v = kstrtos32(buf, 10, &tempInt); + v = kstrtou8(buf, 10, &input); if (v < 0) return -EINVAL; - tempInt = QDF_MIN(tempInt, SIR_ESE_MAX_MEAS_IE_REQS); - pEseBcnReq->numBcnReqIe = tempInt; + input = QDF_MIN(input, SIR_ESE_MAX_MEAS_IE_REQS); + pEseBcnReq->numBcnReqIe = input; hdd_info("Number of Bcn Req Ie fields: %d", pEseBcnReq->numBcnReqIe); @@ -2683,14 +2684,14 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, if (1 != v) return -EINVAL; - v = kstrtos32(buf, 10, &tempInt); + v = kstrtou32(buf, 10, &tempInt); if (v < 0) return -EINVAL; switch (i) { case 0: /* Measurement token */ - if (tempInt <= 0) { - hdd_err("Invalid Measurement Token(%d)", + if (!tempInt) { + hdd_err("Invalid Measurement Token: %u", tempInt); return -EINVAL; } @@ -2699,10 +2700,10 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, break; case 1: /* Channel number */ - if ((tempInt <= 0) || + if (!tempInt || (tempInt > WNI_CFG_CURRENT_CHANNEL_STAMAX)) { - hdd_err("Invalid Channel Number(%d)", + hdd_err("Invalid Channel Number: %u", tempInt); return -EINVAL; } @@ -2712,7 +2713,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, case 2: /* Scan mode */ if ((tempInt < eSIR_PASSIVE_SCAN) || (tempInt > eSIR_BEACON_TABLE)) { - hdd_err("Invalid Scan Mode(%d) Expected{0|1|2}", + hdd_err("Invalid Scan Mode: %u Expected{0|1|2}", tempInt); return -EINVAL; } @@ -2720,13 +2721,12 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, break; case 3: /* Measurement duration */ - if (((tempInt <= 0) + if ((!tempInt && (pEseBcnReq->bcnReq[j].scanMode != eSIR_BEACON_TABLE)) || - ((tempInt < 0) && - (pEseBcnReq->bcnReq[j].scanMode == - eSIR_BEACON_TABLE))) { - hdd_err("Invalid Measurement Duration(%d)", + (pEseBcnReq->bcnReq[j].scanMode == + eSIR_BEACON_TABLE)) { + hdd_err("Invalid Measurement Duration: %u", tempInt); return -EINVAL; } @@ -2738,7 +2738,7 @@ static int hdd_parse_ese_beacon_req(uint8_t *pValue, } for (j = 0; j < pEseBcnReq->numBcnReqIe; j++) { - hdd_info("Index(%d) Measurement Token(%u) Channel(%u) Scan Mode(%u) Measurement Duration(%u)", + hdd_info("Index: %d Measurement Token: %u Channel: %u Scan Mode: %u Measurement Duration: %u", j, pEseBcnReq->bcnReq[j].measurementToken, pEseBcnReq->bcnReq[j].channel, From ca42292f2b0ae7dff67905aff60459db81967bc8 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Wed, 17 Aug 2016 18:29:42 -0700 Subject: [PATCH 108/113] qcacld-3.0: Update get_concurrency_matrix to advertise STA + NAN This is a qcacld-2.0 to qcacld-3.0 propagation. Update the get_concurrency_matrix API to advertise the support for STA + NAN concurrency. Change-Id: Ie178cdb8c01294ef103baebfd7805d80e4c3c3be CRs-Fixed: 987047 --- core/hdd/src/wlan_hdd_cfg80211.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index eb8fedd49527..8e18bcd66c0b 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2068,11 +2068,13 @@ static int __wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy, /* Fill feature combination matrix */ feature_sets = 0; feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | - WIFI_FEATURE_P2P; + WIFI_FEATURE_P2P; + feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA | + WIFI_FEATURE_NAN; /* Add more feature combinations here */ feature_sets = QDF_MIN(feature_sets, max_feature_sets); - hdd_info("Number of feature sets:%d", feature_sets); + hdd_info("Number of feature sets: %d", feature_sets); hdd_info("Feature set matrix"); for (i = 0; i < feature_sets; i++) hdd_info("[%d] 0x%02X", i, feature_set_matrix[i]); From 29ac683dd2726d3f9a7d4076cba973b5993abf8c Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 01:25:12 -0700 Subject: [PATCH 109/113] Release 5.1.0.30N Release 5.1.0.30N Change-Id: I9de09b7de2a7f9751428a08d3a3fea5cd1201abf CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index b71ff74a2e42..1f624b087c76 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "M" +#define QWLAN_VERSION_EXTRA "N" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30M" +#define QWLAN_VERSIONSTR "5.1.0.30N" #endif /* QWLAN_VERSION_H */ From 0be56dfdbcc3f8d720910db5fdea2125160dac4e Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Sirasanagandla Date: Thu, 8 Sep 2016 19:19:47 +0530 Subject: [PATCH 110/113] qcacld-3.0: Add ini to configure RTS profiles to FW qcacld-2.0 to qcacld-3.0 propagation INI parameter to configure different RTS profiles to firmware during wlan startup. Based on this value the FW shall configure any of the following parameters: - RTSCTS_DISABLED - RTSCTS_ENABLED_4_SECOND_RATESERIES - CTS2SELF_ENABLED_4_SECOND_RATESERIES - RTSCTS_ENABLED_4_SWRETRIES - CTS2SELF_ENABLED_4_SWRETRIES Change-Id: Id2a9d64e626288920e0d0a73badca9f9e241decb CRs-Fixed: 940886 --- core/hdd/inc/wlan_hdd_cfg.h | 18 ++++++++++++++++++ core/hdd/src/wlan_hdd_cfg.c | 7 +++++++ core/hdd/src/wlan_hdd_main.c | 9 +++++++++ 3 files changed, 34 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index 4ba70e7ca1cb..c3cead689893 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1279,6 +1279,21 @@ typedef enum { #define CFG_ENABLE_FW_MODULE_LOG_LEVEL "gFwDebugModuleLoglevel" #define CFG_ENABLE_FW_MODULE_LOG_DEFAULT "" +/* + * gEnableRTSProfiles for configuring different RTS profiles + * to firmware. + * Following are the valid values for the rtsprofile: + * RTSCTS_DISABLED 0 + * RTSCTS_ENABLED_4_SECOND_RATESERIES 17 + * CTS2SELF_ENABLED_4_SECOND_RATESERIES 18 + * RTSCTS_ENABLED_4_SWRETRIES 33 + * CTS2SELF_ENABLED_4_SWRETRIES 34 + */ +#define CFG_ENABLE_FW_RTS_PROFILE "gEnableRTSProfiles" +#define CFG_ENABLE_FW_RTS_PROFILE_MIN (0) +#define CFG_ENABLE_FW_RTS_PROFILE_MAX (34) +#define CFG_ENABLE_FW_RTS_PROFILE_DEFAULT (33) + #ifdef FEATURE_GREEN_AP #define CFG_ENABLE_GREEN_AP_FEATURE "gEnableGreenAp" #define CFG_ENABLE_GREEN_AP_FEATURE_MIN (0) @@ -4024,6 +4039,9 @@ struct hdd_config { uint32_t enableFwLogLevel; uint8_t enableFwModuleLogLevel[FW_MODULE_LOG_LEVEL_STRING_LENGTH]; + /* RTS profile parameter */ + uint32_t rts_profile; + #ifdef WLAN_FEATURE_11W uint32_t pmfSaQueryMaxRetries; uint32_t pmfSaQueryRetryInterval; diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 4ad684334918..b76a3c0bf566 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -3052,6 +3052,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MIN, CFG_ENABLE_FW_DEBUG_LOG_LEVEL_MAX), + REG_VARIABLE(CFG_ENABLE_FW_RTS_PROFILE, WLAN_PARAM_Integer, + struct hdd_config, rts_profile, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_ENABLE_FW_RTS_PROFILE_DEFAULT, + CFG_ENABLE_FW_RTS_PROFILE_MIN, + CFG_ENABLE_FW_RTS_PROFILE_MAX), + REG_VARIABLE_STRING(CFG_ENABLE_FW_MODULE_LOG_LEVEL, WLAN_PARAM_String, struct hdd_config, enableFwModuleLogLevel, VAR_FLAGS_OPTIONAL, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index bfbee90dfc03..2dc3cf390050 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3114,6 +3114,15 @@ int hdd_set_fw_params(hdd_adapter_t *adapter) hdd_set_fw_log_params(hdd_ctx, adapter); + ret = wma_cli_set_command(adapter->sessionId, + WMI_VDEV_PARAM_ENABLE_RTSCTS, + hdd_ctx->config->rts_profile, + VDEV_CMD); + if (ret) { + hdd_err("FAILED TO SET RTSCTS Profile ret:%d", ret); + goto error; + } + EXIT(); return 0; From 9d8c2f003c0cf4f5fd014f203745f96c5d6f5b32 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 09:24:19 -0700 Subject: [PATCH 111/113] Release 5.1.0.30O Release 5.1.0.30O Change-Id: Ie55bb1f87e160cc458b6052bcf2b4acf5f534600 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 1f624b087c76..49136ac8471d 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "N" +#define QWLAN_VERSION_EXTRA "O" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30N" +#define QWLAN_VERSIONSTR "5.1.0.30O" #endif /* QWLAN_VERSION_H */ From 1aa9c9ac126aa455a0a472796d3812710fc4f9a3 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Lokere Date: Wed, 5 Oct 2016 18:50:59 -0700 Subject: [PATCH 112/113] qcacld-3.0: Add support to configure the 80MHz preference Add support to configure the 80MHz preference over 160MHz connection when the peer AP is capable of 160MHz 2x2 mode. Change-Id: I67d62a358141c470176667429f982053d162c4f8 CRs-Fixed: 1075815 --- core/hdd/inc/wlan_hdd_cfg.h | 9 +++++++++ core/hdd/src/wlan_hdd_cfg.c | 7 +++++++ core/hdd/src/wlan_hdd_main.c | 2 ++ core/mac/inc/ani_global.h | 1 + core/mac/src/pe/lim/lim_prop_exts_utils.c | 3 ++- core/sme/inc/sme_api.h | 2 ++ core/sme/src/common/sme_api.c | 12 ++++++++++++ 7 files changed, 35 insertions(+), 1 deletion(-) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index c3cead689893..9f3e1e44dc10 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -1098,6 +1098,14 @@ typedef enum { #define CFG_VHT_ENABLE_2x2_CAP_FEATURE_MAX (1) #define CFG_VHT_ENABLE_2x2_CAP_FEATURE_DEFAULT (0) +/* 0 - Connects in 160MHz 1x1 when AP is 160MHz 2x2 + * 1 - Connects in 80MHz 2x2 when AP is 160MHz 2x2 + */ +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ "gStaPrefer80MHzOver160MHz" +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ_MIN (0) +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ_MAX (1) +#define CFG_STA_PREFER_80MHZ_OVER_160MHZ_DEFAULT (1) + /* * NSS cfg bit definition. * STA BIT[0:1] @@ -4225,6 +4233,7 @@ struct hdd_config { bool enable_go_cts2self_for_sta; uint32_t tx_aggregation_size; uint32_t rx_aggregation_size; + bool sta_prefer_80MHz_over_160MHz; }; #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var)) diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index b76a3c0bf566..1b99f3c6ae1b 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -2029,6 +2029,13 @@ REG_TABLE_ENTRY g_registry_table[] = { CFG_VDEV_TYPE_NSS_2G_MIN, CFG_VDEV_TYPE_NSS_2G_MAX), + REG_VARIABLE(CFG_STA_PREFER_80MHZ_OVER_160MHZ, WLAN_PARAM_Integer, + struct hdd_config, sta_prefer_80MHz_over_160MHz, + VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, + CFG_STA_PREFER_80MHZ_OVER_160MHZ_DEFAULT, + CFG_STA_PREFER_80MHZ_OVER_160MHZ_MIN, + CFG_STA_PREFER_80MHZ_OVER_160MHZ_MAX), + REG_VARIABLE(CFG_VDEV_TYPE_NSS_5G, WLAN_PARAM_Integer, struct hdd_config, vdev_type_nss_5g, VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT, diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 2dc3cf390050..fdd639078983 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7458,6 +7458,8 @@ static int hdd_features_init(hdd_context_t *hdd_ctx, hdd_adapter_t *adapter) /* FW capabilities received, Set the Dot11 mode */ sme_setdef_dot11mode(hdd_ctx->hHal); + sme_set_prefer_80MHz_over_160MHz(hdd_ctx->hHal, + hdd_ctx->config->sta_prefer_80MHz_over_160MHz); if (hdd_ctx->config->fIsImpsEnabled) diff --git a/core/mac/inc/ani_global.h b/core/mac/inc/ani_global.h index b4bb8fb0b8da..83d9cbd4067d 100644 --- a/core/mac/inc/ani_global.h +++ b/core/mac/inc/ani_global.h @@ -978,6 +978,7 @@ typedef struct sAniSirGlobal { int8_t first_scan_bucket_threshold; enum auth_tx_ack_status auth_ack_status; uint8_t user_configured_nss; + bool sta_prefer_80MHz_over_160MHz; } tAniSirGlobal; typedef enum { diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 1f367b75a469..c263b366d36e 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -224,7 +224,8 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, * AP supports Nss > 1 in 160MHz mode then connect the STA * in 2x2 80MHz mode instead of connecting in 160MHz mode. */ - if (vht_ch_wd > WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) { + if ((vht_ch_wd > WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ) && + mac_ctx->sta_prefer_80MHz_over_160MHz) { if (!(IS_VHT_NSS_1x1(beacon_struct->VHTCaps.txMCSMap)) && (!IS_VHT_NSS_1x1(beacon_struct->VHTCaps.rxMCSMap))) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index cfbbe22ec405..ce4bdac75066 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -1323,4 +1323,6 @@ QDF_STATUS sme_encrypt_decrypt_msg(tHalHandle hal, * Return: QDF_STATUS */ QDF_STATUS sme_set_cts2self_for_p2p_go(tHalHandle hal); +void sme_set_prefer_80MHz_over_160MHz(tHalHandle hal, + bool sta_prefer_80MHz_over_160MHz); #endif /* #if !defined( __SME_API_H ) */ diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 7577d99c6af0..fe98f63d4264 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -11212,6 +11212,18 @@ void sme_get_command_q_status(tHalHandle hHal) return; } +/** + * sme_set_prefer_80MHz_over_160MHz() - API to set sta_prefer_80MHz_over_160MHz + * @hal: The handle returned by macOpen + * @sta_prefer_80MHz_over_160MHz: sta_prefer_80MHz_over_160MHz config param + */ +void sme_set_prefer_80MHz_over_160MHz(tHalHandle hal, + bool sta_prefer_80MHz_over_160MHz) +{ + tpAniSirGlobal mac_ctx = PMAC_STRUCT(hal); + mac_ctx->sta_prefer_80MHz_over_160MHz = sta_prefer_80MHz_over_160MHz; +} + #ifdef WLAN_FEATURE_DSRC /** * sme_set_dot11p_config() - API to set the 802.11p config From 327d4b3fc880ce6580e830788a759c20b59bb6a8 Mon Sep 17 00:00:00 2001 From: qcabuildsw Date: Wed, 12 Oct 2016 11:03:48 -0700 Subject: [PATCH 113/113] Release 5.1.0.30P Release 5.1.0.30P Change-Id: I6ac966108bfd0d8ba9d1c19d37dbfdab113f6a81 CRs-Fixed: 688141 --- core/mac/inc/qwlan_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/mac/inc/qwlan_version.h b/core/mac/inc/qwlan_version.h index 49136ac8471d..825fdb196df9 100644 --- a/core/mac/inc/qwlan_version.h +++ b/core/mac/inc/qwlan_version.h @@ -41,9 +41,9 @@ #define QWLAN_VERSION_MAJOR 5 #define QWLAN_VERSION_MINOR 1 #define QWLAN_VERSION_PATCH 0 -#define QWLAN_VERSION_EXTRA "O" +#define QWLAN_VERSION_EXTRA "P" #define QWLAN_VERSION_BUILD 30 -#define QWLAN_VERSIONSTR "5.1.0.30O" +#define QWLAN_VERSIONSTR "5.1.0.30P" #endif /* QWLAN_VERSION_H */