Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2 02/13] wil6210: add disable_ap_sme module parameter
From: Maya Erez @ 2017-01-12 13:05 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Dedy Lansky, linux-wireless, wil6210, Maya Erez
In-Reply-To: <1484226365-10433-1-git-send-email-qca_merez@qca.qualcomm.com>

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

By default, AP SME is handled by driver/FW.
In case disable_ap_sme is true, driver doesn't turn-on
WIPHY_FLAG_HAVE_AP_SME and the responsibility for
AP SME is passed to user space.

With AP SME disabled, driver reports assoc request frame
to user space which is then responsible for sending assoc
response frame and for sending NL80211_CMD_NEW_STATION.
Driver also reports disassoc frame to user space
which should then send NL80211_CMD_DEL_STATION.

NL80211_CMD_SET_STATION with NL80211_STA_FLAG_AUTHORIZED
is used by user space to allow/disallow data transmit.

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 | 92 +++++++++++++++++++++++++++--
 drivers/net/wireless/ath/wil6210/main.c     | 10 +++-
 drivers/net/wireless/ath/wil6210/wil6210.h  |  9 ++-
 drivers/net/wireless/ath/wil6210/wmi.c      | 68 +++++++++++++++++----
 drivers/net/wireless/ath/wil6210/wmi.h      | 23 +++++++-
 5 files changed, 178 insertions(+), 24 deletions(-)

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 54dd116..e6001bb 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -20,6 +20,10 @@
 
 #define WIL_MAX_ROC_DURATION_MS 5000
 
+bool disable_ap_sme;
+module_param(disable_ap_sme, bool, S_IRUGO);
+MODULE_PARM_DESC(disable_ap_sme, " let user space handle AP mode SME");
+
 #define CHAN60G(_channel, _flags) {				\
 	.band			= NL80211_BAND_60GHZ,		\
 	.center_freq		= 56160 + (2160 * (_channel)),	\
@@ -62,9 +66,16 @@
 	},
 	[NL80211_IFTYPE_AP] = {
 		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
-		BIT(IEEE80211_STYPE_PROBE_RESP >> 4),
+		BIT(IEEE80211_STYPE_PROBE_RESP >> 4) |
+		BIT(IEEE80211_STYPE_ASSOC_RESP >> 4) |
+		BIT(IEEE80211_STYPE_DISASSOC >> 4),
 		.rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
-		BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
+		BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
+		BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
+		BIT(IEEE80211_STYPE_DISASSOC >> 4) |
+		BIT(IEEE80211_STYPE_AUTH >> 4) |
+		BIT(IEEE80211_STYPE_DEAUTH >> 4) |
+		BIT(IEEE80211_STYPE_REASSOC_REQ >> 4)
 	},
 	[NL80211_IFTYPE_P2P_CLIENT] = {
 		.tx = BIT(IEEE80211_STYPE_ACTION >> 4) |
@@ -1322,6 +1333,28 @@ static int wil_cfg80211_stop_ap(struct wiphy *wiphy,
 	return 0;
 }
 
+static int wil_cfg80211_add_station(struct wiphy *wiphy,
+				    struct net_device *dev,
+				    const u8 *mac,
+				    struct station_parameters *params)
+{
+	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
+
+	wil_dbg_misc(wil, "add station %pM aid %d\n", mac, params->aid);
+
+	if (!disable_ap_sme) {
+		wil_err(wil, "not supported with AP SME enabled\n");
+		return -EOPNOTSUPP;
+	}
+
+	if (params->aid > WIL_MAX_DMG_AID) {
+		wil_err(wil, "invalid aid\n");
+		return -EINVAL;
+	}
+
+	return wmi_new_sta(wil, mac, params->aid);
+}
+
 static int wil_cfg80211_del_station(struct wiphy *wiphy,
 				    struct net_device *dev,
 				    struct station_del_parameters *params)
@@ -1338,6 +1371,52 @@ static int wil_cfg80211_del_station(struct wiphy *wiphy,
 	return 0;
 }
 
+static int wil_cfg80211_change_station(struct wiphy *wiphy,
+				       struct net_device *dev,
+				       const u8 *mac,
+				       struct station_parameters *params)
+{
+	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
+	int authorize;
+	int cid, i;
+	struct vring_tx_data *txdata = NULL;
+
+	wil_dbg_misc(wil, "change station %pM mask 0x%x set 0x%x\n", mac,
+		     params->sta_flags_mask, params->sta_flags_set);
+
+	if (!disable_ap_sme) {
+		wil_dbg_misc(wil, "not supported with AP SME enabled\n");
+		return -EOPNOTSUPP;
+	}
+
+	if (!(params->sta_flags_mask & BIT(NL80211_STA_FLAG_AUTHORIZED)))
+		return 0;
+
+	cid = wil_find_cid(wil, mac);
+	if (cid < 0) {
+		wil_err(wil, "station not found\n");
+		return -ENOLINK;
+	}
+
+	for (i = 0; i < ARRAY_SIZE(wil->vring2cid_tid); i++)
+		if (wil->vring2cid_tid[i][0] == cid) {
+			txdata = &wil->vring_tx_data[i];
+			break;
+		}
+
+	if (!txdata) {
+		wil_err(wil, "vring data not found\n");
+		return -ENOLINK;
+	}
+
+	authorize = params->sta_flags_set & BIT(NL80211_STA_FLAG_AUTHORIZED);
+	txdata->dot1x_open = authorize ? 1 : 0;
+	wil_dbg_misc(wil, "cid %d vring %d authorize %d\n", cid, i,
+		     txdata->dot1x_open);
+
+	return 0;
+}
+
 /* probe_client handling */
 static void wil_probe_client_handle(struct wil6210_priv *wil,
 				    struct wil_probe_client_req *req)
@@ -1521,7 +1600,9 @@ static int wil_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 	.change_beacon = wil_cfg80211_change_beacon,
 	.start_ap = wil_cfg80211_start_ap,
 	.stop_ap = wil_cfg80211_stop_ap,
+	.add_station = wil_cfg80211_add_station,
 	.del_station = wil_cfg80211_del_station,
+	.change_station = wil_cfg80211_change_station,
 	.probe_client = wil_cfg80211_probe_client,
 	.change_bss = wil_cfg80211_change_bss,
 	/* P2P device */
@@ -1542,10 +1623,11 @@ static void wil_wiphy_init(struct wiphy *wiphy)
 				 BIT(NL80211_IFTYPE_P2P_GO) |
 				 BIT(NL80211_IFTYPE_P2P_DEVICE) |
 				 BIT(NL80211_IFTYPE_MONITOR);
-	wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
-			WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
+	wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
 			WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
 			WIPHY_FLAG_PS_ON_BY_DEFAULT;
+	if (!disable_ap_sme)
+		wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME;
 	dev_dbg(wiphy_dev(wiphy), "%s : flags = 0x%08x\n",
 		__func__, wiphy->flags);
 	wiphy->probe_resp_offload =
diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c
index e2e021b..57c19d0 100644
--- a/drivers/net/wireless/ath/wil6210/main.c
+++ b/drivers/net/wireless/ath/wil6210/main.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -176,8 +176,12 @@ static void wil_disconnect_cid(struct wil6210_priv *wil, int cid,
 		     sta->status);
 	/* inform upper/lower layers */
 	if (sta->status != wil_sta_unused) {
-		if (!from_event)
-			wmi_disconnect_sta(wil, sta->addr, reason_code, true);
+		if (!from_event) {
+			bool del_sta = (wdev->iftype == NL80211_IFTYPE_AP) ?
+						disable_ap_sme : false;
+			wmi_disconnect_sta(wil, sta->addr, reason_code,
+					   true, del_sta);
+		}
 
 		switch (wdev->iftype) {
 		case NL80211_IFTYPE_AP:
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index 07d4f76..1cd92c6 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -33,6 +33,7 @@
 extern u32 vring_idle_trsh;
 extern bool rx_align_2;
 extern bool debug_fw;
+extern bool disable_ap_sme;
 
 #define WIL_NAME "wil6210"
 #define WIL_FW_NAME "wil6210.fw" /* code */
@@ -98,6 +99,9 @@ static inline u32 wil_mtu2macbuf(u32 mtu)
 #define WIL6210_RX_HIGH_TRSH_INIT		(0)
 #define WIL6210_RX_HIGH_TRSH_DEFAULT \
 				(1 << (WIL_RX_RING_SIZE_ORDER_DEFAULT - 3))
+#define WIL_MAX_DMG_AID 254 /* for DMG only 1-254 allowed (see
+			     * 802.11REVmc/D5.0, section 9.4.1.8)
+			     */
 /* Hardware definitions begin */
 
 /*
@@ -816,8 +820,8 @@ int wmi_add_cipher_key(struct wil6210_priv *wil, u8 key_index,
 int wmi_rx_chain_add(struct wil6210_priv *wil, struct vring *vring);
 int wmi_rxon(struct wil6210_priv *wil, bool on);
 int wmi_get_temperature(struct wil6210_priv *wil, u32 *t_m, u32 *t_r);
-int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac, u16 reason,
-		       bool full_disconnect);
+int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac,
+		       u16 reason, bool full_disconnect, bool del_sta);
 int wmi_addba(struct wil6210_priv *wil, u8 ringid, u8 size, u16 timeout);
 int wmi_delba_tx(struct wil6210_priv *wil, u8 ringid, u16 reason);
 int wmi_delba_rx(struct wil6210_priv *wil, u8 cidxtid, u16 reason);
@@ -827,6 +831,7 @@ int wmi_ps_dev_profile_cfg(struct wil6210_priv *wil,
 			   enum wmi_ps_profile_type ps_profile);
 int wmi_set_mgmt_retry(struct wil6210_priv *wil, u8 retry_short);
 int wmi_get_mgmt_retry(struct wil6210_priv *wil, u8 *retry_short);
+int wmi_new_sta(struct wil6210_priv *wil, const u8 *mac, u8 aid);
 int wil_addba_rx_request(struct wil6210_priv *wil, u8 cidxtid,
 			 u8 dialog_token, __le16 ba_param_set,
 			 __le16 ba_timeout, __le16 ba_seq_ctrl);
diff --git a/drivers/net/wireless/ath/wil6210/wmi.c b/drivers/net/wireless/ath/wil6210/wmi.c
index 7585003..556acd3 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.c
+++ b/drivers/net/wireless/ath/wil6210/wmi.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -556,7 +556,7 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
 		wil_err(wil, "%s: config tx vring failed for CID %d, rc (%d)\n",
 			__func__, evt->cid, rc);
 		wmi_disconnect_sta(wil, wil->sta[evt->cid].addr,
-				   WLAN_REASON_UNSPECIFIED, false);
+				   WLAN_REASON_UNSPECIFIED, false, false);
 	} else {
 		wil_info(wil, "%s: successful connection to CID %d\n",
 			 __func__, evt->cid);
@@ -583,8 +583,12 @@ static void wmi_evt_connect(struct wil6210_priv *wil, int id, void *d, int len)
 		}
 	} else if ((wdev->iftype == NL80211_IFTYPE_AP) ||
 		   (wdev->iftype == NL80211_IFTYPE_P2P_GO)) {
-		if (rc)
+		if (rc) {
+			if (disable_ap_sme)
+				/* notify new_sta has failed */
+				cfg80211_del_sta(ndev, evt->bssid, GFP_KERNEL);
 			goto out;
+		}
 
 		memset(&sinfo, 0, sizeof(sinfo));
 
@@ -687,6 +691,7 @@ static void wmi_evt_vring_en(struct wil6210_priv *wil, int id, void *d, int len)
 {
 	struct wmi_vring_en_event *evt = d;
 	u8 vri = evt->vring_index;
+	struct wireless_dev *wdev = wil_to_wdev(wil);
 
 	wil_dbg_wmi(wil, "Enable vring %d\n", vri);
 
@@ -694,7 +699,12 @@ static void wmi_evt_vring_en(struct wil6210_priv *wil, int id, void *d, int len)
 		wil_err(wil, "Enable for invalid vring %d\n", vri);
 		return;
 	}
-	wil->vring_tx_data[vri].dot1x_open = true;
+
+	if (wdev->iftype != NL80211_IFTYPE_AP || !disable_ap_sme)
+		/* in AP mode with disable_ap_sme, this is done by
+		 * wil_cfg80211_change_station()
+		 */
+		wil->vring_tx_data[vri].dot1x_open = true;
 	if (vri == wil->bcast_vring) /* no BA for bcast */
 		return;
 	if (agg_wsize >= 0)
@@ -1069,6 +1079,7 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype,
 		.pcp_max_assoc_sta = max_assoc_sta,
 		.hidden_ssid = hidden_ssid,
 		.is_go = is_go,
+		.disable_ap_sme = disable_ap_sme,
 	};
 	struct {
 		struct wmi_cmd_hdr wmi;
@@ -1086,6 +1097,13 @@ int wmi_pcp_start(struct wil6210_priv *wil, int bi, u8 wmi_nettype,
 		cmd.pcp_max_assoc_sta = WIL6210_MAX_CID;
 	}
 
+	if (disable_ap_sme &&
+	    !test_bit(WMI_FW_CAPABILITY_DISABLE_AP_SME,
+		      wil->fw_capabilities)) {
+		wil_err(wil, "disable_ap_sme not supported by FW\n");
+		return -EOPNOTSUPP;
+	}
+
 	/*
 	 * Processing time may be huge, in case of secure AP it takes about
 	 * 3500ms for FW to start AP
@@ -1456,12 +1474,15 @@ int wmi_get_temperature(struct wil6210_priv *wil, u32 *t_bb, u32 *t_rf)
 	return 0;
 }
 
-int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac, u16 reason,
-		       bool full_disconnect)
+int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac,
+		       u16 reason, bool full_disconnect, bool del_sta)
 {
 	int rc;
 	u16 reason_code;
-	struct wmi_disconnect_sta_cmd cmd = {
+	struct wmi_disconnect_sta_cmd disc_sta_cmd = {
+		.disconnect_reason = cpu_to_le16(reason),
+	};
+	struct wmi_del_sta_cmd del_sta_cmd = {
 		.disconnect_reason = cpu_to_le16(reason),
 	};
 	struct {
@@ -1469,12 +1490,19 @@ int wmi_disconnect_sta(struct wil6210_priv *wil, const u8 *mac, u16 reason,
 		struct wmi_disconnect_event evt;
 	} __packed reply;
 
-	ether_addr_copy(cmd.dst_mac, mac);
-
 	wil_dbg_wmi(wil, "%s(%pM, reason %d)\n", __func__, mac, reason);
 
-	rc = wmi_call(wil, WMI_DISCONNECT_STA_CMDID, &cmd, sizeof(cmd),
-		      WMI_DISCONNECT_EVENTID, &reply, sizeof(reply), 1000);
+	if (del_sta) {
+		ether_addr_copy(del_sta_cmd.dst_mac, mac);
+		rc = wmi_call(wil, WMI_DEL_STA_CMDID, &del_sta_cmd,
+			      sizeof(del_sta_cmd), WMI_DISCONNECT_EVENTID,
+			      &reply, sizeof(reply), 1000);
+	} else {
+		ether_addr_copy(disc_sta_cmd.dst_mac, mac);
+		rc = wmi_call(wil, WMI_DISCONNECT_STA_CMDID, &disc_sta_cmd,
+			      sizeof(disc_sta_cmd), WMI_DISCONNECT_EVENTID,
+			      &reply, sizeof(reply), 1000);
+	}
 	/* failure to disconnect in reasonable time treated as FW error */
 	if (rc) {
 		wil_fw_error_recovery(wil);
@@ -1686,6 +1714,24 @@ int wmi_abort_scan(struct wil6210_priv *wil)
 	return rc;
 }
 
+int wmi_new_sta(struct wil6210_priv *wil, const u8 *mac, u8 aid)
+{
+	int rc;
+	struct wmi_new_sta_cmd cmd = {
+		.aid = aid,
+	};
+
+	wil_dbg_wmi(wil, "new sta %pM, aid %d\n", mac, aid);
+
+	ether_addr_copy(cmd.dst_mac, mac);
+
+	rc = wmi_send(wil, WMI_NEW_STA_CMDID, &cmd, sizeof(cmd));
+	if (rc)
+		wil_err(wil, "Failed to send new sta (%d)\n", rc);
+
+	return rc;
+}
+
 void wmi_event_flush(struct wil6210_priv *wil)
 {
 	struct pending_wmi_event *evt, *t;
diff --git a/drivers/net/wireless/ath/wil6210/wmi.h b/drivers/net/wireless/ath/wil6210/wmi.h
index d93a4d4..9c4a0bd 100644
--- a/drivers/net/wireless/ath/wil6210/wmi.h
+++ b/drivers/net/wireless/ath/wil6210/wmi.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  * Copyright (c) 2006-2012 Wilocity
  *
  * Permission to use, copy, modify, and/or distribute this software for any
@@ -56,6 +56,7 @@ enum wmi_fw_capability {
 	WMI_FW_CAPABILITY_PS_CONFIG		= 1,
 	WMI_FW_CAPABILITY_RF_SECTORS		= 2,
 	WMI_FW_CAPABILITY_MGMT_RETRY_LIMIT	= 3,
+	WMI_FW_CAPABILITY_DISABLE_AP_SME	= 4,
 	WMI_FW_CAPABILITY_MAX,
 };
 
@@ -187,6 +188,8 @@ enum wmi_command_id {
 	WMI_AOA_MEAS_CMDID				= 0x923,
 	WMI_SET_MGMT_RETRY_LIMIT_CMDID			= 0x930,
 	WMI_GET_MGMT_RETRY_LIMIT_CMDID			= 0x931,
+	WMI_NEW_STA_CMDID				= 0x935,
+	WMI_DEL_STA_CMDID				= 0x936,
 	WMI_TOF_SESSION_START_CMDID			= 0x991,
 	WMI_TOF_GET_CAPABILITIES_CMDID			= 0x992,
 	WMI_TOF_SET_LCR_CMDID				= 0x993,
@@ -543,7 +546,8 @@ struct wmi_pcp_start_cmd {
 	u8 pcp_max_assoc_sta;
 	u8 hidden_ssid;
 	u8 is_go;
-	u8 reserved0[7];
+	u8 reserved0[6];
+	u8 disable_ap_sme;
 	u8 network_type;
 	u8 channel;
 	u8 disable_sec_offload;
@@ -902,6 +906,18 @@ struct wmi_set_mgmt_retry_limit_cmd {
 	u8 reserved[3];
 } __packed;
 
+/* WMI_NEW_STA_CMDID */
+struct wmi_new_sta_cmd {
+	u8 dst_mac[WMI_MAC_LEN];
+	u8 aid;
+} __packed;
+
+/* WMI_DEL_STA_CMDID */
+struct wmi_del_sta_cmd {
+	u8 dst_mac[WMI_MAC_LEN];
+	__le16 disconnect_reason;
+} __packed;
+
 enum wmi_tof_burst_duration {
 	WMI_TOF_BURST_DURATION_250_USEC		= 2,
 	WMI_TOF_BURST_DURATION_500_USEC		= 3,
@@ -1292,7 +1308,7 @@ struct wmi_connect_event {
 	u8 assoc_info[0];
 } __packed;
 
-/* WMI_DISCONNECT_EVENTID */
+/* disconnect_reason */
 enum wmi_disconnect_reason {
 	WMI_DIS_REASON_NO_NETWORK_AVAIL		= 0x01,
 	/* bmiss */
@@ -1310,6 +1326,7 @@ enum wmi_disconnect_reason {
 	WMI_DIS_REASON_IBSS_MERGE		= 0x0E,
 };
 
+/* WMI_DISCONNECT_EVENTID */
 struct wmi_disconnect_event {
 	/* reason code, see 802.11 spec. */
 	__le16 protocol_reason_status;
-- 
1.9.1

^ permalink raw reply related

* [PATCH v2 01/13] wil6210: add sysfs file for FTM calibration
From: Maya Erez @ 2017-01-12 13:05 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Lior David, linux-wireless, wil6210, Maya Erez
In-Reply-To: <1484226365-10433-1-git-send-email-qca_merez@qca.qualcomm.com>

From: Lior David <qca_liord@qca.qualcomm.com>

In fine timing measurements, the calculation is affected by
2 parts: timing of packets over the air, which is platform
independent, and platform-specific delays, which are dependent
on things like antenna cable length and type.
Add a sysfs file which allows to get/set these platform specific
delays, separated into the TX and RX components.
There are 2 key scenarios where the file can be used:
1. Calibration - start with some initial values (for example,
the default values at startup), make measurements at a known
distance, then iteratively change the values until the
measurement results match the known distance.
2. Adjust the delays when platform starts up, based on known
values.

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/Makefile   |   1 +
 drivers/net/wireless/ath/wil6210/pcie_bus.c |   4 +-
 drivers/net/wireless/ath/wil6210/sysfs.c    | 126 ++++++++++++++++++++++++++++
 drivers/net/wireless/ath/wil6210/wil6210.h  |   4 +-
 4 files changed, 133 insertions(+), 2 deletions(-)
 create mode 100644 drivers/net/wireless/ath/wil6210/sysfs.c

diff --git a/drivers/net/wireless/ath/wil6210/Makefile b/drivers/net/wireless/ath/wil6210/Makefile
index 89bf2f9..2521343 100644
--- a/drivers/net/wireless/ath/wil6210/Makefile
+++ b/drivers/net/wireless/ath/wil6210/Makefile
@@ -5,6 +5,7 @@ wil6210-y += netdev.o
 wil6210-y += cfg80211.o
 wil6210-y += pcie_bus.o
 wil6210-y += debugfs.o
+wil6210-y += sysfs.o
 wil6210-y += wmi.o
 wil6210-y += interrupt.o
 wil6210-y += txrx.o
diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c
index 44746ca..6b8f4d21 100644
--- a/drivers/net/wireless/ath/wil6210/pcie_bus.c
+++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -263,6 +263,7 @@ static int wil_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 #endif /* CONFIG_PM */
 
 	wil6210_debugfs_init(wil);
+	wil6210_sysfs_init(wil);
 
 
 	return 0;
@@ -297,6 +298,7 @@ static void wil_pcie_remove(struct pci_dev *pdev)
 #endif /* CONFIG_PM_SLEEP */
 #endif /* CONFIG_PM */
 
+	wil6210_sysfs_remove(wil);
 	wil6210_debugfs_remove(wil);
 	rtnl_lock();
 	wil_p2p_wdev_free(wil);
diff --git a/drivers/net/wireless/ath/wil6210/sysfs.c b/drivers/net/wireless/ath/wil6210/sysfs.c
new file mode 100644
index 0000000..768f37c
--- /dev/null
+++ b/drivers/net/wireless/ath/wil6210/sysfs.c
@@ -0,0 +1,126 @@
+/*
+ * Copyright (c) 2017 Qualcomm Atheros, Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <linux/device.h>
+#include <linux/sysfs.h>
+
+#include "wil6210.h"
+#include "wmi.h"
+
+static ssize_t
+wil_ftm_txrx_offset_sysfs_show(struct device *dev,
+			       struct device_attribute *attr,
+			       char *buf)
+{
+	struct wil6210_priv *wil = dev_get_drvdata(dev);
+	struct {
+		struct wmi_cmd_hdr wmi;
+		struct wmi_tof_get_tx_rx_offset_event evt;
+	} __packed reply;
+	int rc;
+	ssize_t len;
+
+	if (!test_bit(WMI_FW_CAPABILITY_FTM, wil->fw_capabilities))
+		return -EOPNOTSUPP;
+
+	memset(&reply, 0, sizeof(reply));
+	rc = wmi_call(wil, WMI_TOF_GET_TX_RX_OFFSET_CMDID, NULL, 0,
+		      WMI_TOF_GET_TX_RX_OFFSET_EVENTID,
+		      &reply, sizeof(reply), 100);
+	if (rc < 0)
+		return rc;
+	if (reply.evt.status) {
+		wil_err(wil, "get_tof_tx_rx_offset failed, error %d\n",
+			reply.evt.status);
+		return -EIO;
+	}
+	len = snprintf(buf, PAGE_SIZE, "%d %d\n",
+		       le32_to_cpu(reply.evt.tx_offset),
+		       le32_to_cpu(reply.evt.rx_offset));
+	return len;
+}
+
+static ssize_t
+wil_ftm_txrx_offset_sysfs_store(struct device *dev,
+				struct device_attribute *attr,
+				const char *buf, size_t count)
+{
+	struct wil6210_priv *wil = dev_get_drvdata(dev);
+	struct wmi_tof_set_tx_rx_offset_cmd cmd;
+	struct {
+		struct wmi_cmd_hdr wmi;
+		struct wmi_tof_set_tx_rx_offset_event evt;
+	} __packed reply;
+	u32 tx_offset, rx_offset;
+	int rc;
+
+	if (sscanf(buf, "%d %d", &tx_offset, &rx_offset) != 2)
+		return -EINVAL;
+
+	if (!test_bit(WMI_FW_CAPABILITY_FTM, wil->fw_capabilities))
+		return -EOPNOTSUPP;
+
+	memset(&cmd, 0, sizeof(cmd));
+	cmd.tx_offset = cpu_to_le32(tx_offset);
+	cmd.rx_offset = cpu_to_le32(rx_offset);
+	memset(&reply, 0, sizeof(reply));
+	rc = wmi_call(wil, WMI_TOF_SET_TX_RX_OFFSET_CMDID, &cmd, sizeof(cmd),
+		      WMI_TOF_SET_TX_RX_OFFSET_EVENTID,
+		      &reply, sizeof(reply), 100);
+	if (rc < 0)
+		return rc;
+	if (reply.evt.status) {
+		wil_err(wil, "set_tof_tx_rx_offset failed, error %d\n",
+			reply.evt.status);
+		return -EIO;
+	}
+	return count;
+}
+
+static DEVICE_ATTR(ftm_txrx_offset, 0644,
+		   wil_ftm_txrx_offset_sysfs_show,
+		   wil_ftm_txrx_offset_sysfs_store);
+
+static struct attribute *wil6210_sysfs_entries[] = {
+	&dev_attr_ftm_txrx_offset.attr,
+	NULL
+};
+
+static struct attribute_group wil6210_attribute_group = {
+	.name = "wil6210",
+	.attrs = wil6210_sysfs_entries,
+};
+
+int wil6210_sysfs_init(struct wil6210_priv *wil)
+{
+	struct device *dev = wil_to_dev(wil);
+	int err;
+
+	err = sysfs_create_group(&dev->kobj, &wil6210_attribute_group);
+	if (err) {
+		wil_err(wil, "failed to create sysfs group: %d\n", err);
+		return err;
+	}
+
+	return 0;
+}
+
+void wil6210_sysfs_remove(struct wil6210_priv *wil)
+{
+	struct device *dev = wil_to_dev(wil);
+
+	sysfs_remove_group(&dev->kobj, &wil6210_attribute_group);
+}
diff --git a/drivers/net/wireless/ath/wil6210/wil6210.h b/drivers/net/wireless/ath/wil6210/wil6210.h
index 237e166..07d4f76 100644
--- a/drivers/net/wireless/ath/wil6210/wil6210.h
+++ b/drivers/net/wireless/ath/wil6210/wil6210.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 Qualcomm Atheros, Inc.
+ * Copyright (c) 2012-2017 Qualcomm Atheros, Inc.
  *
  * Permission to use, copy, modify, and/or distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -869,6 +869,8 @@ int wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 
 int wil6210_debugfs_init(struct wil6210_priv *wil);
 void wil6210_debugfs_remove(struct wil6210_priv *wil);
+int wil6210_sysfs_init(struct wil6210_priv *wil);
+void wil6210_sysfs_remove(struct wil6210_priv *wil);
 int wil_cid_fill_sinfo(struct wil6210_priv *wil, int cid,
 		       struct station_info *sinfo);
 
-- 
1.9.1

^ permalink raw reply related

* [PATCH v2 00/13] wil6210 patches
From: Maya Erez @ 2017-01-12 13:05 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Maya Erez, linux-wireless, wil6210

The following set of patches include various wil6210 fixes
Changes from V1:
- Fix copyright year to 2017
- Add a patch to convert symbolic permissions to octal permissions to fix checkpatch
  errors and align to latest kernel preference
- Fix "set dma mask to reflect device capability" commit text


Dedy Lansky (2):
  wil6210: add disable_ap_sme module parameter
  wil6210: support new WMI-only FW capability

Hamad Kadmany (2):
  wil6210: protect against false interrupt during reset sequence
  wil6210: set dma mask to reflect device capability

Lazar Alexei (2):
  wil6210: support loading dedicated image for sparrow-plus devices
  wil6210: remove __func__ from debug printouts

Lior David (6):
  wil6210: add sysfs file for FTM calibration
  wil6210: missing reinit_completion in wmi_call
  wil6210: fix for broadcast workaround in PBSS
  wil6210: align to latest auto generated wmi.h
  wil6210: report association ID (AID) per station in debugfs
  wil6210: option to override A-BFT length in start AP/PCP

Maya Erez (1):
  wil6210: convert symbolic permissions to octal permissions

 drivers/net/wireless/ath/wil6210/Makefile         |   1 +
 drivers/net/wireless/ath/wil6210/cfg80211.c       | 172 ++++++++++++++++------
 drivers/net/wireless/ath/wil6210/debugfs.c        | 136 ++++++++---------
 drivers/net/wireless/ath/wil6210/ethtool.c        |  10 +-
 drivers/net/wireless/ath/wil6210/fw.c             |   7 +-
 drivers/net/wireless/ath/wil6210/fw_inc.c         |  21 ++-
 drivers/net/wireless/ath/wil6210/interrupt.c      |  30 ++--
 drivers/net/wireless/ath/wil6210/main.c           |  87 +++++------
 drivers/net/wireless/ath/wil6210/netdev.c         |  17 ++-
 drivers/net/wireless/ath/wil6210/p2p.c            |  36 ++---
 drivers/net/wireless/ath/wil6210/pcie_bus.c       |  77 +++++++---
 drivers/net/wireless/ath/wil6210/pm.c             |  17 +--
 drivers/net/wireless/ath/wil6210/pmc.c            |  79 +++++-----
 drivers/net/wireless/ath/wil6210/rx_reorder.c     |   8 +-
 drivers/net/wireless/ath/wil6210/sysfs.c          | 126 ++++++++++++++++
 drivers/net/wireless/ath/wil6210/txrx.c           |  75 +++++-----
 drivers/net/wireless/ath/wil6210/wil6210.h        |  33 ++++-
 drivers/net/wireless/ath/wil6210/wil_crash_dump.c |  18 +--
 drivers/net/wireless/ath/wil6210/wmi.c            | 131 ++++++++++------
 drivers/net/wireless/ath/wil6210/wmi.h            |  67 ++++++++-
 20 files changed, 768 insertions(+), 380 deletions(-)
 create mode 100644 drivers/net/wireless/ath/wil6210/sysfs.c

-- 
1.9.1

^ permalink raw reply

* Re: [PATCH 6/9] rt2800: fallback from mcs8 to mcs7
From: Felix Fietkau @ 2017-01-12 11:10 UTC (permalink / raw)
  To: Stanislaw Gruszka, linux-wireless; +Cc: Helmut Schaa, Mathias Kresin
In-Reply-To: <1483707918-31480-7-git-send-email-sgruszka@redhat.com>

On 2017-01-06 14:05, Stanislaw Gruszka wrote:
> If we do not fallback to lower rate, we are unable to calculate
> correctly number of retries in TX status code.
> 
> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
I think falling back from the lowest dual-stream to the highest
single-stream rate is a really bad idea.
Instead you should get rid of the assumption that fallback rates are
ordered by their MCS index.

- Felix

^ permalink raw reply

* Re: ath9k: fix spelling mistake: "meaurement" -> "measurement"
From: Kalle Valo @ 2017-01-12 11:01 UTC (permalink / raw)
  To: Colin Ian King
  Cc: QCA ath9k Development, Kalle Valo, linux-wireless, ath9k-devel,
	netdev, linux-kernel
In-Reply-To: <20161230140647.12945-1-colin.king@canonical.com>

Colin Ian King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Trivial fix to spelling mistake in ath_err message
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Patch applied to ath-next branch of ath.git, thanks.

714ee339ff90 ath9k: fix spelling mistake: "meaurement" -> "measurement"

-- 
https://patchwork.kernel.org/patch/9492191/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [1/2] ath9k: ar9002_mac: kill off ACCESS_ONCE()
From: Kalle Valo @ 2017-01-12 11:00 UTC (permalink / raw)
  To: Mark Rutland
  Cc: linux-kernel, ath9k-devel, kvalo, linux-wireless, ath9k-devel,
	netdev, Mark Rutland
In-Reply-To: <1482864599-19995-2-git-send-email-mark.rutland@arm.com>

Mark Rutland <mark.rutland@arm.com> wrote:
> For several reasons, it is desirable to use {READ,WRITE}_ONCE() in
> preference to ACCESS_ONCE(), and new code is expected to use one of the
> former. So far, there's been no reason to change most existing uses of
> ACCESS_ONCE(), as these aren't currently harmful.
> 
> However, for some new features (e.g. KTSAN / Kernel Thread Sanitizer),
> it is necessary to instrument reads and writes separately, which is not
> possible with ACCESS_ONCE(). This distinction is critical to correct
> operation.
> 
> It's possible to transform the bulk of kernel code using the Coccinelle
> script below. However, for some files (including the ath9k ar9002 mac
> driver), this mangles the formatting. As a preparatory step, this patch
> converts the driver to use {READ,WRITE}_ONCE() without said mangling.
> 
> ----
> virtual patch
> 
> @ depends on patch @
> expression E1, E2;
> @@
> 
> - ACCESS_ONCE(E1) = E2
> + WRITE_ONCE(E1, E2)
> 
> @ depends on patch @
> expression E;
> @@
> 
> - ACCESS_ONCE(E)
> + READ_ONCE(E)
> ----
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: ath9k-devel@qca.qualcomm.com
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: linux-wireless@vger.kernel.org
> Cc: ath9k-devel@lists.ath9k.org
> Cc: netdev@vger.kernel.org

2 patches applied to ath-next branch of ath.git, thanks.

d5a3a76a9cb8 ath9k: ar9002_mac: kill off ACCESS_ONCE()
50f3818196f5 ath9k: ar9003_mac: kill off ACCESS_ONCE()

-- 
https://patchwork.kernel.org/patch/9489799/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [1/2] ath10k: htc: Removal of unused struct members
From: Kalle Valo @ 2017-01-12 10:52 UTC (permalink / raw)
  To: Erik Stromdahl; +Cc: linux-wireless, ath10k, Erik Stromdahl
In-Reply-To: <1481374721-16354-1-git-send-email-erik.stromdahl@gmail.com>

Erik Stromdahl <erik.stromdahl@gmail.com> wrote:
> Removed tx_credits_per_max_message and tx_credit_size
> from struct ath10k_htc_ep since they are not used
> anywhere in the code.
> 
> They are just written, never read.
> 
> Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com>

2 patches applied to ath-next branch of ath.git, thanks.

7bc7441e4da3 ath10k: htc: removal of unused struct members
d48b62ceeea2 ath10k: htc: simplified credit distribution

-- 
https://patchwork.kernel.org/patch/9469283/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: ath5k: drop bogus warning on drv_set_key with unsupported cipher
From: Kalle Valo @ 2017-01-12 10:56 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, kvalo
In-Reply-To: <20161227111609.11113-1-nbd@nbd.name>

Felix Fietkau <nbd@nbd.name> wrote:
> Simply return -EOPNOTSUPP instead.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Felix Fietkau <nbd@nbd.name>

Patch applied to ath-next branch of ath.git, thanks.

a70e1d6fd6b5 ath5k: drop bogus warning on drv_set_key with unsupported cipher

-- 
https://patchwork.kernel.org/patch/9489183/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: net: wireless: ath: wil6210: constify cfg80211_ops structures
From: Kalle Valo @ 2017-01-12 10:55 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, qca_merez, kvalo, linux-wireless, wil6210, netdev,
	linux-kernel, Bhumika Goyal
In-Reply-To: <1482014667-27082-1-git-send-email-bhumirks@gmail.com>

Bhumika Goyal <bhumirks@gmail.com> wrote:
> cfg80211_ops structures are only passed as an argument to the function
> wiphy_new. This argument is of type const, so cfg80211_ops strutures
> having this property can be declared as const.
> Done using Coccinelle
> 
> @r1 disable optional_qualifier @
> identifier i;
> position p;
> @@
> static struct cfg80211_ops i@p = {...};
> 
> @ok1@
> identifier r1.i;
> position p;
> @@
> wiphy_new(&i@p,...)
> 
> @bad@
> position p!={r1.p,ok1.p};
> identifier r1.i;
> @@
> i@p
> 
> @depends on !bad disable optional_qualifier@
> identifier r1.i;
> @@
> +const
> struct cfg80211_ops i;
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>   18133	   6632	      0	  24765	   60bd wireless/ath/wil6210/cfg80211.o
> 
> File size after:
>    text	   data	    bss	    dec	    hex	filename
>   18933	   5832	      0	  24765	   60bd wireless/ath/wil6210/cfg80211.o
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

Patch applied to ath-next branch of ath.git, thanks.

b59eb96181e7 wil6210: constify cfg80211_ops structures

-- 
https://patchwork.kernel.org/patch/9479127/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [v5,1/5] soc: qcom: smem_state: Fix include for ERR_PTR()
From: Kalle Valo @ 2017-01-12 10:47 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Eugene Krasnikov, Kalle Valo, Andy Gross, wcn36xx, linux-wireless,
	netdev, linux-kernel, linux-arm-msm
In-Reply-To: <1479190014-11297-1-git-send-email-bjorn.andersson@linaro.org>

Bjorn Andersson <bjorn.andersson@linaro.org> wrote:
> The correct include file for getting errno constants and ERR_PTR() is
> linux/err.h, rather than linux/errno.h, so fix the include.
> 
> Fixes: e8b123e60084 ("soc: qcom: smem_state: Add stubs for disabled smem_state")
> Acked-by: Andy Gross <andy.gross@linaro.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

5 patches applied to ath-next branch of ath.git, thanks.

6c0b2e833f14 soc: qcom: smem_state: Fix include for ERR_PTR()
f303a9311065 wcn36xx: Transition driver to SMD client
886039036c20 wcn36xx: Implement firmware assisted scan
43efa3c0f241 wcn36xx: Implement print_reg indication
d53628882255 wcn36xx: Don't use the destroyed hal_mutex

-- 
https://patchwork.kernel.org/patch/9429045/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply

* Re: [PATCH] wext: handle NULL exta data in iwe_stream_add_point better
From: Arnd Bergmann @ 2017-01-12  9:44 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, David S. Miller, Networking, linux-kernel
In-Reply-To: <1484212560.5391.3.camel@sipsolutions.net>

On Thursday, January 12, 2017 10:16:00 AM CET Johannes Berg wrote:
> And I realized only now that this was a different place ...

Right, it was a few hundred randconfigs later after I had confirmed
that the first patch fixed all the configurations that were broken
at first.

> I've just added the check you suggested - spent way too much time
> already on this old crap 

Ok, thanks! Let's hope it doesn't come back once more.

I'm still trying to categorize the newly added warnings in gcc-7,
there a number of very useful warnings that got added, but some of
them are rather noisy and find both a number of real bugs and
false positives. The NULL check had only a few findings that all
seemed worth fixing.

	Arnd

^ permalink raw reply

* Re: [PATCH] wext: handle NULL exta data in iwe_stream_add_point better
From: Johannes Berg @ 2017-01-12  9:13 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-wireless, David S. Miller, Networking, linux-kernel
In-Reply-To: <1484210226.5391.1.camel@sipsolutions.net>


> Come to think of it, I'm thinking I should drop this patch and the
> driver should just use iwe_stream_add_event() instead? It'll be
> somewhat tricky to get the length correct though.

No, turns out that's basically impossible with all the compat etc.
stuff here.

johannes

^ permalink raw reply

* Re: [PATCH] wext: handle NULL exta data in iwe_stream_add_point better
From: Johannes Berg @ 2017-01-12  9:16 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-wireless, David S. Miller, Networking, linux-kernel
In-Reply-To: <3292373.oxnXTOSWCQ@wuerfel>

On Wed, 2017-01-11 at 21:39 +0100, Arnd Bergmann wrote:
> On Wednesday, January 11, 2017 4:06:17 PM CET Johannes Berg wrote:
> > 
> > Applied. Also fixed the typo in the subject :)
> 
> Thanks! Unfortunately I now got another warning for the same
> function, and though I would have expected the patch to fix it, that
> did not work:
> 
> In file included from /git/arm-
> soc/drivers/net/wireless/intersil/prism54/islpci_dev.h:27:0,
>                  from /git/arm-
> soc/drivers/net/wireless/intersil/prism54/isl_ioctl.h:24,
>                  from /git/arm-
> soc/drivers/net/wireless/intersil/prism54/isl_ioctl.c:32:
> /git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.c: In
> function 'prism54_get_scan':
> /git/arm-soc/include/net/iw_handler.h:560:4: error: argument 2 null
> where non-null expected [-Werror=nonnull]
>     memcpy(stream + point_len, extra, iwe->u.data.length);

And I realized only now that this was a different place ...

I've just added the check you suggested - spent way too much time
already on this old crap :)

johannes

^ permalink raw reply

* Re: wl1251 & mac address & calibration data
From: Pavel Machek @ 2017-01-12  8:50 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Arend Van Spriel, Pali Rohár, Daniel Wagner,
	Luis R. Rodriguez, Tom Gundersen, Johannes Berg, Ming Lei,
	Mimi Zohar, Bjorn Andersson, Rafał Miłecki,
	Sebastian Reichel, Michal Kazior, Ivaylo Dimitrov, Aaro Koskinen,
	Tony Lindgren, linux-wireless, Network Development,
	linux-kernel@vger.kernel.org, David Woodhouse, Takashi Iwai,
	Josh Boyer, Dmitry Torokhov
In-Reply-To: <87shpiu8j8.fsf@kamboji.qca.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]

Hi!

> >> But overwriting that one file is not possible as it next update of 
> >> linux-firmware package will overwrite it back. It break any normal usage 
> >> of package management.
> >> 
> >> Also it is ridiculously broken by design if some "boot" files needs to 
> >> be overwritten to initialize hardware properly. To not break booting you 
> >> need to overwrite that file before first boot. But without booting 
> >> device you cannot read calibration data. So some hack with autoreboot 
> >> after boot is needed.
> 
> Providing the calibration data via Device Tree is the proper way to
> solve this. Yes yes, I know N900 doesn't support it but that's a
> deficiency in N900, not Linux.

Linux has to work with whatever hardware provides. You may not like
N900 design, but we have to support it, anyway.

								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: [PATCH] wext: handle NULL exta data in iwe_stream_add_point better
From: Johannes Berg @ 2017-01-12  8:37 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-wireless, David S. Miller, Networking, linux-kernel
In-Reply-To: <3292373.oxnXTOSWCQ@wuerfel>

On Wed, 2017-01-11 at 21:39 +0100, Arnd Bergmann wrote:
> On Wednesday, January 11, 2017 4:06:17 PM CET Johannes Berg wrote:
> > 
> > Applied. Also fixed the typo in the subject :)
> 
> Thanks! Unfortunately I now got another warning for the same
> function, and though I would have expected the patch to fix it, that
> did not work:

I've come to expect better of you (i.e. testing your own patches) ;-)


Come to think of it, I'm thinking I should drop this patch and the
driver should just use iwe_stream_add_event() instead? It'll be
somewhat tricky to get the length correct though.

Alternatively, perhaps we should just uninline all the crap and then
the compiler can't bother us :)

johannes

^ permalink raw reply

* [PATCH 7/7] staging:wilc1000:wilc_sdio.c Deleted un-needed blank lines
From: Scott Matheina @ 2017-01-12  3:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman,
	linux-wireless, devel
In-Reply-To: <1484192328-16825-1-git-send-email-scott@matheina.com>

Fixes checkpatch CHECK:
Blank lines aren't necessary before a close brace '}'
Please don't use multiple blank lines

Signed-off-by: Scott Matheina <scott@matheina.com>
---
 drivers/staging/wilc1000/wilc_sdio.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index e48cebe..cd6b8ba 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -81,7 +81,6 @@ static int wilc_sdio_cmd52(struct wilc *wilc, struct sdio_cmd52 *cmd)
 	return ret;
 }
 
-
 static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd)
 {
 	struct sdio_func *func = container_of(wilc->dev, struct sdio_func, dev);
@@ -915,7 +914,6 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
 					__LINE__);
 				goto _fail_;
 			}
-
 		}
 	} else {
 		if (g_sdio.irq_gpio) {
@@ -945,7 +943,6 @@ static int sdio_clear_int_ext(struct wilc *wilc, u32 val)
 								__LINE__);
 							goto _fail_;
 						}
-
 					}
 					if (!ret)
 						break;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 2/7] staging:wilc1000:host_interface.c Added braces {} on else statemement
From: Scott Matheina @ 2017-01-12  3:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman,
	linux-wireless, devel
In-Reply-To: <1484192328-16825-1-git-send-email-scott@matheina.com>

Fixes checkpatch warning: braces {} should be used on all arms of
this statement

Signed-off-by: Scott Matheina <scott@matheina.com>
---
 drivers/staging/wilc1000/host_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b00ea75..c307cce 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3998,8 +3998,9 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
 				pNewJoinBssParam->rsn_found = true;
 				index += pu8IEs[index + 1] + 2;
 				continue;
-			} else
+			} else {
 				index += pu8IEs[index + 1] + 2;
+			}
 		}
 	}
 
-- 
2.7.4

^ permalink raw reply related

* [PATCH 6/7] staging:wilc1000:wilc_sdio.c Aligns code match open parenthesis
From: Scott Matheina @ 2017-01-12  3:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman,
	linux-wireless, devel
In-Reply-To: <1484192328-16825-1-git-send-email-scott@matheina.com>

Fixes checkpatch CHECK: Alignment should match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
---
 drivers/staging/wilc1000/wilc_sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index 3ad7cec..e48cebe 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -127,7 +127,7 @@ static int linux_sdio_probe(struct sdio_func *func,
 
 	dev_dbg(&func->dev, "Initializing netdev\n");
 	ret = wilc_netdev_init(&wilc, &func->dev, HIF_SDIO, gpio,
-			     &wilc_hif_sdio);
+			       &wilc_hif_sdio);
 	if (ret) {
 		dev_err(&func->dev, "Couldn't initialize netdev\n");
 		return ret;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 5/7] staging:wilc1000:wilc_debugfs.c Removes multiple blank lines
From: Scott Matheina @ 2017-01-12  3:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman,
	linux-wireless, devel
In-Reply-To: <1484192328-16825-1-git-send-email-scott@matheina.com>

Fixes checkpatch CHECK: Please don't use multiple blank lines

Signed-off-by: Scott Matheina <scott@matheina.com>
---
 drivers/staging/wilc1000/wilc_debugfs.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index 52aac75..7d32de9 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -17,7 +17,6 @@
 
 #include "wilc_wlan_if.h"
 
-
 static struct dentry *wilc_dir;
 
 /*
@@ -36,7 +35,6 @@ EXPORT_SYMBOL_GPL(WILC_DEBUG_LEVEL);
  * --------------------------------------------------------------------------------
  */
 
-
 static ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf, size_t count, loff_t *ppos)
 {
 	char buf[128];
-- 
2.7.4

^ permalink raw reply related

* [PATCH 3/7] staging:wilc1000:linux_wlan.c Align code to match open parenthesis
From: Scott Matheina @ 2017-01-12  3:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman,
	linux-wireless, devel
In-Reply-To: <1484192328-16825-1-git-send-email-scott@matheina.com>

Fixes checkpatch CHECK: Alignment should match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
---
 drivers/staging/wilc1000/linux_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 185fcd1..9ab4393 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -364,7 +364,7 @@ static int linux_wlan_start_firmware(struct net_device *dev)
 		return ret;
 
 	if (!wait_for_completion_timeout(&wilc->sync_event,
-					msecs_to_jiffies(5000)))
+					 msecs_to_jiffies(5000)))
 		return -ETIME;
 
 	return 0;
-- 
2.7.4

^ permalink raw reply related

* [PATCH 4/7] staging:wilc1000:wilc_debugfs.c Aligns code to match open parenthesis
From: Scott Matheina @ 2017-01-12  3:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Aditya Shankar, Ganesh Krishna, Greg Kroah-Hartman,
	linux-wireless, devel
In-Reply-To: <1484192328-16825-1-git-send-email-scott@matheina.com>

Fixes checkpatch CHECK: Alignment should match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
---
 drivers/staging/wilc1000/wilc_debugfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c
index 07260c4..52aac75 100644
--- a/drivers/staging/wilc1000/wilc_debugfs.c
+++ b/drivers/staging/wilc1000/wilc_debugfs.c
@@ -52,7 +52,7 @@ static ssize_t wilc_debug_level_read(struct file *file, char __user *userbuf, si
 }
 
 static ssize_t wilc_debug_level_write(struct file *filp, const char __user *buf,
-					size_t count, loff_t *ppos)
+				      size_t count, loff_t *ppos)
 {
 	int flag = 0;
 	int ret;
-- 
2.7.4

^ permalink raw reply related

* Re: mac80211: Fix headroom allocation when forwarding mesh pkt
From: Masashi Honma @ 2017-01-12  2:40 UTC (permalink / raw)
  To: Cedric Izoard; +Cc: linux-wireless@vger.kernel.org, Johannes Berg
In-Reply-To: <e3b7a95724944c6aadc8512eadfe1c1d@ceva-dsp.com>

On 2017/01/11 23:39, Cedric Izoard wrote:
> -	fwd_skb = skb_copy_expand(skb, local->tx_headroom, 0, GFP_ATOMIC);
> +	fwd_skb = skb_copy_expand(skb, local->tx_headroom +
> +				  sdata->encrypt_headroom, 0, GFP_ATOMIC);
>  	if (!fwd_skb) {
>  		net_info_ratelimited("%s: failed to clone mesh frame\n",
>  				    sdata->name);
>

# I retransmit this because of server error.

Thanks ! It work for me.

Bisected-reported-and-tested-by: Masashi Honma <masashi.honma@gmail.com>

Masashi Honma.

^ permalink raw reply

* [PATCH] mac80211: initialize SMPS field in HT capabilities
From: Felix Fietkau @ 2017-01-11 22:33 UTC (permalink / raw)
  To: linux-wireless; +Cc: johannes, onelektra

ibss and mesh modes copy the ht capabilites from the band without
overriding the SMPS state. Unfortunately the default value 0 for the
SMPS field means static SMPS instead of disabled.

This results in HT ibss and mesh setups using only single-stream rates,
even though SMPS is not supposed to be active.

Initialize SMPS to disabled for all bands on ieee80211_hw_register to
ensure that the value is sane where it is not overriden with the real
SMPS state.

Reported-by: Elektra Wagenrad <onelektra@gmx.net>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/mac80211/main.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 1822c77f2b1c..c269046aa02b 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -913,10 +913,15 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 		supp_ht = supp_ht || sband->ht_cap.ht_supported;
 		supp_vht = supp_vht || sband->vht_cap.vht_supported;
 
-		if (sband->ht_cap.ht_supported)
-			local->rx_chains =
-				max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
-				    local->rx_chains);
+		if (!sband->ht_cap.ht_supported)
+			continue;
+
+		local->rx_chains =
+			max(ieee80211_mcs_to_chains(&sband->ht_cap.mcs),
+			    local->rx_chains);
+
+		sband->ht_cap.cap |= WLAN_HT_CAP_SM_PS_DISABLED <<
+			             IEEE80211_HT_CAP_SM_PS_SHIFT;
 
 		/* TODO: consider VHT for RX chains, hopefully it's the same */
 	}
-- 
2.11.0

^ permalink raw reply related

* Re: [PATCH] wext: handle NULL exta data in iwe_stream_add_point better
From: Arnd Bergmann @ 2017-01-11 20:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, David S. Miller, Networking, linux-kernel
In-Reply-To: <1484147177.29931.14.camel@sipsolutions.net>

On Wednesday, January 11, 2017 4:06:17 PM CET Johannes Berg wrote:
> 
> Applied. Also fixed the typo in the subject :)

Thanks! Unfortunately I now got another warning for the same function,
and though I would have expected the patch to fix it, that did not work:

In file included from /git/arm-soc/drivers/net/wireless/intersil/prism54/islpci_dev.h:27:0,
                 from /git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.h:24,
                 from /git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.c:32:
/git/arm-soc/drivers/net/wireless/intersil/prism54/isl_ioctl.c: In function 'prism54_get_scan':
/git/arm-soc/include/net/iw_handler.h:560:4: error: argument 2 null where non-null expected [-Werror=nonnull]
    memcpy(stream + point_len, extra, iwe->u.data.length);

The change below kills that warning too, but it gets even uglier there:

diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index 1a41043688bc..c2aa73e5e6bb 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -556,7 +556,7 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends,
 		memcpy(stream + lcp_len,
 		       ((char *) &iwe->u) + IW_EV_POINT_OFF,
 		       IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
-		if (iwe->u.data.length)
+		if (iwe->u.data.length && extra)
 			memcpy(stream + point_len, extra, iwe->u.data.length);
 		stream += event_len;
 	}

Let me know if you want a proper follow-up patch, or if you can amend your
commit, or you have a better idea for resolving that warning.

	Arnd

^ permalink raw reply related

* [PATCH net-next] ath6kl: fix warning for using 0 as NULL
From: Wei Yongjun @ 2017-01-11 16:31 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Wei Yongjun, linux-wireless

From: Wei Yongjun <weiyongjun1@huawei.com>

Fixes the following sparse warning:

drivers/net/wireless/ath/ath6kl/sdio.c:716:55: warning:
 Using plain integer as NULL pointer

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/wireless/ath/ath6kl/sdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 8ec66e7..2195b1b 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -713,7 +713,7 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
 		 * that the packet is properly freed?
 		 */
 		if (s_req->busrequest) {
-			s_req->busrequest->scat_req = 0;
+			s_req->busrequest->scat_req = NULL;
 			ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest);
 		}
 		kfree(s_req->virt_dma_buf);

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox