瀏覽代碼

qcacld-3.0: Add support to get fwr phymode for frequency

Currently, wifi-pos uses channel number to get the fwr phymode.
For adding 6g support wifi-pos need to get the phymode from
frequency instead of channel number.
As a part of fix, Add handler for getting phymode based on
frequency

CRs-Fixed: 2617906
Change-Id: Ie65b3ed98760cef152df3697805593efbad4d5a1
Vinay Gannevaram 5 年之前
父節點
當前提交
521ebf80b1
共有 2 個文件被更改,包括 31 次插入0 次删除
  1. 10 0
      core/wma/inc/wma_api.h
  2. 21 0
      core/wma/src/wma_main.c

+ 10 - 0
core/wma/inc/wma_api.h

@@ -132,6 +132,16 @@ int wma_cli_set_command(int vdev_id, int param_id, int sval, int vpdev);
 int wma_cli_set2_command(int vdev_id, int param_id, int sval1,
 			 int sval2, int vpdev);
 
+/**
+ * wma_get_fw_phy_mode_for_freq_cb() - Callback to get current PHY Mode.
+ * @freq: channel freq
+ * @chan_width: maximum channel width possible
+ * @phy_mode: firmware PHY Mode
+ *
+ * Return: None
+ */
+void wma_get_fw_phy_mode_for_freq_cb(uint32_t freq, uint32_t chan_width,
+				     uint32_t  *phy_mode);
 /**
  * wma_get_phy_mode_cb() - Callback to get current PHY Mode.
  * @chan: channel number

+ 21 - 0
core/wma/src/wma_main.c

@@ -2791,6 +2791,24 @@ struct wlan_objmgr_psoc *wma_get_psoc_from_scn_handle(void *scn_handle)
 	return wma_handle->psoc;
 }
 
+void wma_get_fw_phy_mode_for_freq_cb(uint32_t freq, uint32_t chan_width,
+				     uint32_t *phy_mode)
+{
+	uint32_t dot11_mode;
+	enum wlan_phymode host_phy_mode;
+	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
+
+	if (!mac) {
+		wma_err("MAC context is NULL");
+		*phy_mode = WLAN_PHYMODE_AUTO;
+		return;
+	}
+
+	dot11_mode = mac->mlme_cfg->dot11_mode.dot11_mode;
+	host_phy_mode = wma_chan_phy_mode(freq, chan_width, dot11_mode);
+	*phy_mode = wma_host_to_fw_phymode(host_phy_mode);
+}
+
 void wma_get_phy_mode_cb(uint8_t chan, uint32_t chan_width,
 			 enum wlan_phymode *phy_mode)
 {
@@ -3327,6 +3345,9 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
 	wma_register_debug_callback();
 	wifi_pos_register_get_phy_mode_cb(wma_handle->psoc,
 					  wma_get_phy_mode_cb);
+	wifi_pos_register_get_fw_phy_mode_for_freq_cb(
+					wma_handle->psoc,
+					wma_get_fw_phy_mode_for_freq_cb);
 
 	/* Register callback with PMO so PMO can update the vdev pause bitmap*/
 	pmo_register_pause_bitmap_notifier(wma_handle->psoc,