From d81ab0571ce40a2c51b2dca2bdba0412ba1cbcfa Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 23 Apr 2018 08:06:54 -0700 Subject: [PATCH] qcacld-3.0: Relocate hdd_wlan_get_ibss_mac_addr_from_staid() Function hdd_wlan_get_ibss_mac_addr_from_staid() is currently located in wlan_hdd_wext.c, but this function is independent of wireless extensions, so relocate it as part of the plan to omit wlan_hdd_wext.c from the build when wireless extensions is not enabled. Change-Id: If005f7c2295a519b891d3718799f6f826d59e97f CRs-Fixed: 2229490 --- core/hdd/inc/wlan_hdd_main.h | 3 --- core/hdd/src/wlan_hdd_assoc.c | 25 +++++++++++++++++++++++++ core/hdd/src/wlan_hdd_wext.c | 25 ------------------------- 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index e4d9fd3a12d2..6fe0b56bfbe8 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2115,9 +2115,6 @@ bool hdd_is_valid_mac_address(const uint8_t *pMacAddr); QDF_STATUS hdd_issta_p2p_clientconnected(struct hdd_context *hdd_ctx); bool wlan_hdd_validate_modules_state(struct hdd_context *hdd_ctx); -struct qdf_mac_addr * -hdd_wlan_get_ibss_mac_addr_from_staid(struct hdd_adapter *adapter, - uint8_t staIdx); #ifdef MSM_PLATFORM /** * hdd_bus_bw_compute_timer_start() - start the bandwidth timer diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 73f444b8d71d..4902ecfeb290 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1600,6 +1600,31 @@ static void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter) hdd_exit(); } +/** + * hdd_wlan_get_ibss_mac_addr_from_staid() - Get IBSS MAC address + * @adapter: Adapter upon which the IBSS client is active + * @staIdx: Station index of the IBSS peer + * + * Return: a pointer to the MAC address of the IBSS peer if the peer is + * found, otherwise %NULL. + */ +static struct qdf_mac_addr * +hdd_wlan_get_ibss_mac_addr_from_staid(struct hdd_adapter *adapter, + uint8_t staIdx) +{ + uint8_t idx; + struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); + + for (idx = 0; idx < MAX_PEERS; idx++) { + if (HDD_WLAN_INVALID_STA_ID != + sta_ctx->conn_info.staId[idx] && + staIdx == sta_ctx->conn_info.staId[idx]) { + return &sta_ctx->conn_info.peerMacAddress[idx]; + } + } + return NULL; +} + /** * hdd_roam_deregister_sta() - deregister station * @adapter: pointer to adapter diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index accbb481c900..fae30973137c 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -3372,31 +3372,6 @@ error: return; } -/** - * hdd_wlan_get_ibss_mac_addr_from_staid() - Get IBSS MAC address - * @adapter: Adapter upon which the IBSS client is active - * @staIdx: Station index of the IBSS peer - * - * Return: a pointer to the MAC address of the IBSS peer if the peer is - * found, otherwise %NULL. - */ -struct qdf_mac_addr * -hdd_wlan_get_ibss_mac_addr_from_staid(struct hdd_adapter *adapter, - uint8_t staIdx) -{ - uint8_t idx; - struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter); - - for (idx = 0; idx < MAX_PEERS; idx++) { - if (HDD_WLAN_INVALID_STA_ID != - sta_ctx->conn_info.staId[idx] && - staIdx == sta_ctx->conn_info.staId[idx]) { - return &sta_ctx->conn_info.peerMacAddress[idx]; - } - } - return NULL; -} - /** * hdd_wlan_get_ibss_peer_info() - Print IBSS peer information * @adapter: Adapter upon which the IBSS client is active