From patchwork Wed Jan 15 12:13: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: 216672 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 8EEEBC33CB2 for ; Wed, 15 Jan 2020 12:14:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B87D222C3 for ; Wed, 15 Jan 2020 12:14: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="o1g9Ccf5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732359AbgAOMOW (ORCPT ); Wed, 15 Jan 2020 07:14:22 -0500 Received: from mail-bn7nam10on2041.outbound.protection.outlook.com ([40.107.92.41]:26034 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731673AbgAOMOV (ORCPT ); Wed, 15 Jan 2020 07:14:21 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGBmIEVWJI59VB40LyVj6Cg8QJYwopBJQSmF6fuv2LRt6arcIY/YyLnlxgTlg2fI3psUJaeT6cHba6vWKu9x7oOUoJf1JTJH2oTe5snrRxRSiHI0SR29oHD6irYbVz+aCBi6bp35i+LwaEU//tsQJZImx4x4X4WAJttLNMKbo5yYn/WVf65oIsmB+H6XInJlKhUSJU+o4N/IUCEluXy290VvpKQc0jtT3Llu9L1aECdVv7allKUg4wDMSRYtnOvpOLe0Dt8Zoei5EZ8iDLuGxmc8gJZJ43JUXG7psnJNy6WX48aWOYjwO0GLzERJzR/9um7Qv00sur5k+MZpsmZmYw== 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=8+/BAwuFw3oM+BjgaBfIk2/+u4QYUxQhfRyJJYfrKBY=; b=YDpu+bDyxbsYbyPHjR//KOdfIDECL9gVkJG/WFINStllXuDBnmVW4+D9TnVTFFYoZcPZ7w2+85dR6+sKKMrFpF80/WTOYizNiOyvS3DiI5clEPRT/5XNFqg4dW0mD+Uhlt9ADhWq0XQA2IUmSUu/Jczo6AM/qmzZWfM8VgMNQQIKFbPkFw3kf2ATh0Z0UwcxhZqS47wgU8RZ+tlcj0oDkJnYCKxp2ZJWWRMpsybzxjqDphoYB8vC6GnI+LOz0BK7cEzCb3tEYGpBTnibXXFvrQ/Ts35Q/cz8qENxBqlHKJW/Qy45IyOFh7OXX9cmWGFrT9MXLRU786s7EZ4tINRHqA== 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=8+/BAwuFw3oM+BjgaBfIk2/+u4QYUxQhfRyJJYfrKBY=; b=o1g9Ccf5TuWZteQeY5vpXNXtf7FuKu6IIq1KK8HRpE77GlvhKhyvlX9zzfabE9NnR3/m8adnlMPxWadp0sPWdvtjPqYB9U7oDO0/LtfPiJt/cMridDfO3Qc19g0tqruWawseLSp3JZVOXihal7NR4WcIzYXNd7DS9ZjB61KjRE8= Received: from MN2PR11MB4063.namprd11.prod.outlook.com (10.255.180.22) by MN2PR11MB3934.namprd11.prod.outlook.com (10.255.180.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 15 Jan 2020 12:14: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 12:14:08 +0000 Received: from pc-42.silabs.com (37.71.187.125) by PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) 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 12:13: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 61/65] staging: wfx: remove check for interface state Thread-Topic: [PATCH 61/65] staging: wfx: remove check for interface state Thread-Index: AQHVy50z6uIySu6Zi0W6oWxHuh7ezg== Date: Wed, 15 Jan 2020 12:13:30 +0000 Message-ID: <20200115121041.10863-62-Jerome.Pouiller@silabs.com> References: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> In-Reply-To: <20200115121041.10863-1-Jerome.Pouiller@silabs.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: PR2PR09CA0009.eurprd09.prod.outlook.com (2603:10a6:101:16::21) 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: [37.71.187.125] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fe8279a2-fbba-4dbf-2313-08d799b4559c x-ms-traffictypediagnostic: MN2PR11MB3934: 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)(396003)(136003)(376002)(366004)(346002)(199004)(189003)(54906003)(110136005)(86362001)(956004)(107886003)(2616005)(316002)(36756003)(71200400001)(52116002)(7696005)(478600001)(8936002)(81156014)(8676002)(4326008)(81166006)(6486002)(2906002)(26005)(66946007)(16526019)(186003)(5660300002)(66574012)(1076003)(66556008)(64756008)(66446008)(6666004)(85182001)(66476007)(85202003); DIR:OUT; SFP:1101; SCL:1; SRVR:MN2PR11MB3934; 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: fS4QVqhQPFN2N6pyRLaMh3vGuN6wKkjn+DK0Ojoadblqwh+oIYH2MO28pCR7dMlKYfcr/6O3F5F6HOwQZz4EtSkBwVuwfkgYqeV93hUCKgA4wGTkQ2OSvs3PbFj2FlxgpGs2DXSKHaXFaOoya3nlQVobcTCL0qaF/6Mn9QkS/67hVEvaC9cUjE1zDYr+UMlzcC6BCqkmL3vzA6yOfZq5PYNs75OwZfiBUJu/INSTZcFC6DJmhxmKonD19v2BD6+YvuzN423ozeaAPqDZs8MEcj7fRujYVhg6MHFHJ1o7/pQQaeF6pmnabn9D9fm0rimeV25OMytgYGGVNwoOfwhvGdIwqynH/Oh+kJ/6ZeDWBwZS3NgYDZHWv2cIwKQTk4qGZ6X+IfgPwAGGGqznSCkH36vovkWO66I9ZeW9rk8ZgsZ8WybtLnA1suOSTR1khqSm Content-ID: MIME-Version: 1.0 X-OriginatorOrg: silabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe8279a2-fbba-4dbf-2313-08d799b4559c X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2020 12:13:30.7892 (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: FDdIAR9iUq9JV5ZCSgp5XN9odbAGzeW+/9+dD8Sl1X5BdKRNuJoQbzrFgLnRK5MhxYHvpP4UNfim3V/thgujrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3934 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jérôme Pouiller Obviously, the value of wvif->state as no reason to be wrong. At least, if it the case, dropping the frame is probably not the bast thing to do. Signed-off-by: Jérôme Pouiller --- drivers/staging/wfx/queue.c | 50 +++++++++---------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c index c87d64fbb88f..e0c609c35a7b 100644 --- a/drivers/staging/wfx/queue.c +++ b/drivers/staging/wfx/queue.c @@ -365,52 +365,26 @@ static bool hif_handle_tx_data(struct wfx_vif *wvif, struct sk_buff *skb, struct ieee80211_hdr *frame = (struct ieee80211_hdr *) (req->frame + req->data_flags.fc_offset); enum { - do_drop, do_wep, do_tx, } action = do_tx; - switch (wvif->vif->type) { - case NL80211_IFTYPE_STATION: - if (wvif->state < WFX_STATE_PRE_STA) - action = do_drop; - break; - case NL80211_IFTYPE_AP: - if (!wvif->state) - action = do_drop; - break; - case NL80211_IFTYPE_ADHOC: - if (wvif->state != WFX_STATE_IBSS) - action = do_drop; - break; - case NL80211_IFTYPE_MONITOR: - default: - action = do_drop; - break; - } - - if (action == do_tx) { - if (ieee80211_is_nullfunc(frame->frame_control)) { - mutex_lock(&wvif->bss_loss_lock); - if (wvif->bss_loss_state) { - wvif->bss_loss_confirm_id = req->packet_id; - req->queue_id.queue_id = HIF_QUEUE_ID_VOICE; - } - mutex_unlock(&wvif->bss_loss_lock); - } else if (ieee80211_has_protected(frame->frame_control) && - tx_priv->hw_key && - tx_priv->hw_key->keyidx != wvif->wep_default_key_id && - (tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || - tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { - action = do_wep; + if (ieee80211_is_nullfunc(frame->frame_control)) { + mutex_lock(&wvif->bss_loss_lock); + if (wvif->bss_loss_state) { + wvif->bss_loss_confirm_id = req->packet_id; + req->queue_id.queue_id = HIF_QUEUE_ID_VOICE; } + mutex_unlock(&wvif->bss_loss_lock); + } else if (ieee80211_has_protected(frame->frame_control) && + tx_priv->hw_key && + tx_priv->hw_key->keyidx != wvif->wep_default_key_id && + (tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP40 || + tx_priv->hw_key->cipher == WLAN_CIPHER_SUITE_WEP104)) { + action = do_wep; } switch (action) { - case do_drop: - wfx_pending_remove(wvif->wdev, skb); - handled = true; - break; case do_wep: wfx_tx_lock(wvif->wdev); WARN_ON(wvif->wep_pending_skb);