linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/9] wil6210 patches
@ 2017-08-02 21:00 Maya Erez
  2017-08-02 21:00 ` [PATCH v2 1/9] wil6210: protect against invalid length of tx management frame Maya Erez
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210

Changes from v1:
- Removal of runtime PM patch, pending a fix to system suspend flow

Dedy Lansky (2):
  wil6210: support FW RSSI reporting
  wil6210: store FW RF calibration result

Gidon Studinski (1):
  wil6210: make debugfs compilation optional

Hamad Kadmany (3):
  wil6210: protect against invalid length of tx management frame
  wil6210: allow configuring scan timers
  wil6210: fix interface-up check

Maya Erez (3):
  wil6210: check no_fw_recovery in resume failure recovery
  wil6210: add statistics for suspend time
  wil6210: notify wiphy on wowlan support

 drivers/net/wireless/ath/wil6210/cfg80211.c | 42 ++++++++++++++++++++++++-----
 drivers/net/wireless/ath/wil6210/debugfs.c  | 36 ++++++++++++++++++++-----
 drivers/net/wireless/ath/wil6210/main.c     | 12 ++++++++-
 drivers/net/wireless/ath/wil6210/pcie_bus.c |  3 +++
 drivers/net/wireless/ath/wil6210/pm.c       | 27 ++++++++++++++++---
 drivers/net/wireless/ath/wil6210/txrx.c     |  6 ++---
 drivers/net/wireless/ath/wil6210/wil6210.h  | 15 +++++++++--
 drivers/net/wireless/ath/wil6210/wmi.c      | 14 +++++++---
 drivers/net/wireless/ath/wil6210/wmi.h      |  8 ++++--
 9 files changed, 135 insertions(+), 28 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/9] wil6210: protect against invalid length of tx management frame
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 2/9] wil6210: allow configuring scan timers Maya Erez
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Hamad Kadmany, linux-wireless, wil6210, Maya Erez, Lior David

From: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>

Validate buffer length has the minimum needed size
when sending management frame to protect against
possible buffer overrun.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 3 +++
 drivers/net/wireless/ath/wil6210/debugfs.c  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 0b5383a..77af749 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -884,6 +884,9 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 	wil_hex_dump_misc("mgmt tx frame ", DUMP_PREFIX_OFFSET, 16, 1, buf,
 			  len, true);
 
+	if (len < sizeof(struct ieee80211_hdr_3addr))
+		return -EINVAL;
+
 	cmd = kmalloc(sizeof(*cmd) + len, GFP_KERNEL);
 	if (!cmd) {
 		rc = -ENOMEM;
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index f82506d..a2b5d59 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -801,6 +801,9 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
 	int rc;
 	void *frame;
 
+	if (!len)
+		return -EINVAL;
+
 	frame = memdup_user(buf, len);
 	if (IS_ERR(frame))
 		return PTR_ERR(frame);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 2/9] wil6210: allow configuring scan timers
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
  2017-08-02 21:00 ` [PATCH v2 1/9] wil6210: protect against invalid length of tx management frame Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 3/9] wil6210: support FW RSSI reporting Maya Erez
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Hamad Kadmany, linux-wireless, wil6210, Maya Erez

From: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>

Allow setting scan timeout and scan dwell time
through module parameters.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 17 ++++++++++++++---
 drivers/net/wireless/ath/wil6210/wil6210.h  |  2 +-
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 77af749..d079533 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -26,6 +26,14 @@
 module_param(disable_ap_sme, bool, 0444);
 MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
 
+static uint scan_dwell_time  = WMI_SCAN_DWELL_TIME_MS;
+module_param(scan_dwell_time, uint, 0644);
+MODULE_PARM_DESC(scan_dwell_time, " Scan dwell time (msec)");
+
+static uint scan_timeout = WIL6210_SCAN_TO_SEC;
+module_param(scan_timeout, uint, 0644);
+MODULE_PARM_DESC(scan_timeout, " Scan timeout (seconds)");
+
 #define CHAN60G(_channel, _flags) {				\
 	.band			= NL80211_BAND_60GHZ,		\
 	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -528,8 +536,9 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
 
 	(void)wil_p2p_stop_discovery(wil);
 
-	wil_dbg_misc(wil, "Start scan_request 0x%p\n", request);
-	wil_dbg_misc(wil, "SSID count: %d", request->n_ssids);
+	wil_dbg_misc(wil,
+		     "Start scan_request 0x%p, dwell_time %dms, timeout %dsec, SSID count %d\n",
+		     request, scan_dwell_time, scan_timeout, request->n_ssids);
 
 	for (i = 0; i < request->n_ssids; i++) {
 		wil_dbg_misc(wil, "SSID[%d]", i);
@@ -550,10 +559,12 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
 	}
 
 	wil->scan_request = request;
-	mod_timer(&wil->scan_timer, jiffies + WIL6210_SCAN_TO);
+	mod_timer(&wil->scan_timer,
+		  jiffies + msecs_to_jiffies(1000U * scan_timeout));
 
 	memset(&cmd, 0, sizeof(cmd));
 	cmd.cmd.scan_type = WMI_ACTIVE_SCAN;
+	cmd.cmd.dwell_time = cpu_to_le32(scan_dwell_time);
 	cmd.cmd.num_channels = 0;
 	n = min(request->n_channels, 4U);
 	for (i = 0; i < n; i++) {
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index d085ccf..ac32284 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -112,7 +112,7 @@ static inline u32 wil_mtu2macbuf(u32 mtu)
 #define WIL6210_ITR_RX_MAX_BURST_DURATION_DEFAULT (500) /* usec */
 #define WIL6210_FW_RECOVERY_RETRIES	(5) /* try to recover this many times */
 #define WIL6210_FW_RECOVERY_TO	msecs_to_jiffies(5000)
-#define WIL6210_SCAN_TO		msecs_to_jiffies(10000)
+#define WIL6210_SCAN_TO_SEC		10
 #define WIL6210_DISCONNECT_TO_MS (2000)
 #define WIL6210_RX_HIGH_TRSH_INIT		(0)
 #define WIL6210_RX_HIGH_TRSH_DEFAULT \
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 3/9] wil6210: support FW RSSI reporting
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
  2017-08-02 21:00 ` [PATCH v2 1/9] wil6210: protect against invalid length of tx management frame Maya Erez
  2017-08-02 21:00 ` [PATCH v2 2/9] wil6210: allow configuring scan timers Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 4/9] wil6210: check no_fw_recovery in resume failure recovery Maya Erez
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Dedy Lansky, linux-wireless, wil6210, Maya Erez

From: Dedy Lansky <qca_dlansky@qca.qualcomm.com>

New FW supports reporting RSSI signal in dBm.
Report RSSI to kernel in case FW has this capability.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 12 ++++++++----
 drivers/net/wireless/ath/wil6210/debugfs.c  |  2 ++
 drivers/net/wireless/ath/wil6210/pcie_bus.c |  3 +++
 drivers/net/wireless/ath/wil6210/wmi.c      |  9 ++++++---
 drivers/net/wireless/ath/wil6210/wmi.h      |  6 ++++--
 5 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index d079533..c860c0c 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -281,12 +281,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),
@@ -319,7 +319,11 @@ 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);
-		sinfo->signal = reply.evt.sqi;
+		if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING,
+			     wil->fw_capabilities))
+			sinfo->signal = reply.evt.rssi;
+		else
+			sinfo->signal = reply.evt.sqi;
 	}
 
 	return rc;
@@ -1805,7 +1809,7 @@ static void wil_wiphy_init(struct wiphy *wiphy)
 
 	wiphy->bands[NL80211_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;
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index a2b5d59..21b6611 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1016,6 +1016,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"
@@ -1025,6 +1026,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),
diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c
index d571feb..6a3ab4b 100644
--- a/drivers/net/wireless/ath/wil6210/pcie_bus.c
+++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c
@@ -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)
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 65ef673..a9487f2 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -381,12 +381,15 @@ static void wmi_evt_rx_mgmt(struct wil6210_priv *wil, int id, void *d, int len)
 	ch_no = data->info.channel + 1;
 	freq = ieee80211_channel_to_frequency(ch_no, NL80211_BAND_60GHZ);
 	channel = ieee80211_get_channel(wiphy, freq);
-	signal = data->info.sqi;
+	if (test_bit(WMI_FW_CAPABILITY_RSSI_REPORTING, wil->fw_capabilities))
+		signal = 100 * data->info.rssi;
+	else
+		signal = data->info.sqi;
 	d_status = le16_to_cpu(data->info.status);
 	fc = rx_mgmt_frame->frame_control;
 
-	wil_dbg_wmi(wil, "MGMT Rx: channel %d MCS %d SNR %d SQI %d%%\n",
-		    data->info.channel, data->info.mcs, data->info.snr,
+	wil_dbg_wmi(wil, "MGMT Rx: channel %d MCS %d RSSI %d SQI %d%%\n",
+		    data->info.channel, data->info.mcs, data->info.rssi,
 		    data->info.sqi);
 	wil_dbg_wmi(wil, "status 0x%04x len %d fc 0x%04x\n", d_status, d_len,
 		    le16_to_cpu(fc));
diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h
index 256f63c..4e31c2f 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.h
+++ b/drivers/net/wireless/ath/wil6210/wmi.h
@@ -60,6 +60,7 @@ enum wmi_fw_capability {
 	WMI_FW_CAPABILITY_WMI_ONLY		= 5,
 	WMI_FW_CAPABILITY_THERMAL_THROTTLING	= 7,
 	WMI_FW_CAPABILITY_D3_SUSPEND		= 8,
+	WMI_FW_CAPABILITY_RSSI_REPORTING	= 12,
 	WMI_FW_CAPABILITY_MAX,
 };
 
@@ -1306,7 +1307,8 @@ struct wmi_notify_req_done_event {
 	/* beamforming status, 0: fail; 1: OK; 2: retrying */
 	__le32 status;
 	__le64 tsf;
-	__le32 snr_val;
+	s8 rssi;
+	u8 reserved0[3];
 	__le32 tx_tpt;
 	__le32 tx_goodput;
 	__le32 rx_goodput;
@@ -1602,7 +1604,7 @@ struct wmi_get_ssid_event {
 /* wmi_rx_mgmt_info */
 struct wmi_rx_mgmt_info {
 	u8 mcs;
-	s8 snr;
+	s8 rssi;
 	u8 range;
 	u8 sqi;
 	__le16 stype;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 4/9] wil6210: check no_fw_recovery in resume failure recovery
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
                   ` (2 preceding siblings ...)
  2017-08-02 21:00 ` [PATCH v2 3/9] wil6210: support FW RSSI reporting Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 5/9] wil6210: add statistics for suspend time Maya Erez
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210

Reset 11ad device on resume failure only if no_fw_recovery
is not set.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/pm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wil6210/pm.c b/drivers/net/wireless/ath/wil6210/pm.c
index ce1f384..4548829 100644
--- a/drivers/net/wireless/ath/wil6210/pm.c
+++ b/drivers/net/wireless/ath/wil6210/pm.c
@@ -85,7 +85,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);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 5/9] wil6210: add statistics for suspend time
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
                   ` (3 preceding siblings ...)
  2017-08-02 21:00 ` [PATCH v2 4/9] wil6210: check no_fw_recovery in resume failure recovery Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 6/9] wil6210: notify wiphy on wowlan support Maya Erez
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210

Add statistics for total, min and max suspend time, that
calculates the time the 11ad device was in suspend.
Those statistics will help to estimate the power impact
of d3hot feature.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/debugfs.c | 17 +++++++++++++++--
 drivers/net/wireless/ath/wil6210/main.c    |  2 ++
 drivers/net/wireless/ath/wil6210/pm.c      | 20 ++++++++++++++++++--
 drivers/net/wireless/ath/wil6210/wil6210.h |  5 +++++
 4 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 21b6611..d4e8865 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1617,6 +1617,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;
 }
@@ -1628,18 +1630,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));
 
@@ -1795,6 +1806,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;
 }
 
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index daf944a..8968c2c 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -578,6 +578,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;
 
diff --git a/drivers/net/wireless/ath/wil6210/pm.c b/drivers/net/wireless/ath/wil6210/pm.c
index 4548829..820ed17 100644
--- a/drivers/net/wireless/ath/wil6210/pm.c
+++ b/drivers/net/wireless/ath/wil6210/pm.c
@@ -300,6 +300,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;
 }
 
@@ -309,6 +312,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");
 
@@ -326,8 +330,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;
 }
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index ac32284..724ad59 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -90,6 +90,11 @@ struct wil_suspend_stats {
 	unsigned long failed_resumes;
 	unsigned long rejected_by_device;
 	unsigned long rejected_by_host;
+	unsigned long long total_suspend_time;
+	unsigned long long min_suspend_time;
+	unsigned long long max_suspend_time;
+	ktime_t collection_start;
+	ktime_t suspend_start_time;
 };
 
 /* Calculate MAC buffer size for the firmware. It includes all overhead,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 6/9] wil6210: notify wiphy on wowlan support
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
                   ` (4 preceding siblings ...)
  2017-08-02 21:00 ` [PATCH v2 5/9] wil6210: add statistics for suspend time Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 7/9] wil6210: fix interface-up check Maya Erez
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210

Set wowlan to indicate that 11ad device can wake-up
on any trigger and disconnect.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index c860c0c..61e872c 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -34,6 +34,12 @@
 module_param(scan_timeout, uint, 0644);
 MODULE_PARM_DESC(scan_timeout, " Scan timeout (seconds)");
 
+#ifdef CONFIG_PM
+static struct wiphy_wowlan_support wil_wowlan_support = {
+	.flags = WIPHY_WOWLAN_ANY | WIPHY_WOWLAN_DISCONNECT,
+};
+#endif
+
 #define CHAN60G(_channel, _flags) {				\
 	.band			= NL80211_BAND_60GHZ,		\
 	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -1819,6 +1825,10 @@ static void wil_wiphy_init(struct wiphy *wiphy)
 
 	wiphy->n_vendor_commands = ARRAY_SIZE(wil_nl80211_vendor_commands);
 	wiphy->vendor_commands = wil_nl80211_vendor_commands;
+
+#ifdef CONFIG_PM
+	wiphy->wowlan = &wil_wowlan_support;
+#endif
 }
 
 struct wireless_dev *wil_cfg80211_init(struct device *dev)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 7/9] wil6210: fix interface-up check
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
                   ` (5 preceding siblings ...)
  2017-08-02 21:00 ` [PATCH v2 6/9] wil6210: notify wiphy on wowlan support Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 8/9] wil6210: store FW RF calibration result Maya Erez
  2017-08-02 21:00 ` [PATCH v2 9/9] wil6210: make debugfs compilation optional Maya Erez
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Hamad Kadmany, linux-wireless, wil6210, Maya Erez

From: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>

While wil_open is executed, any call to netif_running
would return a success. In case there are failures
within wil_open, should not treat the device as if it
is already opened in relevant functions (like FW recovery
and runtime suspend check).

Fix that by checking the device up flag instead.

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/main.c | 3 ++-
 drivers/net/wireless/ath/wil6210/pm.c   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index 8968c2c..b1e2814 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -394,10 +394,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;
 	}
diff --git a/drivers/net/wireless/ath/wil6210/pm.c b/drivers/net/wireless/ath/wil6210/pm.c
index 820ed17..8f5d1b44 100644
--- a/drivers/net/wireless/ath/wil6210/pm.c
+++ b/drivers/net/wireless/ath/wil6210/pm.c
@@ -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;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 8/9] wil6210: store FW RF calibration result
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
                   ` (6 preceding siblings ...)
  2017-08-02 21:00 ` [PATCH v2 7/9] wil6210: fix interface-up check Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:00 ` [PATCH v2 9/9] wil6210: make debugfs compilation optional Maya Erez
  8 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Dedy Lansky, linux-wireless, wil6210, Maya Erez

From: Dedy Lansky <qca_dlansky@qca.qualcomm.com>

Store initial FW RF calibration result in driver. Set this calibration
result back to FW after each FW reset in order to avoid future calibration
procedures.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/main.c    | 6 ++++++
 drivers/net/wireless/ath/wil6210/wil6210.h | 6 ++++++
 drivers/net/wireless/ath/wil6210/wmi.c     | 5 +++++
 drivers/net/wireless/ath/wil6210/wmi.h     | 2 ++
 4 files changed, 19 insertions(+)

diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index b1e2814..b89d017 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -1034,6 +1034,12 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
 		wil_s(wil, RGF_CAF_ICR + offsetof(struct RGF_ICR, ICR), 0);
 		wil_w(wil, RGF_CAF_ICR + offsetof(struct RGF_ICR, IMV), ~0);
 
+		if (wil->fw_calib_result > 0) {
+			__le32 val = cpu_to_le32(wil->fw_calib_result |
+						 (CALIB_RESULT_SIGNATURE << 8));
+			wil_w(wil, RGF_USER_FW_CALIB_RESULT, (u32 __force)val);
+		}
+
 		wil_release_cpu(wil);
 	}
 
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index 724ad59..e3c0c2f 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -171,6 +171,10 @@ struct RGF_ICR {
 #define RGF_USER_USER_SCRATCH_PAD	(0x8802bc)
 #define RGF_USER_BL			(0x880A3C) /* Boot Loader */
 #define RGF_USER_FW_REV_ID		(0x880a8c) /* chip revision */
+#define RGF_USER_FW_CALIB_RESULT	(0x880a90) /* b0-7:result
+						    * b8-15:signature
+						    */
+	#define CALIB_RESULT_SIGNATURE	(0x11)
 #define RGF_USER_CLKS_CTL_0		(0x880abc)
 	#define BIT_USER_CLKS_CAR_AHB_SW_SEL	BIT(1) /* ref clk/PLL */
 	#define BIT_USER_CLKS_RST_PWGD	BIT(11) /* reset on "power good" */
@@ -724,6 +728,8 @@ struct wil6210_priv {
 
 	enum wmi_ps_profile_type ps_profile;
 
+	int fw_calib_result;
+
 #ifdef CONFIG_PM
 #ifdef CONFIG_PM_SLEEP
 	struct notifier_block pm_notify;
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index a9487f2..ffdd2fa 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -344,6 +344,11 @@ static void wmi_evt_ready(struct wil6210_priv *wil, int id, void *d, int len)
 	strlcpy(wdev->wiphy->fw_version, wil->fw_version,
 		sizeof(wdev->wiphy->fw_version));
 
+	if (len > offsetof(struct wmi_ready_event, rfc_read_calib_result)) {
+		wil_dbg_wmi(wil, "rfc calibration result %d\n",
+			    evt->rfc_read_calib_result);
+		wil->fw_calib_result = evt->rfc_read_calib_result;
+	}
 	wil_set_recovery_state(wil, fw_recovery_idle);
 	set_bit(wil_status_fwready, wil->status);
 	/* let the reset sequence continue */
diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h
index 4e31c2f..1b426d7 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.h
+++ b/drivers/net/wireless/ath/wil6210/wmi.h
@@ -1300,6 +1300,8 @@ struct wmi_ready_event {
 	/* enum wmi_phy_capability */
 	u8 phy_capability;
 	u8 numof_additional_mids;
+	u8 rfc_read_calib_result;
+	u8 reserved[3];
 } __packed;
 
 /* WMI_NOTIFY_REQ_DONE_EVENTID */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 9/9] wil6210: make debugfs compilation optional
  2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
                   ` (7 preceding siblings ...)
  2017-08-02 21:00 ` [PATCH v2 8/9] wil6210: store FW RF calibration result Maya Erez
@ 2017-08-02 21:00 ` Maya Erez
  2017-08-02 21:43   ` Arend van Spriel
  8 siblings, 1 reply; 12+ messages in thread
From: Maya Erez @ 2017-08-02 21:00 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Gidon Studinski, linux-wireless, wil6210, Maya Erez

From: Gidon Studinski <qca_gidons@qca.qualcomm.com>

Since debugfs is a kernel configuration option, enable the driver to
compile without debugfs.

Signed-off-by: Gidon Studinski <qca_gidons@qca.qualcomm.com>
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
---
 drivers/net/wireless/ath/wil6210/debugfs.c | 14 ++++++++++----
 drivers/net/wireless/ath/wil6210/main.c    |  1 +
 drivers/net/wireless/ath/wil6210/txrx.c    |  6 +++---
 drivers/net/wireless/ath/wil6210/wil6210.h |  2 +-
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index d4e8865..5e803e2 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -14,6 +14,10 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#include "wil6210.h"
+
+#ifdef CONFIG_DEBUG_FS
+
 #include <linux/module.h>
 #include <linux/debugfs.h>
 #include <linux/seq_file.h>
@@ -21,7 +25,6 @@
 #include <linux/rtnetlink.h>
 #include <linux/power_supply.h>
 
-#include "wil6210.h"
 #include "wmi.h"
 #include "txrx.h"
 #include "pmc.h"
@@ -30,7 +33,6 @@
 static u32 mem_addr;
 static u32 dbg_txdesc_index;
 static u32 dbg_vring_index; /* 24+ for Rx, 0..23 for Tx */
-u32 vring_idle_trsh = 16; /* HW fetches up to 16 descriptors at once */
 
 enum dbg_off_type {
 	doff_u32 = 0,
@@ -1763,6 +1765,7 @@ static void wil6210_debugfs_init_isr(struct wil6210_priv *wil,
 	WIL_FIELD(chip_revision, 0444,	doff_u8),
 	WIL_FIELD(abft_len, 0644,		doff_u8),
 	WIL_FIELD(wakeup_trigger, 0644,		doff_u8),
+	WIL_FIELD(vring_idle_trsh, 0644,	doff_u32),
 	{},
 };
 
@@ -1778,8 +1781,6 @@ static void wil6210_debugfs_init_isr(struct wil6210_priv *wil,
 	{"desc_index",	0644, (ulong)&dbg_txdesc_index, doff_u32},
 	{"vring_index",	0644, (ulong)&dbg_vring_index, doff_u32},
 	{"mem_addr",	0644, (ulong)&mem_addr, doff_u32},
-	{"vring_idle_trsh", 0644, (ulong)&vring_idle_trsh,
-	 doff_u32},
 	{"led_polarity", 0644, (ulong)&led_polarity, doff_u8},
 	{},
 };
@@ -1821,3 +1822,8 @@ void wil6210_debugfs_remove(struct wil6210_priv *wil)
 	 */
 	wil_pmc_free(wil, false);
 }
+
+#else /* !CONFIG_DEBUG_FS */
+int wil6210_debugfs_init(struct wil6210_priv *wil) { return 0; }
+void wil6210_debugfs_remove(struct wil6210_priv *wil) {}
+#endif
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index b89d017..e2ea490 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -581,6 +581,7 @@ int wil_priv_init(struct wil6210_priv *wil)
 			      WMI_WAKEUP_TRIGGER_BCAST;
 	memset(&wil->suspend_stats, 0, sizeof(wil->suspend_stats));
 	wil->suspend_stats.min_suspend_time = ULONG_MAX;
+	wil->vring_idle_trsh = 16;
 
 	return 0;
 
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index ec57bcc..389c718 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -1666,7 +1666,7 @@ static int __wil_tx_vring_tso(struct wil6210_priv *wil, struct vring *vring,
 
 	/* performance monitoring */
 	used = wil_vring_used_tx(vring);
-	if (wil_val_in_range(vring_idle_trsh,
+	if (wil_val_in_range(wil->vring_idle_trsh,
 			     used, used + descs_used)) {
 		txdata->idle += get_cycles() - txdata->last_idle;
 		wil_dbg_txrx(wil,  "Ring[%2d] not idle %d -> %d\n",
@@ -1813,7 +1813,7 @@ static int __wil_tx_vring(struct wil6210_priv *wil, struct vring *vring,
 
 	/* performance monitoring */
 	used = wil_vring_used_tx(vring);
-	if (wil_val_in_range(vring_idle_trsh,
+	if (wil_val_in_range(wil->vring_idle_trsh,
 			     used, used + nr_frags + 1)) {
 		txdata->idle += get_cycles() - txdata->last_idle;
 		wil_dbg_txrx(wil,  "Ring[%2d] not idle %d -> %d\n",
@@ -2175,7 +2175,7 @@ int wil_tx_complete(struct wil6210_priv *wil, int ringid)
 
 	/* performance monitoring */
 	used_new = wil_vring_used_tx(vring);
-	if (wil_val_in_range(vring_idle_trsh,
+	if (wil_val_in_range(wil->vring_idle_trsh,
 			     used_new, used_before_complete)) {
 		wil_dbg_txrx(wil, "Ring[%2d] idle %d -> %d\n",
 			     ringid, used_before_complete, used_new);
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index e3c0c2f..cf20a8c 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -30,7 +30,6 @@
 extern unsigned int mtu_max;
 extern unsigned short rx_ring_overflow_thrsh;
 extern int agg_wsize;
-extern u32 vring_idle_trsh;
 extern bool rx_align_2;
 extern bool rx_large_buf;
 extern bool debug_fw;
@@ -693,6 +692,7 @@ struct wil6210_priv {
 	u8 vring2cid_tid[WIL6210_MAX_TX_RINGS][2]; /* [0] - CID, [1] - TID */
 	struct wil_sta_info sta[WIL6210_MAX_CID];
 	int bcast_vring;
+	u32 vring_idle_trsh; /* HW fetches up to 16 descriptors at once  */
 	bool use_extended_dma_addr; /* indicates whether we are using 48 bits */
 	/* scan */
 	struct cfg80211_scan_request *scan_request;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 9/9] wil6210: make debugfs compilation optional
  2017-08-02 21:00 ` [PATCH v2 9/9] wil6210: make debugfs compilation optional Maya Erez
@ 2017-08-02 21:43   ` Arend van Spriel
  0 siblings, 0 replies; 12+ messages in thread
From: Arend van Spriel @ 2017-08-02 21:43 UTC (permalink / raw)
  To: Maya Erez, Kalle Valo; +Cc: Gidon Studinski, linux-wireless, wil6210

On 02-08-17 23:00, Maya Erez wrote:
> From: Gidon Studinski <qca_gidons@qca.qualcomm.com>
> 
> Since debugfs is a kernel configuration option, enable the driver to
> compile without debugfs.
> 
> Signed-off-by: Gidon Studinski <qca_gidons@qca.qualcomm.com>
> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
> ---
>  drivers/net/wireless/ath/wil6210/debugfs.c | 14 ++++++++++----
>  drivers/net/wireless/ath/wil6210/main.c    |  1 +
>  drivers/net/wireless/ath/wil6210/txrx.c    |  6 +++---
>  drivers/net/wireless/ath/wil6210/wil6210.h |  2 +-
>  4 files changed, 15 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
> index d4e8865..5e803e2 100644
> --- a/drivers/net/wireless/ath/wil6210/debugfs.c
> +++ b/drivers/net/wireless/ath/wil6210/debugfs.c
> @@ -14,6 +14,10 @@
>   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>   */
>  
> +#include "wil6210.h"
> +
> +#ifdef CONFIG_DEBUG_FS
> +

[...]

> +#else /* !CONFIG_DEBUG_FS */
> +int wil6210_debugfs_init(struct wil6210_priv *wil) { return 0; }
> +void wil6210_debugfs_remove(struct wil6210_priv *wil) {}
> +#endif

I think it would be better to have these stubs defined in the header
file, ie. in wil6210.h. That way you can conditionally compile this
source file through Makefile as below keeping debugfs.c clean.

Regards,
Arend

diff --git a/drivers/net/wireless/ath/wil6210/Makefile
b/drivers/net/wireless/ath/wil6210/Makefile
index 4ae21da..0f98904c 100644
--- a/drivers/net/wireless/ath/wil6210/Makefile
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -4,7 +4,7 @@ wil6210-y := main.o
 wil6210-y += netdev.o
 wil6210-y += cfg80211.o
 wil6210-y += pcie_bus.o
-wil6210-y += debugfs.o
+wil6210-$(CONFIG_DEBUG_FS) += debugfs.o
 wil6210-y += wmi.o
 wil6210-y += interrupt.o
 wil6210-y += txrx.o

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v2 0/9] wil6210 patches
@ 2017-12-14 16:53 Maya Erez
  0 siblings, 0 replies; 12+ messages in thread
From: Maya Erez @ 2017-12-14 16:53 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210

Changes from v1:
- Fix code review comments on "wil6210: support Scheduled scan"

The following patches include several wil6210 fixes.

Dedy Lansky (2):
  wil6210: support Scheduled scan
  wil6210: remove leftover "FIXME"s

Lazar Alexei (2):
  wil6210: support 40bit DMA addresses
  wil6210: add support for headroom configuration

Lior David (2):
  wil6210: configurable broadcast TX MCS
  wil6210: remove reference to preset_chandef

Maya Erez (3):
  wil6210: add platform capabilities bitmap
  wil6210: set platform features based on FW capabilities
  wil6210: prevent parallel suspend and dump collection

 drivers/net/wireless/ath/wil6210/cfg80211.c       |  68 +++++-
 drivers/net/wireless/ath/wil6210/debugfs.c        |   1 -
 drivers/net/wireless/ath/wil6210/interrupt.c      |   2 +-
 drivers/net/wireless/ath/wil6210/main.c           |  67 +++++-
 drivers/net/wireless/ath/wil6210/netdev.c         |   2 +-
 drivers/net/wireless/ath/wil6210/pcie_bus.c       |  36 +++-
 drivers/net/wireless/ath/wil6210/pm.c             |  17 ++
 drivers/net/wireless/ath/wil6210/pmc.c            |  11 +-
 drivers/net/wireless/ath/wil6210/txrx.c           | 101 ++++++++-
 drivers/net/wireless/ath/wil6210/wil6210.h        |  15 +-
 drivers/net/wireless/ath/wil6210/wil_crash_dump.c |  11 +
 drivers/net/wireless/ath/wil6210/wil_platform.h   |  15 +-
 drivers/net/wireless/ath/wil6210/wmi.c            | 241 +++++++++++++++++++++-
 drivers/net/wireless/ath/wil6210/wmi.h            | 100 +++++++--
 14 files changed, 621 insertions(+), 66 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-12-14 16:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-02 21:00 [PATCH v2 0/9] wil6210 patches Maya Erez
2017-08-02 21:00 ` [PATCH v2 1/9] wil6210: protect against invalid length of tx management frame Maya Erez
2017-08-02 21:00 ` [PATCH v2 2/9] wil6210: allow configuring scan timers Maya Erez
2017-08-02 21:00 ` [PATCH v2 3/9] wil6210: support FW RSSI reporting Maya Erez
2017-08-02 21:00 ` [PATCH v2 4/9] wil6210: check no_fw_recovery in resume failure recovery Maya Erez
2017-08-02 21:00 ` [PATCH v2 5/9] wil6210: add statistics for suspend time Maya Erez
2017-08-02 21:00 ` [PATCH v2 6/9] wil6210: notify wiphy on wowlan support Maya Erez
2017-08-02 21:00 ` [PATCH v2 7/9] wil6210: fix interface-up check Maya Erez
2017-08-02 21:00 ` [PATCH v2 8/9] wil6210: store FW RF calibration result Maya Erez
2017-08-02 21:00 ` [PATCH v2 9/9] wil6210: make debugfs compilation optional Maya Erez
2017-08-02 21:43   ` Arend van Spriel
2017-12-14 16:53 [PATCH v2 0/9] wil6210 patches Maya Erez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).