From patchwork Mon Sep 14 03:16:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 11772769 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 E4BAC618 for ; Mon, 14 Sep 2020 03:16:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C3091208C7 for ; Mon, 14 Sep 2020 03:16:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="VrPRP0kr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725986AbgINDQv (ORCPT ); Sun, 13 Sep 2020 23:16:51 -0400 Received: from mail-bn7nam10on2097.outbound.protection.outlook.com ([40.107.92.97]:49856 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725995AbgINDQt (ORCPT ); Sun, 13 Sep 2020 23:16:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fe/a6dnqOo5W6LqXSSRFqdGox2723sFbqgNpV3AzsCarKflsrRiZtX0l+L1DNTaMa1U9THz4oSBO7SZoaQszFnbcpP0HWX1cmM8HQT7l2xbqHeayedc8nkSD6q0W4UoqWtgjru5RYtiBjYKIchcYPkvmlmvY1iqP1n7EOLQMAbV0aq4yCSJe2KEAmA2aB78W3Zdv9TDkbt6VeG41sKy51qqp/PCuxq9QTOyRHraWjsRF4Zmr1nqx2QU2M0HIkOVroiq7KgAJpUY0macElDpokjfFXvgsENCfB3dhmPJIqhaFLctxlPNYPKsDfUzMT8/QQTcDQyypI3d7RTCdGEGW2w== 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=xBECv4wwJI3jZL7sj2f6BRUqLTi0d6gB1Lbd0luK91g=; b=RzT2zRUQBWW6fCd9ibLd3HsAik6pFyfFOyhJYGVuQXxewpIBszrPksZN2gZKtHYZ8qvc6Me+o9TE99eOWLcvObg8L5E46ukXOumumgWuyw7yBm+5hZdfbpWaYDejuoUSSG+c1aOu9RMDkuOPtDqOWdfS4pDi9hzjdtPBvIlmBSoaJ6C+xtNfxFwjB4CbOaWftw3eHb/yI0KQ1MFK/7MP04FUC/jotCSRVRSNrarVEeWXcd3JhUIPyhIqVrL/BilBQmAN5X6U8xIx8RMHpZMDStOdrU/WWLxBu2vLgim7KYpw5zbgnspktla/ZiaCtriVVSy/qTOIPiI8GSIgn+odqw== 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=xBECv4wwJI3jZL7sj2f6BRUqLTi0d6gB1Lbd0luK91g=; b=VrPRP0krhjPDTDQfsw8FW2yKpDgVbwiCEG1uKkreEUUlXW/hasXmqH867E1A6z0955gDhHxcbdzq6fK72qwDi4L7cw76v3gp5bAKqd4JWkIv6H8VC7p28j1WLdua05z5d2hi7j1YEtMawYjSNljevyil8HSBWwP3PxFDD9tNvRw= 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 BN8PR06MB5889.namprd06.prod.outlook.com (2603:10b6:408:c2::25) by BN8PR06MB5377.namprd06.prod.outlook.com (2603:10b6:408:49::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Mon, 14 Sep 2020 03:16:47 +0000 Received: from BN8PR06MB5889.namprd06.prod.outlook.com ([fe80::d82b:5f42:b7a8:d819]) by BN8PR06MB5889.namprd06.prod.outlook.com ([fe80::d82b:5f42:b7a8:d819%3]) with mapi id 15.20.3370.019; Mon, 14 Sep 2020 03:16:47 +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, "Double Lo" Subject: [PATCH v2 1/3] brcmfmac: support virtual interface creation from firmware Date: Sun, 13 Sep 2020 22:16:32 -0500 Message-Id: <20200914031634.190721-2-wright.feng@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200914031634.190721-1-wright.feng@cypress.com> References: <20200914031634.190721-1-wright.feng@cypress.com> X-ClientProxiedBy: BL1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:208:256::11) To BN8PR06MB5889.namprd06.prod.outlook.com (2603:10b6:408:c2::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote06.aus.cypress.com (157.95.12.33) by BL1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:208:256::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.5 via Frontend Transport; Mon, 14 Sep 2020 03:16:46 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [157.95.12.33] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 2aa87ff0-b806-489d-60ff-08d8585c9d17 X-MS-TrafficTypeDiagnostic: BN8PR06MB5377: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:165; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FCV+ONLrbm3wSNAlrKZnHxO6ESrxxLeDh2y6u9+Hu7YFfleeAmMkNDBoAfm8egR+wY6XOcPKoxEY+nIrNqRSlm8nvXq0DBS68SgZT/PfTI7x85NRJ+Y1+fnsgwWbgCcZZzCvr5BOVkAOi9TVNI0+W7I8yuMKa/a6bsmgYn4xdqje/Nb08vZttPtl7Db3sdWx1cjxSV3M+OgtQGMArgG6TBaDzz/6Hkb6keMcomFCCN+cu0un6rNySiTYzOjZMYHg6pxYLldh+BtrkkBA9SGIqVZOl0B0dhhfHUcx6ZjQgKka2t9i/3Hi74H4i/n89EL1n9rZyGyMzvUm4Gb11NX8Pw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR06MB5889.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(346002)(366004)(136003)(396003)(36756003)(26005)(7696005)(52116002)(6916009)(6486002)(66556008)(66476007)(1076003)(83380400001)(86362001)(16526019)(66946007)(186003)(4326008)(8936002)(8676002)(44832011)(2906002)(478600001)(316002)(54906003)(2616005)(956004)(5660300002)(6666004)(107886003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: ytrBjW0yg45WLzxStmt5znGs60gbnMgztrLuy1fSJT8w/VoRM+H1zrFbVXTX4qVkap5Wf+1u4l8EufKGvNCWF9fooCWHsKzAHiGcPi2FYwE/0IHPJRr/BedSotUpoMYqQmzsVVH65u89RAKBEX55qfx6Vt8eZgg08oW+G7DfQ1iB9zs4mhW9f/vKat4ua5yE1dQIqTQf7NT2fHwqQAW1F8LNmakJPrXTCyhj4vPrtTZodA51iT4hJWMlNaf8jMOl5MobUkj7WaFDIOrR87JDIMhE5tLMGe+hAykdWsKlt0crgR0Veudca0W3elySVNSl0YeMuU8MtLD7i/1AOsZEbt82h3V21Uz/9NuMKqEJVCG79FDrTQtcOrn85it0p9G7jx6TuDdS6IzaGfuJTrzP404LIkr6AdplFiGYDKTF+XVxtCtBvxXjV7UvVQ8XNBU/ZPrxNK6IkfOM5arRo8CoPyrQgGGZamSXrwyfv9abnIRyMqsYluJN6UBT4pY0H7Ia8hQTltz8tWgJURjH2m6/eSjUCea3KX11QDCf+wTe0o1xdrBHdxwnwb9p2vgV59YHU7CED5Kpc/KMFnHsQwTANsEqK26Av7piUUOQC8ocViStIW1RM2OJYyC+pXdmEOjKzvil7vbfbADYJZvnT4QEJg== X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2aa87ff0-b806-489d-60ff-08d8585c9d17 X-MS-Exchange-CrossTenant-AuthSource: BN8PR06MB5889.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2020 03:16:47.1784 (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: Ts0MNWGNc8B0LHRBE3CCAV7YkxHPo2d0CdcpiwGvmJHN1bNO/akewJVekLj2hOo8AxMBdju8XF5qIwR7LJWlDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR06MB5377 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: "Double Lo" Allow interface creation via IF_ADD event from firmware. Signed-off-by: Double Lo --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 50 +++++++++++++++++-- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 5d99771c3f64..c0177e121526 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -230,6 +230,9 @@ struct parsed_vndr_ies { struct parsed_vndr_ie_info ie_info[VNDR_IE_PARSE_LIMIT]; }; +#define WLC_E_IF_ROLE_STA 0 /* Infra STA */ +#define WLC_E_IF_ROLE_AP 1 /* Access Point */ + static u8 nl80211_band_to_fwil(enum nl80211_band band) { switch (band) { @@ -5535,8 +5538,10 @@ void brcmf_cfg80211_free_netdev(struct net_device *ndev) ifp = netdev_priv(ndev); vif = ifp->vif; - if (vif) + if (vif) { brcmf_free_vif(vif); + ifp->vif = NULL; + } } static bool brcmf_is_linkup(struct brcmf_cfg80211_vif *vif, @@ -6102,6 +6107,9 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, struct brcmf_if_event *ifevent = (struct brcmf_if_event *)data; struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; struct brcmf_cfg80211_vif *vif; + enum nl80211_iftype iftype = NL80211_IFTYPE_UNSPECIFIED; + bool vif_pend = false; + int err; brcmf_dbg(TRACE, "Enter: action %u flags %u ifidx %u bsscfgidx %u\n", ifevent->action, ifevent->flags, ifevent->ifidx, @@ -6114,9 +6122,30 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, switch (ifevent->action) { case BRCMF_E_IF_ADD: /* waiting process may have timed out */ - if (!cfg->vif_event.vif) { - spin_unlock(&event->vif_event_lock); - return -EBADF; + if (!vif) { + /* handle IF_ADD event from firmware */ + vif_pend = true; + if (ifevent->role == WLC_E_IF_ROLE_STA) + iftype = NL80211_IFTYPE_STATION; + else if (ifevent->role == WLC_E_IF_ROLE_AP) + iftype = NL80211_IFTYPE_AP; + else + vif_pend = false; + + if (vif_pend) { + spin_unlock(&event->vif_event_lock); + vif = brcmf_alloc_vif(cfg, iftype); + if (IS_ERR(vif)) { + brcmf_err("Role:%d failed to alloc vif\n", + ifevent->role); + return PTR_ERR(vif); + } + spin_lock(&event->vif_event_lock); + } else { + brcmf_err("Invalid Role:%d\n", ifevent->role); + spin_unlock(&event->vif_event_lock); + return -EBADF; + } } ifp->vif = vif; @@ -6126,6 +6155,19 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, ifp->ndev->ieee80211_ptr = &vif->wdev; SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy)); } + + if (vif_pend) { + err = brcmf_net_attach(ifp, false); + if (err) { + brcmf_err("netdevice register failed with err:%d\n", + err); + brcmf_free_vif(vif); + free_netdev(ifp->ndev); + } + spin_unlock(&event->vif_event_lock); + return err; + } + spin_unlock(&event->vif_event_lock); wake_up(&event->vif_wq); return 0; From patchwork Mon Sep 14 03:16:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 11772771 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 1CFC7618 for ; Mon, 14 Sep 2020 03:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03AA3208DB for ; Mon, 14 Sep 2020 03:16:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="j0BKiUDG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726008AbgINDQy (ORCPT ); Sun, 13 Sep 2020 23:16:54 -0400 Received: from mail-co1nam11on2096.outbound.protection.outlook.com ([40.107.220.96]:49120 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725995AbgINDQx (ORCPT ); Sun, 13 Sep 2020 23:16:53 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ze7yNaVJWAMpCPqb8Ao3TMyBLMXtalUjBYYka2zC9lEcG6calkvtJXIsa3HOo7fG4Y3AcE0mBs+UIvb8UDTp7WMvuefAV2qkXgXeWAsr+87mBWKvJrDrPuYz57Oort2o77D8iZ/kVrD+eYhg4um9lu4P3UgR287HSZAquNbbjfhye8/xfRdKkxmI5ykblPfOJwvrcWe+oEpjkzqN1g/cElIopJgTOdTX414C39E8JS7wZFEN+BSe1AlHkcak5nFcS32arrt6wdKqeTSM/AKUEmvGyONNqjyafrbpwB02ysqe5saDTrImkNA/F7W2fpl61BB3wsfGn79pufDPqSk/kQ== 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=1hVch0XCiE2krAp+LgNiSjkiKvWWkErE48HgegzjOi8=; b=aR1LXVV5Ati7tH/kb91OETZcDFkAjnd2LdOVPK289HqYz6o47R3SZtuxipJoZDodnxrgdI0wwGXYK2sEndtSTARhjJOrKk5I/PmiWBSa3cTJZZnAazLGpfmTnspQz7YhyS9C9JNtisVGXh9huRCTFU29+G/+NLy01JUvm8Y6T05HvVMxjcKvZ5IO31jwwnGdMCHog4SL2W4mGvCftt6IvtWhKevYiQuA6LUcphhUHJF0zQdR6fYtTGoZJRpP13HUmFf3BIfEIIAXtqPT1fEV1gq9IMWOmnYiUSctCPaTonNy1jaNHKmU6Qe38RxBM9WERMck22kGu5SqMwuzPFHdYw== 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=1hVch0XCiE2krAp+LgNiSjkiKvWWkErE48HgegzjOi8=; b=j0BKiUDGC0tKV2mN1TOP5y8c4RbUzLGCXUCeP1sXGisQC38MKdVMPFmq3B+jw7OGALWkwcAaRrpepdxrYANfPJEiCQheFo4xC60eX2qZ+X19o4BXWoxb0gWSxmodzx4sUF9SCdQSx04cu97ycitAPtPdMiT5vMA6rTvBz7lihK8= 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 BN8PR06MB5889.namprd06.prod.outlook.com (2603:10b6:408:c2::25) by BN8PR06MB5377.namprd06.prod.outlook.com (2603:10b6:408:49::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Mon, 14 Sep 2020 03:16:51 +0000 Received: from BN8PR06MB5889.namprd06.prod.outlook.com ([fe80::d82b:5f42:b7a8:d819]) by BN8PR06MB5889.namprd06.prod.outlook.com ([fe80::d82b:5f42:b7a8:d819%3]) with mapi id 15.20.3370.019; Mon, 14 Sep 2020 03:16:51 +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, Kurt Lee Subject: [PATCH v2 2/3] brcmfmac: set net carrier on via test tool for AP mode Date: Sun, 13 Sep 2020 22:16:33 -0500 Message-Id: <20200914031634.190721-3-wright.feng@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200914031634.190721-1-wright.feng@cypress.com> References: <20200914031634.190721-1-wright.feng@cypress.com> X-ClientProxiedBy: BL1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:208:256::11) To BN8PR06MB5889.namprd06.prod.outlook.com (2603:10b6:408:c2::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote06.aus.cypress.com (157.95.12.33) by BL1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:208:256::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.5 via Frontend Transport; Mon, 14 Sep 2020 03:16:50 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [157.95.12.33] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e1b25bf6-b7b2-43fe-1768-08d8585c9f67 X-MS-TrafficTypeDiagnostic: BN8PR06MB5377: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:660; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DqWlTh1FNAi5HZFgDp+qZUIjrMgxnkjUETLvFHS2smC8DLbwnqmq1AArinUOljDiPAZr54BvZ9T/5b9fyfGKrgeZ98BlW1+Vge/HADhcgBeJjF4WbOv1xOwUjmf1uquX+qwzGUeq1ECfNvySvOWOOOgXYLG8Uspfs9T/SQW3nWMouawS3sEXViMFKO1YaHHwLpbmVMyXbAIe63ly7Q3McddQzBGY8HceCgWnBCS16cD0E/0XMgYknstGsnLbErCdN6/LkECNiRIuat3d/Vny7zg6iQhe8XpSNr2gMe9dHhOciE5FEGlcBBxWepHzqvUzq9IoqKCZB2Np3JwwC2BJLg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR06MB5889.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(346002)(366004)(136003)(396003)(36756003)(26005)(7696005)(52116002)(6916009)(6486002)(66556008)(66476007)(1076003)(86362001)(16526019)(66946007)(186003)(4326008)(8936002)(8676002)(44832011)(2906002)(478600001)(316002)(54906003)(2616005)(956004)(5660300002)(6666004)(107886003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: n+SkSvgKwcDwYujOzA4YfH0l85UwnnGn117vXan8AW55Rlyr/agHvzpJaKqZ91cbjtnZck4bB6pAwTnEPbvCrm801y2gfPGo+EBpoHcbbAK88DXXtm3hx9mrc0p5COQrsA93IRIX5dBwIOGxxG/XYglKEhWlO7z0IGeD1+5j91Qt/ePY0rrurPLIc2dCe8iJApFf7Rqx/uXocjGfVQvhDsO32BfFoT1scA9e0DJ0xzeBboCLfD3uANVr3Caryuaz6Tbq9pWVbasau+Vi6cWwRiJV9S3SQ2sezQb+FgDVzDD34QEOQ6CBa+Bu9+vfmQ1S0POhz8UePjzJfKHMzhQX6zJ2zrKGzUtwXE6bsJVTmSWlFFIbqF+KqVIHj9nJFp/AfX0EnT7fS238vXsTqp/NPPlZDR3K2QbHBI90hvqqzctw9zNAmycqsOPZKoEeHn+YWD6bsO7nJwgzgnylWl9RLnnfbYkOidpgud+EKyJGe7ECdXnS0an04Tc8OIqdLQeshqWn4n+rL/47YjcL4N8WoxAB2BzODUpk/w09cJnuC+HFGYNjTIYYECQwtYOV2McW7LBrrVkKN457rHGdYZOHz8QhhpOCzHj72S3IV3PVOTCg2egqWo+O3rPVl/hNYlEC5gDcpjqEd58AJ+9917n4mw== X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1b25bf6-b7b2-43fe-1768-08d8585c9f67 X-MS-Exchange-CrossTenant-AuthSource: BN8PR06MB5889.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2020 03:16:51.0672 (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: 9S59B54Z8oda0971rIMxR9yf6T/lXRxhMgD9ZLGuNReD/m1Fba+IbdlKEPNSOCZy4sGBsClA3UNITlfW1MKmxg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR06MB5377 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Kurt Lee In manufacturing line, test tool may be used to enable SoftAP. Such SoftAP can't pass traffic because netif carrier is off by default. To allow such use case, let brcmfmac parse ioctl cmd, and then set iftype to ap mode and report netif_carrier_on to upper layer. Signed-off-by: Kurt Lee Signed-off-by: Chi-Hsien Lin --- .../net/wireless/broadcom/brcm80211/brcmfmac/vendor.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c index d07e7c7355d9..5edf5ac1167a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/vendor.c @@ -64,6 +64,15 @@ static int brcmf_cfg80211_vndr_cmds_dcmd_handler(struct wiphy *wiphy, *(char *)(dcmd_buf + len) = '\0'; } + if (cmdhdr->cmd == BRCMF_C_SET_AP) { + if (*(int *)(dcmd_buf) == 1) { + ifp->vif->wdev.iftype = NL80211_IFTYPE_AP; + brcmf_net_setcarrier(ifp, true); + } else { + ifp->vif->wdev.iftype = NL80211_IFTYPE_STATION; + } + } + if (cmdhdr->set) ret = brcmf_fil_cmd_data_set(ifp, cmdhdr->cmd, dcmd_buf, ret_len); From patchwork Mon Sep 14 03:16:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wright Feng X-Patchwork-Id: 11772773 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 7428214F6 for ; Mon, 14 Sep 2020 03:16:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59618208DB for ; Mon, 14 Sep 2020 03:16:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=cypress.com header.i=@cypress.com header.b="nuYpPtAQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725995AbgINDQ4 (ORCPT ); Sun, 13 Sep 2020 23:16:56 -0400 Received: from mail-co1nam11on2096.outbound.protection.outlook.com ([40.107.220.96]:49120 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726003AbgINDQz (ORCPT ); Sun, 13 Sep 2020 23:16:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SaCDH15zw9AI2Drv5r3iJIGVwfAMb2UfgH8W+lIebD3RVHG5zfxnPUwV/bAsYuYkw/l5S2Gau6eunLSsosxsMxeDIZhXtaY+q5hPZF1rAr64e+knKcOhilY+sq4IQ+hy6YTN71i7BVUAU/AcwTIMlPPJ5bEgU6lrHbttql3KE3GKN4mIH1m44iy6KPMOf531PRaVbLwbulOuxsuocSEaIX/25xvdpGU1onWjZpqNBdn+NlDZxx46mLvmEHkrFpWLHlp53+pTAVqvyxE5gLWGaM6CRi8CpWm1s4hx6/UUroNczSWdCETmyY/WrejyBg48fLylAYwoqKKFZd9kZcwMIg== 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=AyV0tIkFg92r0eszQO7pADzNpNv8qFi1MikJNOKfTfk=; b=KhDRFvs2L5qAzacT2iSspbZqRKFr+wOkFZSMZEgqnV+A73/vuaLJaVf0o7cu97qd/Snk7QIt69iJ8r76clLX4A3NH5XnBZoHQl7vA7wJaWuJLUD+ST220DKx6qt+bPW5OCtcqrvC084tuiqq2hXVmYjiKEr3pSdkJlxkX7BZo3ZGL9XBJsmUIKZnF+q6djRoAmOD12wgWVEpS/vycymmNoifjmZtGZPbPI/OeEIAJV9feNSUkspCp0NiNO/L744qv4dPvyHU/mbPo41h+MSI7VE/GRPFXDF6TEdp1fRAtYJJA052ecRaO2uFBCnfIyneylx93G9jv48opxnt+S0qRA== 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=AyV0tIkFg92r0eszQO7pADzNpNv8qFi1MikJNOKfTfk=; b=nuYpPtAQfDaO765xqyYyYX8YJcSvvAHoHPsqnuWjfqeTMJOd4uj73bt8JbASVuOTloh//TOl5OjJBh+PN4LjabJ7gM7RtTJbgBFzP9rlOqr1XzMNcFmVQMkDOckMLqJlANokksnfmGHY3SPnOFWiIO0k/Bn7eoJGPn564Bb89gk= 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 BN8PR06MB5889.namprd06.prod.outlook.com (2603:10b6:408:c2::25) by BN8PR06MB5377.namprd06.prod.outlook.com (2603:10b6:408:49::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.17; Mon, 14 Sep 2020 03:16:53 +0000 Received: from BN8PR06MB5889.namprd06.prod.outlook.com ([fe80::d82b:5f42:b7a8:d819]) by BN8PR06MB5889.namprd06.prod.outlook.com ([fe80::d82b:5f42:b7a8:d819%3]) with mapi id 15.20.3370.019; Mon, 14 Sep 2020 03:16:53 +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, "Double Lo" Subject: [PATCH v2 3/3] brcmfmac: increase dcmd max control buffer size Date: Sun, 13 Sep 2020 22:16:34 -0500 Message-Id: <20200914031634.190721-4-wright.feng@cypress.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200914031634.190721-1-wright.feng@cypress.com> References: <20200914031634.190721-1-wright.feng@cypress.com> X-ClientProxiedBy: BL1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:208:256::11) To BN8PR06MB5889.namprd06.prod.outlook.com (2603:10b6:408:c2::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aremote06.aus.cypress.com (157.95.12.33) by BL1PR13CA0006.namprd13.prod.outlook.com (2603:10b6:208:256::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.5 via Frontend Transport; Mon, 14 Sep 2020 03:16:52 +0000 X-Mailer: git-send-email 2.25.0 X-Originating-IP: [157.95.12.33] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7b9567ab-c11e-40b4-e620-08d8585ca0c8 X-MS-TrafficTypeDiagnostic: BN8PR06MB5377: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3276; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qcwL2RYRWLRgWcJAXv3RSKpuYl5JzvH0Jk7z35q65C82j6iiQ+THNpb5LTBDudgX4FbJXyX96Y5OTC57HrWWojZbmoXyM2nVkgoVmDE0QmTwGAl5waMRpvEr07ykgFjO79vR8uv3qnsCaiIwMkq65NRtEoe7xAKx5XFZBkWHFT1E1zn/ePMBe+AbheS+yYQhuIn4KLQO+WWv5vLKp2QeUaCc5mQ4TIY7WoU0Wy2zMU2lIAxKv/DJGT6+Z6dX4/lMxy0coSFT67cRK9/MqQ+jw0EtMGzmc0gQ/Zl4pMpx8u+Qba1llS/sn95KPf0l6Oy65DVGJ6PIXv7QhyL3D7edlg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR06MB5889.namprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(346002)(366004)(136003)(396003)(36756003)(26005)(7696005)(52116002)(6916009)(6486002)(66556008)(66476007)(1076003)(83380400001)(86362001)(16526019)(66946007)(186003)(4326008)(8936002)(8676002)(44832011)(2906002)(478600001)(316002)(54906003)(2616005)(956004)(5660300002)(6666004)(107886003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Iohbnh8kV47r3K1zPLQzGstoZeznEOsAFqNFa4BaTc1jMyqYCtBnPNI82Fvx+XEK+jX9e57C9Lnrj3yEzA6RLNAzAuWq6MlQPpoYyx1va6Dl3QCZAiA6pTKrBEOMJ9b8oQFv5BQq1Hac7sNLnjuvDSyeE5icXm0fhsZ1EGzgIbkMncO1/Nxu2dUH4yMYSeS743UwNSTgFjwhHfMWRoIZCHAoWEFt2XwkIiKja98yBd4CI1EtAgnVdFTCz9EZYVLYWLz+179xADGIwIHxfYmVOdeewBe54eFBoWn5Y7ejFTRjvXMRwGXdo7z0Uzk28f86jnC56Pva1p3TeaLa0cEeSdxQNjjeqd1SLijKjgDn/NhuJJYwlxGmePgmNnbjtrGBdutiTwC/xjK1GrdXMH+oRPClPjh4TcsF9X4W4FOacfS3lBoJr1kS7WRz9LlZX9RsdfuyJ3WmLuPIHWmGbiEZ+uz4LXkkdl2SYtndrdejyX2BQzykPFljgDw6ds1hcUV314KWfl6VI38ZbyJPX1tfVbujFwIXFRZIcbpZq6e5a2O0DffI1lRAwY93VMbQOmSYaRCFVcEGxufYL8KdxFIt1ANPvMAtL+hYr4V4BP1IIJet6X4X0tWkqchymszdqxhq3DtsGD/b7NgjW5Dqv59xXQ== X-OriginatorOrg: cypress.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7b9567ab-c11e-40b4-e620-08d8585ca0c8 X-MS-Exchange-CrossTenant-AuthSource: BN8PR06MB5889.namprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2020 03:16:53.4009 (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: p9M93x2q7Gm1f4fhOaIWOMsB+5g/eF1gyQO90i5fqfwidMTrHAf4M6p+V1CaXCGR6xkwMX9GZoOW0NUKmxABdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR06MB5377 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: "Double Lo" Add the padding round up value in the max control buffer size to match firmware configuration for new chips. Signed-off-by: Double Lo Signed-off-by: Chi-Hsien Lin --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c index 2c95a08a5871..705130cf27d5 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c @@ -87,6 +87,8 @@ struct brcmf_proto_bcdc_header { * plus any space that might be needed * for bus alignment padding. */ +#define ROUND_UP_MARGIN 2048 + struct brcmf_bcdc { u16 reqid; u8 bus_header[BUS_HEADER_LEN]; @@ -471,7 +473,7 @@ int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES; drvr->bus_if->maxctl = BRCMF_DCMD_MAXLEN + - sizeof(struct brcmf_proto_bcdc_dcmd); + sizeof(struct brcmf_proto_bcdc_dcmd) + ROUND_UP_MARGIN; return 0; fail: