qcacld-3.0: increase the max supported number of MAC ACL

Extend type of the variables for the number of MAC addresses
in ACL, from 255(uint8_t) to 65535(uint16_t).
With this change, it can support up to 65535 MAC addresses in
theory, after modifying the MACRO 'MAX_ACL_MAC_ADDRESS'.

Change-Id: I32288e46ea4590ebaaa143b2cdca7cefd14997c4
CRs-Fixed: 2856707
这个提交包含在:
Yu Wang
2021-01-19 10:48:47 +08:00
提交者 snandini
父节点 8553c2b4d2
当前提交 d91ac3bd8e
修改 5 个文件,包含 35 行新增36 行删除

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. 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
@@ -487,8 +487,8 @@ struct sap_config {
uint32_t ch_width_orig;
uint8_t max_num_sta; /* maximum number of STAs in station table */
uint8_t dtim_period; /* dtim interval */
uint8_t num_accept_mac;
uint8_t num_deny_mac;
uint16_t num_accept_mac;
uint16_t num_deny_mac;
/* Max ie length 255 * 2(WPA+RSN) + 2 bytes(vendor specific ID) * 2 */
uint8_t RSNWPAReqIE[(WLAN_MAX_IE_LEN * 2) + 4];
/* it is ignored if [0] is 0. */
@@ -1002,7 +1002,7 @@ QDF_STATUS wlansap_clear_acl(struct sap_context *sap_ctx);
*/
QDF_STATUS wlansap_get_acl_accept_list(struct sap_context *sap_ctx,
struct qdf_mac_addr *pAcceptList,
uint8_t *nAcceptList);
uint16_t *nAcceptList);
/**
* wlansap_is_channel_present_in_acs_list() - Freq present in ACS list or not
@@ -1028,7 +1028,7 @@ bool wlansap_is_channel_present_in_acs_list(uint32_t freq,
*/
QDF_STATUS wlansap_get_acl_deny_list(struct sap_context *sap_ctx,
struct qdf_mac_addr *pDenyList,
uint8_t *nDenyList);
uint16_t *nDenyList);
/**
* wlansap_set_acl_mode() - Set the SAP ACL mode

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. 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
@@ -3024,9 +3024,9 @@ void sap_free_roam_profile(struct csr_roam_profile *profile)
}
}
void sap_sort_mac_list(struct qdf_mac_addr *macList, uint8_t size)
void sap_sort_mac_list(struct qdf_mac_addr *macList, uint16_t size)
{
uint8_t outer, inner;
uint16_t outer, inner;
struct qdf_mac_addr temp;
int32_t nRes = -1;
@@ -3057,11 +3057,10 @@ void sap_sort_mac_list(struct qdf_mac_addr *macList, uint8_t size)
bool
sap_search_mac_list(struct qdf_mac_addr *macList,
uint8_t num_mac, uint8_t *peerMac,
uint8_t *index)
uint16_t num_mac, uint8_t *peerMac,
uint16_t *index)
{
int32_t nRes = -1;
int8_t nStart = 0, nEnd, nMiddle;
int32_t nRes = -1, nStart = 0, nEnd, nMiddle;
nEnd = num_mac - 1;
@@ -3081,7 +3080,7 @@ sap_search_mac_list(struct qdf_mac_addr *macList,
/* "index equals NULL" means the caller does not need the */
/* index value of the peerMac being searched */
if (index) {
*index = (uint8_t) nMiddle;
*index = (uint16_t)nMiddle;
sap_debug("index %d", *index);
}
return true;
@@ -3097,7 +3096,7 @@ sap_search_mac_list(struct qdf_mac_addr *macList,
}
void sap_add_mac_to_acl(struct qdf_mac_addr *macList,
uint8_t *size, uint8_t *peerMac)
uint16_t *size, uint8_t *peerMac)
{
int32_t nRes = -1;
int i;
@@ -3129,7 +3128,7 @@ void sap_add_mac_to_acl(struct qdf_mac_addr *macList,
}
void sap_remove_mac_from_acl(struct qdf_mac_addr *macList,
uint8_t *size, uint8_t index)
uint16_t *size, uint16_t index)
{
int i;
@@ -3158,9 +3157,9 @@ void sap_remove_mac_from_acl(struct qdf_mac_addr *macList,
(*size)--;
}
void sap_print_acl(struct qdf_mac_addr *macList, uint8_t size)
void sap_print_acl(struct qdf_mac_addr *macList, uint16_t size)
{
int i;
uint16_t i;
uint8_t *macArray;
sap_debug("print acl entered");

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2012-2021 The Linux Foundation. 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
@@ -162,9 +162,9 @@ struct sap_context {
/* Mac filtering settings */
eSapMacAddrACL eSapMacAddrAclMode;
struct qdf_mac_addr acceptMacList[MAX_ACL_MAC_ADDRESS];
uint8_t nAcceptMac;
uint16_t nAcceptMac;
struct qdf_mac_addr denyMacList[MAX_ACL_MAC_ADDRESS];
uint8_t nDenyMac;
uint16_t nDenyMac;
void *user_context;
@@ -319,22 +319,22 @@ QDF_STATUS
sap_is_peer_mac_allowed(struct sap_context *sap_ctx, uint8_t *peerMac);
void
sap_sort_mac_list(struct qdf_mac_addr *macList, uint8_t size);
sap_sort_mac_list(struct qdf_mac_addr *macList, uint16_t size);
void
sap_add_mac_to_acl(struct qdf_mac_addr *macList, uint8_t *size,
uint8_t *peerMac);
sap_add_mac_to_acl(struct qdf_mac_addr *macList, uint16_t *size,
uint8_t *peerMac);
void
sap_remove_mac_from_acl(struct qdf_mac_addr *macList, uint8_t *size,
uint8_t index);
sap_remove_mac_from_acl(struct qdf_mac_addr *macList, uint16_t *size,
uint16_t index);
void
sap_print_acl(struct qdf_mac_addr *macList, uint8_t size);
sap_print_acl(struct qdf_mac_addr *macList, uint16_t size);
bool
sap_search_mac_list(struct qdf_mac_addr *macList, uint8_t num_mac,
uint8_t *peerMac, uint8_t *index);
sap_search_mac_list(struct qdf_mac_addr *macList, uint16_t num_mac,
uint8_t *peerMac, uint16_t *index);
QDF_STATUS sap_init_dfs_channel_nol_list(struct sap_context *sap_ctx);

查看文件

@@ -921,7 +921,7 @@ QDF_STATUS wlansap_get_acl_mode(struct sap_context *sap_ctx,
QDF_STATUS wlansap_get_acl_accept_list(struct sap_context *sap_ctx,
struct qdf_mac_addr *pAcceptList,
uint8_t *nAcceptList)
uint16_t *nAcceptList)
{
if (!sap_ctx) {
sap_err("Invalid SAP pointer");
@@ -936,7 +936,7 @@ QDF_STATUS wlansap_get_acl_accept_list(struct sap_context *sap_ctx,
QDF_STATUS wlansap_get_acl_deny_list(struct sap_context *sap_ctx,
struct qdf_mac_addr *pDenyList,
uint8_t *nDenyList)
uint16_t *nDenyList)
{
if (!sap_ctx) {
sap_err("Invalid SAP pointer from p_cds_gctx");
@@ -951,13 +951,13 @@ QDF_STATUS wlansap_get_acl_deny_list(struct sap_context *sap_ctx,
QDF_STATUS wlansap_clear_acl(struct sap_context *sap_ctx)
{
uint8_t i;
uint16_t i;
if (!sap_ctx) {
return QDF_STATUS_E_RESOURCES;
}
for (i = 0; i < (sap_ctx->nDenyMac - 1); i++) {
for (i = 0; i < sap_ctx->nDenyMac; i++) {
qdf_mem_zero((sap_ctx->denyMacList + i)->bytes,
QDF_MAC_ADDR_SIZE);
}
@@ -965,7 +965,7 @@ QDF_STATUS wlansap_clear_acl(struct sap_context *sap_ctx)
sap_print_acl(sap_ctx->denyMacList, sap_ctx->nDenyMac);
sap_ctx->nDenyMac = 0;
for (i = 0; i < (sap_ctx->nAcceptMac - 1); i++) {
for (i = 0; i < sap_ctx->nAcceptMac; i++) {
qdf_mem_zero((sap_ctx->acceptMacList + i)->bytes,
QDF_MAC_ADDR_SIZE);
}
@@ -981,7 +981,7 @@ QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
eSapACLType list_type, eSapACLCmdType cmd)
{
bool sta_white_list = false, sta_black_list = false;
uint8_t staWLIndex, staBLIndex;
uint16_t staWLIndex, staBLIndex;
if (!sap_ctx) {
sap_err("Invalid SAP Context");