Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134268
b: refs/heads/master
c: 060210f
h: refs/heads/master
v: v3
  • Loading branch information
Michael Buesch authored and John W. Linville committed Jan 29, 2009
1 parent a327a67 commit bcc1b2e
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08e87a833f5e77ff33b64c9ac27cb7fb9ecd4a48
refs/heads/master: 060210f938d8aa0b9d795588a2274cd67ba9d6a4
14 changes: 11 additions & 3 deletions trunk/drivers/net/wireless/b43/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,18 @@ config B43_DEBUG
bool "Broadcom 43xx debugging"
depends on B43
---help---
Broadcom 43xx debugging messages.
Broadcom 43xx debugging.

Say Y, if you want to find out why the driver does not
work for you.
This adds additional runtime sanity checks and statistics to the driver.
These checks and statistics might me expensive and hurt runtime performance
of your system.
This also adds the b43 debugfs interface.

Do not enable this, unless you are debugging the driver.

Say N, if you are a distributor or user building a release kernel
for production use.
Only say Y, if you are debugging a problem in the b43 driver sourcecode.

config B43_FORCE_PIO
bool "Force usage of PIO instead of DMA"
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/net/wireless/b43/b43.h
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,9 @@ void b43err(struct b43_wl *wl, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
void b43warn(struct b43_wl *wl, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
#if B43_DEBUG
void b43dbg(struct b43_wl *wl, const char *fmt, ...)
__attribute__ ((format(printf, 2, 3)));
#else /* DEBUG */
# define b43dbg(wl, fmt...) do { /* nothing */ } while (0)
#endif /* DEBUG */


/* A WARN_ON variant that vanishes when b43 debugging is disabled.
* This _also_ evaluates the arg with debugging disabled. */
Expand Down
13 changes: 11 additions & 2 deletions trunk/drivers/net/wireless/b43/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,18 @@ B43_DEBUGFS_FOPS(restart, NULL, restart_write_file, 1);
B43_DEBUGFS_FOPS(loctls, loctls_read_file, NULL, 0);


int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
{
return !!(dev->dfsentry && dev->dfsentry->dyn_debug[feature]);
bool enabled;

enabled = (dev->dfsentry && dev->dfsentry->dyn_debug[feature]);
if (unlikely(enabled)) {
/* Force full debugging messages, if the user enabled
* some dynamic debugging feature. */
b43_modparam_verbose = B43_VERBOSITY_MAX;
}

return enabled;
}

static void b43_remove_dynamic_debug(struct b43_wldev *dev)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/b43/debugfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ struct b43_dfsentry {
struct dentry *dyn_debug_dentries[__B43_NR_DYNDBG];
};

int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);
bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature);

void b43_debugfs_init(void);
void b43_debugfs_exit(void);
Expand All @@ -82,7 +82,7 @@ void b43_debugfs_log_txstat(struct b43_wldev *dev,

#else /* CONFIG_B43_DEBUG */

static inline int b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
static inline bool b43_debug(struct b43_wldev *dev, enum b43_dyndbg feature)
{
return 0;
}
Expand Down
25 changes: 17 additions & 8 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Copyright (c) 2005 Martin Langer <martin-langer@gmx.de>
Copyright (c) 2005 Stefano Brivio <stefano.brivio@polimi.it>
Copyright (c) 2005, 2006 Michael Buesch <mb@bu3sch.de>
Copyright (c) 2005-2009 Michael Buesch <mb@bu3sch.de>
Copyright (c) 2005 Danny van Dyk <kugelfang@gentoo.org>
Copyright (c) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch>
Expand Down Expand Up @@ -88,6 +88,10 @@ static int modparam_btcoex = 1;
module_param_named(btcoex, modparam_btcoex, int, 0444);
MODULE_PARM_DESC(btcoex, "Enable Bluetooth coexistance (default on)");

int b43_modparam_verbose = B43_VERBOSITY_DEFAULT;
module_param_named(verbose, b43_modparam_verbose, int, 0644);
MODULE_PARM_DESC(verbose, "Log message verbosity: 0=error, 1=warn, 2=info(default), 3=debug");


static const struct ssb_device_id b43_ssb_tbl[] = {
SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, 5),
Expand Down Expand Up @@ -300,6 +304,8 @@ void b43info(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;

if (b43_modparam_verbose < B43_VERBOSITY_INFO)
return;
if (!b43_ratelimit(wl))
return;
va_start(args, fmt);
Expand All @@ -313,6 +319,8 @@ void b43err(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;

if (b43_modparam_verbose < B43_VERBOSITY_ERROR)
return;
if (!b43_ratelimit(wl))
return;
va_start(args, fmt);
Expand All @@ -326,6 +334,8 @@ void b43warn(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;

if (b43_modparam_verbose < B43_VERBOSITY_WARN)
return;
if (!b43_ratelimit(wl))
return;
va_start(args, fmt);
Expand All @@ -335,18 +345,18 @@ void b43warn(struct b43_wl *wl, const char *fmt, ...)
va_end(args);
}

#if B43_DEBUG
void b43dbg(struct b43_wl *wl, const char *fmt, ...)
{
va_list args;

if (b43_modparam_verbose < B43_VERBOSITY_DEBUG)
return;
va_start(args, fmt);
printk(KERN_DEBUG "b43-%s debug: ",
(wl && wl->hw) ? wiphy_name(wl->hw->wiphy) : "wlan");
vprintk(fmt, args);
va_end(args);
}
#endif /* DEBUG */

static void b43_ram_write(struct b43_wldev *dev, u16 offset, u32 val)
{
Expand Down Expand Up @@ -3589,9 +3599,7 @@ static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
u8 algorithm;
u8 index;
int err;
#if B43_DEBUG
static const u8 bcast_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
#endif
static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };

if (modparam_nohwcrypt)
return -ENOSPC; /* User disabled HW-crypto */
Expand Down Expand Up @@ -4744,9 +4752,10 @@ static int b43_wireless_init(struct ssb_device *dev)
INIT_WORK(&wl->txpower_adjust_work, b43_phy_txpower_adjust_work);

ssb_set_devtypedata(dev, wl);
b43info(wl, "Broadcom %04X WLAN found\n", dev->bus->chip_id);
b43info(wl, "Broadcom %04X WLAN found (core revision %u)\n",
dev->bus->chip_id, dev->id.revision);
err = 0;
out:
out:
return err;
}

Expand Down
18 changes: 18 additions & 0 deletions trunk/drivers/net/wireless/b43/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@


extern int b43_modparam_qos;
extern int b43_modparam_verbose;

/* Logmessage verbosity levels. Update the b43_modparam_verbose helptext, if
* you add or remove levels. */
enum b43_verbosity {
B43_VERBOSITY_ERROR,
B43_VERBOSITY_WARN,
B43_VERBOSITY_INFO,
B43_VERBOSITY_DEBUG,
__B43_VERBOSITY_AFTERLAST, /* keep last */

B43_VERBOSITY_MAX = __B43_VERBOSITY_AFTERLAST - 1,
#if B43_DEBUG
B43_VERBOSITY_DEFAULT = B43_VERBOSITY_DEBUG,
#else
B43_VERBOSITY_DEFAULT = B43_VERBOSITY_INFO,
#endif
};


/* Lightweight function to convert a frequency (in Mhz) to a channel number. */
Expand Down

0 comments on commit bcc1b2e

Please sign in to comment.