瀏覽代碼

qcacmn: Add tx peer filtering WMI command

Add WMI command for tx peer filtering. This command is needed to send
the mac address to FW for which tx monitor peer filtering is needed
to be done.

Change-Id: Ia141fba81ba240b7f4ca015eb9251e3485294bb6
CRs-Fixed: 3199493
Nandha Kishore Easwaran 3 年之前
父節點
當前提交
422bbf322b

+ 18 - 0
dp/inc/cdp_txrx_ops.h

@@ -59,6 +59,20 @@ enum cdp_nac_param_cmd {
 	CDP_NAC_PARAM_LIST,
 };
 
+/**
+ * enum cdp_tx_filter_action - TX peer filtering action
+ * @CDP_TX_FILTER_ACTION_ADD: add peer
+ * @CDP_TX_FILTER_ACTION_DEL: delete peer
+ *
+ * whether add or delete
+ */
+enum cdp_tx_filter_action {
+	/* add peer mac address*/
+	CDP_TX_FILTER_ACTION_ADD = 1,
+	/* delete peer mac address */
+	CDP_TX_FILTER_ACTION_DEL,
+};
+
 #define CDP_DELBA_INTERVAL_MS 3000
 /**
  * enum cdp_delba_rcode - CDP reason code for sending DELBA
@@ -1404,6 +1418,10 @@ struct ol_if_ops {
 				    uint8_t vdev_id,
 				    enum cdp_nac_param_cmd cmd,
 				    uint8_t *peer_mac);
+	int (*config_lite_mon_tx_peer)(struct cdp_ctrl_objmgr_psoc *psoc,
+				       uint8_t pdev_id, uint8_t vdev_id,
+				       enum cdp_tx_filter_action cmd,
+				       uint8_t *peer_mac);
 #endif
 };
 

+ 12 - 0
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h

@@ -532,6 +532,18 @@ struct set_neighbour_rx_params {
 	uint32_t type;
 };
 
+/**
+ * struct set_tx_peer_filter - Set tx peer filter
+ * @vdev_id: vdev id
+ * @idx: index of param
+ * @action: action
+ */
+struct set_tx_peer_filter {
+	uint8_t vdev_id;
+	uint32_t idx;
+	uint32_t action;
+};
+
 /**
  * struct vdev_scan_nac_rssi_params - NAC_RSSI cmd parameter
  * @vdev_id: vdev id

+ 5 - 0
wmi/inc/wmi_unified_priv.h

@@ -3008,6 +3008,11 @@ QDF_STATUS
 				    uint8_t *chip_info,
 				    uint32_t *pktlog_json_version);
 
+QDF_STATUS
+(*send_peer_filter_set_tx_cmd)(wmi_unified_t wmi_handle,
+			       uint8_t macaddr[],
+			       struct set_tx_peer_filter *param);
+
 QDF_STATUS
 (*extract_pdev_telemetry_stats)(
 		wmi_unified_t wmi_handle, void *evt_buf,

+ 14 - 0
wmi/inc/wmi_unified_vdev_api.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2016-2021 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
@@ -26,6 +27,19 @@
 
 #include <wmi_unified_api.h>
 
+/**
+ *  wmi_unified_peer_filter_set_tx_cmd_send() - WMI set tx peer filter function
+ *  @param wmi_handle: handle to WMI.
+ *  @param macaddr: MAC address
+ *  @param param: pointer to hold peer filter parameter
+ *
+ *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_unified_peer_filter_set_tx_cmd_send(struct wmi_unified *wmi_handle,
+					uint8_t macaddr[],
+					struct set_tx_peer_filter *param);
+
 /**
  *  wmi_unified_vdev_set_neighbour_rx_cmd_send() - WMI set neighbour rx function
  *  @param wmi_handle: handle to WMI.

+ 14 - 0
wmi/src/wmi_unified_vdev_api.c

@@ -155,6 +155,20 @@ wmi_unified_vdev_config_ratemask_cmd_send(struct wmi_unified *wmi_handle,
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS
+wmi_unified_peer_filter_set_tx_cmd_send(struct wmi_unified *wmi_handle,
+					uint8_t macaddr[],
+					struct set_tx_peer_filter *param)
+{
+	struct wmi_ops *ops = wmi_handle->ops;
+
+	if (ops->send_peer_filter_set_tx_cmd)
+		return ops->send_peer_filter_set_tx_cmd(wmi_handle, macaddr,
+							param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 QDF_STATUS wmi_unified_vdev_set_neighbour_rx_cmd_send(
 				struct wmi_unified *wmi_handle,
 				uint8_t macaddr[QDF_MAC_ADDR_SIZE],

+ 35 - 0
wmi/src/wmi_unified_vdev_tlv.c

@@ -135,6 +135,40 @@ extract_tbttoffset_num_vdevs_tlv(struct wmi_unified *wmi_handle, void *evt_buf,
 	return QDF_STATUS_SUCCESS;
 }
 
+static QDF_STATUS
+send_peer_filter_set_tx_cmd_tlv(struct wmi_unified *wmi_handle,
+				uint8_t macaddr[],
+				struct set_tx_peer_filter *param)
+{
+	wmi_peer_tx_filter_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	uint32_t len = sizeof(*cmd);
+
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf)
+		return QDF_STATUS_E_FAILURE;
+
+	cmd = (wmi_peer_tx_filter_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_peer_tx_filter_cmd_fixed_param,
+		       WMITLV_GET_STRUCT_TLVLEN(
+		       wmi_peer_tx_filter_cmd_fixed_param));
+
+	cmd->vdev_id = param->vdev_id;
+	cmd->action = param->action;
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->addr);
+
+	wmi_mtrace(WMI_PEER_TX_FILTER_CMDID, cmd->vdev_id, 0);
+	if (wmi_unified_cmd_send(wmi_handle, buf, len,
+				 WMI_PEER_TX_FILTER_CMDID)) {
+		wmi_err("Failed to set neighbour rx param");
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 static QDF_STATUS
 send_vdev_set_neighbour_rx_cmd_tlv(struct wmi_unified *wmi_handle,
 				   uint8_t macaddr[QDF_MAC_ADDR_SIZE],
@@ -420,4 +454,5 @@ void wmi_vdev_attach_tlv(struct wmi_unified *wmi_handle)
 	wmi_ops->send_beacon_send_cmd = send_beacon_send_cmd_tlv;
 	wmi_ops->send_vdev_config_ratemask_cmd =
 				send_vdev_config_ratemask_cmd_tlv;
+	wmi_ops->send_peer_filter_set_tx_cmd = send_peer_filter_set_tx_cmd_tlv;
 }