Forráskód Böngészése

qcacmn: Add support for peer tx event param extraction

Add host's copy of peer cfr tx completion event param and prototype for
extract API.

CRs-Fixed: 2406064
Change-Id: I433171fc90d3c5dbb92dd525e8b5b2c441cc1bf9
Abhiram Jogadenu 6 éve
szülő
commit
c528145962

+ 2 - 0
qdf/linux/src/qdf_trace.c

@@ -2870,6 +2870,7 @@ struct category_name_info g_qdf_category_name[MAX_SUPPORTED_CATEGORY] = {
 	[QDF_MODULE_ID_SM_ENGINE] = {"SM_ENG"},
 	[QDF_MODULE_ID_CMN_MLME] = {"CMN_MLME"},
 	[QDF_MODULE_ID_BSSCOLOR] = {"BSSCOLOR"},
+	[QDF_MODULE_ID_CFR] = {"CFR"},
 	[QDF_MODULE_ID_ANY] = {"ANY"},
 };
 qdf_export_symbol(g_qdf_category_name);
@@ -3323,6 +3324,7 @@ static void set_default_trace_levels(struct category_info *cinfo)
 		[QDF_MODULE_ID_SM_ENGINE] = QDF_TRACE_LEVEL_ERROR,
 		[QDF_MODULE_ID_CMN_MLME] = QDF_TRACE_LEVEL_INFO,
 		[QDF_MODULE_ID_BSSCOLOR] = QDF_TRACE_LEVEL_ERROR,
+		[QDF_MODULE_ID_CFR] = QDF_TRACE_LEVEL_ERROR,
 		[QDF_MODULE_ID_ANY] = QDF_TRACE_LEVEL_INFO,
 	};
 

+ 12 - 0
target_if/direct_buf_rx/inc/target_if_direct_buf_rx_api.h

@@ -56,6 +56,18 @@
 struct wlan_objmgr_psoc;
 struct wlan_lmac_if_tx_ops;
 
+/**
+ * enum DBR_MODULE - Enum containing the modules supporting direct buf rx
+ * @DBR_MODULE_SPECTRAL: Module ID for Spectral
+ * @DBR_MODULE_CFR: Module ID for CFR
+ * @DBR_MODULE_MAX: Max module ID
+ */
+enum DBR_MODULE {
+	DBR_MODULE_SPECTRAL = 0,
+	DBR_MODULE_CFR      = 1,
+	DBR_MODULE_MAX,
+};
+
 /**
  * struct direct_buf_rx_data - direct buffer rx data
  * @dbr_len: Length of the buffer DMAed

+ 1 - 12
target_if/direct_buf_rx/src/target_if_direct_buf_rx_main.h

@@ -21,6 +21,7 @@
 
 #include "qdf_types.h"
 #include "qdf_status.h"
+#include <target_if_direct_buf_rx_api.h>
 
 struct wlan_objmgr_psoc;
 struct wlan_lmac_if_tx_ops;
@@ -30,18 +31,6 @@ struct direct_buf_rx_data;
 #define DBR_EVENT_TIMEOUT_IN_MS 1
 #define DBR_NUM_RESP_PER_EVENT 2
 
-/**
- * enum DBR_MODULE - Enum containing the modules supporting direct buf rx
- * @DBR_MODULE_SPECTRAL: Module ID for Spectral
- * @DBR_MODULE_CFR: Module ID for CFR
- * @DBR_MODULE_MAX: Max module ID
- */
-enum DBR_MODULE {
-	DBR_MODULE_SPECTRAL = 0,
-	DBR_MODULE_CFR      = 1,
-	DBR_MODULE_MAX,
-};
-
 /**
  * struct direct_buf_rx_info - direct buffer rx operation info struct
  * @cookie: SW cookie used to get the virtual address

+ 12 - 0
wmi/inc/wmi_unified_api.h

@@ -1743,5 +1743,17 @@ enum cdp_sec_type wlan_crypto_cipher_to_cdp_sec_type(
 QDF_STATUS
 wmi_unified_send_peer_cfr_capture_cmd(void *wmi_hdl,
 				      struct peer_cfr_params *param);
+/**
+ * wmi_extract_cfr_peer_tx_event_param() - WMI function to extract cfr tx event
+ * for a peer
+ * @wmi_hdl: WMI handle
+ * @evt_buf: Buffer holding event data
+ * @peer_tx_event: pointer to hold tx event data
+ *
+ * Return: QDF_STATUS_SUCCESS if success, else returns proper error code.
+ */
+QDF_STATUS
+wmi_extract_cfr_peer_tx_event_param(void *wmi_hdl, void *evt_buf,
+				    wmi_cfr_peer_tx_event_param *peer_tx_event);
 #endif /* WLAN_CFR_ENABLE */
 #endif /* _WMI_UNIFIED_API_H_ */

+ 62 - 0
wmi/inc/wmi_unified_param.h

@@ -4753,6 +4753,7 @@ typedef enum {
 	wmi_vdev_bcn_reception_stats_event_id,
 	wmi_roam_blacklist_event_id,
 	wmi_wlm_stats_event_id,
+	wmi_peer_cfr_capture_event_id,
 	wmi_events_max,
 } wmi_conv_event_id;
 
@@ -7639,4 +7640,65 @@ struct vap_tidmap_prec_params {
 	uint32_t map_precedence;
 };
 #endif
+
+/**
+ * struct wmi_cfr_peer_tx_event_param - CFR peer tx_event params
+ * @capture_method: CFR data capture method
+ * @vdev_id: ID of vdev to which this info belongs
+ * @mac_addr: Peer MAC address. In AP mode, it is the address of connected
+ *            peer for which CFR capture is needed. In STA mode, this is the
+ *            address of AP it is connected to.
+ * @primary_20mhz_chan: Primary 20 MHz channel frequency in MHz
+ * @bandwidth: BW of measurement
+ *             0 - 20MHz, 1 - 40MHz, 2 - 80MHz, 3 - 160MHz, 4 - 80+80MHz
+ * @phy_mode: Phy mode of channel, type - WMI_HOST_WLAN_PHY_MODE
+ * @band_center_freq1: Center frequency 1 in MHz
+ * @band_center_freq2: Center frequency 2 in MHz
+ * @spatial_streams: Number of spatial streams
+ * @correlation_info_1: Address of data from wmi_dma_buf_release_entry [31:0]
+ * @correlation_info_2:
+ *     Bits [3:0]   - Address of data from wmi_dma_buf_release_entry [35:32]
+ *     Bits [15:4]  - Reserved
+ *     Bits [31:16] - Hardware PPDU ID [15:0]
+ * @status:
+ *     Bits [1:0]   - TX status, if any. 0-OK, 1-XRETRY, 2-DROP, 3-FILTERED.
+ *     Bits [30:2]  - Reserved
+ *     Bit  [31]    - Status of the CFR capture of the peer
+ *                    1 - Successful, 0 - Unsuccessful.
+ * @timestamp_us: Timestamp in microseconds at which the CFR was captured
+ *                in the hardware. The clock used for this timestamp is private
+ *                to the target and not visible to the host. So, Host can
+ *                interpret only the relative timestamp deltas from one message
+ *                to the next, but can't interpret the absolute timestamp
+ *                from a single message
+ * @counter: Count of the current CFR capture from FW.
+ *           This is helpful to identify any drops in FW
+ * @chain_rssi: Per chain RSSI of the peer, for upto WMI_HOST_MAX_CHAINS.
+ *              Each chain's entry reports the RSSI for different bandwidths.
+ *     Bits [7:0]   - Primary 20 MHz
+ *     Bits [15:8]  - Secondary 20 MHz of 40 MHz channel (if applicable)
+ *     Bits [23:16] - Secondary 40 MHz of 80 MHz channel (if applicable)
+ *     Bits [31:24] - Secondary 80 MHz of 160 MHz channel (if applicable)
+ *     Each of these 8-bit RSSI reports is in dBm units. 0x80 means invalid.
+ *     Unused bytes within used chain_rssi indices will be 0x80.
+ *     Unused rssi_chain indices will be set to 0x80808080.
+ */
+typedef struct {
+	uint32_t capture_method;
+	uint32_t vdev_id;
+	struct qdf_mac_addr peer_mac_addr;
+	uint32_t primary_20mhz_chan;
+	uint32_t bandwidth;
+	uint32_t phy_mode;
+	uint32_t band_center_freq1;
+	uint32_t band_center_freq2;
+	uint32_t spatial_streams;
+	uint32_t correlation_info_1;
+	uint32_t correlation_info_2;
+	uint32_t status;
+	uint32_t timestamp_us;
+	uint32_t counter;
+	uint32_t chain_rssi[WMI_HOST_MAX_CHAINS];
+} wmi_cfr_peer_tx_event_param;
+
 #endif /* _WMI_UNIFIED_PARAM_H_ */

+ 4 - 0
wmi/inc/wmi_unified_priv.h

@@ -1877,6 +1877,10 @@ QDF_STATUS (*extract_dfs_status_from_fw)(wmi_unified_t wmi_handle,
 					 uint32_t *dfs_status_check);
 #endif
 
+QDF_STATUS
+(*extract_cfr_peer_tx_event_param)(wmi_unified_t *wmi_handle, void *evt_buf,
+				   wmi_cfr_peer_tx_event_param * peer_tx_event);
+
 #ifdef OBSS_PD
 QDF_STATUS (*send_obss_spatial_reuse_set)(wmi_unified_t wmi_handle,
 		struct wmi_host_obss_spatial_reuse_set_param

+ 16 - 0
wmi/src/wmi_unified_api.c

@@ -4639,4 +4639,20 @@ QDF_STATUS wmi_unified_send_peer_cfr_capture_cmd(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+/**
+ * wmi_extract_cfr_peer_tx_event_param() - extract tx event params from event
+ */
+QDF_STATUS
+wmi_extract_cfr_peer_tx_event_param(void *wmi_hdl, void *evt_buf,
+				    wmi_cfr_peer_tx_event_param *peer_tx_event)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->extract_cfr_peer_tx_event_param)
+		return wmi_handle->ops->extract_cfr_peer_tx_event_param(wmi_hdl,
+									evt_buf,
+									peer_tx_event);
+	return QDF_STATUS_E_FAILURE;
+}
 #endif /* WLAN_CFR_ENABLE */

+ 56 - 1
wmi/src/wmi_unified_tlv.c

@@ -10940,6 +10940,59 @@ static void wmi_11ax_bss_color_attach_tlv(struct wmi_unified *wmi_handle)
 		extract_obss_color_collision_info_tlv;
 }
 
+#ifdef WLAN_CFR_ENABLE
+/**
+ * extract_cfr_peer_tx_event_param_tlv() - Extract peer cfr tx event params
+ * @wmi_handle: wmi handle
+ * @event_buf: pointer to event buffer
+ * @peer_tx_event: Pointer to hold peer cfr tx event params
+ *
+ * Return QDF_STATUS_SUCCESS on success or proper error code.
+ */
+static QDF_STATUS
+extract_cfr_peer_tx_event_param_tlv(wmi_unified_t *wmi_handle, void *evt_buf,
+				    wmi_cfr_peer_tx_event_param *peer_tx_event)
+{
+	WMI_PEER_CFR_CAPTURE_EVENTID_param_tlvs *param_buf;
+	wmi_peer_cfr_capture_event_fixed_param *peer_tx_event_ev;
+
+	param_buf = (WMI_PEER_CFR_CAPTURE_EVENTID_param_tlvs *)evt_buf;
+	if (!param_buf) {
+		WMI_LOGE("Invalid cfr capture buffer");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	peer_tx_event_ev = param_buf->fixed_param;
+	if (!peer_tx_event_ev) {
+		qdf_err("peer cfr capture buffer is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	peer_tx_event->capture_method = peer_tx_event_ev->capture_method;
+	peer_tx_event->vdev_id = peer_tx_event_ev->vdev_id;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&peer_tx_event_ev->mac_addr,
+				   &peer_tx_event->peer_mac_addr.bytes[0]);
+	peer_tx_event->primary_20mhz_chan =
+		peer_tx_event_ev->chan_mhz;
+	peer_tx_event->bandwidth = peer_tx_event_ev->bandwidth;
+	peer_tx_event->phy_mode = peer_tx_event_ev->phy_mode;
+	peer_tx_event->band_center_freq1 = peer_tx_event_ev->band_center_freq1;
+	peer_tx_event->band_center_freq2 = peer_tx_event_ev->band_center_freq2;
+	peer_tx_event->spatial_streams = peer_tx_event_ev->sts_count;
+	peer_tx_event->correlation_info_1 =
+		peer_tx_event_ev->correlation_info_1;
+	peer_tx_event->correlation_info_2 =
+		peer_tx_event_ev->correlation_info_2;
+	peer_tx_event->status = peer_tx_event_ev->status;
+	peer_tx_event->timestamp_us = peer_tx_event_ev->timestamp_us;
+	peer_tx_event->counter = peer_tx_event_ev->counter;
+	qdf_mem_copy(peer_tx_event->chain_rssi, peer_tx_event_ev->chain_rssi,
+		     sizeof(peer_tx_event->chain_rssi));
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* WLAN_CFR_ENABLE */
+
 struct wmi_ops tlv_ops =  {
 	.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
 	.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
@@ -11195,7 +11248,8 @@ struct wmi_ops tlv_ops =  {
 #ifdef WLAN_CFR_ENABLE
 	.send_peer_cfr_capture_cmd =
 		send_peer_cfr_capture_cmd_tlv,
-#endif
+	.extract_cfr_peer_tx_event_param = extract_cfr_peer_tx_event_param_tlv,
+#endif /* WLAN_CFR_ENABLE */
 
 };
 
@@ -11504,6 +11558,7 @@ static void populate_tlv_events_id(uint32_t *event_ids)
 		WMI_VDEV_BCN_RECEPTION_STATS_EVENTID;
 	event_ids[wmi_roam_blacklist_event_id] = WMI_ROAM_BLACKLIST_EVENTID;
 	event_ids[wmi_wlm_stats_event_id] = WMI_WLM_STATS_EVENTID;
+	event_ids[wmi_peer_cfr_capture_event_id] = WMI_PEER_CFR_CAPTURE_EVENTID;
 }
 
 /**