qcacmn: Add support to send RX filter WMI command to firmware

On the initiator side, Host needs to send
WMI_VDEV_ADD_MAC_ADDR_TO_RX_FILTER_CMDID to firmware before sending the
PASN Auth frame. Hence, move send_set_mac_addr_rx_filter_cmd_tlv() from
wmi_unified_p2p_tlv.c to wmi_unified_tlv.c file.

Change-Id: Ia5517dbdd5ec46f611537b12b7046e3a9d859082
CRs-Fixed: 3304909
This commit is contained in:
Shashikala Prabhu
2022-10-03 16:59:50 +05:30
committed by Madan Koyyalamudi
vanhempi 2c92bf0c9c
commit 8ba6f73786
9 muutettua tiedostoa jossa 93 lisäystä ja 83 poistoa

Näytä tiedosto

@@ -587,7 +587,6 @@ struct wlan_lmac_if_scan_rx_ops {
/* forward declarations for p2p tx ops */
struct p2p_ps_config;
struct p2p_lo_start;
struct p2p_set_mac_filter;
/**
* struct wlan_lmac_if_p2p_tx_ops - structure of tx function pointers
@@ -628,7 +627,7 @@ struct wlan_lmac_if_p2p_tx_ops {
struct wlan_objmgr_psoc *psoc, bool reg);
QDF_STATUS (*set_mac_addr_rx_filter_cmd)(
struct wlan_objmgr_psoc *psoc,
struct p2p_set_mac_filter *param);
struct set_rx_mac_filter *param);
#ifdef WLAN_FEATURE_MCC_QUOTA
QDF_STATUS (*reg_mcc_quota_ev_handler)(struct wlan_objmgr_psoc *psoc,
bool reg);

Näytä tiedosto

@@ -702,6 +702,20 @@ struct set_multiple_pdev_vdev_param {
struct dev_set_param *params;
};
/**
* struct set_rx_mac_filter - Set rx mac filter command parameters
* @vdev_id: Vdev id
* @mac: mac addr
* @freq: frequency
* @set: set or clear
*/
struct set_rx_mac_filter {
uint32_t vdev_id;
uint8_t mac[QDF_MAC_ADDR_SIZE];
uint32_t freq;
bool set;
};
static inline
QDF_STATUS mlme_check_index_setparam(struct dev_set_param *param,
uint32_t paramid, uint32_t paramvalue,

Näytä tiedosto

@@ -903,6 +903,16 @@ QDF_STATUS
wmi_unified_multiple_vdev_param_send(wmi_unified_t wmi_handle,
struct set_multiple_pdev_vdev_param *params);
/**
* wmi_unified_set_mac_addr_rx_filter() - set mac addr rx filter cmd
* @wmi_handle: wmi handle
* @param: Pointer to set mac filter struct
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS
wmi_unified_set_mac_addr_rx_filter(wmi_unified_t wmi_handle,
struct set_rx_mac_filter *param);
/**
* wmi_unified_multiple_pdev_param_send() - sends multiple pdev set params
* @wmi_handle: handle to WMI.

Näytä tiedosto

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 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
@@ -56,17 +57,6 @@ QDF_STATUS wmi_extract_p2p_noa_ev_param(wmi_unified_t wmi_handle,
void *evt_buf,
struct p2p_noa_info *param);
/**
* wmi_send_set_mac_addr_rx_filter_cmd() - set mac addr rx filter cmd
* @wmi_handle: wmi handle
* @param: Pointer to set mac filter struct
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS
wmi_send_set_mac_addr_rx_filter_cmd(wmi_unified_t wmi_handle,
struct p2p_set_mac_filter *param);
/**
* wmi_extract_mac_addr_rx_filter_evt_param() - extract mac addr rx filter evt
* @wmi_handle: wmi handle

Näytä tiedosto

@@ -1977,14 +1977,15 @@ QDF_STATUS (*extract_p2p_lo_stop_ev_param)(wmi_unified_t wmi_handle,
QDF_STATUS (*extract_p2p_noa_ev_param)(wmi_unified_t wmi_handle,
void *evt_buf, struct p2p_noa_info *param);
QDF_STATUS (*set_mac_addr_rx_filter)(wmi_unified_t wmi_handle,
struct p2p_set_mac_filter *param);
QDF_STATUS
(*extract_mac_addr_rx_filter_evt_param)(wmi_unified_t wmi_handle,
void *evt_buf,
struct p2p_set_mac_filter_evt *param);
#endif
QDF_STATUS (*set_mac_addr_rx_filter)(wmi_unified_t wmi_handle,
struct set_rx_mac_filter *param);
#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
QDF_STATUS
(*extract_interop_issues_ap_ev_param)(wmi_unified_t wmi_handle, void *evt_buf,

Näytä tiedosto

@@ -312,6 +312,16 @@ wmi_unified_multiple_vdev_param_send(wmi_unified_t wmi_handle,
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS
wmi_unified_set_mac_addr_rx_filter(wmi_unified_t wmi_handle,
struct set_rx_mac_filter *params)
{
if (wmi_handle->ops->set_mac_addr_rx_filter)
return wmi_handle->ops->set_mac_addr_rx_filter(wmi_handle,
params);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS wmi_unified_suspend_send(wmi_unified_t wmi_handle,
struct suspend_params *param,
uint8_t mac_id)

Näytä tiedosto

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 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
@@ -58,22 +59,6 @@ QDF_STATUS wmi_extract_p2p_noa_ev_param(wmi_unified_t wmi_handle,
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS
wmi_send_set_mac_addr_rx_filter_cmd(wmi_unified_t wmi_handle,
struct p2p_set_mac_filter *param)
{
if (!wmi_handle) {
wmi_err("wmi handle is null");
return QDF_STATUS_E_INVAL;
}
if (wmi_handle->ops->set_mac_addr_rx_filter)
return wmi_handle->ops->set_mac_addr_rx_filter(
wmi_handle, param);
return QDF_STATUS_E_FAILURE;
}
QDF_STATUS
wmi_extract_mac_addr_rx_filter_evt_param(wmi_unified_t wmi_handle,
void *evt_buf,

Näytä tiedosto

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-2018, 2020 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 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
@@ -207,57 +208,6 @@ static QDF_STATUS extract_p2p_noa_ev_param_tlv(
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS
send_set_mac_addr_rx_filter_cmd_tlv(wmi_unified_t wmi_handle,
struct p2p_set_mac_filter *param)
{
wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param *cmd;
uint32_t len;
wmi_buf_t buf;
int ret;
if (!wmi_handle) {
wmi_err("WMA context is invald!");
return QDF_STATUS_E_INVAL;
}
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
wmi_err("Failed allocate wmi buffer");
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param *)
wmi_buf_data(buf);
WMITLV_SET_HDR(
&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param));
cmd->vdev_id = param->vdev_id;
cmd->freq = param->freq;
WMI_CHAR_ARRAY_TO_MAC_ADDR(param->mac, &cmd->mac_addr);
if (param->set)
cmd->enable = 1;
else
cmd->enable = 0;
wmi_debug("set random mac rx vdev %d freq %d set %d "QDF_MAC_ADDR_FMT,
param->vdev_id, param->freq, param->set,
QDF_MAC_ADDR_REF(param->mac));
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_VDEV_ADD_MAC_ADDR_TO_RX_FILTER_CMDID);
if (ret) {
wmi_err("Failed to send action frame random mac cmd");
wmi_buf_free(buf);
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS extract_mac_addr_rx_filter_evt_param_tlv(
wmi_unified_t wmi_handle, void *evt_buf,
struct p2p_set_mac_filter_evt *param)
@@ -474,7 +424,6 @@ void wmi_p2p_attach_tlv(wmi_unified_t wmi_handle)
ops->send_set_p2pgo_oppps_req_cmd = send_set_p2pgo_oppps_req_cmd_tlv;
ops->send_set_p2pgo_noa_req_cmd = send_set_p2pgo_noa_req_cmd_tlv;
ops->extract_p2p_noa_ev_param = extract_p2p_noa_ev_param_tlv;
ops->set_mac_addr_rx_filter = send_set_mac_addr_rx_filter_cmd_tlv,
ops->extract_mac_addr_rx_filter_evt_param =
extract_mac_addr_rx_filter_evt_param_tlv,
wmi_p2p_listen_offload_attach_tlv(wmi_handle);

Näytä tiedosto

@@ -19550,6 +19550,57 @@ extract_pdev_telemetry_stats_tlv(
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS
send_set_mac_addr_rx_filter_cmd_tlv(wmi_unified_t wmi_handle,
struct set_rx_mac_filter *param)
{
wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param *cmd;
uint32_t len;
wmi_buf_t buf;
int ret;
if (!wmi_handle) {
wmi_err("WMA context is invalid!");
return QDF_STATUS_E_INVAL;
}
len = sizeof(*cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
wmi_err("Failed allocate wmi buffer");
return QDF_STATUS_E_NOMEM;
}
cmd = (wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param *)
wmi_buf_data(buf);
WMITLV_SET_HDR(
&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN(
wmi_vdev_add_mac_addr_to_rx_filter_cmd_fixed_param));
cmd->vdev_id = param->vdev_id;
cmd->freq = param->freq;
WMI_CHAR_ARRAY_TO_MAC_ADDR(param->mac, &cmd->mac_addr);
if (param->set)
cmd->enable = 1;
else
cmd->enable = 0;
wmi_debug("set random mac rx vdev:%d freq:%d set:%d " QDF_MAC_ADDR_FMT,
param->vdev_id, param->freq, param->set,
QDF_MAC_ADDR_REF(param->mac));
ret = wmi_unified_cmd_send(wmi_handle, buf, len,
WMI_VDEV_ADD_MAC_ADDR_TO_RX_FILTER_CMDID);
if (ret) {
wmi_err("Failed to send action frame random mac cmd");
wmi_buf_free(buf);
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
struct wmi_ops tlv_ops = {
.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
@@ -20025,6 +20076,7 @@ struct wmi_ops tlv_ops = {
extract_health_mon_init_done_info_event_tlv,
#endif /* HEALTH_MON_SUPPORT */
.send_multiple_vdev_param_cmd = send_multiple_vdev_param_cmd_tlv,
.set_mac_addr_rx_filter = send_set_mac_addr_rx_filter_cmd_tlv,
};
#ifdef WLAN_FEATURE_11BE_MLO