diff options
| author | Ganesh Kondabattini <ganeshk@codeaurora.org> | 2017-01-11 12:45:22 +0530 |
|---|---|---|
| committer | Nishank Aggarwal <naggar@codeaurora.org> | 2017-02-03 15:52:54 +0530 |
| commit | 2dee4079f3e377cb1e8d1d4b18a6aad08391d807 (patch) | |
| tree | 438c7a553ea27d69aa75932a20d6cda022cb02b4 | |
| parent | 4ff2953e970da6e326716b96b08f52b0608e8424 (diff) | |
qcacld-2.0: Indicate roc expire event to supplicant
When extending the RoC for off channel tx, the cookie of of the RoC
is changed to action cookie so that RoC request and off channel tx
mapped to same tx frame. Indicate roc expire event to the supplicant
for the RoC request before updating the RoC cookie with action cookie.
CRs-Fixed: 2002054
Change-Id: I66896dd1e98d83b92d4f1e60c7057acd80743929
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_p2p.c | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/CORE/HDD/src/wlan_hdd_p2p.c b/CORE/HDD/src/wlan_hdd_p2p.c index 68f76a49d69e..df5f60a4dbd7 100644 --- a/CORE/HDD/src/wlan_hdd_p2p.c +++ b/CORE/HDD/src/wlan_hdd_p2p.c @@ -1252,14 +1252,49 @@ int __wlan_hdd_cfg80211_cancel_remain_on_channel( struct wiphy *wiphy, */ mutex_lock(&cfgState->remain_on_chan_ctx_lock); pRemainChanCtx = cfgState->remain_on_chan_ctx; - if( (cfgState->remain_on_chan_ctx == NULL) || - (cfgState->remain_on_chan_ctx->cookie != cookie) ) - { - mutex_unlock(&cfgState->remain_on_chan_ctx_lock); - hddLog( LOGE, - "%s: No Remain on channel pending with specified cookie value", - __func__); - return 0; + + if (pRemainChanCtx) { + hddLog(LOGE, + "action_cookie = %08llx, roc cookie = %08llx, cookie = %08llx", + cfgState->action_cookie, pRemainChanCtx->cookie, cookie); + + if (pRemainChanCtx->cookie == cookie) { + /* request to cancel on-going roc */ + if (cfgState->buf) { + /* Tx frame pending */ + if (cfgState->action_cookie != cookie) { + hddLog( LOGE, + FL("Cookie matched with RoC cookie but not with tx cookie, indicate expired event for roc")); + /* RoC was extended to accomodate the tx frame */ + if (REMAIN_ON_CHANNEL_REQUEST == + pRemainChanCtx->rem_on_chan_request) { + cfg80211_remain_on_channel_expired(pRemainChanCtx->dev-> + ieee80211_ptr, + pRemainChanCtx->cookie, + &pRemainChanCtx->chan, + GFP_KERNEL); + } + pRemainChanCtx->rem_on_chan_request = OFF_CHANNEL_ACTION_TX; + pRemainChanCtx->cookie = cfgState->action_cookie; + return 0; + } + } + } else if (cfgState->buf && cfgState->action_cookie == cookie) { + mutex_unlock(&cfgState->remain_on_chan_ctx_lock); + hddLog( LOGE, + FL("Cookie not matched with RoC cookie but matched with tx cookie, cleanup action frame")); + /*free the buf and return 0*/ + hdd_cleanup_actionframe(pHddCtx, pAdapter); + return 0; + } else { + mutex_unlock(&cfgState->remain_on_chan_ctx_lock); + hddLog( LOGE, FL("No matching cookie")); + return -EINVAL; + } + } else { + mutex_unlock(&cfgState->remain_on_chan_ctx_lock); + hddLog( LOGE, FL("RoC context is NULL, return success")); + return 0; } if (NULL != cfgState->remain_on_chan_ctx) |
