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
This commit is contained in:
Srinivas Girigowda 2015-09-24 12:26:28 -07:00 • committed by Satish Singh
commit 9721523f8e
10 changed files with 61 additions and 63 deletions

View file

@ -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 !=

View file

@ -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",

View file

@ -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();

View file

@ -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) {

View file

@ -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;

View file

@ -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:"));
)

View file

@ -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,

View file

@ -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;

View file

@ -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,

View file

@ -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;
}