From patchwork Thu Feb 2 21:33:16 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: 9553255 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 F361360405 for ; Thu, 2 Feb 2017 21:33:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E676928499 for ; Thu, 2 Feb 2017 21:33:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB0D3284BC; Thu, 2 Feb 2017 21:33:46 +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 7A0CB28499 for ; Thu, 2 Feb 2017 21:33:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751898AbdBBVdo (ORCPT ); Thu, 2 Feb 2017 16:33:44 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:34418 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751867AbdBBVdm (ORCPT ); Thu, 2 Feb 2017 16:33:42 -0500 Received: by mail-lf0-f66.google.com with SMTP id q89so46738lfi.1 for ; Thu, 02 Feb 2017 13:33:41 -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=f+QJS0G85F2sxgNuvm2DraWmoU0qE7E8eJ6tcj44Ih4=; b=ql9z7Ll9xFD93LNA3pRhOpytD5xoD1KLt+JWL9T6QEzO0n1yaFKcvQZ2gH0jm+LLZD rG0qIjHFIkPJyqGSBaKUL8fcfh1ID79HCkzxpGXrKDdtYmoWdIHAgZAYeJ3aSGXNvNTW hJO5U4KVE4aGzXa6WfbfwM8hij7sox6lwbB4Rcic9IFwxam1Idj2vwTwHdvYcLunQiiG ilDcRLwaA3zABzB0ESlzLwBHB+TKg6G6BAJ7H4lc4tGmAC2tz09BAwgHxukT3ucwGxHA Pla6x0bAiliQytTKjHMOjo2tGdYUlxfBfCi2oow1bLVEcslztC0mt4n23fxpba87/wld HuXA== 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=f+QJS0G85F2sxgNuvm2DraWmoU0qE7E8eJ6tcj44Ih4=; b=jghVCDbftTWt+SewEZ7HoCdhT4TyqXMVbL6c8QshKhdcDuG4RR1AQ10b8a6pxI+gHZ G3dyT9vSZRiTGKy21/qfCCnJ/0iBLgyCXtVi6qLYDbWQD7q15PuCaEkHqbhjoCU5R43M x+Jw4McMnDBdwqZKeQvQd0e12m2+hIVE6TKcL5uSeeZGdaLzjLvoNNPi7YV49MUfgBLt y/TlkbroPvBjZoGL2ykVWFdy3drpsJL06NmAdefxEEn0pb116ObVemXN0J4BWx5XAxLn nieRPe3S+XZxgoZlcYhLOK4M+86R0PiF2vEzJ6kKRKY2dTi5RgPy6J5mRxNAC0MY0OJO 67PA== X-Gm-Message-State: AIkVDXLiJIWMF8ssaBab63u4m/imMLM1PGzSv70QMvbb9dC8/hLq8r8gE/+l+ORijEqFLQ== X-Received: by 10.25.4.9 with SMTP id 9mr3362229lfe.45.1486071220574; Thu, 02 Feb 2017 13:33:40 -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 1sm2590003ljv.40.2017.02.02.13.33.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 13:33:39 -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 V3 4/9] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Date: Thu, 2 Feb 2017 22:33:16 +0100 Message-Id: <20170202213321.11591-4-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202213321.11591-1-zajec5@gmail.com> References: <20170202213321.11591-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 --- V2: Add missing include --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h | 2 ++ 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 +++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h index 76693df34742..35d4801a62e6 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h @@ -17,6 +17,8 @@ #ifndef BRCMFMAC_BUS_H #define BRCMFMAC_BUS_H +#include + #include "debug.h" /* IDs of the 6 default common rings of msgbuf protocol */ diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c index 33b133f7e63a..f8ce597c4781 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 066126123e96..99acc095c834 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,8 +47,8 @@ #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, ...); /* Macro for error messages. When debugging / tracing the driver all error * messages are important to us. */ @@ -55,7 +57,7 @@ void __brcmf_err(const char *func, const char *fmt, ...); if (IS_ENABLED(CONFIG_BRCMDBG) || \ IS_ENABLED(CONFIG_BRCM_TRACING) || \ net_ratelimit()) \ - __brcmf_err(__func__, fmt, ##__VA_ARGS__); \ + __brcmf_err(NULL, __func__, fmt, ##__VA_ARGS__);\ } while (0) #if defined(DEBUG) || defined(CONFIG_BRCM_TRACING) @@ -99,7 +101,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,