From 9721523f8efa3d8c4ad5f0f7f1de77fa403c834f Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Thu, 24 Sep 2015 12:26:28 -0700 Subject: [PATCH] qcacld-3.0: Replace tSirMacAddr with cdf_mac_addr in sMaxTxPowerParams Replace tSirMacAddr with cdf_mac_addr in sMaxTxPowerParams. Change-Id: Ia9f66cfd3a520019a83d671b7869d49558856698 CRs-Fixed: 898864 --- core/hdd/src/wlan_hdd_hostapd.c | 15 +++++-------- core/hdd/src/wlan_hdd_ioctl.c | 22 +++++++++---------- core/hdd/src/wlan_hdd_power.c | 4 ++-- core/hdd/src/wlan_hdd_wext.c | 15 +++++-------- .../src/pe/lim/lim_process_sme_req_messages.c | 9 ++++---- core/mac/src/pe/rrm/rrm_api.c | 17 +++++++------- core/sme/inc/sme_api.h | 6 ++--- core/sme/src/common/sme_api.c | 14 ++++++------ core/wma/inc/wma_if.h | 4 ++-- core/wma/src/wma_power.c | 18 +++++++++------ 10 files changed, 61 insertions(+), 63 deletions(-) diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 658c636eb9d5..59305a12b05d 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -3242,9 +3242,9 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, tHalHandle hHal = WLAN_HDD_GET_HAL_CTX(pHostapdAdapter); int *value = (int *)extra; int set_value; - tSirMacAddr bssid = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - tSirMacAddr selfMac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; int ret; + struct cdf_mac_addr bssid = CDF_MAC_ADDR_BROADCAST_INITIALIZER; + struct cdf_mac_addr selfMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER; ENTER(); @@ -3257,10 +3257,8 @@ static __iw_softap_set_max_tx_power(struct net_device *dev, return ret; /* Assign correct slef MAC address */ - cdf_mem_copy(bssid, pHostapdAdapter->macAddressCurrent.bytes, - CDF_MAC_ADDR_SIZE); - cdf_mem_copy(selfMac, pHostapdAdapter->macAddressCurrent.bytes, - CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&bssid, &pHostapdAdapter->macAddressCurrent); + cdf_copy_macaddr(&selfMac, &pHostapdAdapter->macAddressCurrent); set_value = value[0]; if (CDF_STATUS_SUCCESS != @@ -3296,7 +3294,7 @@ static __iw_softap_set_tx_power(struct net_device *dev, hdd_context_t *hdd_ctx; int *value = (int *)extra; int set_value; - tSirMacAddr bssid; + struct cdf_mac_addr bssid; int ret; ENTER(); @@ -3309,8 +3307,7 @@ static __iw_softap_set_tx_power(struct net_device *dev, if (NULL == value) return -ENOMEM; - cdf_mem_copy(bssid, pHostapdAdapter->macAddressCurrent.bytes, - CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&bssid, &pHostapdAdapter->macAddressCurrent); set_value = value[0]; if (CDF_STATUS_SUCCESS != diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index 3273d6aab369..1e8db571ff9e 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -4982,8 +4982,8 @@ static int drv_cmd_max_tx_power(hdd_adapter_t *adapter, CDF_STATUS cdf_status; CDF_STATUS smeStatus; uint8_t *value = command; - tSirMacAddr bssid = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - tSirMacAddr selfMac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + struct cdf_mac_addr bssid = CDF_MAC_ADDR_BROADCAST_INITIALIZER; + struct cdf_mac_addr selfMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER; hdd_adapter_list_node_t *pAdapterNode = NULL; hdd_adapter_list_node_t *pNext = NULL; @@ -5001,21 +5001,19 @@ static int drv_cmd_max_tx_power(hdd_adapter_t *adapter, && CDF_STATUS_SUCCESS == cdf_status) { adapter = pAdapterNode->pAdapter; /* Assign correct self MAC address */ - cdf_mem_copy(bssid, - adapter->macAddressCurrent.bytes, - CDF_MAC_ADDR_SIZE); - cdf_mem_copy(selfMac, - adapter->macAddressCurrent.bytes, - CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&bssid, + &adapter->macAddressCurrent); + cdf_copy_macaddr(&selfMac, + &adapter->macAddressCurrent); hddLog(CDF_TRACE_LEVEL_INFO, "Device mode %d max tx power %d selfMac: " MAC_ADDRESS_STR " bssId: " MAC_ADDRESS_STR " ", adapter->device_mode, txPower, - MAC_ADDR_ARRAY(selfMac), - MAC_ADDR_ARRAY(bssid)); + MAC_ADDR_ARRAY(selfMac.bytes), + MAC_ADDR_ARRAY(bssid.bytes)); - smeStatus = sme_set_max_tx_power((tHalHandle)(hdd_ctx->hHal), - bssid, selfMac, txPower); + smeStatus = sme_set_max_tx_power(hdd_ctx->hHal, + bssid, selfMac, txPower); if (CDF_STATUS_SUCCESS != status) { hddLog(CDF_TRACE_LEVEL_ERROR, "%s:Set max tx power failed", diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index 1f97634cfd7b..be764693bf76 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -2185,8 +2185,8 @@ static int __wlan_hdd_cfg80211_set_txpower(struct wiphy *wiphy, { hdd_context_t *pHddCtx = (hdd_context_t *) wiphy_priv(wiphy); tHalHandle hHal = NULL; - tSirMacAddr bssid = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - tSirMacAddr selfMac = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; + struct cdf_mac_addr bssid = CDF_MAC_ADDR_BROADCAST_INITIALIZER; + struct cdf_mac_addr selfMac = CDF_MAC_ADDR_BROADCAST_INITIALIZER; int status; ENTER(); diff --git a/core/hdd/src/wlan_hdd_wext.c b/core/hdd/src/wlan_hdd_wext.c index 245519f8501d..2448ddf5605a 100644 --- a/core/hdd/src/wlan_hdd_wext.c +++ b/core/hdd/src/wlan_hdd_wext.c @@ -5080,10 +5080,9 @@ static int __iw_setint_getnone(struct net_device *dev, } case WE_SET_TX_POWER: { - tSirMacAddr bssid; + struct cdf_mac_addr bssid; - cdf_mem_copy(bssid, pHddStaCtx->conn_info.bssId.bytes, - CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&bssid, &pHddStaCtx->conn_info.bssId); if (sme_set_tx_power (hHal, pAdapter->sessionId, bssid, pAdapter->device_mode, @@ -5096,16 +5095,14 @@ static int __iw_setint_getnone(struct net_device *dev, } case WE_SET_MAX_TX_POWER: { - tSirMacAddr bssid; - tSirMacAddr selfMac; + struct cdf_mac_addr bssid; + struct cdf_mac_addr selfMac; hddLog(CDF_TRACE_LEVEL_INFO, "%s: Setting maximum tx power %d dBm", __func__, set_value); - cdf_mem_copy(bssid, pHddStaCtx->conn_info.bssId.bytes, - CDF_MAC_ADDR_SIZE); - cdf_mem_copy(selfMac, pHddStaCtx->conn_info.bssId.bytes, - CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&bssid, &pHddStaCtx->conn_info.bssId); + cdf_copy_macaddr(&selfMac, &pHddStaCtx->conn_info.bssId); if (sme_set_max_tx_power(hHal, bssid, selfMac, set_value) != CDF_STATUS_SUCCESS) { 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 1e9aa2c76a29..88d18497ea58 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 @@ -4535,10 +4535,11 @@ lim_send_set_max_tx_power_req(tpAniSirGlobal pMac, tPowerdBm txPower, return eSIR_FAILURE; } pMaxTxParams->power = txPower; - cdf_mem_copy(pMaxTxParams->bssId, pSessionEntry->bssId, - sizeof(tSirMacAddr)); - cdf_mem_copy(pMaxTxParams->selfStaMacAddr, pSessionEntry->selfMacAddr, - sizeof(tSirMacAddr)); + cdf_mem_copy(pMaxTxParams->bssId.bytes, pSessionEntry->bssId, + CDF_MAC_ADDR_SIZE); + cdf_mem_copy(pMaxTxParams->selfStaMacAddr.bytes, + pSessionEntry->selfMacAddr, + CDF_MAC_ADDR_SIZE); msgQ.type = WMA_SET_MAX_TX_POWER_REQ; msgQ.bodyptr = pMaxTxParams; diff --git a/core/mac/src/pe/rrm/rrm_api.c b/core/mac/src/pe/rrm/rrm_api.c index 3f2f96f26c4f..38f748a0d478 100644 --- a/core/mac/src/pe/rrm/rrm_api.c +++ b/core/mac/src/pe/rrm/rrm_api.c @@ -165,10 +165,11 @@ rrm_send_set_max_tx_power_req(tpAniSirGlobal pMac, tPowerdBm txPower, } /* Allocated memory for pMaxTxParams...will be freed in other module */ pMaxTxParams->power = txPower; - cdf_mem_copy(pMaxTxParams->bssId, pSessionEntry->bssId, - sizeof(tSirMacAddr)); - cdf_mem_copy(pMaxTxParams->selfStaMacAddr, pSessionEntry->selfMacAddr, - sizeof(tSirMacAddr)); + cdf_mem_copy(pMaxTxParams->bssId.bytes, pSessionEntry->bssId, + CDF_MAC_ADDR_SIZE); + cdf_mem_copy(pMaxTxParams->selfStaMacAddr.bytes, + pSessionEntry->selfMacAddr, + CDF_MAC_ADDR_SIZE); msgQ.type = WMA_SET_MAX_TX_POWER_REQ; msgQ.reserved = 0; @@ -213,9 +214,8 @@ tSirRetStatus rrm_set_max_tx_power_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ) tpMaxTxPowerParams pMaxTxParams = (tpMaxTxPowerParams) limMsgQ->bodyptr; tpPESession pSessionEntry; uint8_t sessionId, i; - tSirMacAddr bssid = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; - if (cdf_mem_compare(bssid, pMaxTxParams->bssId, sizeof(tSirMacAddr))) { + if (cdf_is_macaddr_broadcast(&pMaxTxParams->bssId)) { for (i = 0; i < pMac->lim.maxBssId; i++) { if ((pMac->lim.gpSession[i].valid == true)) { pSessionEntry = &pMac->lim.gpSession[i]; @@ -225,8 +225,9 @@ tSirRetStatus rrm_set_max_tx_power_rsp(tpAniSirGlobal pMac, tpSirMsgQ limMsgQ) } } else { if ((pSessionEntry = - pe_find_session_by_bssid(pMac, pMaxTxParams->bssId, - &sessionId)) == NULL) { + pe_find_session_by_bssid(pMac, + pMaxTxParams->bssId.bytes, + &sessionId)) == NULL) { PELOGE(lim_log (pMac, LOGE, FL("Unable to find session:")); ) diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index b80ae17a0ed6..ec368086c3cc 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -553,11 +553,11 @@ CDF_STATUS sme_get_gtk_offload(tHalHandle hal_ctx, #endif /* WLAN_FEATURE_GTK_OFFLOAD */ uint16_t sme_chn_to_freq(uint8_t chanNum); bool sme_is_channel_valid(tHalHandle hHal, uint8_t channel); -CDF_STATUS sme_set_max_tx_power(tHalHandle hHal, tSirMacAddr pBssid, - tSirMacAddr pSelfMacAddress, int8_t dB); +CDF_STATUS sme_set_max_tx_power(tHalHandle hHal, struct cdf_mac_addr pBssid, + struct cdf_mac_addr pSelfMacAddress, int8_t dB); CDF_STATUS sme_set_max_tx_power_per_band(eCsrBand band, int8_t db); CDF_STATUS sme_set_tx_power(tHalHandle hHal, uint8_t sessionId, - tSirMacAddr pBSSId, + struct cdf_mac_addr bssid, tCDF_CON_MODE dev_mode, int power); CDF_STATUS sme_set_custom_mac_addr(tSirMacAddr customMacAddr); CDF_STATUS sme_hide_ssid(tHalHandle hHal, uint8_t sessionId, diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 5ef7f247f385..0a767e8f4242 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -7720,8 +7720,8 @@ CDF_STATUS sme_set_max_tx_power_per_band(eCsrBand band, int8_t dB) \- return CDF_STATUS -------------------------------------------------------------------------------*/ -CDF_STATUS sme_set_max_tx_power(tHalHandle hHal, tSirMacAddr pBssid, - tSirMacAddr pSelfMacAddress, int8_t dB) +CDF_STATUS sme_set_max_tx_power(tHalHandle hHal, struct cdf_mac_addr pBssid, + struct cdf_mac_addr pSelfMacAddress, int8_t dB) { cds_msg_t msg; tpMaxTxPowerParams pMaxTxParams = NULL; @@ -7736,9 +7736,8 @@ CDF_STATUS sme_set_max_tx_power(tHalHandle hHal, tSirMacAddr pBssid, return CDF_STATUS_E_NOMEM; } - cdf_mem_copy(pMaxTxParams->bssId, pBssid, CDF_MAC_ADDR_SIZE); - cdf_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, - CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&pMaxTxParams->bssId, &pBssid); + cdf_copy_macaddr(&pMaxTxParams->selfStaMacAddr, &pSelfMacAddress); pMaxTxParams->power = dB; msg.type = WMA_SET_MAX_TX_POWER_REQ; @@ -7806,7 +7805,8 @@ CDF_STATUS sme_set_custom_mac_addr(tSirMacAddr customMacAddr) \- return CDF_STATUS ---------------------------------------------------------------------------*/ CDF_STATUS sme_set_tx_power(tHalHandle hHal, uint8_t sessionId, - tSirMacAddr pBSSId, tCDF_CON_MODE dev_mode, int dBm) + struct cdf_mac_addr pBSSId, + tCDF_CON_MODE dev_mode, int dBm) { cds_msg_t msg; tpMaxTxPowerParams pTxParams = NULL; @@ -7830,7 +7830,7 @@ CDF_STATUS sme_set_tx_power(tHalHandle hHal, uint8_t sessionId, return CDF_STATUS_E_NOMEM; } - cdf_mem_copy(pTxParams->bssId, pBSSId, CDF_MAC_ADDR_SIZE); + cdf_copy_macaddr(&pTxParams->bssId, &pBSSId); pTxParams->power = power; /* unit is dBm */ pTxParams->dev_mode = dev_mode; msg.type = WMA_SET_TX_POWER_REQ; diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h index 75c50f84ee03..b7ee6974e49c 100644 --- a/core/wma/inc/wma_if.h +++ b/core/wma/inc/wma_if.h @@ -1148,8 +1148,8 @@ typedef struct sControlTxParams { * Request Type = SIR_HAL_SET_MAX_TX_POWER_REQ */ typedef struct sMaxTxPowerParams { - tSirMacAddr bssId; - tSirMacAddr selfStaMacAddr; + struct cdf_mac_addr bssId; + struct cdf_mac_addr selfStaMacAddr; /* In request, * power == MaxTx power to be used. * In response, diff --git a/core/wma/src/wma_power.c b/core/wma/src/wma_power.c index 59e79759b011..72d77b800d97 100644 --- a/core/wma/src/wma_power.c +++ b/core/wma/src/wma_power.c @@ -418,21 +418,23 @@ void wma_set_tx_power(WMA_HANDLE handle, if (tx_pwr_params->dev_mode == CDF_SAP_MODE || tx_pwr_params->dev_mode == CDF_P2P_GO_MODE) { pdev = wma_find_vdev_by_addr(wma_handle, - tx_pwr_params->bssId, &vdev_id); + tx_pwr_params->bssId.bytes, + &vdev_id); } else { pdev = wma_find_vdev_by_bssid(wma_handle, - tx_pwr_params->bssId, &vdev_id); + tx_pwr_params->bssId.bytes, + &vdev_id); } if (!pdev) { WMA_LOGE("vdev handle is invalid for %pM", - tx_pwr_params->bssId); + tx_pwr_params->bssId.bytes); cdf_mem_free(tx_pwr_params); return; } if (!(wma_handle->interfaces[vdev_id].vdev_up)) { WMA_LOGE("%s: vdev id %d is not up for %pM", __func__, vdev_id, - tx_pwr_params->bssId); + tx_pwr_params->bssId.bytes); cdf_mem_free(tx_pwr_params); return; } @@ -490,15 +492,17 @@ void wma_set_max_tx_power(WMA_HANDLE handle, void *pdev; tPowerdBm prev_max_power; - pdev = wma_find_vdev_by_addr(wma_handle, tx_pwr_params->bssId, &vdev_id); + pdev = wma_find_vdev_by_addr(wma_handle, tx_pwr_params->bssId.bytes, + &vdev_id); if (pdev == NULL) { /* not in SAP array. Try the station/p2p array */ pdev = wma_find_vdev_by_bssid(wma_handle, - tx_pwr_params->bssId, &vdev_id); + tx_pwr_params->bssId.bytes, + &vdev_id); } if (!pdev) { WMA_LOGE("vdev handle is invalid for %pM", - tx_pwr_params->bssId); + tx_pwr_params->bssId.bytes); cdf_mem_free(tx_pwr_params); return; }