From patchwork Wed May 6 13:03:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 11531191 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 565C31392 for ; Wed, 6 May 2020 13:05:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 398CF2073A for ; Wed, 6 May 2020 13:05:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="NU6sY9SN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728296AbgEFNFg (ORCPT ); Wed, 6 May 2020 09:05:36 -0400 Received: from mail-eopbgr680108.outbound.protection.outlook.com ([40.107.68.108]:38088 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728286AbgEFNFg (ORCPT ); Wed, 6 May 2020 09:05:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ITwQmQ3QK1GVGF7YfKumLwLPC6QYxZOtS3Kj8Kd73i38Rmua/U6gT2m441/zVW2nkGFbuHjReZ9oxU8hHzIJfjTA/Ujy+rf9Ur/egY3UBWmG6+XZxrnhY8zaJd7EPNCZOshEuBIB0+jqPBb0oscQN4ZlbTacGS0MDN3uBsM8EZPMYIw8sj7CJWysxx0TjRw7RDQ8I2xX/9PRB51mqv1GD6u43Lagn4ii4DRrG2/ENJJztysDYpJItTlYzgAyk3lBVvNDVvMOdzs4B0B1WA7ozEXC4ruCnM7SN8HS21RVbh5muOisNtpSdWlLmaYQa/ZS6qRH3s4uWbqbf2GSD5O0eQ== 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=AcPjWMyEWyOYUs1aTTPXH4WWm0hPBdkvJXteFmI4fDo=; b=TjoSTJcdt3s/4qGgptn4vw46bL50/Br71JGFntUESFZqlYS7LFB528hIoROdjBOG1jdLzIX16VQpLQ9Gw9vORh5SWHHwKdypF8CDXFB8dWcEGhIws576rAmnrB8rpqNo++3eJ4v8tJ7XXFbrZpFpL+5unskrMtOP5YBMJS/sGNWV6SaFmSqiBMOnwvhwOaW5knlI0gDJQn5Qta3L21RPND5mBxUw/adJXGqUty49cl2vpVuOOjdvKAprsUI9E8UHSsawMxbT7RdI2ZH2vHiff0VHIzQun6O242yq1U/i3m7MFRzQrMirvS/I51W5ARTVFUkNTsO9C9g482DUY0gBgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AcPjWMyEWyOYUs1aTTPXH4WWm0hPBdkvJXteFmI4fDo=; b=NU6sY9SNrOEfkW5PlVgQ/1eB7a36NcgNxH2kXweTMXao8IzcK9G6lc6CCYhO5C1IMm+WahpnCh18blDiDXfpo5VLmOH6COPimK4ZbPB2zcrqJKZOLGR6fsiUTGSOkAucJ1R1QPehjfhipzyMHGhK++7qgHzTI9E9qGq/M02tnac= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from DM6PR06MB4748.namprd06.prod.outlook.com (2603:10b6:5:fd::18) by DM6PR06MB3994.namprd06.prod.outlook.com (2603:10b6:5:87::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Wed, 6 May 2020 13:05:33 +0000 Received: from DM6PR06MB4748.namprd06.prod.outlook.com ([fe80::85fb:1c0e:ce17:e7bb]) by DM6PR06MB4748.namprd06.prod.outlook.com ([fe80::85fb:1c0e:ce17:e7bb%7]) with mapi id 15.20.2979.028; Wed, 6 May 2020 13:05:33 +0000 From: Wright Feng To: linux-wireless@vger.kernel.org Cc: wright.feng@cypress.com, brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , chi-hsien.lin@cypress.com, Jia-Shyr Chuang Subject: [PATCH 1/3] brcmfmac: set security after reiniting interface Date: Wed, 6 May 2020 08:03:19 -0500 Message-Id: <1588770201-54361-2-git-send-email-wright.feng@cypress.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1588770201-54361-1-git-send-email-wright.feng@cypress.com> References: <1588770201-54361-1-git-send-email-wright.feng@cypress.com> X-ClientProxiedBy: BY3PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:254::27) To DM6PR06MB4748.namprd06.prod.outlook.com (2603:10b6:5:fd::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by BY3PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:254::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.18 via Frontend Transport; Wed, 6 May 2020 13:05:32 +0000 X-Mailer: git-send-email 2.1.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 269b1c5a-a9e9-48c1-1e08-08d7f1be2905 X-MS-TrafficTypeDiagnostic: DM6PR06MB3994:|DM6PR06MB3994: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:901; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KPgcNl/65hzqf/jAguEmXOxiTB7hiYoXee7rdxyvCE38dYlhZ+1a7lQIKIp3HyoF0S1/Wh8mbP1jNRcCoIMf1vOEu/wFFckH0T93WXHrjlkUtLO5iOY8GmPKihCjtRfsUpdbbhpb0zoefXe5XQA2MfZmzhuiOjzwzyZ8VS2NMs7JIHiuz/E5pRXZRAYaVnuwSd+ZaUSjRVSPTOT2a5ElwabXnYeFsvhjmq/Ma53D3J4NmIDoO2oGsIO2doehifmNBNcydrIw9edm/PZYOLdGmeDVYpMaGy6JOUXknFhaE6zsDPv1O5PzS/irzfK/1nqr0UgOhFywU23ua9HURtdSnAE7mo6LJ1ugoV0cYkrFXEReleR0n18MFWbU7/aAt3TblfmvfExqFs6C6ToLvYrxuOp3vK4hbgXo9jrXejXeWFFTA24E5eJQffUuUGuyGV+VX9+c30Omwq2uBT6pcWISXXX7Brjf5BubobwskVp6eROQwZ5u9jALGKO6yAnJ85gR+tB0Sx+oAaqUUNsDnKJG4Q== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR06MB4748.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39860400002)(376002)(366004)(346002)(136003)(396003)(33430700001)(15650500001)(86362001)(6666004)(107886003)(2906002)(33440700001)(52116002)(7696005)(4326008)(66476007)(5660300002)(54906003)(2616005)(66556008)(26005)(186003)(44832011)(66946007)(956004)(36756003)(6486002)(316002)(478600001)(8936002)(8676002)(16526019)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: BZGuZW3PGu44W+oerz9VBrBcGw9OgbPErEJ8jrklsmwKtVdwEWJZdTBA41QKcujeV4zZr207hTK/q42/KZ+jNFuuQo9MzmuOD2pKY6fPz9HRR60ZunP1lN677uD3QG3yrrW27vuW32568HSP4SMJVVydXAfSRv/DlQ4A2ndItlk6wJrd6USEv2jIXveXITp6uw5kskx6VEVEyUe3DOaLPRqZTku6gnlvp21VDbbWmh2zUWEqOhBWKCWL1WWRKDZy5+TYy6uh6Y92gBOmbV4pGzODnS9pBscvHCkmGVta9uYG7503ty4lOjl2TspYRWRyNW7mNsjfvJvWlZOu0Gz2g9nE1Avajwfw8wFtRW+Zyi30L2tTHEc6r8/lW64ZECwH5sLpZzEX/S7xUyAOmMpWEUAPBwEqT+XdbNQS7oHCrp3rM2HaMTjTo6hqvM/zk/mnPSV1pT9c7uN/X+JQGde30yyuDBl+aRv5j47VA4dM1BgJ0T8AwKUXODnTsil7T0ZbVZRK0Q8bfzXoJVl0JzrriHegV8OykTakATatW5kNhh2Q7SH4fK4DeVLXqnXZ4cCL72gNquftYUWrIViCLP1Be7/UDW8lBFVST7hPZbBdnQGt3jvVpGdO7J/YCWX/aZ+X6vdVc48l5bcmz6PGdAA5U9J5BLoTkTCouK1yruvti8dPAhoA8OkbPQSmLNI7amcxJC6hFhWrGL5SnOjj1BinuKmeSsVeeGXXpFbXMFBVaFN0SpUrk1CQQXW/iCUtpG8uYKRD3kDqQY2CqowDbifVCrN9FXwHOlvCVaCwW3nSK4Y= X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 269b1c5a-a9e9-48c1-1e08-08d7f1be2905 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 13:05:33.4723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7hIu4potdv553I2Z6fxzMOh9dNwlGmM6v0es/OBYEl8JvdwmbPHSwJwG62jbAmRBEEivHXj8vIRNs6qg4v7gRQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR06MB3994 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Jia-Shyr Chuang Host driver parses and sets security params into FW passed by supplicant. This has to be done after reiniting interface in the firmware. Signed-off-by: Jia-Shyr Chuang Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 90 ++++++++++++++-------- 1 file changed, 58 insertions(+), 32 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index fa84647..4c86ed2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -4599,6 +4599,48 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif, } static s32 +brcmf_parse_configure_security(struct brcmf_if *ifp, + struct cfg80211_ap_settings *settings, + enum nl80211_iftype dev_role) +{ + const struct brcmf_tlv *rsn_ie; + const struct brcmf_vs_tlv *wpa_ie; + s32 err = 0; + + /* find the RSN_IE */ + rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, + settings->beacon.tail_len, WLAN_EID_RSN); + + /* find the WPA_IE */ + wpa_ie = brcmf_find_wpaie((u8 *)settings->beacon.tail, + settings->beacon.tail_len); + + if (wpa_ie || rsn_ie) { + brcmf_dbg(TRACE, "WPA(2) IE is found\n"); + if (wpa_ie) { + /* WPA IE */ + err = brcmf_configure_wpaie(ifp, wpa_ie, false); + if (err < 0) + return err; + } else { + struct brcmf_vs_tlv *tmp_ie; + + tmp_ie = (struct brcmf_vs_tlv *)rsn_ie; + + /* RSN IE */ + err = brcmf_configure_wpaie(ifp, tmp_ie, true); + if (err < 0) + return err; + } + } else { + brcmf_dbg(TRACE, "No WPA(2) IEs found\n"); + brcmf_configure_opensecurity(ifp); + } + + return err; +} + +static s32 brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, struct cfg80211_ap_settings *settings) { @@ -4610,8 +4652,6 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, const struct brcmf_tlv *country_ie; struct brcmf_ssid_le ssid_le; s32 err = -EPERM; - const struct brcmf_tlv *rsn_ie; - const struct brcmf_vs_tlv *wpa_ie; struct brcmf_join_params join_params; enum nl80211_iftype dev_role; struct brcmf_fil_bss_enable_le bss_enable; @@ -4665,36 +4705,6 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, brcmf_configure_arp_nd_offload(ifp, false); } - /* find the RSN_IE */ - rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, - settings->beacon.tail_len, WLAN_EID_RSN); - - /* find the WPA_IE */ - wpa_ie = brcmf_find_wpaie((u8 *)settings->beacon.tail, - settings->beacon.tail_len); - - if ((wpa_ie != NULL || rsn_ie != NULL)) { - brcmf_dbg(TRACE, "WPA(2) IE is found\n"); - if (wpa_ie != NULL) { - /* WPA IE */ - err = brcmf_configure_wpaie(ifp, wpa_ie, false); - if (err < 0) - goto exit; - } else { - struct brcmf_vs_tlv *tmp_ie; - - tmp_ie = (struct brcmf_vs_tlv *)rsn_ie; - - /* RSN IE */ - err = brcmf_configure_wpaie(ifp, tmp_ie, true); - if (err < 0) - goto exit; - } - } else { - brcmf_dbg(TRACE, "No WPA(2) IEs found\n"); - brcmf_configure_opensecurity(ifp); - } - /* Parameters shared by all radio interfaces */ if (!mbss) { if ((supports_11d) && (is_11d != ifp->vif->is_11d)) { @@ -4775,6 +4785,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, bphy_err(drvr, "BRCMF_C_UP error (%d)\n", err); goto exit; } + + err = brcmf_parse_configure_security(ifp, settings, + NL80211_IFTYPE_AP); + if (err < 0) { + bphy_err(drvr, "brcmf_parse_configure_security error\n"); + goto exit; + } + /* On DOWN the firmware removes the WEP keys, reconfigure * them if they were set. */ @@ -4807,6 +4825,14 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, chanspec, err); goto exit; } + + err = brcmf_parse_configure_security(ifp, settings, + NL80211_IFTYPE_P2P_GO); + if (err < 0) { + brcmf_err("brcmf_parse_configure_security error\n"); + goto exit; + } + err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le, sizeof(ssid_le)); if (err < 0) { From patchwork Wed May 6 13:03:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 11531193 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD49E1392 for ; Wed, 6 May 2020 13:05:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0F8C20746 for ; Wed, 6 May 2020 13:05:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="n09gj0Dw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728392AbgEFNFj (ORCPT ); Wed, 6 May 2020 09:05:39 -0400 Received: from mail-eopbgr680137.outbound.protection.outlook.com ([40.107.68.137]:26605 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728286AbgEFNFi (ORCPT ); Wed, 6 May 2020 09:05:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BQjmaiyBAG3Qug7M5QOI0R5mazBT5IIPKtkbsMwH9d6JTkDqA7HHiqbBv9u96HhlEj/RQz5XIX50n4dWQMfLU2yQrgzIdUQTfVtJbTHj25qpFI/kqyRfA1iThMeP979UzQvHpq+NwkYladsJhLV8aW3O+JGXN9FpfMUXeB/CE/Mt0MwEtrjEIfVdquztWTrFsDFRVpdCvUezyuG0ygHiWwpuu7og+sFq5zE+crjYuhrkpZ5SlP5X8PNZnGAM7Sp+eBPoeb53YvjACtY5vQfQV3hdr95L/PcT7aCRzB6E2UO07X371FGa8cex9E3n6a2NXmO3kpYx5VGZUK8CBSNBbA== 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=z96Cth50p8Tpo9nxHeAjGqak31Jir1NAUfh6KqKjAA8=; b=l880Ct7TDjZWdJPerziFjR804Hu3JmmqIVxyylcN+khVYyoS3NGgnE6/nW4/KFR2wT5puVZdIhe78tIlOmzzUkUAu5qM44QJ4oe/UCr6BqRuiaVdvAxsmSYKG+FgBRgPrYiL40UYcUXrUh/6rzp/Ufvo4zwvIzwrpEPLu7KAwsNTL9t9c/amAn2DrdugxWqS74y2Sn74sLKTXJjyqKlyq1HWb++eNixSWaJ9RFTefaJGYJZ2Qm49oRaGa1FC/SPdAHJujeh/iCPcGUtELi3xls/FwUw6afSVzTdXPKIv/HqRVGhilhAKOKqXxzyE6ZU+u9zndW/xOSYGitZa9k2CTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z96Cth50p8Tpo9nxHeAjGqak31Jir1NAUfh6KqKjAA8=; b=n09gj0DwZlRxhC8yVPVe70kT7du3+RogY0UadfMl51V/sUU2PtEd5VYMngepXR3UjzKrLSfXRYBMMrlE/bc0wAltU62irtqHwfqURBk1aeUfq3kj6rozoLWZjpUPoTWFcsQqiEscuS+utlRnSkDDO8U5JtlU5dWLAftOoNSwx+s= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from DM6PR06MB4748.namprd06.prod.outlook.com (2603:10b6:5:fd::18) by DM6PR06MB3994.namprd06.prod.outlook.com (2603:10b6:5:87::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Wed, 6 May 2020 13:05:36 +0000 Received: from DM6PR06MB4748.namprd06.prod.outlook.com ([fe80::85fb:1c0e:ce17:e7bb]) by DM6PR06MB4748.namprd06.prod.outlook.com ([fe80::85fb:1c0e:ce17:e7bb%7]) with mapi id 15.20.2979.028; Wed, 6 May 2020 13:05:36 +0000 From: Wright Feng To: linux-wireless@vger.kernel.org Cc: wright.feng@cypress.com, brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , chi-hsien.lin@cypress.com, Ryohei Kondo Subject: [PATCH 2/3] brcmfmac: use actframe_abort to cancel ongoing action frame Date: Wed, 6 May 2020 08:03:20 -0500 Message-Id: <1588770201-54361-3-git-send-email-wright.feng@cypress.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1588770201-54361-1-git-send-email-wright.feng@cypress.com> References: <1588770201-54361-1-git-send-email-wright.feng@cypress.com> X-ClientProxiedBy: BY3PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:254::27) To DM6PR06MB4748.namprd06.prod.outlook.com (2603:10b6:5:fd::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by BY3PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:254::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.18 via Frontend Transport; Wed, 6 May 2020 13:05:35 +0000 X-Mailer: git-send-email 2.1.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f515b618-5b9b-4e4e-cd9b-08d7f1be2afe X-MS-TrafficTypeDiagnostic: DM6PR06MB3994:|DM6PR06MB3994: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iIch+dCzvQVtx1RTidsA1u1pRuVtEEjr0RMsO+26fSGFv6qHzlqmyvF5SOwAi27TFmi4vYlPMlas4bbTRpmFfSaBx7IAtCByvBRzxKDFe2bIHJR2GjjYoC34m5V/mbpa9aAzOERw9fgeBUPmnTyvsfpqDqhn7+wZLuBbZWOnxjPeudes3zWjhPko1RssbrRJH3TiyF7ILsncOq2/VNw32YFyK13QFfZ8l7pMAZSBhCmw7kZ/f2MPgFY4HOY5HLFiiuSQ2LtAO9epnPFKj4gtG4kx6r7AsfcdzkoVDpf3VPhzNr9RxWJM+jriI4q+R3J2oU9k8IHGtlB53elA1Y2X5LKSHQZyenPrz9aJ0iG8KnuZNIcczW2/ea0ra3wEvMn4U7+JRcJPEZjykVvjZ3b+O09E9N1ePWxcKtB6pvvsx1V1b6F/0j+/3pUw9OrWixL/OAevJCKDfXQSkAf/026UXapaMAxFgoUcfeIWtzLl4UtOrbdQuU2PQ0SqYqHK31Yg9b3b8LU7PrZi+05pNF2rlQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR06MB4748.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(39860400002)(376002)(366004)(346002)(136003)(396003)(33430700001)(86362001)(6666004)(107886003)(2906002)(33440700001)(52116002)(7696005)(4326008)(66476007)(5660300002)(54906003)(2616005)(66556008)(26005)(186003)(44832011)(66946007)(956004)(36756003)(6486002)(316002)(478600001)(8936002)(8676002)(16526019)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: oslj67uewmQW9njFCURfCjxSMsb0tG973KGfSNyRRTWSUYUJmdie4I0pcmPebtKgHCFWzXKkba3KnhtNcKrwuSWC3G+sZ+iGMrxga+rvw4SDNFuIy1fn/5d2P6DgBVXsIXMT/EPLxlMmBehLcRMZlEHjq5RPLVs4G3tXukr+fevRLbCVktoDONvqfaYYprfFhp6EvvJv5z/YaOchcW8f+jLV+f3gi2nS9u7OBWwp9B942l0YVSTNC5PjVs9ulQHDOejADmVOM/jzMpMhhnpy8soDxGteKOkkLPQJQlFvSXpFa/NYbwKRjlADkEKL964g46uS9W6EZdEOs7cZTGkb5HQDgTYv63DNP7KnrT5JyCgaFMhFH8BHwCDJVL9tn8IePATjUKQHGDyL94WAB93k014qu0id1DUd8MP7g7uOLVH/rjjwI8SncZ9aNQtAyqZafJac0dvCB7KuMZ9LjFlwOiPx69XdW2ERQo/hUAUTnkfdYFsv9PCKmLfo0oVnYE4ntsbOGvQFiHHS4/AuiXHHyltmrcSWvEUadJMSLcDALY7eJF4bJR795qW9BA/xXYgCbNw4b9CyMynwKSxsMjnqEJdEaUaEzCjUisxUCXfX8k8s9bDZ/2SZ8k7zS3tK64ze73lZAz9isWMwElT/XsF1NdpEhi0mx7pM20dUK6c2rbPZm+G5q0PYHtEpabpXFJtH7vn1rbllvP7Ib6FRrEbjbkvv20/Ugk3dvcQSBLfAyLH3K8GR8Z3SctZ0XXfD79kjWngIvmnuh8fu7EO+D11TLSD24FeBykoPkAiORhTtgG0= X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: f515b618-5b9b-4e4e-cd9b-08d7f1be2afe X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 13:05:36.7804 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rgBlJljo7uEEGkoTYtcWcjrfW/JMrAxxC8v6Z/5tf6CkvcC7FKltZPTlCuytjzh7KcE7gof+npFguYpv5wNpiQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR06MB3994 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ryohei Kondo The driver sends an action frame down and waits for dwell time to be completed or aborted before sending out the next action frame. Driver issues "scan abort" to cancel the current time slot, but this doesn't have any effect because, we are not using scan engine for sending action frame. Fix is to use "actframe_abort" to cancels the current action frame. Signed-off-by: Ryohei Kondo Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng --- .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 34 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c index 1f5deea..7e43eea 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c @@ -1245,6 +1245,30 @@ bool brcmf_p2p_scan_finding_common_channel(struct brcmf_cfg80211_info *cfg, } /** + * brcmf_p2p_abort_action_frame() - abort action frame. + * + * @cfg: common configuration struct. + * + */ +static s32 brcmf_p2p_abort_action_frame(struct brcmf_cfg80211_info *cfg) +{ + struct brcmf_p2p_info *p2p = &cfg->p2p; + struct brcmf_cfg80211_vif *vif; + s32 err; + s32 int_val = 1; + + brcmf_dbg(TRACE, "Enter\n"); + + vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif; + err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val, + sizeof(s32)); + if (err) + brcmf_err(" aborting action frame has failed (%d)\n", err); + + return err; +} + +/** * brcmf_p2p_stop_wait_next_action_frame() - finish scan if af tx complete. * * @cfg: common configuration struct. @@ -1255,6 +1279,7 @@ brcmf_p2p_stop_wait_next_action_frame(struct brcmf_cfg80211_info *cfg) { struct brcmf_p2p_info *p2p = &cfg->p2p; struct brcmf_if *ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; + s32 err; if (test_bit(BRCMF_P2P_STATUS_SENDING_ACT_FRAME, &p2p->status) && (test_bit(BRCMF_P2P_STATUS_ACTION_TX_COMPLETED, &p2p->status) || @@ -1263,8 +1288,13 @@ brcmf_p2p_stop_wait_next_action_frame(struct brcmf_cfg80211_info *cfg) /* if channel is not zero, "actfame" uses off channel scan. * So abort scan for off channel completion. */ - if (p2p->af_sent_channel) - brcmf_notify_escan_complete(cfg, ifp, true, true); + if (p2p->af_sent_channel) { + /* abort actframe using actframe_abort or abort scan */ + err = brcmf_p2p_abort_action_frame(cfg); + if (err) + brcmf_notify_escan_complete(cfg, ifp, true, + true); + } } else if (test_bit(BRCMF_P2P_STATUS_WAITING_NEXT_AF_LISTEN, &p2p->status)) { brcmf_dbg(TRACE, "*** Wake UP ** abort listen for next af frame\n"); From patchwork Wed May 6 13:03:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 11531195 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33B4414B4 for ; Wed, 6 May 2020 13:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1669C2073A for ; Wed, 6 May 2020 13:05:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="S09TajCf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728317AbgEFNFo (ORCPT ); Wed, 6 May 2020 09:05:44 -0400 Received: from mail-dm6nam12on2136.outbound.protection.outlook.com ([40.107.243.136]:50560 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728162AbgEFNFo (ORCPT ); Wed, 6 May 2020 09:05:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VLb57IFokViUORrudu1QaqwANltsRK9y9IoHrYMJgK4yJPZa7LDyPBW2UWJBuHq568b2WnipAUi5CyolWUuB3mc0tQXKbsGf9GQWCDTCsJGlEi9lfG64qixqcYDqrlgtrK4abCG00FvEqNbC36+9ApMf1oEY8QIo9Yt2hk3GlaRDBwB0pndU+1qXFD9Ckx6ebt6j/YF6LfuOxhtAGN50uIVKGVvLJ98UbuDrSfkIGAw3l4Jv8Uu+iK2IJKfKjSf+4XNCM+/XAbrTw53X1bONe+MBnR1i0QB3TCz2GmD2NzQFg7Hn9GqIl9fnwTrA4/6FeYVU3baUpTT0UBWCYNdogA== 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=05ADnhhSpoogBUHJkeGwTC4ivXfr5EqPdRfTIRe+avM=; b=m4bkM+xFYD+2wzvAf8CmSYED4LEO5VcUUTzYmAye1HNIoxKMhDwMsoO88AnfRya46oZyfYAfxar6KiKXF579aL4ygxLS5m6SCtWEdnql6p0HY2ThFtCP5zsOStR+2PK/a8V8mrGTRbkHKILNWNLf9NetQkq8VhKGa2TxHm0AR3dfpI/acaSlio0fw4VJ/2y0hXwDa3mgV0f8mBuJSe7ELt8MQoVu7qv4cjlyKpnJ3F9ErJHDWJdKKHb8jXVQstdBASl5gRTrZkWNJ59J/mCDu0NX8tfb0dZdtzc5ZF3aHvjgzGwr4Y4sPvsfIynx8xcRLsglc47fBaMho1C8WDEkog== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cypress.com; dmarc=pass action=none header.from=cypress.com; dkim=pass header.d=cypress.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cypress.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=05ADnhhSpoogBUHJkeGwTC4ivXfr5EqPdRfTIRe+avM=; b=S09TajCfXrLT9sst2aUjj7BZQM2K8apekzbbM0aIhRAfrGrf1vgmvS+sFWBc2MibHVpZ3JzTggS2CkbKpHKQp08vgaFaCMNnxvkrOyk2ozQ9WAdyMiSz+TE4Sy+7lrWaBeGyYke+hsm1oXgPVG1TbXIcFCvQWw5yJEj8OnmP9VY= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=cypress.com; Received: from DM6PR06MB4748.namprd06.prod.outlook.com (2603:10b6:5:fd::18) by DM6PR06MB5322.namprd06.prod.outlook.com (2603:10b6:5:106::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.29; Wed, 6 May 2020 13:05:39 +0000 Received: from DM6PR06MB4748.namprd06.prod.outlook.com ([fe80::85fb:1c0e:ce17:e7bb]) by DM6PR06MB4748.namprd06.prod.outlook.com ([fe80::85fb:1c0e:ce17:e7bb%7]) with mapi id 15.20.2979.028; Wed, 6 May 2020 13:05:39 +0000 From: Wright Feng To: linux-wireless@vger.kernel.org Cc: wright.feng@cypress.com, brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , chi-hsien.lin@cypress.com, Soontak Lee Subject: [PATCH 3/3] brcmfmac: Use seq/seq_len and set iv_initialize when plumbing of rxiv in (GTK) keys Date: Wed, 6 May 2020 08:03:21 -0500 Message-Id: <1588770201-54361-4-git-send-email-wright.feng@cypress.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1588770201-54361-1-git-send-email-wright.feng@cypress.com> References: <1588770201-54361-1-git-send-email-wright.feng@cypress.com> X-ClientProxiedBy: BY3PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:254::27) To DM6PR06MB4748.namprd06.prod.outlook.com (2603:10b6:5:fd::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote02.aus.cypress.com (12.110.209.245) by BY3PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:254::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.18 via Frontend Transport; Wed, 6 May 2020 13:05:37 +0000 X-Mailer: git-send-email 2.1.0 X-Originating-IP: [12.110.209.245] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 19bf5c35-27ae-49be-0ccd-08d7f1be2c7c X-MS-TrafficTypeDiagnostic: DM6PR06MB5322:|DM6PR06MB5322: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Bxsbp76/fLtRVxWQsieF/wFSFdlnCA/15JiZXj+7Z/m5UQ511/Av3XALcWBVvz6kShYFuLYCwATt8tjQmQO91PdlV/oLYzHWIqJEm8TVTN/OtoG8hI8uMhedkCfocHqX4loD/OlqWUyfidRxdo+ru8eJ7Tyl93BFKmoWhokYReu8oWuhhP1sQMADOSzJh6H8tdIG6Xt5BEODhWisifvZ/dwzN+SrkuAm6u1MaxG7VqAEdX+chX5JMUVyGN5onZhfx8IDIH8fnkslwdEiABqNr2OnhfFV7lR6BGe56En1f7GnHU6hOegUbZftLQ+yeUJ5InNvNW2e1eKYdByjnstR6ambLI8q2Dy6JkFMhyLVY0ODkyxng88NqoQsuImybm+VckMyfdYJV+3yD161YeoZnOXWkZ7zV6l6NirC4G8UUxOSsrdEWbb4L+R+2g/eFkoqSMbkwXnFvfiwMzuPfjE9mPd/A5/LxlsUaQlSrHvGI8HBJopQnqT95US0Sw9WXT0uq46FdZmp0vteYvpQXzJ6qw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR06MB4748.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(366004)(376002)(396003)(136003)(346002)(39860400002)(33430700001)(316002)(2906002)(8676002)(8936002)(36756003)(6916009)(4326008)(86362001)(33440700001)(6486002)(107886003)(66946007)(6666004)(26005)(66476007)(66556008)(5660300002)(186003)(44832011)(956004)(2616005)(54906003)(52116002)(478600001)(7696005)(16526019);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: h4dtYT4s75Y8O+U5F3EK1A5gr0+/r+cFD4E+iTl52HDIu/F7ddqGqvX2w1VgmOulcH0yVha7FRz8/WIlAyrcV7yCYD50pMZU6miGP9AnB8c8i2TWkZ1L60tqZimzZibykgM/pXN5QE9K2hz7HNEy/xW91VCuDF0+Ge5RFrgjZSWoW7v1Nh7cAEDxrXq9hpuA+PSN9V0mVCD+gd43hPUih4mIymNYDaD8JKHA3BfXyYUaXSmYkuyef6F5huWPGZJUK6PWYx1qKOprJ1seRhjCFEI3QqehqonWUGQ6v4ZmsgrRVpcIRxfd0z7Rbe9tPr2xSdPG15QuVT1TrYt+FwzYFxMqesfGlbpcZPxyL7xxZTqvgMLVAP4hVNKkRBlZnrYvRuLVPZVfDnZzmfYGDR9jmr7+TpPq1cSac7Yt1SifasZIptXMV2rsHDZEGh+Duddt/R2hfPulS+HvP8jM7+Nz6tMkeKXbnduDgVAaMjSyhaIME+wDpUhxsxNt7fbOKqWUGA3Q2hzS/j2qazbQbYJxQYfT2TJD0FSJObyBEuVMN96/HUUq9yTdcIskp/+cKB58gpYGfZ4jeY4A/cq21f0q59PK+VXmFmy7S+Cs5hD1U3Kb0uUaToGYhs/c2YfIIZiBG6XkjVqS+WHeU8BJhzP3hCbcw3sElZkEC7L4tog2zADehV2V98yduUfpAX12ktjbNRz3EKFdvd3DgJUUDPtgeMRaRi+EqCSp602oO4dc8f1DaOAWsPJUen716/ULsy8/fPLOlzTwLV9dBuubw74uDXezmVVog55FGUIJYHfIAEE= X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19bf5c35-27ae-49be-0ccd-08d7f1be2c7c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 13:05:39.2829 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 011addfc-2c09-450d-8938-e0bbc2dd2376 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WMPtQLIiTMh+WKmO6PX4LsNrxuC3eTlbWTixApX/ccNr30dwQmq+JcM55CoonK6s005B76xJOmQvXz9o44g+Gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR06MB5322 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Soontak Lee When plumbing rxiv for (GTK) keys, current code does not use seq/seq_len when present nor set iv_initialized for iovar wsec_key. This could result in missing broadcast traffic after GTK rekey. The fix is setting iv_initialized and using seq/seq_len for iovar wsec_key. Signed-off-by: Soontak Lee Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 4c86ed2..b20ccfd 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2468,6 +2468,17 @@ brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, if (!ext_key) key->flags = BRCMF_PRIMARY_KEY; + if (params->seq && params->seq_len == 6) { + /* rx iv */ + u8 *ivptr; + + ivptr = (u8 *)params->seq; + key->rxiv.hi = (ivptr[5] << 24) | (ivptr[4] << 16) | + (ivptr[3] << 8) | ivptr[2]; + key->rxiv.lo = (ivptr[1] << 8) | ivptr[0]; + key->iv_initialized = true; + } + switch (params->cipher) { case WLAN_CIPHER_SUITE_WEP40: key->algo = CRYPTO_ALGO_WEP1;