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

Commit 0594b969 authored by Paul Zhang's avatar Paul Zhang Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: set the default wlm level

Per Change-Id: Ifac93fb869553d0f9eb553d5c41da43c8b014ad8, it
saves the latency level and reconfig it to fw after vdev
creates. But if user is doing WiFi OFF/ON, it expects the
default wlm level to set to fw.

Change-Id: I329ad90e09a39d461c52c614d9b7a5e23d9540dd
CRs-Fixed: 2873595
parent 8fae28fa
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -4996,6 +4996,7 @@ hdd_alloc_station_adapter(struct hdd_context *hdd_ctx, tSirMacAddr mac_addr,
	dev->tx_queue_len = HDD_NETDEV_TX_QUEUE_LEN;
	adapter->wdev.wiphy = hdd_ctx->wiphy;
	adapter->wdev.netdev = dev;
	adapter->latency_level = cfg_get(hdd_ctx->psoc, CFG_LATENCY_LEVEL);

	/* set dev's parent to underlying device */
	SET_NETDEV_DEV(dev, hdd_ctx->parent_dev);
@@ -15353,6 +15354,24 @@ void hdd_deinit(void)
#define HDD_WLAN_START_WAIT_TIME (CDS_WMA_TIMEOUT + 5000)
#endif

static void hdd_set_adapter_wlm_def_level(struct hdd_context *hdd_ctx)
{
	struct hdd_adapter *adapter, *next_adapter = NULL;
	wlan_net_dev_ref_dbgid dbgid = NET_DEV_HOLD_GET_ADAPTER;
	int ret;

	ret = wlan_hdd_validate_context(hdd_ctx);
	if (ret != 0)
		return;

	hdd_for_each_adapter_dev_held_safe(hdd_ctx, adapter, next_adapter,
					   dbgid) {
		adapter->latency_level =
				cfg_get(hdd_ctx->psoc, CFG_LATENCY_LEVEL);
		hdd_adapter_dev_put_debug(adapter, dbgid);
	}
}

static int wlan_hdd_state_ctrl_param_open(struct inode *inode,
					  struct file *file)
{
@@ -15388,6 +15407,7 @@ static void hdd_inform_wifi_off(void)
	if (ret)
		return;

	hdd_set_adapter_wlm_def_level(hdd_ctx);
	__hdd_inform_wifi_off();

	osif_psoc_sync_op_stop(psoc_sync);