From patchwork Thu May 7 19:07:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 6360641 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D17EBEEE1 for ; Thu, 7 May 2015 19:08:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3796B20304 for ; Thu, 7 May 2015 19:08:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 30C9920303 for ; Thu, 7 May 2015 19:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751118AbbEGTIH (ORCPT ); Thu, 7 May 2015 15:08:07 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:33181 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750900AbbEGTIE (ORCPT ); Thu, 7 May 2015 15:08:04 -0400 Received: by wgin8 with SMTP id n8so52917186wgi.0 for ; Thu, 07 May 2015 12:08:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=UpWH4KFg7g7rTBbeDyGzmLRkohKcIR/yxANgsbjtm1w=; b=hnEThHRMeEUOSVF0X5lGEtImR42xd8AAUScMF/2hkxjWA/52aeqfgTQX4tBWAxaHvZ fQmmnP/1/20CNbDxhUZ4HwfpcP+o0y4BKO5jUEvzHG1PMETceWe7JkCClpfZZ9af6FPt jm8ne+BKrZrModSdUFrtVFqfb1+2PBMenbcDJXhszh0GK1FuEfTmD9k6W5wEwW39zMwg H0hHL0gbA9CweYPNmIx6+R8Ycv0xrKztSW69wQ9W7itm85nT7Hwki5fKngmaxcOmB1OV fjfacBNCdOHjadxgPkJxYE0zsl5RKuhfmJ+q1mwcbe1BNhHCT3pZwh8QU0czoc4DomGh MqRA== X-Received: by 10.194.61.133 with SMTP id p5mr204978wjr.132.1431025683083; Thu, 07 May 2015 12:08:03 -0700 (PDT) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id ch2sm5348985wib.18.2015.05.07.12.08.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2015 12:08:02 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo , linux-wireless@vger.kernel.org Cc: Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , brcm80211-dev-list@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 1/2] brcmfmac: move strings debugging Broadcom errors to debug.c Date: Thu, 7 May 2015 21:07:40 +0200 Message-Id: <1431025661-8879-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP They are used with CONFIG_BRCMDBG so it makes sense to put them in debug specific file. Also they aren't really specific to fwil.c. Signed-off-by: Rafa? Mi?ecki --- drivers/net/wireless/brcm80211/brcmfmac/debug.c | 64 ++++++++++++++++++++++ drivers/net/wireless/brcm80211/brcmfmac/debug.h | 5 ++ drivers/net/wireless/brcm80211/brcmfmac/fwil.c | 73 +------------------------ 3 files changed, 70 insertions(+), 72 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/debug.c b/drivers/net/wireless/brcm80211/brcmfmac/debug.c index 9b473d5..2d9a1c0 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/debug.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.c @@ -115,3 +115,67 @@ int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, return PTR_ERR_OR_ZERO(dentry); } + +static const char * const brcmf_errstr[] = { + "BCME_OK", + "BCME_ERROR", + "BCME_BADARG", + "BCME_BADOPTION", + "BCME_NOTUP", + "BCME_NOTDOWN", + "BCME_NOTAP", + "BCME_NOTSTA", + "BCME_BADKEYIDX", + "BCME_RADIOOFF", + "BCME_NOTBANDLOCKED", + "BCME_NOCLK", + "BCME_BADRATESET", + "BCME_BADBAND", + "BCME_BUFTOOSHORT", + "BCME_BUFTOOLONG", + "BCME_BUSY", + "BCME_NOTASSOCIATED", + "BCME_BADSSIDLEN", + "BCME_OUTOFRANGECHAN", + "BCME_BADCHAN", + "BCME_BADADDR", + "BCME_NORESOURCE", + "BCME_UNSUPPORTED", + "BCME_BADLEN", + "BCME_NOTREADY", + "BCME_EPERM", + "BCME_NOMEM", + "BCME_ASSOCIATED", + "BCME_RANGE", + "BCME_NOTFOUND", + "BCME_WME_NOT_ENABLED", + "BCME_TSPEC_NOTFOUND", + "BCME_ACM_NOTSUPPORTED", + "BCME_NOT_WME_ASSOCIATION", + "BCME_SDIO_ERROR", + "BCME_DONGLE_DOWN", + "BCME_VERSION", + "BCME_TXFAIL", + "BCME_RXFAIL", + "BCME_NODEVICE", + "BCME_NMODE_DISABLED", + "BCME_NONRESIDENT", + "BCME_SCANREJECT", + "BCME_USAGE_ERROR", + "BCME_IOCTL_ERROR", + "BCME_SERIAL_PORT_ERR", + "BCME_DISABLED", + "BCME_DECERR", + "BCME_ENCERR", + "BCME_MICERR", + "BCME_REPLAY", + "BCME_IE_NOTFOUND", +}; + +const char *brcmf_get_errstr(u32 err) +{ + if (err >= ARRAY_SIZE(brcmf_errstr)) + return "(unknown)"; + + return brcmf_errstr[err]; +} diff --git a/drivers/net/wireless/brcm80211/brcmfmac/debug.h b/drivers/net/wireless/brcm80211/brcmfmac/debug.h index eb0b8c4..d1b2a5c 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/debug.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/debug.h @@ -111,6 +111,7 @@ void brcmf_debugfs_detach(struct brcmf_pub *drvr); struct dentry *brcmf_debugfs_get_devdir(struct brcmf_pub *drvr); int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, int (*read_fn)(struct seq_file *seq, void *data)); +const char *brcmf_get_errstr(u32 err); #else static inline void brcmf_debugfs_init(void) { @@ -131,6 +132,10 @@ int brcmf_debugfs_add_entry(struct brcmf_pub *drvr, const char *fn, { return 0; } +static inline const char *brcmf_get_errstr(u32 err) +{ + return ""; +} #endif #endif /* BRCMFMAC_DEBUG_H */ diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c index dcfa0bb..bdbdc9e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil.c @@ -32,77 +32,6 @@ #define MAX_HEX_DUMP_LEN 64 -#ifdef DEBUG -static const char * const brcmf_fil_errstr[] = { - "BCME_OK", - "BCME_ERROR", - "BCME_BADARG", - "BCME_BADOPTION", - "BCME_NOTUP", - "BCME_NOTDOWN", - "BCME_NOTAP", - "BCME_NOTSTA", - "BCME_BADKEYIDX", - "BCME_RADIOOFF", - "BCME_NOTBANDLOCKED", - "BCME_NOCLK", - "BCME_BADRATESET", - "BCME_BADBAND", - "BCME_BUFTOOSHORT", - "BCME_BUFTOOLONG", - "BCME_BUSY", - "BCME_NOTASSOCIATED", - "BCME_BADSSIDLEN", - "BCME_OUTOFRANGECHAN", - "BCME_BADCHAN", - "BCME_BADADDR", - "BCME_NORESOURCE", - "BCME_UNSUPPORTED", - "BCME_BADLEN", - "BCME_NOTREADY", - "BCME_EPERM", - "BCME_NOMEM", - "BCME_ASSOCIATED", - "BCME_RANGE", - "BCME_NOTFOUND", - "BCME_WME_NOT_ENABLED", - "BCME_TSPEC_NOTFOUND", - "BCME_ACM_NOTSUPPORTED", - "BCME_NOT_WME_ASSOCIATION", - "BCME_SDIO_ERROR", - "BCME_DONGLE_DOWN", - "BCME_VERSION", - "BCME_TXFAIL", - "BCME_RXFAIL", - "BCME_NODEVICE", - "BCME_NMODE_DISABLED", - "BCME_NONRESIDENT", - "BCME_SCANREJECT", - "BCME_USAGE_ERROR", - "BCME_IOCTL_ERROR", - "BCME_SERIAL_PORT_ERR", - "BCME_DISABLED", - "BCME_DECERR", - "BCME_ENCERR", - "BCME_MICERR", - "BCME_REPLAY", - "BCME_IE_NOTFOUND", -}; - -static const char *brcmf_fil_get_errstr(u32 err) -{ - if (err >= ARRAY_SIZE(brcmf_fil_errstr)) - return "(unknown)"; - - return brcmf_fil_errstr[err]; -} -#else -static const char *brcmf_fil_get_errstr(u32 err) -{ - return ""; -} -#endif /* DEBUG */ - static s32 brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set) { @@ -125,7 +54,7 @@ brcmf_fil_cmd_data(struct brcmf_if *ifp, u32 cmd, void *data, u32 len, bool set) return 0; brcmf_dbg(FIL, "Failed: %s (%d)\n", - brcmf_fil_get_errstr((u32)(-err)), err); + brcmf_get_errstr((u32)(-err)), err); return -EBADE; }