Explorar o código

qcacld-3.0: Add new ACL command type to not deauth STA

When EasyMesh controller steers client from AP in EasyMesh controller
to AP in EasyMesh agent, EasyMesh controller will add this client to
blacklist ACL of its AP, then send BTM request to this client. When
client is added to ACL, deauth is not expected since EasyMesh controller
would like client to do roaming with BTM request.

Add new ACL command for EasyMesh. Do not deauth station when add station
to ACL or delete station from ACL.

Change-Id: I499c69108259799a9f0742d1371a666f2b3bbed1
CRs-Fixed: 3408175
Bing Sun %!s(int64=2) %!d(string=hai) anos
pai
achega
63c4c052ea
Modificáronse 3 ficheiros con 33 adicións e 20 borrados
  1. 2 2
      core/hdd/src/wlan_hdd_son.c
  2. 5 1
      core/sap/inc/sap_api.h
  3. 26 17
      core/sap/src/sap_module.c

+ 2 - 2
core/hdd/src/wlan_hdd_son.c

@@ -1327,7 +1327,7 @@ static int hdd_son_add_acl_mac(struct wlan_objmgr_vdev *vdev,
 	}
 	}
 	qdf_status = wlansap_modify_acl(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
 	qdf_status = wlansap_modify_acl(WLAN_HDD_GET_SAP_CTX_PTR(adapter),
 					acl_mac->bytes, list_type,
 					acl_mac->bytes, list_type,
-					ADD_STA_TO_ACL);
+					ADD_STA_TO_ACL_NO_DEAUTH);
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		hdd_err("Modify ACL failed");
 		hdd_err("Modify ACL failed");
 		return -EIO;
 		return -EIO;
@@ -1383,7 +1383,7 @@ static int hdd_son_del_acl_mac(struct wlan_objmgr_vdev *vdev,
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 	qdf_status = wlansap_modify_acl(sap_ctx, acl_mac->bytes, list_type,
 	qdf_status = wlansap_modify_acl(sap_ctx, acl_mac->bytes, list_type,
-					DELETE_STA_FROM_ACL);
+					DELETE_STA_FROM_ACL_NO_DEAUTH);
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 	if (QDF_IS_STATUS_ERROR(qdf_status)) {
 		hdd_err("Modify ACL failed");
 		hdd_err("Modify ACL failed");
 		return -EIO;
 		return -EIO;

+ 5 - 1
core/sap/inc/sap_api.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
  * Copyright (c) 2012-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -119,6 +119,10 @@ typedef enum {
 typedef enum {
 typedef enum {
 	ADD_STA_TO_ACL = 0,       /* cmd to add STA to access control list */
 	ADD_STA_TO_ACL = 0,       /* cmd to add STA to access control list */
 	DELETE_STA_FROM_ACL = 1,  /* cmd to del STA from access control list */
 	DELETE_STA_FROM_ACL = 1,  /* cmd to del STA from access control list */
+	/* only add STA to ACL, do not trigger deauth */
+	ADD_STA_TO_ACL_NO_DEAUTH = 2,
+	/* only delete STA from ACL, do not trigger deauth */
+	DELETE_STA_FROM_ACL_NO_DEAUTH = 3,
 } eSapACLCmdType;
 } eSapACLCmdType;
 
 
 typedef enum {
 typedef enum {

+ 26 - 17
core/sap/src/sap_module.c

@@ -1102,7 +1102,7 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
 
 
 	switch (list_type) {
 	switch (list_type) {
 	case SAP_ALLOW_LIST:
 	case SAP_ALLOW_LIST:
-		if (cmd == ADD_STA_TO_ACL) {
+		if (cmd == ADD_STA_TO_ACL || cmd == ADD_STA_TO_ACL_NO_DEAUTH) {
 			/* error check */
 			/* error check */
 			/* if list is already at max, return failure */
 			/* if list is already at max, return failure */
 			if (sap_ctx->nAcceptMac == MAX_ACL_MAC_ADDRESS) {
 			if (sap_ctx->nAcceptMac == MAX_ACL_MAC_ADDRESS) {
@@ -1138,7 +1138,8 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
 				sap_debug("size of accept and deny lists %d %d",
 				sap_debug("size of accept and deny lists %d %d",
 					  sap_ctx->nAcceptMac,
 					  sap_ctx->nAcceptMac,
 					  sap_ctx->nDenyMac);
 					  sap_ctx->nDenyMac);
-		} else if (cmd == DELETE_STA_FROM_ACL) {
+		} else if (cmd == DELETE_STA_FROM_ACL ||
+			   cmd == DELETE_STA_FROM_ACL_NO_DEAUTH) {
 			if (sta_allow_list) {
 			if (sta_allow_list) {
 
 
 				struct csr_del_sta_params delStaParams;
 				struct csr_del_sta_params delStaParams;
@@ -1150,14 +1151,18 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
 				/* If a client is deleted from allow list and */
 				/* If a client is deleted from allow list and */
 				/* it is connected, send deauth
 				/* it is connected, send deauth
 				 */
 				 */
-				wlansap_populate_del_sta_params(peer_sta_mac,
-					eCsrForcedDeauthSta,
-					SIR_MAC_MGMT_DEAUTH,
-					&delStaParams);
-				wlansap_deauth_sta(sap_ctx, &delStaParams);
-				sap_debug("size of accept and deny lists %d %d",
-					  sap_ctx->nAcceptMac,
-					  sap_ctx->nDenyMac);
+				if (cmd == DELETE_STA_FROM_ACL) {
+					wlansap_populate_del_sta_params(
+						peer_sta_mac,
+						eCsrForcedDeauthSta,
+						SIR_MAC_MGMT_DEAUTH,
+						&delStaParams);
+					wlansap_deauth_sta(sap_ctx,
+							   &delStaParams);
+					sap_debug("size of accept and deny lists %d %d",
+						  sap_ctx->nAcceptMac,
+						  sap_ctx->nDenyMac);
+				}
 			} else {
 			} else {
 				sap_warn("MAC address to be deleted is not present in the allow list "
 				sap_warn("MAC address to be deleted is not present in the allow list "
 					 QDF_MAC_ADDR_FMT,
 					 QDF_MAC_ADDR_FMT,
@@ -1172,7 +1177,7 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
 
 
 	case SAP_DENY_LIST:
 	case SAP_DENY_LIST:
 
 
-		if (cmd == ADD_STA_TO_ACL) {
+		if (cmd == ADD_STA_TO_ACL || cmd == ADD_STA_TO_ACL_NO_DEAUTH) {
 			struct csr_del_sta_params delStaParams;
 			struct csr_del_sta_params delStaParams;
 			/* error check */
 			/* error check */
 			/* if list is already at max, return failure */
 			/* if list is already at max, return failure */
@@ -1205,18 +1210,22 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
 			/* If we are adding a client to the deny list; */
 			/* If we are adding a client to the deny list; */
 			/* if its connected, send deauth
 			/* if its connected, send deauth
 			 */
 			 */
-			wlansap_populate_del_sta_params(peer_sta_mac,
-				eCsrForcedDeauthSta,
-				SIR_MAC_MGMT_DEAUTH,
-				&delStaParams);
-			wlansap_deauth_sta(sap_ctx, &delStaParams);
+			if (cmd == ADD_STA_TO_ACL) {
+				wlansap_populate_del_sta_params(
+					peer_sta_mac,
+					eCsrForcedDeauthSta,
+					SIR_MAC_MGMT_DEAUTH,
+					&delStaParams);
+				wlansap_deauth_sta(sap_ctx, &delStaParams);
+			}
 			sap_info("... Now add to deny list");
 			sap_info("... Now add to deny list");
 			sap_add_mac_to_acl(sap_ctx->denyMacList,
 			sap_add_mac_to_acl(sap_ctx->denyMacList,
 				       &sap_ctx->nDenyMac, peer_sta_mac);
 				       &sap_ctx->nDenyMac, peer_sta_mac);
 			sap_debug("size of accept and deny lists %d %d",
 			sap_debug("size of accept and deny lists %d %d",
 				  sap_ctx->nAcceptMac,
 				  sap_ctx->nAcceptMac,
 				  sap_ctx->nDenyMac);
 				  sap_ctx->nDenyMac);
-		} else if (cmd == DELETE_STA_FROM_ACL) {
+		} else if (cmd == DELETE_STA_FROM_ACL ||
+			   cmd == DELETE_STA_FROM_ACL_NO_DEAUTH) {
 			if (sta_deny_list) {
 			if (sta_deny_list) {
 				sap_info("Delete from deny list");
 				sap_info("Delete from deny list");
 				sap_remove_mac_from_acl(sap_ctx->denyMacList,
 				sap_remove_mac_from_acl(sap_ctx->denyMacList,