All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
To: linux-wireless@vger.kernel.org
Cc: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>,
	Avinash Patil <avinashp@quantenna.com>,
	Vasily Ulyanov <vulyanov@quantenna.com>
Subject: [PATCH 04/10] qtnfmac: change default interface mode from AP to STA
Date: Mon, 13 Nov 2017 13:28:09 +0300	[thread overview]
Message-ID: <20171113102815.11254-5-sergey.matyukevich.os@quantenna.com> (raw)
In-Reply-To: <20171113102815.11254-1-sergey.matyukevich.os@quantenna.com>

From: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>

To mimic mac80211 behaviour, change default interface type from AP to STA.

Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com>
---
 drivers/net/wireless/quantenna/qtnfmac/cfg80211.c |  2 +-
 drivers/net/wireless/quantenna/qtnfmac/core.c     | 11 ++++-------
 drivers/net/wireless/quantenna/qtnfmac/core.h     |  3 +--
 3 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
index 64fc4119b3a6..a11278de678d 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
@@ -190,7 +190,7 @@ static struct wireless_dev *qtnf_add_virtual_intf(struct wiphy *wiphy,
 		goto err_mac;
 	}
 
-	if (qtnf_core_net_attach(mac, vif, name, name_assign_t, type)) {
+	if (qtnf_core_net_attach(mac, vif, name, name_assign_t)) {
 		pr_err("VIF%u.%u: failed to attach netdev\n", mac->macid,
 		       vif->vifid);
 		goto err_net;
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c
index 2d2c1ea65cb2..ea850cb7dffc 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.c
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.c
@@ -258,7 +258,7 @@ static void qtnf_mac_init_primary_intf(struct qtnf_wmac *mac)
 {
 	struct qtnf_vif *vif = &mac->iflist[QTNF_PRIMARY_VIF_IDX];
 
-	vif->wdev.iftype = NL80211_IFTYPE_AP;
+	vif->wdev.iftype = NL80211_IFTYPE_STATION;
 	vif->bss_priority = QTNF_DEF_BSS_PRIORITY;
 	vif->wdev.wiphy = priv_to_wiphy(mac);
 	INIT_WORK(&vif->reset_work, qtnf_vif_reset_handler);
@@ -298,8 +298,7 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus,
 }
 
 int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif,
-			 const char *name, unsigned char name_assign_type,
-			 enum nl80211_iftype iftype)
+			 const char *name, unsigned char name_assign_type)
 {
 	struct wiphy *wiphy = priv_to_wiphy(mac);
 	struct net_device *dev;
@@ -320,7 +319,6 @@ int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif,
 	dev->needs_free_netdev = true;
 	dev_net_set(dev, wiphy_net(wiphy));
 	dev->ieee80211_ptr = &vif->wdev;
-	dev->ieee80211_ptr->iftype = iftype;
 	ether_addr_copy(dev->dev_addr, vif->mac_addr);
 	SET_NETDEV_DEV(dev, wiphy_dev(wiphy));
 	dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
@@ -418,7 +416,7 @@ static int qtnf_core_mac_attach(struct qtnf_bus *bus, unsigned int macid)
 		goto error;
 	}
 
-	ret = qtnf_cmd_send_add_intf(vif, NL80211_IFTYPE_AP, vif->mac_addr);
+	ret = qtnf_cmd_send_add_intf(vif, vif->wdev.iftype, vif->mac_addr);
 	if (ret) {
 		pr_err("MAC%u: failed to add VIF\n", macid);
 		goto error;
@@ -446,8 +444,7 @@ static int qtnf_core_mac_attach(struct qtnf_bus *bus, unsigned int macid)
 
 	rtnl_lock();
 
-	ret = qtnf_core_net_attach(mac, vif, "wlan%d", NET_NAME_ENUM,
-				   NL80211_IFTYPE_AP);
+	ret = qtnf_core_net_attach(mac, vif, "wlan%d", NET_NAME_ENUM);
 	rtnl_unlock();
 
 	if (ret) {
diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h
index 1b7bc0318f3e..8e42d1bdc65f 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/core.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/core.h
@@ -144,8 +144,7 @@ struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac);
 struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac);
 struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus);
 int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *priv,
-			 const char *name, unsigned char name_assign_type,
-			 enum nl80211_iftype iftype);
+			 const char *name, unsigned char name_assign_type);
 void qtnf_main_work_queue(struct work_struct *work);
 int qtnf_cmd_send_update_phy_params(struct qtnf_wmac *mac, u32 changed);
 int qtnf_cmd_send_get_phy_params(struct qtnf_wmac *mac);
-- 
2.11.0

  parent reply	other threads:[~2017-11-13 10:28 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 10:28 [PATCH 0/10] qtnfmac: regular portion of features and fixes Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 01/10] qtnfmac: check that MAC exists in regulatory notifier Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 02/10] qtnfmac: pass complete channel data between driver and firmware Sergey Matyukevich
2017-12-04 14:46   ` Kalle Valo
2017-12-05 16:24     ` Sergey Matyukevich
2018-01-12 11:23       ` Kalle Valo
2018-01-15  9:56         ` Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 03/10] qtnfmac: add support for radar detection and CAC Sergey Matyukevich
2017-12-04 14:49   ` Kalle Valo
2017-12-04 14:52     ` Kalle Valo
2017-12-05 16:27       ` Sergey Matyukevich
2017-11-13 10:28 ` Sergey Matyukevich [this message]
2017-11-13 10:28 ` [PATCH 05/10] qtnfmac: check for passed channel being NULL in MGMT_TX command Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 06/10] qtnfmac: fix rssi data passed to wireless core Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 07/10] qtnfmac: fill wiphy's extended capabilities Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 08/10] qtnfmac: modify GET_STA_STATS cmd format for back/forward compatibility Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 09/10] qtnfmac: keeping track of "generation" for STA info Sergey Matyukevich
2017-11-13 10:28 ` [PATCH 10/10] qtnfmac: support MAC address based access control Sergey Matyukevich
2017-12-04 15:01   ` Kalle Valo
2017-12-05 16:00     ` Sergey Matyukevich
2017-12-18 12:43       ` Sergey Matyukevich
2017-12-18 14:01       ` Kalle Valo
2017-12-18 16:18         ` Sergey Matyukevich
2017-12-19  9:38           ` Johannes Berg
2017-12-19 10:29             ` Sergey Matyukevich
2017-12-19 10:35               ` Johannes Berg
2017-12-19 10:42                 ` Sergey Matyukevich
2017-12-19 10:59                   ` Johannes Berg
2017-12-19 11:19                     ` Sergey Matyukevich
2017-12-19 12:37                       ` Arend van Spriel
2017-12-19 16:58                         ` Johannes Berg
2017-12-19 22:13                           ` Arend Van Spriel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171113102815.11254-5-sergey.matyukevich.os@quantenna.com \
    --to=sergey.matyukevich.os@quantenna.com \
    --cc=avinashp@quantenna.com \
    --cc=igor.mitsyanko.os@quantenna.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=vulyanov@quantenna.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.