Short version: Is there any chance to get iwn working on 7.1-RC1 reliably? I have got one problem with the initial perforce version and the backport from gavin always crashes. Long version:

I have been using the initial perforce version of iwn on 7-STABLE for a few month now, since the next version is already "vap'ify iwn". Usually, the connection to my WPA2 ap is established on boot, but pretty often I get an error instead:

iwn0: error, INTR=82000000<SW_ERROR,RX_INTR> STATUS=0x10000
iwn0: iwn_config: could not set power mode, error 35

Doing one or two "kldunload if_iwn" fixes the problem.

Rarely, I had crashes (on boot).

Today, I found that gavin did a backport of iwn in September: http://lists.freebsd.org/pipermail/freebsd-stable/2008-September/045234.html

As it had some changes compared to the initial perforce version, I tried that version instead. I always get a crash on boot:

[...]
iwn0: iwn_read_eeprom_ht40: no entry for channel 10
iwn0: iwn_read_eeprom_ht40: no entry for channel 11
iwn0: iwn_read_eeprom_ht40: no entry for channel 12
iwn0: iwn_read_eeprom_ht40: no entry for channel 13


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0xc5bb5004
fault code              = supervisor read, page not present
instruction pointer     = 0x20:0xc1543935
stack pointer           = 0x28:0xc18207f8
frame pointer           = 0x28:0xc1820858
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processsor eflags       = interrupt enabled, resume, IOPL = 0
current process         = 0 (swapper)
trap number             = 12
panic: page fault
cpuid = 0
Uptime: 1s
Automatic reboot in 15 seconds - press a key on the console to abort

I do not remember, if the crash is the same as I had with the initial perforce version, which I cannot reproduce.

Does anyone have a better version of iwn without vap? Does anyone know which current / perforce change could address the error mentioned above?

There are only a few differences between the initial perforce version and the backport by gavin (besides man page). I will attach them below.

Cheers,
Jan Henrik


diff -u perforce/sys/dev/iwn/if_iwn.c gavin/sys/dev/iwn/if_iwn.c --- perforce/sys/dev/iwn/if_iwn.c 2008-12-19 15:19:14.000000000 +0100 +++ gavin/sys/dev/iwn/if_iwn.c 2008-12-19 15:16:57.000000000 +0100 @@ -124,6 +124,7 @@ void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *); void iwn_tx_intr(struct iwn_softc *, struct iwn_rx_desc *); void iwn_cmd_intr(struct iwn_softc *, struct iwn_rx_desc *); +static void iwn_bmiss(void *, int); void iwn_notif_intr(struct iwn_softc *); void iwn_intr(void *); void iwn_read_eeprom(struct iwn_softc *); @@ -292,7 +293,8 @@ taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", device_get_nameunit(dev));


- TASK_INIT(&sc->sc_opstask, 0, iwn_ops, sc ); + TASK_INIT(&sc->sc_ops_task, 0, iwn_ops, sc ); + TASK_INIT(&sc->sc_bmiss_task, 0, iwn_bmiss, sc );


/* * Put adapter into a known state. @@ -379,6 +381,8 @@ #endif | IEEE80211_C_WME /* WME */ ; +#if 0 + /* XXX disable until HT channel setup works */ ic->ic_htcaps = IEEE80211_HTCAP_SMPS_ENA /* SM PS mode enabled */ | IEEE80211_HTCAP_CHWIDTH40 /* 40MHz channel width */ @@ -391,7 +395,7 @@ | IEEE80211_HTC_AMPDU /* tx A-MPDU */ | IEEE80211_HTC_AMSDU /* tx A-MSDU */ ; - +#endif /* read supported channels and MAC address from EEPROM */ iwn_read_eeprom(sc);


@@ -1594,6 +1598,15 @@ wakeup(&ring->cmd[desc->idx]); }


+static void +iwn_bmiss(void *arg, int npending) +{ + struct iwn_softc *sc = arg; + struct ieee80211com *ic = sc->sc_ifp->if_l2com; + + ieee80211_beacon_miss(ic); +} + void iwn_notif_intr(struct iwn_softc *sc) { @@ -1652,7 +1665,8 @@ if (ic->ic_state == IEEE80211_S_RUN && misses > 5) (void) iwn_init_sensitivity(sc); if (misses >= ic->ic_bmissthreshold) - ieee80211_beacon_miss(ic); + taskqueue_enqueue(taskqueue_swi, + &sc->sc_bmiss_task); break; } case IWN_UC_READY: { @@ -2398,7 +2412,7 @@ static const struct iwn_chan_band iwn_bands[] = { { IWN_EEPROM_BAND1, IEEE80211_CHAN_G, 14, { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 } }, - { IWN_EEPROM_BAND2, IEEE80211_CHAN_A, 13, +/* { IWN_EEPROM_BAND2, IEEE80211_CHAN_A, 13, { 183, 184, 185, 187, 188, 189, 192, 196, 7, 8, 11, 12, 16 } }, { IWN_EEPROM_BAND3, IEEE80211_CHAN_A, 12, { 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 } }, @@ -2406,11 +2420,11 @@ { 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 } }, { IWN_EEPROM_BAND5, IEEE80211_CHAN_A, 6, { 145, 149, 153, 157, 161, 165 } }, - { IWN_EEPROM_BAND6, IEEE80211_CHAN_G | IEEE80211_CHAN_HT40, 7, +*/ { IWN_EEPROM_BAND6, IEEE80211_CHAN_G | IEEE80211_CHAN_HT40, 7, { 1, 2, 3, 4, 5, 6, 7 } }, - { IWN_EEPROM_BAND7, IEEE80211_CHAN_A | IEEE80211_CHAN_HT40, 11, +/* { IWN_EEPROM_BAND7, IEEE80211_CHAN_A | IEEE80211_CHAN_HT40, 11, { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157 } } - }; +*/ }; struct ieee80211com *ic = &sc->sc_ic; int i;


@@ -2651,14 +2665,14 @@
        /* XXX all wrong */
        /* compute remaining time until next beacon */
        val = (uint64_t)ni->ni_intval * 1024;   /* msecs -> usecs */
-       DPRINTF(sc, IWN_DEBUG_ANY, "%s: val = %llu %s\n", __func__,
+       DPRINTF(sc, IWN_DEBUG_ANY, "%s: val = %ju %s\n", __func__,
            val, val == 0 ? "correcting" : "");
        if (val == 0)
                val = 1;
        mod = le64toh(tsf.tstamp) % val;
        tsf.binitval = htole32((uint32_t)(val - mod));

- DPRINTF(sc, IWN_DEBUG_RESET, "TSF bintval=%u tstamp=%llu, init=%u\n",
+       DPRINTF(sc, IWN_DEBUG_RESET, "TSF bintval=%u tstamp=%ju, init=%u\n",
            ni->ni_intval, le64toh(tsf.tstamp), (uint32_t)(val - mod));

        if (iwn_cmd(sc, IWN_CMD_TSF, &tsf, sizeof tsf, 1) != 0)
@@ -4243,7 +4257,7 @@
                sc->sc_cmd_arg[sc->sc_cmd_next] = arg;
                sc->sc_cmd_next = (sc->sc_cmd_next + 1) % IWN_CMD_MAXOPS;
        }
-       taskqueue_enqueue(sc->sc_tq, &sc->sc_opstask);
+       taskqueue_enqueue(sc->sc_tq, &sc->sc_ops_task);
        IWN_CMD_UNLOCK(sc);
        return 0;
 }
--- perforce/sys/dev/iwn/if_iwnvar.h    2008-12-19 15:19:14.000000000 +0100
+++ gavin/sys/dev/iwn/if_iwnvar.h       2008-12-19 15:16:57.000000000 +0100
@@ -197,7 +197,8 @@
        struct taskqueue         *sc_tq; /* Main command task queue */

        /* Tasks used by the driver */
-       struct task             sc_opstask; /* operation handling task */
+ struct task sc_ops_task; /* operation handling task */
+       struct task             sc_bmiss_task;  /* beacon miss task */

        /* Thermal calibration */
        struct callout          calib_to;
--- perforce/sys/modules/iwn/Makefile   2008-12-19 15:19:14.000000000 +0100
+++ gavin/sys/modules/iwn/Makefile      2008-12-19 15:16:57.000000000 +0100
@@ -3,6 +3,6 @@
 .PATH:  ${.CURDIR}/../../dev/iwn

 KMOD    = if_iwn
-SRCS    = if_iwn.c opt_bdg.h device_if.h bus_if.h pci_if.h
-CFLAGS += -g -DWITNESS -DINVARIANT_SUPPORT -DINVARIANTS -I${.CURDIR}/../../
+SRCS    = if_iwn.c device_if.h bus_if.h pci_if.h
+
 .include <bsd.kmod.mk>
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[email protected]"

Reply via email to