linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] qtnfmac: fixes and minor enhancements
@ 2019-01-09 16:08 Sergey Matyukevich
  2019-01-09 16:08 ` [PATCH 1/7] qtnfmac: support EBUSY errcode for QLINK protocol Sergey Matyukevich
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

Hello Kalle and all,

Here is the patch set with fixes and enhancements for qtnfmac driver.
The major changes include the following items:
- final conversion to SPDX license format
- 4addr mode support
- PCIe INTx fix

Regards,
Sergey


Andrey Shevchenko (1):
  qtnfmac: support EBUSY errcode for QLINK protocol

Sergey Matyukevich (6):
  qtnfmac: fix legacy PCIe interrupt handling
  qtnfmac: add support for 4addr mode
  qtnfmac: switch to 32bit values for RTS/FRAG thresholds
  qtnfmac: do not reject retry changes in driver
  qtnfmac: convert to SPDX license identifiers
  qtnfmac: add missing bss record to host scan cache

 drivers/net/wireless/quantenna/Makefile            |  1 +
 drivers/net/wireless/quantenna/qtnfmac/bus.h       | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c  | 30 ++-----
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.h  |  3 +
 drivers/net/wireless/quantenna/qtnfmac/commands.c  | 48 +++++------
 drivers/net/wireless/quantenna/qtnfmac/commands.h  | 22 ++---
 drivers/net/wireless/quantenna/qtnfmac/core.c      | 21 ++---
 drivers/net/wireless/quantenna/qtnfmac/core.h      | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/debug.c     | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/debug.h     | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/event.c     | 96 +++++++++++++++++-----
 drivers/net/wireless/quantenna/qtnfmac/event.h     | 17 +---
 .../wireless/quantenna/qtnfmac/pcie/topaz_pcie.c   |  6 +-
 drivers/net/wireless/quantenna/qtnfmac/qlink.h     | 27 ++----
 .../net/wireless/quantenna/qtnfmac/qlink_util.c    | 16 +---
 .../net/wireless/quantenna/qtnfmac/qlink_util.h    | 28 +++----
 .../net/wireless/quantenna/qtnfmac/qtn_hw_ids.h    | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c   | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h   | 17 +---
 .../net/wireless/quantenna/qtnfmac/shm_ipc_defs.h  | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/trans.c     | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/trans.h     | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/util.c      | 17 +---
 drivers/net/wireless/quantenna/qtnfmac/util.h      | 17 +---
 24 files changed, 177 insertions(+), 342 deletions(-)

-- 
2.11.0


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

* [PATCH 1/7] qtnfmac: support EBUSY errcode for QLINK protocol
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
@ 2019-01-09 16:08 ` Sergey Matyukevich
  2019-01-09 16:08 ` [PATCH 2/7] qtnfmac: fix legacy PCIe interrupt handling Sergey Matyukevich
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko

From: Andrey Shevchenko <ashevchenko@quantenna.com>

Add support of EBUSY error code for remote procedures over QLINK protocol.

Signed-off-by: Andrey Shevchenko <ashevchenko@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 2 ++
 drivers/net/wireless/quantenna/qtnfmac/qlink.h    | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 659e7649fe22..c2f085589f54 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -72,6 +72,8 @@ static int qtnf_cmd_resp_result_decode(enum qlink_cmd_result qcode)
 		return -EADDRINUSE;
 	case QLINK_CMD_RESULT_EADDRNOTAVAIL:
 		return -EADDRNOTAVAIL;
+	case QLINK_CMD_RESULT_EBUSY:
+		return -EBUSY;
 	default:
 		return -EFAULT;
 	}
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index 8d62addea895..f9c7f87afaf8 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -733,6 +733,7 @@ enum qlink_cmd_result {
 	QLINK_CMD_RESULT_EALREADY,
 	QLINK_CMD_RESULT_EADDRINUSE,
 	QLINK_CMD_RESULT_EADDRNOTAVAIL,
+	QLINK_CMD_RESULT_EBUSY,
 };
 
 /**
-- 
2.11.0


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

* [PATCH 2/7] qtnfmac: fix legacy PCIe interrupt handling
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
  2019-01-09 16:08 ` [PATCH 1/7] qtnfmac: support EBUSY errcode for QLINK protocol Sergey Matyukevich
@ 2019-01-09 16:08 ` Sergey Matyukevich
  2019-01-09 16:08 ` [PATCH 3/7] qtnfmac: add support for 4addr mode Sergey Matyukevich
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

In the current implementation INTx interrupt is deasserted after the
control path processing. However this leads to missed interrupts
from the wireless card. For instance, this may happen as a result
of control path activity, when another interrupt arrives before
INTx is deasserted.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
index 598edb814421..cbcda57105f3 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
@@ -559,6 +559,9 @@ static irqreturn_t qtnf_pcie_topaz_interrupt(int irq, void *data)
 	if (!priv->msi_enabled && !qtnf_topaz_intx_asserted(ts))
 		return IRQ_NONE;
 
+	if (!priv->msi_enabled)
+		qtnf_deassert_intx(ts);
+
 	priv->pcie_irq_count++;
 
 	qtnf_shm_ipc_irq_handler(&priv->shm_ipc_ep_in);
@@ -571,9 +574,6 @@ static irqreturn_t qtnf_pcie_topaz_interrupt(int irq, void *data)
 
 	tasklet_hi_schedule(&priv->reclaim_tq);
 
-	if (!priv->msi_enabled)
-		qtnf_deassert_intx(ts);
-
 	return IRQ_HANDLED;
 }
 
-- 
2.11.0


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

* [PATCH 3/7] qtnfmac: add support for 4addr mode
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
  2019-01-09 16:08 ` [PATCH 1/7] qtnfmac: support EBUSY errcode for QLINK protocol Sergey Matyukevich
  2019-01-09 16:08 ` [PATCH 2/7] qtnfmac: fix legacy PCIe interrupt handling Sergey Matyukevich
@ 2019-01-09 16:08 ` Sergey Matyukevich
  2019-01-12 10:54   ` kbuild test robot
  2019-01-09 16:09 ` [PATCH 4/7] qtnfmac: switch to 32bit values for RTS/FRAG thresholds Sergey Matyukevich
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:08 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

Advertise WIPHY_FLAG_4ADDR_STATION capability to wireless core. Send
use4addr interface change flag to firmware in change_virtual_intf
cfg80211 callback.

In order to enable adding wireless station interface to bridge
one should turn on 4addr mode using the following command:
$ iw dev wlan0 set 4addr on
$ brctl addif br0 wlan0

If this commands succeeds, then interface can be added to bridge.
Note that when wireless interface is added to bridge, wpa_supplicant
should be started with appropriate -b <brname> parameter, e.g:
$ wpa_supplicant -Dnl80211 -iwlan0 -c/path/to/wpa_s.conf -b br0

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c |  8 +++++---
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 14 +++++++++-----
 drivers/net/wireless/quantenna/qtnfmac/commands.h |  6 ++++--
 drivers/net/wireless/quantenna/qtnfmac/core.c     |  4 +++-
 drivers/net/wireless/quantenna/qtnfmac/qlink.h    |  3 ++-
 5 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 51b33ec78fac..9e0ac1744be7 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -139,7 +139,8 @@ qtnf_change_virtual_intf(struct wiphy *wiphy,
 
 	qtnf_scan_done(vif->mac, true);
 
-	ret = qtnf_cmd_send_change_intf_type(vif, type, mac_addr);
+	ret = qtnf_cmd_send_change_intf_type(vif, type, params->use_4addr,
+					     mac_addr);
 	if (ret) {
 		pr_err("VIF%u.%u: failed to change type to %d\n",
 		       vif->mac->macid, vif->vifid, type);
@@ -228,7 +229,7 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy,
 	if (params)
 		mac_addr = params->macaddr;
 
-	ret = qtnf_cmd_send_add_intf(vif, type, mac_addr);
+	ret = qtnf_cmd_send_add_intf(vif, type, params->use_4addr, mac_addr);
 	if (ret) {
 		pr_err("VIF%u.%u: failed to add VIF %pM\n",
 		       mac->macid, vif->vifid, mac_addr);
@@ -1107,7 +1108,8 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac)
 	wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME |
 			WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD |
 			WIPHY_FLAG_AP_UAPSD |
-			WIPHY_FLAG_HAS_CHANNEL_SWITCH;
+			WIPHY_FLAG_HAS_CHANNEL_SWITCH |
+			WIPHY_FLAG_4ADDR_STATION;
 	wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
 
 	if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index c2f085589f54..0748a756cc1c 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -734,6 +734,7 @@ int qtnf_cmd_get_sta_info(struct qtnf_vif *vif, const u8 *sta_mac,
 
 static int qtnf_cmd_send_add_change_intf(struct qtnf_vif *vif,
 					 enum nl80211_iftype iftype,
+					 int use4addr,
 					 u8 *mac_addr,
 					 enum qlink_cmd_type cmd_type)
 {
@@ -751,6 +752,7 @@ static int qtnf_cmd_send_add_change_intf(struct qtnf_vif *vif,
 	qtnf_bus_lock(vif->mac->bus);
 
 	cmd = (struct qlink_cmd_manage_intf *)cmd_skb->data;
+	cmd->intf_info.use4addr = use4addr;
 
 	switch (iftype) {
 	case NL80211_IFTYPE_AP:
@@ -786,17 +788,19 @@ static int qtnf_cmd_send_add_change_intf(struct qtnf_vif *vif,
 	return ret;
 }
 
-int qtnf_cmd_send_add_intf(struct qtnf_vif *vif,
-			   enum nl80211_iftype iftype, u8 *mac_addr)
+int qtnf_cmd_send_add_intf(struct qtnf_vif *vif, enum nl80211_iftype iftype,
+			   int use4addr, u8 *mac_addr)
 {
-	return qtnf_cmd_send_add_change_intf(vif, iftype, mac_addr,
+	return qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr,
 			QLINK_CMD_ADD_INTF);
 }
 
 int qtnf_cmd_send_change_intf_type(struct qtnf_vif *vif,
-				   enum nl80211_iftype iftype, u8 *mac_addr)
+				   enum nl80211_iftype iftype,
+				   int use4addr,
+				   u8 *mac_addr)
 {
-	return qtnf_cmd_send_add_change_intf(vif, iftype, mac_addr,
+	return qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr,
 					     QLINK_CMD_CHANGE_INTF);
 }
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h
index 1ac41156c192..1c25e7905e9a 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h
@@ -26,9 +26,11 @@ void qtnf_cmd_send_deinit_fw(struct qtnf_bus *bus);
 int qtnf_cmd_get_hw_info(struct qtnf_bus *bus);
 int qtnf_cmd_get_mac_info(struct qtnf_wmac *mac);
 int qtnf_cmd_send_add_intf(struct qtnf_vif *vif, enum nl80211_iftype iftype,
-			   u8 *mac_addr);
+			   int use4addr, u8 *mac_addr);
 int qtnf_cmd_send_change_intf_type(struct qtnf_vif *vif,
-				   enum nl80211_iftype iftype, u8 *mac_addr);
+				   enum nl80211_iftype iftype,
+				   int use4addr,
+				   u8 *mac_addr);
 int qtnf_cmd_send_del_intf(struct qtnf_vif *vif);
 int qtnf_cmd_band_info_get(struct qtnf_wmac *mac,
 			   struct ieee80211_supported_band *band);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c
index 5d18a4a917c9..29258acfa8dc 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
@@ -195,6 +195,7 @@ static int qtnf_netdev_set_mac_address(struct net_device *ndev, void *addr)
 	qtnf_scan_done(vif->mac, true);
 
 	ret = qtnf_cmd_send_change_intf_type(vif, vif->wdev.iftype,
+					     vif->wdev.use_4addr,
 					     sa->sa_data);
 
 	if (ret)
@@ -545,7 +546,8 @@ static int qtnf_core_mac_attach(struct qtnf_bus *bus, unsigned int macid)
 		goto error;
 	}
 
-	ret = qtnf_cmd_send_add_intf(vif, vif->wdev.iftype, vif->mac_addr);
+	ret = qtnf_cmd_send_add_intf(vif, vif->wdev.iftype,
+				     vif->wdev.use_4addr, vif->mac_addr);
 	if (ret) {
 		pr_err("MAC%u: failed to add VIF\n", macid);
 		goto error;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index f9c7f87afaf8..a78cb9e05068 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -105,7 +105,8 @@ struct qlink_intf_info {
 	__le16 if_type;
 	__le16 vlanid;
 	u8 mac_addr[ETH_ALEN];
-	u8 rsvd[2];
+	u8 use4addr;
+	u8 rsvd[1];
 } __packed;
 
 enum qlink_sta_flags {
-- 
2.11.0


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

* [PATCH 4/7] qtnfmac: switch to 32bit values for RTS/FRAG thresholds
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
                   ` (2 preceding siblings ...)
  2019-01-09 16:08 ` [PATCH 3/7] qtnfmac: add support for 4addr mode Sergey Matyukevich
@ 2019-01-09 16:09 ` Sergey Matyukevich
  2019-01-09 16:09 ` [PATCH 5/7] qtnfmac: do not reject retry changes in driver Sergey Matyukevich
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

Host wireless stack uses u32 type for RTS/FRAG threshold values.
Switch to u32 in driver: pass u32 values to firmware and let
firmware properly adapt these values according to its
internal representation.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/commands.c   |  8 ++++----
 drivers/net/wireless/quantenna/qtnfmac/qlink.h      |  4 ++--
 drivers/net/wireless/quantenna/qtnfmac/qlink_util.h | 11 +++++++++++
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 0748a756cc1c..66cb05dfdba5 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -1564,11 +1564,11 @@ static int qtnf_cmd_resp_proc_phy_params(struct qtnf_wmac *mac,
 		switch (tlv_type) {
 		case QTN_TLV_ID_FRAG_THRESH:
 			phy_thr = (void *)tlv;
-			mac_info->frag_thr = (u32)le16_to_cpu(phy_thr->thr);
+			mac_info->frag_thr = le32_to_cpu(phy_thr->thr);
 			break;
 		case QTN_TLV_ID_RTS_THRESH:
 			phy_thr = (void *)tlv;
-			mac_info->rts_thr = (u32)le16_to_cpu(phy_thr->thr);
+			mac_info->rts_thr = le32_to_cpu(phy_thr->thr);
 			break;
 		case QTN_TLV_ID_SRETRY_LIMIT:
 			limit = (void *)tlv;
@@ -1816,10 +1816,10 @@ int qtnf_cmd_send_update_phy_params(struct qtnf_wmac *mac, u32 changed)
 	qtnf_bus_lock(mac->bus);
 
 	if (changed & WIPHY_PARAM_FRAG_THRESHOLD)
-		qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_FRAG_THRESH,
+		qtnf_cmd_skb_put_tlv_u32(cmd_skb, QTN_TLV_ID_FRAG_THRESH,
 					 wiphy->frag_threshold);
 	if (changed & WIPHY_PARAM_RTS_THRESHOLD)
-		qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_RTS_THRESH,
+		qtnf_cmd_skb_put_tlv_u32(cmd_skb, QTN_TLV_ID_RTS_THRESH,
 					 wiphy->rts_threshold);
 	if (changed & WIPHY_PARAM_COVERAGE_CLASS)
 		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_COVERAGE_CLASS,
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index a78cb9e05068..ace52e9d421d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -19,7 +19,7 @@
 
 #include <linux/ieee80211.h>
 
-#define QLINK_PROTO_VER		11
+#define QLINK_PROTO_VER		12
 
 #define QLINK_MACID_RSVD		0xFF
 #define QLINK_VIFID_RSVD		0xFF
@@ -1184,7 +1184,7 @@ struct qlink_iface_limit_record {
 
 struct qlink_tlv_frag_rts_thr {
 	struct qlink_tlv_hdr hdr;
-	__le16 thr;
+	__le32 thr;
 } __packed;
 
 struct qlink_tlv_rlimit {
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
index 960d5d97492f..fc87827cb49c 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
@@ -69,6 +69,17 @@ static inline void qtnf_cmd_skb_put_tlv_u16(struct sk_buff *skb,
 	memcpy(hdr->val, &tmp, sizeof(tmp));
 }
 
+static inline void qtnf_cmd_skb_put_tlv_u32(struct sk_buff *skb,
+					    u16 tlv_id, u32 value)
+{
+	struct qlink_tlv_hdr *hdr = skb_put(skb, sizeof(*hdr) + sizeof(value));
+	__le32 tmp = cpu_to_le32(value);
+
+	hdr->type = cpu_to_le16(tlv_id);
+	hdr->len = cpu_to_le16(sizeof(value));
+	memcpy(hdr->val, &tmp, sizeof(tmp));
+}
+
 u16 qlink_iface_type_to_nl_mask(u16 qlink_type);
 u8 qlink_chan_width_mask_to_nl(u16 qlink_mask);
 void qlink_chandef_q2cfg(struct wiphy *wiphy,
-- 
2.11.0


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

* [PATCH 5/7] qtnfmac: do not reject retry changes in driver
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
                   ` (3 preceding siblings ...)
  2019-01-09 16:09 ` [PATCH 4/7] qtnfmac: switch to 32bit values for RTS/FRAG thresholds Sergey Matyukevich
@ 2019-01-09 16:09 ` Sergey Matyukevich
  2019-01-09 16:09 ` [PATCH 6/7] qtnfmac: convert to SPDX license identifiers Sergey Matyukevich
  2019-01-09 16:09 ` [PATCH 7/7] qtnfmac: add missing bss record to host scan cache Sergey Matyukevich
  6 siblings, 0 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

Do not reject RETRY changes in driver. This decision
should belong to firmware.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 5 -----
 drivers/net/wireless/quantenna/qtnfmac/commands.c | 8 ++++++++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 9e0ac1744be7..422b79a5b98d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -360,11 +360,6 @@ static int qtnf_set_wiphy_params(struct wiphy *wiphy, u32 changed)
 		return -EFAULT;
 	}
 
-	if (changed & (WIPHY_PARAM_RETRY_LONG | WIPHY_PARAM_RETRY_SHORT)) {
-		pr_err("MAC%u: can't modify retry params\n", mac->macid);
-		return -EOPNOTSUPP;
-	}
-
 	ret = qtnf_cmd_send_update_phy_params(mac, changed);
 	if (ret)
 		pr_err("MAC%u: failed to update PHY params\n", mac->macid);
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 66cb05dfdba5..3f0a0b6abf01 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -1825,6 +1825,14 @@ int qtnf_cmd_send_update_phy_params(struct qtnf_wmac *mac, u32 changed)
 		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_COVERAGE_CLASS,
 					wiphy->coverage_class);
 
+	if (changed & WIPHY_PARAM_RETRY_LONG)
+		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_LRETRY_LIMIT,
+					wiphy->retry_long);
+
+	if (changed & WIPHY_PARAM_RETRY_SHORT)
+		qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_SRETRY_LIMIT,
+					wiphy->retry_short);
+
 	ret = qtnf_cmd_send(mac->bus, cmd_skb);
 	if (ret)
 		goto out;
-- 
2.11.0


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

* [PATCH 6/7] qtnfmac: convert to SPDX license identifiers
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
                   ` (4 preceding siblings ...)
  2019-01-09 16:09 ` [PATCH 5/7] qtnfmac: do not reject retry changes in driver Sergey Matyukevich
@ 2019-01-09 16:09 ` Sergey Matyukevich
  2019-01-10  7:37   ` Kalle Valo
  2019-01-09 16:09 ` [PATCH 7/7] qtnfmac: add missing bss record to host scan cache Sergey Matyukevich
  6 siblings, 1 reply; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

Replace textual license with SPDX-License-Identifier.
Add an SPDX-License-Identifier for the Makefile.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/Makefile               |  1 +
 drivers/net/wireless/quantenna/qtnfmac/bus.h          | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c     | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.h     |  3 +++
 drivers/net/wireless/quantenna/qtnfmac/commands.c     | 16 ++--------------
 drivers/net/wireless/quantenna/qtnfmac/commands.h     | 16 ++--------------
 drivers/net/wireless/quantenna/qtnfmac/core.c         | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/core.h         | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/debug.c        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/debug.h        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/event.c        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/event.h        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/qlink.h        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/qlink_util.c   | 16 ++--------------
 drivers/net/wireless/quantenna/qtnfmac/qlink_util.h   | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h   | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c      | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h      | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/shm_ipc_defs.h | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/trans.c        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/trans.h        | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/util.c         | 17 ++---------------
 drivers/net/wireless/quantenna/qtnfmac/util.h         | 17 ++---------------
 23 files changed, 46 insertions(+), 312 deletions(-)

diff --git a/drivers/net/wireless/quantenna/Makefile b/drivers/net/wireless/quantenna/Makefile
index baebfbde119e..cea83d178d2e 100644
--- a/drivers/net/wireless/quantenna/Makefile
+++ b/drivers/net/wireless/quantenna/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
 #
 # Copyright (c) 2015-2016 Quantenna Communications, Inc.
 # All rights reserved.
diff --git a/drivers/net/wireless/quantenna/qtnfmac/bus.h b/drivers/net/wireless/quantenna/qtnfmac/bus.h
index 528ca7f5e070..7bd906cc7023 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/bus.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/bus.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015 Quantenna Communications
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015 Quantenna Communications. All rights reserved. */
 
 #ifndef QTNFMAC_BUS_H
 #define QTNFMAC_BUS_H
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 422b79a5b98d..e9bef621a7d6 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2012-2012 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/kernel.h>
 #include <linux/etherdevice.h>
diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
index b73425122a10..7f223d0fbbd3 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
@@ -1,3 +1,6 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
+
 /*
  * Copyright (c) 2015-2016 Quantenna Communications, Inc.
  * All rights reserved.
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c
index 3f0a0b6abf01..009a4e4f4c7a 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c
@@ -1,17 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/types.h>
 #include <linux/skbuff.h>
diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h
index 1c25e7905e9a..96dff643bbc4 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/commands.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h
@@ -1,17 +1,5 @@
-/*
- * Copyright (c) 2016 Quantenna Communications, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2016 Quantenna Communications. All rights reserved. */
 
 #ifndef QLINK_COMMANDS_H_
 #define QLINK_COMMANDS_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c
index 29258acfa8dc..ee1b75fda1dd 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/kernel.h>
 #include <linux/module.h>
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index 293055049caa..a31cff46e964 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_CORE_H_
 #define _QTN_FMAC_CORE_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/debug.c b/drivers/net/wireless/quantenna/qtnfmac/debug.c
index 9f826b9ef5d9..ad70cdb80060 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/debug.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/debug.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include "debug.h"
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/debug.h b/drivers/net/wireless/quantenna/qtnfmac/debug.h
index d6dd12b5d434..61b45536b83a 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/debug.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/debug.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_DEBUG_H_
 #define _QTN_FMAC_DEBUG_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index 8b542b431b75..3038a000c287 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/kernel.h>
 #include <linux/module.h>
diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.h b/drivers/net/wireless/quantenna/qtnfmac/event.h
index ae759b602c2a..533ad99d045d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_EVENT_H_
 #define _QTN_FMAC_EVENT_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index ace52e9d421d..d958b268de02 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_QLINK_H_
 #define _QTN_QLINK_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
index aeeda81b09ea..72bfd17cb687 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.c
@@ -1,17 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/nl80211.h>
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
index fc87827cb49c..781ea7fe79f2 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink_util.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_QLINK_UTIL_H_
 #define _QTN_FMAC_QLINK_UTIL_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h b/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
index 40295a511224..82d879950b62 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef	_QTN_HW_IDS_H_
 #define	_QTN_HW_IDS_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c
index 2ec334199c2b..ff678951d3b2 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/types.h>
 #include <linux/io.h>
diff --git a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h
index c2a3702a9ee7..52cac5439b03 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_SHM_IPC_H_
 #define _QTN_FMAC_SHM_IPC_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc_defs.h b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc_defs.h
index 95a5f89a8b1a..78be70df1218 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/shm_ipc_defs.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/shm_ipc_defs.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_SHM_IPC_DEFS_H_
 #define _QTN_FMAC_SHM_IPC_DEFS_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/trans.c b/drivers/net/wireless/quantenna/qtnfmac/trans.c
index 345f34ec9750..95356e280e23 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/trans.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/trans.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include <linux/types.h>
 #include <linux/export.h>
diff --git a/drivers/net/wireless/quantenna/qtnfmac/trans.h b/drivers/net/wireless/quantenna/qtnfmac/trans.h
index 9a473e07af0f..c0b76f871b31 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/trans.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/trans.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #ifndef _QTN_FMAC_TRANS_H_
 #define _QTN_FMAC_TRANS_H_
diff --git a/drivers/net/wireless/quantenna/qtnfmac/util.c b/drivers/net/wireless/quantenna/qtnfmac/util.c
index 3bc96b264769..cda6f5f3f38a 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/util.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/util.c
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015-2016 Quantenna Communications, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- */
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
 
 #include "util.h"
 #include "qtn_hw_ids.h"
diff --git a/drivers/net/wireless/quantenna/qtnfmac/util.h b/drivers/net/wireless/quantenna/qtnfmac/util.h
index b8744baac332..a14b7078a9c7 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/util.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/util.h
@@ -1,18 +1,5 @@
-/*
- * Copyright (c) 2015 Quantenna Communications
- *
- * 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.
- */
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Copyright (c) 2015 Quantenna Communications. All rights reserved. */
 
 #ifndef QTNFMAC_UTIL_H
 #define QTNFMAC_UTIL_H
-- 
2.11.0


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

* [PATCH 7/7] qtnfmac: add missing bss record to host scan cache
  2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
                   ` (5 preceding siblings ...)
  2019-01-09 16:09 ` [PATCH 6/7] qtnfmac: convert to SPDX license identifiers Sergey Matyukevich
@ 2019-01-09 16:09 ` Sergey Matyukevich
  6 siblings, 0 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-09 16:09 UTC (permalink / raw)
  To: linux-wireless; +Cc: Igor Mitsyanko, Andrey Shevchenko, Sergey Matyukevich

Make sure that valid BSS entry exists in wireless core scan records
even in the case of successful connect reported by firmware.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/event.c | 79 ++++++++++++++++++++++++--
 drivers/net/wireless/quantenna/qtnfmac/qlink.h |  4 +-
 2 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c
index 3038a000c287..3fd1a9217737 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/event.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c
@@ -145,6 +145,12 @@ qtnf_event_handle_bss_join(struct qtnf_vif *vif,
 			   const struct qlink_event_bss_join *join_info,
 			   u16 len)
 {
+	struct wiphy *wiphy = priv_to_wiphy(vif->mac);
+	enum ieee80211_statuscode status = le16_to_cpu(join_info->status);
+	struct cfg80211_chan_def chandef;
+	struct cfg80211_bss *bss = NULL;
+	u8 *ie = NULL;
+
 	if (unlikely(len < sizeof(*join_info))) {
 		pr_err("VIF%u.%u: payload is too short (%u < %zu)\n",
 		       vif->mac->macid, vif->vifid, len,
@@ -158,15 +164,80 @@ qtnf_event_handle_bss_join(struct qtnf_vif *vif,
 		return -EPROTO;
 	}
 
-	pr_debug("VIF%u.%u: BSSID:%pM\n", vif->mac->macid, vif->vifid,
-		 join_info->bssid);
+	pr_debug("VIF%u.%u: BSSID:%pM status:%u\n",
+		 vif->mac->macid, vif->vifid, join_info->bssid, status);
+
+	if (status == WLAN_STATUS_SUCCESS) {
+		qlink_chandef_q2cfg(wiphy, &join_info->chan, &chandef);
+		if (!cfg80211_chandef_valid(&chandef)) {
+			pr_warn("MAC%u.%u: bad channel freq=%u cf1=%u cf2=%u bw=%u\n",
+				vif->mac->macid, vif->vifid,
+				chandef.chan->center_freq,
+				chandef.center_freq1,
+				chandef.center_freq2,
+				chandef.width);
+			status = WLAN_STATUS_UNSPECIFIED_FAILURE;
+			goto done;
+		}
 
+		bss = cfg80211_get_bss(wiphy, chandef.chan, join_info->bssid,
+				       NULL, 0, IEEE80211_BSS_TYPE_ESS,
+				       IEEE80211_PRIVACY_ANY);
+		if (!bss) {
+			pr_warn("VIF%u.%u: add missing BSS:%pM chan:%u\n",
+				vif->mac->macid, vif->vifid,
+				join_info->bssid, chandef.chan->hw_value);
+
+			if (!vif->wdev.ssid_len) {
+				pr_warn("VIF%u.%u: SSID unknown for BSS:%pM\n",
+					vif->mac->macid, vif->vifid,
+					join_info->bssid);
+				status = WLAN_STATUS_UNSPECIFIED_FAILURE;
+				goto done;
+			}
+
+			ie = kzalloc(2 + vif->wdev.ssid_len, GFP_KERNEL);
+			if (!ie) {
+				pr_warn("VIF%u.%u: IE alloc failed for BSS:%pM\n",
+					vif->mac->macid, vif->vifid,
+					join_info->bssid);
+				status = WLAN_STATUS_UNSPECIFIED_FAILURE;
+				goto done;
+			}
+
+			ie[0] = WLAN_EID_SSID;
+			ie[1] = vif->wdev.ssid_len;
+			memcpy(ie + 2, vif->wdev.ssid, vif->wdev.ssid_len);
+
+			bss = cfg80211_inform_bss(wiphy, chandef.chan,
+						  CFG80211_BSS_FTYPE_UNKNOWN,
+						  join_info->bssid, 0,
+						  WLAN_CAPABILITY_ESS, 100,
+						  ie, 2 + vif->wdev.ssid_len,
+						  0, GFP_KERNEL);
+			if (!bss) {
+				pr_warn("VIF%u.%u: can't connect to unknown BSS: %pM\n",
+					vif->mac->macid, vif->vifid,
+					join_info->bssid);
+				status = WLAN_STATUS_UNSPECIFIED_FAILURE;
+				goto done;
+			}
+		}
+	}
+
+done:
 	cfg80211_connect_result(vif->netdev, join_info->bssid, NULL, 0, NULL,
-				0, le16_to_cpu(join_info->status), GFP_KERNEL);
+				0, status, GFP_KERNEL);
+	if (bss) {
+		if (!ether_addr_equal(vif->bssid, join_info->bssid))
+			ether_addr_copy(vif->bssid, join_info->bssid);
+		cfg80211_put_bss(wiphy, bss);
+	}
 
-	if (le16_to_cpu(join_info->status) == WLAN_STATUS_SUCCESS)
+	if (status == WLAN_STATUS_SUCCESS)
 		netif_carrier_on(vif->netdev);
 
+	kfree(ie);
 	return 0;
 }
 
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
index d958b268de02..27fdb5b01ee3 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h
@@ -6,7 +6,7 @@
 
 #include <linux/ieee80211.h>
 
-#define QLINK_PROTO_VER		12
+#define QLINK_PROTO_VER		13
 
 #define QLINK_MACID_RSVD		0xFF
 #define QLINK_VIFID_RSVD		0xFF
@@ -975,11 +975,13 @@ struct qlink_event_sta_deauth {
 /**
  * struct qlink_event_bss_join - data for QLINK_EVENT_BSS_JOIN event
  *
+ * @chan: new operating channel definition
  * @bssid: BSSID of a BSS which interface tried to joined.
  * @status: status of joining attempt, see &enum ieee80211_statuscode.
  */
 struct qlink_event_bss_join {
 	struct qlink_event ehdr;
+	struct qlink_chandef chan;
 	u8 bssid[ETH_ALEN];
 	__le16 status;
 } __packed;
-- 
2.11.0


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

* Re: [PATCH 6/7] qtnfmac: convert to SPDX license identifiers
  2019-01-09 16:09 ` [PATCH 6/7] qtnfmac: convert to SPDX license identifiers Sergey Matyukevich
@ 2019-01-10  7:37   ` Kalle Valo
  2019-01-10  8:15     ` Sergey Matyukevich
  0 siblings, 1 reply; 11+ messages in thread
From: Kalle Valo @ 2019-01-10  7:37 UTC (permalink / raw)
  To: Sergey Matyukevich; +Cc: linux-wireless, Igor Mitsyanko, Andrey Shevchenko

Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> writes:

> Replace textual license with SPDX-License-Identifier.
> Add an SPDX-License-Identifier for the Makefile.
>
> Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>

[...]

> --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
> +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
> @@ -1,3 +1,6 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
> +
>  /*
>   * Copyright (c) 2015-2016 Quantenna Communications, Inc.
>   * All rights reserved.

This doesn't look correct, please check.

-- 
Kalle Valo

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

* Re: [PATCH 6/7] qtnfmac: convert to SPDX license identifiers
  2019-01-10  7:37   ` Kalle Valo
@ 2019-01-10  8:15     ` Sergey Matyukevich
  0 siblings, 0 replies; 11+ messages in thread
From: Sergey Matyukevich @ 2019-01-10  8:15 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Igor Mitsyanko, Andrey Shevchenko

Hello Kalle,

> Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> writes:
> 
> > Replace textual license with SPDX-License-Identifier.
> > Add an SPDX-License-Identifier for the Makefile.
> >
> > Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
> 
> [...]
> 
> > --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
> > +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
> > @@ -1,3 +1,6 @@
> > +/* SPDX-License-Identifier: GPL-2.0+ */
> > +/* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */
> > +
> >  /*
> >   * Copyright (c) 2015-2016 Quantenna Communications, Inc.
> >   * All rights reserved.
> 
> This doesn't look correct, please check.

Oh, I missed that one. Thanks for catching. All the other SPDX changes
looks ok. This issue is fixed and will be queued into v2 of this patch set.


Regards,
Sergey

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

* Re: [PATCH 3/7] qtnfmac: add support for 4addr mode
  2019-01-09 16:08 ` [PATCH 3/7] qtnfmac: add support for 4addr mode Sergey Matyukevich
@ 2019-01-12 10:54   ` kbuild test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kbuild test robot @ 2019-01-12 10:54 UTC (permalink / raw)
  To: kbuild, Sergey Matyukevich
  Cc: Dan Carpenter, kbuild-all, linux-wireless, Igor Mitsyanko,
	Andrey Shevchenko, Sergey Matyukevich

Hi Sergey,

url:    https://github.com/0day-ci/linux/commits/Sergey-Matyukevich/qtnfmac-fixes-and-minor-enhancements/20190111-030606
base:   https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git master

smatch warnings:
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c:142 qtnf_change_virtual_intf() error: we previously assumed 'params' could be null (see line 135)
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c:232 qtnf_add_virtual_intf() error: we previously assumed 'params' could be null (see line 229)

# https://github.com/0day-ci/linux/commit/6bf96047ef769f18b29bbfae576d829462da53f3
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 6bf96047ef769f18b29bbfae576d829462da53f3
vim +/params +142 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

01efff52 Sergey Matyukevich 2018-01-22  117  
01efff52 Sergey Matyukevich 2018-01-22  118  static int
98f44cb0 Igor Mitsyanko     2017-05-11  119  qtnf_change_virtual_intf(struct wiphy *wiphy,
98f44cb0 Igor Mitsyanko     2017-05-11  120  			 struct net_device *dev,
98f44cb0 Igor Mitsyanko     2017-05-11  121  			 enum nl80211_iftype type,
98f44cb0 Igor Mitsyanko     2017-05-11  122  			 struct vif_params *params)
98f44cb0 Igor Mitsyanko     2017-05-11  123  {
98f44cb0 Igor Mitsyanko     2017-05-11  124  	struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
98f44cb0 Igor Mitsyanko     2017-05-11  125  	u8 *mac_addr;
98f44cb0 Igor Mitsyanko     2017-05-11  126  	int ret;
98f44cb0 Igor Mitsyanko     2017-05-11  127  
01efff52 Sergey Matyukevich 2018-01-22  128  	ret = qtnf_validate_iface_combinations(wiphy, vif, type);
01efff52 Sergey Matyukevich 2018-01-22  129  	if (ret) {
01efff52 Sergey Matyukevich 2018-01-22  130  		pr_err("VIF%u.%u combination check: failed to set type %d\n",
01efff52 Sergey Matyukevich 2018-01-22  131  		       vif->mac->macid, vif->vifid, type);
01efff52 Sergey Matyukevich 2018-01-22  132  		return ret;
01efff52 Sergey Matyukevich 2018-01-22  133  	}
01efff52 Sergey Matyukevich 2018-01-22  134  
98f44cb0 Igor Mitsyanko     2017-05-11 @135  	if (params)
98f44cb0 Igor Mitsyanko     2017-05-11  136  		mac_addr = params->macaddr;
98f44cb0 Igor Mitsyanko     2017-05-11  137  	else
98f44cb0 Igor Mitsyanko     2017-05-11  138  		mac_addr = NULL;
98f44cb0 Igor Mitsyanko     2017-05-11  139  
98f44cb0 Igor Mitsyanko     2017-05-11  140  	qtnf_scan_done(vif->mac, true);
98f44cb0 Igor Mitsyanko     2017-05-11  141  
6bf96047 Sergey Matyukevich 2019-01-09 @142  	ret = qtnf_cmd_send_change_intf_type(vif, type, params->use_4addr,
6bf96047 Sergey Matyukevich 2019-01-09  143  					     mac_addr);
98f44cb0 Igor Mitsyanko     2017-05-11  144  	if (ret) {
c6ed298f Sergey Matyukevich 2018-10-05  145  		pr_err("VIF%u.%u: failed to change type to %d\n",
c6ed298f Sergey Matyukevich 2018-10-05  146  		       vif->mac->macid, vif->vifid, type);
98f44cb0 Igor Mitsyanko     2017-05-11  147  		return ret;
98f44cb0 Igor Mitsyanko     2017-05-11  148  	}
98f44cb0 Igor Mitsyanko     2017-05-11  149  
98f44cb0 Igor Mitsyanko     2017-05-11  150  	vif->wdev.iftype = type;
98f44cb0 Igor Mitsyanko     2017-05-11  151  	return 0;
98f44cb0 Igor Mitsyanko     2017-05-11  152  }
98f44cb0 Igor Mitsyanko     2017-05-11  153  
98f44cb0 Igor Mitsyanko     2017-05-11  154  int qtnf_del_virtual_intf(struct wiphy *wiphy, struct wireless_dev *wdev)
98f44cb0 Igor Mitsyanko     2017-05-11  155  {
98f44cb0 Igor Mitsyanko     2017-05-11  156  	struct net_device *netdev =  wdev->netdev;
98f44cb0 Igor Mitsyanko     2017-05-11  157  	struct qtnf_vif *vif;
98f44cb0 Igor Mitsyanko     2017-05-11  158  
98f44cb0 Igor Mitsyanko     2017-05-11  159  	if (WARN_ON(!netdev))
98f44cb0 Igor Mitsyanko     2017-05-11  160  		return -EFAULT;
98f44cb0 Igor Mitsyanko     2017-05-11  161  
98f44cb0 Igor Mitsyanko     2017-05-11  162  	vif = qtnf_netdev_get_priv(wdev->netdev);
98f44cb0 Igor Mitsyanko     2017-05-11  163  
a715b3a0 Sergey Matyukevich 2017-09-18  164  	qtnf_scan_done(vif->mac, true);
a715b3a0 Sergey Matyukevich 2017-09-18  165  
98f44cb0 Igor Mitsyanko     2017-05-11  166  	/* Stop data */
98f44cb0 Igor Mitsyanko     2017-05-11  167  	netif_tx_stop_all_queues(netdev);
98f44cb0 Igor Mitsyanko     2017-05-11  168  	if (netif_carrier_ok(netdev))
98f44cb0 Igor Mitsyanko     2017-05-11  169  		netif_carrier_off(netdev);
98f44cb0 Igor Mitsyanko     2017-05-11  170  
98f44cb0 Igor Mitsyanko     2017-05-11  171  	if (netdev->reg_state == NETREG_REGISTERED)
98f44cb0 Igor Mitsyanko     2017-05-11  172  		unregister_netdevice(netdev);
98f44cb0 Igor Mitsyanko     2017-05-11  173  
87affdde Vasily Ulyanov     2018-01-22  174  	if (qtnf_cmd_send_del_intf(vif))
87affdde Vasily Ulyanov     2018-01-22  175  		pr_err("VIF%u.%u: failed to delete VIF\n", vif->mac->macid,
87affdde Vasily Ulyanov     2018-01-22  176  		       vif->vifid);
87affdde Vasily Ulyanov     2018-01-22  177  
98f44cb0 Igor Mitsyanko     2017-05-11  178  	vif->netdev->ieee80211_ptr = NULL;
98f44cb0 Igor Mitsyanko     2017-05-11  179  	vif->netdev = NULL;
98f44cb0 Igor Mitsyanko     2017-05-11  180  	vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
98f44cb0 Igor Mitsyanko     2017-05-11  181  
98f44cb0 Igor Mitsyanko     2017-05-11  182  	return 0;
98f44cb0 Igor Mitsyanko     2017-05-11  183  }
98f44cb0 Igor Mitsyanko     2017-05-11  184  
98f44cb0 Igor Mitsyanko     2017-05-11  185  static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy,
98f44cb0 Igor Mitsyanko     2017-05-11  186  						  const char *name,
98f44cb0 Igor Mitsyanko     2017-05-11  187  						  unsigned char name_assign_t,
98f44cb0 Igor Mitsyanko     2017-05-11  188  						  enum nl80211_iftype type,
98f44cb0 Igor Mitsyanko     2017-05-11  189  						  struct vif_params *params)
98f44cb0 Igor Mitsyanko     2017-05-11  190  {
98f44cb0 Igor Mitsyanko     2017-05-11  191  	struct qtnf_wmac *mac;
98f44cb0 Igor Mitsyanko     2017-05-11  192  	struct qtnf_vif *vif;
98f44cb0 Igor Mitsyanko     2017-05-11  193  	u8 *mac_addr = NULL;
01efff52 Sergey Matyukevich 2018-01-22  194  	int ret;
98f44cb0 Igor Mitsyanko     2017-05-11  195  
98f44cb0 Igor Mitsyanko     2017-05-11  196  	mac = wiphy_priv(wiphy);
98f44cb0 Igor Mitsyanko     2017-05-11  197  
98f44cb0 Igor Mitsyanko     2017-05-11  198  	if (!mac)
98f44cb0 Igor Mitsyanko     2017-05-11  199  		return ERR_PTR(-EFAULT);
98f44cb0 Igor Mitsyanko     2017-05-11  200  
01efff52 Sergey Matyukevich 2018-01-22  201  	ret = qtnf_validate_iface_combinations(wiphy, NULL, type);
01efff52 Sergey Matyukevich 2018-01-22  202  	if (ret) {
01efff52 Sergey Matyukevich 2018-01-22  203  		pr_err("MAC%u invalid combination: failed to add type %d\n",
01efff52 Sergey Matyukevich 2018-01-22  204  		       mac->macid, type);
01efff52 Sergey Matyukevich 2018-01-22  205  		return ERR_PTR(ret);
01efff52 Sergey Matyukevich 2018-01-22  206  	}
01efff52 Sergey Matyukevich 2018-01-22  207  
98f44cb0 Igor Mitsyanko     2017-05-11  208  	switch (type) {
98f44cb0 Igor Mitsyanko     2017-05-11  209  	case NL80211_IFTYPE_STATION:
98f44cb0 Igor Mitsyanko     2017-05-11  210  	case NL80211_IFTYPE_AP:
98f44cb0 Igor Mitsyanko     2017-05-11  211  		vif = qtnf_mac_get_free_vif(mac);
98f44cb0 Igor Mitsyanko     2017-05-11  212  		if (!vif) {
98f44cb0 Igor Mitsyanko     2017-05-11  213  			pr_err("MAC%u: no free VIF available\n", mac->macid);
98f44cb0 Igor Mitsyanko     2017-05-11  214  			return ERR_PTR(-EFAULT);
98f44cb0 Igor Mitsyanko     2017-05-11  215  		}
98f44cb0 Igor Mitsyanko     2017-05-11  216  
98f44cb0 Igor Mitsyanko     2017-05-11  217  		eth_zero_addr(vif->mac_addr);
9a3beeb5 Sergey Matyukevich 2018-05-29  218  		eth_zero_addr(vif->bssid);
98f44cb0 Igor Mitsyanko     2017-05-11  219  		vif->bss_priority = QTNF_DEF_BSS_PRIORITY;
9a3beeb5 Sergey Matyukevich 2018-05-29  220  		memset(&vif->wdev, 0, sizeof(vif->wdev));
98f44cb0 Igor Mitsyanko     2017-05-11  221  		vif->wdev.wiphy = wiphy;
98f44cb0 Igor Mitsyanko     2017-05-11  222  		vif->wdev.iftype = type;
98f44cb0 Igor Mitsyanko     2017-05-11  223  		break;
98f44cb0 Igor Mitsyanko     2017-05-11  224  	default:
98f44cb0 Igor Mitsyanko     2017-05-11  225  		pr_err("MAC%u: unsupported IF type %d\n", mac->macid, type);
98f44cb0 Igor Mitsyanko     2017-05-11  226  		return ERR_PTR(-ENOTSUPP);
98f44cb0 Igor Mitsyanko     2017-05-11  227  	}
98f44cb0 Igor Mitsyanko     2017-05-11  228  
98f44cb0 Igor Mitsyanko     2017-05-11 @229  	if (params)
98f44cb0 Igor Mitsyanko     2017-05-11  230  		mac_addr = params->macaddr;
98f44cb0 Igor Mitsyanko     2017-05-11  231  
6bf96047 Sergey Matyukevich 2019-01-09 @232  	ret = qtnf_cmd_send_add_intf(vif, type, params->use_4addr, mac_addr);
c6ed298f Sergey Matyukevich 2018-10-05  233  	if (ret) {
c6ed298f Sergey Matyukevich 2018-10-05  234  		pr_err("VIF%u.%u: failed to add VIF %pM\n",
c6ed298f Sergey Matyukevich 2018-10-05  235  		       mac->macid, vif->vifid, mac_addr);
98f44cb0 Igor Mitsyanko     2017-05-11  236  		goto err_cmd;
98f44cb0 Igor Mitsyanko     2017-05-11  237  	}
98f44cb0 Igor Mitsyanko     2017-05-11  238  
98f44cb0 Igor Mitsyanko     2017-05-11  239  	if (!is_valid_ether_addr(vif->mac_addr)) {
98f44cb0 Igor Mitsyanko     2017-05-11  240  		pr_err("VIF%u.%u: FW reported bad MAC: %pM\n",
98f44cb0 Igor Mitsyanko     2017-05-11  241  		       mac->macid, vif->vifid, vif->mac_addr);
c6ed298f Sergey Matyukevich 2018-10-05  242  		ret = -EINVAL;
98f44cb0 Igor Mitsyanko     2017-05-11  243  		goto err_mac;
98f44cb0 Igor Mitsyanko     2017-05-11  244  	}
98f44cb0 Igor Mitsyanko     2017-05-11  245  
c6ed298f Sergey Matyukevich 2018-10-05  246  	ret = qtnf_core_net_attach(mac, vif, name, name_assign_t);
c6ed298f Sergey Matyukevich 2018-10-05  247  	if (ret) {
98f44cb0 Igor Mitsyanko     2017-05-11  248  		pr_err("VIF%u.%u: failed to attach netdev\n", mac->macid,
98f44cb0 Igor Mitsyanko     2017-05-11  249  		       vif->vifid);
98f44cb0 Igor Mitsyanko     2017-05-11  250  		goto err_net;
98f44cb0 Igor Mitsyanko     2017-05-11  251  	}
98f44cb0 Igor Mitsyanko     2017-05-11  252  
98f44cb0 Igor Mitsyanko     2017-05-11  253  	vif->wdev.netdev = vif->netdev;
98f44cb0 Igor Mitsyanko     2017-05-11  254  	return &vif->wdev;
98f44cb0 Igor Mitsyanko     2017-05-11  255  
98f44cb0 Igor Mitsyanko     2017-05-11  256  err_net:
98f44cb0 Igor Mitsyanko     2017-05-11  257  	vif->netdev = NULL;
98f44cb0 Igor Mitsyanko     2017-05-11  258  err_mac:
98f44cb0 Igor Mitsyanko     2017-05-11  259  	qtnf_cmd_send_del_intf(vif);
98f44cb0 Igor Mitsyanko     2017-05-11  260  err_cmd:
98f44cb0 Igor Mitsyanko     2017-05-11  261  	vif->wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
98f44cb0 Igor Mitsyanko     2017-05-11  262  
c6ed298f Sergey Matyukevich 2018-10-05  263  	return ERR_PTR(ret);
98f44cb0 Igor Mitsyanko     2017-05-11  264  }
98f44cb0 Igor Mitsyanko     2017-05-11  265  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

end of thread, other threads:[~2019-01-12 10:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 16:08 [PATCH 0/7] qtnfmac: fixes and minor enhancements Sergey Matyukevich
2019-01-09 16:08 ` [PATCH 1/7] qtnfmac: support EBUSY errcode for QLINK protocol Sergey Matyukevich
2019-01-09 16:08 ` [PATCH 2/7] qtnfmac: fix legacy PCIe interrupt handling Sergey Matyukevich
2019-01-09 16:08 ` [PATCH 3/7] qtnfmac: add support for 4addr mode Sergey Matyukevich
2019-01-12 10:54   ` kbuild test robot
2019-01-09 16:09 ` [PATCH 4/7] qtnfmac: switch to 32bit values for RTS/FRAG thresholds Sergey Matyukevich
2019-01-09 16:09 ` [PATCH 5/7] qtnfmac: do not reject retry changes in driver Sergey Matyukevich
2019-01-09 16:09 ` [PATCH 6/7] qtnfmac: convert to SPDX license identifiers Sergey Matyukevich
2019-01-10  7:37   ` Kalle Valo
2019-01-10  8:15     ` Sergey Matyukevich
2019-01-09 16:09 ` [PATCH 7/7] qtnfmac: add missing bss record to host scan cache Sergey Matyukevich

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).