From patchwork Tue Dec 19 11:28:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10123085 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 891AB6019C for ; Tue, 19 Dec 2017 11:29:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 86D5129280 for ; Tue, 19 Dec 2017 11:29:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B87E292A2; Tue, 19 Dec 2017 11:29:33 +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 EA2ED29280 for ; Tue, 19 Dec 2017 11:29:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965682AbdLSL3b (ORCPT ); Tue, 19 Dec 2017 06:29:31 -0500 Received: from mail-by2nam03on0052.outbound.protection.outlook.com ([104.47.42.52]:40224 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965110AbdLSL32 (ORCPT ); Tue, 19 Dec 2017 06:29:28 -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=9uuyV/IkF5xovkexD5GSLMAw0OrmTqy9Y4zfCOywDWA=; b=W58F7oDjNMxvNIs0YLubDkogMzZSrLGUtczuLnKFTb8lbFZVRbzXaEhdD8vCWwmKiYqxyO/GGsiOiyVhY4/LAcjhH2B3d5fXcjUyeVlS3l7btaknpsVK5peiOlmSX9zKU603+4VPOLLKCcpv26HhwO+K7H2cdbC/0QUrZV+KKBg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BLUPR05MB1923.namprd05.prod.outlook.com (10.162.224.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.10; Tue, 19 Dec 2017 11:29:21 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil Subject: [PATCH v2 04/10] qtnfmac: change default interface mode from AP to STA Date: Tue, 19 Dec 2017 14:28:50 +0300 Message-Id: <20171219112856.22463-5-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171219112856.22463-1-sergey.matyukevich.os@quantenna.com> References: <20171219112856.22463-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR0502CA0022.eurprd05.prod.outlook.com (52.133.16.163) To BLUPR05MB1923.namprd05.prod.outlook.com (10.162.224.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 896a84fe-3e18-45ed-b531-08d546d3c08c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603307); SRVR:BLUPR05MB1923; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB1923; 3:w6uckdt4DlkDxmFLTivpfAbNVjoSrMAOxDOhT9RU+ZXIh7OoJAbOIc1JF+34QPpkQJ4e4Xm1EkxFzKLnqHYhE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InXNTxOfJ8Ovo2s9bJZLmJlWNruAFvewsbZrwtyUxU0BVo3E5aPg3BjVUM8r9qzIPpIUdN/EOE8IrHTiPEAi1MNNDPvjQ9SYomAdKQ/aUPsCb1ffuzFuX4R4o6S1AWFgrPtkY6AVhhhO6LGnYBK7UrzTfKe5+brwYnY6o2jt1oZmfCVZfW9MP+iNmKxso6w8wEBmnOKAi+/+FqTzwOk6l1Y2qaJxm7A44WHCdNV3I7krkrqnHP1r+7CrhIGk6b3UdtMAbFHXrWGHLx5L67tJ6NTeT; 4:Bks++KTF7E8tOEEH51t14E59F562MoFEOHfKYr96i18MpTZteJrlW5wxcACvViQuNBUg/7FIuZtPBNLAfgX6gSmQJKsICARDl6xAnjovy/Er0s6t3TeqU1gXP+aypnj7cvXHTl03c5a7J7iX3ksil3ICnqBNtx/ZdjM8ggSr2s9FmU2GlGx0MQLt8eb91NvOoeRxTdlQgLePQSGORCCdOqAC0bEHpDQrLVM+ERRC3W0ykrba0QnDL4rAY6mWG5LYomDdU5JbILvTmkp2MTgmDA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(3002001)(3231023)(10201501046)(93006095)(93001095)(6041248)(20161123560025)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011); SRVR:BLUPR05MB1923; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR05MB1923; X-Forefront-PRVS: 052670E5A4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39840400004)(346002)(396003)(189003)(199004)(48376002)(68736007)(50466002)(59450400001)(5660300001)(5890100001)(2950100002)(6666003)(6916009)(316002)(52116002)(76176011)(386003)(7696005)(97736004)(51416003)(16526018)(16586007)(107886003)(25786009)(54906003)(4326008)(69596002)(86362001)(53936002)(2906002)(81156014)(103116003)(6486002)(2361001)(2351001)(478600001)(8676002)(50226002)(1076002)(8936002)(7736002)(81166006)(66066001)(47776003)(106356001)(105586002)(3846002)(36756003)(6116002)(305945005)(53416004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB1923; H:bars.quantenna.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BLUPR05MB1923; 23:AcXLmXhY9lRhByPLsgLrtYmkepKvHboindmE5dqxS?= =?us-ascii?Q?S/9IHtMO1rfHJ1y5wIa6dGbfv7HjJrqsXssrDDTIJZ4+wMDFcDmY/hjPY8dh?= =?us-ascii?Q?MMWeXma4epROwCSxxIsB8tPrqa5yX1Uts/c5OM8y+MISBseX5F2I8egrqxHm?= =?us-ascii?Q?9mOyv5dcoW6Rtu+yrF+6G+BCZiAMRKLvltOg/gxqXFOshCfa2alUVAxrXgNK?= =?us-ascii?Q?ZsUxG2e+pULEAwDD6JLQrgt2XWO26eckJXNUdc4GhUSh4RPnh5ThcDko7L8E?= =?us-ascii?Q?IbhF5VCmU0Ns8A0r2EaYgX6xteh+RkpKk+IWDMWuWop9bHDGrLo3NN/pe1F3?= =?us-ascii?Q?1xIws7RNY+8dbe2p/VSlQzgiOhCto4kROOL9GuKFypAdZKos3/a5JjD0Vsoi?= =?us-ascii?Q?h5Bq3Agt6jduOw23yn9PUBmxrT/RJEeq7bhdyE4tdJmyYwBGED+T2UKdMRZm?= =?us-ascii?Q?T5LcE5t0WV2Tn3O/lHtlDIXWV0MvcLnF8N56w1q4IRrpz/ellt6jxXys4e4H?= =?us-ascii?Q?4MdMCeHQTlI+BxMLgjTgVYJu86didb1V+xMAWtHnAuHwMOxdVOQ4j48PYCI3?= =?us-ascii?Q?vr7mrOMI8QFkJduPeG3X2VlGuYjJT4OX7wirz7hn2lOh1muDObA1DH5LxRdQ?= =?us-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IrTl/18H/pF5ui/1TTIKeJlI+xlyTf//+984u7a+E/SBaQnOmkp3jP8aj1Nd9PxP6TQiT9T4y0DVTHgngcwGgMcS0A6kKC3xn7IEI=; 5:vQ6xdO8eZHCaB+MMU9R1VUpMxkXl1jsXV1KvduVSOcfODfzpTVdjfUWhnShd859j7ysdm2Exu7OZLMBZgBIYguJjG3sLKzjXrS5BUokm7KGfwVXraGqJcma+8SIOzcVlkeXBkQbySYaDL9lsekJw0Ogr9f12hhByzgNJtRoxheI=; 24:uK6LQBDdtjrp0TGOx+UWQ1EIvVtCnpRjC+jDaeavdVumHOq8oMx3vktGCdxyT1gUy4uKbrZkNN8NMnKx4qnfVbC18wjQ5lvguVZbfl8HARM=; 7:mykEdI1G25yDwJPSx7hJWjbfoJFfwnq2pquc45BOpgxC/ndxOr4MoccePU56w+/Jhd4a2M+AAGkBiFySGG15nmYgAK4F6uLSrGutaLOtTBID+cLcRWeIubexC1DUXRa7BO2rkwpTA1ed/FmFsGOk2sITUx8AKLFpw74sXEoHDTTLk6tjS9fCI/qLR77nZ0u/k7yKwEON5TT0e0zfgvnTlaNuexeOZjBRlZ6nEB2yQCV9u1bpl9LHBFUm40rauv9c SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 11:29:21.8408 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 896a84fe-3e18-45ed-b531-08d546d3c08c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB1923 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 d4a98d62ecbe..c026882bf9c7 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 3423dc51198b..518a2fe927f7 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);