Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3075514pxk; Mon, 7 Sep 2020 02:24:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxAMFq7TeGqWJiAOo1fmS+pvrkIEWTe1UUeDI/kGpeuj5IBxItGgq4Qi9uvdRFU2rnC2CI X-Received: by 2002:a17:906:813:: with SMTP id e19mr19839466ejd.101.1599470662559; Mon, 07 Sep 2020 02:24:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599470662; cv=none; d=google.com; s=arc-20160816; b=edoe0dDg3TJfwAfVH63crRL7yYUtiwyIZXNfNimR5dhyLukWqR/lGD8Ve4i32Q1tCu JOMGuk6+V1PjvdNtkd8i0D5R0VweO6DGU+CrUhTNEZkLhImoY/Ip8JR3E/wPtxbFj1hh fVnykTqeFWxGsPrVh/R3Ir+Mb5qKYSITa3fxCf5xI6Y6gvAdRJbDy+OdgQn5A3HIhYvb 5SeQ9w+LKvre0S1FUB0t9lHicFWlUgptDdqlZknko8BSTwgwaJjigwZUck4HOGcvkP7b rDWUVSFhhPBFlaoCnQdFVERsIktJ3Li6L2MxVdSTxBdM6HG1Y03qCvmKBtilGkYp6Snq tSqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :message-id:in-reply-to:date:references:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=zP9azvk4fxN3Qs9cNr04R0UZlqPKxewPA+9FEr8D/44=; b=eep5NgLtiGDzSHZjkFxF1y8S1YcVdpo/BaLAV0zLewamHPq+kAntQddKwS9Ol3jqk0 OqMVEtP/wxV8Dw3mw7FcjUpEjNSiawFEVu+IxY78ChC8+b/dGrGntuDnCbZMnfMtffZr c2/F5A8v6SZZrzCIkYL0Ih2/hFCvqvgSwj+qlY86Y+6orSYKGwrmeeN0SFePzqN6BK9M PUq33XYafqmF8LMBc+XvkKJJicPF+2uuikhJYh3yknLR5wumu28v9kuKCYiu3bdV7alS up3DXITxEMA9Z7oUepLM4GVp/8fbI6nuYRp2dd8NRHAtiFVdiUVDmAzp7g2MNXErCnD1 vaaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=OCJ15qBk; dkim=pass header.i=@amazonses.com header.s=hsbnp7p3ensaochzwyq5wwmceodymuwv header.b=N5JXDjpd; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si9057770edq.277.2020.09.07.02.23.58; Mon, 07 Sep 2020 02:24:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=zsmsymrwgfyinv5wlfyidntwsjeeldzt header.b=OCJ15qBk; dkim=pass header.i=@amazonses.com header.s=hsbnp7p3ensaochzwyq5wwmceodymuwv header.b=N5JXDjpd; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728317AbgIGJVd (ORCPT + 99 others); Mon, 7 Sep 2020 05:21:33 -0400 Received: from a27-10.smtp-out.us-west-2.amazonses.com ([54.240.27.10]:49418 "EHLO a27-10.smtp-out.us-west-2.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728141AbgIGJVd (ORCPT ); Mon, 7 Sep 2020 05:21:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=zsmsymrwgfyinv5wlfyidntwsjeeldzt; d=codeaurora.org; t=1599470492; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type; bh=9b5FrUg1iGXJA/9iw+ulM0boM5F0pty0Vwes5WHWREM=; b=OCJ15qBk+EpBxSJqVpPWgq45o+uyNuaamvCVL7tFGQhP/S792+K0TOgwHm45Cgw8 6ooyhAtZi3F07r/Rzr868Sp5gKGlyFPSL7yoEL159A0zIckpRWRRkiFc+8oSFUpH+Ml qUAbS4dMhtiBsru1RiFOFaap6eQwKt+hybNVJJcE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=hsbnp7p3ensaochzwyq5wwmceodymuwv; d=amazonses.com; t=1599470492; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID:MIME-Version:Content-Type:Feedback-ID; bh=9b5FrUg1iGXJA/9iw+ulM0boM5F0pty0Vwes5WHWREM=; b=N5JXDjpde/0IK319bY0jnbobJ8PLeXN+Vk5+VdpIpXu3UAIh4nEt1ZpR0lTBLAI5 aQBrnIzdQXNoTfBPgkHtD+FErOZpEdKxZe5NF0ZKcbi6PcjitbzgISuzn43WJJ2MWmr 2u+ctpPf/id8s+BW3yMDrNXk7Z+/e+H7qm612QRw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B6D42C43463 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Wright Feng Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com, brcm80211-dev-list@cypress.com, Arend van Spriel , Franky Lin , Hante Meuleman , chi-hsien.lin@cypress.com, Ting-Ying Li Subject: Re: [PATCH 4/4] brcmfmac: add a variable for packet forwarding condition References: <20200901063237.15549-1-wright.feng@cypress.com> <20200901063237.15549-5-wright.feng@cypress.com> Date: Mon, 7 Sep 2020 09:21:32 +0000 In-Reply-To: <20200901063237.15549-5-wright.feng@cypress.com> (Wright Feng's message of "Tue, 1 Sep 2020 01:32:37 -0500") Message-ID: <0101017467dedc38-3e3a7b7e-3e16-4eb2-adcf-5b6f502178ac-000000@us-west-2.amazonses.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SES-Outgoing: 2020.09.07-54.240.27.10 Feedback-ID: 1.us-west-2.CZuq2qbDmUIuT3qdvXlRHZZCpfZqZ4GtG9v3VKgRyF0=:AmazonSES Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Wright Feng writes: > From: Ting-Ying Li > > When the "ap_isolate" function is not set by the host, > host-based packet forwarding will be enabled if the packet > forwarding mechanism is not offloaded to the lower layer. > > Signed-off-by: Ting-Ying Li > Signed-off-by: Chi-hsien Lin [...] > + /* Get ap_isolate value from firmware to detemine whether fmac */ > + /* driver supports packet forwarding. */ > + if (brcmf_fil_iovar_int_get(ifp, "ap_isolate", &val) == 0) { > + ifp->fmac_pkt_fwd_en = > + ((params->ap_isolate == 0) && (val == 1)) ? > + true : false; > + } else { > + brcmf_err("get ap_isolate iovar failed: ret=%d\n", ret); > + ifp->fmac_pkt_fwd_en = false; > + } This is hard to read, you can simplify it to: if (brcmf_fil_iovar_int_get(ifp, "ap_isolate", &val) == 0 && params->ap_isolate == 0 && val == 1) { ifp->fmac_pkt_fwd_en = true; } else { brcmf_err("get ap_isolate iovar failed: ret=%d\n", ret); ifp->fmac_pkt_fwd_en = false; } -- https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches