From patchwork Mon Nov 13 10:28:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10055517 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 98EA06029B for ; Mon, 13 Nov 2017 10:28:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65E752935C for ; Mon, 13 Nov 2017 10:28:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A56F29362; Mon, 13 Nov 2017 10:28:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAF1629364 for ; Mon, 13 Nov 2017 10:28:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbdKMK2i (ORCPT ); Mon, 13 Nov 2017 05:28:38 -0500 Received: from mail-sn1nam01on0085.outbound.protection.outlook.com ([104.47.32.85]:59533 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752177AbdKMK2f (ORCPT ); Mon, 13 Nov 2017 05:28:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1EtR4jm3a402JLQdr3eWB8RZDW7lXzFmRnR8159pubg=; b=acwbyARelDK7eqbs15mzUEgVnAtBh6xLXX4WyfVUKgvr5dY0P05vIJ3sFbT/EtvgoiAkl3u/4+49Iyt0xToBJhVI61gCu3lIEvMlQBchJJfl7Aj+Gqh/D4dwMqd2ot44gr5zUx/EszKHtty95huaoyUAy1UaMySOWfOUYCmrmO4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1924.namprd05.prod.outlook.com (10.162.224.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.239.4; Mon, 13 Nov 2017 10:28:31 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil , Vasily Ulyanov Subject: [PATCH 04/10] qtnfmac: change default interface mode from AP to STA Date: Mon, 13 Nov 2017 13:28:09 +0300 Message-Id: <20171113102815.11254-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171113102815.11254-1-sergey.matyukevich.os@quantenna.com> References: <20171113102815.11254-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM5P190CA0007.EURP190.PROD.OUTLOOK.COM (10.161.47.148) To BLUPR05MB1924.namprd05.prod.outlook.com (10.162.224.14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ea9244f-204e-48d8-6604-08d52a8149fb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:BLUPR05MB1924; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1924; 3:yhmPd7sTDpapGaC8yleEmn0ReB3bmajffvZzPI0z5eu1WSfaWTJovmHrjAKPGNyMQvKpXjODj5QVDRTrFvSFIE/bP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V5Wbg5JFhOQ4XUF+WY9qsA3hys5qMqAc6drYHttBtANKzLqhGkbzMsii6A2b2Es8P4a9iZhPDSXSa0euTXg6kQDRFpw5mLQbbzZiwXGcLyhsG96fs1fc29ICxui8xvauEbd1xpQM2a+lwkB+4aWfs4sn/a54hemh/Jq50tTIcrN86kK3KPWCjDdE3NR+85Q2Kn6p6xmTgEGi7BKBPWIZ3FVRZcJ8HAnDbiKXL9QJDQYsp1cmqONRUlF+H1R0CltwCh2d/J2NDMsfP; 4:RmzvTxKxXVESGJJ53yXoSUmxAKmfbn2eZmkZOap7F4NdpGqA5b/y189+tzpWL3xLKZTk7c5oPTX5vzU4YChu/JJE6UwGNGxEAjXFB1TieJWJncBbhQLKTHPy06a62Xp4qrqGEysf5gf9fge5sjpMIALLGZWNQQEbZwIDkxwYf+py55VYiEoPmqZxWwAL08Yxdr3U7OveczATfMLrE6CwCtBZVVyB4hocdZLRw6skL1CxoFlkt6mG8y/O8FgcUcH4EJHVSu1ZbUbLsaUT2CoIkA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3231022)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR05MB1924; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR05MB1924; X-Forefront-PRVS: 0490BBA1F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39830400002)(346002)(199003)(189002)(5660300001)(107886003)(47776003)(105586002)(50226002)(54906003)(66066001)(53936002)(2361001)(76176999)(316002)(6486002)(6916009)(50986999)(97736004)(4326008)(33646002)(5003940100001)(106356001)(2906002)(6666003)(2950100002)(25786009)(101416001)(16526018)(189998001)(81166006)(81156014)(86362001)(8676002)(6116002)(3846002)(478600001)(68736007)(53416004)(5890100001)(48376002)(7736002)(50466002)(2351001)(16586007)(103116003)(69596002)(36756003)(305945005)(1076002)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1924; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB1924; 23:r3CF1SLKkFKV5yGUUgC1vvijanyGzA4062cV30xVq?= =?us-ascii?Q?i2KHDrx7QCUQORic8lcb0DbJHQ+0xIShTDykzD3EDTi6/2XKrFZREUaSR7ZJ?= =?us-ascii?Q?gRjpGeYLgS+UHvb8PHrnJpTRyxKfXY3l/mv9ocJ0KeQvnZxDeEFVfXPcXEjY?= =?us-ascii?Q?Bis/GZiqMkdMT3M/E9zl6NvCpME93fpvr5M2gvgXsvLN02NrwLO49+3Wi4Iy?= =?us-ascii?Q?2JsVJpGt7/2qEwhOaYHTWJA5pRtLSsU0tZwJacsKLUVHhryVQ9yZPl8yeMgH?= =?us-ascii?Q?hA9aYMwrBkjM3xERfdfAl7A/kJZDW2WLh4HHjKRRS4NfYeg5BA9Ah+1pdSgo?= =?us-ascii?Q?OwbNocFoOI79buRFogscu5rKtedg8aZY0SgrxhDRVCfpGMGJjuBvNAE1+7ME?= =?us-ascii?Q?s9Al+nxGXiRpnqGawtBWWtwg55cmbolacOXAoATICoFzits3fpX4EKbRFPS5?= =?us-ascii?Q?OL3seDpjVnzYzsDUBA99l2aDNMpxdimDY0Uv7v6qRk3Cyqcb5YZ2b0DP1XJ9?= =?us-ascii?Q?FPUMijTTazJPFgA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OCrF0DDE13Qjjp/2gMXMoH/FyhBdQofzpwc2C+ZqHFMiinTdv6vXmLqAdM7ZXoCiWKGpfLVJEMiau6BUoSO3u/3QyCex+kx0RBauHpcJaqaicqlKOaPQTQ8hx9HLP2BP1iVVhYPbq2IkUN8+OwvdYwpm9Q9MPzYdGTILqdrAlSlaNuH8i87mJVeG+d2GP4RsKZipIXoSJTEhg2fYmWe71g68o9acI=; 5:tPtUuxRmuYYj0IkeZAXl9ZnaXbFHRe/wElpvP4eeri2Z6L0DjzmZtTO2rZJyU0TU1p4X8WrukyJnDO8bb/bIW4rnDMTVnzrMw7ogyvXD09qzEIX1JmZ8D7rEvKgqjjn7KP69Jp+XC0B0znlPw2+ApJz7mZ0v1OYYB0aBasvZNdM=; 24:cIr5p+03F7KxqXAzcR++CitExGVlj5bZzDCXY788fe1yNZHex9KWqkOM1T9iuIUllIYF5ECd7c3Wb2lp0JZWHCKjYD/NjatNr8A7zcvTvQg=; 7:mJMDJqByekhsiQJ1PZ5OCCIQehNnVgvlzM9BltLCSxFFiDErvCGuFsseyrSXPpXKh6wo6bhBr8O/edN8EmJUG8MannySNAmiew9d87Sv7Nh8q8v/AH4Kaj1Z0KNGAz11aj5DptzEr7KlAwFevPStrxi5Sk1agucsUyrO2hbTGFo8f0qD2EURGIZyIzbPXF6uZ9m4bT5D01pkMjc65Yoo0ytcmey3Xs10fsLNW0bFXTutXQ604MK2NOMg227OlXCu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2017 10:28:31.4715 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ea9244f-204e-48d8-6604-08d52a8149fb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1924 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Igor Mitsyanko To mimic mac80211 behaviour, change default interface type from AP to STA. Signed-off-by: Igor Mitsyanko --- 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);