Browse Source

qcacld-3.0: Indicate roc expire event to supplicant

qcacld-2.0 to qcacld-3.0 propagation

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.

Change-Id: I66896dd1e98d83b92d4f1e60c7057acd80743929
CRs-Fixed: 2002054
Ganesh Kondabattini 8 years ago
parent
commit
2da6ac02a6
1 changed files with 45 additions and 5 deletions
  1. 45 5
      core/hdd/src/wlan_hdd_p2p.c

+ 45 - 5
core/hdd/src/wlan_hdd_p2p.c

@@ -1138,13 +1138,53 @@ __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)) {
+
+	if (pRemainChanCtx) {
+		hdd_notice("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) {
+					hdd_debug("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);
+			hdd_debug("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);
+			hdd_debug("No matching cookie");
+			return -EINVAL;
+		}
+	} else {
 		mutex_unlock(&cfgState->remain_on_chan_ctx_lock);
-		hdd_err("No Remain on channel pending with specified cookie value");
-		return -EINVAL;
+		hdd_debug("RoC context is NULL, return success");
+		return 0;
 	}
-
 	if (NULL != cfgState->remain_on_chan_ctx) {
 		if (qdf_mc_timer_stop(&cfgState->remain_on_chan_ctx->
 					hdd_remain_on_chan_timer)