Ver Fonte

qcacmn: Handle TWT enable/disable failure status

When HOST based TWT is triggered from userspace, while disabling
congestion based TWT, disable/enable TWT may fail due to ongoing
roam operations in firmware. These changes return error code EBUSY
in failure case in vendor command context to userspace.

Change-Id: I3da64b6ea4dcf08cf80966cd7639d8945fe46417
CRs-Fixed: 3520189
Sai Pavan Akhil Remella há 1 ano atrás
pai
commit
ef71aa4c26
1 ficheiros alterados com 8 adições e 1 exclusões
  1. 8 1
      os_if/linux/twt/src/osif_twt_req.c

+ 8 - 1
os_if/linux/twt/src/osif_twt_req.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -62,6 +62,10 @@ int osif_twt_requestor_enable(struct wlan_objmgr_psoc *psoc,
 		goto cleanup;
 	}
 
+	twt_en_priv = osif_request_priv(request);
+	if (twt_en_priv->status != HOST_TWT_ENABLE_STATUS_OK &&
+	    twt_en_priv->status != HOST_TWT_ENABLE_STATUS_ALREADY_ENABLED)
+		ret = -EBUSY;
 cleanup:
 	osif_request_put(request);
 	return ret;
@@ -140,6 +144,9 @@ int osif_twt_requestor_disable(struct wlan_objmgr_psoc *psoc,
 		goto cleanup;
 	}
 
+	twt_en_priv = osif_request_priv(request);
+	if (twt_en_priv->status != HOST_TWT_DISABLE_STATUS_OK)
+		ret = -EBUSY;
 cleanup:
 	osif_request_put(request);
 	return ret;