qcacld-3.0: Fix STA state handling in case of WEP

qcacld-2.0 to qcacld-3.0 propagation

Handle STA State in hdd_RoamSetKeyCompleteHandler for WEP case.
In WEP case Key are set in following order.
1)Group key
2)Unicast Key
In WEP case STA was moved to AUTHENTICATED prior to
setting the unicast key and it was resulting in sending
few un-encrypted packet. Now STA state will be moved to
AUTHENTICATED after we set the unicast and group
key in WEP case.

Change-Id: I7471bc76b10be31c4a2dbb52286c7f808fa27306
CRs-Fixed: 906555
This commit is contained in:
Govind Singh
2015-10-23 17:11:35 +05:30
committed by Prakash Dhavali
부모 bace351fef
커밋 edc5cda7af
2개의 변경된 파일102개의 추가작업 그리고 47개의 파일을 삭제

파일 보기

@@ -106,6 +106,8 @@ typedef enum {
* @uIsAuthenticated: Remembers authenticated state * @uIsAuthenticated: Remembers authenticated state
* @dot11Mode: dot11Mode * @dot11Mode: dot11Mode
* @proxyARPService: proxy arp service * @proxyARPService: proxy arp service
* @ptk_installed: ptk installed state
* @gtk_installed: gtk installed state
*/ */
typedef struct connection_info_s { typedef struct connection_info_s {
eConnectionState connState; eConnectionState connState;
@@ -122,6 +124,8 @@ typedef struct connection_info_s {
uint8_t uIsAuthenticated; uint8_t uIsAuthenticated;
uint32_t dot11Mode; uint32_t dot11Mode;
uint8_t proxyARPService; uint8_t proxyARPService;
bool ptk_installed;
bool gtk_installed;
} connection_info_t; } connection_info_t;
/* Forward declarations */ /* Forward declarations */

파일 보기

@@ -1442,6 +1442,64 @@ done:
kfree(rspRsnIe); kfree(rspRsnIe);
} }
/**
* hdd_is_roam_sync_in_progress()- Check if roam offloaded
*
* Return: roam sync status if roaming offloaded else false
*/
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
static inline bool hdd_is_roam_sync_in_progress(tCsrRoamInfo *roaminfo)
{
return roaminfo->roamSynchInProgress;
}
#else
static inline bool hdd_is_roam_sync_in_progress(tCsrRoamInfo *roaminfo)
{
return false;
}
#endif
/**
* hdd_change_sta_state_authenticated()-
* This function changes STA state to authenticated
* @adapter: pointer to the adapter structure.
* @roaminfo: pointer to the RoamInfo structure.
*
* This is called from hdd_RoamSetKeyCompleteHandler
* in context to eCSR_ROAM_SET_KEY_COMPLETE event from fw.
*
* Return: 0 on success and errno on failure
*/
static int hdd_change_sta_state_authenticated(hdd_adapter_t *adapter,
tCsrRoamInfo *roaminfo)
{
int ret;
hdd_station_ctx_t *hddstactx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
hddLog(LOG1,
"Changing TL state to AUTHENTICATED for StaId= %d",
hddstactx->conn_info.staId[0]);
/* Connections that do not need Upper layer authentication,
* transition TL to 'Authenticated' state after the keys are set
*/
ret = hdd_change_peer_state(adapter,
hddstactx->conn_info.staId[0],
ol_txrx_peer_state_auth,
hdd_is_roam_sync_in_progress(roaminfo));
hdd_conn_set_authenticated(adapter, true);
if ((WLAN_HDD_INFRA_STATION == adapter->device_mode) ||
(WLAN_HDD_P2P_CLIENT == adapter->device_mode)) {
sme_ps_enable_auto_ps_timer(
WLAN_HDD_GET_HAL_CTX(adapter),
adapter->sessionId,
hddstactx->hdd_ReassocScenario);
}
return ret;
}
/** /**
* hdd_roam_set_key_complete_handler() - Update the security parameters * hdd_roam_set_key_complete_handler() - Update the security parameters
* @pAdapter: pointer to adapter * @pAdapter: pointer to adapter
@@ -1503,59 +1561,52 @@ static CDF_STATUS hdd_roam_set_key_complete_handler(hdd_adapter_t *pAdapter,
} else { } else {
/* /*
* TODO: Considering getting a state machine in * TODO: Considering getting a state machine in
* HDD later. This routine is invoked twice. * HDD later.This routine is invoked twice.
* 1)set PTK 2)set GTK. * 1)set PTK 2)set GTK.The following if
* The following if statement will be true when * statement will be TRUE when setting GTK.
* setting GTK. At this time we don't handle the state * At this time we don't handle the state in detail.
* in detail. Related CR: 174048 - TL not in * Related CR: 174048 - TL not in authenticated state
* authenticated state */
if (eCSR_ROAM_RESULT_AUTHENTICATED == roamResult)
pHddStaCtx->conn_info.gtk_installed = true;
else
pHddStaCtx->conn_info.ptk_installed = true;
/* In WPA case move STA to authenticated when
* ptk is installed.Earlier in WEP case STA
* was moved to AUTHENTICATED prior to setting
* the unicast key and it was resulting in sending
* few un-encrypted packet. Now in WEP case
* STA state will be moved to AUTHENTICATED
* after we set the unicast and broadcast key.
*/ */
cdf_status = if ((pHddStaCtx->conn_info.ucEncryptionType ==
hdd_change_peer_state(pAdapter, pHddStaCtx->conn_info.staId[0], eCSR_ENCRYPT_TYPE_WEP40) ||
ol_txrx_peer_state_auth, (pHddStaCtx->conn_info.ucEncryptionType ==
#ifdef WLAN_FEATURE_ROAM_OFFLOAD eCSR_ENCRYPT_TYPE_WEP104) ||
pRoamInfo->roamSynchInProgress (pHddStaCtx->conn_info.ucEncryptionType ==
#else eCSR_ENCRYPT_TYPE_WEP40_STATICKEY) ||
false (pHddStaCtx->conn_info.ucEncryptionType ==
#endif eCSR_ENCRYPT_TYPE_WEP104_STATICKEY)) {
); if (pHddStaCtx->conn_info.gtk_installed &&
hdd_conn_set_authenticated(pAdapter, true); pHddStaCtx->conn_info.ptk_installed)
if ((eCSR_ROAM_RESULT_AUTHENTICATED == roamResult) && cdf_status =
(pRoamInfo != NULL) && !pRoamInfo->fAuthRequired) { hdd_change_sta_state_authenticated(pAdapter,
hddLog(LOG3, pRoamInfo);
"Key set for StaId= %d. Changing TL state to AUTHENTICATED", } else if (pHddStaCtx->conn_info.ptk_installed) {
pHddStaCtx->conn_info.staId[0]);
/*
* Connections that do not need Upper layer
* authentication, transition TL to
* 'Authenticated' state after the keys are set.
*/
cdf_status = cdf_status =
hdd_change_peer_state(pAdapter, hdd_change_sta_state_authenticated(pAdapter,
pHddStaCtx->conn_info.staId[0], pRoamInfo);
ol_txrx_peer_state_auth, }
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
pRoamInfo->roamSynchInProgress
#else
false
#endif
);
hdd_conn_set_authenticated(pAdapter, true); if (pHddStaCtx->conn_info.gtk_installed &&
if ((WLAN_HDD_INFRA_STATION == pHddStaCtx->conn_info.ptk_installed) {
pAdapter->device_mode) || pHddStaCtx->conn_info.gtk_installed = false;
(WLAN_HDD_P2P_CLIENT == pHddStaCtx->conn_info.ptk_installed = false;
pAdapter->device_mode)) {
sme_ps_enable_auto_ps_timer
(WLAN_HDD_GET_HAL_CTX(pAdapter),
pAdapter->sessionId,
pHddStaCtx->hdd_ReassocScenario);
}
} }
pHddStaCtx->roam_info.roamingState = pHddStaCtx->roam_info.roamingState =
HDD_ROAM_STATE_NONE; HDD_ROAM_STATE_NONE;
} }
} else { } else {
/* /*