From patchwork Wed Jan 15 13:54:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216614 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B305CC33CB1 for ; Wed, 15 Jan 2020 14:02:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A58C24679 for ; Wed, 15 Jan 2020 14:02:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="JD4yjZpb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729898AbgAOOCO (ORCPT ); Wed, 15 Jan 2020 09:02:14 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726506AbgAONyP (ORCPT ); Wed, 15 Jan 2020 08:54:15 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZHZVg0aOsZIIfy7aU1HnXI8jcrUkGOoY6Eay4sBQ8Inh6NP1r7a4BVv/nslpof5pEK27n7E05nsqSXWD5T5qPc7w0KMJe0d9OnGLN7WkpwUdZLTPICRZiJhAq82ufMwVMZU9jAD7uppLRUuYCmXytRiSO/AA71YQxzvLTLcbqGt8V2kaqEshE/9LTaol5630hzQnxQVkD5amhmP4ZujwgAA4PiNftm8h/zyUqC759ExU08y7Q7RHMmSgtIACuirTryjhJfGewvJlitNKDAcABZnJm4oa6rVJXhGVPx57rwu7EYJcVs5fDk+a+a93BsfCYazeto7c4e+9n6r9RidT4g== 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=WJKgaa7pmmCRqtSbENrnVw4XdApYgK6og7UgQlebpmM=; b=dbS+S+7cFJ3LbzKr24Y+PBWivM6ewoANz3iOJgmr4RJ8uOUigL54Tg15kndBwVF1crbB1VA6GSpNykSZHyEjA7mUkb+gGoLvrrSdcRCNxdglshE8skAYHIJ9ZkuyApy2EYgJiWtw5kCgaUc8sXECgaMDQ8R5KPCwxUFkGtKlXIPHtXBzV9GhseqWjpVBVt0s0CRzCPa43994xLD+TF3FNl0+GzYKR0Lj327ZlL1mb+MrqOJvp04veXQqKRTI5NloJPI+WOeeIfWMiXzv3rKe/+KTK1KFxVefeMxyuCyGNA+mfmI7OHfBsVT6eL1hMTWL49Ld3/MWiNoLQe+Vy3FADg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WJKgaa7pmmCRqtSbENrnVw4XdApYgK6og7UgQlebpmM=; b=JD4yjZpbE2bBZ9u+454lY+KbWz/ZgZXHS6PnM3t9tbliQgGEr8uzyhQzo3fONnoToMSgCC17SHaK5et0ZdowOS6Mc8nf0q0HbPzTSPGcC7AXqrZ2SVuIK5OPyk0HlkQsyMfmdMD57Kyf+yfdHLXilz7KLwt/Onr/Do2zp4cH3zQ= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:03 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:03 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:02 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= , Pascal Prime , Jules Irenge Subject: [PATCH v2 01/65] staging: wfx: revert unexpected change in debugfs output Thread-Topic: [PATCH v2 01/65] staging: wfx: revert unexpected change in debugfs output Thread-Index: AQHVy6s/YEhg+rUE80CFaDwRY6jjlw== Date: Wed, 15 Jan 2020 13:54:03 +0000 Message-ID: <20200115135338.14374-2-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: deb7213f-94f0-4c1a-310c-08d799c26163 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:220; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MVuZGiiVaDql32ySGtJVYVDi1qfqLN8TEDY5dqhYpIyMqoGS0VC6YsmAWmrBkWE6Vn9nkw81k9B66VWVT/cZcxVE0OZ2EZ+v96g1tBgONoRAOKSZ9ft8LIkpmYugoc5ACPT9ggX+FlFOQOd2XMQABRZdo3l6k+51dPPPAvgkxJqxczQdfQHnrkodQjWfd9YA2KDLIE5Ezq1LLzZiPRd9H8HkPPazOUpL3OcQgAu+HmlSF2san1lEeHKD+xUvD84rQN7zHVDhyckvgh7TFgApcFIbuCCJD1HwNr4HS4dXilmCJI/8aPnLWMWQyitiOrbUNQjJ5970mACG995cvzv5b6c7XrS3ZoKnsHAwSCGVQTQJw3TmSCgM4hursZMLADWmMFlfCCP2XFSTJUt3K8DxEsaFJvhWkri3Osg2EHnEGBvTdC/NwBXw+dPw7u9vjrbu Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: deb7213f-94f0-4c1a-310c-08d799c26163 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:03.4689 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: b1Rzs0pt0JBlvwe/9vKHao82eNjTvXlFGKrNpwbbo2DXEQGHOCI0NWN52P34AaNbtTvD59VL0Bcp0tyjkn14cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It appears that commit 8c7128c4cf4e ("staging: align to fix warnings of line over 80 characters") do slightly more than what is explained in commit log. Especially, it changes the output of the file rx_stats from debugfs. >From some point of view, this file can be considered as a part of the API. Any change on it should be clearly announced. Since the change introduced does not seems to have any justification, revert it. Reported-by: Pascal Prime Cc: Jules Irenge Fixes: 8c7128c4cf4e ("staging: align to fix warnings of line over 80 characters") Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c index d17a75242365..1164aba118a1 100644 --- a/drivers/staging/wfx/debug.c +++ b/drivers/staging/wfx/debug.c @@ -145,7 +145,7 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v) st->pwr_clk_freq, st->is_ext_pwr_clk ? "yes" : "no"); seq_printf(seq, - "N. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", + "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n", st->nb_rx_frame, st->per_total, st->throughput); seq_puts(seq, " Num. of PER RSSI SNR CFO\n"); seq_puts(seq, " frames (x10e4) (dBm) (dB) (kHz)\n"); From patchwork Wed Jan 15 13:54:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B692FC33CB3 for ; Wed, 15 Jan 2020 14:01:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 815E624656 for ; Wed, 15 Jan 2020 14:01:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="LrJrHfZl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729281AbgAONyb (ORCPT ); Wed, 15 Jan 2020 08:54:31 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726132AbgAONya (ORCPT ); Wed, 15 Jan 2020 08:54:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b8n1bWbiLN/i/SPN8a1Ir38ooRWypl/NFvJH5J/s8ydWr+LBmaPwcPVDwF9HDDWiemGQ1rj8i5TpxV9qGgSSMOq2ENWhzWQpGldK5nc8JsnGNsVa9QyowQcY+FRCLGHjw1Gp+vcbcIFBRfzcVrALa+3DfShBiNtMtfQj5f7pSsKAo7VZ8lzlY3+r0tdIS7RAdO3xm9fFVoH6vNB9z0lPd23FS2hsDKvH7OGSvb5Pny62Ug2VBgAH3YQYuk3+KCHDFvqWClIEhNQrn6CYHXIYPkr3ZMYPQTw5vQKth+VgSuxp6WN5+AHiHRztZJJQpS7UHr6Zure4ea5Ts52PJHrQSw== 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=gq5Umz4L0UlsXSSwPFNYQaPHeYPTP/zJciKYxMzYSus=; b=lKTgUjcY50apjdeWmFbHo9zAuvpOQ767iycDA6aBkGSg2x4yTfxpeAB0PtFiYDxV+5QqqmSfYLBl+Lkb9QrS5BDnaYPsGdCSpKznm/ATgQW2yOVlCyoksK6J52oL7XK3ZnQ6+ZbR+2Yw42Q0Q+k1o92/a6Zo3oirmJwvOp78WWi/LYvucf4ZdqzlaHOC/XQEEoQA9IBRke8KA4utF0ytNF4uFz9RczeTedEGTmHzSpe6R5gy9FFrHZHaP3t490lcI7MZPOrzNU+eJQ6PFC5jwLqg8k5FOKfABRGwzuqpDc3hXRzqz9cw+939Q03Phn1SKyXsTchuKnem3y35A/8Onw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gq5Umz4L0UlsXSSwPFNYQaPHeYPTP/zJciKYxMzYSus=; b=LrJrHfZlD6icf+ghekWIpHqS2sGmPC6uxRPKW/qdxieUORD7i3cghC4V2nnFbir+kz8XiWPY32pJHdH5wzhDdCsYVi80E4ApL+9/VCP+lfKyo01rr9wWTKREN9vC12WuvzoS+ZX3ungIKQmZuHl3f3nS8Vx9EqEPY4jUWk+MgBc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:08 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:07 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:06 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 04/65] staging: wfx: send rate policies one by one Thread-Topic: [PATCH v2 04/65] staging: wfx: send rate policies one by one Thread-Index: AQHVy6tBNYloxuW2g0u7z8Y0M1pzeQ== Date: Wed, 15 Jan 2020 13:54:07 +0000 Message-ID: <20200115135338.14374-5-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7c04c141-eeff-4233-7ff9-08d799c263f9 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NZn5rv8acWB6vOa2v61ehRPCz2Te75RYCXrVJl5JueQtn9NcQvmsh/WCweUUOJdb9S3Cn9Ekz1pAkeQLkGxY+lwU6VgkQA4Nf1fZLFJKBQ1g3AverqYLAPHR61Nlw7+AWar1bq0bQbBQ79nzAoVfTtPkOk0z6zn987w3QSRRBEY7QX++0qHhIYCYakXTPGEBar82zoCHZkVVmAOAnqUhZrhdM7IJfoHje9Ymnf8DQH+kKu7ySaw/47jWSUp1NfMdiXRXRXkVc1moueIka6BsR9ZZpDwnEDZsDsL9r91y+Hho/+MMig0IotBh7hejjnkfu0MH/BhuJEx0R3mtShBaqyiL+AmZF54DI1dtaGY+jY8kIrtA5amdYK8NCvLP2SkA1bkPgJe8UXznczedQwBUyV9V1lnHfgkfuQg+bs8y2GBMqqM+poPmdlrbtxikYHST Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c04c141-eeff-4233-7ff9-08d799c263f9 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:07.8194 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: sgsntgN+GNn3wAtv1tKPdEJKdojwnfMXZwdbrpzhhYl63JEk/Yf6nsOCh2+Nn8/LsjXpEUgUe6KoFQCP3dvMwg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Rate policies (aka. tx_rate_retry_policy in hardware API) are sent to device asynchronously from tx requests. So, the device maintains a list of active rate policies and the tx requests only reference an existent rate policy. The device API allows to send multiple rate policies at once. However, this property is very rarely used. We prefer to send rate policies one by one and simplify the architecture. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 53 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index b2a325c47b2d..fb51c5910ace 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -217,37 +217,34 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx) static int wfx_tx_policy_upload(struct wfx_vif *wvif) { - int i; - struct tx_policy_cache *cache = &wvif->tx_policy_cache; struct hif_mib_set_tx_rate_retry_policy *arg = - kzalloc(struct_size(arg, - tx_rate_retry_policy, - HIF_MIB_NUM_TX_RATE_RETRY_POLICIES), - GFP_KERNEL); - struct hif_mib_tx_rate_retry_policy *dst; + kzalloc(struct_size(arg, tx_rate_retry_policy, 1), GFP_KERNEL); + struct tx_policy *policies = wvif->tx_policy_cache.cache; + int i; - spin_lock_bh(&cache->lock); - /* Upload only modified entries. */ - for (i = 0; i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES; ++i) { - struct tx_policy *src = &cache->cache[i]; - - if (!src->uploaded && memzcmp(src->rates, sizeof(src->rates))) { - dst = arg->tx_rate_retry_policy + - arg->num_tx_rate_policies; - - dst->policy_index = i; - dst->short_retry_count = 255; - dst->long_retry_count = 255; - dst->first_rate_sel = 1; - dst->terminate = 1; - dst->count_init = 1; - memcpy(&dst->rates, src->rates, sizeof(src->rates)); - src->uploaded = true; - arg->num_tx_rate_policies++; + do { + spin_lock_bh(&wvif->tx_policy_cache.lock); + for (i = 0; i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES; ++i) + if (!policies[i].uploaded && + memzcmp(policies[i].rates, sizeof(policies[i].rates))) + break; + if (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES) { + policies[i].uploaded = 1; + arg->num_tx_rate_policies = 1; + arg->tx_rate_retry_policy[0].policy_index = i; + arg->tx_rate_retry_policy[0].short_retry_count = 255; + arg->tx_rate_retry_policy[0].long_retry_count = 255; + arg->tx_rate_retry_policy[0].first_rate_sel = 1; + arg->tx_rate_retry_policy[0].terminate = 1; + arg->tx_rate_retry_policy[0].count_init = 1; + memcpy(&arg->tx_rate_retry_policy[0].rates, + policies[i].rates, sizeof(policies[i].rates)); + spin_unlock_bh(&wvif->tx_policy_cache.lock); + hif_set_tx_rate_retry_policy(wvif, arg); + } else { + spin_unlock_bh(&wvif->tx_policy_cache.lock); } - } - spin_unlock_bh(&cache->lock); - hif_set_tx_rate_retry_policy(wvif, arg); + } while (i < HIF_MIB_NUM_TX_RATE_RETRY_POLICIES); kfree(arg); return 0; } From patchwork Wed Jan 15 13:54:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03B2EC33CB1 for ; Wed, 15 Jan 2020 14:02:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2B2D222C3 for ; Wed, 15 Jan 2020 14:02:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="BEKnFwWJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728988AbgAONyO (ORCPT ); Wed, 15 Jan 2020 08:54:14 -0500 Received: from mail-bn7nam10on2086.outbound.protection.outlook.com ([40.107.92.86]:18912 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726132AbgAONyN (ORCPT ); Wed, 15 Jan 2020 08:54:13 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CbelD5pUiphsZZyaGAFhNJtNVDAm4o/Luz1cGZNPuNBN58wxzdz6zyJYYJQ2XJ8+vYMIjyc6ODD8zizyIMaLe77bCARfygZuRHPKlt08gbrPCaK8P0YhHUuuKEByFxKUL53m0CiM0K0SuK73/UJUHcJV+jmkHsleoXAyrD9QcUT8QqRKoVkPUBxYNuONbsaJuIfyipAfdJxbt/vtmQrxjcucvvfIRVS3f37VBDPPcmWRwjpvssiEFJ5Jh0mN5kQWWmUUMKAbq0TtIuUJLTY8dya35m8d91GWMgIVCtlnjB8Br6H2qanfOSwGGn6J53rd5hFBfkqZvdYygVJib4QVZQ== 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=ZUo8LwBo1qK4cZ/ojBZuyySQUx8sEw77KK5ENOyqfFo=; b=HCBKOMPxJgYBQOISmX6bSCNGFVyCRM//jgRIlEt98nNIZG6RQ1lBXJy+UOLF/o+XZeIxWpfOs5DWyqoegnV4LMV9XI7vbBSIClTp9r+5uPZVGpoxBmZf4ao0DYR57Cm6PljjMOxrojFbX1xUSnmt+JNfCVIvtsBnBmXV4eOWMmh9vkuXbNhqLjxBBPq4/fYppT8MwhqDs6ZC9K6f5cAKvDzmgBxTtfNDwSkce0F8QU1XPl9SMvpU1Jp0fdwzWBSx91z7vyDADemSO8jWbYL3vRNX/Vb+abRMNmVkWyo3VElfRsnVOC2XH0LNfnWLgWQnGrjsFkakJZFZoI+LvOH8Jw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZUo8LwBo1qK4cZ/ojBZuyySQUx8sEw77KK5ENOyqfFo=; b=BEKnFwWJQPrMpZ7hiR2LeQCMFnwX8P/AB9dyLNbbBsvqLOhwp/3Le2VOeJEBsjgnQk+NM+L7dxzMklVQPaMjxSoCR5jzaG4IeEOyFenmbxlKf8HMKPg5dQiVmTZLiCuJn6NkgsNYjmQQLFHlTnWJCV3/c18JhFUdBqQVDhnGdzw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:54:10 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:10 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:09 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 06/65] staging: wfx: simplify hif_set_output_power() usage Thread-Topic: [PATCH v2 06/65] staging: wfx: simplify hif_set_output_power() usage Thread-Index: AQHVy6tDn0wcOEiD3EqwTSZft4VqOw== Date: Wed, 15 Jan 2020 13:54:10 +0000 Message-ID: <20200115135338.14374-7-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 699dc407-fb96-4338-c86e-08d799c265b8 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(6666004)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bV9/az/qwmag8KOydqEccbH0lqiobg0+Lzls7S2n4kWbA4g2ZuEuXIL8a+1kz6FNshzry9GeUf8MLL4whj3zDCGtuGa1d7wIrND5aAbmM4fOOLyG1kjZ75blL8HNQ5VMXg5XLnB5wxTAZwGpprndx4r7ooX6T1kCAHh59y2YZu5Y1N+YrUJ2X85yu9oEO9RkES89/SMkfTze3MSYTHM0WoDU0eagBw9BQxw73gzLA8/7rHzDAbNDd23+LwMYjEDN9PdCbj+qyOaQOo9qpvD2JKtRVKVfORf6CdoUvrphmIndpeXbt9uV2O3j2zhZVxejOnoIocwCNPxGgtMn6s6NUKdv63W1rQAJkn7E2BqlipCQ/VuT5dBJYKmpqgSywLF8T2eYza8bp0yTEphB+CEtQ40LIf2dHtb7MyLYMTp6GpCyn76vBOuZU0uUZCETrhXg Content-ID: <92D6F7CF6F831D4EB0E35503B86C08E3@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 699dc407-fb96-4338-c86e-08d799c265b8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:10.7457 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: yn6YLVcGqffhc582qevWhFNzRlSSBMkneUBajPp4eoYyIYo7gNpUJToGCjgBdZ2mydGUBD3bmnQJ8xTsiYKPEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Hardware API use 10th of dBm for output power unit. Upper layers should use same units than mac80211 and the conversion should be done by low level layer of the driver (hif_set_output_power()) In add, current code of hif_set_output_power() use a __le32 while the device API specify a specific structure for this. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 8 +++++--- drivers/staging/wfx/scan.c | 2 +- drivers/staging/wfx/sta.c | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index ef033a409381..749df67131c3 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -15,13 +15,15 @@ #include "hif_tx.h" #include "hif_api_mib.h" -static inline int hif_set_output_power(struct wfx_vif *wvif, int power_level) +static inline int hif_set_output_power(struct wfx_vif *wvif, int val) { - __le32 val = cpu_to_le32(power_level); + struct hif_mib_current_tx_power_level arg = { + .power_level = cpu_to_le32(val * 10), + }; return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_CURRENT_TX_POWER_LEVEL, - &val, sizeof(val)); + &arg, sizeof(arg)); } static inline int hif_set_beacon_wakeup_period(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 9b3674b3226a..8e0ac89fd28f 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -61,7 +61,7 @@ static int send_scan_req(struct wfx_vif *wvif, return timeout; ret = wait_for_completion_timeout(&wvif->scan_complete, timeout); if (req->channels[start_idx]->max_power != wvif->wdev->output_power) - hif_set_output_power(wvif, wvif->wdev->output_power * 10); + hif_set_output_power(wvif, wvif->wdev->output_power); wfx_tx_unlock(wvif->wdev); if (!ret) { dev_notice(wvif->wdev->dev, "scan timeout\n"); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 8f53a78d7215..11e33a6d5bb5 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -503,7 +503,7 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) hif_keep_alive_period(wvif, 0); hif_reset(wvif, false); wfx_tx_policy_init(wvif); - hif_set_output_power(wvif, wvif->wdev->output_power * 10); + hif_set_output_power(wvif, wvif->wdev->output_power); wvif->dtim_period = 0; hif_set_macaddr(wvif, wvif->vif->addr); wfx_free_event_queue(wvif); @@ -1063,7 +1063,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_TXPOWER && info->txpower != wdev->output_power) { wdev->output_power = info->txpower; - hif_set_output_power(wvif, wdev->output_power * 10); + hif_set_output_power(wvif, wdev->output_power); } mutex_unlock(&wdev->conf_mutex); @@ -1317,7 +1317,7 @@ int wfx_config(struct ieee80211_hw *hw, u32 changed) mutex_lock(&wdev->conf_mutex); if (changed & IEEE80211_CONF_CHANGE_POWER) { wdev->output_power = conf->power_level; - hif_set_output_power(wvif, wdev->output_power * 10); + hif_set_output_power(wvif, wdev->output_power); } if (changed & IEEE80211_CONF_CHANGE_PS) { From patchwork Wed Jan 15 13:54:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53386C33CB1 for ; Wed, 15 Jan 2020 14:01:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 141AC24656 for ; Wed, 15 Jan 2020 14:01:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="TylJzHLQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729833AbgAOOA6 (ORCPT ); Wed, 15 Jan 2020 09:00:58 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728884AbgAONyd (ORCPT ); Wed, 15 Jan 2020 08:54:33 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2yaBI3FlAr2xivUwicVrJGBv6vWv0fXws9hjTg8lpSfm5EK1cD/VjzKzhaVHRNOyHm9ZoNkFe/AQIr9YNyCa4HLbdGctWCH6VidkBZhXaKTxUmrsaZzxMEvGyyFvgyEgJAhLENSCdfsQnIxJEu7XSzyGRNZRxvFhGLWAoixPfb2WixF8GSuIaU6nRhYt1Fy1jAvs7IZQquhlTguqL80/xTTjQvSSj5hzNUOJnwc3iKiVkC1hxxGKp1MWlxtTSei29+XI94sSQAxyr0vnZGB8sO4Ir6LGsAgzmk5LbhGLVAY1ouNVsaDZtB+BPdq3+kpy63zkVxo6MR0it66pDnZ5A== 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=+AJrNR5x6OaUELuP4bcANVom55NGF0XSik/Lq5n/m4E=; b=c3Az/5wUAr/QpF550qgEqD9Jlr1E6EPmGwQATCxAwAAQ01fQHTdxb11E20cRicdN2NJwhaHusSEnQ/dqUsYpTmVk1jpirtXPVYPwbNXEHzrBPCHxmXVdhP9HuwaFqIRkpUC6OFH01yzXHi5puFiHC3Z++VLN68HaTupqlZxVe/vlXs0wO4vsmmaknvqiuTyw4mA8VSWv1dMhVuCJIcd2/Tx5umgwXTRieaNef6ERAx+PjDepq+TzzwDhYGOcle37yhpmZVQy6ABebKPX5YXVtT2PIJPjS4ydwVykt5PfrXhQ7/67D3ToJBRuvMW3GFQZD+hQ0ef7peZ+rCEeyq7qjQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+AJrNR5x6OaUELuP4bcANVom55NGF0XSik/Lq5n/m4E=; b=TylJzHLQlQ5rQIuCH85tGRG62er7/CsF69MvTXLRG0CuN5rTlDuiwb69BzyeZxxzdoKdc4aBztNd1O56B2vYVjjAnKcY988L3VVHzvGRpDivwlwlhi5hpJoM6KhHsfnUjZWRKS8I8110nksLZ2LN/DrefHuZZviSxvQl20L2PNg= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:12 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:12 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:11 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage Thread-Topic: [PATCH v2 07/65] staging: wfx: simplify hif_set_rcpi_rssi_threshold() usage Thread-Index: AQHVy6tEZVLrPPl2cUSAlMb2bQPJ/g== Date: Wed, 15 Jan 2020 13:54:12 +0000 Message-ID: <20200115135338.14374-8-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: feb40c88-1772-439d-f220-08d799c26688 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4502; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 00o9vDEIH5I7c2fbwwiuI+qBr1917nKaxC2DXOTUPMaa3/FMKKWdpLeusPOgx2Di1vJKvSfVd1/N9OxvvnnmYRoSVjYm/PNpDaxXoY61Zgz+6BovHjV+k5QyFmR8J73QiocZcGYe9ayev7TAYB74kJMTTg0XYrQtd1AXQInB5k4x38XlqNlbWBjELHtyBqvrCCYDLn2JTY8rbV2q8y7XFrtD76cZKWGdN8GwKNlnY7QdUU+XcbMYyIuMzZfheZo2gFhM7ewhrmWF0JqZtBLMpa1/RxHS39fK6+5fCRRosI8D/t7fRB4N9Ve2by1yCecUFpnAi348EW/t6SW6FtBarSREyX0BPWor6ETl+qn1B8/5T+lCUbwE/fAQ0zWj9IHLfKu5RRoviRSuKyN/jduBQhKKAG+jDRlQgg2IwiuGbckBoncLfQGEXxylKYZ1u3Bc Content-ID: <100D41C3DAA1E24A9CD8AF345F137BB4@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: feb40c88-1772-439d-f220-08d799c26688 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:12.0919 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 210EfQM7F/uvSJnvGkiwNuUUWlm4TuMvawMLZjNQVY3kHy2p36qWtS2jLd1bspi8ZJQtLImgeo9zEMThnNc1KQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_rcpi_rssi_threshold come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_rcpi_rssi_threshold() is dumb. It should pack data using the hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 19 +++++++++++++++++-- drivers/staging/wfx/sta.c | 26 ++------------------------ 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index 749df67131c3..a8082508fbfd 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -44,10 +44,25 @@ static inline int hif_set_beacon_wakeup_period(struct wfx_vif *wvif, } static inline int hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, - struct hif_mib_rcpi_rssi_threshold *arg) + int rssi_thold, int rssi_hyst) { + struct hif_mib_rcpi_rssi_threshold arg = { + .rolling_average_count = 8, + .detection = 1, + }; + + if (!rssi_thold && !rssi_hyst) { + arg.upperthresh = 1; + arg.lowerthresh = 1; + } else { + arg.upper_threshold = rssi_thold + rssi_hyst; + arg.upper_threshold = (arg.upper_threshold + 110) * 2; + arg.lower_threshold = rssi_thold; + arg.lower_threshold = (arg.lower_threshold + 110) * 2; + } + return hif_write_mib(wvif->wdev, wvif->id, - HIF_MIB_ID_RCPI_RSSI_THRESHOLD, arg, sizeof(*arg)); + HIF_MIB_ID_RCPI_RSSI_THRESHOLD, &arg, sizeof(arg)); } static inline int hif_get_counters_table(struct wfx_dev *wdev, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 11e33a6d5bb5..339acbce96fb 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -1033,31 +1033,9 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, hif_slot_time(wvif, info->use_short_slot ? 9 : 20); if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_CQM) { - struct hif_mib_rcpi_rssi_threshold th = { - .rolling_average_count = 8, - .detection = 1, - }; - wvif->cqm_rssi_thold = info->cqm_rssi_thold; - - if (!info->cqm_rssi_thold && !info->cqm_rssi_hyst) { - th.upperthresh = 1; - th.lowerthresh = 1; - } else { - /* FIXME It's not a correct way of setting threshold. - * Upper and lower must be set equal here and adjusted - * in callback. However current implementation is much - * more reliable and stable. - */ - /* RSSI: signed Q8.0, RCPI: unsigned Q7.1 - * RSSI = RCPI / 2 - 110 - */ - th.upper_threshold = info->cqm_rssi_thold + info->cqm_rssi_hyst; - th.upper_threshold = (th.upper_threshold + 110) * 2; - th.lower_threshold = info->cqm_rssi_thold; - th.lower_threshold = (th.lower_threshold + 110) * 2; - } - hif_set_rcpi_rssi_threshold(wvif, &th); + hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold, + info->cqm_rssi_hyst); } if (changed & BSS_CHANGED_TXPOWER && From patchwork Wed Jan 15 13:54:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216615 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6274C33CB3 for ; Wed, 15 Jan 2020 14:02:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 71F3E2465A for ; Wed, 15 Jan 2020 14:02:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mmuPg/nL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729093AbgAONyR (ORCPT ); Wed, 15 Jan 2020 08:54:17 -0500 Received: from mail-bn7nam10on2086.outbound.protection.outlook.com ([40.107.92.86]:6092 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729019AbgAONyR (ORCPT ); Wed, 15 Jan 2020 08:54:17 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i73oIta3UIL0Il+YFi/E86afFY9P4mOqydf9OmYlEo08WcbmvAsvz8ES1zk7sISVtByVKj72tXZI341UgrrFDHY3HNE79VwcaVJIJxKz+q+lQRa+QJ/+6WIcvSDf/Pl20QNyUuBB7xqPgFWefGSQStpZ9WwCYas8LFqcVjhw2VJxfSNyKjHJepZkS4ZSzbtvWiUgKou+/auuLYvrmHc14WkT6G2U/k0N0ceZLgwXXJWZCWfGszEhQROOawDUwXKW3WUY5+8VoFkup+Uj2+O38pg3mgys2d/L/yOomtGv3sPPC+4zMhmdxWpYY2jnfRaKrlbYQBVfYPFZyJxzEgPm1g== 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=tz6rRPqYovKmS4+0y3NaPK/jPsF16HaTkAo8p/CyYzE=; b=W1O7K5iRuCTL+Qresi4Z25XCtCPn4x2FLlCSmr+CNuzQofvPV9K9K4LNgKVhUe7fy4H+F500dSeMTCf+o5KGbiKe9EzgmX8IKlmIgMzzKL+CBlH1FaRxDsoDHfM5uSRvkyxerx+f3GFqj+fMO+2LxM8AQVsvh5d+6D7dQNbABwIQ9QasYzHBPD/vR3V7dYHWCckfK+1PHvK4wMT1MPIFnVd42eyjkpWzs2d8ey4fcC2Be1BKKr/Mc4lgzvB3/dcaOUFOxKVRoFD6rnRSUDoOeiLSPpLMzaCtj53Jk22ZMbprA40WIY0wjTTHF1fyYnCBXJAr+JEkSGyRkB2cyfo+4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tz6rRPqYovKmS4+0y3NaPK/jPsF16HaTkAo8p/CyYzE=; b=mmuPg/nLCez01hEmo4ZcRwVoRKzQPV7o4avaS4hmGuVK97MQRPmWgjodiyAZxiB4aYb3YBPDH7mrorqG82jpRjt8+FIjkeHTY6AqBGCDmdhjf03GQu54iuJW1ovHT6E/GhCM6lq/Dz871FcfbPcvy30ZtDo9gHl3WXBEw9LMPSI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:54:15 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:14 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:13 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 09/65] staging: wfx: simplify hif_start() usage Thread-Topic: [PATCH v2 09/65] staging: wfx: simplify hif_start() usage Thread-Index: AQHVy6tFUukb1+gu7kK1xSJ1YvHhDA== Date: Wed, 15 Jan 2020 13:54:14 +0000 Message-ID: <20200115135338.14374-10-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c9ee73ae-bb0a-4262-5a91-08d799c26831 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 89YiUnu7EjR+VMC+Fot+QCgnrB3p8+2eOW0NeJPwwZw2TS1mFUpZX29xNDw8+dKJdWyEb6JkNVpsuqOGGXmzkHRD72HTRi/sxwGCgrdyPyFATySY3DLzwu9aKUI9ERBD5w7jq/H8+W+3vOlFW7+RXcD4f63RC+x2bg/9WUtgCmq1Wx851G31mHMsgC+YZoeYH0AOSRQcfY8Kv7U9V+3OqRjIiFsSsydg4lgveGRbVRyGYc2FYmrtjvTPoUZcqaZkWGxjs4Fkc9Y1kJo0XskchItavTXfPGA4m48mZcADdDOzHZesysYzJu56G+5NuLv230ZDF7IbxeWjsgNqhAlH9QFGbC/b74M+fYSgU36j/dFy8Q30vZPW9peU5122M21JXSeC8leMe3UtyChFL9s2qXagrJosYk18KtvPGgca+sOC2HcfH4OlLKFilu86mcac Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9ee73ae-bb0a-4262-5a91-08d799c26831 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:14.8683 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: egYkPwFzzLIB7XZYzchzLtN+LNQmJWQMa1Yb3bXwzPWt3uvqfVk5wNJulfL/JHzRElUkKJegP77bMSpNq1FhwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_req_start come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_start() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 17 ++++++++++----- drivers/staging/wfx/hif_tx.h | 5 ++++- drivers/staging/wfx/sta.c | 40 ++++++++++++------------------------ 3 files changed, 29 insertions(+), 33 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index d8e159670eae..be3138590a4f 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -409,16 +409,23 @@ int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout) return ret; } -int hif_start(struct wfx_vif *wvif, const struct hif_req_start *arg) +int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, + const struct ieee80211_channel *channel) { int ret; struct hif_msg *hif; struct hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif); - memcpy(body, arg, sizeof(*body)); - cpu_to_le16s(&body->channel_number); - cpu_to_le32s(&body->beacon_interval); - cpu_to_le32s(&body->basic_rate_set); + body->dtim_period = conf->dtim_period, + body->short_preamble = conf->use_short_preamble, + body->channel_number = cpu_to_le16(channel->hw_value), + body->beacon_interval = cpu_to_le32(conf->beacon_int); + body->basic_rate_set = + cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates)); + if (!conf->hidden_ssid) { + body->ssid_length = conf->ssid_len; + memcpy(body->ssid, conf->ssid, conf->ssid_len); + } wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START, sizeof(*body)); ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false); kfree(hif); diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index e8855ead3a18..fbaed991b112 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -12,6 +12,8 @@ #include "hif_api_cmd.h" +struct ieee80211_channel; +struct ieee80211_bss_conf; struct ieee80211_tx_queue_params; struct cfg80211_scan_request; struct wfx_dev; @@ -51,7 +53,8 @@ int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg); int hif_remove_key(struct wfx_dev *wdev, int idx); int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue, const struct ieee80211_tx_queue_params *arg); -int hif_start(struct wfx_vif *wvif, const struct hif_req_start *arg); +int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, + const struct ieee80211_channel *channel); int hif_beacon_transmit(struct wfx_vif *wvif, bool enable); int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id); int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 8c55089b1ea4..660a75024f4b 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -740,38 +740,24 @@ static void wfx_set_cts_work(struct work_struct *work) static int wfx_start_ap(struct wfx_vif *wvif) { int ret; - struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; - struct hif_req_start start = { - .channel_number = wvif->channel->hw_value, - .beacon_interval = conf->beacon_int, - .dtim_period = conf->dtim_period, - .short_preamble = conf->use_short_preamble, - .basic_rate_set = wfx_rate_mask_to_hw(wvif->wdev, - conf->basic_rates), - }; - memset(start.ssid, 0, sizeof(start.ssid)); - if (!conf->hidden_ssid) { - start.ssid_length = conf->ssid_len; - memcpy(start.ssid, conf->ssid, start.ssid_length); - } - - wvif->beacon_int = conf->beacon_int; - wvif->dtim_period = conf->dtim_period; + wvif->beacon_int = wvif->vif->bss_conf.beacon_int; + wvif->dtim_period = wvif->vif->bss_conf.dtim_period; memset(&wvif->link_id_db, 0, sizeof(wvif->link_id_db)); wvif->wdev->tx_burst_idx = -1; - ret = hif_start(wvif, &start); - if (!ret) - ret = wfx_upload_keys(wvif); - if (!ret) { - if (wvif_count(wvif->wdev) <= 1) - hif_set_block_ack_policy(wvif, 0xFF, 0xFF); - wvif->state = WFX_STATE_AP; - wfx_update_filtering(wvif); - } - return ret; + ret = hif_start(wvif, &wvif->vif->bss_conf, wvif->channel); + if (ret) + return ret; + ret = wfx_upload_keys(wvif); + if (ret) + return ret; + if (wvif_count(wvif->wdev) <= 1) + hif_set_block_ack_policy(wvif, 0xFF, 0xFF); + wvif->state = WFX_STATE_AP; + wfx_update_filtering(wvif); + return 0; } static int wfx_update_beaconing(struct wfx_vif *wvif) From patchwork Wed Jan 15 13:54:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216616 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73AE4C33CB1 for ; Wed, 15 Jan 2020 14:01:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 38C402465A for ; Wed, 15 Jan 2020 14:01:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="evc5ZanK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729151AbgAONyV (ORCPT ); Wed, 15 Jan 2020 08:54:21 -0500 Received: from mail-bn7nam10on2043.outbound.protection.outlook.com ([40.107.92.43]:8538 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729019AbgAONyV (ORCPT ); Wed, 15 Jan 2020 08:54:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kHmE43A10rWxQ40JNx0Kjc1+mb23pNVRxpNFcs/RWqHqs+TzG7zgPEv6WHOjN7OGD08wDQCoLFPy3rahiGpaJsGxUmRGpcpFjvMf8dDLPTFQs6enJgfZuK3KiEzxJS2bQKse1f3EisBvzYlT5MZudO+UEFUS/zdSYdZbTq1sBLVtpEMtYekjovsNv5I8165gNelZDnKYdtsaxDJsJDrfmGDUq33q9uZgqaV3o6qn2Z44W038+xRIowlLZTYHfOKLPorJUgSCS5ddTrD7ZrRv7VZTUIojss3oLUfWumljQGsho+4tBtf7U9af+doJ+a+IkMcStLxihxTbU1KCntxmKg== 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=fhQww9H4Ug/YZqWy3+tCxx6M/uj8urd6WRAAOKOSgfk=; b=Xnj3a8tbaM1kBqCDssYh9xqqvgJFlrede1lF96O0gH4KZyYoKuVt7qJqWBTziIdp47wlzWZP78nIuRA8J08/A6cbb7O9sQr2kZahTZuCym9OwHImF1j+yYmyO+0vhfOpbAK0Uu2x8FgCgE9XW2njptsE6/18yNG97KFwUu+DR68jBlKhxVucFqv82urzgS4F7sqVStm6qyWIwuovKmHIUzmiLn4rfTi/42fIoITHMabm5OpKO5onNSpLUHRlJ9gppBCP3AXXT91YISnPEXOpq968lwn0cjk0EW21ckmg1W8sMnS0E0scOEcRYsmI21QxBK3mNUoSb9p1FR2v7XWeag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fhQww9H4Ug/YZqWy3+tCxx6M/uj8urd6WRAAOKOSgfk=; b=evc5ZanKjZdGZsQ+SDUri3ouy+K19BrvF+LADo3XCgjcE6V1L2gRwCt7Ux5YbikE2fmdSwOCgjpMR56I75I+T3bg0xXw2kDtL239t0Tixk6KBi5Fe8Z1XF1pY871QYrkMg7ta2H8uDS7koajD9iYB5nQVlYO+AUfrnY4dJNe6tY= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:54:17 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:17 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:16 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 11/65] staging: wfx: retrieve ampdu_density from sta->ht_cap Thread-Topic: [PATCH v2 11/65] staging: wfx: retrieve ampdu_density from sta->ht_cap Thread-Index: AQHVy6tHPpjVpkzfK0eN52IIaiVMww== Date: Wed, 15 Jan 2020 13:54:17 +0000 Message-ID: <20200115135338.14374-12-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b206454d-b500-45eb-8079-08d799c269ee x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:222; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oEBxX86NLPKgNAGOiLTWoFjxTCEqJjL1+gJJpw8p+gbTi38pmlfOSjoX9abkNBJmpy4+w7n/Vo0NSlHlmsEYD5AD+VGXIao0ry45c/Avyc7UtWfg3oyeptPe/MS9y5vJsE5UJR4DFsl14BnJFRKwk4eODaHUfJ9iJNukPEPw0S+R0iOfJ+eSJ8NJwrwRSrSky+pLiO4ZC/nbLFLdU4mtRPMMB/nxduf42lah4TxhOegQiYXC4vQ8/Xg8lrL15QfSjWXqbIzSfLaqWfsO7Y3hlWExuaCeg3qaUppd/oZ2HfBlWx/7bSvfXRB95O3VkOWC6p7BsBZ+Aon6GvNI30ccIGUxFXw4NOwOlyiU9UvRfVcM9Iwh48S+xA7UGGug22Mm4Ch332tadg5fiz1fYeXklrIAGds/AM8JmCdu2LnwkrVATfm24VFVabYDGMQCOOV2 Content-ID: <0E6B6FF1B93E4F4FBBEF3B9BE9CEFD05@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b206454d-b500-45eb-8079-08d799c269ee X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:17.7926 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: aE31wU3uQCSPvvzNPcCcJTBGuxl0Sayb9wAXhdas2HeX05tWc0+MY6jiPRVxcpSCUqq1ucd11q6ZOPKSLyCG1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wvif->ht_info.ht_cap is a useless copy of sta->ht_cap. It makes no sense to rely on it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 660a75024f4b..f13a5b41735c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -825,13 +825,6 @@ static int wfx_ht_greenfield(const struct wfx_ht_info *ht_info) IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); } -static int wfx_ht_ampdu_density(const struct wfx_ht_info *ht_info) -{ - if (!wfx_is_ht(ht_info)) - return 0; - return ht_info->ht_cap.ampdu_density; -} - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { @@ -870,7 +863,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, association_mode.short_preamble = info->use_short_preamble; association_mode.basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, info->basic_rates)); association_mode.greenfield = wfx_ht_greenfield(&wvif->ht_info); - association_mode.mpdu_start_spacing = wfx_ht_ampdu_density(&wvif->ht_info); + if (sta && sta->ht_cap.ht_supported) + association_mode.mpdu_start_spacing = sta->ht_cap.ampdu_density; wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); From patchwork Wed Jan 15 13:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11FA3C33CB1 for ; Wed, 15 Jan 2020 14:01:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C916C2467E for ; Wed, 15 Jan 2020 14:01:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="OzdYana7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbgAONyZ (ORCPT ); Wed, 15 Jan 2020 08:54:25 -0500 Received: from mail-bn7nam10on2043.outbound.protection.outlook.com ([40.107.92.43]:8538 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729163AbgAONyY (ORCPT ); Wed, 15 Jan 2020 08:54:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FP4fI6IepO3jn1zwVjF37idcEoruE2fKs1O+lFoCaCDEspiXp13edo3RudaStG+pzVMiQCWMOMNgIWEXXX6ScNrrWWUkEMrzVOVbO2VH3gfb0MsRC6oDgYxHqKJnEJ39ZQVjOVKQDx+NrHCVcCBGnfrCN5dWEIlfrhubB05Tn/9NRqmxGWQnbGC8CPaL+9iSQLZLtsCvNPg57dPOSKmSfUT+pAhOJdDuZj3wBowo3zBtICwWO1aqz3R60+pywL5lopVbMT+Jp/TdPL2WUHz/Fg2hrvkxZCFmEyel+AggkK4jb5mlfGZaKWnzB9lwDhFvHfgg1TxaipO+aQ4iVc7QbQ== 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=TkgqQrIIiJU7w+2JUxpXKH/R2F2qsPbaxSas1tRjHT8=; b=NlQBdQk+p0jKXswUr+i/8+t5kl0T5b9AMWlmBJBFC/6QL57PnRFsK9vISKNq2dhhrdfZcPG5n10lt+N1f5ABHSoOU1OFX6MOTGAnFRBfvpH8uLTAuH+8wL4sHwI/GtgioRV3PielKrrUok63ClgQ+Uuy4jgFbySRs1IvxTEc/bei8dIZkutRH7fyHEsln111rbfJgf341ksgTjRs36jcy1dWCB+XGcho54QbVT29UwhpHJLKZoN3laNBhgKsXUBEMNXLiJwpEze5YX5aN72oQIzz0aKFzOn3ilOS20PjvdmyXDG6CmlPuR7fGOUAkKHNVh1HGLMquSIVu+J52mt49A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TkgqQrIIiJU7w+2JUxpXKH/R2F2qsPbaxSas1tRjHT8=; b=OzdYana7CgtzK+ik/JIZ/Wc4p+1OvNX2IQfVIGR/fy5/Efhu4Zi0QU1crq/+CEtw2ibOVTK8GHzHkpbWcsWA59TDiuLuszTuFhcl0CmmfOJzGaAIi6EWsawGzfLIFWJHZ9Y+NDymVeKvSPnVqztAE4VLoyWjSgQKdDe59Xii/cI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:54:20 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:20 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:19 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 13/65] staging: wfx: drop struct wfx_ht_info Thread-Topic: [PATCH v2 13/65] staging: wfx: drop struct wfx_ht_info Thread-Index: AQHVy6tJ79W/WzZaRkeK96ItHLEj3g== Date: Wed, 15 Jan 2020 13:54:20 +0000 Message-ID: <20200115135338.14374-14-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2fc063dc-0788-4e5e-4cc4-08d799c26b96 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:242; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(6666004)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9lGYzE6mgO6ulIpLpbpO1z90TltrB79KZuzk1MNe1f8lhOz+EU9xXe3WRYAZYYtAWJ3R8qMG5J9oV7mEAl5garzeFfarvIotuSMzPz5qqUG39A3JPUV/w/+0M8OSRa71rI6NSGjcQ6BxJ8fBcyAEjgzDh94lwVUV2yKLHQBgldT/mEhmFYGGtc7g8PCKkcc1Mda4AnXJCSrzerGkwnxrTYvKP5UtzCXdXZreZokaesSirQ8bYe/iPiCGdnDk+s8KA9lRW72/b54sFzJqUGQRoDk6+8LArPbBM98dVT/xvoCS232q76l2wubpcNcAYwzPshG5YXzJ+40MMGfTZ4U0yBwpwLbFqFo+Ai8V7UR7/xFLuWBMbGGAhfaGZihnnOB3orP2uEqVzkhXlJalpkuYbYeL5FUmEWY08jW7khExVXHMowp/YCRv2VgosZkopjwP Content-ID: <4074A93F9E914341BC8F6A807A33B556@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fc063dc-0788-4e5e-4cc4-08d799c26b96 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:20.5610 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: oV5LDy3jpubjx7z70NjZrZJbb3BkJZwOLzvqHYBZnsz17PNicvpKYdnFBRJibwS9H+TZXVf2a7nPHDxdqPj+5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller This struct is no more used. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 +++--------------- drivers/staging/wfx/sta.h | 6 ------ drivers/staging/wfx/wfx.h | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index fcd9fe66e417..dd2d0422c9ca 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -517,7 +517,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) wfx_update_filtering(wvif); memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); wvif->setbssparams_done = false; - memset(&wvif->ht_info, 0, sizeof(wvif->ht_info)); done: mutex_unlock(&wvif->wdev->conf_mutex); @@ -812,11 +811,6 @@ static int wfx_upload_beacon(struct wfx_vif *wvif) return 0; } -static int wfx_is_ht(const struct wfx_ht_info *ht_info) -{ - return ht_info->channel_type != NL80211_CHAN_NO_HT; -} - static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_bss_conf *info) { @@ -830,17 +824,12 @@ static void wfx_join_finalize(struct wfx_vif *wvif, rcu_read_lock(); if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); - if (sta) { - wvif->ht_info.ht_cap = sta->ht_cap; + rcu_read_unlock(); + if (sta) wvif->bss_params.operational_rate_set = wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]); - wvif->ht_info.operation_mode = info->ht_operation_mode; - } else { - memset(&wvif->ht_info, 0, sizeof(wvif->ht_info)); + else wvif->bss_params.operational_rate_set = -1; - } - rcu_read_unlock(); - if (sta && info->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) hif_dual_cts_protection(wvif, true); @@ -1224,7 +1213,6 @@ int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, WARN(wvif->channel, "channel overwrite"); wvif->channel = ch; - wvif->ht_info.channel_type = cfg80211_get_chandef_type(&conf->def); return 0; } diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index b5d8d6494157..e0b54332e98a 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -23,12 +23,6 @@ enum wfx_state { WFX_STATE_AP, }; -struct wfx_ht_info { - struct ieee80211_sta_ht_cap ht_cap; - enum nl80211_channel_type channel_type; - u16 operation_mode; -}; - struct wfx_hif_event { struct list_head link; struct hif_ind_event evt; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 0a3df382af03..ba6e0e923f4b 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -113,7 +113,6 @@ struct wfx_vif { u32 erp_info; int cqm_rssi_thold; bool setbssparams_done; - struct wfx_ht_info ht_info; unsigned long uapsd_mask; struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; From patchwork Wed Jan 15 13:54:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E18AC3F68F for ; Wed, 15 Jan 2020 14:00:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 490DF24656 for ; Wed, 15 Jan 2020 14:00:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="camq1mFN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729399AbgAONyl (ORCPT ); Wed, 15 Jan 2020 08:54:41 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729335AbgAONyl (ORCPT ); Wed, 15 Jan 2020 08:54:41 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBsIqiBiA82e762SDIMcmxCafiZWADlND/nZvAMpIFLYGxfyH8NNQyFO6e8Rt6pmpUpiyXCKTAR05ovPZU/KwC3BcMhIh8iY1spMakqdrxPGT9Vx7NJARgMPKKKJgQsocNGsT/kmQIQXx6M9A/KRTk2FniLdK7rSaDFO9fB8omEdipXZm+bCJKsAYQJ6z249Be0Sx/BnyRF+cA0BsxY0pm8J7OhjOSLaf+lRqQmM+DqBcLie97zA/TXyn7aFiJ1Vr28BaSf7vVOtq+VAEPvEb+H64B+0bp33oKLOzDmGwhiZWhEw5uuXZJ44mBepawAJRa9zBZVDtDdBbf5ArDyfgQ== 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=1JtJ2THuxCUky/HiJ4NGgOwKReUaawaehfR0nk8oPx4=; b=gQW09Fdgf4ycuKE/j4AlTq50sPUEMQVUegotTUsC9R8vIztS+3ZcJ6oNGDymOMWbK8f+ZOtEfNOm73tM2KcYudmMMqBGDAVk/6ktFI65cOPVXvYfXUP/E0K7xWi0SFazDVCZlFYdEhqBFklnrPdAwhU86NAZb1BbaLwRJdsmbxyKqv+/pd8Bctdam3CKNhbam8uNM5FBQ26HDTP4wxUNrJRMBAAThQXk2EpilZGy+IiQncczrkg1SOXnER0GMmgxfpdP8kFjqTClAjhzSdH+hZbMcePN9xf2YEX6zeRR64u8s+7H9DliAK910grNf+ppjm1B2hZ9IpZ5qHmyjG8/Og== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1JtJ2THuxCUky/HiJ4NGgOwKReUaawaehfR0nk8oPx4=; b=camq1mFNEHGWzFf0+1PIeKKfAxG7AmtDENznJOAX9l8i+vNrHSmGjK61vJHnMQFdIFBAATAiicYIzKhE/lA8xkm4DH585GJ6IWATSoRc8R3kbRQ9RTlHkEFpxYDIU97YwTjx1UTK1mB9shlxNNqbnhuSfvn0leVt6PyoJwtgV+A= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:25 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:25 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:23 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 16/65] staging: wfx: rename wfx_upload_beacon() Thread-Topic: [PATCH v2 16/65] staging: wfx: rename wfx_upload_beacon() Thread-Index: AQHVy6tLV6TNFz6aKUGZU44vHfJ7Lg== Date: Wed, 15 Jan 2020 13:54:24 +0000 Message-ID: <20200115135338.14374-17-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9ff9ee08-318e-4102-70ce-08d799c26e25 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2449; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PHyyUWc/7HCNwLQXISJNp6Y39oF8BptRC9Jhiy92nOWNpI13MWpO28wZX5y5b4Mvw5aQ7bbl6K6LWBqANaW3lVOd0U4rW1xmX4YthbtLX8LnnzflgQiYwx/kKxt/Ta2jc/RPkYlhZ0zis561BnQaCs5fWo/v5orp0H4d17gaZfi977EneTEbRJV71j90gjSYceW/dNV36TGLxLyKmbqvYR+J3csToFb88jHk22ef1DJh6htQsLoMN3Gvi7x/9SuG/2SVn5e/ZTj8baDmnsMUfIu7mQUS8mqDLmpDL5ow0ve9Vt5720K6wolG2RDk38uJHidqE7U9AaJdykFHpaxrPUy1W2Rj3RyLIJbj0He9keKNaWEOE5EpQIUHaK3rN1Hql8l3oIwQ3Gw4Qhwm+c8yPvRJtuNUNDDtSSi2VMJa1/A67gPUgeII2M7D0l/IZPJA Content-ID: <7B7267F6236A404F93A77C3555A1C471@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ff9ee08-318e-4102-70ce-08d799c26e25 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:24.8756 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BZHDlFPv2q78CBTC8m1L0A4jHoCGXehlsdREa16gm3u+vM8OLJihEC4T//3Ly3rmYWgfWUy4TKzpBky433ArIQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller In fact, wfx_upload_beacon() uploads beacon and probe response. So, rename it in wfx_upload_ap_templates(). The call to wfx_fwd_probe_req() has nothing to do with template uploading, so relocate it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 451d0108a1b0..fdde7ab92302 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -780,7 +780,7 @@ static int wfx_update_beaconing(struct wfx_vif *wvif) return 0; } -static int wfx_upload_beacon(struct wfx_vif *wvif) +static int wfx_upload_ap_templates(struct wfx_vif *wvif) { struct sk_buff *skb; struct ieee80211_mgmt *mgmt; @@ -805,7 +805,6 @@ static int wfx_upload_beacon(struct wfx_vif *wvif) hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, API_RATE_INDEX_B_1MBPS); - wfx_fwd_probe_req(wvif, false); dev_kfree_skb(skb); return 0; } @@ -900,7 +899,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, changed & BSS_CHANGED_IBSS) { wvif->beacon_int = info->beacon_int; wfx_update_beaconing(wvif); - wfx_upload_beacon(wvif); + wfx_upload_ap_templates(wvif); + wfx_fwd_probe_req(wvif, false); } if (changed & BSS_CHANGED_BEACON_ENABLED && From patchwork Wed Jan 15 13:54:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216621 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0CE8C33CB1 for ; Wed, 15 Jan 2020 14:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C20624656 for ; Wed, 15 Jan 2020 14:00:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="XGDtkF9T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729427AbgAONym (ORCPT ); Wed, 15 Jan 2020 08:54:42 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729378AbgAONym (ORCPT ); Wed, 15 Jan 2020 08:54:42 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UJaanCjTatpOTrUaOSDqisAZX2i+FuiGfMbhglPSAVH00ahXUOh0cq4Q2eLv/hkQEh9kh8d8eWYyP4PzPQgcv3bGT2N+afWFx/XQ+ci2XwkjHI9aviQipPED/2HEpwP0BeARt9CV4k3YkQ2Bfhh0/VabR5gKyc2jIQcLIykx8Qa51RauTS8Lm3E6FDQKggDILG9lj7VJNsPPmJP1S+lphCMjqCuWtXxShNJ7fdlPrx+jfN1zqba+w2tUrbtKiGtAu8MvNCrea3SPsIo1koLI+AzfoqO9dV3RNZaVad5DCO8G8XblSthA9q3o/DgUE/daWFdyIvziobquUI+n6Ecv0g== 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=vzVf8PCsjhv48CVwVz+IbX+oGTKM2/8Ap4mn8+5bTGE=; b=BfVJFgf67nDRo2+z1cG0jjy3csHZ8S/Vrmry94eqhYk179uLEgRx3E1SK9PNc2NdIiw0xelAWIHDw98J9046QM4n2NaxoMYNqiGdi0pnKZ96GyPGhoxg79puf6E8BmYho5YdCF4BMNYCLHPFIopYHHXudAOQXTOf70rymMncj0315ZOjrQkQEM6Mh2WQjvpBEzHeX8AuV3sRyYndQZKkHrEtBRO/XJKxsKZ60K4SsrwDZOBD539T28Usz+Xm2mYkWOzKmrSNxumCglCJRBY2uVFI3QsWactnXo5vOTt14cOzm6ewhRX9ohYeAXqlp9uR6AIegm+oZv6XLpXnTz2/qA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vzVf8PCsjhv48CVwVz+IbX+oGTKM2/8Ap4mn8+5bTGE=; b=XGDtkF9T+Kp0mI65nMRvvvpFro8hovIrVxfdSrh6asvC/TGEoJM0//gwJ5cxHpMhRf53MtSUWo4P3PqJ1GCWk6dVODZdSedaRS1ddBGwICXhensBleyc0s+rDXPWZE5Zuxv1IQkKXuGUVY3sPFu65lVd2gBnWuMeHsvqlCrebGA= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:26 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:25 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 17/65] staging: wfx: simplify wfx_upload_ap_templates() Thread-Topic: [PATCH v2 17/65] staging: wfx: simplify wfx_upload_ap_templates() Thread-Index: AQHVy6tMm6Ei/ubRgkWvfX7AxA3Pvg== Date: Wed, 15 Jan 2020 13:54:26 +0000 Message-ID: <20200115135338.14374-18-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dd43a2a5-47bc-407e-3228-08d799c26ef8 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Lq4Fk2fm81heqR5dIkGWvE6YbPzgHF86ivMmt62pt2l2vv2hWIPP9O31aFtPgy1T8P25upqpd88ga7EESw2gp3spPDG1FAKt+LjFWq8twlOqZbvB79XwXeUVSxyIT7tN7lwwjWig+VG6hbkx4nySym4GKjK/eqYAiE+vgt+WZVxK5/yc+VKtuzvQz203P0wZFDSJhr+DonqiCsGS+XXIVp+3kQ1tWagPYYOwgbHC8K4EknyBGELRuAvVvnzofZBh/ZcExi7SxTbPB7HjszvbVtF2oGpGq13DE2tGI2iopEmdT5mcHcwBJa+p+fTQjL9L9kYEiYylElZhIKnfjp+KdohiLdGX1/dFGl0pFJeKdUIY7U0Qk/a1FppYd6vZF2ct8NYB83TH1vkLtcCDjo/9YHInSwjKEbJlP7UVG7PYA+nITL5C4Zp03isq7CJGoLz7 Content-ID: <6AAE882B4E271E4CA0420451E9A569DF@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd43a2a5-47bc-407e-3228-08d799c26ef8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:26.2628 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IMgMxJPLUosRPpSAHJy1VrFi7W4CzjTpA8ydoRoTz4bWmTJntEzUTML7bcRUdzyXXsMIMsuPKpzqaVf+X2zOJw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller This function built probe response from data retrieved in beacon. Yet, this job can be done with ieee80211_proberesp_get(). So, we can simplify that code (and fix bugs like inclusion of TIM in probe responses). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index fdde7ab92302..1181203489f0 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -783,7 +783,6 @@ static int wfx_update_beaconing(struct wfx_vif *wvif) static int wfx_upload_ap_templates(struct wfx_vif *wvif) { struct sk_buff *skb; - struct ieee80211_mgmt *mgmt; if (wvif->vif->type == NL80211_IFTYPE_STATION || wvif->vif->type == NL80211_IFTYPE_MONITOR || @@ -795,14 +794,11 @@ static int wfx_upload_ap_templates(struct wfx_vif *wvif) return -ENOMEM; hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN, API_RATE_INDEX_B_1MBPS); + dev_kfree_skb(skb); - /* TODO: Distill probe resp; remove TIM and any other beacon-specific - * IEs - */ - mgmt = (void *)skb->data; - mgmt->frame_control = - cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); - + skb = ieee80211_proberesp_get(wvif->wdev->hw, wvif->vif); + if (!skb) + return -ENOMEM; hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, API_RATE_INDEX_B_1MBPS); dev_kfree_skb(skb); From patchwork Wed Jan 15 13:54:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9739AC33CB1 for ; Wed, 15 Jan 2020 14:00:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C52D2467C for ; Wed, 15 Jan 2020 14:00:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="dvcZD+Gb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729518AbgAONyr (ORCPT ); Wed, 15 Jan 2020 08:54:47 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729454AbgAONyq (ORCPT ); Wed, 15 Jan 2020 08:54:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Te0daHa6Hy88EMAnbIKWHh99DYl84LH8Wc2QTkB6uwPmZH9w/YQ5ImcWS3LivYzoJdG4r8v/d8GUCEhBPVIKDxv1DnpXkjRWG/oCzlHxhpiaqSTisAhnt3/Lk2T31Sd+J+se7o1d1nWdMHzQN3gPv0e0sGSDbLInIAyoD/vPH2clvB4dx4CSj2ApIXn1lcJM+CN+STNKeTjzSyySv+zccODObeUQmQqVv+YEgnWKL8m9uS/C3fq7ImicJYhFjy3gqLcv4qmvcwf2kgpYN+ZYp4djD/ZGACUM4jluEvnN0U2gD1DBKvAR780ig0DKUM6ndSc8h8nss+kw3m1RqPyPcw== 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=9v8lmwrZH/RnjmTRFxIndgVQtr5M/Rb020b3Yufs6f8=; b=czBbthKRyd3vyj0NGMthtLLHrpoAPA5PbjxtGDgZMWkwUZYEZ06cbPM6acSyPRsq9azZFO8GfThzOAkLXgyAS/npYqrUI382LiLKwDOwKjhK4s+BZavtB3Ioak3eJjNkhTQ8naH/apFogeckLx7a00DhYYSWZQzUzH9GIJUdGb2B+87jEOeCqX8KqxLi5KRpWKxOuiwEbEliDNueAaNouw9FjvwgMz2DhN8Ju+3XiHrHXKbqiEgP8pHbQhD5rFQwmaSfbUIA5Xhhb4miZSlkmX8DfCRU2hp3U3ZCH5SIk+amLQMpwb2ZvEZtnwS5zSouNu5ZAxn5XYmh397g2zaZYA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9v8lmwrZH/RnjmTRFxIndgVQtr5M/Rb020b3Yufs6f8=; b=dvcZD+GbmbUOcpCx2CcJ4GK/g9PXyTKzHgjKHRNFZmUYoaFxxXm0vw69NLXiOHkPUQFFAsnUhN+UyoYas6PMZNiFhZuAY336Eba1vG1ByHPpMChyVqhqQx2jJfMeQe7M48BXtrxnge5hCaCFLdx/Gqf5CiQiVBXyz/0PXkGJMmU= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:29 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:29 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:27 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 19/65] staging: wfx: fix __wfx_flush() when drop == false Thread-Topic: [PATCH v2 19/65] staging: wfx: fix __wfx_flush() when drop == false Thread-Index: AQHVy6tOjJgVdNaIeEm4iALKY8/T+Q== Date: Wed, 15 Jan 2020 13:54:29 +0000 Message-ID: <20200115135338.14374-20-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 724be364-0141-4c1a-c623-08d799c2709e x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: BFVKgGbPcwqP6yrBXPBYCLM/QwwwUojMH4+1vw01rffuoidf+VkdyLuYSpQGDb6pA4Xr9caSTyDQz+/zzr5xWN7yrs8EsKzuEPQdJKNmmrarTzXCr202D3AflRYRuz+5uzWDKy5u6e4eNDdiQ+MVA+UDTeTr37481iFiakwt0eWbaF7Ux7gd1IWktKuMEGgfSaB3oqL6T0153HnXs05QgkCa20F+oPEHEE7V1wSRWd+wG5H4wHw19nnTTN2z4PiTA4xexJLpgj/9P1rpC9Juzva2ZFdNCPLqFpswNfG6Kapoim7oV3O+zBcDAMeveXJtjhaRcqobqyippeO3EwUvNUn0+llSw714PMuay7Z8kdMV+pV7DLF6u2F+smHjaMRdbVI6YWCLj+Vi1zjmEj3Q5IhITlf/KYr+M3YlCxm0rIaJKYOaoAtTBHkX7Nq9S/Qt Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 724be364-0141-4c1a-c623-08d799c2709e X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:29.0502 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lOQbPPAs26qcXBwIoaLFSyKED6qyoXoC2kXYXnhL6atqzXXU2Oi/3YGG64FPt/MtdF/3QlZXM17fqxZIfwJrWA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_queues_clear() only clear not yet sent requests. So, it always necessary to wait for tx_queue_stats.wait_link_id_empty whatever the value of "drop" argument. In add, it is not necessary to return with tx queue locked since all calls to __wfx_flush() unlock the tx queue just after the call to __wfx_tx_flush(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 2 -- drivers/staging/wfx/sta.c | 42 ++++++++++--------------------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index abfbad7c9f75..92bb9a794f30 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -31,8 +31,6 @@ void wfx_tx_flush(struct wfx_dev *wdev) { int ret; - WARN(!atomic_read(&wdev->tx_lock), "tx_lock is not locked"); - // Do not wait for any reply if chip is frozen if (wdev->chip_frozen) return; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 0c73691ab736..3d665eef8ba7 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -343,42 +343,25 @@ int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value) return 0; } -/* If successful, LOCKS the TX queue! */ static int __wfx_flush(struct wfx_dev *wdev, bool drop) { - int ret; - for (;;) { - if (drop) { + if (drop) wfx_tx_queues_clear(wdev); - } else { - ret = wait_event_timeout( - wdev->tx_queue_stats.wait_link_id_empty, - wfx_tx_queues_is_empty(wdev), - 2 * HZ); - } - - if (!drop && ret <= 0) { - ret = -ETIMEDOUT; - break; - } - ret = 0; - - wfx_tx_lock_flush(wdev); - if (!wfx_tx_queues_is_empty(wdev)) { - /* Highly unlikely: WSM requeued frames. */ - wfx_tx_unlock(wdev); - continue; - } - break; + if (wait_event_timeout(wdev->tx_queue_stats.wait_link_id_empty, + wfx_tx_queues_is_empty(wdev), + 2 * HZ) <= 0) + return -ETIMEDOUT; + wfx_tx_flush(wdev); + if (wfx_tx_queues_is_empty(wdev)) + return 0; + dev_warn(wdev->dev, "frames queued while flushing tx queues"); } - return ret; } void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop) { - struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif; if (vif) { @@ -389,10 +372,8 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, !wvif->enable_beacon) drop = true; } - // FIXME: only flush requested vif - if (!__wfx_flush(wdev, drop)) - wfx_tx_unlock(wdev); + __wfx_flush(hw->priv, drop); } /* WSM callbacks */ @@ -1046,8 +1027,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif, &tim_offset, &tim_length); if (!skb) { - if (!__wfx_flush(wvif->wdev, true)) - wfx_tx_unlock(wvif->wdev); + __wfx_flush(wvif->wdev, true); return -ENOENT; } tim_ptr = skb->data + tim_offset; From patchwork Wed Jan 15 13:54:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216624 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFCD1C33CB1 for ; Wed, 15 Jan 2020 14:00:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7ABEE2465A for ; Wed, 15 Jan 2020 14:00:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="A0BHqJxA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730054AbgAOOAK (ORCPT ); Wed, 15 Jan 2020 09:00:10 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729505AbgAONyr (ORCPT ); Wed, 15 Jan 2020 08:54:47 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b89zrAxxqyI7YeNKQhi+CF1EfL9rgIMi23rb570wXvqclOFHVg8BUE/ygkGPKdVVYDjAQ0ODHgyVTjrZ1tS0SeJ1JtiaOAbZPg4OdqBo6zF8SbXIUuQQFgpqWnJwqVohTzQE5+0bk9eG+i6s0D82yuol4x3d/F4vi8toqzaNp6byMSZcUy/oe0IPIEVkY8EudMz7CAvvbbb3StZQ/AjTEgi665a+wWn0ZVhsxRganzDaVrBsxOww+A/1aZlqw2wsEu4nXWKjfv0AEaetDZbimbZvMGN+uEfluptAElHR8cLdOpfY2+7AxqyA8mFAFn7eI8ThyiSRy8FEtRWBEFxNDQ== 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=n2ETDyqVciDrVTsElmWoRWuQT1mIpukmooLN9gH5YIg=; b=ghn/ePOBuV9ZYhWeFB38ZD4D5DGChAqYb41mW3HbG7L83KjGekJ90E26gNpyV1pmFUJoVCq0/zzgOihHeiPajyJ6JWm74caOH5tf/E/PRuDSfYSQM2FktIbhkGBI9wyPpDDuCmm8+AXtf7q2Co13u6wK1QNlAytYWtIq8p5/gB116HixiY3QrhGiPAfwvaKX6KOkxKcLtlCRbk9N7evjmbmw6abGPA+qv3ksHJO5/vqpfo3GVCSygrtRitkudD3OFRZcDamkk48mGwUkL9H09n6vgfXajkTOneSiSJNebjJSIYVggQl1G5GLkWsza6mvKxtHtb34RAKBGTL3ESFgGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=n2ETDyqVciDrVTsElmWoRWuQT1mIpukmooLN9gH5YIg=; b=A0BHqJxAKTXmLiJKpfO4APM7cgMqEJnQMTPvvjiNtI0MzmqH/LMKBYDS/6flG90XmOxst7YW+RDyOfvlk3/b8/oxYn1HvU92SCh9D+HOPkXXxv304/QJs+Jtkj5cfaJ5NwYdHGGi/75EItB/KwoP0KnlBd/2q6wG6NBBh6Njtjk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:30 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:30 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:29 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 20/65] staging: wfx: simplify wfx_flush() Thread-Topic: [PATCH v2 20/65] staging: wfx: simplify wfx_flush() Thread-Index: AQHVy6tPXDDCxzgink2P+uB/DsLkqQ== Date: Wed, 15 Jan 2020 13:54:30 +0000 Message-ID: <20200115135338.14374-21-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8c1ef2cc-c5d2-46b9-faaa-08d799c2718c x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(6666004)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: PQ6WGLr+WSDLKZeXVROcmb3LD6lbE8c0JqASfNMlYO/70WwfTLNlpdyJ17SfFxwPV6oLTedP8I6WtUGXMw49pO4ZEsDWFlFDF56czpKSL6AaEOIeJiZSVNAThWVxa/Z09VTmG/LdyConVdHQbZ/3SpxKdH76lOleFIKvOyhD0RaDjcZhVaR9h6jKplfdVPc+pCUF87JlC35Vf4JVDKFOERLijcCKdL8P9S2cdt/Y6X3CTBMlBfSo2hrqeo/tj/nL7NKobEA8ZETqvJr3e24yUzPNWB12x4kmApZqb+aAU8+a7WoedpPod+RyQ5e6aZ6R2N+RBBEPmOGyqr64IMSHtvJPBap9AfZ8yfZoqBJ5qaxNrUTfE332yuPkVrT2ZgnQrygvhmNJAmN1tGdEVLBwgzKszSPXTEvQbnYc9OEtE25mWVe5F4coNQC4pIJq6L1B Content-ID: <8A2F20680412E2468A6FE0BBE067C37F@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8c1ef2cc-c5d2-46b9-faaa-08d799c2718c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:30.5733 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: p68uYygqgZlJMBcI/NxPR5DRIYgur5QkQ+FZOFeuQsh37+59rdgL+CMVKfljfDTvnpTbQF47em7dSNUKEZixOA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Current code of wfx_flush() force to drop packets in some contexts. However, there is no obvious reasons to do that. It looks like a workaround for a bug with the old implementation of __wfx_flush(). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 3d665eef8ba7..ae01f7be0ddb 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -362,17 +362,7 @@ static int __wfx_flush(struct wfx_dev *wdev, bool drop) void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop) { - struct wfx_vif *wvif; - - if (vif) { - wvif = (struct wfx_vif *) vif->drv_priv; - if (wvif->vif->type == NL80211_IFTYPE_MONITOR) - drop = true; - if (wvif->vif->type == NL80211_IFTYPE_AP && - !wvif->enable_beacon) - drop = true; - } - // FIXME: only flush requested vif + // FIXME: only flush requested vif and queues __wfx_flush(hw->priv, drop); } From patchwork Wed Jan 15 13:54:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46F4BC33CB1 for ; Wed, 15 Jan 2020 13:55:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 04F6E24656 for ; Wed, 15 Jan 2020 13:55:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="pmBQS2vB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729708AbgAONzQ (ORCPT ); Wed, 15 Jan 2020 08:55:16 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729406AbgAONyv (ORCPT ); Wed, 15 Jan 2020 08:54:51 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LFhbqiP9LdUhhb+zvp5qN0FP6vOqdhULZoBDJNaamSALS5BJBcN4YlfRQuWly5hnsrcMlaGu1ge0hJ+L4qnd2jfLkUHxO4Sp0eVhl0olYqOHVwEeyuHQjdq/SSqCyRGkVmTxI42j55VGKontp9utJ2da5ugnVc3TcTKU/rCIok2IgV67DXJNrWKVXmoU2E1ziBeliCwXGInEAlkKQRcwGoHDp9jsME1lFAGpSYLDJPURAnzUz4eyO8K5xr2nLvvR8W/7l3JDgXTAYU3gVm4CznstyteKfCGDY4c64SZ8JrTX8rptdnmP0ww3aVw6NWr9K29TNrClA+6OHa8hO7Viqg== 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=ZlidXQn8i1jas5J/LLCgvEICvbLWAL1DhgHsKcUtOo4=; b=bWZR5XkuC9XVdoCvlAqm5yYr5bnRE5kND7M1jFdtIh9zlKonRoIjlfoVuYIUlxk+BDkmzG465LplvXBVpMXtodlH7RzWk2W4XxdhYfmUcMF/EQ50slv5eFbo73cVxUfzNWr+kr6sHm55cWrvZSxNHjHpWbBbsILQ1rg0NnR1CppIPY98avu1rCEaLFGqYa6P58KCp4wFOYPNs21UyZX8v/yFzFEciR9EOVskLgK9YN3B5JSAdp5vv1f0Se4ubUCSFr7tpDzShj1YOZxdKrb2HGllwaWqP355/V2tEloPhQwFAwwaRvm06u8WN7eKbXCj7pPCkoeQzfBenEYibJVfVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZlidXQn8i1jas5J/LLCgvEICvbLWAL1DhgHsKcUtOo4=; b=pmBQS2vByotYiK4T/5SjLR+aaR9s2nMK54GLRss70JHy62dPZhLF6Yw5Ll+oIl28Ed2+r3wECIYGqOvB5jRuC++PTlWFkV1nQ/qx3VTIya+thmwI95V0h1XvjvIIqf9jzty2OtqN5mo7miwT92fYVQf3ugMXITXfLaVSyvFnuMk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:32 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:32 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:30 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 21/65] staging: wfx: simplify update of DTIM period Thread-Topic: [PATCH v2 21/65] staging: wfx: simplify update of DTIM period Thread-Index: AQHVy6tQO+AEslTb7E6I36qEIrOx5Q== Date: Wed, 15 Jan 2020 13:54:32 +0000 Message-ID: <20200115135338.14374-22-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e1b09bd8-831a-49dc-d6e8-08d799c27290 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2657; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(15650500001)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: awVaB42Dq5oF2MHnp7yFsTSsCLhp4/t7XNBHZH2vXmg+U8m6u+xBf7ceT6BtvWbrXx/S0Ho4ebOCDxe5+kx/N+ex20sMBZOVPjasCmEBIze3/AF6wZEQZdTa3HrmqlxjQBGvte1o8m5tP2gcO3lNdw2bDQAK+/i/2QTJAqXOUok2UJh13Rod5LkeD0FcF5rWB3R5IRiTk8U4rP/jcc6Bue7yxOtPwC1F38Vtthgp222j1BPA4yCikdyYDw6Y+GsjCDWZcMReOwfwZBePqDYQZPcu4W5q2mh+zSUgzN9AvHJCWkN5rwso+TREe+61zlSGaQXyWO97zQHDW/c8G1u+7+zsPOI/hUxntJmGCBJdjz9bJsd2IPUT+0flBRzZI/xk9vOmAKc8JtpoFo0ZQnN4awrbojKc6T76le3S5JvyLprYofX5legDm1lCWRTYS5Wq Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1b09bd8-831a-49dc-d6e8-08d799c27290 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:32.3682 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /T/thh6jwcAO/829DDYsCj7CW99zznKY2mrRHcxk3IsPYhNewayCTSOGKjGSpt1yG2dNhf3Ai4ZLgkDZp5hkQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Current code parse the TIM and retrieve the DTIM period. It is far easier to rely on bss_info_changed() for this job. It is no more necessary to run task asynchronously. So set_beacon_wakeup_period_work is now useless. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 14 -------------- drivers/staging/wfx/sta.c | 19 ++++++------------- drivers/staging/wfx/wfx.h | 2 -- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index d460c0ffca1f..0ab71c911f84 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -173,20 +173,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, !arg->status && wvif->vif && ether_addr_equal(ieee80211_get_SA(frame), wvif->vif->bss_conf.bssid)) { - const u8 *tim_ie; - u8 *ies = mgmt->u.beacon.variable; - size_t ies_len = skb->len - (ies - skb->data); - - tim_ie = cfg80211_find_ie(WLAN_EID_TIM, ies, ies_len); - if (tim_ie) { - struct ieee80211_tim_ie *tim = (struct ieee80211_tim_ie *)&tim_ie[2]; - - if (wvif->dtim_period != tim->dtim_period) { - wvif->dtim_period = tim->dtim_period; - schedule_work(&wvif->set_beacon_wakeup_period_work); - } - } - /* Disable beacon filter once we're associated... */ if (wvif->disable_beacon_filter && (wvif->vif->bss_conf.assoc || diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index ae01f7be0ddb..1af99b7930f4 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -446,15 +446,6 @@ static void wfx_bss_params_work(struct work_struct *work) mutex_unlock(&wvif->wdev->conf_mutex); } -static void wfx_set_beacon_wakeup_period_work(struct work_struct *work) -{ - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - set_beacon_wakeup_period_work); - - hif_set_beacon_wakeup_period(wvif, wvif->dtim_period, - wvif->dtim_period); -} - static void wfx_do_unjoin(struct wfx_vif *wvif) { mutex_lock(&wvif->wdev->conf_mutex); @@ -466,7 +457,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) goto done; cancel_work_sync(&wvif->update_filtering_work); - cancel_work_sync(&wvif->set_beacon_wakeup_period_work); wvif->state = WFX_STATE_PASSIVE; /* Unjoin is a reset. */ @@ -823,7 +813,8 @@ static void wfx_join_finalize(struct wfx_vif *wvif, hif_keep_alive_period(wvif, 30 /* sec */); hif_set_bss_params(wvif, &wvif->bss_params); wvif->setbssparams_done = true; - wfx_set_beacon_wakeup_period_work(&wvif->set_beacon_wakeup_period_work); + hif_set_beacon_wakeup_period(wvif, info->dtim_period, + info->dtim_period); wfx_update_pm(wvif); } } @@ -872,6 +863,10 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, } } + if (changed & BSS_CHANGED_BEACON_INFO) + hif_set_beacon_wakeup_period(wvif, info->dtim_period, + info->dtim_period); + /* assoc/disassoc, or maybe AID changed */ if (changed & BSS_CHANGED_ASSOC) { wfx_tx_lock_flush(wdev); @@ -1260,8 +1255,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) init_completion(&wvif->set_pm_mode_complete); complete(&wvif->set_pm_mode_complete); - INIT_WORK(&wvif->set_beacon_wakeup_period_work, - wfx_set_beacon_wakeup_period_work); INIT_WORK(&wvif->update_filtering_work, wfx_update_filtering_work); INIT_WORK(&wvif->bss_params_work, wfx_bss_params_work); INIT_WORK(&wvif->set_cts_work, wfx_set_cts_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 155dbe5704c9..d201cceec1ab 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -101,8 +101,6 @@ struct wfx_vif { int dtim_period; int beacon_int; bool enable_beacon; - struct work_struct set_beacon_wakeup_period_work; - bool filter_bssid; bool fwd_probe_req; bool disable_beacon_filter; From patchwork Wed Jan 15 13:54:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3DAFC33CB2 for ; Wed, 15 Jan 2020 13:54:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F2002467A for ; Wed, 15 Jan 2020 13:54:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="gpgVTPtw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729575AbgAONyx (ORCPT ); Wed, 15 Jan 2020 08:54:53 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729548AbgAONyw (ORCPT ); Wed, 15 Jan 2020 08:54:52 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MsA27Mj2gGjCfX2OkRZn9R/J3ze+nlVWvKLL5GmUxoJDs3rc1Me+Qh8kgTznh6Mho5rmtAw2P8Oyjb4qW/j+11w7+CPCKMSSfM7tN+Nl08KFOXL9Cx/c3xR4v0OgL84LNDvOelhKIITXcL/ShQJF4adaNGABfA/vKzqoH0wLf4oT5ViWGqrzKAFvnFm7lBx7LIjBG/PfU7njQPE7/oXfT5OgkwkZb24Noqstof4qsVPFPVj84YIebS0WfvJcur2vtXqu9RktsVsQJK3qeob1j0JfCSJIUeLZi/gv0fEQFyQz5pTPT443vM1wnmbqapon3iT6oqlY6AHvZBqWha7H2g== 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=b50yWk0WdKoZEN9INKqfong0gAhkN4IuUW7QgFNvUOc=; b=MC8CgSYfLmJgwo5jNz5I+o3MNV6nBF1vsrUiYi/08jljSA2QmnxWo2NIgADk7XMulZUOi9XxSgPdnZu+m/y5mOig5XefXNwq/TDOCRjhe4sxwWWzkeSwL9jhOCXye4TSqJ7Z5zCpjSylVUTKOMRoJqi50E9XuZXIWy0HPwQH7UkmgFPksyv/vNcUUseXTODs3xNLDDHrXHvUCZrWQGNrN6UINRTYx32HGvpeBRMhl+XntCAvWfctOmw2Bpxm7pNeR0S0fcxHJOffyPfxyuqvb5KonzLh4oeTctPYWhcuLGoIBX0b+Iq37skzPH2YiUnJMCwzQc+p/Ruf6r9X4UqiAA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b50yWk0WdKoZEN9INKqfong0gAhkN4IuUW7QgFNvUOc=; b=gpgVTPtwtsBP42p0qdNfu8AwN020tC8b+q7JfusXBQYnR9sNWsfOQETTWPN9I4IOfqsLxp47+3XTXKT8Dh9sFKBKmH38SXAA/AOI7+5Sw4MsSIp7C9ySF2OBrBy07EiwA4UqOpuUr9KUrqB7rV+u57z6W15esLrS1uodLWY1h+c= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:34 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:34 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:33 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 22/65] staging: wfx: drop wvif->dtim_period Thread-Topic: [PATCH v2 22/65] staging: wfx: drop wvif->dtim_period Thread-Index: AQHVy6tRXiQhHkgk/kySOKZC3y8L1Q== Date: Wed, 15 Jan 2020 13:54:34 +0000 Message-ID: <20200115135338.14374-23-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0358933f-ed49-4b83-c330-08d799c273a7 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3826; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 9+39egR8hf7JvpSHrlNgQmkydaGAl08sfgQH2Bs7ZHVb1Sq5p5vNVEUn8+m99xdqoKbceDIGusG29L3fgOYTdb6/OAanYcJxnyyLgdqw0y/6StzWMC0MUMJpVy1VacaF+SeKOqLRY87/XfoVPsfMmXbVCEKwkW/7ubzDDCELDi3sO8YRkn2+JXdXhnzp98US+tKHENZQASBjN8T6tkIn3YRndnc1LWWrl/5R3qxNgVRWTcE314w/9ErfxvD2izVCbC/CFQMLs7jxWslLs9hTbRW1ZhZBQacl5ZwRGYtsj8rVK6rQk0N1/N8P5jkDi1o7cqJ1deB0azuqbVQCuvvX0GkA3/N5b893vAT/0l6cBzss/JXSUwW3lHdpFiZ9W3L8tVVTmG+C1l6WVyEbxvqp13aj3ub87n1XppxxOY0ShyYFVC+AIH1VBtqN8kf4mjYh Content-ID: <058DBEBA09D46E45914367B87825C030@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0358933f-ed49-4b83-c330-08d799c273a7 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:34.2612 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zQz1pvtwBzxkCQ0QfGKWJ3OkCxm5t4ATj16kCN98S7ZxcfzgJ9IzuLceWPAqOC38vELaep4lh+8CkW+fLUnNBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It is not necessary to keep a copy of dtim_period in wfx_vif. Prefer to just rely on bss_conf->dtim_period. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 20 ++++---------------- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1af99b7930f4..376451433e9e 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -464,7 +464,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) hif_keep_alive_period(wvif, 0); hif_reset(wvif, false); wfx_tx_policy_init(wvif); - wvif->dtim_period = 0; hif_set_macaddr(wvif, wvif->vif->addr); wfx_free_event_queue(wvif); cancel_work_sync(&wvif->event_handler_work); @@ -557,10 +556,6 @@ static void wfx_do_join(struct wfx_vif *wvif) wvif->beacon_int = 1; join.beacon_interval = wvif->beacon_int; - - // DTIM period will be set on first Beacon - wvif->dtim_period = 0; - join.channel_number = wvif->channel->hw_value; memcpy(join.bssid, bssid, sizeof(join.bssid)); @@ -701,8 +696,6 @@ static int wfx_start_ap(struct wfx_vif *wvif) int ret; wvif->beacon_int = wvif->vif->bss_conf.beacon_int; - wvif->dtim_period = wvif->vif->bss_conf.dtim_period; - memset(&wvif->link_id_db, 0, sizeof(wvif->link_id_db)); wvif->wdev->tx_burst_idx = -1; @@ -766,10 +759,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_sta *sta = NULL; struct hif_mib_set_association_mode association_mode = { }; - if (info->dtim_period) - wvif->dtim_period = info->dtim_period; wvif->beacon_int = info->beacon_int; - rcu_read_lock(); if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); @@ -804,9 +794,6 @@ static void wfx_join_finalize(struct wfx_vif *wvif, wvif->bss_params.beacon_lost_count = 20; wvif->bss_params.aid = info->aid; - if (wvif->dtim_period < 1) - wvif->dtim_period = 1; - hif_set_association_mode(wvif, &association_mode); if (!info->ibss_joined) { @@ -1055,9 +1042,10 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) static void wfx_mcast_start_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - mcast_start_work); - long tmo = wvif->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); + struct wfx_vif *wvif = + container_of(work, struct wfx_vif, mcast_start_work); + struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; + long tmo = conf->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); cancel_work_sync(&wvif->mcast_stop_work); if (!wvif->aid0_bit_set) { diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index d201cceec1ab..bd4b55e07c73 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -98,7 +98,6 @@ struct wfx_vif { spinlock_t ps_state_lock; struct work_struct set_tim_work; - int dtim_period; int beacon_int; bool enable_beacon; bool filter_bssid; From patchwork Wed Jan 15 13:54:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 40775C33CB1 for ; Wed, 15 Jan 2020 13:55:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0949D24656 for ; Wed, 15 Jan 2020 13:55:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QAsSU45m" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729610AbgAONy5 (ORCPT ); Wed, 15 Jan 2020 08:54:57 -0500 Received: from mail-dm6nam11on2085.outbound.protection.outlook.com ([40.107.223.85]:14113 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729593AbgAONy4 (ORCPT ); Wed, 15 Jan 2020 08:54:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cBvouFCR5c/7zo7uR8e4tAChJUHBy8/DMyLrAruYEoG2B7/Q5824A+f05DyG/Zh3soYWATWaHL9Tnjo0zdfWtwkrN/2YMRJE2EDPZIKkiDWlmw+iJ5fyE0MjfdgLP5LQ6QTQLW3nwbDmedOpdkcq+sP4DJVsNOlpwR7a9pqqFUTFdBEWzR+UzA/fh0Zl+VxfxkBs5c/FS4GeB1C1JmPBbbZFssDjfymIP90xIw/gZMVkVQW19F15pb4DuMG6PwNPaOOyq9yY1kXNIEg/JNpf9xBF8KrKz8wZqd6qcI9RrAZF1Ru7GTzrOOEwi6jiFRLkegELD34BIy/caG2hxenM3g== 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=tjKAuLPHt5gNg/Eo1CFrDExKSrzLBhwAanAjvAIxEpw=; b=G1jYC2YRBXlLMcH5ud3pus73ZeXzpusXg9vtoBENwOux5dbxHqugkPoJDIO8EwooCGSxmeBmZgERpM0/cHwshyumvI9QsKuwTvEnf0Vls3MtodsGgnj+oZ4IupMqA+YILdXQfXDNOqAxVJg0w2G7zLMSuwzH/g74IvJByPjXKhnXzM4uxAZp+AQz9/Tj0OVKdMQRSdRbco71CBGS4cPur554K4sKr3UaVLs3meFPQnU4Q587ANozycExWC28dcqp/ZY+YPiT6F6+CblSGPMUYA/LIs72bvKqI4c/yJFjbK0gIgtVu/2aNjDbHnyotze0LhdhRuPKoGkzqa6ZQ8NcyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tjKAuLPHt5gNg/Eo1CFrDExKSrzLBhwAanAjvAIxEpw=; b=QAsSU45mx9hebVmZVG6sDM+Jade8PW9SVuKDtjbWvtQyKbqNnqt4eee0/h4WgnKqAx8fAZZuoAPAMlMgLVP0pSp5L3SXle5QY3DohvG/YqUDjN9J32DMz7OMs8gxRBBBlwA5zMJud4Xm9MELjwH4OSdHDB5aFnN/BxmZndFZyu8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:54:38 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:38 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:37 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 25/65] staging: wfx: drop wvif->setbssparams_done Thread-Topic: [PATCH v2 25/65] staging: wfx: drop wvif->setbssparams_done Thread-Index: AQHVy6tT151hzhi3V0aXThOObsMaWQ== Date: Wed, 15 Jan 2020 13:54:38 +0000 Message-ID: <20200115135338.14374-26-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9140b8a6-d657-409f-d364-08d799c27659 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2958; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: V/MEr8X8R2iOw/uCYtY+F/1o+wYY+qJe1kHH0EWznLz73lhU7JRczfo57zg/A/SHcOD91lUReqPCpmrt/lrVnDLOcUXy50pe8vuepKGtLf7lu99PD4fH853+g6i7E6OOFo01CFUUaWT+uIxDIYaeDmIY7AROA/fiMZB3ruhIEaM3VF9mUDnjhskdLpntCkQan5yyvwUP6dWDP3FmPUzFsE/DCZoaz1qo2aAMurz7CcH1x58S9ZHR1zE/qAi5oYxZMBynvNFza/YxaikX8GgT5tr5/OL23wat/o7lIPRGOdfCrI6TmcoDvc0ZfUxUYYi3M0WT1P5sSoIgQiELmNUDonr4VFiEy9VuNw4CPj/r3gXGlVzY7PuPTnE7/0vW7eKg1awmFgXkZfG5enVo6J/YxNiWoyXlcUySVHvukqBiRc3vIJJMK3aMxtfXU7LEMxzK Content-ID: <7E6E70C6E576E648A96EA30D450A6B09@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9140b8a6-d657-409f-d364-08d799c27659 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:38.6526 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5nWjg8bYYqjduXj5YHqSWwR24/F7fad2pwr6UweHaMHquqxIGbn1APNTKALtRPmR1C+pbNpgyWim4KGBuAB1hg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller setbssparams_done was here to ensure that the firmware does not enable powersave before to get the first beacon. However, mac80211 already ensures it gets a beacon before to associate to the BSS. And even, if it won't, the firmware wake up at least on every DTIM, which is sufficient to finalize the association. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 8 +++----- drivers/staging/wfx/wfx.h | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 021daa9f7a33..7abe272ddc0d 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -326,8 +326,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, hif_set_edca_queue_params(wvif, queue, params); if (wvif->vif->type == NL80211_IFTYPE_STATION) { hif_set_uapsd_info(wvif, wvif->uapsd_mask); - if (wvif->setbssparams_done && wvif->state == WFX_STATE_STA) - ret = wfx_update_pm(wvif); + wfx_update_pm(wvif); } mutex_unlock(&wdev->conf_mutex); return ret; @@ -475,7 +474,6 @@ static void wfx_do_unjoin(struct wfx_vif *wvif) wvif->disable_beacon_filter = false; wfx_update_filtering(wvif); memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); - wvif->setbssparams_done = false; done: mutex_unlock(&wvif->wdev->conf_mutex); @@ -799,7 +797,6 @@ static void wfx_join_finalize(struct wfx_vif *wvif, if (!info->ibss_joined) { hif_keep_alive_period(wvif, 30 /* sec */); hif_set_bss_params(wvif, &wvif->bss_params); - wvif->setbssparams_done = true; hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period); wfx_update_pm(wvif); @@ -1224,7 +1221,8 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work); timer_setup(&wvif->mcast_timeout, wfx_mcast_timeout, 0); - wvif->setbssparams_done = false; + memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); + mutex_init(&wvif->bss_loss_lock); INIT_DELAYED_WORK(&wvif->bss_loss_work, wfx_bss_loss_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 1b487d96eca2..5e1a763eb4b5 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -105,7 +105,6 @@ struct wfx_vif { struct work_struct update_filtering_work; u32 erp_info; - bool setbssparams_done; unsigned long uapsd_mask; struct ieee80211_tx_queue_params edca_params[IEEE80211_NUM_ACS]; struct hif_req_set_bss_params bss_params; From patchwork Wed Jan 15 13:54:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216622 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FB5CC33CB3 for ; Wed, 15 Jan 2020 14:00:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 35E9124679 for ; Wed, 15 Jan 2020 14:00:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="UBn0tgCo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729548AbgAOOA1 (ORCPT ); Wed, 15 Jan 2020 09:00:27 -0500 Received: from mail-eopbgr770053.outbound.protection.outlook.com ([40.107.77.53]:11386 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729378AbgAONyp (ORCPT ); Wed, 15 Jan 2020 08:54:45 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bJJBgE/qa6i5aSZlyPZmEbjEncWQcNHZdBhB+Q46gEsm8slVWtiejB/c895K8BI0ej+tOaZiQTg9al/AItKMTVNFqbPJkspolGs17a2MYBB6TrJt8wRh4cY9llX9uqTMspQ9QIz7KoWhaoE2QEiT8NX5IuWMZF835LrxD1WND/ROdB7yas06A7wrrzBUkhYk4/vkUGQgUt2qZt6iJlhueEBkrNl7hWtlS9cFUSuuVAOX3nNPSvvMn3DsICqX+6wx7/5Z6jO6eIe5JlEJI7p1owh9YyqxZjtzcvSdJwprLnleCAZHzYnl5PDuMLW8II+7F9lPltlfAsMo1NG+C5aVGg== 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=8Z6eY3YKLacQ9BswNsaslS7+IH+navlKtJGAw9pK9io=; b=nWciybK1nguhLKz21Q0hgBeKv1fORPszGL8LJnSdPgxnmth023czAPNsc9E3SqnCN/6W0VcNVx+fPKP3FFlwMmbcoBXeYzoGkY6VAUIqTtpU/9tNHPiNUvdWj4iI05ppdkOE/6/8wig8pXIbQKuAHJIq5oVbhL8tWhE2wtKNwF8C0htJxLoUBLV2mxs6Tf7yRu9RMDcVvpVvZG2JN/Znn4EbLstujiymmMkT+8fZslw/F/5KeWNsIjJ2RA3uZUTSmGtguFKBljlrjCcZKbCzcbweqSpSi6HmKgbLH7Am0rMBXN4ILCGsf6mPUQ7m1TaEF8cL1AOpeES0M19SPVe7nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Z6eY3YKLacQ9BswNsaslS7+IH+navlKtJGAw9pK9io=; b=UBn0tgCoRrnnIj7QCZd85XGjhGbmzHLWY4vuv8jMLAhzsqzg34yeJDizAWvCtisMG3UE9HATKTfVDMGSwydr9Wtsw2wiFBVQl/1zU2dWqc+0nCv16TeUj9+WyJ9B1nTgM8tK0g/qvcVv1wSqEPV22x06x+sF2HrCLXF176qFnME= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:54:43 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:54:43 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:42 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 28/65] staging: wfx: simplify hif_update_ie() Thread-Topic: [PATCH v2 28/65] staging: wfx: simplify hif_update_ie() Thread-Index: AQHVy6tWByjDNbiG4UW4fbzDa/d9XA== Date: Wed, 15 Jan 2020 13:54:43 +0000 Message-ID: <20200115135338.14374-29-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ee889111-fc7c-44ec-5f22-08d799c2792c x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4303; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 7Xr622aJJpDtlwa/Lg91j6JSj09JpQHvpg3lmnobuPey48tpdnr4tAYC+NCk45pis2tMe7Kw3ybRou20wn2cPHt9UrW4WRvm1YIG5rs0Qw8Zsw5Iek+qBd/yLPV7rfkjBKJVtxoJMxowYkoTlw/Iz1OiSOKf4ww7WrsrvmemjVJbQHy5Pu1IAiQcU4a60/gVvFJNj1isbOJHNfsyeJripmvP1eUKEqIRNZe/RIgp13lwiZ5BVC3bMPozeEvMMYAiK4RE5bIBBLNBMPZ8bwTAyautWXdQUnc2m9aGqRe1H5MiCKl1FNx7qKoERNMAq4kCAiFfWhTuvlsjgXEm9XZkXGJd4VV0CSUamQ6ZBB+o8F+GpWCLpXIW3Hl9U7vfXQJbrD7CtV9EiIK/QIAVyRpk0yDZvlUd/KGG5BG/QKaXx8R8b59/4NVSBi2RqBJPXLsS Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ee889111-fc7c-44ec-5f22-08d799c2792c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:43.4479 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: HJTNoE8vXmr4kLSuENvYGzkUj5u8TbKIHzkDqRNv396w8MjO6rxz7lt3bA6JfEDoeaFKkmXvHKiSxaMWZUOPzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller hif_update_ie() is only called to change the beacon template. So, specialize this function and simplify the way to call it. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx.c | 5 ++--- drivers/staging/wfx/hif_tx.h | 3 +-- drivers/staging/wfx/sta.c | 10 ++-------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 8df6e43fe742..32eeba2fca47 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -461,15 +461,14 @@ int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id) return ret; } -int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, - const u8 *ies, size_t ies_len) +int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len) { int ret; struct hif_msg *hif; int buf_len = sizeof(struct hif_req_update_ie) + ies_len; struct hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif); - memcpy(&body->ie_flags, target_frame, sizeof(struct hif_ie_flags)); + body->ie_flags.beacon = 1; body->num_ies = cpu_to_le16(1); memcpy(body->ie, ies, ies_len); wfx_fill_header(hif, wvif->id, HIF_REQ_ID_UPDATE_IE, buf_len); diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h index fbaed991b112..924b889cad0a 100644 --- a/drivers/staging/wfx/hif_tx.h +++ b/drivers/staging/wfx/hif_tx.h @@ -57,8 +57,7 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, const struct ieee80211_channel *channel); int hif_beacon_transmit(struct wfx_vif *wvif, bool enable); int hif_map_link(struct wfx_vif *wvif, u8 *mac_addr, int flags, int sta_id); -int hif_update_ie(struct wfx_vif *wvif, const struct hif_ie_flags *target_frame, - const u8 *ies, size_t ies_len); +int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len); int hif_sl_set_mac_key(struct wfx_dev *wdev, const u8 *slk_key, int destination); int hif_sl_config(struct wfx_dev *wdev, const unsigned long *bitmap); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index e02ebc39ed41..395a282346b1 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -881,9 +881,6 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_CTS_PROT || changed & BSS_CHANGED_ERP_PREAMBLE) { - struct hif_ie_flags target_frame = { - .beacon = 1, - }; u8 erp_ie[3] = { WLAN_EID_ERP_INFO, 1, 0 }; hif_erp_use_protection(wvif, info->use_cts_prot); @@ -892,7 +889,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (info->use_short_preamble) erp_ie[2] |= WLAN_ERP_BARKER_PREAMBLE; if (wvif->vif->type != NL80211_IFTYPE_STATION) - hif_update_ie(wvif, &target_frame, erp_ie, sizeof(erp_ie)); + hif_update_ie_beacon(wvif, erp_ie, sizeof(erp_ie)); } if (changed & BSS_CHANGED_ASSOC || changed & BSS_CHANGED_ERP_SLOT) @@ -960,9 +957,6 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) { struct sk_buff *skb; - struct hif_ie_flags target_frame = { - .beacon = 1, - }; u16 tim_offset, tim_length; u8 *tim_ptr; @@ -987,7 +981,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) tim_ptr[4] &= ~1; } - hif_update_ie(wvif, &target_frame, tim_ptr, tim_length); + hif_update_ie_beacon(wvif, tim_ptr, tim_length); dev_kfree_skb(skb); return 0; From patchwork Wed Jan 15 13:54:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB247C33CB1 for ; Wed, 15 Jan 2020 14:00:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 879BC2467C for ; Wed, 15 Jan 2020 14:00:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="bjXSpV+P" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729765AbgAONzV (ORCPT ); Wed, 15 Jan 2020 08:55:21 -0500 Received: from mail-eopbgr770084.outbound.protection.outlook.com ([40.107.77.84]:58049 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729406AbgAONzU (ORCPT ); Wed, 15 Jan 2020 08:55:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BzzccLf8qHj2zxB5YJAfKk3THBcNExTSOuPO0SVlDT9ShBZ36Cbcp3BWhfpdVGOT+AoyJ6BqA+vmMcqig89tWOFevZFP+pdlXebOyIXYdmMWqsVTKst3inaQPimWjJztzpUdOh9EI9HojS1/wQBvFXk3d+VCqGNdORsEJF6FC0R9+U+G9KU8TL+Su6sspc2RXmrxvI7ZJB7+RyzhgftmqDTtXa9GbgmmbJIBlN1Er/So1F9n1W9GbvjmaWScA5yOU+LU5NRTuPs5mkp9p8sSOJgudBUJ2We47yY2kxdJcXeJtTWvJ9gy5uQDq00lTS0a7NsfF8CUl83Hq3hu/e1SZQ== 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=t7WXVyk7UNsnby0BTFvK7nM6kwOYLUjSDsqtkvRlZTw=; b=B76B0bDQpmhgPj5bUdh5iQ9XwxJZZuK2FVOekty7PHQr/jaNR2oc6lCiFp7iukHO6NGHKL8DfslGp+zD6n7buBouJ3IMbsGcxZM+XbJ8rjUHDlb6o8Axr3lZ3q4wJFZ/EKRvAXNaLLZcCvy0s0hFv5/F6FOkyQbAvM3NJ6pHXLD6z1Av90tBQCfr6RpyMEZX7QImw6Jh2JU9kUlFkuo033UC6W4XLxo7V96wdn+LTK81KGfH/JzC9+KbUEBl/7cZixaY1X9Lu5eFxetVQpoeTALc+W+Dzq+DzGGaxj0n1N0ozF5y7R7TNHIK3K7jtrmZgghd4h9+DxzBdt9dVHJwTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t7WXVyk7UNsnby0BTFvK7nM6kwOYLUjSDsqtkvRlZTw=; b=bjXSpV+PiB5pRif2fRvNEY86liMKisdSa4Pcv3WF7cY3BolYHRvAblUU4NqL7Q0kUmKiQPl5wRI8AT74HfYJHkZ2SFZnx7Dza1DmNPZbd3Q1hWSknIUZN89wvrI1CRhdqBXvUSoCMwqZqxJqGuQqiN9UYtXhmaFb9AvaiLcwh1Q= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:17 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:17 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:47 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition() Thread-Topic: [PATCH v2 31/65] staging: wfx: simplify hif_set_uc_mc_bc_condition() Thread-Index: AQHVy6tZfV6OMRg3xkujGLdYN50CKw== Date: Wed, 15 Jan 2020 13:54:48 +0000 Message-ID: <20200115135338.14374-32-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6b9d42bb-7508-4a19-ccd2-08d799c27c37 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: negmMEw4i6Jq1gWvn1FPRcnjXwlH4izv4qnumnY6INLNrVtNSPIgKhA5y4NNrWF/FERtoM8o5bUlG6lJ+WOy2jlomt2MmKF9tsTpghTvX67kaNI/YMCtFmTBkUPvIoTrgbSmGRL77nyDKzY49FkgVZ+Je6FoVRgLJedRp/SYmVvd6f84jysJc5dT/iF6gXsXZPn7TBqmkmtiD+8KYrwysFu/rj3wiR5Iw4ixqjRuda/EPacVjGxz10cON6giLJsrHopiosHtT6vz8mM4SHiJgSclW3HUM/9s/6uPJLpCIfN/v80KMpwQfcRCEUR9zicOVrgyCTI7nqgpMkxOALaS6PS90e6FdLZLsDYh6I0wTxBcrTfc7+6YCbjmc3zNVv6CXiJDgaUPxwbTfxNWlFHkvjOHQEbQEWYDkYr1cdqvpDwj7gsKEiHexi5f/Lkso5d2 Content-ID: <853FF0B7B01C864C9319ABC0F7678133@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b9d42bb-7508-4a19-ccd2-08d799c27c37 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:48.4630 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mCTDeaaLj2qtHfSrns4pIk3heSPgYQu81dFk+Vwjih8s/g2/e4dMA/MFiweN9MGYrXww+UFt7VLKqkfGQxLJBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The structure hif_mib_uc_mc_bc_data_frame_condition come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_uc_mc_bc_condition() is too dumb. It should pack data with hardware representation instead of leaving all work to the caller. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_tx_mib.h | 14 +++++++++++--- drivers/staging/wfx/sta.c | 6 +----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index eec6f4157e60..4d171e6cfc9a 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -246,12 +246,20 @@ static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, arg, sizeof(*arg)); } -static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, - struct hif_mib_uc_mc_bc_data_frame_condition *arg) +// FIXME: use a bitfield instead of 3 boolean values +static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, int idx, + bool unic, bool multic, bool broadc) { + struct hif_mib_uc_mc_bc_data_frame_condition val = { + .condition_idx = idx, + .param.bits.type_unicast = unic, + .param.bits.type_multicast = multic, + .param.bits.type_broadcast = broadc, + }; + return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_UC_MC_BC_DATAFRAME_CONDITION, - arg, sizeof(*arg)); + &val, sizeof(val)); } static inline int hif_set_config_data_filter(struct wfx_vif *wvif, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 9030681858bb..79285927c7bf 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -120,7 +120,6 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, struct hif_mib_config_data_filter config = { }; struct hif_mib_set_data_filtering filter_data = { }; struct hif_mib_mac_addr_data_frame_condition filter_addr_val = { }; - struct hif_mib_uc_mc_bc_data_frame_condition filter_addr_type = { }; // Temporary workaround for filters return hif_set_data_filtering(wvif, &filter_data); @@ -144,10 +143,7 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, } // Accept unicast and broadcast - filter_addr_type.condition_idx = 0; - filter_addr_type.param.bits.type_unicast = 1; - filter_addr_type.param.bits.type_broadcast = 1; - ret = hif_set_uc_mc_bc_condition(wvif, &filter_addr_type); + ret = hif_set_uc_mc_bc_condition(wvif, 0, true, false, true); if (ret) return ret; From patchwork Wed Jan 15 13:54:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DE31C33CB1 for ; Wed, 15 Jan 2020 13:59:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16FAA222C3 for ; Wed, 15 Jan 2020 13:59:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="DExnBvlj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729855AbgAONz0 (ORCPT ); Wed, 15 Jan 2020 08:55:26 -0500 Received: from mail-eopbgr770084.outbound.protection.outlook.com ([40.107.77.84]:58049 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729813AbgAONzX (ORCPT ); Wed, 15 Jan 2020 08:55:23 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lVo1oVyWM9IF4fqn5vtIvcqIaICzUSPhCgLlkSauIAFJKPuTbUnh1bK4RuIcmsQNjtyHWe/7V8SMreQEbxlyz8kt9gR/ePopdtfj/Mw4As+cZEc6M9kUOMeCyOlJ8WFlP9mcdYjgvXXLkU7ka0TQqefZib+B0n9yyfKBRq/stib9AL5dyTZ3OxABOXi1oyFDwBbECRYt53/zfQo6t9QMUT27kCUVel+xBD/l7dOlq9693gMBLDUW9fsdqO6L3C5Xxr0KQtI0bq3QPh/aNnvlnjF5I9FHxDdmQ3Z7zHTj7XKXHXztSfzK+NTZtpqytC5PmtIW0rQ5TNySDnCUMROQ1Q== 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=A2/Jm6w1JZAbFd2GIhM4GZMXqZt/BV+Jj6ZkQwLi2xk=; b=LbnlVUMoqLqLbDHhCC0CkBGrb/nhSgDPGYe6WS/LGeKEu8DYBhY9+EZuHDICwsC4CDexkvP5mfEIBfwpeALX5EVAP/I3A+dKIK4xUxp1/RywrOXr3f3tUk5TwwjWBDt301b3cOungfglwzaGBOt4ITSpyukDfRN0tApTXGoG22L0dyJzaNggDuB75UFDgFjW6hPXsBOJoY71D4a/pDPrzUmC4JgssbmisfBbGJKRtAtwYlrlNbzrJJK8Z1jmR2Fj7aYim9B5tC8Oy1DhRm6Tk2WeX9uf74AMMOKwr4RAN80mB7N1W+MV+X5ubtLQ0+EirmeFLQ/ovs/COjIztltfTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A2/Jm6w1JZAbFd2GIhM4GZMXqZt/BV+Jj6ZkQwLi2xk=; b=DExnBvljHNaKwAAJL+qPVRD1fiQOZWj4GOFWCSj9TIDTbg9yzjzOd/9Yk8pfxgFg3RDUoLfh7vdP3Fkjv0V6KE9JEclh6zCwwjpdeK9u/m0eTrdOK1bn13xmHmx7/kDUcJcUPrxef66i/Ive40wZoYQilXUZcukYjyVErRc0Clc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:18 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:18 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:50 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 33/65] staging: wfx: simplify hif_mib_set_data_filtering Thread-Topic: [PATCH v2 33/65] staging: wfx: simplify hif_mib_set_data_filtering Thread-Index: AQHVy6tbuB7e0lz3BkWa3Nsca80jng== Date: Wed, 15 Jan 2020 13:54:51 +0000 Message-ID: <20200115135338.14374-34-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 360623ee-eb74-4eb3-74a9-08d799c27df8 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1091; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8T5jRbU115IgsB8U5jreb5sAEuritn5gAhMbWZK4LQ/3ekr9Pc84Tga7fpR4NmMA1vxLUWURUix33fuyXDiqWaZYybLPZvqf0fIytpHRYFoobQWJVYLseKjWbu6e+8xisNh4lzYLByfYl1xZBhxSkwvtxTSSAxJu/xbhGMcLlbdUkxJ0c3bvrxDe09gJ/RsMTm8esjvFP+3cJDiPu5uEcRQBcTCPVwk3DRG6w8r6ST7e7T1DerNbNXl1hOH3K4QobSY2GuPWTS2Ep2a87S8qx78SludgCE1lwh1mmB2Ks4T8rJAmP0oAZx3kl6ZPis4hKNuv3kz1+Li3i14fWjOBLdsfjLZeMkjlzHLBVQ7a4T/RWMPv++T9QqSwL1G5SPx82cMSJfTadFno/W+It19JcRTP3gDRtfrkPYZAL6TRrw5FrM0nL9pIH5/2DQmquKBt Content-ID: <2BC2593D25EE0640A3B26980B322F012@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 360623ee-eb74-4eb3-74a9-08d799c27df8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:51.4153 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: V+3Eb27hUyNJXaw4Qfq1FveKhse1JlUSIp4ELQd8CPdkSo2wl8Ew3H4yMYEqEHSNl5LpG3s2KS9wfRxwtjxzww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The field "default_filter" was not obvious. In add, explicitly declare that fields default_filter and enable are booleans. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_api_mib.h | 8 +++++--- drivers/staging/wfx/sta.c | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h index e0ef0337e01c..0c67cd4c1593 100644 --- a/drivers/staging/wfx/hif_api_mib.h +++ b/drivers/staging/wfx/hif_api_mib.h @@ -206,9 +206,11 @@ struct hif_mib_config_data_filter { } __packed; struct hif_mib_set_data_filtering { - u8 default_filter; - u8 enable; - u8 reserved[2]; + u8 invert_matching:1; + u8 reserved1:7; + u8 enable:1; + u8 reserved2:7; + u8 reserved3[2]; } __packed; enum hif_arp_ns_frame_treatment { diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1c1b5a6c2474..27248ea62aea 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -154,9 +154,8 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, if (ret) return ret; - // discard all data frames except match filter filter_data.enable = 1; - filter_data.default_filter = 1; // discard all + filter_data.invert_matching = 1; // discard all but matching frames ret = hif_set_data_filtering(wvif, &filter_data); return ret; From patchwork Wed Jan 15 13:54:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216626 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45010C33CB3 for ; Wed, 15 Jan 2020 13:59:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 105AE222C3 for ; Wed, 15 Jan 2020 13:59:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ihQxyinT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729615AbgAON7l (ORCPT ); Wed, 15 Jan 2020 08:59:41 -0500 Received: from mail-dm6nam11on2047.outbound.protection.outlook.com ([40.107.223.47]:4897 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729094AbgAONzZ (ORCPT ); Wed, 15 Jan 2020 08:55:25 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KCMVSh/0QubU+a+Dwu00HMpBHE/nwCBnFfBWPpMxHllPr4kHM/IorzXUdW1OAOTHh3ucC0s1Yp5lmhEXhwIJCKJR2XcS9LzYeJ2y4EcfCIZHZ3Wknxb1mgVWzqwOmNjqWoxGE4EB4P4Ljlw1pXOkBsUkf6zrt5XHdWH+O142JUEuaZ9J6eeFAyfc64m1gc49ezGyYDS9YwLNMQFbPxJVrUZ55Xp8DlJX/V/jbRQ+9MBg6AqiYWawA+0PxaUp4B4qbzlnWFdRYyEPRQxoS63dF4vUM3RrIljNZonrCPPAmi3+ujVvBGDCVc1whEp8c8dmqBSI0cVNKvql2Kf5woVveg== 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=+r+hH6i8d3N1IAb/CKSuC2M9LsNeoz8vnFD1h6dEiDg=; b=msVx5qw+W+LVqb9yy8/e80n57ObGemuagj4XuCpN8idmzEAGe7O8RsC1OVDo7ZlVCIQaXy62+9DbTCFRAZRBBwFhNJ1YNm+XU/xCLzUbAhRgLUmTADr8+R/9Arri8Rs3IdWa+t+C3M+57HJEGBoUKs+zJpsSP2s5uU85Cz2RsZAYcahmzw9dP3YRfT4DKPL8cp6+Qnp2gQUPDAYtJ8Mkzx0lHGhl+zMqy8pu5sFBIiXjgj6Fn2iTvSqn6epewsvWZEGw+kWuuFWc3W+BTXn1P1mKYsE9lqEG3bKM0uys7xnzkOI0003tNBaY9RlSN8x+wIt92yIVQxt5IJX4eJ85RQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+r+hH6i8d3N1IAb/CKSuC2M9LsNeoz8vnFD1h6dEiDg=; b=ihQxyinT5GCuANc4wTn5hhoPM7+ojBqeQ2DT6/BKKGcV3J+QEFyysDjnz7FgP9+hvCoeRmQUcegy1YnCr8Com8L6jp85a7XAK2n59V9XPd7CJSi9Wxno9I/odywXnf8INl8FhfmFNMpew2ehDibUBBp1DkpL0zOp491qMC2F3WI= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:55:20 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:20 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:57 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Topic: [PATCH v2 38/65] staging: wfx: simplify wfx_update_filtering() Thread-Index: AQHVy6tfngHVt8U6GUCny0hqIaFlXQ== Date: Wed, 15 Jan 2020 13:54:58 +0000 Message-ID: <20200115135338.14374-39-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9bdc3c1d-fa54-4082-2e92-08d799c28213 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1051; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sMhPG2Na9Bjv3m+MKKLzbzxraZmqo7HKw+RU6H9FkH8sRysShj3V9ZIWcrUS8YoWD2babPsmCsrJfBfhL6ln2UzEW9ZHmFGEwNQHZgj6fXr5egJhzAdBPInSEDfuO98iOdNY5WfbdQSsU6SlEIzsK7o536/Ol+5ow6QRJsN0OwisBFA0h3DmI2JQtQgZU0uHdU6YhdKmjBPkAOq6Zu2dJNBuPixZ/s6j7An0A82/3a2iDLFI091/cGWgd282+JKNlQQ56LhvkALuRltW2BU5+BLfvrJsdbyJ3TcHZsri8CEG+NG3CPmXdtmoId8RQkaQXQaWyh34j6Y7jMCaZVw9QbJkOc6Kx062WC5+/aC3QibsQrjgMjBcpYWVTs+0jEpgqb+R0oUmAamhxvBTxsjwMDXMsxJ9N9fONcO82QqtTteI2VJLeQW9BUWVxqi/NaI5 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bdc3c1d-fa54-4082-2e92-08d799c28213 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:58.2983 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: z6B2m58fbrnGoyN+JyotBmbajF8jP4GH2cJavooqiKerxAZXsTm46YOKoLL+Jio83U7jEQg6AQn5IyVcldvJRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_update_filtering() has no reason to instantiate a struct hif_mib_bcn_filter_enable. Drop it and simplify the code. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index a934f66f3a4c..0c3150a94c7c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -138,10 +138,9 @@ static int wfx_set_mcast_filter(struct wfx_vif *wvif, void wfx_update_filtering(struct wfx_vif *wvif) { int ret; - bool is_sta = wvif->vif && NL80211_IFTYPE_STATION == wvif->vif->type; - bool filter_bssid = wvif->filter_bssid; - bool fwd_probe_req = wvif->fwd_probe_req; - struct hif_mib_bcn_filter_enable bf_ctrl; + int bf_enable; + int bf_count; + int n_filter_ies; struct hif_ie_table_entry filter_ies[] = { { .ie_id = WLAN_EID_VENDOR_SPECIFIC, @@ -161,33 +160,29 @@ void wfx_update_filtering(struct wfx_vif *wvif) .has_appeared = 1, } }; - int n_filter_ies; if (wvif->state == WFX_STATE_PASSIVE) return; if (wvif->disable_beacon_filter) { - bf_ctrl.enable = 0; - bf_ctrl.bcn_count = 1; + bf_enable = 0; + bf_count = 1; n_filter_ies = 0; - } else if (!is_sta) { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE | - HIF_BEACON_FILTER_AUTO_ERP; - bf_ctrl.bcn_count = 0; + } else if (wvif->vif->type != NL80211_IFTYPE_STATION) { + bf_enable = HIF_BEACON_FILTER_ENABLE | HIF_BEACON_FILTER_AUTO_ERP; + bf_count = 0; n_filter_ies = 2; } else { - bf_ctrl.enable = HIF_BEACON_FILTER_ENABLE; - bf_ctrl.bcn_count = 0; + bf_enable = HIF_BEACON_FILTER_ENABLE; + bf_count = 0; n_filter_ies = 3; } - ret = hif_set_rx_filter(wvif, filter_bssid, fwd_probe_req); + ret = hif_set_rx_filter(wvif, wvif->filter_bssid, wvif->fwd_probe_req); if (!ret) - ret = hif_set_beacon_filter_table(wvif, n_filter_ies, - filter_ies); + ret = hif_set_beacon_filter_table(wvif, n_filter_ies, filter_ies); if (!ret) - ret = hif_beacon_filter_control(wvif, bf_ctrl.enable, - bf_ctrl.bcn_count); + ret = hif_beacon_filter_control(wvif, bf_enable, bf_count); if (!ret) ret = wfx_set_mcast_filter(wvif, &wvif->mcast_filter); if (ret) From patchwork Wed Jan 15 13:54:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216628 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC4B5C33CB1 for ; Wed, 15 Jan 2020 13:59:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9531924656 for ; Wed, 15 Jan 2020 13:59:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mFqhm4up" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730150AbgAON71 (ORCPT ); Wed, 15 Jan 2020 08:59:27 -0500 Received: from mail-dm6nam11on2047.outbound.protection.outlook.com ([40.107.223.47]:4897 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729837AbgAONz0 (ORCPT ); Wed, 15 Jan 2020 08:55:26 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OZ3WiSt2lNXC2TfkCn5ifztIX7LKKeQ4Edi+jrKCf319HLUY+yCmCLuwvn9CeB0cyOLjCCgCYBk6xoe4V3tv5TsAEwLsE/ztPiKsZOIgbCiPZjZ4YDEWsPD3RZ2g7jsQawH/cY3DwwvSzRSZxW89wHA5nF9c07uO2BwfN5z7bsUoBNgxLZQ6zBV16o5NYDYe2VMdvcGDeNGgUlqE/2Tg+JHvwvv01Y7ZryP4PNCualgWf4Y8NxAVHbuOU/l1Xuygaa6kx2B57T0W8UkHEP4YSyI+zGq3bPabcZjP5gGISwOZykkYAPqZxl/XZtFbXJNNsS7fi3saVOL2u4hdtFPrtw== 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=p7xw4WCj2d15OmRXMql5kVmIrhFJ5wVO8llOWfUVcAg=; b=e1Fxg1Ns4ZBqm1Gl5+ZMqfwjepC4bM4zC8hHZbzgutf538vSrCJ3hpny3K3IJtkfvaGb0mkjyvUa9DQtSOM3GUBvdkozkHqVSvffiOLG3kalNGzvqFSZY8GdcxGMsTn7tIamD0mc4iWpdoWHqmbU6ITnSX4j0p7kjzbhH9VAv2SdlMrSiqQRglNYjZfoTllV5m382CTWW/e6lN1pBdS7WG2bfkngJOZ23gZ3KT5hLITgt+ATbB+EJ9qUokb4LsEF2piLamSEtylS/p2GO/V8cMBY6oYuVdmEvs29cqbcvggMebgCVifU90W1ogMIXXf7WnOeg7jxdU011FwMPSfauw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p7xw4WCj2d15OmRXMql5kVmIrhFJ5wVO8llOWfUVcAg=; b=mFqhm4upwxfTZAj78mOY6tziyIsDBOZUXam7A5637bhtD8b9kBXTpCBieM24MYK3cW2LtImcoOQ2Xj5MPlCsCB31prYrnSCzCo4UHPwxljq4vjIEqnS4WwGgfcVk9XfOKUEDWQ1GxbQrS5BBXhnTfPCtir3eUpr94redFbAnLrA= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:55:21 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:21 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:58 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 39/65] staging: wfx: simplify wfx_scan_complete() Thread-Topic: [PATCH v2 39/65] staging: wfx: simplify wfx_scan_complete() Thread-Index: AQHVy6tgPdIIv+HZaEOcngYmvApagA== Date: Wed, 15 Jan 2020 13:54:59 +0000 Message-ID: <20200115135338.14374-40-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 066b16c5-4c2c-4008-efed-08d799c282e5 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1360; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: UGgi1GeeNCKvDZggIbwEIAkynwC0UeojiFqTdOfCGHbK8C5qbQ1jtgKb2UOMSOTtP3XV32N8awn5jrK4B4D3d28J4IZ0njt9YnBvldaUtqiq69NMPKzM0ucyJCRznJwieA5F+GyMDOhKjVbEV/teTSgH1xp12dv9Jd1Mi3ksAkFFdznBpjOpDHUrR54KFm6Ib8cKeRjZ04gkOpU0iYQHHBqQWO6GHnCxRArdg3zpHh5N0XjykE36N+7AMOnRF3FC2AGWBHWGOhhHDh6gmc3sDL3+BjK4gF9+LTHzb8SmHTaMSLmJr3W7B5VWRwPdnuaVyx8o0h8m1giJ46hA5nD+PUJYAvNBEtt2jqm6EpY6PxW5ep40gQ+mQd+Sx8BID9v2z9IePFBpE6vs7ywEVpZZxl28Sh4cTH40CsKbRg4OlvJ5GNbPURRK1tBYcVu5yx+E Content-ID: <91BB3F2FE9A35A4AABAA19359C7A493D@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 066b16c5-4c2c-4008-efed-08d799c282e5 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:54:59.6825 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: MhrNL3ynFjGBno/rPmGcKkqfOZpR4VjxowAdh5glv494TMYJsSTvvb7CCAfmi/P5qSTAnPWhsubfyqrTyG2PlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_scan_complete() do nothing with argument hif_ind_scan_cmpl. In add, hif_ind_scan_cmpl come from hardware API and is not expected to be used with upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 3 +-- drivers/staging/wfx/scan.c | 3 +-- drivers/staging/wfx/scan.h | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index 408967a4c457..f04afc6db9a5 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -203,10 +203,9 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev, const void *buf) { struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - const struct hif_ind_scan_cmpl *body = buf; WARN_ON(!wvif); - wfx_scan_complete(wvif, body); + wfx_scan_complete(wvif); return 0; } diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c index 5cc9df5eb6a1..6e1e50048651 100644 --- a/drivers/staging/wfx/scan.c +++ b/drivers/staging/wfx/scan.c @@ -127,8 +127,7 @@ void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif) hif_stop_scan(wvif); } -void wfx_scan_complete(struct wfx_vif *wvif, - const struct hif_ind_scan_cmpl *arg) +void wfx_scan_complete(struct wfx_vif *wvif) { complete(&wvif->scan_complete); } diff --git a/drivers/staging/wfx/scan.h b/drivers/staging/wfx/scan.h index bba9f15a9ff5..2eb786c9572c 100644 --- a/drivers/staging/wfx/scan.h +++ b/drivers/staging/wfx/scan.h @@ -10,8 +10,6 @@ #include -#include "hif_api_cmd.h" - struct wfx_dev; struct wfx_vif; @@ -19,7 +17,6 @@ void wfx_hw_scan_work(struct work_struct *work); int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_scan_request *req); void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif); -void wfx_scan_complete(struct wfx_vif *wvif, - const struct hif_ind_scan_cmpl *ind); +void wfx_scan_complete(struct wfx_vif *wvif); #endif /* WFX_SCAN_H */ From patchwork Wed Jan 15 13:55:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7C15C33CB1 for ; Wed, 15 Jan 2020 13:59:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2968222C3 for ; Wed, 15 Jan 2020 13:59:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="n5iKOJDH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729936AbgAONzc (ORCPT ); Wed, 15 Jan 2020 08:55:32 -0500 Received: from mail-eopbgr770071.outbound.protection.outlook.com ([40.107.77.71]:65358 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729904AbgAONza (ORCPT ); Wed, 15 Jan 2020 08:55:30 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C38VzlOKhFNd8jyt8iw7NuhAJRQSjqH38MIVMw43ASGyvCJyLle9oQXkOyqQhbQ/Y6DO/PlFd206r7ID02nhzo7f1n3px1lMLUXqhVTR89LUsj4fOvEDYdEaiCxTVBuL1Rxz1zT/Yl0LINwJSmiqYeoNSd9ddts9sxN2I+QoT7R8Nj4wG6rRkmVnnWj6CVMw6cjHEFbhdDIbyg9o1z3wCk5GyBwLskGQdZX0c0sSyaYKhE8KZ8Hsa/7bcbtL9gGz1tczZsxZHFyFyo9WwbKT0o9vvd/08lpQD3ElWWFuZeU9xpzG6kiSA087puA7LnODvIbNRCEkPWoL46I0IPMOfA== 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=dyYeovap0+RlWylFVGyolLwgpnfFNImokIBu+J3RC7k=; b=fnMiOWDYMveP/Q5wqz+MWW8QHo+4PX7rSKuac5B27poKhXuHQB0vAxkNP+JAaZzQj52Ddaf7qN0m1YjNdzey8dsdFI2J0MTemV3T822skvSA9wcseIRu2I/7b2IlyWbbymVT1k9MmI2LAvZ02RQieIFsc4WDMzWBRrW7yeRDV48uOJgV7qaJzJzMqBiahP0ZoZeyebQHEEwdMNeahsE3a1cc9GE1m51vcKVhz4rO9JuiJNJn3rtsOEmLE4lg16E5QJgO/pkwxypYzg3klWrKsqqeubRfNYTEn4tV8tpV+cS3+Gdhc1ZumP9GX6/PgCMvSbmo7ET3XVALcl+vfr0tHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dyYeovap0+RlWylFVGyolLwgpnfFNImokIBu+J3RC7k=; b=n5iKOJDHmz8LazOlDjn537B/0YatT1VdwS732/lB0DYHiV3ixT163Eqy08VuJzFzXFzjIf2VMcveigI25kTPq3De1CG8q6mOKN11lulJlt/eZTwGinEcZhNMAp6XCtaEZZYhghyKv4qTn8y6NbE6P1A27/UyoYGQZsWMTLH41w8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:21 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:21 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:54:59 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 40/65] staging: wfx: update power-save per interface Thread-Topic: [PATCH v2 40/65] staging: wfx: update power-save per interface Thread-Index: AQHVy6th6CaT+imqO0iWc63tAvCjAQ== Date: Wed, 15 Jan 2020 13:55:01 +0000 Message-ID: <20200115135338.14374-41-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 78287c4a-df6f-4556-4d73-08d799c283b9 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(6666004)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002)(60793003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MclBadxvLEATDKFruzYpNMqqRCawH4vsm5At8gFt+9RNaA3zOwOa1a3w8cs7jBYDHOj1dQVcv2rmOVVEaB1l4mlNjvYJsOM7H5kRROMnUfWVr0cB4Dy0t+XGyQnYCHk5g6rF9/DK+X6vTVGeKtrOg51pSnsinJGQkhMDwqN32NdPC+zPyUilvp4KfuaB+7m8EBG2QbpbIoARxXwlbGNHNer9vWNIEWetfG1YQRuOPtSWyI/trsvtjLLoYYddmzqAp3jSJQ3/CbcaqqQwfQnBjV2gqi9Wt3cn9GUOfMbYQ+oMP1zsSFkrFGBJ+ediXkNkVod7KV8B6+QTeYfx+RLRq9H4RtYv315gh2NFAv7dkSzEgQw6dWfX4LO/fdp//K4cIX8VGO9TcqLkNt0U1Fj9JCuzPzrIP48o7R3lIstqDwglas7+you1n3n6TpF8k0QSpnFPHLMsYObYGQdXsqe4rBmMY3+iAmOmgElY3e9lZSQ= Content-ID: <1167DF9AE01DA5469E64705091BB8E84@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78287c4a-df6f-4556-4d73-08d799c283b9 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:01.0587 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: dr9WBh12L3G2QDK415wBHEYvZD+kdlOsK5z3+OS0VWC3b8M5JlNRWURym/YnnTWMsKR+cdv9IYBgzqle6nwKEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller mac80211 and the device are both able to control power-save per vif. But, the current code retrieve power-save from wfx_config(). So, it does not allow to setup power-save independently for each vif. Driver just has to rely on wfx_bss_info_changed() instead of wfx_config(). wfx_config() has nothing to do anymore, but we keep it since it is mandatory for mac80211. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/main.c | 2 +- drivers/staging/wfx/sta.c | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c index 1904890c03fe..84adad64fc30 100644 --- a/drivers/staging/wfx/main.c +++ b/drivers/staging/wfx/main.c @@ -131,7 +131,7 @@ static const struct ieee80211_ops wfx_ops = { .stop = wfx_stop, .add_interface = wfx_add_interface, .remove_interface = wfx_remove_interface, - .config = wfx_config, + .config = wfx_config, .tx = wfx_tx, .conf_tx = wfx_conf_tx, .hw_scan = wfx_hw_scan, diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 0c3150a94c7c..94683a1440c8 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -826,6 +826,10 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, if (changed & BSS_CHANGED_TXPOWER) hif_set_output_power(wvif, info->txpower); + + if (changed & BSS_CHANGED_PS) + wfx_update_pm(wvif); + mutex_unlock(&wdev->conf_mutex); if (do_join) @@ -1058,18 +1062,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, int wfx_config(struct ieee80211_hw *hw, u32 changed) { - int ret = 0; - struct wfx_dev *wdev = hw->priv; - struct wfx_vif *wvif; - - if (changed & IEEE80211_CONF_CHANGE_PS) { - mutex_lock(&wdev->conf_mutex); - wvif = NULL; - while ((wvif = wvif_iterate(wdev, wvif)) != NULL) - ret = wfx_update_pm(wvif); - mutex_unlock(&wdev->conf_mutex); - } - return ret; + return 0; } int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) From patchwork Wed Jan 15 13:55:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216630 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23245C33CB1 for ; Wed, 15 Jan 2020 13:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3C33222C3 for ; Wed, 15 Jan 2020 13:58:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="oPrEHeWy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730192AbgAON6o (ORCPT ); Wed, 15 Jan 2020 08:58:44 -0500 Received: from mail-eopbgr770071.outbound.protection.outlook.com ([40.107.77.71]:65358 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729174AbgAONzc (ORCPT ); Wed, 15 Jan 2020 08:55:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A89kW6f8H4kKYTvWn2p6NT1TbgdqwUIQ4MpCxwvyB0Pb9rkeftL+uh6iIGPiwaoaYr3cFBjEywecrVikPzH6aTPYCHYpvPqtgLxXFaAYIBQbf/8LDO/78wuOrhUf8K+dRCvbsbSrfpdLGEukKg9y8mutPRrq43Y4H2UhzpoBypCwOmDw8wpv5ysIZxPPoKBWrCmr2KazSk/SHsPxIZ6RzNJ+wMv0wNTbv41x73od57JcJD/eyNdHkFhJ3+GKEbW/MInhwh5Rwzd3vFlHXQCFKkpIB6nyURv6k9nYH49ZlxZWtksZF6sQT6UO7vj4/tA4GYI0G9NQfy9yNiJAeGn9KA== 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=4OQhlUt+sYJ/eiAbIL8ycTks4MYvs5U6ohNWOamkvK4=; b=hZssF4Ty2nuS1TnB/wpEYiJh8+BAZR52/JAFbq9m5E84jcMzfc4OLKqdetAQerSFZoORNM3t/deFo46g1JcxcbMq2utoa+CNmdZukxt7BkQY1bSkxQFEvhKadcIDg+BgruAQ6azgjXuEcSuXGZ/QMljOzqsk8MmVUfcRv9UQB5UyfxhZcVrjRvYQrGkCUL4zV3ZZ/RBNZU0T6PcVB7ny1PoaHK3lDZiYxT1rpJrRd3GYRQWSZeinEjKDMlSiq9eBl1o+dQOiCSq7R4mScslvm+05ziOiFLnpt+YlkfQRvkzSyHzB3YmiqtoInnlTXj8YFDlyEKwJUWrfavcE+TxVsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4OQhlUt+sYJ/eiAbIL8ycTks4MYvs5U6ohNWOamkvK4=; b=oPrEHeWy6js7Y7KxPJObYzHEAWLcJZGJwu92xrTRsx1OrrOugHOIwH3KycEn7/NaC9SKVIbI5AxcI6JH+f31IwdXJsi+KTEbeQQ9yoQ4N+9MUAFTu628T/c/9pFIoOTi45A1kZb1Qmg1U56VdQ/xWUpfA6n1lo8r6dc+Uc8q9LA= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:23 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:23 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:05 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 44/65] staging: wfx: fix possible overflow on jiffies comparaison Thread-Topic: [PATCH v2 44/65] staging: wfx: fix possible overflow on jiffies comparaison Thread-Index: AQHVy6tknNoFdeHsHUyntutLYMezLg== Date: Wed, 15 Jan 2020 13:55:06 +0000 Message-ID: <20200115135338.14374-45-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 67ef5be2-7b05-4e35-5561-08d799c2871d x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1332; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002)(16251815004); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: wbbuqLrOGE6C0JRBBhkr2yot0I3HShDupjfYTAv1NrHrcuvGz3h3II8tgzFRtozkV2i5bhgBBGwNqRn05fVdsg6/+nSH+1r87ZoEcGiGABt815E9F/O4QMRoZxlgls6gvdvZgsEcuGSXSUz+oXzBG2vHg0VFse6lCL92GSabrtDgUN9ePto2OJ6bKFzEqM6BQfFEmwcQLsNODlUWQ52NbhDAA7AKQZ/KB1ZO6LaPjDte6Khd+zsbqBqTkd/MeFZn22HxtL4MpputTDlTfsvuLgeqvUfGnT9NtQMlZlPecz1taorx2N2CI8N8ALQ601BuZForV0Ep+b6owjD2lshK7Qtl3V1utsqjFo8baaBCZNoZrTxDR+Jpl5iYpkohR5xTGuLkBNxvoehsNgSP+vGSytW86pgOOvPtHoo2HS4dQvjf5VFGs0UQf+b1o/UOVZEgLxfJFUXrzMM+vYfvaM32MzRQvMWCbwjAcoMlVghiZxWcQT4nP/YFAKhHUKJD17/j Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67ef5be2-7b05-4e35-5561-08d799c2871d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:06.7445 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pXmP9f6DFfSvv+D3HRVAsVu3EMS9YAwv9twNNL2W3AtUtPw6+JAd0Jy9w7ilVCHPUanEwCZ8zyRTGGpUD73Sww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is recommended to use function time_*() to compare jiffies. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 60459299a3a9..704ebfe1cd05 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -270,8 +270,7 @@ void wfx_tx_policy_init(struct wfx_vif *wvif) static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) { int i, ret = 0; - unsigned long max_inactivity = 0; - unsigned long now = jiffies; + unsigned long oldest; spin_lock_bh(&wvif->ps_state_lock); for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { @@ -280,13 +279,10 @@ static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) break; } else if (wvif->link_id_db[i].status != WFX_LINK_HARD && !wvif->wdev->tx_queue_stats.link_map_cache[i + 1]) { - unsigned long inactivity = - now - wvif->link_id_db[i].timestamp; - - if (inactivity < max_inactivity) - continue; - max_inactivity = inactivity; - ret = i + 1; + if (!ret || time_after(oldest, wvif->link_id_db[i].timestamp)) { + oldest = wvif->link_id_db[i].timestamp; + ret = i + 1; + } } } From patchwork Wed Jan 15 13:55:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216632 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F045C33CB1 for ; Wed, 15 Jan 2020 13:58:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2865F24656 for ; Wed, 15 Jan 2020 13:58:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QSp0W05R" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729990AbgAONze (ORCPT ); Wed, 15 Jan 2020 08:55:34 -0500 Received: from mail-eopbgr770084.outbound.protection.outlook.com ([40.107.77.84]:58049 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729949AbgAONzd (ORCPT ); Wed, 15 Jan 2020 08:55:33 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XozFP+K0pmBGntJV0QAOb7fHYEJQSWod35N8+4/w11Yp2GU3h62M+kpqYsNAuSvNUrNIzbsYPEVRAXiXtdLWG+VU9k2wKX8n/RWNhhzTJpUwcFOefmTTngPY5Q3zYT43ReLeYyBLBt1P0zr3d1nXNgeJ7aRch2ZCqzUuShMzbVAEIvXiZYMOGMUY3o8LTgO0DLT4cLDSiw9J4Js9FW4tl4dOdoGLH6g0SEhZ40MJLDVhujKEZHrG6HuSFrTlivn/b71NL7bap1JjFyUkVKrijDG9ceziMTO/+7Nuz64e5bDswfdYcEck1UU51OQUBqkx676OnNatideHfN6jcMDhEA== 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=Bwh7lWsf/cwWs0AEW/3avuQIgItjw4kHtgAkBvBt6+k=; b=me5NHcqL0N1mP3L+pnBxrkIAvdllEXcSCED7Mtd0uy5tlL/ZQAzvMUF/s4xZLd0S6Jvyre4+ayFI+v5zQphiXjtUa1kCzBo4iiJLsmIYyb0DJz4dgJnv1sWZlGwaOAM+I9xje3kFxHAlQof0hFMh/jDI7bHkpJcHxWd+5MkTzoEWAZ2jtrtSMlhszwip/K9iJBgA20yEAfBN63Gyman1xGhGtdxdUxZNhhhGEWFdegjwpjP0bSdwV+Skh6SQAWqwqBPasN+mAr3bPIwOVb3Ax/H+kzooAAk7PwAC/hOqjiPtk7lcCrZyq51mx5DiIlWD5QQXAZmTFIgy+pUZDNIEgA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Bwh7lWsf/cwWs0AEW/3avuQIgItjw4kHtgAkBvBt6+k=; b=QSp0W05RFK147S5doTITtYYBj9+dEPISSniNwDXE69JLTPbFRrfR3oQ8+ND2fYBW5LLyOKjU9PRhlehJCN9JvDOruir8M81L6oKAZ4wh5YA8HFdgrvjLzrPkMzBEDwzNv9U/ei1NcRBAwuHTNlUGqDYZiv1Ffh6XwM3z+HKwkO8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:24 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:24 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:08 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 46/65] staging: wfx: relocate "buffered" information to sta_priv Thread-Topic: [PATCH v2 46/65] staging: wfx: relocate "buffered" information to sta_priv Thread-Index: AQHVy6tm4JGe3+qchECT4G6SL0M87w== Date: Wed, 15 Jan 2020 13:55:09 +0000 Message-ID: <20200115135338.14374-47-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f8354f39-d3af-42ab-f250-08d799c288bf x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: T1qyIWEd3/AvDotyw+mNpCTwbLbPYkr8R9Vjodzp8YCltkcZCLOHCk4ke9/8ELfwH5zB0i25evXe3Ef5rR3oryBNEXtqnBIMq2uwY6z9IKNbKSAs/7li2LO2xzWNhfBBxpdFuqAM2iOM0WhtKE4fFFYKU07AlrZXEpQePcdwXbDt0qF1Y15+52fBHVZfW2GTD5NX2tcgvC2xdr+eee6xCQiozTKbEBZvbOOq6uO679CMB4l+gn3D4Fdawq5F4emQbSVJirs/V3L4JZ/nmYSP1oVI7W5aEEquDfAhi09qMga429YHtabEEx8o+S0eTj/g3mpYwzOY1O2tlDUzUTccAR+F1Rv4O2OPphSY38X99VEXFDkD5NHxIvN5ZubwGzcF2PZhfsKEuGve3YTRHVWdbqo/sYnfiuMGGwfal/2uCWA5TdyiP+fFD0jWB0VAnzAM Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8354f39-d3af-42ab-f250-08d799c288bf X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:09.5039 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jBEh5aDgNxD2H1tDJYOYHXdeOo7PBr/qeRfU+h0ASXRXYKqumzVBcETXQCV9ccwMYPRukqYlM+DAor9U00P3VQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller It simplify the code if field buffered is hosted in the struct sta_priv instead of in the struct wfx_link_entry. More globally, struct wfx_link_entry has no real reasons to exist and should be dropped soon. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 50 ++++++++++++++++------------------- drivers/staging/wfx/data_tx.h | 4 --- drivers/staging/wfx/sta.c | 1 + drivers/staging/wfx/sta.h | 6 +++++ 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index e669fc4485e6..9313c8f5d4d8 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -291,7 +291,6 @@ static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) entry->status = WFX_LINK_RESERVE; ether_addr_copy(entry->mac, mac); - memset(&entry->buffered, 0, WFX_MAX_TID); wfx_tx_lock(wvif->wdev); if (!schedule_work(&wvif->link_id_work)) @@ -434,6 +433,7 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, struct ieee80211_sta *sta) { u32 mask = ~BIT(tx_priv->raw_link_id); + struct wfx_sta_priv *sta_priv; spin_lock_bh(&wvif->ps_state_lock); if (ieee80211_is_auth(hdr->frame_control)) { @@ -448,15 +448,17 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, schedule_work(&wvif->mcast_start_work); } - if (tx_priv->raw_link_id) { + if (tx_priv->raw_link_id) wvif->link_id_db[tx_priv->raw_link_id - 1].timestamp = jiffies; - if (tx_priv->tid < WFX_MAX_TID) - wvif->link_id_db[tx_priv->raw_link_id - 1].buffered[tx_priv->tid]++; - } spin_unlock_bh(&wvif->ps_state_lock); - if (sta) + if (sta && tx_priv->tid < WFX_MAX_TID) { + sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; + spin_lock_bh(&sta_priv->lock); + sta_priv->buffered[tx_priv->tid]++; ieee80211_sta_set_buffered(sta, tx_priv->tid, true); + spin_unlock_bh(&sta_priv->lock); + } } static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, @@ -789,31 +791,25 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) wfx_pending_remove(wvif->wdev, skb); } -static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb, - struct hif_req_tx *req) +static void wfx_notify_buffered_tx(struct wfx_vif *wvif, struct sk_buff *skb) { + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_sta *sta; - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + struct wfx_sta_priv *sta_priv; int tid = wfx_tx_get_tid(hdr); - int raw_link_id = req->queue_id.peer_sta_id; - u8 *buffered; - if (raw_link_id && tid < WFX_MAX_TID) { - buffered = wvif->link_id_db[raw_link_id - 1].buffered; - - spin_lock_bh(&wvif->ps_state_lock); - WARN(!buffered[tid], "inconsistent notification"); - buffered[tid]--; - spin_unlock_bh(&wvif->ps_state_lock); - - if (!buffered[tid]) { - rcu_read_lock(); - sta = ieee80211_find_sta(wvif->vif, hdr->addr1); - if (sta) - ieee80211_sta_set_buffered(sta, tid, false); - rcu_read_unlock(); - } + rcu_read_lock(); // protect sta + sta = ieee80211_find_sta(wvif->vif, hdr->addr1); + if (sta && tid < WFX_MAX_TID) { + sta_priv = (struct wfx_sta_priv *)&sta->drv_priv; + spin_lock_bh(&sta_priv->lock); + WARN(!sta_priv->buffered[tid], "inconsistent notification"); + sta_priv->buffered[tid]--; + if (!sta_priv->buffered[tid]) + ieee80211_sta_set_buffered(sta, tid, false); + spin_unlock_bh(&sta_priv->lock); } + rcu_read_unlock(); } void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) @@ -827,7 +823,7 @@ void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb) WARN_ON(!wvif); skb_pull(skb, offset); - wfx_notify_buffered_tx(wvif, skb, req); + wfx_notify_buffered_tx(wvif, skb); wfx_tx_policy_put(wvif, req->tx_flags.retry_policy_index); ieee80211_tx_status_irqsafe(wdev->hw, skb); } diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index 54738c2e3eac..d02a7b325b27 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -14,9 +14,6 @@ #include "hif_api_cmd.h" #include "hif_api_mib.h" -// FIXME: use IEEE80211_NUM_TIDS -#define WFX_MAX_TID 8 - struct wfx_tx_priv; struct wfx_dev; struct wfx_vif; @@ -33,7 +30,6 @@ struct wfx_link_entry { enum wfx_link_status status; u8 mac[ETH_ALEN]; u8 old_mac[ETH_ALEN]; - u8 buffered[WFX_MAX_TID]; }; struct tx_policy { diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 4a44d72f0db1..aebce96dcd4a 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -572,6 +572,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; struct wfx_link_entry *entry; + spin_lock_init(&sta_priv->lock); if (wvif->vif->type != NL80211_IFTYPE_AP) return 0; diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index e0b54332e98a..47d94d6b8590 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -12,6 +12,9 @@ #include "hif_api_cmd.h" +// FIXME: use IEEE80211_NUM_TIDS +#define WFX_MAX_TID 8 + struct wfx_dev; struct wfx_vif; @@ -37,6 +40,9 @@ struct wfx_grp_addr_table { struct wfx_sta_priv { int link_id; int vif_id; + u8 buffered[WFX_MAX_TID]; + // Ensure atomicity of "buffered" and calls to ieee80211_sta_set_buffered() + spinlock_t lock; }; // mac80211 interface From patchwork Wed Jan 15 13:55:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216635 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB407C33CB1 for ; Wed, 15 Jan 2020 13:57:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81DF824656 for ; Wed, 15 Jan 2020 13:57:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Zvqy5x5d" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730320AbgAON4j (ORCPT ); Wed, 15 Jan 2020 08:56:39 -0500 Received: from mail-dm6nam11on2065.outbound.protection.outlook.com ([40.107.223.65]:2785 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730040AbgAONzh (ORCPT ); Wed, 15 Jan 2020 08:55:37 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0verkCuahh3GTMn/J8ZNpZAo06RdhnCj8JA2Z4kVUnJEWsEpCuJ2LLPuSk0niBux1n2BsulvGRBnHNEAmKydB0atd7ofD0aQVIHlKekZRdlOB74RK26vKw/HWbWhO+qxiXTnjy1l5BoQd+YCM5XuEY1Cy8mvz3HUTPUyqYTvNMHW+4uGwejPJ100Jzv6rdnU9MZoHD7+1kuWctyLTeGtPn4yN4R84Jz5890M9zdTloatby2AyJBOa6ZSIF1NT8GVfc8aRom1tfj+mihLyQKoER5/+MCd9GKuvrccvGCupyRfDc+Y+LmekCPgvUq27Fch3TtHeSM/9NlLaRXMuKm9w== 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=Al1Suf7asEdXDlAgY+GihgZrRYhE2CYrZa2Hmh7IEOw=; b=Ff1iBeTMTP3o4G4oJn9aKYMzANvsMYDG7hQJLuqE78+oI6hbMHQgVGvnmmUFASxqVbY5ZdB4rjbEJMRk2J4DWqJ2HZM0YlMYLdK0OZoOh6n4o2+qe+v49QBLTNboScWBnbpGUcu5jzsvwuLrGXzPy+jDe994C9zujEu1wsW28jYsZEOej/M+Kt0UaRHFeI2WmF6AkdjU4QaCHMxGHwwsTOrqvm+o8Z2TY4279YNWihWLAJ/201qXHn82/+Kxxv7SiCI+4mhAVk9AZSlroVjAWFBrz0vjYWLXhQgGytzg77VyRzUGb9CN8Dra/VN6ABTaUWwkKxLJsFgh7VeExrj8Xg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Al1Suf7asEdXDlAgY+GihgZrRYhE2CYrZa2Hmh7IEOw=; b=Zvqy5x5dWw/hkSF1XSTsm1EfCw+ZbYlx7PtuyFTowRKIeA6+iHRfehUC1UYvx75dKpBt6hFXbddqdt7bJVmflo3M7ej+BetocKp2gM6TthYB93xAKL0q39v3n2UX4SPzeBhQdJNZ2ESqAoQf8VWjhpAkAihts6hJx3F0PQyR6Hk= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:55:25 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:25 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:09 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 47/65] staging: wfx: fix bss_loss Thread-Topic: [PATCH v2 47/65] staging: wfx: fix bss_loss Thread-Index: AQHVy6tnhftv2aZMEU6oRLHUQewePA== Date: Wed, 15 Jan 2020 13:55:10 +0000 Message-ID: <20200115135338.14374-48-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7d7321ac-2b57-46a1-8ca0-08d799c28992 x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(6666004)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LAUFTak0rVAf0S+i6QK0h0fjJKR+ArLwYtDzEpPoiI+m2hT6LfaIRtMw8vx5amAKRdF7ltDRLa+WvL65d+qGsgGruqcoluzR3AQTsxF4p3PGfAaJghB1RUYDzG9hw71oUS7EeeYaXRl5LA3pQ7Gxw6c2w9f0z2+tUiuX4ecWVFBRdd5kWlLZ0cmCaTg4MD6XABeYGYaTyIX8VNX+jV29JAZpxg8Lp+1bF68XHYnLTxy3j8XtV9lrPb/LIp+fYBFpz3ucL+9evOw5Hm7w47QuiqUtBPr0FLcbbRTH3kHH5tlEnhnKSn8wEvruCjX9NaANcRWyQ9IbtNS/ZruK1MwOP/teulLYkAX9hpkJviNFbdJJp17VsrHuny99OOM1O8yvZX4yagqh6d15T4sPOn9z0MZfOHvoXz5fMnEXtiIKDwL+Xp3akIVQRlnQ1xUxHEVS Content-ID: <22F3F573D434D346ABEA3324DA769F50@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d7321ac-2b57-46a1-8ca0-08d799c28992 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:10.8851 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xyOXFL/WapsE8GyFv50JrtBgyceXwxE3CWJ7mByF4gPSFYP+cM/3nNwlHVct0dWq+jykE759dlASrHbG9BS2HA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_confirm_cb() retrieves the station associated with a frame using the MAC address from the 802.11 header. In the other side wfx_tx() retrieves the station using sta field from the ieee80211_tx_control argument. In wfx_cqm_bssloss_sm(), wfx_tx() was called directly without valid sta field, but with a valid MAC address in 802.11 header. So there the processing of this packet was unbalanced and may produce weird bugs. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index aebce96dcd4a..1c10ebd11944 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -88,19 +88,25 @@ void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad) // FIXME: call ieee80211_beacon_loss/ieee80211_connection_loss instead if (tx) { struct sk_buff *skb; + struct ieee80211_hdr *hdr; + struct ieee80211_tx_control control = { }; wvif->bss_loss_state++; skb = ieee80211_nullfunc_get(wvif->wdev->hw, wvif->vif, false); if (!skb) goto end; + hdr = (struct ieee80211_hdr *)skb->data; memset(IEEE80211_SKB_CB(skb), 0, sizeof(*IEEE80211_SKB_CB(skb))); IEEE80211_SKB_CB(skb)->control.vif = wvif->vif; IEEE80211_SKB_CB(skb)->driver_rates[0].idx = 0; IEEE80211_SKB_CB(skb)->driver_rates[0].count = 1; IEEE80211_SKB_CB(skb)->driver_rates[1].idx = -1; - wfx_tx(wvif->wdev->hw, NULL, skb); + rcu_read_lock(); // protect control.sta + control.sta = ieee80211_find_sta(wvif->vif, hdr->addr1); + wfx_tx(wvif->wdev->hw, &control, skb); + rcu_read_unlock(); } end: mutex_unlock(&wvif->bss_loss_lock); From patchwork Wed Jan 15 13:55:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216642 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2579DC33CB3 for ; Wed, 15 Jan 2020 13:55:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF035222C3 for ; Wed, 15 Jan 2020 13:55:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="IP5fm4u3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730016AbgAONzf (ORCPT ); Wed, 15 Jan 2020 08:55:35 -0500 Received: from mail-eopbgr770047.outbound.protection.outlook.com ([40.107.77.47]:48566 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729955AbgAONze (ORCPT ); Wed, 15 Jan 2020 08:55:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HM7GncxmHJhiXvhtLMaF2WVPHimMXlhaI/8CfND1T67HtWvqJoGDHxBTjKAQWmL0VJAANBhnv7zd/Mx/bgb9WzbOE42tMEn3pYbLisoKNsHoz77f6l85RtxLAxK6XD0/kbj27M51drny1Y8G8yJYybLk/KGznXSAZw6862MJnLgzHx5iW5ORhNMrgNn+jd+L4fpfzT9bWzs/g9iPURNoKteK03kHoIf0F2d2NDy7k3ODboGAcA9auzDnhBJ03motKVj3e8sYE9rZp7sXnM5WMogHBv4BseSBtgfGtSKWXbis9wd1A8gHe2SV74HxBQYb/JA85teQBICf2qPv0bZu5w== 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=S58a9nBVLutMsEJZPV8bHoCpGXQyMjCyT50cVLTOSZ8=; b=LytiwQ0WnQ3aMLBlk5J0xVmUkukhMtSI0HIEPxxKVbC+bz3GCMaaZAFGt8X5PMHz1KFti/DwFHaFM35DFla0zu1sjrbqFDP2ujgL4bXcEtsZWmquyjyuu7WaDB5dCfQtCU2Su6I4xJb1iNSWx2TSElRwq4wwp+YdMDDth2zMuqEHy+HFKIzqtJNwXQiPSb+jC4IjLMPKOzh3OjQXH/yUIuk9rTYnDk37ze9pQh9l5o7UR67/KsLogPDXQ1L2ZoilNmw6s3kGPniPMJwqTg1ovqYZbzEhlMUT3UPcB/WiRobVNI2F73jg3jCz5mDeTqM68Vlpttb0wgoyla7scSP0lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S58a9nBVLutMsEJZPV8bHoCpGXQyMjCyT50cVLTOSZ8=; b=IP5fm4u34uT+JdFfSsJqyoYe+ruNjaVKiUKH47+8e8wZRlyCbJk79OPz0lx4nZnuFEzN8zH1OZEUqur6Mq1og8+b8bgSA5D7etr73mQpYG8W2ukibjE+HGf6K0wO1XPgsg+KWJYbox2227Mnn4m4XfdcL3v2IdG8Sa/6fOZUaIw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:25 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:25 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:11 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 48/65] staging: wfx: fix RCU usage Thread-Topic: [PATCH v2 48/65] staging: wfx: fix RCU usage Thread-Index: AQHVy6toAXQ1JWeWU06vV4WjT0TLSw== Date: Wed, 15 Jan 2020 13:55:12 +0000 Message-ID: <20200115135338.14374-49-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9789353e-7c4a-4ae6-1977-08d799c28a6b x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:390; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pNuT7HyEhSwa2PfBEQdtUe6p9koYyyWtEpASn+sJOgIOUMWix8TKPchbJqilopLPT1yy5Ct46GZdttuPrFHyKG5mACGHdT9boYACpfojl+1vwKRPqS8600MoazBXnvkkpZogqIlXy6miFY9DwGmN2MFKlNdKGf4gUGezPVYUQLInVUQ+4bBpV/ULO2M/N/ADpd6o+HgBxukDUWIyuU+k5MYj5RnVNZnNaUmYWEKAFP+QgpJMq4O3Yr3pasR091YhEXCIk6lKpAisrAQ4OlVrLsbsecIt5DzdKR8jdiv0wBsXhpHDtVx5twZ7T3TXAY+btjHWmIGKggBR/UQbF9dLRKiMKJCM4EtTPF0LsAT5xxxAFwPVgNuH59Z7LDzHpKy0ODc9U93jMjLPJ9q4n8vwrTwY2yCD0XqKAW0eEGaREqIrFOqrFpLQPoceJ9Abq1gD Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9789353e-7c4a-4ae6-1977-08d799c28a6b X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:12.3023 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IKiWCp7PdyIs6DS/6TjL7DsCgtvC7UTF+EqS7QNsMz/I+aL9IDBY1TRQLcumDNbwosqYlbC8x2BgUx04oB252Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Indeed, sta was used after call to rcu_unlock() Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 1c10ebd11944..cc72877a090f 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -690,10 +690,9 @@ static void wfx_join_finalize(struct wfx_vif *wvif, struct ieee80211_sta *sta = NULL; wvif->beacon_int = info->beacon_int; - rcu_read_lock(); + rcu_read_lock(); // protect sta if (info->bssid && !info->ibss_joined) sta = ieee80211_find_sta(wvif->vif, info->bssid); - rcu_read_unlock(); if (sta) wvif->bss_params.operational_rate_set = wfx_rate_mask_to_hw(wvif->wdev, sta->supp_rates[wvif->channel->band]); @@ -712,6 +711,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif, wvif->bss_params.aid = info->aid; hif_set_association_mode(wvif, info, sta ? &sta->ht_cap : NULL); + rcu_read_unlock(); if (!info->ibss_joined) { hif_keep_alive_period(wvif, 30 /* sec */); From patchwork Wed Jan 15 13:55:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44D98C33CB3 for ; Wed, 15 Jan 2020 13:58:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 112702465A for ; Wed, 15 Jan 2020 13:58:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="QBbAUnZ+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729789AbgAON6Y (ORCPT ); Wed, 15 Jan 2020 08:58:24 -0500 Received: from mail-eopbgr770084.outbound.protection.outlook.com ([40.107.77.84]:58049 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729075AbgAONze (ORCPT ); Wed, 15 Jan 2020 08:55:34 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NfOsHrQmjMO1ADDTnK6A2GG0Cc0SBk2Wnf1ZrDD7i2wXxPX7yahbsqB+xrLjYL6JSXTHyqwOf5dshbC2l+gm/YxK/tkh2jgdegd5BKXffbgr4/ZfM9Z3V6mBTki4VJ/ibD1mw5RTlnwyB6dptFErE2XQ9Q/XcqySqNDpV8vkk6ZaX5KsYIbqjPoGpA2H7A1QU47iWbf9EHrpjRfQj3HQgYgwA2AF0Ka/FQ2GkFPL+wbGGTDZb0kcMzfD2LUwaVVtAjS0enuoIXEvakr9aQAH2i+YpZ1QvanBShCrTw0FS2//TXJPqF/69F8Z4Y2zZVuLAkpCsXIIgvNls9ShH9px4Q== 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=uOrtloGiHZH4CTUw4jIxstqp+7GcIHe3HODqlIzlH9s=; b=eNGI5gf+hJ0JJkbUitqzw9dTh3sFOtMOiHM042Wpx4CnZlFkNjQull/wKrzwLEHQhLInrr/sfoKtzTOediCnPhemWUjXKl40xUXRxisUgLMBjByMjReDD2gt0/ebxOgIq0G36xFYXMV9A7f5/pISJQ+3HnpPZYUSfnL058D50j6Qcu77fqfrLpOvp7pjrRLuI2Y7XQzwk5B6hVyZwILTMRdDsxuvmTqThuWsPyKYJ99nA7QhgDp04bwB55y+lv1bvaI4YQLoKLXKCGRm6eV6KNJft47i5p9JaKDW0lnC4HQlrUfXY0J6bP4Mrkf99+3ZyJEtA89v+nlNn/1kPd6bGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uOrtloGiHZH4CTUw4jIxstqp+7GcIHe3HODqlIzlH9s=; b=QBbAUnZ+feraB74fEIZCNZGwjwBooQYuv8yZI+4rHDTEt3nDXsFDZZILppmSKPpzmUZ3VM3GSLBmOIzcvCLATFttM84SFE4/7ip3n3XRekkxLY29SmHGDUB53QQmOitAEz+Bk5OGNAze9pXjtnjzf0nwYZp1uOQt1QMfHTf7Loc= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:26 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:12 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 49/65] staging: wfx: simplify wfx_set_tim_impl() Thread-Topic: [PATCH v2 49/65] staging: wfx: simplify wfx_set_tim_impl() Thread-Index: AQHVy6to64KLHnVd/UOnhm2uzYO07g== Date: Wed, 15 Jan 2020 13:55:13 +0000 Message-ID: <20200115135338.14374-50-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe3d4db7-065e-4b63-f32a-08d799c28b55 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1227; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +oyFicVEaw66J00ZXBB3+LDRnAVvjMnIYxzdehau5zKaVSSzy3AnV28NRB9Ha+NJIJ9gqIgzEzb/VlSjYq1AYG4KLEN4/WlU5CWbAAMLv1LP8xkv+sypQsXH5pQJtQMTX1PJNQ0k+x6TlbZBh0Uo1AHFATQPRbbreYnCZ6DIBOdgEMjgcnYqTZoKweq8VcKB7cdJEigKbo1/ctaTou4ydcAckVjLMsR/bxhpMKC9MU3pD7HWzacw7/2bJBsqJ3/yTBwptZOiaKZAf1Za/AjqpoUPgsxnCWaBiujYBTPWzv5D6EjjPMZjvgNgwuZuthXSwA6Q9f3oLrqJG/lBgd1skGe15g68kFi1Z8Fcw3P8fBFD+f+K5IUXjRFJ1iTvRwLxsSSkwRX/dgPZUR5Fyeqxc7BT6jY1Zdzz3ozvj3AcjzYlZu7YGR+TZyNGmkJtqRTC Content-ID: <769C4D71AC69FF418590A4766EE137D5@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe3d4db7-065e-4b63-f32a-08d799c28b55 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:13.8304 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: XNuJQVENEDK9XUQuGOzw4vgPOcvH5DpcH4LmlZiSw7nBd9DPlVreCZZ/PlK/IU9JkjXI0+73g6RuizuFu/U91w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Argument provided to wfx_set_tim_impl() is always wvif->aid0_bit_set and there is no reason to provide another argument. Also rename wfx_set_tim_impl() into wfx_update_tim() to reflect the new behavior. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 18 +++++++++--------- drivers/staging/wfx/wfx.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index cc72877a090f..b7d21540d9a2 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -895,7 +895,7 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, wfx_ps_notify(wvif, notify_cmd, sta_priv->link_id); } -static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) +static int wfx_update_tim(struct wfx_vif *wvif) { struct sk_buff *skb; u16 tim_offset, tim_length; @@ -916,7 +916,7 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (aid0_bit_set) + if (wvif->aid0_bit_set) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -928,11 +928,11 @@ static int wfx_set_tim_impl(struct wfx_vif *wvif, bool aid0_bit_set) return 0; } -static void wfx_set_tim_work(struct work_struct *work) +static void wfx_update_tim_work(struct work_struct *work) { - struct wfx_vif *wvif = container_of(work, struct wfx_vif, set_tim_work); + struct wfx_vif *wvif = container_of(work, struct wfx_vif, update_tim_work); - wfx_set_tim_impl(wvif, wvif->aid0_bit_set); + wfx_update_tim(wvif); } int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) @@ -941,7 +941,7 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) struct wfx_sta_priv *sta_dev = (struct wfx_sta_priv *) &sta->drv_priv; struct wfx_vif *wvif = wdev_to_wvif(wdev, sta_dev->vif_id); - schedule_work(&wvif->set_tim_work); + schedule_work(&wvif->update_tim_work); return 0; } @@ -955,8 +955,8 @@ static void wfx_mcast_start_work(struct work_struct *work) cancel_work_sync(&wvif->mcast_stop_work); if (!wvif->aid0_bit_set) { wfx_tx_lock_flush(wvif->wdev); - wfx_set_tim_impl(wvif, true); wvif->aid0_bit_set = true; + wfx_update_tim(wvif); mod_timer(&wvif->mcast_timeout, jiffies + tmo); wfx_tx_unlock(wvif->wdev); } @@ -971,7 +971,7 @@ static void wfx_mcast_stop_work(struct work_struct *work) del_timer_sync(&wvif->mcast_timeout); wfx_tx_lock_flush(wvif->wdev); wvif->aid0_bit_set = false; - wfx_set_tim_impl(wvif, false); + wfx_update_tim(wvif); wfx_tx_unlock(wvif->wdev); } } @@ -1118,7 +1118,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) INIT_DELAYED_WORK(&wvif->link_id_gc_work, wfx_link_id_gc_work); spin_lock_init(&wvif->ps_state_lock); - INIT_WORK(&wvif->set_tim_work, wfx_set_tim_work); + INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); INIT_WORK(&wvif->mcast_start_work, wfx_mcast_start_work); INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index f56a91ea082d..cb359150e2ad 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -96,7 +96,7 @@ struct wfx_vif { u32 sta_asleep_mask; u32 pspoll_mask; spinlock_t ps_state_lock; - struct work_struct set_tim_work; + struct work_struct update_tim_work; int beacon_int; bool filter_bssid; From patchwork Wed Jan 15 13:55:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03CAEC33CB1 for ; Wed, 15 Jan 2020 13:58:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF6B824656 for ; Wed, 15 Jan 2020 13:58:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="HLW/6/Vy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730097AbgAON6H (ORCPT ); Wed, 15 Jan 2020 08:58:07 -0500 Received: from mail-eopbgr770047.outbound.protection.outlook.com ([40.107.77.47]:48566 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729972AbgAONzf (ORCPT ); Wed, 15 Jan 2020 08:55:35 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYCRELp1AHsDxf35U41L5qRw5Gf+nzw0QYaBMTp0VuG/UEa+0aPVBD9eDs7t7wu7Wmp2jMANDGUu9mKeevJmGjCqQsPuUuqH8rQKHBlWt0z/3Ue/3XLcim5W5NAOAvAjg78ur4o0FQ73NVTeIwtS0EpDaaOLFPd4Imcir1E+eE6SIEzTxdIg/9sRFUqY0a/7n4v0ouXRg6ZigGmJQA4p6Usktv+IMlwtdiEUrvEjoae5ScjRChhySjcSsn36qvMPmAankQQT+UKnlKIkb4Sz3e+ELkeSfffaD1gl/Vxu5R1es3S+wejz6X4rxBXGNbMOtkGoz6A9Tqt/q/2mW0jOpw== 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=Z72lnyKkPKO/GKtepl4hHTZ6glZfib3TTFoTuv7kGXY=; b=EWCz0212uwu3z6k3TuYl6pC2vbt2dS3SOHufEy2x+p2ZI475tHqQoNAtFpgrXV8M+n0AQeSTo2+o9knYuvu3xBfOzXFi3SOQNq69L8L3i4wnUtXjcV/jzM3V0NTu2zEP+qlSU0A+l8ItAmapbsU1o9iBFXoveLwp55FTrwvgqq9JUsa3P1QqiXxzopD2T+jcBtLv8mDpd/LdOj+rtFQb0dn163n1kBVyxysLp3172OUIjoCk9S0aGJWkOwMEQ+f9lcySfs+ySTl9Qt9qpuBDexwPhPGLg91jQTr90kBaFZMDA6BzjSWwV91twqL2V8y2wQyd8FZcCryUi5nhC0JOiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z72lnyKkPKO/GKtepl4hHTZ6glZfib3TTFoTuv7kGXY=; b=HLW/6/Vyfpj6XAzF635020qej4IPjBIQZbsarB5zu+3doC3oWrhMzoFsuoHA2C+r0DzeQ9tlIZnBFZtzI6i7Vb34BNOSKA2nlhE5Zd17avJH2DkK7x3cKUts4H9eM4LH5qlF/fzQXZi4z86dJhGrV/c9RXzzr4TOMG/RpSx+YJ4= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:26 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:26 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:14 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 50/65] staging: wfx: simplify the link-id allocation Thread-Topic: [PATCH v2 50/65] staging: wfx: simplify the link-id allocation Thread-Index: AQHVy6tpmju/g8fOj0Gzij+1N9WhHw== Date: Wed, 15 Jan 2020 13:55:15 +0000 Message-ID: <20200115135338.14374-51-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d853b497-fdd5-437a-f14a-08d799c28c27 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(30864003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oDfPWeP2iOfBsX3Bwzd7fW1OGaRZc2qe1faBaEzLzsq0QzBXkJQ8SA2xMH5oWYE7c8PGI3KwEO0hqg74hs0iKmC4DfqOXzWbn9/Jf6VaqJlTQUYRyCF1naadJtiiINE96U7Uz4WNU4+MVtTnLY9zQCVcea4T13lGSVKNRv1JEZ1Jf7PTP1Dx92+5RbPlO34tlufzsGb37drEywPEumhbnURCcUSPpZOB9JCNTv98VEfo8YGZBmEcKs6u9LKKVG4v4WttH2os+A8HL6dJpH3gexUNW3D6Frilg+dpF9bK3VnJxzKxmJYO+mLSFbi0tJJPovFtjMic1glo7lHPH1ae6imstRutZJrVaXzA5JV17le1g4qPGr+KTO8NH/RZ/dohpZUeTN6twrWxgEbwUv95bE11cYV6sQCZ9HuigehS5KD/9UvhvLi6gHrYszeNXn33 Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: d853b497-fdd5-437a-f14a-08d799c28c27 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:15.2226 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7xD9DYArto4gN6YeXyCUrhUu52pmPccFy5nrTSNj0n60hjc1DR1/v3XxO3pbboLijzVzm1k/+B7Gc6VSyZyp3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller The "link-id" is a slot number provided to the chip. A link-id is allocated to every station associated with the chip (mainly when the chip is in AP mode). It is more or less the same thing than the association ID, but it is limited to 14 values. Firmware uses the link-id to track the power save status of the stations. The current code try to associate a link-id as soon as data are exchanged with station. It is far easier to rely on sta_add() and sta_remove(). Until now the value WFX_LINK_ID_NO_ASSOC, was only used when no more link-id was available. Now, we also use this value for not-yet-associated stations (that was its primary behavior). Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_rx.c | 7 -- drivers/staging/wfx/data_tx.c | 164 +--------------------------------- drivers/staging/wfx/data_tx.h | 19 ---- drivers/staging/wfx/queue.c | 7 +- drivers/staging/wfx/queue.h | 7 +- drivers/staging/wfx/sta.c | 58 ++++-------- drivers/staging/wfx/wfx.h | 3 - 7 files changed, 24 insertions(+), 241 deletions(-) diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c index e26bc665b2b3..699e2d60fa89 100644 --- a/drivers/staging/wfx/data_rx.c +++ b/drivers/staging/wfx/data_rx.c @@ -103,11 +103,9 @@ static int wfx_drop_encrypt_data(struct wfx_dev *wdev, void wfx_rx_cb(struct wfx_vif *wvif, const struct hif_ind_rx *arg, struct sk_buff *skb) { - int link_id = arg->rx_flags.peer_sta_id; struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb); struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data; struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; - struct wfx_link_entry *entry = NULL; memset(hdr, 0, sizeof(*hdr)); @@ -117,11 +115,6 @@ void wfx_rx_cb(struct wfx_vif *wvif, ieee80211_is_beacon(frame->frame_control))) goto drop; - if (link_id && link_id <= WFX_MAX_STA_IN_AP_MODE) { - entry = &wvif->link_id_db[link_id - 1]; - entry->timestamp = jiffies; - } - if (arg->status == HIF_STATUS_MICFAILURE) hdr->flag |= RX_FLAG_MMIC_ERROR; else if (arg->status) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 9313c8f5d4d8..8c9f986ec672 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -17,7 +17,6 @@ #include "hif_tx_mib.h" #define WFX_INVALID_RATE_ID 15 -#define WFX_LINK_ID_NO_ASSOC 15 #define WFX_LINK_ID_GC_TIMEOUT ((unsigned long)(10 * HZ)) static int wfx_get_hw_rate(struct wfx_dev *wdev, @@ -265,156 +264,6 @@ void wfx_tx_policy_init(struct wfx_vif *wvif) list_add(&cache->cache[i].link, &cache->free); } -/* Link ID related functions */ - -static int wfx_alloc_link_id(struct wfx_vif *wvif, const u8 *mac) -{ - int i, ret = 0; - unsigned long oldest; - - spin_lock_bh(&wvif->ps_state_lock); - for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { - if (!wvif->link_id_db[i].status) { - ret = i + 1; - break; - } else if (wvif->link_id_db[i].status != WFX_LINK_HARD && - !wvif->wdev->tx_queue_stats.link_map_cache[i + 1]) { - if (!ret || time_after(oldest, wvif->link_id_db[i].timestamp)) { - oldest = wvif->link_id_db[i].timestamp; - ret = i + 1; - } - } - } - - if (ret) { - struct wfx_link_entry *entry = &wvif->link_id_db[ret - 1]; - - entry->status = WFX_LINK_RESERVE; - ether_addr_copy(entry->mac, mac); - wfx_tx_lock(wvif->wdev); - - if (!schedule_work(&wvif->link_id_work)) - wfx_tx_unlock(wvif->wdev); - } else { - dev_info(wvif->wdev->dev, "no more link-id available\n"); - } - spin_unlock_bh(&wvif->ps_state_lock); - return ret; -} - -int wfx_find_link_id(struct wfx_vif *wvif, const u8 *mac) -{ - int i, ret = 0; - - spin_lock_bh(&wvif->ps_state_lock); - for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { - if (ether_addr_equal(mac, wvif->link_id_db[i].mac) && - wvif->link_id_db[i].status) { - wvif->link_id_db[i].timestamp = jiffies; - ret = i + 1; - break; - } - } - spin_unlock_bh(&wvif->ps_state_lock); - return ret; -} - -static int wfx_map_link(struct wfx_vif *wvif, - struct wfx_link_entry *link_entry, int sta_id) -{ - int ret; - - ret = hif_map_link(wvif, link_entry->mac, 0, sta_id); - - if (ret == 0) - /* Save the MAC address currently associated with the peer - * for future unmap request - */ - ether_addr_copy(link_entry->old_mac, link_entry->mac); - - return ret; -} - -int wfx_unmap_link(struct wfx_vif *wvif, int sta_id) -{ - u8 *mac_addr = NULL; - - if (sta_id) - mac_addr = wvif->link_id_db[sta_id - 1].old_mac; - - return hif_map_link(wvif, mac_addr, 1, sta_id); -} - -void wfx_link_id_gc_work(struct work_struct *work) -{ - struct wfx_vif *wvif = - container_of(work, struct wfx_vif, link_id_gc_work.work); - unsigned long now = jiffies; - unsigned long next_gc = -1; - long ttl; - u32 mask; - int i; - - if (wvif->state != WFX_STATE_AP) - return; - - wfx_tx_lock_flush(wvif->wdev); - spin_lock_bh(&wvif->ps_state_lock); - for (i = 0; i < WFX_MAX_STA_IN_AP_MODE; ++i) { - bool need_reset = false; - - mask = BIT(i + 1); - if (wvif->link_id_db[i].status == WFX_LINK_RESERVE || - (wvif->link_id_db[i].status == WFX_LINK_HARD && - !(wvif->link_id_map & mask))) { - if (wvif->link_id_map & mask) { - wvif->sta_asleep_mask &= ~mask; - wvif->pspoll_mask &= ~mask; - need_reset = true; - } - wvif->link_id_map |= mask; - if (wvif->link_id_db[i].status != WFX_LINK_HARD) - wvif->link_id_db[i].status = WFX_LINK_SOFT; - - spin_unlock_bh(&wvif->ps_state_lock); - if (need_reset) - wfx_unmap_link(wvif, i + 1); - wfx_map_link(wvif, &wvif->link_id_db[i], i + 1); - next_gc = min(next_gc, WFX_LINK_ID_GC_TIMEOUT); - spin_lock_bh(&wvif->ps_state_lock); - } else if (wvif->link_id_db[i].status == WFX_LINK_SOFT) { - ttl = wvif->link_id_db[i].timestamp - now + - WFX_LINK_ID_GC_TIMEOUT; - if (ttl <= 0) { - need_reset = true; - wvif->link_id_db[i].status = WFX_LINK_OFF; - wvif->link_id_map &= ~mask; - wvif->sta_asleep_mask &= ~mask; - wvif->pspoll_mask &= ~mask; - spin_unlock_bh(&wvif->ps_state_lock); - wfx_unmap_link(wvif, i + 1); - spin_lock_bh(&wvif->ps_state_lock); - } else { - next_gc = min_t(unsigned long, next_gc, ttl); - } - } - } - spin_unlock_bh(&wvif->ps_state_lock); - if (next_gc != -1) - schedule_delayed_work(&wvif->link_id_gc_work, next_gc); - wfx_tx_unlock(wvif->wdev); -} - -void wfx_link_id_work(struct work_struct *work) -{ - struct wfx_vif *wvif = - container_of(work, struct wfx_vif, link_id_work); - - wfx_tx_flush(wvif->wdev); - wfx_link_id_gc_work(&wvif->link_id_gc_work.work); - wfx_tx_unlock(wvif->wdev); -} - /* Tx implementation */ static bool ieee80211_is_action_back(struct ieee80211_hdr *hdr) @@ -447,9 +296,6 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, if (wvif->sta_asleep_mask) schedule_work(&wvif->mcast_start_work); } - - if (tx_priv->raw_link_id) - wvif->link_id_db[tx_priv->raw_link_id - 1].timestamp = jiffies; spin_unlock_bh(&wvif->ps_state_lock); if (sta && tx_priv->tid < WFX_MAX_TID) { @@ -468,7 +314,6 @@ static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, struct wfx_sta_priv *sta_priv = sta ? (struct wfx_sta_priv *) &sta->drv_priv : NULL; const u8 *da = ieee80211_get_DA(hdr); - int ret; if (sta_priv && sta_priv->link_id) return sta_priv->link_id; @@ -476,14 +321,7 @@ static u8 wfx_tx_get_raw_link_id(struct wfx_vif *wvif, return 0; if (is_multicast_ether_addr(da)) return 0; - ret = wfx_find_link_id(wvif, da); - if (!ret) - ret = wfx_alloc_link_id(wvif, da); - if (!ret) { - dev_err(wvif->wdev->dev, "no more link-id available\n"); - return WFX_LINK_ID_NO_ASSOC; - } - return ret; + return WFX_LINK_ID_NO_ASSOC; } static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates) diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h index d02a7b325b27..83720b343484 100644 --- a/drivers/staging/wfx/data_tx.h +++ b/drivers/staging/wfx/data_tx.h @@ -18,20 +18,6 @@ struct wfx_tx_priv; struct wfx_dev; struct wfx_vif; -enum wfx_link_status { - WFX_LINK_OFF, - WFX_LINK_RESERVE, - WFX_LINK_SOFT, - WFX_LINK_HARD, -}; - -struct wfx_link_entry { - unsigned long timestamp; - enum wfx_link_status status; - u8 mac[ETH_ALEN]; - u8 old_mac[ETH_ALEN]; -}; - struct tx_policy { struct list_head link; int usage_count; @@ -63,11 +49,6 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg); void wfx_skb_dtor(struct wfx_dev *wdev, struct sk_buff *skb); -int wfx_unmap_link(struct wfx_vif *wvif, int link_id); -void wfx_link_id_work(struct work_struct *work); -void wfx_link_id_gc_work(struct work_struct *work); -int wfx_find_link_id(struct wfx_vif *wvif, const u8 *mac); - static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb) { struct ieee80211_tx_info *tx_info; diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 92bb9a794f30..3d40388739e3 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -378,13 +378,8 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, action = do_drop; break; case NL80211_IFTYPE_AP: - if (!wvif->state) { + if (!wvif->state) action = do_drop; - } else if (!(BIT(tx_priv->raw_link_id) & - (BIT(0) | wvif->link_id_map))) { - dev_warn(wvif->wdev->dev, "a frame with expired link-id is dropped\n"); - action = do_drop; - } break; case NL80211_IFTYPE_ADHOC: if (wvif->state != WFX_STATE_IBSS) diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 21566e48b2c2..813c2d09e034 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -13,9 +13,10 @@ #include "hif_api_cmd.h" #define WFX_MAX_STA_IN_AP_MODE 14 -#define WFX_LINK_ID_AFTER_DTIM (WFX_MAX_STA_IN_AP_MODE + 1) -#define WFX_LINK_ID_UAPSD (WFX_MAX_STA_IN_AP_MODE + 2) -#define WFX_LINK_ID_MAX (WFX_MAX_STA_IN_AP_MODE + 3) +#define WFX_LINK_ID_NO_ASSOC 15 +#define WFX_LINK_ID_AFTER_DTIM (WFX_LINK_ID_NO_ASSOC + 1) +#define WFX_LINK_ID_UAPSD (WFX_LINK_ID_NO_ASSOC + 2) +#define WFX_LINK_ID_MAX (WFX_LINK_ID_NO_ASSOC + 3) struct wfx_dev; struct wfx_vif; diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index b7d21540d9a2..75c1e2aecc23 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -573,28 +573,26 @@ static void wfx_unjoin_work(struct work_struct *work) int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { - struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; - struct wfx_link_entry *entry; spin_lock_init(&sta_priv->lock); - if (wvif->vif->type != NL80211_IFTYPE_AP) - return 0; - sta_priv->vif_id = wvif->id; - sta_priv->link_id = wfx_find_link_id(wvif, sta->addr); - if (!sta_priv->link_id) { - dev_warn(wdev->dev, "mo more link-id available\n"); - return -ENOENT; - } - entry = &wvif->link_id_db[sta_priv->link_id - 1]; + // FIXME: in station mode, the current API interprets new link-id as a + // tdls peer. + if (vif->type == NL80211_IFTYPE_STATION) + return 0; + sta_priv->link_id = ffz(wvif->link_id_map); + wvif->link_id_map |= BIT(sta_priv->link_id); + WARN_ON(!sta_priv->link_id); + WARN_ON(sta_priv->link_id >= WFX_MAX_STA_IN_AP_MODE); + hif_map_link(wvif, sta->addr, 0, sta_priv->link_id); + spin_lock_bh(&wvif->ps_state_lock); if ((sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) == IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK) wvif->sta_asleep_mask |= BIT(sta_priv->link_id); - entry->status = WFX_LINK_HARD; spin_unlock_bh(&wvif->ps_state_lock); return 0; } @@ -602,23 +600,15 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta) { - struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; - struct wfx_link_entry *entry; - if (wvif->vif->type != NL80211_IFTYPE_AP || !sta_priv->link_id) + // FIXME: see note in wfx_sta_add() + if (vif->type == NL80211_IFTYPE_STATION) return 0; - - entry = &wvif->link_id_db[sta_priv->link_id - 1]; - spin_lock_bh(&wvif->ps_state_lock); - entry->status = WFX_LINK_RESERVE; - entry->timestamp = jiffies; - wfx_tx_lock(wdev); - if (!schedule_work(&wvif->link_id_work)) - wfx_tx_unlock(wdev); - spin_unlock_bh(&wvif->ps_state_lock); - flush_work(&wvif->link_id_work); + // FIXME add a mutex? + hif_map_link(wvif, sta->addr, 1, sta_priv->link_id); + wvif->link_id_map &= ~BIT(sta_priv->link_id); return 0; } @@ -627,8 +617,6 @@ static int wfx_start_ap(struct wfx_vif *wvif) int ret; wvif->beacon_int = wvif->vif->bss_conf.beacon_int; - memset(&wvif->link_id_db, 0, sizeof(wvif->link_id_db)); - wvif->wdev->tx_burst_idx = -1; ret = hif_start(wvif, &wvif->vif->bss_conf, wvif->channel); if (ret) @@ -861,7 +849,7 @@ static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, dev_warn(wvif->wdev->dev, "unsupported notify command\n"); bit = 0; } else { - bit = wvif->link_id_map; + bit = wvif->link_id_map & ~1; } prev = wvif->sta_asleep_mask & bit; @@ -1114,9 +1102,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) wvif->vif = vif; wvif->wdev = wdev; - INIT_WORK(&wvif->link_id_work, wfx_link_id_work); - INIT_DELAYED_WORK(&wvif->link_id_gc_work, wfx_link_id_gc_work); - + wvif->link_id_map = 1; // link-id 0 is reserved for multicast spin_lock_init(&wvif->ps_state_lock); INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); @@ -1171,11 +1157,11 @@ void wfx_remove_interface(struct ieee80211_hw *hw, { struct wfx_dev *wdev = hw->priv; struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; - int i; wait_for_completion_timeout(&wvif->set_pm_mode_complete, msecs_to_jiffies(300)); mutex_lock(&wdev->conf_mutex); + WARN(wvif->link_id_map != 1, "corrupted state"); switch (wvif->state) { case WFX_STATE_PRE_STA: case WFX_STATE_STA: @@ -1185,13 +1171,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_tx_unlock(wdev); break; case WFX_STATE_AP: - for (i = 0; wvif->link_id_map; ++i) { - if (wvif->link_id_map & BIT(i)) { - wfx_unmap_link(wvif, i); - wvif->link_id_map &= ~BIT(i); - } - } - memset(wvif->link_id_db, 0, sizeof(wvif->link_id_db)); wvif->sta_asleep_mask = 0; wvif->mcast_tx = false; wvif->aid0_bit_set = false; @@ -1213,7 +1192,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); - cancel_delayed_work_sync(&wvif->link_id_gc_work); del_timer_sync(&wvif->mcast_timeout); wfx_free_event_queue(wvif); diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index cb359150e2ad..365aacc073fb 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -74,9 +74,6 @@ struct wfx_vif { struct delayed_work bss_loss_work; u32 link_id_map; - struct wfx_link_entry link_id_db[WFX_MAX_STA_IN_AP_MODE]; - struct delayed_work link_id_gc_work; - struct work_struct link_id_work; bool aid0_bit_set; bool mcast_tx; From patchwork Wed Jan 15 13:55:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 578BAC33CB3 for ; Wed, 15 Jan 2020 13:55:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 21EAA222C3 for ; Wed, 15 Jan 2020 13:55:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="EyN7rPKx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730198AbgAONzz (ORCPT ); Wed, 15 Jan 2020 08:55:55 -0500 Received: from mail-dm6nam11on2065.outbound.protection.outlook.com ([40.107.223.65]:2785 "EHLO NAM11-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726483AbgAONzq (ORCPT ); Wed, 15 Jan 2020 08:55:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QGD6RDn+eBl1yBAACLGm00V8g0RiDotxL9MolbBDZI5USYgGqlRW7AUUuYYLvl2nh9Up748ZXaL5saQSDEiPeYXX4OWhG+/UvOB+rxakyeXcE/ddAxfw/rII8A7CCh7WPdFAVf6TcPI1b5iMwFoR6oLIiWt6m8KUflo+kONAjkoFlFebhsuNsGZ4AXzdoe3xj7r/Hfwx7nufchuvUM0a4GuB+3RJQe8pljK6gay0W8Sf7VujXR9uEQR/LDYgLB3gUn+Z/Qmd6L87MlafLEmgAfxxwSx6l6/ze+yIuuHzK0BxHRhsTZKsI9oVRlScT+P5/7pbGcE5JTPHFfLr84yzeg== 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=Lth01pwnvd1VKz3M1apCRW9wn/D3pZfNBvY7HmUha+Y=; b=du1wzLyJqk83eGvyb3UJQ61oOasN0AOdTJZhsiDQ5CskQtW1uZLbTT2x2YvIynHOP+BZZKtKcAz7408oFkJL4uOchl1TDnTrd+iLQjUo4AnyGKpn4nlZO/oLi6uWJ94cFXGoChAeLDKAi2M8Enw9OIqjmcXLcyze/sGF/n1TNKCTF0fT0a/BPRcSLDd46N6C05oZ04OW10EhwYJUsYDrEyHMDTbUqQFtvfZAwW6BVGE3V1Ot55IEVLnreGdmNkw+gvgEBCID35OQ8Dt9zKky5Uax7TtSNKX9Cuq0g2IjrKw7kLcEm73l0LNxWkftDtMoF/2DSND9NftFOt6d/budmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lth01pwnvd1VKz3M1apCRW9wn/D3pZfNBvY7HmUha+Y=; b=EyN7rPKxO3myZmuz2fZ6V+oUF/gPXyMGKrlbeOQvLNg+Pm85cWWKbA9g21EVWhNTUf7zq8qXEl+pJLc6/JLHyMbFupyJJWObhlr4aepStec9zTOdgSvC10nhIyIE2f3tdYXwHxjruF/6/IsoRA5xYjlf51blC7X73HfTZ5oI0V0= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB4094.namprd11.prod.outlook.com (10.255.180.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Wed, 15 Jan 2020 13:55:30 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:30 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:20 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 54/65] staging: wfx: sta and dtim Thread-Topic: [PATCH v2 54/65] staging: wfx: sta and dtim Thread-Index: AQHVy6ttVcenlxcO1EKX1Q2hSlIFWg== Date: Wed, 15 Jan 2020 13:55:21 +0000 Message-ID: <20200115135338.14374-55-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1ad99bb7-a777-4b5f-c75a-08d799c28faa x-ms-traffictypediagnostic: MN2PR11MB4094: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(366004)(396003)(346002)(136003)(376002)(189003)(199004)(316002)(110136005)(54906003)(85202003)(81156014)(5660300002)(8676002)(71200400001)(8936002)(81166006)(186003)(6506007)(86362001)(66946007)(66446008)(66476007)(66556008)(2906002)(64756008)(478600001)(6512007)(52116002)(66574012)(6486002)(1076003)(16526019)(4326008)(85182001)(107886003)(36756003)(8886007)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB4094; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: F70YYYCzkWHFY/Sxu0mpGJdMYIkH6sGe0pOk/5y3a/LwZYFzHNN9vK7Wh4hJ1l+piJSbK5WOZieTufCy7T5cmjvaEspHja1UZqfOf5B1Rhzd7zc6YlgmpWwPmnNRrPoN+sznY59UwNnCfNC24CP8TP6oA/l0jkaTihxr+50NiOGnb4EpOIsy5WvreonDwZiVo1chTQiUPFhwUV3eGofuUNUzW33PtzJfWry+KYwKIwYtZ/VZ3b+7iuGd2Ikq0KmNYEIJEyVXnfg6IU7jD/ohmRQBUWCYYk0GWVMowBfX/IUurAhkxaD02/UYy9VSRD6LUdPqs3raP3VaxuwS7P6AKChvgjzCPJDTDWAW9wzFjpD4BKhO3K4BnlLQEF9vR5zBoHCZniEZl7rGRckNQ62pFN/7NjjA1duGNu/F+bByuAuoApbZBIp0/iAGXpZ6Xb5W Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ad99bb7-a777-4b5f-c75a-08d799c28faa X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:21.1032 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qQksKHMkVs1wQ1wbjYLVO91lz0yriW60NhDgmj+93RshOk6wKXEWKXinFA2BGqQVB7y4EFPF3EuxwboSA2wJBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4094 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_ps_notify() is called for any changes in the TIM. However, association ID 0 is a very special case that should be handled independently. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/sta.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index c249a2953bb0..9f4c566517a1 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -839,21 +839,13 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, wfx_do_join(wvif); } -static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, - int link_id) +static void wfx_ps_notify_sta(struct wfx_vif *wvif, + enum sta_notify_cmd notify_cmd, int link_id) { u32 bit, prev; spin_lock_bh(&wvif->ps_state_lock); - /* Zero link id means "for all link IDs" */ - if (link_id) { - bit = BIT(link_id); - } else if (notify_cmd != STA_NOTIFY_AWAKE) { - dev_warn(wvif->wdev->dev, "unsupported notify command\n"); - bit = 0; - } else { - bit = wvif->link_id_map & ~1; - } + bit = BIT(link_id); prev = wvif->sta_asleep_mask & bit; switch (notify_cmd) { @@ -867,7 +859,7 @@ static void wfx_ps_notify(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd, case STA_NOTIFY_AWAKE: if (prev) { wvif->sta_asleep_mask &= ~bit; - if (link_id && !wvif->sta_asleep_mask) + if (!wvif->sta_asleep_mask) schedule_work(&wvif->mcast_stop_work); wfx_bh_request_tx(wvif->wdev); } @@ -882,7 +874,7 @@ void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct wfx_vif *wvif = (struct wfx_vif *) vif->drv_priv; struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *) &sta->drv_priv; - wfx_ps_notify(wvif, notify_cmd, sta_priv->link_id); + wfx_ps_notify_sta(wvif, notify_cmd, sta_priv->link_id); } static int wfx_update_tim(struct wfx_vif *wvif) @@ -993,6 +985,14 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } +static void wfx_dtim_notify(struct wfx_vif *wvif) +{ + spin_lock_bh(&wvif->ps_state_lock); + wvif->sta_asleep_mask = 0; + wfx_bh_request_tx(wvif->wdev); + spin_unlock_bh(&wvif->ps_state_lock); +} + void wfx_suspend_resume(struct wfx_vif *wvif, const struct hif_ind_suspend_resume_tx *arg) { @@ -1013,12 +1013,9 @@ void wfx_suspend_resume(struct wfx_vif *wvif, if (cancel_tmo) del_timer_sync(&wvif->mcast_timeout); } else if (arg->suspend_resume_flags.resume) { - // FIXME: should change each station status independently - wfx_ps_notify(wvif, STA_NOTIFY_AWAKE, 0); - wfx_bh_request_tx(wvif->wdev); + wfx_dtim_notify(wvif); } else { - // FIXME: should change each station status independently - wfx_ps_notify(wvif, STA_NOTIFY_SLEEP, 0); + dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); } } From patchwork Wed Jan 15 13:55:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216634 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D76EEC33CB1 for ; Wed, 15 Jan 2020 13:57:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0506222C3 for ; Wed, 15 Jan 2020 13:57:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="mjn7Hj0e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729359AbgAON5t (ORCPT ); Wed, 15 Jan 2020 08:57:49 -0500 Received: from mail-eopbgr770047.outbound.protection.outlook.com ([40.107.77.47]:48566 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730039AbgAONzg (ORCPT ); Wed, 15 Jan 2020 08:55:36 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jd4BL53IB/41n0OkIJFsSLto9tEHdvx16sDti6aYS2x3HRYMPF1XL7l6JVEWtWoSS5KDX9Xr2E/uoQF4xDUSgBP3zgVRQi7OzgfrPTZnjE7m33u/R3+1ZPgBgdZF3R4x9E1OyG0copx7zkrKRjf4toklHtc4R4laJzSq7wK6WZTq4SMn+fLMTejeHwpD3h7xvUVX6xQyxZAxRfnWpm8fQwJDXsu2Sb5GJm11JZmGq/DBKmvvkOmBQEJ8xpMQVit5uM1D0zLAjiGxxlvqYx4BOJ3TBEpeQBqHbRC+gzxqVS199b6wQhbe12i03yUEkstjczR4Dr4oDYKdKsELXgeByg== 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=CZcasPrMA/8ilPvnsOg/0o+UwLhMEXVcTojckwzEtT8=; b=YL9w/lGjCW8wWy/7cRwfzdgCv3N4SrqYtHsqLkwEtI3WC3uP1T+ESwzThXHSUIDAYmdR2kfvtZcI9+Y6k/hKUSHfSWc618I/Iw7YqXPt7Oog8vJVefSp95nGDuUUE7k/+zXPIJU6D+TCx2SKui1zexnygsATcH08E4phnntAWNOzuO/miT7STBXD/71DgjTXb/XRUYicRDN0RASAr9Xb/xQ2NfJIdl38FMFpGCTqOtRWkFu/4o1dCYhVxwdTn+no1e73EwCet8KVvEsIFkcDSzKlt/p6fG/rls+dIVH2BLhm0t3RwnKpfj6t+N0hj5PPWosH5fwJD3Rqfq8fOrMuxg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CZcasPrMA/8ilPvnsOg/0o+UwLhMEXVcTojckwzEtT8=; b=mjn7Hj0eWkUdHhqsEBrt5w1YfNYlsk84wRjsM/lhNwE84CyK38ftbGixssGAtuLj59NcgFZEbtYwqrLjwkQ8JrKJJTPSpjtEKAm6+n5rbMmRVuwS2Fk8Cu46KMFpE3wxGUYF32e1iY2OJFYDhrCKaefnxvpoM8Vge7r2LuBZp4Y= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:31 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:31 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:23 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Thread-Topic: [PATCH v2 56/65] staging: wfx: simplify wfx_suspend_resume_mc() Thread-Index: AQHVy6tvqRNbeQHxKEKWIiwJJT8fkw== Date: Wed, 15 Jan 2020 13:55:24 +0000 Message-ID: <20200115135338.14374-57-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 509924ea-1e52-43c8-11bc-08d799c2918c x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: AWOonB8r7otVKsHmuU7tPD8f1U1MwAICJsciSd8o6Xt44TTD+v9Qt40PsaU3PTKWVIsbuQiPwOi7F1+JByRmZDCHb8/luTmW0d9gc/aXj0vm2sxarH+gt6mlXe3L0Si6bAQNt2GpWQhTtGA8A/qxZMTdFqSB3hBfAQ7bgVuBHNwG6rYdHwmL5maCxmqPvtDQ1qUDrNnb+4brcmkcJXWzHUvwrL/lfCo94kIEZGACnIlRrxkMVyffg9CQXkjp0tl4rHHHWpFRuFcO+JdVrWvwBFKx+McD8KrfMvHpVdbEiV835Sj05mXbqq2Gp0xR82Brv4oJWOlD7UwwwhxwsrpcqVLA2WNilSXRWxB9FyCvgotVN8S9ChfU6PCBU6UMFPJifZyP5wiQKzO+t4cvmCuKgGHVkCufhWv9DbcJWh/HqhQLV6HqYa0uZtxrQtyj0x8J Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 509924ea-1e52-43c8-11bc-08d799c2918c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:24.2694 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7cCkiOOc01pzVOvNu5MxPG0f67nSpGJW1ZolngTknhz9YC2k+Qwwq7/qHMPi0HGLc2dUUhEt5OsU9NVnRNmdNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Indeed, it is not necessary to pass whole hif_ind_suspend_resume_tx to wfx_suspend_resume_mc(). In add, the structure hif_ind_suspend_resume_tx come from hardware API. It is not intended to be manipulated in upper layers of the driver. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 7 +------ drivers/staging/wfx/hif_rx.c | 6 +++++- drivers/staging/wfx/sta.c | 10 ++-------- drivers/staging/wfx/sta.h | 3 +-- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 7914c06578aa..8710383f66e5 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -600,13 +600,8 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) tx_info->flags |= IEEE80211_TX_STAT_ACK; } else if (arg->status == HIF_REQUEUE) { /* "REQUEUE" means "implicit suspend" */ - struct hif_ind_suspend_resume_tx suspend = { - .suspend_resume_flags.resume = 0, - .suspend_resume_flags.bc_mc_only = 1, - }; - WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); - wfx_suspend_resume(wvif, &suspend); + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; } else { if (wvif->bss_loss_state && diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index f04afc6db9a5..f798cd6973b6 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -230,7 +230,11 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev, const struct hif_ind_suspend_resume_tx *body = buf; WARN_ON(!wvif); - wfx_suspend_resume(wvif, body); + WARN(!body->suspend_resume_flags.bc_mc_only, "unsupported suspend/resume notification"); + if (body->suspend_resume_flags.resume) + wfx_suspend_resume_mc(wvif, STA_NOTIFY_AWAKE); + else + wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); return 0; } diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index 7c9e93f52993..bdc15554958c 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -985,18 +985,12 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -void wfx_suspend_resume(struct wfx_vif *wvif, - const struct hif_ind_suspend_resume_tx *arg) +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { bool cancel_tmo = false; - if (!arg->suspend_resume_flags.bc_mc_only) { - dev_warn(wvif->wdev->dev, "unsupported suspend/resume notification\n"); - return; - } - spin_lock_bh(&wvif->ps_state_lock); - if (!arg->suspend_resume_flags.resume) + if (notify_cmd == STA_NOTIFY_SLEEP) wvif->mcast_tx = false; else wvif->mcast_tx = wvif->aid0_bit_set && diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h index e832405d604e..cf99a8a74a81 100644 --- a/drivers/staging/wfx/sta.h +++ b/drivers/staging/wfx/sta.h @@ -82,8 +82,7 @@ void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf); // WSM Callbacks -void wfx_suspend_resume(struct wfx_vif *wvif, - const struct hif_ind_suspend_resume_tx *arg); +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd cmd); // Other Helpers void wfx_cqm_bssloss_sm(struct wfx_vif *wvif, int init, int good, int bad); From patchwork Wed Jan 15 13:55:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216638 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D18D6C33CB1 for ; Wed, 15 Jan 2020 13:56:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8750724656 for ; Wed, 15 Jan 2020 13:56:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="ZqgBvA75" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730082AbgAON4a (ORCPT ); Wed, 15 Jan 2020 08:56:30 -0500 Received: from mail-eopbgr770084.outbound.protection.outlook.com ([40.107.77.84]:58049 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730055AbgAONzi (ORCPT ); Wed, 15 Jan 2020 08:55:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cE+s95htSBcGQwgdfnkuotuPbeHys7sEHPjKoVW7aCSY1H3fcFqkmfRzheTcniy/tyJBlJGhmBt1jfMqlI3dQhWzJW/D/TdeAQhPj4Mkt5l0i26P+aUV0RaPIs///gbBSsmym7OUc/LQO21Glm8Z1wqaNOU6/zdaU/o0MM3NpTEabNHE/IaKtx0aU99U8pSVmKo1SNv9eIMtuyP20ZSucvfXqSCHKfVqkdZ9WctATg5IhjWFCZ2DDjdhyq65srjm3wE7xe/eD3Uaf9CZMBiuW24dvUhiyHBZ/hsHGX2jD6rVuOT3AZciu6sM4Cs5qOH2V449sYAHOkw580naEeCD3w== 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=mu+qG//gBvr7FMjRPBL9jyX0ISunaS6iGeqd+pcW++k=; b=VKdIm4UtMIRAKnU87RxRcwdw5CsFCx8IJ4l1ExsW1sfO4rRbO0rUuoPdujL6Cz2DoTgLYtF/SHpb5B4R6SGS6DG/XPgJqwMbnStDiPZgMtVhUuSv0kHSm0zQ5/NXtnf5ueFO/yavcYDEsMe9xCXnfTj8Ff5O14V2DcXXeZ21glOOThTNtmXe4GhPkXi/joY31pa2LXVooZvrYBzIuiVaP82K/fr2bIiKjZ3ZoWQAouxaYuJPpu/NguI/+NlXnUMYopM458eEC3UHDfB7Gi9N3t1seNrqWyX3ziApHSpbUF2eHWDoZSqTftUJl50VyHoBKt7MAMLOIizOHGcYSR5ANA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mu+qG//gBvr7FMjRPBL9jyX0ISunaS6iGeqd+pcW++k=; b=ZqgBvA75g1utIqy2CrsGMh6pAvZ/hpQ8XwL2wV8AGY604JbhskzcJQkm1fKZnKARJR61mWpH8kfMAcLQisrMo2aHy66AWwfYZC8DB0WkrfhFwfEFVcClYMhYNyH/FnyLg5DPuqaMO3cPQkLT1LXZ6C5Ty2BxTUHZJ7G4knAHdaw= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:31 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:31 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:24 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 57/65] staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM Thread-Topic: [PATCH v2 57/65] staging: wfx: simplify handling of IEEE80211_TX_CTL_SEND_AFTER_DTIM Thread-Index: AQHVy6twtXbIGmYGL0SoZz5GU/tFlw== Date: Wed, 15 Jan 2020 13:55:25 +0000 Message-ID: <20200115135338.14374-58-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ea0debf1-582d-4a49-73b6-08d799c2925d x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(30864003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: tytHxcCmgEw9SYVa2W2SuZ52X8J5wtIV59mBg7S9LIyF7KayE+aVFNPgITUvWlz59iQ5+JjasqXu79JUcTv9p2Iy/D/llgDUxdiIP49ljkkzwq5Uc0w2A7NqhPCYSf6Z1N4aC6tQ4AfakRSI8NKr4NgpeUKclmNlw4fXlvdLkdbqxlsQ82pnASd/EtaGWzOQ8vuMRuIwC0dA2gZT2j5uemrfSWnvU6UfHbPriSasomZhhnxrgSoERTE5iyQlIEY2SvKbQnTcPp+rCYesIm0PD57dILXv+inc1xd2i8sZHnisG4fckLbtobThLbsv/Hy8jzmnYBkG5oKcjsSLs6TNAxLnbV5a3anozb5IBRskD6uWc65k8h6FH7NkbMA6ebxNZBY3puMC3rMWkejrhBCpekUqHOOjWXKkth8IgLdlp9zrS6oH1rmMNMmsU9B6405t Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: ea0debf1-582d-4a49-73b6-08d799c2925d X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:25.6496 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EKPZPvPerdgj0hO0H00HYRHtnFvxl1E94X2FMw7l1bL/4ZqHoJ8giz2QPsHEoA4nxltHNoOyOmlFtqbm30+/ww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller When mac80211 ask for a frame to be sent after a DTIM, driver should: 1. Update TIM with multicast bit set (using update_ie). This function can be called whenever. 2. Keep buffered all frames marked "after dtim" 3. When it receive a suspend_resume indication (see wfx_suspend_resume_mc()), send all the buffered frames. This indication is sent by the firmware 4ms before the dtim. 4. If one of the frames returns status "REQUEUE", it means that the DTIM period was ended before to be able to send the frame. 5. When all the buffered frames were sent or if DTIM period was ended, driver should update the TIM with multicast bit reset. All the mess with the asynchronous works can be dropped. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 17 +++--- drivers/staging/wfx/hif_api_cmd.h | 3 +- drivers/staging/wfx/queue.c | 98 +++++++++++++++---------------- drivers/staging/wfx/queue.h | 1 + drivers/staging/wfx/sta.c | 78 ++---------------------- drivers/staging/wfx/wfx.h | 7 +-- 6 files changed, 66 insertions(+), 138 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 8710383f66e5..c32994553633 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -288,13 +288,6 @@ static void wfx_tx_manage_pm(struct wfx_vif *wvif, struct ieee80211_hdr *hdr, spin_lock_bh(&wvif->ps_state_lock); if (ieee80211_is_auth(hdr->frame_control)) wvif->sta_asleep_mask &= mask; - - if (tx_priv->link_id == WFX_LINK_ID_AFTER_DTIM && - !wvif->mcast_buffered) { - wvif->mcast_buffered = true; - if (wvif->sta_asleep_mask) - schedule_work(&wvif->mcast_start_work); - } spin_unlock_bh(&wvif->ps_state_lock); if (sta) { @@ -479,6 +472,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, req->packet_id = queue_id << 16 | IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); req->data_flags.fc_offset = offset; + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + req->data_flags.after_dtim = 1; req->queue_id.peer_sta_id = tx_priv->raw_link_id; // Queue index are inverted between firmware and Linux req->queue_id.queue_id = 3 - queue_id; @@ -488,6 +483,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Auxiliary operations wfx_tx_manage_pm(wvif, hdr, tx_priv, sta); wfx_tx_queue_put(wvif->wdev, &wvif->wdev->tx_queue[queue_id], skb); + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) + schedule_work(&wvif->update_tim_work); wfx_bh_request_tx(wvif->wdev); return 0; } @@ -599,9 +596,11 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) else tx_info->flags |= IEEE80211_TX_STAT_ACK; } else if (arg->status == HIF_REQUEUE) { - /* "REQUEUE" means "implicit suspend" */ WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); - wfx_suspend_resume_mc(wvif, STA_NOTIFY_SLEEP); + if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { + wvif->after_dtim_tx_allowed = false; // DTIM period elapsed + schedule_work(&wvif->update_tim_work); + } tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; } else { if (wvif->bss_loss_state && diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h index fc078d54bfbf..5554d6eddbf3 100644 --- a/drivers/staging/wfx/hif_api_cmd.h +++ b/drivers/staging/wfx/hif_api_cmd.h @@ -253,7 +253,8 @@ struct hif_queue { struct hif_data_flags { u8 more:1; u8 fc_offset:3; - u8 reserved:4; + u8 after_dtim:1; + u8 reserved:3; } __packed; struct hif_tx_flags { diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 42d64534c92c..ec11a63a2ff9 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -235,7 +235,6 @@ static struct sk_buff *wfx_tx_queue_get(struct wfx_dev *wdev, break; } } - WARN_ON(!skb); if (skb) { tx_priv = wfx_skb_tx_priv(skb); tx_priv->xmit_timestamp = ktime_get(); @@ -473,23 +472,12 @@ static int wfx_get_prio_queue(struct wfx_vif *wvif, static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, struct wfx_queue **queue_p, - u32 *tx_allowed_mask_p, - bool *more) + u32 *tx_allowed_mask_p) { int idx; u32 tx_allowed_mask; int total = 0; - /* Search for a queue with multicast frames buffered */ - if (wvif->mcast_tx) { - tx_allowed_mask = BIT(WFX_LINK_ID_AFTER_DTIM); - idx = wfx_get_prio_queue(wvif, tx_allowed_mask, &total); - if (idx >= 0) { - *more = total > 1; - goto found; - } - } - /* Search for unicast traffic */ tx_allowed_mask = ~wvif->sta_asleep_mask; tx_allowed_mask |= BIT(WFX_LINK_ID_UAPSD); @@ -501,64 +489,83 @@ static int wfx_tx_queue_mask_get(struct wfx_vif *wvif, if (idx < 0) return -ENOENT; -found: *queue_p = &wvif->wdev->tx_queue[idx]; *tx_allowed_mask_p = tx_allowed_mask; return 0; } +struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif) +{ + struct wfx_dev *wdev = wvif->wdev; + struct ieee80211_tx_info *tx_info; + struct hif_msg *hif; + struct sk_buff *skb; + int i; + + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb_queue_walk(&wdev->tx_queue[i].queue, skb) { + tx_info = IEEE80211_SKB_CB(skb); + hif = (struct hif_msg *)skb->data; + if ((tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) && + (hif->interface == wvif->id)) + return (struct hif_msg *)skb->data; + } + } + return NULL; +} + struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) { struct sk_buff *skb; struct hif_msg *hif = NULL; - struct hif_req_tx *req = NULL; struct wfx_queue *queue = NULL; struct wfx_queue *vif_queue = NULL; u32 tx_allowed_mask = 0; u32 vif_tx_allowed_mask = 0; const struct wfx_tx_priv *tx_priv = NULL; struct wfx_vif *wvif; - /* More is used only for broadcasts. */ - bool more = false; - bool vif_more = false; int not_found; int burst; + int i; + + if (atomic_read(&wdev->tx_lock)) + return NULL; + + wvif = NULL; + while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { + if (wvif->after_dtim_tx_allowed) { + for (i = 0; i < IEEE80211_NUM_ACS; ++i) { + skb = wfx_tx_queue_get(wvif->wdev, + &wdev->tx_queue[i], + BIT(WFX_LINK_ID_AFTER_DTIM)); + if (skb) { + hif = (struct hif_msg *)skb->data; + // Cannot happen since only one vif can + // be AP at time + WARN_ON(wvif->id != hif->interface); + return hif; + } + } + // No more multicast to sent + wvif->after_dtim_tx_allowed = false; + schedule_work(&wvif->update_tim_work); + } + } for (;;) { int ret = -ENOENT; int queue_num; - struct ieee80211_hdr *hdr; - - if (atomic_read(&wdev->tx_lock)) - return NULL; wvif = NULL; while ((wvif = wvif_iterate(wdev, wvif)) != NULL) { spin_lock_bh(&wvif->ps_state_lock); not_found = wfx_tx_queue_mask_get(wvif, &vif_queue, - &vif_tx_allowed_mask, - &vif_more); - - if (wvif->mcast_buffered && (not_found || !vif_more) && - (wvif->mcast_tx || - !wvif->sta_asleep_mask)) { - wvif->mcast_buffered = false; - if (wvif->mcast_tx) { - wvif->mcast_tx = false; - schedule_work(&wvif->mcast_stop_work); - } - } + &vif_tx_allowed_mask); spin_unlock_bh(&wvif->ps_state_lock); - if (vif_more) { - more = true; - tx_allowed_mask = vif_tx_allowed_mask; - queue = vif_queue; - ret = 0; - break; - } else if (!not_found) { + if (!not_found) { if (queue && queue != vif_queue) dev_info(wdev->dev, "vifs disagree about queue priority\n"); tx_allowed_mask |= vif_tx_allowed_mask; @@ -595,15 +602,6 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) else wdev->tx_burst_idx = -1; - /* more buffered multicast/broadcast frames - * ==> set MoreData flag in IEEE 802.11 header - * to inform PS STAs - */ - if (more) { - req = (struct hif_req_tx *) hif->body; - hdr = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); - hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_MOREDATA); - } return hif; } } diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 813c2d09e034..096ae86135cc 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -47,6 +47,7 @@ void wfx_tx_queues_clear(struct wfx_dev *wdev); bool wfx_tx_queues_is_empty(struct wfx_dev *wdev); void wfx_tx_queues_wait_empty_vif(struct wfx_vif *wvif); struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev); +struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c index bdc15554958c..a9b58e4a9fa3 100644 --- a/drivers/staging/wfx/sta.c +++ b/drivers/staging/wfx/sta.c @@ -851,16 +851,12 @@ static void wfx_ps_notify_sta(struct wfx_vif *wvif, switch (notify_cmd) { case STA_NOTIFY_SLEEP: if (!prev) { - if (wvif->mcast_buffered && !wvif->sta_asleep_mask) - schedule_work(&wvif->mcast_start_work); wvif->sta_asleep_mask |= bit; } break; case STA_NOTIFY_AWAKE: if (prev) { wvif->sta_asleep_mask &= ~bit; - if (!wvif->sta_asleep_mask) - schedule_work(&wvif->mcast_stop_work); wfx_bh_request_tx(wvif->wdev); } break; @@ -898,7 +894,7 @@ static int wfx_update_tim(struct wfx_vif *wvif) tim_ptr[2] = 0; /* Set/reset aid0 bit */ - if (wvif->aid0_bit_set) + if (wfx_tx_queues_get_after_dtim(wvif)) tim_ptr[4] |= 1; else tim_ptr[4] &= ~1; @@ -927,47 +923,12 @@ int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) return 0; } -static void wfx_mcast_start_work(struct work_struct *work) +void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) { - struct wfx_vif *wvif = - container_of(work, struct wfx_vif, mcast_start_work); - struct ieee80211_bss_conf *conf = &wvif->vif->bss_conf; - long tmo = conf->dtim_period * TU_TO_JIFFIES(wvif->beacon_int + 20); - - cancel_work_sync(&wvif->mcast_stop_work); - if (!wvif->aid0_bit_set) { - wfx_tx_lock_flush(wvif->wdev); - wvif->aid0_bit_set = true; - wfx_update_tim(wvif); - mod_timer(&wvif->mcast_timeout, jiffies + tmo); - wfx_tx_unlock(wvif->wdev); - } -} - -static void wfx_mcast_stop_work(struct work_struct *work) -{ - struct wfx_vif *wvif = container_of(work, struct wfx_vif, - mcast_stop_work); - - if (wvif->aid0_bit_set) { - del_timer_sync(&wvif->mcast_timeout); - wfx_tx_lock_flush(wvif->wdev); - wvif->aid0_bit_set = false; - wfx_update_tim(wvif); - wfx_tx_unlock(wvif->wdev); - } -} - -static void wfx_mcast_timeout(struct timer_list *t) -{ - struct wfx_vif *wvif = from_timer(wvif, t, mcast_timeout); - - dev_warn(wvif->wdev->dev, "multicast delivery timeout\n"); - spin_lock_bh(&wvif->ps_state_lock); - wvif->mcast_tx = wvif->aid0_bit_set && wvif->mcast_buffered; - if (wvif->mcast_tx) - wfx_bh_request_tx(wvif->wdev); - spin_unlock_bh(&wvif->ps_state_lock); + WARN(!wfx_tx_queues_get_after_dtim(wvif), "incorrect sequence"); + WARN(wvif->after_dtim_tx_allowed, "incorrect sequence"); + wvif->after_dtim_tx_allowed = true; + wfx_bh_request_tx(wvif->wdev); } int wfx_ampdu_action(struct ieee80211_hw *hw, @@ -985,25 +946,6 @@ int wfx_ampdu_action(struct ieee80211_hw *hw, return -ENOTSUPP; } -void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd) -{ - bool cancel_tmo = false; - - spin_lock_bh(&wvif->ps_state_lock); - if (notify_cmd == STA_NOTIFY_SLEEP) - wvif->mcast_tx = false; - else - wvif->mcast_tx = wvif->aid0_bit_set && - wvif->mcast_buffered; - if (wvif->mcast_tx) { - cancel_tmo = true; - wfx_bh_request_tx(wvif->wdev); - } - spin_unlock_bh(&wvif->ps_state_lock); - if (cancel_tmo) - del_timer_sync(&wvif->mcast_timeout); -} - int wfx_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf) { @@ -1090,10 +1032,6 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) spin_lock_init(&wvif->ps_state_lock); INIT_WORK(&wvif->update_tim_work, wfx_update_tim_work); - INIT_WORK(&wvif->mcast_start_work, wfx_mcast_start_work); - INIT_WORK(&wvif->mcast_stop_work, wfx_mcast_stop_work); - timer_setup(&wvif->mcast_timeout, wfx_mcast_timeout, 0); - memset(&wvif->bss_params, 0, sizeof(wvif->bss_params)); mutex_init(&wvif->bss_loss_lock); @@ -1156,9 +1094,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, break; case WFX_STATE_AP: wvif->sta_asleep_mask = 0; - wvif->mcast_tx = false; - wvif->aid0_bit_set = false; - wvif->mcast_buffered = false; /* reset.link_id = 0; */ hif_reset(wvif, false); break; @@ -1175,7 +1110,6 @@ void wfx_remove_interface(struct ieee80211_hw *hw, wfx_cqm_bssloss_sm(wvif, 0, 0, 0); cancel_work_sync(&wvif->unjoin_work); - del_timer_sync(&wvif->mcast_timeout); wfx_free_event_queue(wvif); wdev->vif[wvif->id] = NULL; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 8491f050478d..5d61946e33e0 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -75,13 +75,8 @@ struct wfx_vif { u32 link_id_map; - bool aid0_bit_set; - bool mcast_tx; - bool mcast_buffered; + bool after_dtim_tx_allowed; struct wfx_grp_addr_table mcast_filter; - struct timer_list mcast_timeout; - struct work_struct mcast_start_work; - struct work_struct mcast_stop_work; s8 wep_default_key_id; struct sk_buff *wep_pending_skb; From patchwork Wed Jan 15 13:55:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216639 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41B13C4741C for ; Wed, 15 Jan 2020 13:56:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 170562465A for ; Wed, 15 Jan 2020 13:56:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="D6cLMlm6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730108AbgAONzk (ORCPT ); Wed, 15 Jan 2020 08:55:40 -0500 Received: from mail-eopbgr770047.outbound.protection.outlook.com ([40.107.77.47]:48566 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730086AbgAONzi (ORCPT ); Wed, 15 Jan 2020 08:55:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FcGS5yVCSmN0pzzkQvGr3UilUEo+1qC7awgO9HpsSVzedMRyyQ4XdkZ4e8TDMjLRbwEy/NcSeIiGTQCScAnZsicO3hqmsoI5ggoYSCaFvOYXGsKwyq/6c81aGM+GOV8c40hharDK7kkd3UuWRmKfo3Z+EiTJm6i0oQMMbvGCRGuVU5HSOL+6rSysEcVcMIiv2v1zV8uPg8/l4Qr63MDQ/wWcgcRSGxfqzKEIqSPtuKUFgcUNxORHHqiwGyg9AqQthXgyHBCZXIxgeflGvKreBXkIP6XzivZoI8Uscg1WwfvoDho6AU5PxylikX60dr/Efxw96Sa0So9hQufvuina6A== 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=NV6i8iFSi16VOyb/8DY1eR4/NhyYerJyThLKXln0oV0=; b=j2zV0Pp9p4+Yqw8cJg3CwBxtsiD5emvvjVFrHwJIEBL+6WvzJkN1rVU5MYSHiECEFJnPOo0zNnbVEt5nD1aEV8gihyrBieAnuKt1gAJSU20ZSh1a9zGMYXDdPPGB26buyqhl41qzG7UfgXdUK+4JBUCU2ZP50YvbFzehZX5AhIwsxSto66vx+I9XfNEiCsr4cVUU0bDESrdawHzLvf+I4DftvrEz1S2aKeotSt3nmaojSb/YbaAPkM4xT3FewCew/Yt1dsys/osRQmnYG+96Gz7rb29li7UR9266ajbhxyiAaS6HWGPPB7tgd6hsc+ZP8tSJ6YRYdxSbkFqlZKhEuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NV6i8iFSi16VOyb/8DY1eR4/NhyYerJyThLKXln0oV0=; b=D6cLMlm6SR1Y9NqD4ZOkGkZU0wsLUNxhpTSLowLMSC83pq423NOuF2IOC0uHL1vcv+Iu/+dUJ47K2ynysVa7I95V2l00DApYzsrPABdkw0Du64uGe6i9gpDAZN2O9ArOdNFyrOlnl+dYhrrKw1SnbUfWo1FQToxu5F8myyOns90= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:55:32 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:55:32 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:27 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 59/65] staging: wfx: ensure that packet_id is unique Thread-Topic: [PATCH v2 59/65] staging: wfx: ensure that packet_id is unique Thread-Index: AQHVy6txUER+GWdktEqnlcABTK2d+A== Date: Wed, 15 Jan 2020 13:55:28 +0000 Message-ID: <20200115135338.14374-60-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0631c169-8da4-470c-07b5-08d799c29441 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: czYwTgkgAJdIhp0rUR/YWE1J3SzIhZZSxC0aLsP/8Df9dvrisMye2EPEt2aOryeyGOy104iGqionEfVhYkvEXPViTdo/ScHD7TBDfZZTfBFgWsGqk1fb+zsVB+NIZqlmJP8q9DTZLe6Ua5cPxBjFJ8YcGlqsQyz/c+A/NJRArXo8DSdee8PMdO+CcujT1if1MpEPdneGbPBo5DmUE7uT/tRAyxwtktmXs5Y6lYcEjd93A4ujPYZ/ffS7YXNiwsUCSrgg+Ycc3XLj5w3o5FUOySjAyam0dALOa9tBEqZ5ntM+i8yQammEsFjm8BPzDxgQCDfs3OfCiVCeVytOcJzabNXe0V+cfmQk3OStHhT3aQQ39LJc0+bCw37znB8HV/9A6JUHBME5V1W/W16kDBpXXQqXJFZSEBhDeflDMiUq1AgfOV3O+43YzH5h3CwA86/4 Content-ID: <0171E68131C9814BAA64F3F408878735@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0631c169-8da4-470c-07b5-08d799c29441 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:28.8268 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Iq6b9uIEO1aQ/lOTybKcvhMlKiqD1cC2jeA2x9jBpNNaf3geZIFRpXdMLbTCvsX+8hRyykxY1Qbv6w19UoVrEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller In current code, packet_id is derivated from mac802.11 packet sequence number, but this number is only unique for a station. It is not sufficient. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/data_tx.c | 8 ++++++-- drivers/staging/wfx/wfx.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index c32994553633..20f4740734f2 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -469,8 +469,12 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, // Fill tx request req = (struct hif_req_tx *)hif_msg->body; - req->packet_id = queue_id << 16 | - IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); + // packet_id just need to be unique on device. 32bits are more than + // necessary for that task, so we tae advantage of it to add some extra + // data for debug. + req->packet_id = queue_id << 28 | + IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16 | + (atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF); req->data_flags.fc_offset = offset; if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) req->data_flags.after_dtim = 1; diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h index 5d61946e33e0..8b85bb1abb9c 100644 --- a/drivers/staging/wfx/wfx.h +++ b/drivers/staging/wfx/wfx.h @@ -54,6 +54,7 @@ struct wfx_dev { int tx_burst_idx; atomic_t tx_lock; + atomic_t packet_id; u32 key_map; struct hif_req_add_key keys[MAX_KEY_ENTRIES]; From patchwork Wed Jan 15 13:55:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A30B1C33CB3 for ; Wed, 15 Jan 2020 13:57:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7781D2467C for ; Wed, 15 Jan 2020 13:57:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="Z09up+tM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730040AbgAON4r (ORCPT ); Wed, 15 Jan 2020 08:56:47 -0500 Received: from mail-eopbgr770085.outbound.protection.outlook.com ([40.107.77.85]:39089 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730364AbgAON4o (ORCPT ); Wed, 15 Jan 2020 08:56:44 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PNm1BBELvuNsVLdXyoA2aXFSVBDnRpZmT5ui+UEEsZTCeDe1PdCvFRcOktH+5iNlYsCk3Wy/kFqUczNTcYl4KBYXLkzLCxHQFW7osnLK0/MW2IDFmCbdiuTpCx8h8yueP0s5ICqoq1+GaYvY3D/VSYi59dKsFbxZpxIndOw6lJw+H+y313btoGaG+rG2maMU+VGCnUtCHNMF9kNhAhKoM0vHcDtbRq0gaTGTCV11twgWgY3YvcQBcNEfwic+Rn79v13Nr9bqtNDmBu2w7K1WEzdqA6tt+JhTNtNu8uE/rEzCL54RQOPJ+GS1mwyX8rP1mvNqC9TwgQbS6FZs2jj3tQ== 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=ro9I2rSIp0iul/hKKxPII0gO0+PaKdaAxCdGr0ktzNc=; b=dHh97vpsjApJ3e070TGVuAIarzks6NFpFzFNXDcpnMpw3uvhH+TqYOaYHmVAeRO8EvpU//8bqw6mAUSuDW4EE3S57iGOUXDCIaysIPbgb5YIKargLt5c0WXJ9ihSLk2ShgJmeTPLWrvwLogVNYomY5ehWFyKocqff0ftBI0rNPA1mqSvsm/cDmslpb2cFipslJLfrMLIPEizLeQAWciHIbMilRJxLS6DxtjLSeToS0L5DxMZGyWOWwnBuhv4K0diNnIJSU7cFz1Ebd9PQIYWkZFgCDYBp6Wask04loUKUrfJ/AgfHVTYaXyj6Viptls31CEM0GySk4A0/2g9k7P86g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ro9I2rSIp0iul/hKKxPII0gO0+PaKdaAxCdGr0ktzNc=; b=Z09up+tMnLty2rxdXcN80lJQr4shv5s3tP2UeVj75FwFVM9OaQ/RdzOMZRKCDQmAlq2Sk3HShhv/Ud4L7PSMc8/LShW0/ezer5Rdouh0mpVp8+9P/fa0FR8hdnHl5c16ymahtCvx8hFpT6ZMNi+rf2a2LsfX+7H2XjJzdFqiWF4= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:56:04 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:56:04 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:34 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 63/65] staging: wfx: simplify wfx_tx_queue_get_num_queued() Thread-Topic: [PATCH v2 63/65] staging: wfx: simplify wfx_tx_queue_get_num_queued() Thread-Index: AQHVy6t1PPmnEE1x50GLb9uE8oi/Yg== Date: Wed, 15 Jan 2020 13:55:35 +0000 Message-ID: <20200115135338.14374-64-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 307eabdb-5377-470b-1438-08d799c2985a x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ljB7x66vmeW27kItOGJAseYpfeJk7XiV9tT317bKvBCLkIm9/LRf7gg81Au88pdNj/PBmbtrSaweh35/vInNIUM5FAnnyHfhqC7bAnuB/02FgsA8f7TEn+XJA3Z8Hk+ZnGOrgCHsEYyslCbKjv5ibLTnJIQOwLjZHBxgv0UhaN+p81Mid4lG5gkePt5U3KatUPtrY08wV5hd76QYnlIDj0kbprE9U0y6htfuhFX+BqgFoudiIwf5HY9e4xzxUIVIkyxywIahAZoOy2YG9PIsXdmN45jPX+6lO6h0apSpa34K7LSRMFzKBTB6OcFFpBaIavZDz0+J6WgXHqx50hVuBrRRiRmgktBog9hurXF8HWpYqJJ05CbMNDMt5nRYtDHpd9ncmlWThZPsZ+s8+Ro5Nkk4+jcTSXkMfTO7RYDULdEewNo2FiObmCBCH++b9ovA Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 307eabdb-5377-470b-1438-08d799c2985a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:35.6848 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: EyCR1W6kuKpqcgsgGLYX82BQRgEIRlLeQXus+EWEZ0nFHDkFiDKaSXOjrFxev0/h/9VRfFxbjrEef7yc1XZk5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller wfx_tx_queue_get_num_queued() can take advantage of BIT() instead of maintaining one variable for a counter and another for a mask. In add, wfx_tx_queue_get_num_queued() has no real reason to return a size_t instead of an int. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 14 +++++--------- drivers/staging/wfx/queue.h | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index 024497eb19ac..0bcc61feee1d 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -175,11 +175,9 @@ void wfx_tx_queues_deinit(struct wfx_dev *wdev) wfx_tx_queues_clear(wdev); } -size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, - u32 link_id_map) +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map) { - size_t ret; - int i, bit; + int ret, i; if (!link_id_map) return 0; @@ -189,11 +187,9 @@ size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, ret = skb_queue_len(&queue->queue); } else { ret = 0; - for (i = 0, bit = 1; i < ARRAY_SIZE(queue->link_map_cache); - ++i, bit <<= 1) { - if (link_id_map & bit) + for (i = 0; i < ARRAY_SIZE(queue->link_map_cache); i++) + if (link_id_map & BIT(i)) ret += queue->link_map_cache[i]; - } } spin_unlock_bh(&queue->queue.lock); return ret; @@ -555,7 +551,7 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev) /* allow bursting if txop is set */ if (wvif->edca_params[queue_num].txop) - burst = (int)wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; + burst = wfx_tx_queue_get_num_queued(queue, tx_allowed_mask) + 1; else burst = 1; diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h index 096ae86135cc..90bb060d1204 100644 --- a/drivers/staging/wfx/queue.h +++ b/drivers/staging/wfx/queue.h @@ -51,7 +51,7 @@ struct hif_msg *wfx_tx_queues_get_after_dtim(struct wfx_vif *wvif); void wfx_tx_queue_put(struct wfx_dev *wdev, struct wfx_queue *queue, struct sk_buff *skb); -size_t wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); +int wfx_tx_queue_get_num_queued(struct wfx_queue *queue, u32 link_id_map); struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id); int wfx_pending_remove(struct wfx_dev *wdev, struct sk_buff *skb); From patchwork Wed Jan 15 13:55:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= X-Patchwork-Id: 216636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6281C33CB1 for ; Wed, 15 Jan 2020 13:57:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6BD5E24656 for ; Wed, 15 Jan 2020 13:57:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=silabs.onmicrosoft.com header.i=@silabs.onmicrosoft.com header.b="moiUOHFo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730155AbgAON5O (ORCPT ); Wed, 15 Jan 2020 08:57:14 -0500 Received: from mail-eopbgr770085.outbound.protection.outlook.com ([40.107.77.85]:39089 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730381AbgAON4q (ORCPT ); Wed, 15 Jan 2020 08:56:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UVcq6/FWOKWH3vWqYIrzfCl0qTj9N9za55L7v2iHGLrffW4nf9PrrDmo4erFuUEkBHHhZ8OZLpAgsVi5EqN4w9aFudNXs6mYTmJNHCHP3ZQ904pfd1y9GmwbCErhoTP0qFqGtEq6IE7hB8uQecVFIBhk55smEA3FZq2i2lRdS/1sY8v2netC9x/2Cz1i6+Ez0u4cc7J29WJhHEzUi4axlBjOvmPD1Pzv8Cv0bx6HylV0RvnwA16VWYpZNvhqcCzSrHXeHEy1SuOTrcCIiH4G3z+0Ic0KAHpRk+eYGwvWvwEZsM5KFiLcJsukrky1jL7htw0Gbd6l1xkuNOsYV4bjcQ== 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=p3u2E2RuWsPeDBspbS1BYQcNKcjt+UuC5v4vUdV+0qA=; b=JRADd+u8Qh097PlV8dwANZ9XNLc1/ikORsUTLCvIw8hgQdBXqVkgLfMQZVopBdRXUajCiR8xfQbVSrXYUQDcnTEG7xDR0sekkpSgiMED2000vjF1HODwiT1QzdYdLgADKJPwRHHXJ4Dk0D5FvDDwZZpa6tlCsLwRmt5hlsyK8bBa4ZXZG+1oSuD+k96RqUJY6fFarW1kB9dQS/I1E64k0X41YH0aV08xgdWEZ5VTCYTFFam9+ededvmotPjsINX+A/t+GujUoKVNoa29FzhZOlTQkTKjpjoMh9pgkxmHVYlgxrbpJDiD/qXPCOFuymCLf1FruImxGtzYvcvrVifDKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=silabs.com; dmarc=pass action=none header.from=silabs.com; dkim=pass header.d=silabs.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silabs.onmicrosoft.com; s=selector2-silabs-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p3u2E2RuWsPeDBspbS1BYQcNKcjt+UuC5v4vUdV+0qA=; b=moiUOHFoEf2dWzL78kJVMoyphgpetygZhOtXoJLRTa6CMS5gxpIS3oeq4XXM5S0Me2NvmU+DDQ6LmyuF1SqFIN1sZINLsiR4bkCJQRr8m82jI80ompQrLffWbGVkAVl64uobD6YSv+uFufuyrTnAlDGlYmPedJIrM28IiAXz/yY= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3661.namprd11.prod.outlook.com (20.178.252.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18; Wed, 15 Jan 2020 13:56:05 +0000 Received: from MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf]) by MN2PR11MB4063.namprd11.prod.outlook.com ([fe80::f46c:e5b4:2a85:f0bf%4]) with mapi id 15.20.2623.018; Wed, 15 Jan 2020 13:56:05 +0000 Received: from pc-42.home (2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948) by PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.18 via Frontend Transport; Wed, 15 Jan 2020 13:55:35 +0000 From: =?utf-8?b?SsOpcsO0bWUgUG91aWxsZXI=?= To: "devel@driverdev.osuosl.org" , "linux-wireless@vger.kernel.org" CC: "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Kalle Valo , "David S . Miller" , =?utf-8?b?SsOpcsO0bWUgUG91?= =?utf-8?q?iller?= Subject: [PATCH v2 64/65] staging: wfx: simplify hif_multi_tx_confirm() Thread-Topic: [PATCH v2 64/65] staging: wfx: simplify hif_multi_tx_confirm() Thread-Index: AQHVy6t2ZLEHcGkyoU+PxqF9Ez40+g== Date: Wed, 15 Jan 2020 13:55:37 +0000 Message-ID: <20200115135338.14374-65-Jerome.Pouiller@silabs.com> References: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115135338.14374-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2P264CA0008.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::20) To MN2PR11MB4063.namprd11.prod.outlook.com (2603:10b6:208:13f::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerome.Pouiller@silabs.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.25.0 x-originating-ip: [2a01:e35:8bf5:66a0:3dbe:4cb5:6059:a948] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f8a185d-6cd0-445e-cd38-08d799c29927 x-ms-traffictypediagnostic: MN2PR11MB3661: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 02830F0362 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(396003)(136003)(346002)(366004)(199004)(189003)(8886007)(6486002)(316002)(54906003)(71200400001)(36756003)(6506007)(66476007)(66446008)(66946007)(110136005)(8676002)(81166006)(81156014)(478600001)(86362001)(2616005)(4326008)(66574012)(2906002)(107886003)(1076003)(16526019)(186003)(85202003)(5660300002)(6512007)(52116002)(64756008)(66556008)(85182001)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3661; H:MN2PR11MB4063.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: silabs.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: L2734OgM+GNyb1qKT6bxjV8kH9aD7LIZZNIOxbXZNApSfMBxrbDEnZAbSOdh48rhvg7jpKIhL9uT/eVz4d6BtxM5MtSZ46hcMU0yc5kJWSAeb6UHKgzi+jYrRttaEmQ1g/LLE2/PXG5FKJjrr4tKjp/px7qlXtkNOmMe9DiChcMUXPVE0N+jUE2ciKD1aVthNoCnVKeSX9QEZ1Oyhta4xZ0bzKurzJQrke/il7zM4fRHQ3/Qv8/jRjJDstIzCvm+tGqqP1sgl7opIewiovr17Q6Pbjcdm0t353jSjhOj3BlHjBI5/jUpnLa/usZC+3ITkSc7VkIjBl+1oSeu2Hv+jLfgX5Y2sMd1qTBKA5ddbOqlB/mOw9T5OhDzLqC0TemgCr4wPxJe63iE4fMl6jOqXbGwAoiRo/TuILn6x+3QRpltbXwmmlQQi3VJpflDh6KE Content-ID: <8FCBE9271BF65D4F9FEF3C60FAE94438@namprd11.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f8a185d-6cd0-445e-cd38-08d799c29927 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 13:55:37.0530 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 54dbd822-5231-4b20-944d-6f4abcd541fb X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +mJpJOai+RX8yTDTKFbWanIzxJqxouXwHToj65IGnB4CiYYqhzTcgUpKNePxnq1NcH+9nyC1euCh/9mEV6IWVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3661 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Usage of the "buf_loc" variable does not simplify the function. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/hif_rx.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c index f798cd6973b6..33c22c5d629d 100644 --- a/drivers/staging/wfx/hif_rx.c +++ b/drivers/staging/wfx/hif_rx.c @@ -77,21 +77,16 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev, const struct hif_msg *hif, const void *buf) { const struct hif_cnf_multi_transmit *body = buf; - const struct hif_cnf_tx *buf_loc = - (const struct hif_cnf_tx *)&body->tx_conf_payload; struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface); - int count = body->num_tx_confs; int i; - WARN(count <= 0, "corrupted message"); + WARN(body->num_tx_confs <= 0, "corrupted message"); WARN_ON(!wvif); if (!wvif) return -EFAULT; - for (i = 0; i < count; ++i) { - wfx_tx_confirm_cb(wvif, buf_loc); - buf_loc++; - } + for (i = 0; i < body->num_tx_confs; i++) + wfx_tx_confirm_cb(wvif, &body->tx_conf_payload[i]); return 0; }