From patchwork Wed Nov 13 11:06:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241691 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC5921515 for ; Wed, 13 Nov 2019 11:07:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2EFD222BD for ; Wed, 13 Nov 2019 11:07:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="i/cvI/nX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727749AbfKMLHc (ORCPT ); Wed, 13 Nov 2019 06:07:32 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:17430 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfKMLHb (ORCPT ); Wed, 13 Nov 2019 06:07:31 -0500 Received: from pps.filterd (m0048106.ppops.net [127.0.0.1]) by mx0a-00183b01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xADB6PKn012523 for ; Wed, 13 Nov 2019 04:07:30 -0700 Received: from nam05-co1-obe.outbound.protection.outlook.com (mail-co1nam05lp2053.outbound.protection.outlook.com [104.47.48.53]) by mx0a-00183b01.pphosted.com with ESMTP id 2w7pt7m9bs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FSpdvtbetSTWhoPMYLZGhPqEWmZ6Fx16y2V5gDteryTaTgDjZs1WwH9U31xB9YCz+xc7vfz6kEDQXz/BZK/MkHkN5krGaEw9zRiyVIvyJ2qTwOTXN0XMTM/cqbhWtOn/C9DngmTSBNkWmWKZNeSug0fZQZRX8iGe1LW+8tRFZwKakQaAcP0a94SFMn619yXKbUuRVCrJNXZejaLZ2eZClhSJzMIKa5j5UCDASM5E5eausCp27QMlc6u1Wa4ssGOjOt1EVM6VW1m0tMDM10znr1osYZX2qaNd7UAe4eZT4bdCgospbMCiPUJ65guGTrmpSvPBjAvCVuBcnfL1Cc7chg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+w1rmwnrdANcVo4yw58rMc8Lkt3Cf1iEdH29ntpvYro=; b=JqZ09WKkZICAmYEjaWQBhj9m8mv1doSxZE8fg4KiNeqTM63985rzpz6RLx5xnNLQ309unjw3rpRZWP0ZfkhJ7XVQhzhRCg9ohGFwPsgDzxbnJDGYDskYH1vE+78wIbfRKFPHbii10s9LmRIDJbWuPzY4lBfgwnjZbHWKzvfMeiBkCHZNoqQZAPLjjuPWkWjgSpZBMiRcBEu0aqdV8w21MzRTqF1koH2rqZUdET4PGfD8hbilfuEGkJ4K2ayh1Ug8u+CQ4IjtMP1C5tEIq7bpA2+t/4oi5rhhByoOdM3fR+8TK22B4QmZZMeCF/vt//4ZWJ9x419jx+qLobEHq9DVRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+w1rmwnrdANcVo4yw58rMc8Lkt3Cf1iEdH29ntpvYro=; b=i/cvI/nXxEnXDkMk3Rd5ra+DZLPXwpNLIj+0DD8b+6hQM41uY+6owXmSCXfDO8EwoXngrtwdxnDiVhBmd0GtUyThJFSwOXEg6sR9miiGHRuXpeXTO04nAQAYTYCvuXIzEHECj5NgAY78+TbBqWCz7hfbHkIuMNmL/CYlGYdOvO0= Received: from BN6PR05MB3316.namprd05.prod.outlook.com (10.174.95.138) by BN6PR05MB3186.namprd05.prod.outlook.com (10.172.146.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2474.7; Wed, 13 Nov 2019 11:07:29 +0000 Received: from BN6PR05MB3316.namprd05.prod.outlook.com ([fe80::8cd6:2f36:a9a8:292f]) by BN6PR05MB3316.namprd05.prod.outlook.com ([fe80::8cd6:2f36:a9a8:292f%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:07:28 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5789.namprd05.prod.outlook.com (20.178.7.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:06:47 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:06:47 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 1/7] qtnfmac: fix using skb after free Thread-Topic: [PATCH 1/7] qtnfmac: fix using skb after free Thread-Index: AQHVmhJxxthIf+xvJkqR9oCrSfPpeQ== Date: Wed, 13 Nov 2019 11:06:47 +0000 Message-ID: <20191113110639.9226-2-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 93d6a383-dac2-445c-1636-08d768299375 x-ms-traffictypediagnostic: SN6PR05MB5789:|BN6PR05MB3186: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:25 AM x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39830400003)(366004)(136003)(346002)(396003)(199004)(189003)(486006)(2616005)(102836004)(76176011)(5660300002)(186003)(6506007)(2501003)(446003)(11346002)(36756003)(436003)(1076003)(476003)(86362001)(52116002)(26005)(66446008)(66066001)(66946007)(386003)(64756008)(66556008)(66476007)(478600001)(14454004)(6116002)(6486002)(54906003)(107886003)(99286004)(6916009)(71190400001)(71200400001)(5640700003)(3846002)(8676002)(81166006)(25786009)(103116003)(316002)(6436002)(81156014)(305945005)(7736002)(4326008)(50226002)(6512007)(2351001)(256004)(2906002)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR05MB3186;H:BN6PR05MB3316.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1DvZHfK1PhEO3+r9N2sITiZkvM49AtpKME7x9UU5+qxm0m23h6dVoGkKL/AinPnWvooq+5ZwHEPVcVOGRel+9rGu+DdkF1xExnyZhTKqhH7QjBAto3NhxDPbWbJ4rEuNEWtFY7S0+Ehl0iwk7/8r80B3Ic1QFHLip3jPr2hjlwTwgQJN6Mms6eC3nu7FeajtUWIxMeUr0uKF/hcdNUV67QWP9EZzgOzEo+j2eMc6Kmdp6iKP6ImxHMZYKjqBy1Tyycg3EsjSimdNCQsmOsd1qkBetf0BdRZLinNnGUdpqGk7EaO4QWl95rk2/B6MuFHc6ns8apV6mCYCcY60zdYT+Ddz44xGauSLfLA6AY8Ib21kAlmEfm0OSAMwxUjM2WEnB6WWks2hfPJG5UxNCXsZwoMyPzdp4LLUEm6hrVRcqpoUWjQseTIku5P4ehq7ZPQ4 MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93d6a383-dac2-445c-1636-08d768299375 X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: FVlMSShtyDq5+ATTyyi0qGsbCqf4jhK9IwHcyyvBJ/3fOxouF3PoNhKNe2MsN9gfgfi9houLfHMbQIy07BmOyde1f4XYD5V5KNrrfJecP8AtB4EjRCtWkJMynUBrtZZBEFLtSeCaL1FkAHeqQzgKO12l3zvtjwEaa7TU/4DVHXnBfma3Kso6gSUzy4WswXykTGBP1AV5mN2JCC/vDSKg4k8nJukpNDRe28VZqFiFLyc= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:28.1453 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR05MB3186 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 phishscore=0 mlxlogscore=811 malwarescore=0 adultscore=0 clxscore=1015 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911130105 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org KASAN reported use-after-free error: [ 995.220767] BUG: KASAN: use-after-free in qtnf_cmd_send_with_reply+0x169/0x3e0 [qtnfmac] [ 995.221098] Read of size 2 at addr ffff888213d1ded0 by task kworker/1:1/71 The issue in qtnf_cmd_send_with_reply impacts all the commands that do not need response other then return code. For such commands, consume_skb is used for response skb and right after that return code in response skb is accessed. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/commands.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index dc0c7244b60e..c0c32805fb8d 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -83,6 +83,7 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, struct qlink_cmd *cmd; struct qlink_resp *resp = NULL; struct sk_buff *resp_skb = NULL; + int resp_res = 0; u16 cmd_id; u8 mac_id; u8 vif_id; @@ -113,6 +114,7 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, } resp = (struct qlink_resp *)resp_skb->data; + resp_res = le16_to_cpu(resp->result); ret = qtnf_cmd_check_reply_header(resp, cmd_id, mac_id, vif_id, const_resp_size); if (ret) @@ -128,8 +130,8 @@ static int qtnf_cmd_send_with_reply(struct qtnf_bus *bus, else consume_skb(resp_skb); - if (!ret && resp) - return qtnf_cmd_resp_result_decode(le16_to_cpu(resp->result)); + if (!ret) + return qtnf_cmd_resp_result_decode(resp_res); pr_warn("VIF%u.%u: cmd 0x%.4X failed: %d\n", mac_id, vif_id, cmd_id, ret); From patchwork Wed Nov 13 11:06:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241687 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AE0B14E5 for ; Wed, 13 Nov 2019 11:07:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0314A222C1 for ; Wed, 13 Nov 2019 11:07:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="iTjdtD0o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727722AbfKMLH2 (ORCPT ); Wed, 13 Nov 2019 06:07:28 -0500 Received: from mx0b-00183b01.pphosted.com ([67.231.157.42]:55360 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726165AbfKMLH1 (ORCPT ); Wed, 13 Nov 2019 06:07:27 -0500 Received: from pps.filterd (m0059811.ppops.net [127.0.0.1]) by mx0b-00183b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xADB5OX4007583 for ; Wed, 13 Nov 2019 04:07:26 -0700 Received: from nam01-bn3-obe.outbound.protection.outlook.com (mail-bn3nam01lp2059.outbound.protection.outlook.com [104.47.33.59]) by mx0b-00183b01.pphosted.com with ESMTP id 2w7psq3cur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sj2RjH0XAZTuQmENTkr9fqm0u1WSdkfPaix0FZgEuv7uEKBxrYqBM1WDJUL07vz9q9y0/dEA5mWmc/vkMh8uN42P9T3R7KxTGfz6S5xKQZD6l3y4TzpYVA/jS8Gp9wiyrDYNx1pJhLcmRsMlsm/BkTOR6Z3sBUrCkV4E06Rjz2ir6vYETUzDLwsPkmX8zcznMWISUZYWgsra16UW11Ckr7s0I6KyL0Ozdtv8Rztz6XSV9SM3vaQgebdEZVETTXy31IzldjiyGTn5UAt/XjFa12sNO07VOStrf1fmA9siX2IEeZ/WGC3yMPIICXdOUMg9NNoRPLIjs4HBuYX6/JtdqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q4zsj20ZuNk3B5KRgHgNJ4U3awY1Pm9COwDLkd15m8o=; b=W+nlMtKwZbNK4p21PkmbxreI20VN0gOPiqKaG4pl0t2RMcIR7lCXC+dX3xsRX7dc6BVqCEnnZbok/Q5rRbZ0rdtuGd/08n9CC/ygLU5fDqMC/9olF3iD5wQINUrlxHjl4YLtttvA9S7J7V5RGWW+r5r66m/S1sw6MaxBF3fjpXDo3lmCUuZaT1J7bO7wvFvht2yETY1S6aFXeQ7NxpK7oTtM3YIiF2TKgYG2pDqg6ZnDwp3dCByunuewggVvu1VwITyY7gy4GplPNu9yVE/MBJWXfF4G1+fQA9uliHtJjs9TWI/IxrC2rsk9r1nlPpDdyltBB6WTUJbIL8RhzUkPuw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q4zsj20ZuNk3B5KRgHgNJ4U3awY1Pm9COwDLkd15m8o=; b=iTjdtD0oS0cQWhi5901FDaBpYrNnxVt2GercPgZ/XyMwy++9ADjHoUIYFD9dns7DBRZWwzG+ymMzvk8KzsRjOW06eX9m1tPQMn1rqgQOnEm8hfK4eS6SoetQCjDOiLWX05eeyylQJ6H9efeOfOlN0wHCgMI0W131CioXV7TNCcM= Received: from BL0PR05MB5250.namprd05.prod.outlook.com (20.177.242.33) by BL0PR05MB5586.namprd05.prod.outlook.com (10.167.234.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.18; Wed, 13 Nov 2019 11:07:24 +0000 Received: from BL0PR05MB5250.namprd05.prod.outlook.com ([fe80::ed7b:2348:5c70:1c84]) by BL0PR05MB5250.namprd05.prod.outlook.com ([fe80::ed7b:2348:5c70:1c84%4]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:07:24 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5789.namprd05.prod.outlook.com (20.178.7.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:06:50 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:06:49 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 2/7] qtnfmac: fix debugfs support for multiple cards Thread-Topic: [PATCH 2/7] qtnfmac: fix debugfs support for multiple cards Thread-Index: AQHVmhJyUSs/Ct9jK0S6pSz5L8/Oug== Date: Wed, 13 Nov 2019 11:06:49 +0000 Message-ID: <20191113110639.9226-3-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 53305c35-5389-444b-3275-08d7682994bc x-ms-traffictypediagnostic: SN6PR05MB5789:|BL0PR05MB5586: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:22 AM x-ms-oob-tlc-oobclassifiers: OLM:49; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(346002)(136003)(396003)(39850400004)(199004)(189003)(6506007)(66446008)(64756008)(14444005)(2616005)(256004)(76176011)(305945005)(71200400001)(436003)(6116002)(86362001)(386003)(52116002)(7736002)(102836004)(2351001)(3846002)(5024004)(66556008)(71190400001)(2501003)(103116003)(186003)(486006)(446003)(11346002)(6916009)(476003)(26005)(66476007)(81156014)(81166006)(478600001)(8676002)(99286004)(6486002)(2906002)(14454004)(1076003)(4326008)(54906003)(36756003)(5640700003)(316002)(50226002)(66946007)(8936002)(6512007)(25786009)(66066001)(107886003)(5660300002)(6436002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR05MB5586;H:BL0PR05MB5250.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: we8tQUHSlKYyRKLHYVKDXatslbkYwglWdx82Z/0eXwlto++bqgkKPfIFQ2Eozd9+Q/8sXgxf9WQCEpr+cltj6p0OsUetRm+vgssMZOBe+7duSq/g/mwSlL4MvyKpw0KlOTlz5GBCq8H7TrCl2jwfJpP0lER13KXNwPiMP+m3jGjSKsa8o8L4c8OPxDWVDjM2WmPRi1Ma3gG9mVW6Rit9A1gM6LOKNlktr8YpaRoLcFUScuIF2n1fuWKDFo4LRwGzxqlzDSILUdWSAbLzv7d6fzX7ag0SDJ/aRWTLit8RR9utdB6Uu+iLSX8nZpmZ47InUdLMfc40kAE7FpwMK15oxhnO7KIrNWr4uNHqRrfr2ViTtiBuBeAwWpQwp6gVl4nfNgM9kPXtEo3VE88lXXuClAPRWry8Bvb34NeR7zzsxbpwylRktFgSr9lSSKd5cQ85 MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 53305c35-5389-444b-3275-08d7682994bc X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 03Jv7SdScyS0lD8MUsBcDv7Fwk3QjsMrTC/ruJcJ7WEqj21J93GAUCc21DCNTzv/fpulpZ9YpCAOQyZ/Dvi4EUduNT9M1in+yjRV7rXXkEwH9Zj1eQ/GAk0KPg9+jEuyuL6BCzH8LAlonjOLeJpJV5jfP/zr5N0DhGkh8HaKpWqHxpNQ2REMJMnvpQud4g+mFJE93owrDuITc+apaEZRWoTfIOm6qERlqvAuze1N73Y= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:24.5024 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR05MB5586 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 mlxscore=0 clxscore=1015 phishscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911130105 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Fix merge artifact for commit 0b68fe10b8e8 ("qtnfmac: modify debugfs to support multiple cards") and finally add debugfs support for multiple qtnfmac wireless cards. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c index 8ae318b5fe54..4824be0c6231 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c @@ -130,6 +130,8 @@ static int qtnf_dbg_shm_stats(struct seq_file *s, void *data) int qtnf_pcie_fw_boot_done(struct qtnf_bus *bus) { + struct qtnf_pcie_bus_priv *priv = get_bus_priv(bus); + char card_id[64]; int ret; bus->fw_state = QTNF_FW_STATE_BOOT_DONE; @@ -137,7 +139,9 @@ int qtnf_pcie_fw_boot_done(struct qtnf_bus *bus) if (ret) { pr_err("failed to attach core\n"); } else { - qtnf_debugfs_init(bus, DRV_NAME); + snprintf(card_id, sizeof(card_id), "%s:%s", + DRV_NAME, pci_name(priv->pdev)); + qtnf_debugfs_init(bus, card_id); qtnf_debugfs_add_entry(bus, "mps", qtnf_dbg_mps_show); qtnf_debugfs_add_entry(bus, "msi_enabled", qtnf_dbg_msi_show); qtnf_debugfs_add_entry(bus, "shm_stats", qtnf_dbg_shm_stats); From patchwork Wed Nov 13 11:06:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241689 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37F5E14E5 for ; Wed, 13 Nov 2019 11:07:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F5A7222C1 for ; Wed, 13 Nov 2019 11:07:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="Ez+ddsz2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727734AbfKMLH3 (ORCPT ); Wed, 13 Nov 2019 06:07:29 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:25208 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726165AbfKMLH3 (ORCPT ); Wed, 13 Nov 2019 06:07:29 -0500 Received: from pps.filterd (m0059812.ppops.net [127.0.0.1]) by m0059812.ppops.net (8.16.0.42/8.16.0.42) with SMTP id xADB6RLM011870 for ; Wed, 13 Nov 2019 04:07:28 -0700 Received: from nam03-dm3-obe.outbound.protection.outlook.com (mail-dm3nam03lp2056.outbound.protection.outlook.com [104.47.41.56]) by m0059812.ppops.net with ESMTP id 2w7pst45e6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:28 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TAqz2Rq65vkQi9vmSGbgFMqiWqsAi7WqaYGxSPOHmDyRfcF8fB7av5277/orDKrPSBxGVbWyRfvr17JCSVqyiTbPVSk1O+0a3U8jyDmbWCJp/aMajU8Es8o9ejigu1mDaVbK9bu7sj3P7GIFil25tjaAIhDAv7+ga3Uw3xxU4p3XpN/bfP9JgXKEwrvyjeczfQPxAtafC9Z9oJJ1mfa1vppQ/KP/cXg8SXANwNcpvw1Wsc/AvcWlNvPTWAofwd7x3NlaJ7RQCSYUw2I3dj7D8BVnuKiUrizv0CzKqC94dssWiREBHCt/AMSu2lw/vJGzl5dRYkh3KdaAwI9m575zTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vg+Gnd8bGvtllOvvsLWOzKseLueYChQAV26aDdQafs8=; b=CF02bAjzGb+sSHEDB6MIUpKjoapJbQTQv3V4wCPd9YqzPp1bl3w5oWUKx5Jj0r/h8GLIOHQPwzYezy6nKRX/hyt5mvjlmTew+ME+O6nfTWrC0MPyT0So1ivtS+uKaCLg4NEoT0jGKkxoVb2ncQI1Nk1WGyB6mu0M0j2ioGyKwgCA34JtQCeFFzAGd7wj9/5e+Y/B1PCg/MtN5+OX1R/dabzUo2FQQ7OIikR4yqcOvA2vYWM6beJd/pUICiAdkOMw5P/CaXKH7lwbz8WsOl2DmtLO1UbfeefdGFx4ejV80G9zLdnXDrVlmtLnI6l79nexaSBLICPPW42QGbcmMX0Emw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vg+Gnd8bGvtllOvvsLWOzKseLueYChQAV26aDdQafs8=; b=Ez+ddsz2nc+oHpsB4pyifNNdc2ja/kPWx97wfJ1K1LvLW/VlQFATHq9VSJnwfj/Vrf7Wraj+A60RRDZJuULMBjbSE3HI8eJqsnutCuq1gv+9Bd+cOPuW3jyB+LXcLUFmP7KWqgBsXgX0k9U0eshgIM/pAQdP3XNdNLE7DAenfH4= Received: from CH2PR05MB6966.namprd05.prod.outlook.com (10.186.148.95) by CH2PR05MB7078.namprd05.prod.outlook.com (10.186.149.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.15; Wed, 13 Nov 2019 11:07:26 +0000 Received: from CH2PR05MB6966.namprd05.prod.outlook.com ([fe80::8ca6:eff6:b34d:49da]) by CH2PR05MB6966.namprd05.prod.outlook.com ([fe80::8ca6:eff6:b34d:49da%6]) with mapi id 15.20.2451.018; Wed, 13 Nov 2019 11:07:26 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5789.namprd05.prod.outlook.com (20.178.7.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:06:52 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:06:52 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 3/7] qtnfmac: fix invalid channel information output Thread-Topic: [PATCH 3/7] qtnfmac: fix invalid channel information output Thread-Index: AQHVmhJzatQV28nWRkCzGr5RyHMlZA== Date: Wed, 13 Nov 2019 11:06:51 +0000 Message-ID: <20191113110639.9226-4-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 828cce2f-3f6f-4c97-7ada-08d7682995f8 x-ms-traffictypediagnostic: SN6PR05MB5789:|CH2PR05MB7078: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:24 AM x-ms-oob-tlc-oobclassifiers: OLM:605; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39830400003)(376002)(366004)(346002)(396003)(136003)(199004)(189003)(76176011)(5660300002)(478600001)(446003)(2616005)(11346002)(71190400001)(6512007)(486006)(476003)(2501003)(81166006)(4326008)(81156014)(256004)(71200400001)(8936002)(305945005)(7736002)(107886003)(14454004)(6486002)(8676002)(6916009)(316002)(6116002)(66476007)(3846002)(66556008)(5640700003)(66446008)(64756008)(103116003)(26005)(386003)(25786009)(436003)(36756003)(50226002)(186003)(2351001)(52116002)(2906002)(86362001)(54906003)(6436002)(99286004)(66066001)(6506007)(1076003)(66946007)(102836004);DIR:OUT;SFP:1101;SCL:1;SRVR:CH2PR05MB7078;H:CH2PR05MB6966.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SrkE9pePverRbwdJe81F8jvUVCiM79EFzp1Tm1RsrQZRFHtOpQ7NbOXEy4MHakxuqjY/bfR7yPIJfBmubEDr5onTNi+JUE6xmlwHsZklLpHBYOkL6Bm6kO2tHFXsRHjSn66ST1mZCkMjHJMtNuYI9IUaqmmrj8+HTnvx8uZbmJfzw7W6+WUg4nQ4M7YD8OXuKeLWs/QjSssv2Z4ccus0bMa7naaKTFiFGqdVlaZB9pS7kJA2XV9e+smSCqabxQzuf4rg8Ef8CnwTYByHbPp8Pkngdxx0rBh5rYx21CeCeljIoeUgmJ/4D8lfBX74k3+UcNuY59bP2AkqgnlNFMCx9y/kafdnx5YmGA0LeSEZjng/Y6iXCMqat4Zr6MnBZ137drUleTbaMny3t7VQyFIfJWAKgPfWGRiq86d+Dc+anaW/oD1LnvxUMWaya15bWaD+ MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: 828cce2f-3f6f-4c97-7ada-08d7682995f8 X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cF+5Zbe34BbZbTGTG9a5UnCzLt1fBL3/+7fAAimNWaaF3336uwV8XEfDfYrEhg3K5p/+xm7bQbljxDEUe/4s3ypSNY8HYWJsGq2e3B1nHatWo57Lk9EnQUwaMkDC6MydMWGES4tHH0JyCzvLE1pBcfdHJxXK1SBiiic8b8GCyoAgs8Sq1rN6x8SlR+/s2XUapF4TJndEYByDw8nGT+3DfhMQvjuxztH33vr93YVFRkk= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:26.4164 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR05MB7078 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 impostorscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911130105 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Do not attempt to print frequency for an invalid channel provided by firmware. That channel may simply not exist. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/event.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index b57c8c18a8d0..7846383c8828 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -171,8 +171,9 @@ qtnf_event_handle_bss_join(struct qtnf_vif *vif, return -EPROTO; } - pr_debug("VIF%u.%u: BSSID:%pM status:%u\n", - vif->mac->macid, vif->vifid, join_info->bssid, status); + pr_debug("VIF%u.%u: BSSID:%pM chan:%u status:%u\n", + vif->mac->macid, vif->vifid, join_info->bssid, + le16_to_cpu(join_info->chan.chan.center_freq), status); if (status != WLAN_STATUS_SUCCESS) goto done; @@ -181,7 +182,7 @@ qtnf_event_handle_bss_join(struct qtnf_vif *vif, 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.chan ? chandef.chan->center_freq : 0, chandef.center_freq1, chandef.center_freq2, chandef.width); From patchwork Wed Nov 13 11:06:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241693 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C49F61515 for ; Wed, 13 Nov 2019 11:07:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95A0B222C1 for ; Wed, 13 Nov 2019 11:07:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="llnOmDZd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727756AbfKMLHd (ORCPT ); Wed, 13 Nov 2019 06:07:33 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:63394 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727736AbfKMLHc (ORCPT ); Wed, 13 Nov 2019 06:07:32 -0500 Received: from pps.filterd (m0059812.ppops.net [127.0.0.1]) by m0059812.ppops.net (8.16.0.42/8.16.0.42) with SMTP id xADB6RLN011870 for ; Wed, 13 Nov 2019 04:07:31 -0700 Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2056.outbound.protection.outlook.com [104.47.36.56]) by m0059812.ppops.net with ESMTP id 2w7pst45e9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:31 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BZQJe/P7R0iT92ta3U0weM8T0xXbod97L2ZCmeYLMbzKupA3GCJWD/rapS+PRENuJXGpsMPD/eszqVuOGJjpOM9chPXjuF7kh0mMoxHEP+HFaUcL3TV4t3kl5kdISraC0VGK7nYpRKbTXlxOK2kAb6O20lIgvNDN9LP+sHIsUtzrCP/MeI9+MY3ZH/u2kERXK9UEUA5Y/J5PWAjcS+eZQ7dSt3wLeDkMWt/h71ugbg4TPaqbTNFz6WAmBz05uzwqQo/jgOpsf2xH8sZeD4JG4LMb5tuhrea8+V/rAFiEOIyrLILCkhMOzf8MJeGqwc3q3bvB99YmpL0/1ex6+bJR8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ffX+tlSZuG/n1ByofijnjCptoFClPY9QfK4cHjdCQpM=; b=CE349Mteexm9MVhdDa6nvmpNtbF3AI7mJWMk8E9321WwFcPUCZxBSMS+jYVixSHwUslWumcWeZtexpq+EgV1/uXZte+Rz/LedRMD363+C4vZKylGGKXVeHi3E7LSjkZuuoEa9mFnwe1JIvWPbfoaHtN/k8JR+/2cgZYoBfPEgSFwB/ywhRVjfD7HD7dRpoDJs8y5OLp8K2g/RhHXJPBvxTxuNSOfMT9KcFcGLedtk3+VKRqgDiOoycJu5hJw2s1dNZtGMBgR29znOyGeHAcclUeg5858O7mE5sjjUVx66Yw8TIlGtfS5alZwvP57pya+E+/1GZIUhJlfhl25iECORw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ffX+tlSZuG/n1ByofijnjCptoFClPY9QfK4cHjdCQpM=; b=llnOmDZd6MXI0bn52QD+wk0TkvoOMhAC+2NfIM0Hue/9SxptTObRlEax1ErriKcCgxWH1K/mI7RI8gNETAW9pujY73RcNP591uiFmGajM1ny7wjZcY5SMm0EFrQv9Klb31BnTagBUUKXW4l8MvpOB8v7QWueGRkdZqj7c1UgXxs= Received: from BN7PR05MB4211.namprd05.prod.outlook.com (52.132.6.160) by BN7PR05MB4404.namprd05.prod.outlook.com (52.133.220.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.16; Wed, 13 Nov 2019 11:07:29 +0000 Received: from BN7PR05MB4211.namprd05.prod.outlook.com ([fe80::248c:f458:3b48:d65e]) by BN7PR05MB4211.namprd05.prod.outlook.com ([fe80::248c:f458:3b48:d65e%6]) with mapi id 15.20.2451.018; Wed, 13 Nov 2019 11:07:29 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5295.namprd05.prod.outlook.com (52.135.109.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:06:54 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:06:54 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 4/7] qtnfmac: modify Rx descriptors queue setup Thread-Topic: [PATCH 4/7] qtnfmac: modify Rx descriptors queue setup Thread-Index: AQHVmhJ0spEq1MUuyUe1jBucSSdR4w== Date: Wed, 13 Nov 2019 11:06:53 +0000 Message-ID: <20191113110639.9226-5-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b6d65416-6349-4de0-4203-08d768299728 x-ms-traffictypediagnostic: SN6PR05MB5295:|BN7PR05MB4404: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:27 AM x-ms-oob-tlc-oobclassifiers: OLM:3276; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(366004)(396003)(136003)(39850400004)(189003)(199004)(102836004)(103116003)(66946007)(305945005)(107886003)(66476007)(2501003)(486006)(436003)(76176011)(66556008)(64756008)(99286004)(6512007)(52116002)(478600001)(2351001)(8936002)(256004)(14444005)(66446008)(8676002)(86362001)(71190400001)(71200400001)(7736002)(25786009)(66066001)(50226002)(6916009)(4326008)(81166006)(81156014)(5640700003)(6436002)(6506007)(11346002)(6486002)(3846002)(316002)(5660300002)(26005)(186003)(2616005)(446003)(54906003)(1076003)(6116002)(2906002)(386003)(476003)(14454004)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR05MB4404;H:BN7PR05MB4211.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HIx4E5KOm5iAC+yKU7mqzi66DxkvpIBHww240T8iuNb08yQO1c1py1tuw6SEnY0im2Za6yKQteeM3zb8Dxh/9AE/jNCMW2AMAVHvM+AppLnOr79HcBy5eQu4QAPBPeP+eMsJg5kqPc4jXXc3mkG9q1PjWhzApGJbDgUxVmlHN95wsXoI7jPQGuH3wJYV8f4igHysnZDs627J41gNH+jGomI+RmmxG5/itbcUyWdxRWIE00d8Ctd/FnrkS90rdzPpZCnyv+rEqgtGrp5QRnkTm7phtr0YfqakBbT3Uci5wzR3Clh+8Kaz2aCPmGY3fcrx0gGuCroP/ndGzLeWb2l9imKIH1HQ6fJZw8Cb/QEvpYEjqLJiyms67yw0cRdhejVJ9cm7gA5MjnVpaZBt1CA2b9dwYasUsib5BEs5QiQ2k2TlhC0J2dko9roi2q7XozS0 MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6d65416-6349-4de0-4203-08d768299728 X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QeWDlu/GuYpZJ4yidOzwUmbuCScnHiNvNQGHtW+KR6bkH29iIk53AcdgvMihoa5O7YN/9mOXRxlbwDoWpOg3hcXVYl9Dn9yE0wQ3OgFIp2nD6Iuh53F7bgR96p7mYSj+At7BEz+a+IkUlgDU4o0YODoZTh//lw5qQmvvvBXsEbCUAy15OmZYlQEDuc5XityZqXB+mxM+szI89S26AUCTW3hknF5ZYYPy0VYJAQqqyF0= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:29.3717 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR05MB4404 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Rx descriptors queue length is hardware specific. Current common default value is no more than an accident. So move Rx descriptor queue setup to platform PCIe backend in the same way as it is already done for Tx. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c | 5 ++- .../wireless/quantenna/qtnfmac/pcie/pcie_priv.h | 3 +- .../wireless/quantenna/qtnfmac/pcie/pearl_pcie.c | 36 ++++++++++++---------- .../wireless/quantenna/qtnfmac/pcie/topaz_pcie.c | 20 ++++++++++-- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c index 4824be0c6231..3360b836fc44 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c @@ -33,7 +33,7 @@ static unsigned int tx_bd_size_param; module_param(tx_bd_size_param, uint, 0644); MODULE_PARM_DESC(tx_bd_size_param, "Tx descriptors queue size"); -static unsigned int rx_bd_size_param = 256; +static unsigned int rx_bd_size_param; module_param(rx_bd_size_param, uint, 0644); MODULE_PARM_DESC(rx_bd_size_param, "Rx descriptors queue size"); @@ -341,7 +341,6 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) bus->fw_state = QTNF_FW_STATE_DETACHED; pcie_priv->pdev = pdev; pcie_priv->tx_stopped = 0; - pcie_priv->rx_bd_num = rx_bd_size_param; pcie_priv->flashboot = flashboot; if (fw_blksize_param > QTN_PCIE_MAX_FW_BUFSZ) @@ -381,7 +380,7 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) pcie_priv->epmem_bar = epmem_bar; pci_save_state(pdev); - ret = pcie_priv->probe_cb(bus, tx_bd_size_param); + ret = pcie_priv->probe_cb(bus, tx_bd_size_param, rx_bd_size_param); if (ret) goto error; diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h index 5e8b9cb68419..8bc4300518d0 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h @@ -23,7 +23,8 @@ struct qtnf_pcie_bus_priv { struct pci_dev *pdev; - int (*probe_cb)(struct qtnf_bus *bus, unsigned int tx_bd_size); + int (*probe_cb)(struct qtnf_bus *bus, unsigned int tx_bd_size, + unsigned int rx_bd_size); void (*remove_cb)(struct qtnf_bus *bus); int (*suspend_cb)(struct qtnf_bus *bus); int (*resume_cb)(struct qtnf_bus *bus); diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c index 5ec1c9bc1612..a501a1fd5332 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c @@ -24,6 +24,7 @@ #include "debug.h" #define PEARL_TX_BD_SIZE_DEFAULT 32 +#define PEARL_RX_BD_SIZE_DEFAULT 256 struct qtnf_pearl_bda { __le16 bda_len; @@ -397,7 +398,8 @@ static int pearl_hhbm_init(struct qtnf_pcie_pearl_state *ps) } static int qtnf_pcie_pearl_init_xfer(struct qtnf_pcie_pearl_state *ps, - unsigned int tx_bd_size) + unsigned int tx_bd_size, + unsigned int rx_bd_size) { struct qtnf_pcie_bus_priv *priv = &ps->base; int ret; @@ -409,28 +411,29 @@ static int qtnf_pcie_pearl_init_xfer(struct qtnf_pcie_pearl_state *ps, val = tx_bd_size * sizeof(struct qtnf_pearl_tx_bd); if (!is_power_of_2(tx_bd_size) || val > PCIE_HHBM_MAX_SIZE) { - pr_warn("bad tx_bd_size value %u\n", tx_bd_size); + pr_warn("invalid tx_bd_size value %u, use default %u\n", + tx_bd_size, PEARL_TX_BD_SIZE_DEFAULT); priv->tx_bd_num = PEARL_TX_BD_SIZE_DEFAULT; } else { priv->tx_bd_num = tx_bd_size; } - priv->rx_bd_w_index = 0; - priv->rx_bd_r_index = 0; + if (rx_bd_size == 0) + rx_bd_size = PEARL_RX_BD_SIZE_DEFAULT; - if (!priv->rx_bd_num || !is_power_of_2(priv->rx_bd_num)) { - pr_err("rx_bd_size_param %u is not power of two\n", - priv->rx_bd_num); - return -EINVAL; - } + val = rx_bd_size * sizeof(dma_addr_t); - val = priv->rx_bd_num * sizeof(dma_addr_t); - if (val > PCIE_HHBM_MAX_SIZE) { - pr_err("rx_bd_size_param %u is too large\n", - priv->rx_bd_num); - return -EINVAL; + if (!is_power_of_2(rx_bd_size) || val > PCIE_HHBM_MAX_SIZE) { + pr_warn("invalid rx_bd_size value %u, use default %u\n", + rx_bd_size, PEARL_RX_BD_SIZE_DEFAULT); + priv->rx_bd_num = PEARL_RX_BD_SIZE_DEFAULT; + } else { + priv->rx_bd_num = rx_bd_size; } + priv->rx_bd_w_index = 0; + priv->rx_bd_r_index = 0; + ret = pearl_hhbm_init(ps); if (ret) { pr_err("failed to init h/w queues\n"); @@ -1064,7 +1067,8 @@ static u64 qtnf_pearl_dma_mask_get(void) #endif } -static int qtnf_pcie_pearl_probe(struct qtnf_bus *bus, unsigned int tx_bd_size) +static int qtnf_pcie_pearl_probe(struct qtnf_bus *bus, unsigned int tx_bd_size, + unsigned int rx_bd_size) { struct qtnf_shm_ipc_int ipc_int; struct qtnf_pcie_pearl_state *ps = get_bus_priv(bus); @@ -1079,7 +1083,7 @@ static int qtnf_pcie_pearl_probe(struct qtnf_bus *bus, unsigned int tx_bd_size) ps->bda = ps->base.epmem_bar; writel(ps->base.msi_enabled, &ps->bda->bda_rc_msi_enabled); - ret = qtnf_pcie_pearl_init_xfer(ps, tx_bd_size); + ret = qtnf_pcie_pearl_init_xfer(ps, tx_bd_size, rx_bd_size); if (ret) { pr_err("PCIE xfer init failed\n"); return ret; diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c index 1f91088e3dff..ef255fb57405 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c @@ -23,6 +23,7 @@ #include "debug.h" #define TOPAZ_TX_BD_SIZE_DEFAULT 128 +#define TOPAZ_RX_BD_SIZE_DEFAULT 256 struct qtnf_topaz_tx_bd { __le32 addr; @@ -331,7 +332,8 @@ static void qtnf_topaz_free_xfer_buffers(struct qtnf_pcie_topaz_state *ts) } static int qtnf_pcie_topaz_init_xfer(struct qtnf_pcie_topaz_state *ts, - unsigned int tx_bd_size) + unsigned int tx_bd_size, + unsigned int rx_bd_size) { struct qtnf_topaz_bda __iomem *bda = ts->bda; struct qtnf_pcie_bus_priv *priv = &ts->base; @@ -349,6 +351,17 @@ static int qtnf_pcie_topaz_init_xfer(struct qtnf_pcie_topaz_state *ts, priv->tx_bd_num = tx_bd_size; qtnf_non_posted_write(priv->tx_bd_num, &bda->bda_rc_tx_bd_num); + + if (rx_bd_size == 0) + rx_bd_size = TOPAZ_RX_BD_SIZE_DEFAULT; + + if (rx_bd_size > TOPAZ_RX_BD_SIZE_DEFAULT) { + pr_warn("RX BD queue cannot exceed %d\n", + TOPAZ_RX_BD_SIZE_DEFAULT); + rx_bd_size = TOPAZ_RX_BD_SIZE_DEFAULT; + } + + priv->rx_bd_num = rx_bd_size; qtnf_non_posted_write(priv->rx_bd_num, &bda->bda_rc_rx_bd_num); priv->rx_bd_w_index = 0; @@ -1111,7 +1124,8 @@ static u64 qtnf_topaz_dma_mask_get(void) return DMA_BIT_MASK(32); } -static int qtnf_pcie_topaz_probe(struct qtnf_bus *bus, unsigned int tx_bd_num) +static int qtnf_pcie_topaz_probe(struct qtnf_bus *bus, + unsigned int tx_bd_num, unsigned int rx_bd_num) { struct qtnf_pcie_topaz_state *ts = get_bus_priv(bus); struct pci_dev *pdev = ts->base.pdev; @@ -1145,7 +1159,7 @@ static int qtnf_pcie_topaz_probe(struct qtnf_bus *bus, unsigned int tx_bd_num) return ret; } - ret = qtnf_pcie_topaz_init_xfer(ts, tx_bd_num); + ret = qtnf_pcie_topaz_init_xfer(ts, tx_bd_num, rx_bd_num); if (ret) { pr_err("PCIE xfer init failed\n"); return ret; From patchwork Wed Nov 13 11:06:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241701 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E1E214E5 for ; Wed, 13 Nov 2019 11:07:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64BAE222C1 for ; Wed, 13 Nov 2019 11:07:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="InnLaHKE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727809AbfKMLHn (ORCPT ); Wed, 13 Nov 2019 06:07:43 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:46248 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbfKMLHn (ORCPT ); Wed, 13 Nov 2019 06:07:43 -0500 Received: from pps.filterd (m0048106.ppops.net [127.0.0.1]) by mx0a-00183b01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xADB6R1w012528 for ; Wed, 13 Nov 2019 04:07:42 -0700 Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2054.outbound.protection.outlook.com [104.47.36.54]) by mx0a-00183b01.pphosted.com with ESMTP id 2w7pt7m9c4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fue8aoSCrv+RVOjSErxJX4mbW9RgAR9GsVZ74VY4Tenxzqxqgs5VKYspT7Fp/EHMxx+HPIGma49wz4m4nY39vamflHx62uftuXJymr+uSBp3s7baIyYjibu8CMVuU6bonthcX5LlvqCNs3BsADtHH7Az1Oipl3X4irC4/c8z/Lo4LeqtSZH6fys2QrNx/chfbPXJOS4S78RrrdFDgZkBaCHF6+xUYvek2AIXlbWHdjo6UXDGf9zz5kdFnSI7OrNGxnUG6Wm1jjAuWUa9G1jfmcQqVutOtWAh/F4DE+DjFu3IUdSQmNpKt54Hn3ODPs0Kyc39Zp/PDdYn9Fp0A2XtRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uO2O1MgH8oyvycws5rp47XY/JJLmJcqsM/Y0s7jomFI=; b=BF+rA8DCV1DsmZI7fZBiLjOg5VVuYTSiDBgW1YQpn/2v/XMAGSR4ZrSpTHCPMEbcK94azSLY1C/212873ki4H+cvbWvZAcIuwx/IoPZDhYj2+jI7KZlOuO6QST8QhI7nn6cG8GYEq6cR1admRzQy7dqnaFwRQXjLgOB+/+/90tGm0TPd/cawx7Hu4TI3fiHPX6G09FptQHAjj6BJ1h4mkjXfsizyL+y4fEgMOgjqzQZdCnd4BM+RXFLJk4xzbd9CrzNlEk27CKyh+H9gd9orYFQyV8mnXlTautKfGOPOUpCpT4OXQDNYPJNyy2pCdQ5F4Bo/M0FuM7LFvpZchLBOIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uO2O1MgH8oyvycws5rp47XY/JJLmJcqsM/Y0s7jomFI=; b=InnLaHKE6rz5JkKWHqyy7ctAXG2Hu6roy2szYujtVGyGUSxbeM0DfncX3j5EaWGGm53Zu7Ny6Qb7YEC3fuvuVJ69b2eLrqIWMl3Ar2BJVJ8uuOeQrX0c3F5NKKV2EkfmhqES/GICFn2BgHIThapbqJYw7FW9KeHJ5NCcMLL1pNs= Received: from SN6PR05MB4496.namprd05.prod.outlook.com (52.135.74.149) by SN6PR05MB4781.namprd05.prod.outlook.com (52.135.115.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.21; Wed, 13 Nov 2019 11:07:40 +0000 Received: from SN6PR05MB4496.namprd05.prod.outlook.com ([fe80::fc6e:cad2:ffb3:22bb]) by SN6PR05MB4496.namprd05.prod.outlook.com ([fe80::fc6e:cad2:ffb3:22bb%7]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:07:40 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5295.namprd05.prod.outlook.com (52.135.109.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:06:56 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:06:56 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 5/7] qtnfmac: send EAPOL frames via control path Thread-Topic: [PATCH 5/7] qtnfmac: send EAPOL frames via control path Thread-Index: AQHVmhJ2MjnOC2xosUKtc48SE29I8g== Date: Wed, 13 Nov 2019 11:06:55 +0000 Message-ID: <20191113110639.9226-6-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c4ef726b-0f53-4888-1557-08d768299864 x-ms-traffictypediagnostic: SN6PR05MB5295:|SN6PR05MB4781: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:36 AM x-ms-oob-tlc-oobclassifiers: OLM:194; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(136003)(376002)(366004)(39830400003)(199004)(189003)(71190400001)(305945005)(64756008)(71200400001)(7736002)(2501003)(66556008)(103116003)(66476007)(76176011)(66946007)(2351001)(66066001)(99286004)(52116002)(81166006)(81156014)(8936002)(8676002)(6916009)(6506007)(386003)(6116002)(3846002)(50226002)(107886003)(66446008)(4326008)(2616005)(36756003)(436003)(486006)(476003)(11346002)(102836004)(26005)(14444005)(446003)(186003)(25786009)(54906003)(5660300002)(2906002)(316002)(6436002)(6486002)(478600001)(86362001)(14454004)(5640700003)(6512007)(1076003)(256004);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR05MB4781;H:SN6PR05MB4496.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: SjdS/Bt5jN1qa7e1qGSa4use36/zhz0M/73Q0MB1+Ly3JSqAuTWZ3v5MdZmh+jse8F5tWdF/GBrAMikJwr62SK6Q2e0C/FGTIaL7kIfnOzSvzG+9BnSBmfnj0c/arXGEQ+gxvzNWkQay6g2ci5qIppbedG7MrCOOGBr8JQilMft9XJ+VKEKsrVssh/K5ezd6a/B2l/hkB7h+bncLOcKZEh0pOFhU7S8B7CLuJwOjOlgFTh0NrF05u8C1IJOGETtVEVVO2QiqJI98vOsIz1pzEwD5BZuYTj2vrU/bbNS29a/dpRHsBT3q68s8yVsel0uT6be41HYK1r+F5ifLcXdVPtPvxFxCanXS8YcpUHbVHQqKJezG/jGWJtNSEE3AC996SeF1G5fy829I6HNQwYV7HJp+KeoJYF3+sQWd0Q/2htOazcdIeBVe0qqkg5DlbnYn MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4ef726b-0f53-4888-1557-08d768299864 X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fHVEcJrgGRWpQtrhpISFJeKfVcN1XZeRnqnZiXXxt0BgzVVKBXqaIrGgPldGvBiUqiYDwlJEjsFi5L6Uxm33uDT8bLUBquemVzhssGTfyeD2/w4+2Eijeg7I1yFjy0PfQ5OwHuaXXAoqnCU2lwAfAXgVI/1ZYgzvMqNGhNUtR2STdLo5HBXae1j2H2wIOYD8IsS7qzKp/0QO0Xr+fT26mQ== X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:40.4395 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR05MB4781 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Send EAPOL frames via control path so they can be treated in a different way rather than normal data frames. In this case EAPOLs are sent with higher priority and with disabled aggregation and encryption. Besides, all devices benefit from sending EAPOL frames via high priority path, so move the functionality from chip specific to common code. Signed-off-by: Igor Mitsyanko Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/core.c | 23 +++++++++++++--------- drivers/net/wireless/quantenna/qtnfmac/core.h | 1 - drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c | 1 - .../wireless/quantenna/qtnfmac/pcie/pcie_priv.h | 1 - .../wireless/quantenna/qtnfmac/pcie/topaz_pcie.c | 8 -------- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.c b/drivers/net/wireless/quantenna/qtnfmac/core.c index 8d699cc03d26..8116b224c946 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.c +++ b/drivers/net/wireless/quantenna/qtnfmac/core.c @@ -67,6 +67,14 @@ static int qtnf_netdev_close(struct net_device *ndev) return 0; } +static void qtnf_packet_send_hi_pri(struct sk_buff *skb) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(skb->dev); + + skb_queue_tail(&vif->high_pri_tx_queue, skb); + queue_work(vif->mac->bus->hprio_workqueue, &vif->high_pri_tx_work); +} + /* Netdev handler for data transmission. */ static netdev_tx_t @@ -107,6 +115,12 @@ qtnf_netdev_hard_start_xmit(struct sk_buff *skb, struct net_device *ndev) /* tx path is enabled: reset vif timeout */ vif->cons_tx_timeout_cnt = 0; + if (unlikely(skb->protocol == htons(ETH_P_PAE))) { + qtnf_packet_send_hi_pri(skb); + qtnf_update_tx_stats(ndev, skb); + return NETDEV_TX_OK; + } + return qtnf_bus_data_tx(mac->bus, skb); } @@ -841,15 +855,6 @@ void qtnf_update_tx_stats(struct net_device *ndev, const struct sk_buff *skb) } EXPORT_SYMBOL_GPL(qtnf_update_tx_stats); -void qtnf_packet_send_hi_pri(struct sk_buff *skb) -{ - struct qtnf_vif *vif = qtnf_netdev_get_priv(skb->dev); - - skb_queue_tail(&vif->high_pri_tx_queue, skb); - queue_work(vif->mac->bus->hprio_workqueue, &vif->high_pri_tx_work); -} -EXPORT_SYMBOL_GPL(qtnf_packet_send_hi_pri); - struct dentry *qtnf_get_debugfs_dir(void) { return qtnf_debugfs_dir; diff --git a/drivers/net/wireless/quantenna/qtnfmac/core.h b/drivers/net/wireless/quantenna/qtnfmac/core.h index 322858df600c..e3feea31191e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/core.h +++ b/drivers/net/wireless/quantenna/qtnfmac/core.h @@ -152,7 +152,6 @@ void qtnf_virtual_intf_cleanup(struct net_device *ndev); void qtnf_netdev_updown(struct net_device *ndev, bool up); void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted); -void qtnf_packet_send_hi_pri(struct sk_buff *skb); struct dentry *qtnf_get_debugfs_dir(void); static inline struct qtnf_vif *qtnf_netdev_get_priv(struct net_device *dev) diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c index 3360b836fc44..5337e67092ca 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c @@ -357,7 +357,6 @@ static int qtnf_pcie_probe(struct pci_dev *pdev, const struct pci_device_id *id) pcie_priv->pcie_irq_count = 0; pcie_priv->tx_reclaim_done = 0; pcie_priv->tx_reclaim_req = 0; - pcie_priv->tx_eapol = 0; pcie_priv->workqueue = create_singlethread_workqueue("QTNF_PCIE"); if (!pcie_priv->workqueue) { diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h index 8bc4300518d0..2a6a928e13bd 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h @@ -63,7 +63,6 @@ struct qtnf_pcie_bus_priv { u32 tx_done_count; u32 tx_reclaim_done; u32 tx_reclaim_req; - u32 tx_eapol; u8 msi_enabled; u8 tx_stopped; diff --git a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c index ef255fb57405..a0587472736f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c +++ b/drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c @@ -509,13 +509,6 @@ static int qtnf_pcie_data_tx(struct qtnf_bus *bus, struct sk_buff *skb) int len; int i; - if (unlikely(skb->protocol == htons(ETH_P_PAE))) { - qtnf_packet_send_hi_pri(skb); - qtnf_update_tx_stats(skb->dev, skb); - priv->tx_eapol++; - return NETDEV_TX_OK; - } - spin_lock_irqsave(&priv->tx_lock, flags); if (!qtnf_tx_queue_ready(ts)) { @@ -779,7 +772,6 @@ static int qtnf_dbg_pkt_stats(struct seq_file *s, void *data) seq_printf(s, "tx_done_count(%u)\n", priv->tx_done_count); seq_printf(s, "tx_reclaim_done(%u)\n", priv->tx_reclaim_done); seq_printf(s, "tx_reclaim_req(%u)\n", priv->tx_reclaim_req); - seq_printf(s, "tx_eapol(%u)\n", priv->tx_eapol); seq_printf(s, "tx_bd_r_index(%u)\n", priv->tx_bd_r_index); seq_printf(s, "tx_done_index(%u)\n", tx_done_index); From patchwork Wed Nov 13 11:06:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241697 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D96014E5 for ; Wed, 13 Nov 2019 11:07:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB28C222C1 for ; Wed, 13 Nov 2019 11:07:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="PqHasP6L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727787AbfKMLHj (ORCPT ); Wed, 13 Nov 2019 06:07:39 -0500 Received: from mx0b-00183b01.pphosted.com ([67.231.157.42]:30068 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727780AbfKMLHj (ORCPT ); Wed, 13 Nov 2019 06:07:39 -0500 Received: from pps.filterd (m0048104.ppops.net [127.0.0.1]) by mx0b-00183b01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xADArlt3028773 for ; Wed, 13 Nov 2019 04:07:37 -0700 Received: from nam03-dm3-obe.outbound.protection.outlook.com (mail-dm3nam03lp2055.outbound.protection.outlook.com [104.47.41.55]) by mx0b-00183b01.pphosted.com with ESMTP id 2w7psmbgb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:37 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JAnqhzUbC8mLSEqp5wB4wX0GtebhbWdwsGq4StRISZgBzzXqpYCwHuF1aLTswvUhJEu+NgQ+MxVI/GqLftQRdKRqWqgnc8oEpnA5FUJgwWnm7Y0UeF6B4fLuvqHantHhEPiCEEF9XOjDG15wFrOD1QlIQlbLqPEXXe5cK3xgwFiCdMms5vlmdMVRh58sDmxZOJOHhcXqZTn7pGqPbNwXmuINil7/kp6b5htdXPleHockI+RkmQyHK9FwzPtwcdMUYj3OOFeejjCg3OlR2+8CRFyfCO8+EkgyWkVXyaVJYRMuKcWDaSB2UYLa0GtTECa/szltFWI1HKRWWqXgVesvRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=unbZJshkuaKpYC0MuiWC54zXGOmrKukjn4+euqiSGpI=; b=UbeXmu4jnMLxl1ufGts+NyF0oLtpu4FyNp3Phv9zBTQNiyyi1qCvDOsblTH2F+ouaKQHtkjuAagnF+nJIqXoijs5tzEyWnIeRiF13dvBFFHyVphTLUogVG9PX7kgS2vVqLN4aAPWEeHXclcQ1g3agYytys419vusu3LZ/5xU93sjjwzGAEhbJc7pbl3qzoG1z8Q0hMi/G0uSuaxxE5E76QEbxHHLlyczYoRjnIYUL/hZ9QL3kKiGN4XrdsDBhNJYgzR1dAPP+HSgNFjp6odxZOswQZWODBweHf6JE5Ls5T2eCbNq+AldFPh/fVmrE7yT1Eubx4Qt8KKjkaLGllqM+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=unbZJshkuaKpYC0MuiWC54zXGOmrKukjn4+euqiSGpI=; b=PqHasP6LkQKbbOSecbaS3CIRLI95wb8UUAKLAhLfo9PnLgX0LTC5ujnuDXoy94C/kR0PSRkTIp42MrNy7DjBlgHNNGo15Lfp2liceyvvoOWl6iQuMozSsRf4hXAjy4TK4FVmE3snITLoeBV8bR/yCYpvfJgQy/z4RXD7PLaHHtA= Received: from DM5PR0501MB3733.namprd05.prod.outlook.com (10.167.110.151) by DM5PR0501MB3701.namprd05.prod.outlook.com (10.167.106.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.21; Wed, 13 Nov 2019 11:07:36 +0000 Received: from DM5PR0501MB3733.namprd05.prod.outlook.com ([fe80::6848:5b92:9e42:fc23]) by DM5PR0501MB3733.namprd05.prod.outlook.com ([fe80::6848:5b92:9e42:fc23%2]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:07:36 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5295.namprd05.prod.outlook.com (52.135.109.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:06:58 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:06:58 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 6/7] qtnfmac: handle MIC failure event from firmware Thread-Topic: [PATCH 6/7] qtnfmac: handle MIC failure event from firmware Thread-Index: AQHVmhJ37ztStXznuU6xhMrM859dCA== Date: Wed, 13 Nov 2019 11:06:57 +0000 Message-ID: <20191113110639.9226-7-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f3206c4d-0e80-4039-32e6-08d768299999 x-ms-traffictypediagnostic: SN6PR05MB5295:|DM5PR0501MB3701: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:34 AM x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(39830400003)(376002)(346002)(136003)(366004)(189003)(199004)(26005)(316002)(81156014)(81166006)(2906002)(256004)(103116003)(14454004)(66946007)(14444005)(8936002)(1076003)(478600001)(446003)(99286004)(102836004)(2501003)(6916009)(476003)(54906003)(6506007)(76176011)(386003)(11346002)(2616005)(36756003)(186003)(436003)(71190400001)(71200400001)(107886003)(8676002)(486006)(52116002)(86362001)(6436002)(25786009)(4326008)(5640700003)(6486002)(7736002)(66476007)(3846002)(66446008)(66556008)(6512007)(66066001)(50226002)(5660300002)(6116002)(2351001)(305945005)(64756008);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR0501MB3701;H:DM5PR0501MB3733.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ja/MjinHhaWpGeTeC6GNCdMRoZaNxnhTdPPdgXqsPG1VeyH+i0rN2kfuROOIWjWpZE1msmNCzj1HFXiv8tK3tmuMCf04GeGdcftl8GGaKxOrcnBO871901JfTP409Bst8r9Nxtdo0/PZAVV6Sb0cdyDu4eNUocE0Y4q34cwOtdcZr+JfxzRi6bYL2l1NMXDitevCoyW7iAIPdfP0ZXIzcPTufVouonIpafJ8DMIhW+h0d0mIXmTlOZmcrmy8E5ya8xyxMBvyy1e8jjF4mVGVG2tn0beCKjT+p+lOu28hon176WYjYE80P8O/+SrV3UNYbhBgF5RZhKJSGooJWKg46rqA8E9RwTORmdCzrSlXc6xDSbCVQIGzkVAziIMbXM9Cy1lIxqAUhfKebZQHrRfM/wDM/PKiIvBUEP52PLtUUS+udZSQGa3d4emTGPBNQbdK MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3206c4d-0e80-4039-32e6-08d768299999 X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KfBtWLzskz2cr/pZ1o6+IjMarnXO1lk5V190vZofhLlssyZsKU1XJiFjROu2i4AjiXIkb5S581xuc6uHTzQvnbqum9RinSW4oy6RdV8pKJRy2KOQIPaV3DpCxUNCoRDoSvjtoYFTarCTY6eu40oKNBWe1eh0afvMyl0Ofb5UIBRhHrRgBqY8qWnLKfbq5EUV6+STEFWOxHJ0oaPqW5ENqkma/tRCHfamIYBIQh/jAWYV6ruU78txyijqZ76joTnr X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:36.3169 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0501MB3701 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911130103 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Report MIC failure from firmware to cfg80211 subsystem using dedicated callback cfg80211_michael_mic_failure. Signed-off-by: Sergey Matyukevich --- drivers/net/wireless/quantenna/qtnfmac/event.c | 40 ++++++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 15 ++++++++++ 2 files changed, 55 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/event.c b/drivers/net/wireless/quantenna/qtnfmac/event.c index 7846383c8828..51af93bdf06e 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/event.c +++ b/drivers/net/wireless/quantenna/qtnfmac/event.c @@ -618,6 +618,42 @@ qtnf_event_handle_external_auth(struct qtnf_vif *vif, return ret; } +static int +qtnf_event_handle_mic_failure(struct qtnf_vif *vif, + const struct qlink_event_mic_failure *mic_ev, + u16 len) +{ + struct wiphy *wiphy = priv_to_wiphy(vif->mac); + u8 pairwise; + + if (len < sizeof(*mic_ev)) { + pr_err("VIF%u.%u: payload is too short (%u < %zu)\n", + vif->mac->macid, vif->vifid, len, + sizeof(struct qlink_event_mic_failure)); + return -EINVAL; + } + + if (!wiphy->registered || !vif->netdev) + return 0; + + if (vif->wdev.iftype != NL80211_IFTYPE_STATION) { + pr_err("VIF%u.%u: MIC_FAILURE event when not in STA mode\n", + vif->mac->macid, vif->vifid); + return -EPROTO; + } + + pairwise = mic_ev->pairwise ? + NL80211_KEYTYPE_PAIRWISE : NL80211_KEYTYPE_GROUP; + + pr_info("%s: MIC error: src=%pM key_index=%u pairwise=%u\n", + vif->netdev->name, mic_ev->src, mic_ev->key_index, pairwise); + + cfg80211_michael_mic_failure(vif->netdev, mic_ev->src, pairwise, + mic_ev->key_index, NULL, GFP_KERNEL); + + return 0; +} + static int qtnf_event_parse(struct qtnf_wmac *mac, const struct sk_buff *event_skb) { @@ -680,6 +716,10 @@ static int qtnf_event_parse(struct qtnf_wmac *mac, ret = qtnf_event_handle_external_auth(vif, (const void *)event, event_len); break; + case QLINK_EVENT_MIC_FAILURE: + ret = qtnf_event_handle_mic_failure(vif, (const void *)event, + event_len); + break; default: pr_warn("unknown event type: %x\n", event_id); break; diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 8a3c6344fa8e..ac1ebe4bb580 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -958,6 +958,7 @@ enum qlink_event_type { QLINK_EVENT_FREQ_CHANGE = 0x0028, QLINK_EVENT_RADAR = 0x0029, QLINK_EVENT_EXTERNAL_AUTH = 0x0030, + QLINK_EVENT_MIC_FAILURE = 0x0031, }; /** @@ -1151,6 +1152,20 @@ struct qlink_event_external_auth { u8 action; } __packed; +/** + * struct qlink_event_mic_failure - data for QLINK_EVENT_MIC_FAILURE event + * + * @src: source MAC address of the frame + * @key_index: index of the key being reported + * @pairwise: whether the key is pairwise or group + */ +struct qlink_event_mic_failure { + struct qlink_event ehdr; + u8 src[ETH_ALEN]; + u8 key_index; + u8 pairwise; +} __packed; + /* QLINK TLVs (Type-Length Values) definitions */ From patchwork Wed Nov 13 11:06:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 11241699 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7656414E5 for ; Wed, 13 Nov 2019 11:07:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D80F222C1 for ; Wed, 13 Nov 2019 11:07:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=quantenna.com header.i=@quantenna.com header.b="LuDgeV/x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727804AbfKMLHm (ORCPT ); Wed, 13 Nov 2019 06:07:42 -0500 Received: from mx0a-00183b01.pphosted.com ([67.231.149.44]:19398 "EHLO mx0a-00183b01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbfKMLHm (ORCPT ); Wed, 13 Nov 2019 06:07:42 -0500 Received: from pps.filterd (m0048105.ppops.net [127.0.0.1]) by mx0a-00183b01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xADB6RQt030927 for ; Wed, 13 Nov 2019 04:07:41 -0700 Received: from nam04-co1-obe.outbound.protection.outlook.com (mail-co1nam04lp2051.outbound.protection.outlook.com [104.47.45.51]) by mx0a-00183b01.pphosted.com with ESMTP id 2w7pt5mam6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 13 Nov 2019 04:07:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8cysSSZyIWlqDYOP/hVur7e5hT84k7RL2sdaaqRHZIJmx5e8+PtN72ZcG9NbqmAW4jSJbNx8DGbBd38XB/yuLwc4E+BQBk1XTAKfq4sRi1QzSjEYzp6Bkfd5Pl3B2hugcIPSgvePylDnItj33h7uWutFnZi258NDCBrwLbVdAmmYlfvhe2FY/6KP0ufUTIF4o68xnT+BtiIxUVNBJo6LLaRQQ7jtZ8PUWct42lJBLVvSqflygNUHupeulVmBnNOhFz1hAVSITPEs2eAdJ7a04pRG4V1fOG39vYbp9C8RNwTy7/zBmsuI59mZsFHvWZMBaUZ2mG47x8Aw2HUhZPVmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NpRH9Iop/mqBTBgs14ttrJUEeW/T7y6sCPDM5hII+i4=; b=MuDzLgHs0nfNhRyE/zucV3xEOLX1wk/oHaFZWeNGvqRtJIOLBg3XkGrJsE0+rRkAqaI0/YAmQ3bJiM3JC5IwoZrHnao6L3w1UImB3EM34y8MfMBnJbBstlM4mXsbzM7NY7j6l69b63ikYGx0ZRHob2MvGUmAKud6m2zke8hGTUUGpR+v56uebRYW7e8VWSv8Nxibp0Fj/BdGGpI/zZGU3VytlDqa7NBTBuI7NHNUAjTLEM1+61U9Mg7APSLegdhP4ESUmx9VPcjuYmruu8xMtdXiJRwIpKIvnqtYr+EPVEHFQquDgU5oLMMf2jL+a2U/clHqEi1W14dn5/SbDGa/zg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=quantenna.com; dmarc=pass action=none header.from=quantenna.com; dkim=pass header.d=quantenna.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NpRH9Iop/mqBTBgs14ttrJUEeW/T7y6sCPDM5hII+i4=; b=LuDgeV/xDpmnR8IkzxRgUV1mej/dAKxTASyQ9Tztnr8BfAkTASAlAB14wSd7XFJch1kPZBg3yvXXtXXetN9EWkc0/VASZV0EZKrZXmiMnwaTEamoEek6Vf0HJjWyvlf5h2GxH/JAUxtLC+CX9gAqB7QpZYtRB+Wlj+k4GOHO3qw= Received: from BYAPR05MB6039.namprd05.prod.outlook.com (20.178.54.92) by BYAPR05MB6677.namprd05.prod.outlook.com (20.178.234.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:07:39 +0000 Received: from BYAPR05MB6039.namprd05.prod.outlook.com ([fe80::9099:5295:2974:2a43]) by BYAPR05MB6039.namprd05.prod.outlook.com ([fe80::9099:5295:2974:2a43%3]) with mapi id 15.20.2474.007; Wed, 13 Nov 2019 11:07:39 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com (52.135.117.74) by SN6PR05MB5295.namprd05.prod.outlook.com (52.135.109.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.17; Wed, 13 Nov 2019 11:07:00 +0000 Received: from SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9]) by SN6PR05MB4928.namprd05.prod.outlook.com ([fe80::61a0:dd3d:3477:29c9%5]) with mapi id 15.20.2451.023; Wed, 13 Nov 2019 11:07:00 +0000 From: Sergey Matyukevich To: "linux-wireless@vger.kernel.org" CC: Igor Mitsyanko , Mikhail Karpenko , Sergey Matyukevich Subject: [PATCH 7/7] qtnfmac: add support for getting/setting transmit power Thread-Topic: [PATCH 7/7] qtnfmac: add support for getting/setting transmit power Thread-Index: AQHVmhJ4MFdQ+c8ksESvTPWTOD3mJQ== Date: Wed, 13 Nov 2019 11:06:59 +0000 Message-ID: <20191113110639.9226-8-sergey.matyukevich.os@quantenna.com> References: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> In-Reply-To: <20191113110639.9226-1-sergey.matyukevich.os@quantenna.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR03CA0022.namprd03.prod.outlook.com (2603:10b6:a02:a8::35) To SN6PR05MB4928.namprd05.prod.outlook.com (2603:10b6:805:9d::10) x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.11.0 x-originating-ip: [195.182.157.78] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d8e0aef9-0760-4404-963b-08d768299ac9 x-ms-traffictypediagnostic: SN6PR05MB5295:|BYAPR05MB6677: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-moderation-data: 11/13/2019 11:07:37 AM x-ms-oob-tlc-oobclassifiers: OLM:2733; x-forefront-prvs: 0220D4B98D x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(136003)(376002)(346002)(39850400004)(366004)(189003)(199004)(386003)(3846002)(99286004)(66446008)(6116002)(26005)(14454004)(66066001)(76176011)(6916009)(52116002)(66556008)(6506007)(64756008)(2906002)(305945005)(7736002)(2501003)(54906003)(316002)(86362001)(36756003)(436003)(5660300002)(5640700003)(107886003)(66946007)(6486002)(6436002)(6512007)(256004)(14444005)(8936002)(446003)(81166006)(2616005)(50226002)(486006)(2351001)(11346002)(8676002)(81156014)(476003)(1076003)(4326008)(478600001)(103116003)(186003)(71200400001)(25786009)(102836004)(66476007)(71190400001);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR05MB6677;H:BYAPR05MB6039.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tQKRHzuEh3p2nuSH3HhRiFsx+dALWAQ8aCYgBbwjbAiVzzC2vZQW2iWxHl6Cb4Ym/BYtEY5oVUFF/n5WBVs4SsmGUxaAAVrPulfJw3YoCT387fUCJ+v8F3g+FToOoN6S2mI6mRLcJC2gqZPpBFPYssxYo1m1IoCThHyTNreHvs2z944Wqidr0dlp+a1ZThUFKANXQJRggV+KD7KryV06du+t9ffteGphiV+iCXaxO1lwvCTvjQFDYoz9be8DucSbpzI0jFUU45+xx3BEl1GuLqdiiWpSTqgirNHK/QMYL53U8oaR9nmC3MYnxbn9FSUOY1XYW7KBc0+3jrL7EcIfMiqJ4iyEs+YNqLdmCfpgykXOSctRZLWnH7g5ev/eclbjUO4s+CGaOop8fL4Pur77mKV4JjRiac9XzGwtSN1W/LkZZkNireQDkI2JxIf1Fsmj MIME-Version: 1.0 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8e0aef9-0760-4404-963b-08d768299ac9 X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RqqXRq/RZiGHwA7cUXnp5wzGYcx2f+8P0SGdyHlAGWJB3xskaDtVeGFpqMJpshclI4tUC295P3uDkHK2TKe0UTU0uJqhm0jIAgGfsrhOVXKqVT3soz8EWuQirz61SVuFD1xqzanplgQ2F/daxSEcoEZymnkqHEjD38vt0yJhd93BJSrhf9zF0n+SIj6VbWbSv2RtxZEUgCygTf2ECII3uHc4ogQ6mUHxU+UctC1C4aM= X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Nov 2019 11:07:39.6390 (UTC) X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR05MB6677 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-11-13_03:2019-11-13,2019-11-13 signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Mikhail Karpenko Add new command for getting/setting current transmit power and propagate requests from user space to firmware. Signed-off-by: Mikhail Karpenko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 41 ++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.c | 65 +++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.h | 3 ++ drivers/net/wireless/quantenna/qtnfmac/qlink.h | 42 +++++++++++++++ 4 files changed, 151 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index d90016125dfc..aa0ed0f2b973 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -897,6 +897,45 @@ static int qtnf_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, return ret; } +static int qtnf_get_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, + int *dbm) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev); + int ret; + + ret = qtnf_cmd_get_tx_power(vif, dbm); + if (ret) + pr_err("MAC%u: failed to get Tx power\n", vif->mac->macid); + + return ret; +} + +static int qtnf_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, + enum nl80211_tx_power_setting type, int mbm) +{ + struct qtnf_vif *vif; + int ret; + + if (wdev) { + vif = qtnf_netdev_get_priv(wdev->netdev); + } else { + struct qtnf_wmac *mac = wiphy_priv(wiphy); + + vif = qtnf_mac_get_base_vif(mac); + if (!vif) { + pr_err("MAC%u: primary VIF is not configured\n", + mac->macid); + return -EFAULT; + } + } + + ret = qtnf_cmd_set_tx_power(vif, type, mbm); + if (ret) + pr_err("MAC%u: failed to set Tx power\n", vif->mac->macid); + + return ret; +} + #ifdef CONFIG_PM static int qtnf_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wowlan) { @@ -991,6 +1030,8 @@ static struct cfg80211_ops qtn_cfg80211_ops = { .start_radar_detection = qtnf_start_radar_detection, .set_mac_acl = qtnf_set_mac_acl, .set_power_mgmt = qtnf_set_power_mgmt, + .get_tx_power = qtnf_get_tx_power, + .set_tx_power = qtnf_set_tx_power, #ifdef CONFIG_PM .suspend = qtnf_suspend, .resume = qtnf_resume, diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index c0c32805fb8d..61bda34e2ac2 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2643,6 +2643,71 @@ int qtnf_cmd_send_pm_set(const struct qtnf_vif *vif, u8 pm_mode, int timeout) return ret; } +int qtnf_cmd_get_tx_power(const struct qtnf_vif *vif, int *dbm) +{ + struct qtnf_bus *bus = vif->mac->bus; + const struct qlink_resp_txpwr *resp; + struct sk_buff *resp_skb = NULL; + struct qlink_cmd_txpwr *cmd; + struct sk_buff *cmd_skb; + int ret = 0; + + cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, + QLINK_CMD_TXPWR, sizeof(*cmd)); + if (!cmd_skb) + return -ENOMEM; + + cmd = (struct qlink_cmd_txpwr *)cmd_skb->data; + cmd->op_type = QLINK_TXPWR_GET; + + qtnf_bus_lock(bus); + + ret = qtnf_cmd_send_with_reply(bus, cmd_skb, &resp_skb, + sizeof(*resp), NULL); + if (ret) + goto out; + + resp = (const struct qlink_resp_txpwr *)resp_skb->data; + *dbm = MBM_TO_DBM(le32_to_cpu(resp->txpwr)); + +out: + qtnf_bus_unlock(bus); + consume_skb(resp_skb); + + return ret; +} + +int qtnf_cmd_set_tx_power(const struct qtnf_vif *vif, + enum nl80211_tx_power_setting type, int mbm) +{ + struct qtnf_bus *bus = vif->mac->bus; + const struct qlink_resp_txpwr *resp; + struct sk_buff *resp_skb = NULL; + struct qlink_cmd_txpwr *cmd; + struct sk_buff *cmd_skb; + int ret = 0; + + cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, + QLINK_CMD_TXPWR, sizeof(*cmd)); + if (!cmd_skb) + return -ENOMEM; + + cmd = (struct qlink_cmd_txpwr *)cmd_skb->data; + cmd->op_type = QLINK_TXPWR_SET; + cmd->txpwr_setting = type; + cmd->txpwr = cpu_to_le32(mbm); + + qtnf_bus_lock(bus); + + ret = qtnf_cmd_send_with_reply(bus, cmd_skb, &resp_skb, + sizeof(*resp), NULL); + + qtnf_bus_unlock(bus); + consume_skb(resp_skb); + + return ret; +} + int qtnf_cmd_send_wowlan_set(const struct qtnf_vif *vif, const struct cfg80211_wowlan *wowl) { diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h index 88d7a3cd90d2..e0de65261213 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.h +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h @@ -70,6 +70,9 @@ int qtnf_cmd_start_cac(const struct qtnf_vif *vif, int qtnf_cmd_set_mac_acl(const struct qtnf_vif *vif, const struct cfg80211_acl_data *params); int qtnf_cmd_send_pm_set(const struct qtnf_vif *vif, u8 pm_mode, int timeout); +int qtnf_cmd_get_tx_power(const struct qtnf_vif *vif, int *dbm); +int qtnf_cmd_set_tx_power(const struct qtnf_vif *vif, + enum nl80211_tx_power_setting type, int mbm); int qtnf_cmd_send_wowlan_set(const struct qtnf_vif *vif, const struct cfg80211_wowlan *wowl); diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index ac1ebe4bb580..59c69c0a6e06 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -217,6 +217,8 @@ struct qlink_sta_info_state { * command is supported only if device reports QLINK_HW_SUPPORTS_REG_UPDATE * capability. * @QLINK_CMD_START_CAC: start radar detection procedure on a specified channel. + * @QLINK_CMD_TXPWR: get or set current channel transmit power for + * the specified MAC. */ enum qlink_cmd_type { QLINK_CMD_FW_INIT = 0x0001, @@ -254,6 +256,7 @@ enum qlink_cmd_type { QLINK_CMD_PM_SET = 0x0062, QLINK_CMD_WOWLAN_SET = 0x0063, QLINK_CMD_EXTERNAL_AUTH = 0x0066, + QLINK_CMD_TXPWR = 0x0067, }; /** @@ -719,6 +722,32 @@ struct qlink_cmd_pm_set { } __packed; /** + * enum qlink_txpwr_op - transmit power operation type + * @QLINK_TXPWR_SET: set tx power + * @QLINK_TXPWR_GET: get current tx power setting + */ +enum qlink_txpwr_op { + QLINK_TXPWR_SET, + QLINK_TXPWR_GET +}; + +/** + * struct qlink_cmd_txpwr - get or set current transmit power + * + * @txpwr: new transmit power setting, in mBm + * @txpwr_setting: transmit power setting type, one of + * &enum nl80211_tx_power_setting + * @op_type: type of operation, one of &enum qlink_txpwr_op + */ +struct qlink_cmd_txpwr { + struct qlink_cmd chdr; + __le32 txpwr; + u8 txpwr_setting; + u8 op_type; + u8 rsvd[2]; +} __packed; + +/** * enum qlink_wowlan_trigger * * @QLINK_WOWLAN_TRIG_DISCONNECT: wakeup on disconnect @@ -944,6 +973,19 @@ struct qlink_resp_channel_get { struct qlink_chandef chan; } __packed; +/** + * struct qlink_resp_txpwr - response for QLINK_CMD_TXPWR command + * + * This response is intended for QLINK_TXPWR_GET operation and does not + * contain any meaningful information in case of QLINK_TXPWR_SET operation. + * + * @txpwr: current transmit power setting, in mBm + */ +struct qlink_resp_txpwr { + struct qlink_resp rhdr; + __le32 txpwr; +} __packed; + /* QLINK Events messages related definitions */