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

Commit ed52938f authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: fix interface-up check"

parents e53deedd 66865bb5
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -31,6 +31,12 @@ static bool ignore_reg_hints = true;
module_param(ignore_reg_hints, bool, 0444);
MODULE_PARM_DESC(ignore_reg_hints, " Ignore OTA regulatory hints (Default: true)");

#ifdef CONFIG_PM
static struct wiphy_wowlan_support wil_wowlan_support = {
	.flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_DISCONNECT,
};
#endif

#define CHAN60G(_channel, _flags) {				\
	.band			= IEEE80211_BAND_60GHZ,		\
	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -345,12 +351,12 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,

	wil_dbg_wmi(wil, "Link status for CID %d: {\n"
		    "  MCS %d TSF 0x%016llx\n"
		    "  BF status 0x%08x SNR 0x%08x SQI %d%%\n"
		    "  BF status 0x%08x RSSI %d SQI %d%%\n"
		    "  Tx Tpt %d goodput %d Rx goodput %d\n"
		    "  Sectors(rx:tx) my %d:%d peer %d:%d\n""}\n",
		    cid, le16_to_cpu(reply.evt.bf_mcs),
		    le64_to_cpu(reply.evt.tsf), reply.evt.status,
		    le32_to_cpu(reply.evt.snr_val),
		    reply.evt.rssi,
		    reply.evt.sqi,
		    le32_to_cpu(reply.evt.tx_tpt),
		    le32_to_cpu(reply.evt.tx_goodput),
@@ -384,6 +390,10 @@ int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,

	if (test_bit(wil_status_fwconnected, wil->status)) {
		sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
		if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING,
			     wil->fw_capabilities))
			sinfo->signal = reply.evt.rssi;
		else
			sinfo->signal = reply.evt.sqi;
	}

@@ -1870,7 +1880,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)

	wiphy->bands[IEEE80211_BAND_60GHZ] = &wil_band_60ghz;

	/* TODO: figure this out */
	/* may change after reading FW capabilities */
	wiphy->signal_type = CFG80211_SIGNAL_TYPE_UNSPEC;

	wiphy->cipher_suites = wil_cipher_suites;
@@ -1887,6 +1897,10 @@ static void wil_wiphy_init(struct wiphy *wiphy)
		wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS;
		wiphy->regulatory_flags |= REGULATORY_COUNTRY_IE_IGNORE;
	}

#ifdef CONFIG_PM
	wiphy->wowlan = &wil_wowlan_support;
#endif
}

struct wireless_dev *wil_cfg80211_init(struct device *dev)
+17 −2
Original line number Diff line number Diff line
@@ -1027,6 +1027,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data)
			   "  TSF = 0x%016llx\n"
			   "  TxMCS = %2d TxTpt = %4d\n"
			   "  SQI = %4d\n"
			   "  RSSI = %4d\n"
			   "  Status = 0x%08x %s\n"
			   "  Sectors(rx:tx) my %2d:%2d peer %2d:%2d\n"
			   "  Goodput(rx:tx) %4d:%4d\n"
@@ -1036,6 +1037,7 @@ static int wil_bf_debugfs_show(struct seq_file *s, void *data)
			   le16_to_cpu(reply.evt.bf_mcs),
			   le32_to_cpu(reply.evt.tx_tpt),
			   reply.evt.sqi,
			   reply.evt.rssi,
			   status, wil_bfstatus_str(status),
			   le16_to_cpu(reply.evt.my_rx_sector),
			   le16_to_cpu(reply.evt.my_tx_sector),
@@ -1626,6 +1628,8 @@ static ssize_t wil_write_suspend_stats(struct file *file,
	struct wil6210_priv *wil = file->private_data;

	memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats));
	wil->suspend_stats.min_suspend_time = ULONG_MAX;
	wil->suspend_stats.collection_start = ktime_get();

	return len;
}
@@ -1637,18 +1641,27 @@ static ssize_t wil_read_suspend_stats(struct file *file,
	struct wil6210_priv *wil = file->private_data;
	static char text[400];
	int n;
	unsigned long long stats_collection_time =
		ktime_to_us(ktime_sub(ktime_get(),
				      wil->suspend_stats.collection_start));

	n = snprintf(text, sizeof(text),
		     "Suspend statistics:\n"
		     "successful suspends:%ld failed suspends:%ld\n"
		     "successful resumes:%ld failed resumes:%ld\n"
		     "rejected by host:%ld rejected by device:%ld\n",
		     "rejected by host:%ld rejected by device:%ld\n"
		     "total suspend time:%lld min suspend time:%lld\n"
		     "max suspend time:%lld stats collection time: %lld\n",
		     wil->suspend_stats.successful_suspends,
		     wil->suspend_stats.failed_suspends,
		     wil->suspend_stats.successful_resumes,
		     wil->suspend_stats.failed_resumes,
		     wil->suspend_stats.rejected_by_host,
		     wil->suspend_stats.rejected_by_device);
		     wil->suspend_stats.rejected_by_device,
		     wil->suspend_stats.total_suspend_time,
		     wil->suspend_stats.min_suspend_time,
		     wil->suspend_stats.max_suspend_time,
		     stats_collection_time);

	n = min_t(int, n, sizeof(text));

@@ -1804,6 +1817,8 @@ int wil6210_debugfs_init(struct wil6210_priv *wil)

	wil6210_debugfs_create_ITR_CNT(wil, dbg);

	wil->suspend_stats.collection_start = ktime_get();

	return 0;
}

+4 −1
Original line number Diff line number Diff line
@@ -395,10 +395,11 @@ static void wil_fw_error_worker(struct work_struct *work)
	struct wil6210_priv *wil = container_of(work, struct wil6210_priv,
						fw_error_worker);
	struct wireless_dev *wdev = wil->wdev;
	struct net_device *ndev = wil_to_ndev(wil);

	wil_dbg_misc(wil, "fw error worker\n");

	if (!netif_running(wil_to_ndev(wil))) {
	if (!(ndev->flags & IFF_UP)) {
		wil_info(wil, "No recovery - interface is down\n");
		return;
	}
@@ -581,6 +582,8 @@ int wil_priv_init(struct wil6210_priv *wil)

	wil->wakeup_trigger = WMI_WAKEUP_TRIGGER_UCAST |
			      WMI_WAKEUP_TRIGGER_BCAST;
	memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats));
	wil->suspend_stats.min_suspend_time = ULONG_MAX;

	return 0;

+3 −0
Original line number Diff line number Diff line
@@ -84,6 +84,9 @@ void wil_set_capabilities(struct wil6210_priv *wil)

	/* extract FW capabilities from file without loading the FW */
	wil_request_firmware(wil, wil->wil_fw_name, false);

	if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING, wil->fw_capabilities))
		wil_to_wiphy(wil)->signal_type = CFG80211_SIGNAL_TYPE_MBM;
}

void wil_disable_irq(struct wil6210_priv *wil)
+23 −4
Original line number Diff line number Diff line
@@ -21,10 +21,11 @@ int wil_can_suspend(struct wil6210_priv *wil, bool is_runtime)
{
	int rc = 0;
	struct wireless_dev *wdev = wil->wdev;
	struct net_device *ndev = wil_to_ndev(wil);

	wil_dbg_pm(wil, "can_suspend: %s\n", is_runtime ? "runtime" : "system");

	if (!netif_running(wil_to_ndev(wil))) {
	if (!(ndev->flags & IFF_UP)) {
		/* can always sleep when down */
		wil_dbg_pm(wil, "Interface is down\n");
		goto out;
@@ -85,7 +86,9 @@ static int wil_resume_keep_radio_on(struct wil6210_priv *wil)
	/* Send WMI resume request to the device */
	rc = wmi_resume(wil);
	if (rc) {
		wil_err(wil, "device failed to resume (%d), resetting\n", rc);
		wil_err(wil, "device failed to resume (%d)\n", rc);
		if (no_fw_recovery)
			goto out;
		rc = wil_down(wil);
		if (rc) {
			wil_err(wil, "wil_down failed (%d)\n", rc);
@@ -298,6 +301,9 @@ int wil_suspend(struct wil6210_priv *wil, bool is_runtime)
	wil_dbg_pm(wil, "suspend: %s => %d\n",
		   is_runtime ? "runtime" : "system", rc);

	if (!rc)
		wil->suspend_stats.suspend_start_time = ktime_get();

	return rc;
}

@@ -307,6 +313,7 @@ int wil_resume(struct wil6210_priv *wil, bool is_runtime)
	struct net_device *ndev = wil_to_ndev(wil);
	bool keep_radio_on = ndev->flags & IFF_UP &&
			     wil->keep_radio_on_during_sleep;
	unsigned long long suspend_time_usec = 0;

	wil_dbg_pm(wil, "resume: %s\n", is_runtime ? "runtime" : "system");

@@ -324,8 +331,20 @@ int wil_resume(struct wil6210_priv *wil, bool is_runtime)
	else
		rc = wil_resume_radio_off(wil);

	if (rc)
		goto out;

	suspend_time_usec =
		ktime_to_us(ktime_sub(ktime_get(),
				      wil->suspend_stats.suspend_start_time));
	wil->suspend_stats.total_suspend_time += suspend_time_usec;
	if (suspend_time_usec < wil->suspend_stats.min_suspend_time)
		wil->suspend_stats.min_suspend_time = suspend_time_usec;
	if (suspend_time_usec > wil->suspend_stats.max_suspend_time)
		wil->suspend_stats.max_suspend_time = suspend_time_usec;

out:
	wil_dbg_pm(wil, "resume: %s => %d\n",
		   is_runtime ? "runtime" : "system", rc);
	wil_dbg_pm(wil, "resume: %s => %d, suspend time %lld usec\n",
		   is_runtime ? "runtime" : "system", rc, suspend_time_usec);
	return rc;
}
Loading