qcacld-3.0: Refine API wlansap_modify_acl()

See change "qcacld-3.0: Refine API wlansap_open()" for the API history.
Update wlansap_modify_acl() to use the true struct pointer type.

Change-Id: I91aa0e55f1f08a28417108dae76205c0785cd163
CRs-Fixed: 2116267
This commit is contained in:
Jeff Johnson 2017-09-24 17:42:11 -07:00 • committed by snandini
commit 42fbe2f0e9
2 changed files with 30 additions and 31 deletions

View file

@ -930,8 +930,23 @@ QDF_STATUS wlansap_get_acl_deny_list(void *pCtx,
struct qdf_mac_addr *pDenyList, uint8_t *nDenyList);
QDF_STATUS wlansap_set_mode(void *p_cds_gctx, uint32_t mode);
QDF_STATUS wlansap_get_acl_mode(void *p_cds_gctx, eSapMacAddrACL *mode);
QDF_STATUS wlansap_modify_acl(void *p_cds_gctx,
uint8_t *pPeerStaMac, eSapACLType listType, eSapACLCmdType cmd);
/**
* wlansap_modify_acl() - Update ACL entries
* @sap_ctx: Pointer to the SAP context
* @peer_sta_mac: peer sta mac to be updated.
* @list_type: white/Black list type.
* @cmd: command to be executed on ACL.
*
* This function is called when a peer needs to be added or deleted from the
* white/black ACL
*
* Return: Status
*/
QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
uint8_t *peer_sta_mac,
eSapACLType list_type, eSapACLCmdType cmd);
QDF_STATUS wlansap_send_action
(void *p_cds_gctx,
const uint8_t *pBuf, uint32_t len, uint16_t wait, uint16_t channel_freq);

View file

@ -1045,27 +1045,12 @@ QDF_STATUS wlansap_clear_acl(void *pCtx)
return QDF_STATUS_SUCCESS;
}
/*
* wlansap_modify_acl() -Update ACL entries
*
* @ctx: Global context
* @peer_sta_mac: peer sta mac to be updated.
* @list_type: white/Black list type.
* @cmd: command to be executed on ACL.
*
* This function is called when a peer needs to be added or deleted from the
* white/black ACL
*
* Return: Status
*/
QDF_STATUS
wlansap_modify_acl
(void *ctx,
uint8_t *peer_sta_mac, eSapACLType list_type, eSapACLCmdType cmd) {
QDF_STATUS wlansap_modify_acl(struct sap_context *sap_ctx,
uint8_t *peer_sta_mac,
eSapACLType list_type, eSapACLCmdType cmd)
{
bool sta_white_list = false, sta_black_list = false;
uint8_t staWLIndex, staBLIndex;
struct sap_context *sap_ctx = CDS_GET_SAP_CB(ctx);
if (NULL == sap_ctx) {
QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
@ -1084,8 +1069,10 @@ wlansap_modify_acl
"*** BLACK LIST ***");
sap_print_acl(sap_ctx->denyMacList, sap_ctx->nDenyMac);
/* the expectation is a mac addr will not be in both the lists at the same time.
It is the responsiblity of userspace to ensure this */
/* the expectation is a mac addr will not be in both the lists
* at the same time. It is the responsiblity of userspace to
* ensure this
*/
sta_white_list =
sap_search_mac_list(sap_ctx->acceptMacList, sap_ctx->nAcceptMac,
peer_sta_mac, &staWLIndex);
@ -1132,8 +1119,7 @@ wlansap_modify_acl
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_WARN,
"STA present in black list so first remove from it");
sap_remove_mac_from_acl(sap_ctx->
denyMacList,
sap_remove_mac_from_acl(sap_ctx->denyMacList,
&sap_ctx->nDenyMac,
staBLIndex);
}
@ -1164,7 +1150,7 @@ wlansap_modify_acl
eCsrForcedDeauthSta,
(SIR_MAC_MGMT_DEAUTH >> 4),
&delStaParams);
wlansap_deauth_sta(ctx, &delStaParams);
wlansap_deauth_sta(sap_ctx, &delStaParams);
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO_LOW,
"size of accept and deny lists %d %d",
@ -1213,10 +1199,8 @@ wlansap_modify_acl
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_WARN,
"Present in white list so first remove from it");
sap_remove_mac_from_acl(sap_ctx->
acceptMacList,
&sap_ctx->
nAcceptMac,
sap_remove_mac_from_acl(sap_ctx->acceptMacList,
&sap_ctx->nAcceptMac,
staWLIndex);
}
/* If we are adding a client to the black list; if its connected, send deauth */
@ -1224,7 +1208,7 @@ wlansap_modify_acl
eCsrForcedDeauthSta,
(SIR_MAC_MGMT_DEAUTH >> 4),
&delStaParams);
wlansap_deauth_sta(ctx, &delStaParams);
wlansap_deauth_sta(sap_ctx, &delStaParams);
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO,
"... Now add to black list");