From patchwork Tue Dec 19 11:28:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10123087 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 0FF1A6019C for ; Tue, 19 Dec 2017 11:29:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F2E229280 for ; Tue, 19 Dec 2017 11:29:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 041C7292A2; Tue, 19 Dec 2017 11:29:36 +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 967D029280 for ; Tue, 19 Dec 2017 11:29:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966980AbdLSL3e (ORCPT ); Tue, 19 Dec 2017 06:29:34 -0500 Received: from mail-by2nam03on0045.outbound.protection.outlook.com ([104.47.42.45]:64231 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965176AbdLSL33 (ORCPT ); Tue, 19 Dec 2017 06:29:29 -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=mcQGaxujfyBhBq/yiz2Ze9Q5QcI8FDB2JldnOUsLE+k=; b=zbLv891goiou0ebQO7/Zg0N6xrn00IShutfErm7/rix2ZeF7WRqBb5/r/F1inMOGFySB744KtyzAsHiqPNNrURmSdc2NoXgLPyjWXaqgW2jf6f+yEmpzEfp/LDiLZ0Ru9GvLXpRtOR7n7YiDcl1suAHvaWfLOkQwNxf2gzNCmNw= 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:22 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Avinash Patil Subject: [PATCH v2 05/10] qtnfmac: check for passed channel being NULL in MGMT_TX command Date: Tue, 19 Dec 2017 14:28:51 +0300 Message-Id: <20171219112856.22463-6-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: 3ca1398b-a5d6-4a29-7466-08d546d3c12c 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:nu1ULBduylBpi9uWThml6DoHhRivZzXRNWmYYjRMwnARra4RxyKKJb3gxUCdgJgjfKLHOrK/p1PP7BLuzc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Yu2srWfXl2BHXNhjgRnjfKSx0Cxsp9XEsg/l4caB/jB6Cy4PMZpsfqRUMmMtSy2R4aJjDcmuMU8orkgJwbiDgE/MHAUgAyfut2cgjQeX/ksAnlu0fXt5tiAqwp7B9w63JJOzWQt4GBlUyMXa4dk7mSc/+P17/+74VO2Z/O/Qo2lookTejpbtUIhZkuhUQbgV9/fJ+oLmZvn7sHQuWz2NjkLo1SlvRx2ZReRwbDXCoA9sLivmFYabd63uT3VF2sKrw/Dt44kWG1W4QoW+XprrTdTpatcIZ3lrogthtmdYCdNhHEArHQ; 4:pTTKFXeoOTmgTlvmEjMVwFovuw3aDq4frIyrLzFqMCBWb+IOaIK9W3CTWLHBdoAKVARQC02AYDNp2n7c0j/DH8jJZfVmtE4nZBNdwgmD9/O79mMfRtYmv4sw5kagh8WQrkFGlOOdVRpJJmtBcNBnZtZRWvm1tPcHfhIrQjGuO7QgLOX6W2IC10Jl40hkilbhJbcxyCPdElHisFj1HCaVlSoSkje8XZVDUtCgdbyqzBVpq54cwpT5yUslSJKjofmQokERjKGyPkpJPvFVYPCVzg== 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)(5660300001)(2950100002)(6666003)(6916009)(316002)(52116002)(76176011)(386003)(7696005)(97736004)(51416003)(16526018)(16586007)(107886003)(25786009)(575784001)(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:b/ic/oBDEALkBuwQPAcjWI+BT/MvsnudXnCDrSREb?= =?us-ascii?Q?/9D6WanFgMc/TRWS7Sx7JoJXh8SoePvR9Yah26jEWilVK+1RiV02w3Fcqavo?= =?us-ascii?Q?y/e+R85eMNpXbNopii0lEes+L7iOQIMiXii4R6+SVDOVvWSkL/HBvZsOeSNl?= =?us-ascii?Q?RWRwSu8p0yUiDbbOj1GjcSoFX3MJCdeDFjYDxX/cvJSR3tArwWE4WzFSDj0m?= =?us-ascii?Q?MxdLq9yq+JlXqqzC0/OJmvoO9NuO4UtSHI+8cm6o50jiqz+aqH2S/xyYFNTv?= =?us-ascii?Q?943Gm0RTJfgYFs5Yoq52iDUg4Sd3TTbSECb3JjPKqYnZL5Nw4AtGNlOSmzu9?= =?us-ascii?Q?movKKS83rnmtkezQ85cjMsiHwxS8KBy8960CzMMxgddFMgG18uNu414r69jS?= =?us-ascii?Q?2CifOABMB+tpimoagIwxrxDSk7o+NYv2cIeBlHeadym1GitaebaoA2V7YiHl?= =?us-ascii?Q?ApstG42/yJkAQixcRVPzaPs5CJRTbHqSTX5l+Bb0aNhc2f6BXxqHJ5PF3njw?= =?us-ascii?Q?+4w5d/c1EAbEfXRPDu5CwtFaiT1oQyjbuE/qR6itCfp6O9fOGMpHAzQzH59j?= =?us-ascii?Q?ws9oFbAyYI7i+in5WwCkerVE1GWPRTz7awq1/Jyc0T3jEUKPu40/GEc2LHwU?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PNZ7jvjLml3KTXg6W5LnbAIZ3dSigeNq5n3J6+qog=; 5:cGqos1db9hmUK8oZ++DMPbjMBHmqFUnQdQYGdxxixFwbK3xINIvc88y7ilmrXL8Bep31zwYn46y+xA3ETtzcWK0y5CZj9tUsfVEgRCvDoueLbBj8mIz6tbv7kNRt8BNFpBPgKf1WwS/QERrcqy+iCtNmKIGqxpYFuxiLh23nudc=; 24:UFLJDBYUoT5RGB0daABq3qqQ6gDFzQpqWntWqetSxSRCrh1vEUOWlVuwOPOa3TnfpmaUEQQWLlwphSEK4YBC2qyLARPNZZ1GdN7OkHJ1qdw=; 7:3PjPAO0uML4nAUPNtFsC6W+EVo+Vx2Ln0Yii9zhX76tMvhINLRTe4n+C5Y6Zfv+ZUfBlP00fu9xTvcz3mHVLukKGXMziz3VSG/9EfzDvztgOwUIi3j/vMol/wSK/xMFmw8Rn4TzV9mzRUNBKklD4LNr8V+begjM5+Y+xw8qYC9mtsSI4QCmcAE2bUwI5M6eIuGcd8zB8qJ3JYJFrggyREE608HzWw+DBo+jZuEtJctBAISU6ifeI3d9N7hH+ZTHz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Dec 2017 11:29:22.8877 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ca1398b-a5d6-4a29-7466-08d546d3c12c 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 Parameters passed into .mgmt_tx callback may have a NULL channel in case userspace wants to send a frame on current channel. Make sure this case is handled, pass "freq==0" in case channel is not specififed to tell wlan device to use current channel. Signed-off-by: Igor Mitsyanko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index c026882bf9c7..be15d0ed362c 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -381,6 +381,7 @@ qtnf_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, const struct ieee80211_mgmt *mgmt_frame = (void *)params->buf; u32 short_cookie = prandom_u32(); u16 flags = 0; + u16 freq; *cookie = short_cookie; @@ -393,13 +394,21 @@ qtnf_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev, if (params->dont_wait_for_ack) flags |= QLINK_MGMT_FRAME_TX_FLAG_ACK_NOWAIT; + /* If channel is not specified, pass "freq = 0" to tell device + * firmware to use current channel. + */ + if (params->chan) + freq = params->chan->center_freq; + else + freq = 0; + pr_debug("%s freq:%u; FC:%.4X; DA:%pM; len:%zu; C:%.8X; FL:%.4X\n", - wdev->netdev->name, params->chan->center_freq, + wdev->netdev->name, freq, le16_to_cpu(mgmt_frame->frame_control), mgmt_frame->da, params->len, short_cookie, flags); return qtnf_cmd_send_mgmt_frame(vif, short_cookie, flags, - params->chan->center_freq, + freq, params->buf, params->len); }