diff options
| author | Nirav Shah <nnshah@qti.qualcomm.com> | 2014-05-14 11:41:56 +0530 |
|---|---|---|
| committer | Pitani Venkata Rajesh Kumar <c_vpitan@qti.qualcomm.com> | 2014-05-16 15:50:12 +0530 |
| commit | 827e2bb5f457ec8d25459fdf561c425bbcf13264 (patch) | |
| tree | d5caa07c901addd15f7f6586f9d041975c1314b1 | |
| parent | 07c689b2888603158d99b43986b8331c840c9c2a (diff) | |
WLAN: Don't disconnect if station is connected in supported band.
If station is connected in 2.4 GHz and band capability is changed
from Auto to 2.4 GHz only, station is getting disconnect.
Same is the case with 5 GHz.
Right now disconnection is issued when in connected state
if new band capability is not the supported one.
Disconnect will happen only in case of if connected channel is
not supported in new Band.
Change-Id: I6f42ad5a65dab38eaca1ec23745f8f04e91a882a
CRs-Fixed: 664060
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_assoc.h | 1 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 18 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_wext.c | 11 |
3 files changed, 27 insertions, 3 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h index 158ed3d184a7..a1d2bf950378 100644 --- a/CORE/HDD/inc/wlan_hdd_assoc.h +++ b/CORE/HDD/inc/wlan_hdd_assoc.h @@ -136,6 +136,7 @@ typedef enum #endif /* QCA_WIFI_2_0 */ extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx ); +eCsrBand hdd_connGetConnectedBand( hdd_station_ctx_t *pHddStaCtx ); extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId, eRoamCmdStatus roamStatus, eCsrRoamResult roamResult ); diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index e5440e4b9a90..54b48b35040b 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -179,6 +179,24 @@ v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx ) return( hdd_connGetConnectionState( pHddStaCtx, NULL ) ); } +eCsrBand hdd_connGetConnectedBand( hdd_station_ctx_t *pHddStaCtx ) +{ + v_U8_t staChannel = 0; + + if ( eConnectionState_Associated == pHddStaCtx->conn_info.connState ) + { + staChannel = pHddStaCtx->conn_info.operationChannel; + } + + if ( staChannel > 0 && staChannel < 14 ) + return eCSR_BAND_24; + else if (staChannel >= 36 && staChannel <= 165 ) + return eCSR_BAND_5G; + else /* If station is not connected return as eCSR_BAND_ALL */ + return eCSR_BAND_ALL; +} + + //TODO - Not used anyhwere. Can be removed. #if 0 // diff --git a/CORE/HDD/src/wlan_hdd_wext.c b/CORE/HDD/src/wlan_hdd_wext.c index cab8e18fd20b..80cff1c03a7d 100644 --- a/CORE/HDD/src/wlan_hdd_wext.c +++ b/CORE/HDD/src/wlan_hdd_wext.c @@ -105,6 +105,7 @@ #include "sme_Api.h" #include "wlan_qct_wda.h" #include "vos_trace.h" +#include "wlan_hdd_assoc.h" #ifdef QCA_PKT_PROTO_TRACE #include "vos_packet.h" @@ -9358,6 +9359,7 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) hdd_context_t *pHddCtx; hdd_adapter_list_node_t *pAdapterNode, *pNext; eCsrBand currBand = eCSR_BAND_MAX; + eCsrBand connectedBand; pAdapterNode = NULL; pNext = NULL; @@ -9424,12 +9426,15 @@ int hdd_setBand(struct net_device *dev, u8 ui_band) hHal = WLAN_HDD_GET_HAL_CTX(pAdapter); hdd_abort_mac_scan(pHddCtx, pAdapter->sessionId, eCSR_SCAN_ABORT_DUE_TO_BAND_CHANGE); + connectedBand = + hdd_connGetConnectedBand(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter)); /* Handling is done only for STA and P2P */ - if (((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) || + if ( band != eCSR_BAND_ALL && + ((pAdapter->device_mode == WLAN_HDD_INFRA_STATION) || (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)) && - (hdd_connIsConnected(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))) - ) + (hdd_connIsConnected(WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))) && + (connectedBand != band)) { hdd_station_ctx_t *pHddStaCtx = &(pAdapter)->sessionCtx.station; eHalStatus status = eHAL_STATUS_SUCCESS; |
