summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirav Shah <nnshah@qti.qualcomm.com>2014-03-08 15:16:12 +0530
committerAkash Patel <c_akashp@qca.qualcomm.com>2014-03-13 11:08:20 -0700
commit6852d930581926db91ef490e77cde5ac83b4aa3d (patch)
tree92d6f35f1bc0eeaa0cc19895cb8b87ba9ad8ee6a
parent04e42ca4b3cc344c63294a92359a608d0744658f (diff)
P2P: Indicate appropiate RoC events to supplicant
Implement internalRoCinProgress flag for cleaner approach to indicate appropriate RoC events to supplicant Change-Id: Iba610f2a242f74ede5cb85ccf882a15b57f9c2b6 CRs-Fixed: 626345
-rw-r--r--CORE/HDD/inc/wlan_hdd_main.h4
-rw-r--r--CORE/HDD/src/wlan_hdd_p2p.c74
2 files changed, 62 insertions, 16 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h
index 68724ce159ca..9c47f90bb47d 100644
--- a/CORE/HDD/inc/wlan_hdd_main.h
+++ b/CORE/HDD/inc/wlan_hdd_main.h
@@ -1025,9 +1025,7 @@ struct hdd_adapter_s
v_U8_t psbChanged;
/* UAPSD psb value configured through framework */
v_U8_t configuredPsb;
-#ifdef QCA_WIFI_2_0
- v_BOOL_t internalCancelRemainOnChReq;
-#endif
+ v_BOOL_t internalRoCinProgress;
#ifdef IPA_OFFLOAD
void *ipa_context;
#endif
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c
index 0fd41dca1fb1..a969e6d1763e 100644
--- a/CORE/HDD/src/wlan_hdd_p2p.c
+++ b/CORE/HDD/src/wlan_hdd_p2p.c
@@ -156,7 +156,7 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx,
cfgState->remain_on_chan_ctx = NULL;
if( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request &&
- !pAdapter->internalCancelRemainOnChReq )
+ (pAdapter->internalRoCinProgress == VOS_FALSE) )
{
if( cfgState->buf )
{
@@ -177,7 +177,6 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx,
#endif
GFP_KERNEL);
}
- pAdapter->internalCancelRemainOnChReq = VOS_FALSE;
if ( ( WLAN_HDD_INFRA_STATION == pAdapter->device_mode ) ||
( WLAN_HDD_P2P_CLIENT == pAdapter->device_mode ) ||
@@ -185,7 +184,7 @@ eHalStatus wlan_hdd_remain_on_channel_callback( tHalHandle hHal, void* pCtx,
)
{
tANI_U8 sessionId = pAdapter->sessionId;
- if( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request )
+ if( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request)
{
sme_DeregisterMgmtFrame(
hHal, sessionId,
@@ -458,7 +457,8 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter )
pRemainChanCtx->p2pRemOnChanTimeStamp =
vos_timer_get_system_time() - READY_EVENT_PROPOGATE_TIME;
- if( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request )
+ if( REMAIN_ON_CHANNEL_REQUEST == pRemainChanCtx->rem_on_chan_request
+ && (pAdapter->internalRoCinProgress == VOS_FALSE) )
{
cfg80211_ready_on_channel(
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
@@ -474,7 +474,8 @@ void hdd_remainChanReadyHandler( hdd_adapter_t *pAdapter )
pRemainChanCtx->duration, GFP_KERNEL );
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
- else if( OFF_CHANNEL_ACTION_TX == pRemainChanCtx->rem_on_chan_request )
+ else if( OFF_CHANNEL_ACTION_TX == pRemainChanCtx->rem_on_chan_request
+ || (pAdapter->internalRoCinProgress == VOS_TRUE))
{
complete(&pAdapter->offchannel_tx_event);
}
@@ -618,7 +619,6 @@ int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
hdd_adapter_t *goAdapter;
#endif
- u64 old_cookie = 0;
status = wlan_hdd_validate_context(pHddCtx);
@@ -746,7 +746,8 @@ int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
if( offchan && wait)
{
int status;
-
+ hdd_remain_on_chan_ctx_t old_roc_ctx;
+ rem_on_channel_request_type_t req_type = OFF_CHANNEL_ACTION_TX;
// In case of P2P Client mode if we are already
// on the same channel then send the frame directly
@@ -786,14 +787,16 @@ int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
ESTIMATED_ROC_DUR_REQD_FOR_ACTION_TX))
{
hddLog(LOG1,"action frame: Extending the RoC");
- old_cookie = cfgState->remain_on_chan_ctx->cookie;
- pAdapter->internalCancelRemainOnChReq = VOS_TRUE;
+ pAdapter->internalRoCinProgress = VOS_TRUE;
+ // saved old RoC Context
+ vos_mem_copy(&old_roc_ctx,cfgState->remain_on_chan_ctx,
+ sizeof(hdd_remain_on_chan_ctx_t));
status = wlan_hdd_check_remain_on_channel(pAdapter);
- pAdapter->internalCancelRemainOnChReq = VOS_FALSE;
if ( status )
{
VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
"Failed to cancel the existing RoC");
+ pAdapter->internalRoCinProgress = VOS_FALSE;
}
}
}
@@ -808,6 +811,9 @@ int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
}
INIT_COMPLETION(pAdapter->offchannel_tx_event);
+ // Restore request type if it is internal RoC.
+ if(pAdapter->internalRoCinProgress == VOS_TRUE)
+ req_type = old_roc_ctx.rem_on_chan_request;
status = wlan_hdd_request_remain_on_channel(wiphy, dev,
chan,
@@ -815,14 +821,35 @@ int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
channel_type,
#endif
wait, cookie,
- OFF_CHANNEL_ACTION_TX);
+ req_type);
// Assign the preserved cookie value here to appear as
// same RoC to supplicant
- if (old_cookie)
- cfgState->remain_on_chan_ctx->cookie = old_cookie;
+ if (pAdapter->internalRoCinProgress == VOS_TRUE)
+ cfgState->remain_on_chan_ctx->cookie = old_roc_ctx.cookie;
+
if(0 != status)
{
+ // If new RoC request fails then indicate complete RoC
+ // to supplicant if internalRoCinProgress using old RoC Context
+ if(pAdapter->internalRoCinProgress == VOS_TRUE)
+ {
+ hddLog( LOGE, "Indicate Complete RoC to supplicant for"
+ "cookie %llu",old_roc_ctx.cookie);
+ cfg80211_remain_on_channel_expired(
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
+ old_roc_ctx.dev->ieee80211_ptr,
+#else
+ old_roc_ctx.dev,
+#endif
+ old_roc_ctx.cookie,
+ &old_roc_ctx.chan,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
+ old_roc_ctx.chan_type,
+#endif
+ GFP_KERNEL);
+ pAdapter->internalRoCinProgress = VOS_FALSE;
+ }
if( (-EBUSY == status) &&
(cfgState->current_freq == chan->center_freq) )
{
@@ -841,10 +868,31 @@ int wlan_hdd_action( struct wiphy *wiphy, struct net_device *dev,
msecs_to_jiffies(WAIT_CHANGE_CHANNEL_FOR_OFFCHANNEL_TX));
if(!status)
{
+ // If Ready indication timeout occuers then indicate complete
+ // RoC to supplicant is internalRoCin Progress is set
+ if(pAdapter->internalRoCinProgress == VOS_TRUE)
+ {
+ hddLog( LOGE, "Indicate Complete RoC to supplicant for"
+ "cookie %llu Timeout",cfgState->remain_on_chan_ctx->cookie);
+ cfg80211_remain_on_channel_expired(
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
+ cfgState->remain_on_chan_ctx->dev->ieee80211_ptr,
+#else
+ cfgState->remain_on_chan_ctx->dev,
+#endif
+ cfgState->remain_on_chan_ctx->cookie,
+ &cfgState->remain_on_chan_ctx->chan,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
+ cfgState->remain_on_chan_ctx->chan_type,
+#endif
+ GFP_KERNEL);
+ pAdapter->internalRoCinProgress = VOS_FALSE;
+ }
hddLog( LOGE, "Not able to complete remain on channel request"
" within timeout period");
goto err_rem_channel;
}
+ pAdapter->internalRoCinProgress = VOS_FALSE;
}
else if ( offchan )
{