Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1f052c99 authored by Ashish Kumar Dhanotiya's avatar Ashish Kumar Dhanotiya Committed by snandini
Browse files

qcacmn: Correct fix to get max BW to set channel params

Currently wifi pos component is directly calling init-deinit
component apis which is not the correct way according to
design.
Add the tx_ops logic to correct the above implementation.

Change-Id: I6ca28a44232b6dc7dced127061c1694cee1c928c
CRs-Fixed: 2756637
parent 44696632
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -315,12 +315,4 @@ void init_deinit_wakeup_host_wait(
		 struct wlan_objmgr_psoc *psoc,
		 struct target_psoc_info *tgt_info);

/**
 * init_deinit_get_vht_ch_width - return vht channel width
 * @psoc: PSOC object
 *
 * Return: return max vht channel width supported by FW
 */
enum phy_ch_width init_deinit_get_vht_ch_width(struct wlan_objmgr_psoc *psoc);

#endif /* _SERVICE_READY_UTIL_H_*/
+0 −22
Original line number Diff line number Diff line
@@ -863,25 +863,3 @@ void init_deinit_wakeup_host_wait(
	}
	qdf_event_set(&tgt_hdl->info.event);
}

enum phy_ch_width init_deinit_get_vht_ch_width(struct wlan_objmgr_psoc *psoc)
{
	enum phy_ch_width fw_ch_wd = CH_WIDTH_80MHZ;
	struct target_psoc_info *tgt_hdl;
	int vht_cap_info;

	if (!psoc)
		return fw_ch_wd;

	tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
	if (!tgt_hdl)
		return fw_ch_wd;

	vht_cap_info = target_if_get_vht_cap_info(tgt_hdl);
	if (vht_cap_info & WMI_VHT_CAP_CH_WIDTH_80P80_160MHZ)
		fw_ch_wd = CH_WIDTH_80P80MHZ;
	else if (vht_cap_info & WMI_VHT_CAP_CH_WIDTH_160MHZ)
		fw_ch_wd = CH_WIDTH_160MHZ;

	return fw_ch_wd;
}
+11 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@

#include "qdf_types.h"
#include "qdf_status.h"
#include "wlan_cmn.h"
struct oem_data_req;
struct oem_data_rsp;
struct wlan_objmgr_psoc;
@@ -61,6 +62,16 @@ QDF_STATUS target_if_wifi_pos_register_events(struct wlan_objmgr_psoc *psoc);
QDF_STATUS target_if_wifi_pos_deregister_events(struct wlan_objmgr_psoc *psoc);


/**
 * target_if_wifi_pos_get_vht_ch_width: function to get vht channel width
 * @psoc: pointer to psoc object
 * @ch_width: pointer to the variable in which output value needs to be filled
 *
 * Return: status of operation
 */
QDF_STATUS target_if_wifi_pos_get_vht_ch_width(struct wlan_objmgr_psoc *psoc,
					       enum phy_ch_width *ch_width);

/**
 * target_if_wifi_pos_register_tx_ops: function to register with lmac tx ops
 * @tx_ops: lmac tx ops struct object
+30 −0
Original line number Diff line number Diff line
@@ -316,6 +316,9 @@ void target_if_wifi_pos_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
		target_if_wifi_pos_register_events;
	wifi_pos_tx_ops->wifi_pos_deregister_events =
		target_if_wifi_pos_deregister_events;
	wifi_pos_tx_ops->wifi_pos_get_vht_ch_width =
		target_if_wifi_pos_get_vht_ch_width;

}

inline struct wlan_lmac_if_wifi_pos_rx_ops *target_if_wifi_pos_get_rxops(
@@ -403,6 +406,33 @@ QDF_STATUS target_if_wifi_pos_deregister_events(struct wlan_objmgr_psoc *psoc)
	return QDF_STATUS_SUCCESS;
}

QDF_STATUS target_if_wifi_pos_get_vht_ch_width(struct wlan_objmgr_psoc *psoc,
					       enum phy_ch_width *ch_width)
{
	struct target_psoc_info *tgt_hdl;
	int vht_cap_info;

	*ch_width = CH_WIDTH_INVALID;

	if (!psoc)
		return QDF_STATUS_E_INVAL;

	tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
	if (!tgt_hdl)
		return QDF_STATUS_E_INVAL;

	*ch_width = CH_WIDTH_80MHZ;

	vht_cap_info = target_if_get_vht_cap_info(tgt_hdl);

	if (vht_cap_info & WLAN_VHTCAP_SUP_CHAN_WIDTH_80_160)
		*ch_width = CH_WIDTH_80P80MHZ;
	else if (vht_cap_info & WLAN_VHTCAP_SUP_CHAN_WIDTH_160)
		*ch_width = CH_WIDTH_160MHZ;

	return QDF_STATUS_SUCCESS;
}

#ifdef WLAN_FEATURE_CIF_CFR
static QDF_STATUS target_if_wifi_pos_fill_ring(uint8_t ring_idx,
					struct hal_srng *srng,
+3 −0
Original line number Diff line number Diff line
@@ -626,12 +626,15 @@ struct wlan_lmac_if_sptrl_tx_ops {
 * @data_req_tx: function pointer to send wifi_pos req to firmware
 * @wifi_pos_register_events: function pointer to register wifi_pos events
 * @wifi_pos_deregister_events: function pointer to deregister wifi_pos events
 * @wifi_pos_get_vht_ch_width: Function pointer to get max supported bw by FW
 */
struct wlan_lmac_if_wifi_pos_tx_ops {
	QDF_STATUS (*data_req_tx)(struct wlan_objmgr_pdev *pdev,
				  struct oem_data_req *req);
	QDF_STATUS (*wifi_pos_register_events)(struct wlan_objmgr_psoc *psoc);
	QDF_STATUS (*wifi_pos_deregister_events)(struct wlan_objmgr_psoc *psoc);
	QDF_STATUS (*wifi_pos_get_vht_ch_width)(struct wlan_objmgr_psoc *psoc,
						enum phy_ch_width *ch_width);
};
#endif

Loading