Эх сурвалжийг харах

qcacmn: WMI command to delete multiple WDS entries

Added new WMI command to delete multiple WDS entries.

Change-Id: Ifa40d8d96c645f12c4887763ce0aebb874306382
CRs-Fixed: 2291453
Rathees kumar Chinannan 6 жил өмнө
parent
commit
b0bedad338

+ 11 - 0
wmi/inc/wmi_unified_ap_api.h

@@ -236,4 +236,15 @@ QDF_STATUS wmi_extract_channel_hopping_event(void *wmi_hdl, void *evt_buf,
 
 QDF_STATUS wmi_unified_peer_chan_width_switch_cmd_send(void *wmi_hdl,
 			struct peer_chan_width_switch_params *param);
+
+/**
+ * wmi_unified_peer_del_all_wds_entries_cmd_send() - send delete
+ * all wds entries cmd to fw
+ * @wmi_hdl: wmi handle
+ * @param:   delete all wds entries params
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+QDF_STATUS wmi_unified_peer_del_all_wds_entries_cmd_send(void *wmi_hdl,
+		struct peer_del_all_wds_entries_params *param);
 #endif /* _WMI_UNIFIED_AP_API_H_ */

+ 12 - 0
wmi/inc/wmi_unified_param.h

@@ -3204,6 +3204,18 @@ struct peer_update_wds_entry_params {
 	uint32_t vdev_id;
 };
 
+/**
+ * struct peer_del_all_wds_entries_params - WDS peer entries del params
+ * @wds_macaddr: Pointer to destination macaddr
+ * @peer_macaddr: Pointer to peer mac addr
+ * @flags: flags
+ */
+struct peer_del_all_wds_entries_params {
+	uint8_t *wds_macaddr;
+	uint8_t *peer_macaddr;
+	uint32_t flags;
+};
+
 /**
  * struct set_ps_mode_params - PS mode params
  * @vdev_id: vdev id

+ 4 - 0
wmi/inc/wmi_unified_priv.h

@@ -1851,6 +1851,10 @@ QDF_STATUS
 		wmi_unified_t wmi_handle,
 		void *evt_buf,
 		struct wmi_host_pdev_ctl_failsafe_event *param);
+
+QDF_STATUS (*send_peer_del_all_wds_entries_cmd)(wmi_unified_t wmi_handle,
+		struct peer_del_all_wds_entries_params *param);
+
 };
 
 /* Forward declartion for psoc*/

+ 20 - 0
wmi/src/wmi_unified_ap_api.c

@@ -1099,3 +1099,23 @@ QDF_STATUS wmi_unified_peer_chan_width_switch_cmd_send(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+/**
+ *  wmi_unified_peer_del_all_wds_entries_cmd_send() - WMI del wds
+ *  entries cmd function
+ *  @param wmi_handle      : handle to WMI.
+ *  @param param    : pointer to hold wds entry param
+ *
+ *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_peer_del_all_wds_entries_cmd_send(void *wmi_hdl,
+				struct peer_del_all_wds_entries_params *param)
+{
+	wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
+
+	if (wmi->ops->send_peer_del_all_wds_entries_cmd)
+		return wmi->ops->send_peer_del_all_wds_entries_cmd(wmi,
+				param);
+
+	return QDF_STATUS_E_FAILURE;
+}

+ 36 - 0
wmi/src/wmi_unified_non_tlv.c

@@ -8859,6 +8859,40 @@ extract_dfs_status_from_fw_non_tlv(wmi_unified_t wmi_handle,
 }
 #endif
 
+/**
+ * send_peer_del_all_wds_entries_cmd_non_tlv()-send peer delete
+ * WDS entries cmd to fw
+ * @wmi_handle: wmi handle
+ * @param: pointer holding peer details
+ *
+ * Return: 0 for success or error code
+ */
+QDF_STATUS send_peer_del_all_wds_entries_cmd_non_tlv(wmi_unified_t wmi_handle,
+				struct peer_del_all_wds_entries_params *param)
+{
+	wmi_peer_remove_all_wds_entries_cmd *cmd;
+	wmi_buf_t buf;
+	int len = sizeof(wmi_peer_remove_all_wds_entries_cmd);
+
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf) {
+		qdf_print("%s: wmi_buf_alloc failed\n", __func__);
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	/* wmi_buf_alloc returns zeroed command buffer */
+	cmd = (wmi_peer_remove_all_wds_entries_cmd *)wmi_buf_data(buf);
+	cmd->flags = (param->flags) ? WMI_WDS_DELETE_ALL_FLAG_STATIC : 0;
+	if (param->wds_macaddr)
+		WMI_CHAR_ARRAY_TO_MAC_ADDR(param->wds_macaddr,
+						&cmd->wds_macaddr);
+	if (param->peer_macaddr)
+		WMI_CHAR_ARRAY_TO_MAC_ADDR(param->peer_macaddr,
+						&cmd->peer_macaddr);
+	return wmi_unified_cmd_send(wmi_handle, buf, len,
+			WMI_PEER_REMOVE_ALL_WDS_ENTRIES_CMDID);
+}
+
 /**
  * wmi_non_tlv_pdev_id_conversion_enable() - Enable pdev_id conversion
  *
@@ -9128,6 +9162,8 @@ struct wmi_ops non_tlv_ops =  {
 				extract_esp_estimation_ev_param_non_tlv,
 	.extract_ctl_failsafe_check_ev_param =
 			extract_ctl_failsafe_check_ev_param_non_tlv,
+	.send_peer_del_all_wds_entries_cmd =
+			send_peer_del_all_wds_entries_cmd_non_tlv,
 };
 
 /**