Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Oct 2011 10:52:21 -0400
From:      Arnaud Lacombe <lacombar@gmail.com>
To:        Gary Palmer <gpalmer@freebsd.org>
Cc:        freebsd-net@freebsd.org, Chuck Burns <break19@gmail.com>
Subject:   Re: [urtw] Wifi link dying randomly. reboot required to reconnect.
Message-ID:  <CACqU3MWV85GrivsZyv38XE3ye4aUYvvy-%2BLfC0vrOQ6jM_M0JA@mail.gmail.com>
In-Reply-To: <20111005130936.GB38162@in-addr.com>
References:  <201110042008.48915.break19@gmail.com> <CACqU3MWJt2YX82cW9eJACJ-ALQCoTnaErnCZUWTz5EnYJKHY=w@mail.gmail.com> <201110042054.33599.break19@gmail.com> <201110042132.52788.break19@gmail.com> <20111005130936.GB38162@in-addr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Wed, Oct 5, 2011 at 9:09 AM, Gary Palmer <gpalmer@freebsd.org> wrote:
> On Tue, Oct 04, 2011 at 09:32:52PM -0500, Chuck Burns wrote:
>> On Tuesday, October 04, 2011 8:54:33 PM Chuck Burns wrote:
>> <snip>
>> > I'm not sure how to rebuild just the module with that option URTW_DEBUG
>> > enabled.. I'm being told by some to just add the device to my kernel config
>> > along with the line "option URTW_DEBUG" .. but if there's a better way, let
>> > me know please.
>> >
>> > Also, I suppose that means if I want the "any" I sysctl
>> > hw.usb.urtw.debug=0xffffffff right? Still a bit green with regards to
>> > debugging.
>>
>> I wound up adding "#define URTW_DEBUG" to the top of the if_urtw.c file and
>> make install'ing the module from the proper subdirectory..
>
> Just wanted to make sure that you unloaded and reloaded the module after
> the "make install"?
>
actually, it is more tricky than that.

The sysctl `hw.usb.urtw.debug' only exist when URTW_DEBUG is defined,
but the backing variable, `urtw_debug' is only used during attach to
initialize `sc->sc_debug'. So setting the sysctl afterward is useless,
the only real possibility is either to use the tunable, or directly
use the sysctl's variable in DPRINTF():

diff --git a/sys/dev/usb/wlan/if_urtw.c b/sys/dev/usb/wlan/if_urtw.c
index 6ae7e16..af8cd79 100644
--- a/sys/dev/usb/wlan/if_urtw.c
+++ b/sys/dev/usb/wlan/if_urtw.c
@@ -80,7 +80,7 @@ enum {
        URTW_DEBUG_ANY          = 0xffffffff
 };
 #define        DPRINTF(sc, m, fmt, ...) do {           \
-       if (sc->sc_debug & (m))                         \
+       if (urtw_debug & (m))                           \
                printf(fmt, __VA_ARGS__);               \
 } while (0)

 - Arnaud

> Gary
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACqU3MWV85GrivsZyv38XE3ye4aUYvvy-%2BLfC0vrOQ6jM_M0JA>