From patchwork Tue Jan 24 15:06:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9535377 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A003960434 for ; Tue, 24 Jan 2017 15:06:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 947DD28343 for ; Tue, 24 Jan 2017 15:06:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 847CD28354; Tue, 24 Jan 2017 15:06:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5696728324 for ; Tue, 24 Jan 2017 15:06:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751223AbdAXPG3 (ORCPT ); Tue, 24 Jan 2017 10:06:29 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:34230 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbdAXPG1 (ORCPT ); Tue, 24 Jan 2017 10:06:27 -0500 Received: by mail-lf0-f65.google.com with SMTP id q89so17773975lfi.1 for ; Tue, 24 Jan 2017 07:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fomVc1fQzOfa323oB6X2JQ2p16seWIAIe++oAY/sMok=; b=IL7j4ySrbKDfVrZhdRrF+BRMwSLZNh66rjmJdXegJXKOvd5yAqQYDtRxQTtm0fm0y4 3W+WZHOSpDHc8UIiL/J2Akc4CLsdJclBq8miW/3lkxPY31AuZ4pZJY9m5ROzJ+K1pmKF MDWL3jnoXm21nqNksWwhdfM4JB728qoBlahMbWTwacAeZa2BrZ78sRL8aXec66o9Cws6 GVWzL7uK6eSFZFsFV53z0hAJofl1QoMoH1QYPVwATm5wsDtZ+RLn1F8NcqST9uu4jnzv dq1reROB4YYxJ/F8GelbEPOhvPfqXBb/Quxfm6hze+DPiJDk8tpLsDBHjqjnVIxHGLak UmOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fomVc1fQzOfa323oB6X2JQ2p16seWIAIe++oAY/sMok=; b=iRlc/mPSh46G3VnVn66ieOYEPv3wRU6erKrGrWF7vzcvdKHdbbaXKcRfn+HbCMBkAo TW90nyetHCLrTpPeXc4qZHV2nWP679RrydiNy1YuXPOkqDaKgnVpehZi8PfYkd0r0I1c afcdADG+gRUiNDC4pNqhtxkG00HSd0bgcrOM6a5gwrNCVULHICh7tKxZVKzjhmyEntbp 317omNSws3IAbyr72mzraYZk1q+sySX0N+61S3m0uBdkdnaprNCorZS3RtArbiQbM8Uq 643vuIh6RT0Gj6uFre2PQeYfQmzz93uwaPKICfy8zlHgVAoW9oa3wZKrF4HtKDQjl3mY 0wdA== X-Gm-Message-State: AIkVDXJeBWR5PgJ/YiJHFXsw3Hc3MTwHFimAegNbcYkCiOamycHvbaNIQ9t+bd7SK5L6AQ== X-Received: by 10.25.16.158 with SMTP id 30mr11066752lfq.119.1485270385694; Tue, 24 Jan 2017 07:06:25 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id 66sm7485352lfy.42.2017.01.24.07.06.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 07:06:24 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 2/6] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Date: Tue, 24 Jan 2017 16:06:08 +0100 Message-Id: <20170124150612.25138-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170124150612.25138-1-zajec5@gmail.com> References: <20170124150612.25138-1-zajec5@gmail.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafał Miłecki This will allow getting struct device reference from the passed brcmf_pub for the needs of dev_err. More detailed messages are really important for home routers which frequently have 2 (or even 3) wireless cards supported by brcmfmac. Note that all calls are yet to be updated as for now brcmf_err macro always passes NULL. This will be handled in following patch to make this change easier to review. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h | 9 +++++---- drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 05fb778ddd0f..0978fb4c9066 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -219,7 +219,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) } #ifndef CONFIG_BRCM_TRACING -void __brcmf_err(const char *func, const char *fmt, ...) +void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...) { struct va_format vaf; va_list args; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h index 5fef79473c87..012401e6be74 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/debug.h @@ -19,6 +19,8 @@ #include /* net_ratelimit() */ +struct brcmf_pub; + /* message levels */ #define BRCMF_TRACE_VAL 0x00000002 #define BRCMF_INFO_VAL 0x00000004 @@ -45,10 +47,10 @@ #undef pr_fmt #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -__printf(2, 3) -void __brcmf_err(const char *func, const char *fmt, ...); +__printf(3, 4) +void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...); #define brcmf_err(fmt, ...) \ - __brcmf_err(__func__, fmt, ##__VA_ARGS__) + __brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__) #if defined(DEBUG) || defined(CONFIG_BRCM_TRACING) __printf(3, 4) @@ -91,7 +93,6 @@ do { \ extern int brcmf_msg_level; -struct brcmf_pub; #ifdef DEBUG void brcmf_debugfs_init(void); void brcmf_debugfs_exit(void); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c index fe6755944b7b..329cb65eb78b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c @@ -18,10 +18,12 @@ #ifndef __CHECKER__ #define CREATE_TRACE_POINTS +#include "bus.h" +#include "core.h" #include "tracepoint.h" #include "debug.h" -void __brcmf_err(const char *func, const char *fmt, ...) +void __brcmf_err(struct brcmf_pub *pub, const char *func, const char *fmt, ...) { struct va_format vaf = { .fmt = fmt,