From patchwork Thu Feb 2 12:16:54 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: 9551733 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 7A37A604E1 for ; Thu, 2 Feb 2017 12:17:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71BC4280CF for ; Thu, 2 Feb 2017 12:17:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 669BF28425; Thu, 2 Feb 2017 12:17:32 +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 7E4C32815E for ; Thu, 2 Feb 2017 12:17:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbdBBMRT (ORCPT ); Thu, 2 Feb 2017 07:17:19 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:33269 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdBBMRS (ORCPT ); Thu, 2 Feb 2017 07:17:18 -0500 Received: by mail-lf0-f65.google.com with SMTP id x1so1239079lff.0 for ; Thu, 02 Feb 2017 04:17:17 -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=qm+kLp0De8L7afLOYDwi/SBI2rqieL+7jbqk5IUnaXI=; b=ZSkEB2s+PrOdWFWmi/xKyLoYDfHjMsbkunRZ8fZTeT1S3d3adoc9NKz1uTzmlCr7JZ UZzeMWXpD2Trs2GRHj1cAwhaLYS6HM4m8dSRbPEZmScwEdRbokMWGpZ7H0XMJ+da3b3B Z7cwnjhlo5yWjUxqtGvurRUFIFMAs4lajIKJkL/N5lEmeZOZ7scr83HxxCZG5Li2PovM W7/fQvYvDHDYhz4c7as9WFZBFM1a9biR96CT9hcm1NGH0ZPVjN36MPCVzaHa9/5L2YY9 20xPds5XG2gM+4GgAGSiKiUSzS7Bbtr4UzWg5NcLY10JITSUl4z/fynTM9/OXPwSWxET eBPw== 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=qm+kLp0De8L7afLOYDwi/SBI2rqieL+7jbqk5IUnaXI=; b=mS9JmprpIrbpmtrWY3fnIzs0TqckfSclt8rn/nkpj9icy2kDGp+ztIrz6X5QmVD323 DcH7zt2yJDPh2RHKY4olL0QQWwn6Yugqxk31ZSazl4Hsb0gI9CdLEGDzaemDkMJkNbca a4mVDXbtSuSAbro73o0IymSokH+LX3+/QvXSL2O8vXcM8DrVkgxoxc2OaIslLDigFex7 0/BoYzgmWYRTvR7fZeyohV8QoP79iEtcePbAFyFKk2C0LVBklHSL/sJ7Dq/byhMNXi16 ToUsDcSx4PK44JgPCXim754h9sDWvH36Ye33kRnCEmiSmXH+jlv9nekbrcFSb386VcRt VSfQ== X-Gm-Message-State: AIkVDXIEwWqGivh9/dMY7wyq+vu6X89tJWStv4vyHof1HYAgt1V6QPqJVz6eYKYeiCiVzA== X-Received: by 10.25.139.131 with SMTP id n125mr3069603lfd.20.1486037836576; Thu, 02 Feb 2017 04:17:16 -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 t10sm2878398lja.48.2017.02.02.04.17.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Feb 2017 04:17:16 -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 V2 2/7] brcmfmac: add struct brcmf_pub parameter to the __brcmf_err Date: Thu, 2 Feb 2017 13:16:54 +0100 Message-Id: <20170202121659.21130-2-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170202121659.21130-1-zajec5@gmail.com> References: <20170202121659.21130-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 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,