Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp6036125rwb; Tue, 1 Aug 2023 11:15:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlGsha/6DMn45e7oI8EJFYIMiy8pGWB5t/TOmPhi3p3MKg99NjshePomys/BUpeZC3twuQQv X-Received: by 2002:a17:90a:4f0a:b0:267:717f:2f91 with SMTP id p10-20020a17090a4f0a00b00267717f2f91mr11390501pjh.40.1690913754823; Tue, 01 Aug 2023 11:15:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690913754; cv=none; d=google.com; s=arc-20160816; b=fMykhlT+MJMoRuY1/ZcehQKuRzd3vv6K0wSO/0DjEbK9OeRma3PkazwJcpCrxB5CNK spEx1DvQRTr1lsVJhb4xVs7AMykofjqoweHN3t/BMdHj0gYpbR52VlcjxqQ3DcXxbHGA ggrhCky0ASfGTpcLEpQCl3hyQludI8iRnGp4941H/S1uDhVb0osEQ9pyllokj9lqkfoi tXY8vh6e/EU4vLPNKEm9RnxSa+7yztZhL8aek6OUylaeIYQuibn3ti5UzHdo4VHMSsLn BZXLdxukn/TBSUFq6SubhGT8VyGkOox/Wn77clHs5UMUhXSmo2PuN3bvl07ZBxcSwnY7 OwvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=PXRXTLGrx3Hm3jF4oOlELsrS2Yphh5kofHMOvv0/pss=; fh=Ntxyy1OVAL8rlFSB0ThsYoy9BmX5G4BTLC8EIWo3vAA=; b=S7bymcNUHsFyPikbS7pFD+LIC10yjgetdhgn70XiluxqwDuPmLq53lQBbuUBfeP8wi Gps8dWzhqgYoO6WiWDRxn2TpGcfPrVTL1JsPldQl49LaRaVTXD01kR+/6WP4Z9SdaVim RK3l4w53bBwHytCzUBdL6fX9RH4xuUK0VTBX4CbOmmvwUvjzY8Ed3EBFCkyBYlKYTcMJ V4lCN9KP1bVTbD1l2kI6ky10IePnB9Gr1JHEb7eK0VTzCVqel/PfFO3CV/ecvaed1mC8 0lEsnvf74PH2YoBTj3sM+41qxA4yTPbnM+7427TFPy9bBmLXhYaSKgofsDOEn/YfMa+/ fgKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id il5-20020a17090b164500b00262f937bf93si9679600pjb.77.2023.08.01.11.15.47; Tue, 01 Aug 2023 11:15:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbjHAR6S (ORCPT + 58 others); Tue, 1 Aug 2023 13:58:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233143AbjHAR6I (ORCPT ); Tue, 1 Aug 2023 13:58:08 -0400 Received: from frasgout12.his.huawei.com (unknown [14.137.139.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388A9127; Tue, 1 Aug 2023 10:58:07 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.18.147.229]) by frasgout12.his.huawei.com (SkyGuard) with ESMTP id 4RFjD61Rz8z9ttCx; Wed, 2 Aug 2023 01:44:38 +0800 (CST) Received: from [10.81.206.119] (unknown [10.81.206.119]) by APP1 (Coremail) with SMTP id LxC2BwDHerqKR8lk5+oeAA--.35282S2; Tue, 01 Aug 2023 18:57:44 +0100 (CET) Message-ID: <327159d6-f520-bea1-c6b0-facda7c26699@huaweicloud.com> Date: Tue, 1 Aug 2023 19:57:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/3] wifi: brcm80211: drop struct brcmf_p2p_scan_le Content-Language: en-US From: Petr Tesarik To: Arend van Spriel , Franky Lin , Hante Meuleman , Kalle Valo , Chi-hsien Lin , Ian Lin , Wright Feng , Hector Martin , Prasanna Kerekoppa , Hans de Goede , Ramesh Rangavittal , Linus Walleij , Kees Cook , "Gustavo A. R. Silva" , Ryohei Kondo , Greg Kroah-Hartman , "Jason A. Donenfeld" , "Darrick J. Wong" , Jason Gunthorpe , Brian Henriquez , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , "open list:BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER" , open list Cc: Roberto Sassu , petr@tesarici.cz References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CM-TRANSID: LxC2BwDHerqKR8lk5+oeAA--.35282S2 X-Coremail-Antispam: 1UD129KBjvJXoWxXF13Xr1xZFWrCrWftF4DCFg_yoWrJF4kpF yfXa4qgrnxXw429r4UXa1kArWIv3y2qw1ktFyYvw13KFn8Crn3JFWDKr109rWUC3yfA3yY vF45tF4UZrW2ka7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUU9Y14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j 6r4UJwA2z4x0Y4vEx4A2jsIE14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr 1j6rxdM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj 6xIIjxv20xvE14v26r1Y6r17McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr 0_Gr1lF7xvr2IY64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7M4IIrI8v6xkF7I0E8cxa n2IY04v7MxkF7I0En4kS14v26r4a6rW5MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6Fyj6rWU JwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26F4UJVW0obIYCT nIWIevJa73UjIFyTuYvjTR_KsUDUUUU X-CM-SenderInfo: hshw23xhvd2x3n6k3tpzhluzxrxghudrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L3,RDNS_DYNAMIC,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 8/1/2023 5:36 PM, Petr Tesarik wrote: > From: Petr Tesarik > > The 'S' scan method is not implemented. The type member is always written > as 'E' and never read. Consequently, struct brcmf_p2p_scan_le can be > replaced with struct brcmf_escan_params_le. Seeing that Hans has already fixed the actual issue with the flex array, this whole series is not needed. But maybe this simplification has some value on its own? Petr T > Signed-off-by: Petr Tesarik > --- > .../broadcom/brcm80211/brcmfmac/p2p.c | 38 ++++--------------- > 1 file changed, 8 insertions(+), 30 deletions(-) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c > index d4492d02e4ea..915f95760470 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c > @@ -123,23 +123,6 @@ enum brcmf_p2p_disc_state { > WL_P2P_DISC_ST_SEARCH > }; > > -/** > - * struct brcmf_p2p_scan_le - P2P specific scan request. > - * > - * @type: type of scan method requested (values: 'E' or 'S'). > - * @reserved: reserved (ignored). > - * @eparams: parameters used for type 'E'. > - * @sparams: parameters used for type 'S'. > - */ > -struct brcmf_p2p_scan_le { > - u8 type; > - u8 reserved[3]; > - union { > - struct brcmf_escan_params_le eparams; > - struct brcmf_scan_params_le sparams; > - }; > -}; > - > /** > * struct brcmf_p2p_pub_act_frame - WiFi P2P Public Action Frame > * > @@ -646,14 +629,14 @@ static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans, > { > struct brcmf_pub *drvr = p2p->cfg->pub; > s32 ret = 0; > - s32 memsize = offsetof(struct brcmf_p2p_scan_le, > - eparams.params_le.channel_list); > + s32 memsize = offsetof(struct brcmf_escan_params_le, > + params_le.channel_list); > s32 nprobes; > s32 active; > u32 i; > u8 *memblk; > struct brcmf_cfg80211_vif *vif; > - struct brcmf_p2p_scan_le *p2p_params; > + struct brcmf_escan_params_le *eparams; > struct brcmf_scan_params_le *sparams; > > memsize += num_chans * sizeof(__le16); > @@ -667,8 +650,8 @@ static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans, > ret = -EINVAL; > goto exit; > } > - p2p_params = (struct brcmf_p2p_scan_le *)memblk; > - sparams = &p2p_params->eparams.params_le; > + eparams = (struct brcmf_escan_params_le *)memblk; > + sparams = &eparams->params_le; > > switch (search_state) { > case WL_P2P_DISC_ST_SEARCH: > @@ -698,11 +681,6 @@ static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans, > > brcmf_p2p_set_discover_state(vif->ifp, search_state, 0, 0); > > - /* > - * set p2p scan parameters. > - */ > - p2p_params->type = 'E'; > - > /* determine the scan engine parameters */ > sparams->bss_type = DOT11_BSSTYPE_ANY; > sparams->scan_type = BRCMF_SCANTYPE_ACTIVE; > @@ -747,9 +725,9 @@ static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans, > sparams->channel_list[i] = cpu_to_le16(chanspecs[i]); > > /* set the escan specific parameters */ > - p2p_params->eparams.version = cpu_to_le32(BRCMF_ESCAN_REQ_VERSION); > - p2p_params->eparams.action = cpu_to_le16(WL_ESCAN_ACTION_START); > - p2p_params->eparams.sync_id = cpu_to_le16(0x1234); > + eparams->version = cpu_to_le32(BRCMF_ESCAN_REQ_VERSION); > + eparams->action = cpu_to_le16(WL_ESCAN_ACTION_START); > + eparams->sync_id = cpu_to_le16(0x1234); > /* perform p2p scan on primary device */ > ret = brcmf_fil_bsscfg_data_set(vif->ifp, "p2p_scan", memblk, memsize); > if (!ret)