quiet hostap by default
Tim Gardner
tim.gardner at canonical.com
Fri Mar 9 19:51:07 UTC 2007
I like it 'cause now debug is dynamic.
rtg
Kyle McMartin wrote:
> it's a really annoying driver... lots of console spew making
> it hard to get a good dmesg trace.
>
> diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
> index b6a02a0..6eb8d88 100644
> --- a/drivers/net/wireless/hostap/hostap_info.c
> +++ b/drivers/net/wireless/hostap/hostap_info.c
> @@ -96,7 +96,6 @@ static void prism2_info_commtallies(local_info_t *local, unsigned char *buf,
>
>
> #ifndef PRISM2_NO_STATION_MODES
> -#ifndef PRISM2_NO_DEBUG
> static const char* hfa384x_linkstatus_str(u16 linkstatus)
> {
> switch (linkstatus) {
> @@ -116,7 +115,6 @@ static const char* hfa384x_linkstatus_str(u16 linkstatus)
> return "Unknown";
> }
> }
> -#endif /* PRISM2_NO_DEBUG */
>
>
> /* Called only as a tasklet (software IRQ) */
> @@ -362,9 +360,7 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb)
> struct hfa384x_info_frame *info;
> unsigned char *buf;
> int left;
> -#ifndef PRISM2_NO_DEBUG
> int i;
> -#endif /* PRISM2_NO_DEBUG */
>
> info = (struct hfa384x_info_frame *) skb->data;
> buf = skb->data + sizeof(*info);
> @@ -389,16 +385,16 @@ void hostap_info_process(local_info_t *local, struct sk_buff *skb)
> break;
> #endif /* PRISM2_NO_STATION_MODES */
>
> -#ifndef PRISM2_NO_DEBUG
> default:
> - PDEBUG(DEBUG_EXTRA, "%s: INFO - len=%d type=0x%04x\n",
> - local->dev->name, info->len, info->type);
> - PDEBUG(DEBUG_EXTRA, "Unknown info frame:");
> - for (i = 0; i < (left < 100 ? left : 100); i++)
> - PDEBUG2(DEBUG_EXTRA, " %02x", buf[i]);
> - PDEBUG2(DEBUG_EXTRA, "\n");
> + if (hostap_debug) {
> + PDEBUG(DEBUG_EXTRA, "%s: INFO - len=%d type=0x%04x\n",
> + local->dev->name, info->len, info->type);
> + PDEBUG(DEBUG_EXTRA, "Unknown info frame:");
> + for (i = 0; i < (left < 100 ? left : 100); i++)
> + PDEBUG2(DEBUG_EXTRA, " %02x", buf[i]);
> + PDEBUG2(DEBUG_EXTRA, "\n");
> + }
> break;
> -#endif /* PRISM2_NO_DEBUG */
> }
> }
>
> diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
> index 9077e6e..2015ab3 100644
> --- a/drivers/net/wireless/hostap/hostap_main.c
> +++ b/drivers/net/wireless/hostap/hostap_main.c
> @@ -46,6 +46,14 @@ MODULE_VERSION(PRISM2_VERSION);
> /* FIX: */
> #define PRISM2_MAX_MTU (PRISM2_MAX_FRAME_SIZE - (6 /* LLC */ + 8 /* WEP */))
>
> +unsigned int hostap_debug = 0;
> +module_param(hostap_debug, uint, 0644);
> +MODULE_PARM_DESC(hostap_debug, "Enable verbose debugging output");
> +EXPORT_SYMBOL(hostap_debug);
> +
> +unsigned int hostap_debug_mask = DEBUG_MASK;
> +module_param(hostap_debug_mask, uint, 0644);
> +EXPORT_SYMBOL(hostap_debug_mask);
>
> struct net_device * hostap_add_interface(struct local_info *local,
> int type, int rtnl_locked,
> diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
> index 87a54aa..e318f26 100644
> --- a/drivers/net/wireless/hostap/hostap_wlan.h
> +++ b/drivers/net/wireless/hostap/hostap_wlan.h
> @@ -923,8 +923,6 @@ struct hostap_skb_tx_data {
> };
>
>
> -#ifndef PRISM2_NO_DEBUG
> -
> #define DEBUG_FID BIT(0)
> #define DEBUG_PS BIT(1)
> #define DEBUG_FLOW BIT(2)
> @@ -935,16 +933,12 @@ struct hostap_skb_tx_data {
> #define DEBUG_PS2 BIT(7)
> #define DEBUG_MASK (DEBUG_PS | DEBUG_AP | DEBUG_HW | DEBUG_EXTRA)
> #define PDEBUG(n, args...) \
> -do { if ((n) & DEBUG_MASK) printk(KERN_DEBUG args); } while (0)
> +do { if (hostap_debug && ((n) & hostap_debug_mask)) printk(KERN_DEBUG args); } while (0)
> #define PDEBUG2(n, args...) \
> -do { if ((n) & DEBUG_MASK) printk(args); } while (0)
> -
> -#else /* PRISM2_NO_DEBUG */
> -
> -#define PDEBUG(n, args...)
> -#define PDEBUG2(n, args...)
> +do { if (hostap_debug && ((n) & hostap_debug_mask)) printk(args); } while (0)
>
> -#endif /* PRISM2_NO_DEBUG */
> +extern unsigned int hostap_debug;
> +extern unsigned int hostap_debug_mask;
>
> enum { BAP0 = 0, BAP1 = 1 };
>
>
More information about the kernel-team
mailing list