[PATCH] libertas: tune debug code

Dan Williams dcbw at redhat.com
Sat Mar 17 00:56:41 EDT 2007


On Sat, 2007-02-24 at 17:07 +0100, Holger Schurig wrote:
> * renamed module parameter back to libertas_debug
> * change from bit shifts to constants, that way it's easier to look at the
>   source and specify the libertas_debug=0xXXXX module parameter
> * moved module_param from fw.c to main.c, where it belongs better

Applied.

> Signed-off-by: Holger Schurig <hs4233 at mail.mn-solutions.de>
> ---
>  drivers/net/wireless/libertas/defs.h |   52 +++++++++++++++++-----------------
>  drivers/net/wireless/libertas/fw.c   |    7 ----
>  drivers/net/wireless/libertas/main.c |    8 +++++
>  3 files changed, 34 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h
> index 96f15c1..7b0a544 100644
> --- a/drivers/net/wireless/libertas/defs.h
> +++ b/drivers/net/wireless/libertas/defs.h
> @@ -11,34 +11,34 @@
>  #define DRV_NAME "usb8xxx"
>  
> 
> -#define LBS_DEB_ENTER	(1<<0)
> -#define LBS_DEB_LEAVE	(1<<1)
> -#define LBS_DEB_MAIN	(1<<2)
> -#define LBS_DEB_NET	(1<<3)
> -#define LBS_DEB_MESH	(1<<4)
> -#define LBS_DEB_WEXT	(1<<5)
> -#define LBS_DEB_IOCTL	(1<<6)
> -#define LBS_DEB_SCAN	(1<<7)
> -#define LBS_DEB_ASSOC	(1<<8)
> -#define LBS_DEB_JOIN	(1<<9)
> -#define LBS_DEB_11D	(1<<10)
> -#define LBS_DEB_DEBUGFS	(1<<11)
> -#define LBS_DEB_ETHTOOL	(1<<12)
> -#define LBS_DEB_HOST	(1<<13)
> -#define LBS_DEB_CMD	(1<<14)
> -#define LBS_DEB_RX	(1<<15)
> -#define LBS_DEB_TX	(1<<16)
> -#define LBS_DEB_FW	(1<<17)
> -#define LBS_DEB_USB	(1<<18)
> -#define LBS_DEB_CS	(1<<19)
> -#define LBS_DEB_THREAD	(1<<20)
> -#define LBS_DEB_HEX	(1<<21)
> -
> -extern unsigned int libertas_debug_flags;
> +#define LBS_DEB_ENTER	0x00000001
> +#define LBS_DEB_LEAVE	0x00000002
> +#define LBS_DEB_MAIN	0x00000004
> +#define LBS_DEB_NET	0x00000008
> +#define LBS_DEB_MESH	0x00000010
> +#define LBS_DEB_WEXT	0x00000020
> +#define LBS_DEB_IOCTL	0x00000040
> +#define LBS_DEB_SCAN	0x00000080
> +#define LBS_DEB_ASSOC	0x00000100
> +#define LBS_DEB_JOIN	0x00000200
> +#define LBS_DEB_11D	0x00000400
> +#define LBS_DEB_DEBUGFS	0x00000800
> +#define LBS_DEB_ETHTOOL	0x00001000
> +#define LBS_DEB_HOST	0x00002000
> +#define LBS_DEB_CMD	0x00004000
> +#define LBS_DEB_RX	0x00008000
> +#define LBS_DEB_TX	0x00010000
> +#define LBS_DEB_USB	0x00020000
> +#define LBS_DEB_CS	0x00040000
> +#define LBS_DEB_FW	0x00080000
> +#define LBS_DEB_THREAD	0x00100000
> +#define LBS_DEB_HEX	0x00200000
> +
> +extern unsigned int libertas_debug;
>  
>  #ifdef DEBUG
>  #define LBS_DEB_LL(grp, fmt, args...) \
> -do { if ((libertas_debug_flags & (grp)) == (grp)) \
> +do { if ((libertas_debug & (grp)) == (grp)) \
>    printk(KERN_DEBUG DRV_NAME "%s: " fmt, \
>           in_interrupt() ? " (INT)" : "", ## args); } while (0)
>  #else
> @@ -88,7 +88,7 @@ static inline void lbs_dbg_hex(char *prompt, u8 * buf, int len)
>  {
>  	int i = 0;
>  
> -	if (!(libertas_debug_flags & LBS_DEB_HEX))
> +	if (!(libertas_debug & LBS_DEB_HEX))
>  		return;
>  
>  	printk(KERN_DEBUG "%s: ", prompt);
> diff --git a/drivers/net/wireless/libertas/fw.c b/drivers/net/wireless/libertas/fw.c
> index 16e51cb..94b3d8e 100644
> --- a/drivers/net/wireless/libertas/fw.c
> +++ b/drivers/net/wireless/libertas/fw.c
> @@ -1,12 +1,8 @@
>  /** 
>    * This file contains the initialization for FW and HW 
>    */
> -#include <linux/module.h>
>  #include <linux/moduleparam.h>
> -
> -#include <linux/vmalloc.h>
>  #include <linux/firmware.h>
> -#include <linux/version.h>
>  
>  #include "host.h"
>  #include "sbi.h"
> @@ -20,9 +16,6 @@
>  char *libertas_fw_name = NULL;
>  module_param_named(fw_name, libertas_fw_name, charp, 0644);
>  
> -unsigned int libertas_debug_flags = 0;
> -module_param_named(debug, libertas_debug_flags, int, 0);
> -
>  /**
>   *  @brief This function checks the validity of Boot2/FW image.
>   *
> diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
> index 534137b..ec71200 100644
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -4,6 +4,7 @@
>    * thread etc..
>    */
>  
> +#include <linux/moduleparam.h>
>  #include <linux/delay.h>
>  #include <linux/freezer.h>
>  #include <linux/etherdevice.h>
> @@ -22,6 +23,13 @@
>  #include "debugfs.h"
>  #include "assoc.h"
>  
> +
> +/* Module parameters */
> +unsigned int libertas_debug = 0;
> +module_param(libertas_debug, int, 0644);
> +
> +
> +
>  #define WLAN_TX_PWR_DEFAULT		20	/*100mW */
>  #define WLAN_TX_PWR_US_DEFAULT		20	/*100mW */
>  #define WLAN_TX_PWR_JP_DEFAULT		16	/*50mW */




More information about the libertas-dev mailing list