浏览代码

qcacmn: Add obss detection offload support

Add support for obss detection offload support.
Sending WMI_SAP_OBSS_DETECTION_CFG_CMDID command
to firmware.

Change-Id: I56eba46e37330637c81d1a2cfa6542dd4ead8183
CRs-Fixed: 2170184
Arif Hussain 7 年之前
父节点
当前提交
a9e4986634
共有 5 个文件被更改,包括 113 次插入2 次删除
  1. 16 2
      wmi/inc/wmi_unified_api.h
  2. 28 0
      wmi/inc/wmi_unified_param.h
  3. 2 0
      wmi/inc/wmi_unified_priv.h
  4. 12 0
      wmi/src/wmi_unified_api.c
  5. 55 0
      wmi/src/wmi_unified_tlv.c

+ 16 - 2
wmi/inc/wmi_unified_api.h

@@ -1767,7 +1767,7 @@ QDF_STATUS wmi_send_bcn_offload_control_cmd(void *wmi_hdl,
 /**
  * wmi_unified_send_wds_entry_list_cmd() - WMI function to get list of
  *  wds entries from FW
- * @wmi_handle: wmi handle
+ * @wmi_hdl: wmi handle
  *
  * Send WMI_PDEV_WDS_ENTRY_LIST_CMDID parameters to fw.
  *
@@ -1778,7 +1778,7 @@ QDF_STATUS wmi_unified_send_dump_wds_table_cmd(void *wmi_hdl);
 
 /**
  * wmi_extract_wds_entry - api to extract wds entry
- * @wmi_handle: wma handle
+ * @wmi_hdl: wmi handle
  * @evt_buf: pointer to event buffer
  * @wds_entry: wds entry
  * @idx: index to point wds entry in event buffer
@@ -1897,4 +1897,18 @@ QDF_STATUS wmi_extract_ndp_end_ind(wmi_unified_t wmi_handle, uint8_t *data,
  */
 QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
 				       struct wmi_btm_config *params);
+
+/**
+ * wmi_unified_send_obss_detection_cfg_cmd() - WMI function to send obss
+ *  detection configuration to FW.
+ * @wmi_hdl: wmi handle
+ * @cfg: obss detection configuration
+ *
+ * Send WMI_SAP_OBSS_DETECTION_CFG_CMDID parameters to fw.
+ *
+ * Return: QDF_STATUS
+ */
+
+QDF_STATUS wmi_unified_send_obss_detection_cfg_cmd(void *wmi_hdl,
+			struct wmi_obss_detection_cfg_param *cfg);
 #endif /* _WMI_UNIFIED_API_H_ */

+ 28 - 0
wmi/inc/wmi_unified_param.h

@@ -5640,6 +5640,7 @@ typedef enum {
 	wmi_radio_tx_power_level_stats_event_id,
 	wmi_report_stats_event_id,
 	wmi_dma_buf_release_event_id,
+	wmi_sap_obss_detection_report_event_id,
 
 	wmi_events_max,
 } wmi_conv_event_id;
@@ -8269,4 +8270,31 @@ struct direct_buf_rx_cfg_req {
 	uint32_t num_resp_per_event;
 };
 
+/**
+ * struct wmi_obss_detection_cfg_param - obss detection cfg
+ * @vdev_id: vdev id
+ * @obss_detect_period_ms: detection period in ms
+ * @obss_11b_ap_detect_mode: detect whether there is 11b ap/ibss
+ * @obss_11b_sta_detect_mode: detect whether there is 11b sta
+ *                            connected with other APs
+ * @obss_11g_ap_detect_mode: detect whether there is 11g AP
+ * @obss_11a_detect_mode: detect whether there is legacy 11a traffic
+ * @obss_ht_legacy_detect_mode: detect whether there is ap which is
+ *                              ht legacy mode
+ * @obss_ht_mixed_detect_mode: detect whether there is ap which is ht mixed mode
+ * @obss_ht_20mhz_detect_mode: detect whether there is ap which has 20M only
+ *                             station
+ */
+struct wmi_obss_detection_cfg_param {
+	uint32_t vdev_id;
+	uint32_t obss_detect_period_ms;
+	uint32_t obss_11b_ap_detect_mode;
+	uint32_t obss_11b_sta_detect_mode;
+	uint32_t obss_11g_ap_detect_mode;
+	uint32_t obss_11a_detect_mode;
+	uint32_t obss_ht_legacy_detect_mode;
+	uint32_t obss_ht_mixed_detect_mode;
+	uint32_t obss_ht_20mhz_detect_mode;
+};
+
 #endif /* _WMI_UNIFIED_PARAM_H_ */

+ 2 - 0
wmi/inc/wmi_unified_priv.h

@@ -1494,6 +1494,8 @@ QDF_STATUS (*extract_ndp_end_ind)(wmi_unified_t wmi_handle,
 #endif
 QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle,
 			      struct wmi_btm_config *params);
+QDF_STATUS (*send_obss_detection_cfg_cmd)(wmi_unified_t wmi_handle,
+		struct wmi_obss_detection_cfg_param *obss_cfg_param);
 };
 
 /* Forward declartion for psoc*/

+ 12 - 0
wmi/src/wmi_unified_api.c

@@ -7232,3 +7232,15 @@ QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+QDF_STATUS wmi_unified_send_obss_detection_cfg_cmd(void *wmi_hdl,
+		struct wmi_obss_detection_cfg_param *obss_cfg_param)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->send_obss_detection_cfg_cmd)
+		return wmi_handle->ops->send_obss_detection_cfg_cmd(wmi_handle,
+				obss_cfg_param);
+
+	return QDF_STATUS_E_FAILURE;
+}

+ 55 - 0
wmi/src/wmi_unified_tlv.c

@@ -20954,6 +20954,58 @@ static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle,
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
 	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * send_obss_detection_cfg_cmd_tlv() - send obss detection
+ *   configurations to firmware.
+ * @wmi_handle: wmi handle
+ * @obss_cfg_param: obss detection configurations
+ *
+ * Send WMI_SAP_OBSS_DETECTION_CFG_CMDID parameters to fw.
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS send_obss_detection_cfg_cmd_tlv(wmi_unified_t wmi_handle,
+		struct wmi_obss_detection_cfg_param *obss_cfg_param)
+{
+	wmi_buf_t buf;
+	wmi_sap_obss_detection_cfg_cmd_fixed_param *cmd;
+	uint8_t len = sizeof(wmi_sap_obss_detection_cfg_cmd_fixed_param);
+
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf) {
+		WMI_LOGE("%s: Failed to allocate wmi buffer", __func__);
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	cmd = (wmi_sap_obss_detection_cfg_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		WMITLV_TAG_STRUC_wmi_sap_obss_detection_cfg_cmd_fixed_param,
+		       WMITLV_GET_STRUCT_TLVLEN
+		       (wmi_sap_obss_detection_cfg_cmd_fixed_param));
+
+	cmd->vdev_id = obss_cfg_param->vdev_id;
+	cmd->detect_period_ms = obss_cfg_param->obss_detect_period_ms;
+	cmd->b_ap_detect_mode = obss_cfg_param->obss_11b_ap_detect_mode;
+	cmd->b_sta_detect_mode = obss_cfg_param->obss_11b_sta_detect_mode;
+	cmd->g_ap_detect_mode = obss_cfg_param->obss_11g_ap_detect_mode;
+	cmd->a_detect_mode = obss_cfg_param->obss_11a_detect_mode;
+	cmd->ht_legacy_detect_mode = obss_cfg_param->obss_ht_legacy_detect_mode;
+	cmd->ht_mixed_detect_mode = obss_cfg_param->obss_ht_mixed_detect_mode;
+	cmd->ht_20mhz_detect_mode = obss_cfg_param->obss_ht_20mhz_detect_mode;
+	WMI_LOGD("Sending WMI_SAP_OBSS_DETECTION_CFG_CMDID vdev_id:%d",
+		  cmd->vdev_id);
+
+	if (wmi_unified_cmd_send(wmi_handle, buf, len,
+				 WMI_SAP_OBSS_DETECTION_CFG_CMDID)) {
+		WMI_LOGE("Failed to send WMI_SAP_OBSS_DETECTION_CFG_CMDID");
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -21398,6 +21450,7 @@ struct wmi_ops tlv_ops =  {
 	.extract_ndp_end_ind = extract_ndp_end_ind_tlv,
 #endif
 	.send_btm_config = send_btm_config_cmd_tlv,
+	.send_obss_detection_cfg_cmd = send_obss_detection_cfg_cmd_tlv,
 };
 
 /**
@@ -21676,6 +21729,8 @@ static void populate_tlv_events_id(uint32_t *event_ids)
 	event_ids[wmi_report_stats_event_id] = WMI_REPORT_STATS_EVENTID;
 	event_ids[wmi_dma_buf_release_event_id] =
 					WMI_PDEV_DMA_RING_BUF_RELEASE_EVENTID;
+	event_ids[wmi_sap_obss_detection_report_event_id] =
+		WMI_SAP_OBSS_DETECTION_REPORT_EVENTID;
 }
 
 #ifndef CONFIG_MCL