diff options
| author | Xun Luo <xunl@qca.qualcomm.com> | 2014-03-07 23:15:11 -0800 |
|---|---|---|
| committer | Akash Patel <c_akashp@qca.qualcomm.com> | 2014-03-11 18:03:44 -0700 |
| commit | fc8ff925f73c56f6a962cc85c59a095d2e2667ef (patch) | |
| tree | d5c619899790271121214d85dd62ba7c9a281704 | |
| parent | 03e5438d1a9c132adb8d9d5611b68056597e403b (diff) | |
MAC address change for DHCP BTCOEX
MAC address in the DHCP message is now change to associated AP MAC
address rather than the address of the STA itself.
Change-Id: I31bf5d5fb79cc84cf7475d83d1d390b55aeb0968
CRs-Fixed: 588989
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_main.c | 4 | ||||
| -rw-r--r-- | CORE/SME/inc/sme_Api.h | 9 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 34 |
3 files changed, 34 insertions, 13 deletions
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index e94a34fc378d..eb89600ec15f 100644 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -3961,12 +3961,12 @@ int hdd_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) if ('1' == *dhcpPhase) { sme_DHCPStartInd(pHddCtx->hHal, pAdapter->device_mode, - pAdapter->macAddressCurrent.bytes); + pAdapter->sessionId); } else if ('2' == *dhcpPhase) { sme_DHCPStopInd(pHddCtx->hHal, pAdapter->device_mode, - pAdapter->macAddressCurrent.bytes); + pAdapter->sessionId); } } else if (strncmp(command, "SCAN-ACTIVE", 11) == 0) diff --git a/CORE/SME/inc/sme_Api.h b/CORE/SME/inc/sme_Api.h index 357f9b8d4946..f88d31766636 100644 --- a/CORE/SME/inc/sme_Api.h +++ b/CORE/SME/inc/sme_Api.h @@ -1644,7 +1644,7 @@ eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, \param device_mode the mode of the device - \param macAddr the macAddress of the devices + \param sessionId session ID \return eHalStatus SUCCESS. @@ -1654,7 +1654,7 @@ eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, eHalStatus sme_DHCPStartInd( tHalHandle hHal, tANI_U8 device_mode, - tANI_U8 *macAddr ); + tANI_U8 sessionId ); /* --------------------------------------------------------------------------- @@ -1666,7 +1666,7 @@ eHalStatus sme_DHCPStartInd( tHalHandle hHal, \param device_mode the mode of the device - \param macAddr the macAddress of the devices + \param sessionId session ID \return eHalStatus SUCCESS. @@ -1675,8 +1675,7 @@ eHalStatus sme_DHCPStartInd( tHalHandle hHal, -------------------------------------------------------------------------------*/ eHalStatus sme_DHCPStopInd( tHalHandle hHal, tANI_U8 device_mode, - tANI_U8 *macAddr ); - + tANI_U8 sessionId ); /* --------------------------------------------------------------------------- \fn sme_BtcSignalBtEvent diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 3813718ddb6e..58f2168a6c9a 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -5457,7 +5457,7 @@ eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, \param device_mode - mode(AP,SAP etc) of the device. - \param macAddr - MAC address of the device. + \param sessionId - session ID. \return eHalStatus SUCCESS. @@ -5465,17 +5465,27 @@ eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, --------------------------------------------------------------------------*/ eHalStatus sme_DHCPStartInd( tHalHandle hHal, tANI_U8 device_mode, - tANI_U8 *macAddr ) + tANI_U8 sessionId ) { eHalStatus status; VOS_STATUS vosStatus; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); vos_msg_t vosMessage; tAniDHCPInd *pMsg; + tCsrRoamSession *pSession; status = sme_AcquireGlobalLock(&pMac->sme); if ( eHAL_STATUS_SUCCESS == status) { + pSession = CSR_GET_SESSION( pMac, sessionId ); + + if (!pSession) + { + smsLog(pMac, LOGE, FL("session %d not found "), sessionId); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); if (NULL == pMsg) { @@ -5487,7 +5497,8 @@ eHalStatus sme_DHCPStartInd( tHalHandle hHal, pMsg->msgType = WDA_DHCP_START_IND; pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); pMsg->device_mode = device_mode; - vos_mem_copy( pMsg->macAddr, macAddr, sizeof(tSirMacAddr)); + vos_mem_copy( pMsg->macAddr, pSession->connectedProfile.bssid, + sizeof(tSirMacAddr) ); vosMessage.type = WDA_DHCP_START_IND; vosMessage.bodyptr = pMsg; @@ -5514,24 +5525,34 @@ eHalStatus sme_DHCPStartInd( tHalHandle hHal, \param device_mode - mode(AP, SAP etc) of the device. - \param macAddr - MAC address of the device. + \param sessionId - session ID. \return eHalStatus SUCCESS. FAILURE or RESOURCES The API finished and failed. --------------------------------------------------------------------------*/ eHalStatus sme_DHCPStopInd( tHalHandle hHal, tANI_U8 device_mode, - tANI_U8 *macAddr ) + tANI_U8 sessionId ) { eHalStatus status; VOS_STATUS vosStatus; tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); vos_msg_t vosMessage; tAniDHCPInd *pMsg; + tCsrRoamSession *pSession; status = sme_AcquireGlobalLock(&pMac->sme); if ( eHAL_STATUS_SUCCESS == status) { + pSession = CSR_GET_SESSION( pMac, sessionId ); + + if (!pSession) + { + smsLog(pMac, LOGE, FL("session %d not found "), sessionId); + sme_ReleaseGlobalLock( &pMac->sme ); + return eHAL_STATUS_FAILURE; + } + pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); if (NULL == pMsg) { @@ -5544,7 +5565,8 @@ eHalStatus sme_DHCPStopInd( tHalHandle hHal, pMsg->msgType = WDA_DHCP_STOP_IND; pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); pMsg->device_mode = device_mode; - vos_mem_copy( pMsg->macAddr, macAddr, sizeof(tSirMacAddr)); + vos_mem_copy( pMsg->macAddr, pSession->connectedProfile.bssid, + sizeof(tSirMacAddr) ); vosMessage.type = WDA_DHCP_STOP_IND; vosMessage.bodyptr = pMsg; |
