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

Commit 47c9931a authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "icnss: Avoid qmi exchange when fw is not ready"

parents f48a6125 a1deecba
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -972,6 +972,7 @@ static int icnss_driver_event_fw_ready_ind(void *data)
		return -ENODEV;

	set_bit(ICNSS_FW_READY, &penv->state);
	clear_bit(ICNSS_MODE_ON, &penv->state);

	icnss_pr_info("WLAN FW is ready: 0x%lx\n", penv->state);

@@ -1798,7 +1799,8 @@ int icnss_set_fw_log_mode(struct device *dev, uint8_t fw_log_mode)
	if (!dev)
		return -ENODEV;

	if (test_bit(ICNSS_FW_DOWN, &penv->state)) {
	if (test_bit(ICNSS_FW_DOWN, &penv->state) ||
	    !test_bit(ICNSS_FW_READY, &penv->state)) {
		icnss_pr_err("FW down, ignoring fw_log_mode state: 0x%lx\n",
			     penv->state);
		return -EINVAL;
@@ -1890,12 +1892,18 @@ int icnss_wlan_enable(struct device *dev, struct icnss_wlan_enable_cfg *config,
		      enum icnss_driver_mode mode,
		      const char *host_version)
{
	if (test_bit(ICNSS_FW_DOWN, &penv->state)) {
	if (test_bit(ICNSS_FW_DOWN, &penv->state) ||
	    !test_bit(ICNSS_FW_READY, &penv->state)) {
		icnss_pr_err("FW down, ignoring wlan_enable state: 0x%lx\n",
			     penv->state);
		return -EINVAL;
	}

	if (test_bit(ICNSS_MODE_ON, &penv->state)) {
		icnss_pr_err("Already Mode on, ignoring wlan_enable state: 0x%lx\n",
			     penv->state);
	}

	return icnss_send_wlan_enable_to_fw(penv, config, mode, host_version);
}
EXPORT_SYMBOL(icnss_wlan_enable);
@@ -2538,6 +2546,9 @@ static int icnss_stats_show_state(struct seq_file *s, struct icnss_priv *priv)
			continue;
		case ICNSS_REJUVENATE:
			seq_puts(s, "FW REJUVENATE");
			continue;
		case ICNSS_MODE_ON:
			seq_puts(s, "MODE ON DONE");
		}

		seq_printf(s, "UNKNOWN-%d", i);
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ enum icnss_driver_state {
	ICNSS_FW_DOWN,
	ICNSS_DRIVER_UNLOADING,
	ICNSS_REJUVENATE,
	ICNSS_MODE_ON,
};

struct ce_irq_list {
+10 −0
Original line number Diff line number Diff line
@@ -471,6 +471,16 @@ int wlfw_wlan_mode_send_sync_msg(struct icnss_priv *priv,

	priv->stats.mode_resp++;

	if (mode == QMI_WLFW_OFF_V01) {
		icnss_pr_dbg("Clear mode on 0x%lx, mode: %d\n",
			     priv->state, mode);
		clear_bit(ICNSS_MODE_ON, &priv->state);
	} else {
		icnss_pr_dbg("Set mode on 0x%lx, mode: %d\n",
			     priv->state, mode);
		set_bit(ICNSS_MODE_ON, &priv->state);
	}

	kfree(resp);
	kfree(req);
	return 0;