# Finished: CALL FOR TESTERS Intel wireless 5100/5300 iwn(4) driver for FreeBSD



## delphij@ (Oct 29, 2009)

Hi guys,

Bernhard Schmidt has a patchset that updates our iwn(4) driver to support 5100/5300 wireless adapters.  It also updated some firmware included in our distribution.  Please test if you own these hardware and report back about how it worked, thanks for your cooperation!

http://techwires.net/~bschmidt/patches/freebsd/iwn/iwn_merge_20081028.diff.bz2

To apply it, go to your /usr/src/sys and do `# bzcat iwn_merge_20081028.diff.bz2 | patch -p0` and recompile/install kernel.

(We would appreciate if you would cc rpaulo@FreeBSD.org and/or freebsd-net@FreeBSD.org but I'll try to forward whatever appeared here 

Thanks in advance!


----------



## MellowCat (Nov 2, 2009)

Was there any specific testing you were looking for?


----------



## delphij@ (Nov 2, 2009)

Whether it works for your hardware/break existing compatibility


----------



## thuglife (Nov 3, 2009)

I have 5300 on a lenovo T500, i will test it this afternoon and report back. Thank you for this!


----------



## MellowCat (Nov 3, 2009)

Berndt's patch worked first time 'out of the box' for me, haven't tried all the wifi features though.

Lenovo Thinkpad T500,  Intel 5100 AGN wireless card, 8.0-RC1 and RC2 (amd64).


----------



## bschmidt (Nov 3, 2009)

Hi,

I'd really appreciate any kind of feedback 

There is a newer version available with some additional bug fixes and yet another bunch of imports from OpenBSD.
Checkout:

```
svn co http://svn.techwires.net/svn/projects/freebsd/
```
View:
http://svn.techwires.net/viewvc/viewvc.cgi/svnrepos/projects/freebsd/

There is one open issue reported by Mykola Dzham regarding suspend/resume I haven't been able to track down and there's still the LOR thing which is not yet fixed completely. It just happens on boot not while loading module manually later (races?)


----------



## oliverh (Nov 4, 2009)

So actually I'm able to use e.g. WPA2? Is it possible to use 11n?


----------



## bschmidt (Nov 4, 2009)

Not yet. I do not have access to a 11n capable accesspoint.


----------



## bschmidt (Nov 4, 2009)

And yes, WPA does work.


----------



## vermaden (Nov 4, 2009)

@bschmidt

You are thinkig about WPA or WPA2?


----------



## bschmidt (Nov 4, 2009)

both


----------



## TzunTzai (Nov 4, 2009)

ummm, is this link .... 

http://svn.techwires.net/viewvc/viewvc.cgi/svnrepos/projects/freebsd/

more current than this link?

http://techwires.net/~bschmidt/patches/freebsd/iwn/iwn_merge_20081028.diff.bz2


----------



## bschmidt (Nov 4, 2009)

yes it is. Revsion 1 is iwn_merge_20081028.diff.bz2


----------



## oliverh (Nov 4, 2009)

Ah, I see. Thanks for the clarification.


----------



## TzunTzai (Nov 5, 2009)

I'm sorry. I'm new to patching. Whats the next step here?



```
0# bzcat /storage/DOWNLOADS/iwn_merge_20081028.diff.bz2 | patch -p0
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: conf/files
|===================================================================
|--- conf/files	(revision 198553)
|+++ conf/files	(working copy)
--------------------------
Patching file conf/files using Plan A...
Hunk #1 failed at 1082.
Hunk #2 failed at 1107.
Hunk #3 failed at 1121.
Hunk #4 failed at 1138.
4 out of 4 hunks failed--saving rejects to conf/files.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: modules/iwnfw/iwn5000/Makefile
|===================================================================
|--- modules/iwnfw/iwn5000/Makefile	(revision 198553)
|+++ modules/iwnfw/iwn5000/Makefile	(working copy)
--------------------------
File to patch: 
No file found--skip this patch? [n] n
File to patch:
```


----------



## bschmidt (Nov 5, 2009)

Probably easier if you use the svn checkout.


```
svn co http://svn.techwires.net/svn/projects/freebsd
cd freebsd/sys/modules/iwnfw
make
make install
cd ../iwn
env CFLAGS=-I$PWD/../../ make
make install
```


----------



## thuglife (Nov 7, 2009)

Hey there!

Well, the driver works for me. It is stable for general - light use but when i try to cvsup the base system the link dies, if i try to bring the interface back up i get the following:


```
Nov  8 01:04:12 optimus kernel: wlan0: link state changed to DOWN
Nov  8 01:04:12 optimus dhclient[1636]: exiting.
Nov  8 01:04:33 optimus kernel: ifa_add_loopback_route: insertion failed
Nov  8 01:04:35 optimus kernel: iwn0: iwn5000_post_alive: crystal calibration failed, error 35
Nov  8 01:04:35 optimus kernel: iwn0: iwn_init_locked: could not initialize hardware, error 35
```


```
Failed to initiate AP scan.
ioctl[SIOCS80211, op 103, len 128]: Device not configured
```

This is me.


```
FreeBSD optimus.cybertron.local 8.0-RC2 FreeBSD 8.0-RC2 #2: Sat Nov  7 03:55:14 EET 2009     root@optimus.cybertron.local:/usr/obj/usr/src/sys/GENERIC  amd64
```


```
optimus# cat /etc/rc.conf
wlans_iwn0="wlan0"
ifconfig_em0="DHCP"
ifconfig_wlan0="WPA DHCP"
hostname="optimus.cybertron.local"
```


```
optimus# cat /etc/make.conf
CPUTYPE         =core2
WITH_GECKO      =libxul
```

If there is anything i can do to help you debug this issue please let me know. Thank you for your work.


----------



## bschmidt (Nov 8, 2009)

Can you reproduce the issue with

```
wlandebug 0xffffffff
```
set?

I'm curious about why the device goes down, you're not getting a device timeout message, so it must be somewhere in net80211.


----------



## thuglife (Nov 8, 2009)

This is the most interesting section from the log, i used:

```
sysctl net.wlan.0.debug=0xffffffff
```


```
Nov  8 15:38:25 optimus kernel: wlan0: [00:05:59:0c:47:60] discard duplicate frame, seqno <1365,1365> fragno <0,0> tid 16
Nov  8 15:38:25 optimus kernel: wlan0: [00:05:59:0c:47:60] discard duplicate frame, seqno <1389,1389> fragno <0,0> tid 16
Nov  8 15:38:25 optimus kernel: wlan0: [00:05:59:0c:47:60] discard duplicate frame, seqno <1399,1399> fragno <0,0> tid 16
Nov  8 15:38:25 optimus kernel: wlan0: received beacon from 00:05:59:0c:47:60 rssi 65
Nov  8 15:38:26 optimus kernel: wlan0: received beacon from 00:05:59:0c:47:60 rssi 66
Nov  8 15:38:26 optimus kernel: wlan0: received beacon from 00:05:59:0c:47:60 rssi 66
Nov  8 15:38:26 optimus wpa_supplicant[387]: Failed to disable WPA in the driver.
Nov  8 15:38:26 optimus kernel: wlan0: stop running, 1 vaps running
Nov  8 15:38:26 optimus kernel: wlan0: ieee80211_new_state_locked: RUN -> INIT (nrunning 0 nscanning 0)
Nov  8 15:38:26 optimus kernel: wlan0: down parent iwn0
Nov  8 15:38:26 optimus kernel: wlan0: ieee80211_newstate_cb: RUN -> INIT arg -1
Nov  8 15:38:26 optimus kernel: wlan0: sta_newstate: RUN -> INIT (-1)
Nov  8 15:38:26 optimus kernel: wlan0: ieee80211_ref_node (ieee80211_send_mgmt:1876) 0xffffff8000841000<00:05:59:0c:47:60> refcnt 276
Nov  8 15:38:26 optimus kernel: wlan0: [00:05:59:0c:47:60] send station disassociate (reason 8)
Nov  8 15:38:26 optimus kernel: [00:05:59:0c:47:60] send disassoc on channel 11
Nov  8 15:38:26 optimus kernel: wlan0: _ieee80211_crypto_delkey: AES-CCM keyix 0 flags 0x133 rsc 50479 tsc 37776 len 16
Nov  8 15:38:26 optimus kernel: wlan0: [00:05:59:0c:47:60] bss node leave
Nov  8 15:38:26 optimus kernel: wlan0: node_reclaim: remove 0xffffff8000841000<00:05:59:0c:47
Nov  8 15:38:26 optimus kernel: :<5>w6l0a> nf0r:o ml isntka tsitoatne  tcahbalneg,e dr etfoc ntD 27O5WN
Nov  8 15:38:26 optimus kernel: 
Nov  8 15:38:26 optimus kernel: wlan0: ieee80211_alloc_node 0xffffff8000865000<00:21:6a:6e:3d:b6> in station table
Nov  8 15:38:26 optimus kernel: wlan0: [00:21:6a:6e:3d:b6] ieee80211_alloc_node: inact_reload 2
Nov  8 15:38:26 optimus kernel: wlan0: ieee80211_scan_flush
Nov  8 15:38:26 optimus kernel: wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
Nov  8 15:38:26 optimus last message repeated 2 times
Nov  8 15:38:26 optimus kernel: wlan0: _ieee80211_crypto_delkey: TKIP keyix 3 flags 0x1f6 rsc 1393 tsc 1 len 16
Nov  8 15:38:26 optimus dhclient[1051]: connection closed
Nov  8 15:38:26 optimus dhclient[1051]: exiting.
Nov  8 15:38:30 optimus kernel: wlan0: start running, 0 vaps running
Nov  8 15:38:30 optimus kernel: wlan0: ieee80211_start_locked: up parent iwn0
Nov  8 15:38:30 optimus kernel: wlan0: start running, 1 vaps running
Nov  8 15:38:30 optimus kernel: wlan0: ieee80211_new_state_locked: INIT -> SCAN (nrunning 0 nscanning 0)
Nov  8 15:38:30 optimus kernel: wlan0: ieee80211_newstate_cb: INIT -> SCAN arg 0
Nov  8 15:38:30 optimus kernel: wlan0: sta_newstate: INIT -> SCAN (0)
Nov  8 15:38:30 optimus kernel: wlan0: ieee80211_check_scan: active scan, append
Nov  8 15:38:30 optimus kernel: wlan0: start_scan_locked: active scan, duration 2147483647 mindwell 0 maxdwell 0, desired mode auto, append
Nov  8 15:38:30 optimus kernel: wlan0: scan set 1g, 6g, 11g, 7g, 13g, 52a, 56a, 60a, 64a, 36a, 40a, 44a, 48a, 2g, 3g, 4g, 5g, 8g, 9g, 10g, 12g, 149a, 153a, 157a, 161a, 165a, 100a, 104a, 108a, 112a, 116a, 120a, 124a, 128a, 132a, 136a, 140a dwell min 20ms max 200ms
Nov  8 15:38:30 optimus kernel: wlan0: scan_task: chan  11g ->   1g [active, dwell min 20ms max 200ms]
Nov  8 15:38:30 optimus kernel: wlan0: received probe_resp from 00:14:7f:32:c5:c3 rssi 29
Nov  8 15:38:30 optimus kernel: wlan0: [00:14:7f:32:c5:c3] discard unhandled information element, id 47, len 1
Nov  8 15:38:30 optimus kernel: [00:14:7f:32:c5:c3] new probe_resp on chan 1 (bss chan 1) "NIKITAS-FILIPPOS" rssi 29
Nov  8 15:38:30 optimus kernel: [00:14:7f:32:c5:c3] caps 0x411 bintval 100 erp 0x104
Nov  8 15:38:30 optimus kernel: wlan0: scan_task: chan   1g ->   6g [active, dwell min 20ms max 200ms]
Nov  8 15:38:30 optimus kernel: wlan0: received beacon from 00:13:33:81:bf:ad rssi 5
Nov  8 15:38:30 optimus kernel: [00:13:33:81:bf:ad] new beacon on chan 6 (bss chan 6) "Zeus" rssi 5
Nov  8 15:38:30 optimus kernel: [00:13:33:81:bf:ad] caps 0x411 bintval 100 erp 0x104
Nov  8 15:38:30 optimus kernel: wlan0: received probe_resp from 00:13:33:81:bf:ad rssi 6
Nov  8 15:38:30 optimus kernel: [00:13:33:81:bf:ad] new probe_resp on chan 6 (bss chan 6) "Zeus" rssi 6
Nov  8 15:38:30 optimus kernel: [00:13:33:81:bf:ad] caps 0x411 bintval 100 erp 0x104
Nov  8 15:38:30 optimus kernel: wlan0: received probe_resp from 00:13:33:81:bf:ad rssi 7
Nov  8 15:38:30 optimus kernel: [00:13:33:81:bf:ad] new probe_resp on chan 6 (bss chan 6) "Zeus" rssi 7
Nov  8 15:38:30 optimus kernel: [00:13:33:81:bf:ad] caps 0x411 bintval 100 erp 0x104
Nov  8 15:38:30 optimus kernel: wlan0: scan_task: chan   6g ->  11g [active, dwell min 20ms max 200ms]
Nov  8 15:38:30 optimus kernel: wlan0: received probe_resp from 00:05:59:0c:47:60 rssi 67
Nov  8 15:38:30 optimus kernel: [00:05:59:0c:47:60] new probe_resp on chan 11 (bss chan 11) "Liaskos2" rssi 67
Nov  8 15:38:30 optimus kernel: [00:05:59:0c:47:60] caps 0x431 bintval 100 erp 0x100
Nov  8 15:38:30 optimus kernel: wlan0: received probe_resp from 00:05:59:0c:47:60 rssi 68
Nov  8 15:38:30 optimus kernel: [00:05:59:0c:47:60] new probe_resp on chan 11 (bss chan 11) "Liaskos2" rssi 68
Nov  8 15:38:30 optimus kernel: [00:05:59:0c:47:60] caps 0x431 bintval 100 erp 0x100
Nov  8 15:38:30 optimus kernel: wlan0: received probe_resp from 00:1c:df:08:72:9b rssi 14
Nov  8 15:38:30 optimus kernel: wlan0: [00:1c:df:08:72:9b] discard unhandled information element, id 47, len 1
Nov  8 15:38:30 optimus kernel: wlan0: [00:1c:df:08:72:9b] discard probe_resp frame, for off-channel 10
Nov  8 15:38:30 optimus kernel: wlan0: received beacon from 00:05:59:0c:47:60 rssi 68
Nov  8 15:38:30 optimus kernel: [00:05:59:0c:47:60] new beacon on chan 11 (bss chan 11) "Liaskos2" rssi 68
Nov  8 15:38:30 optimus kernel: [00:05:59:0c:47:60] caps 0x431 bintval 100 erp 0x100
Nov  8 15:38:30 optimus kernel: wlan0: scan_task: chan  11g ->   7g [active, dwell min 20ms max 200ms]
Nov  8 15:38:30 optimus kernel: wlan0: scan_task: chan   7g ->  13g [passive, dwell min 20ms max 200ms]
Nov  8 15:38:30 optimus kernel: wlan0: received beacon from 00:1c:a2:ac:3e:21 rssi 21
Nov  8 15:38:30 optimus kernel: [00:1c:a2:ac:3e:21] new beacon on chan 13 (bss chan 13) "WIRELESS" rssi 21
Nov  8 15:38:30 optimus kernel: [00:1c:a2:ac:3e:21] caps 0x471 bintval 100 erp 0x103
Nov  8 15:38:30 optimus kernel: wlan0: ieee80211_add_scan: chan  13g min dwell met (1785560 > 1785487)
Nov  8 15:38:30 optimus kernel: wlan0: scan_task: chan  13g ->  52a [passive, dwell min 20ms max 200ms]
Nov  8 15:38:30 optimus kernel: wlan0: received beacon from 00:1c:a2:ac:3e:21 rssi 21
Nov  8 15:38:30 optimus kernel: wlan0: [00:1c:a2:ac:3e:21] discard beacon frame, for off-channel 13
Nov  8 15:38:31 optimus kernel: wlan0: received beacon from 00:1c:a2:ac:3e:21 rssi 21
Nov  8 15:38:31 optimus kernel: wlan0: [00:1c:a2:ac:3e:21] discard beacon frame, for off-channel 13
Nov  8 15:38:31 optimus kernel: wlan0: received beacon from 00:1c:a2:ac:3e:21 rssi 21
Nov  8 15:38:31 optimus kernel: wlan0: [00:1c:a2:ac:3e:21] discard beacon frame, for off-channel 13
Nov  8 15:38:31 optimus kernel: wlan0: received beacon from 00:1c:a2:ac:3e:21 rssi 20
Nov  8 15:38:31 optimus kernel: wlan0: [00:1c:a2:ac:3e:21] discard beacon frame, for off-channel 13
Nov  8 15:38:31 optimus kernel: iwn0: iwn_config: could not configure bluetooth coexistence, error 35
Nov  8 15:38:31 optimus kernel: wlan0: ieee80211_cancel_scan: cancel active scan
Nov  8 15:38:31 optimus kernel: wlan0: scan_task: done, [ticks 1786601, dwell min 20 scanend 2149268980]
Nov  8 15:38:31 optimus kernel: wlan0: [00:05:59:0c:47:60] discard frame, not to bss
Nov  8 15:38:31 optimus kernel: wlan0: [00:05:59:0c:47:60] discard frame, not to bss
Nov  8 15:38:31 optimus kernel: wlan0: [00:24:b2:36:61:c8] discard frame, not to bss
Nov  8 15:38:32 optimus kernel: wlan0: [00:1c:a2:ac:3e:21] discard frame, not to bss
```


----------



## bschmidt (Nov 8, 2009)

Hmm, seems like wpa_supplicant is telling the device to stop. Can you run wpa_supplicant with debug output?


```
wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf -ddt
```

I have have the feeling that something with re-keying is not working correctly.


----------



## Zhwazi (Nov 9, 2009)

I have a Dell Latitude E6400 with a Wifilink 5300 which I bought separately, followed the svn instructions on 8.0-RC1 i386, works fine for me so far in an hour of use.

Tried cvsup like ThugLife says gave him problems, didn't see any problems when I tried it.

Thank you very much for the driver, this was the last thing in my system that wasn't working as I expected it to


----------



## Zephyrus (Nov 9, 2009)

Hi,
well, first of all thanks for the driver, this was the last major device who was totally not supported by FreeBSD on my HP Probook.

With regard to the driver itself, I've tested it today for about three hours to connect to an hidden ssid-open network with browser based authentication.
In particular I performed a full-speed download test for about thirty minutes, I tested csup and then I spent the rest of the time with a standard network usage (http,imap,ssh, etc...).

These are the most relevant messages I found in the log files:

```
Nov  8 12:38:40 polaris kernel: iwn0: iwn_config: could not set TX power
Nov  8 12:38:41 polaris kernel: iwn0: iwn_config: could not configure valid TX chains, error 35
Nov  9 12:46:23 polaris kernel: iwn0: <Intel(R) PRO/Wireless 5100> mem 0x98200000-0x98201fff irq 17 at device 0.0 on pci3
Nov  9 12:46:23 polaris kernel: iwn0: MIMO 1T2R, MoW, address 00:22:fa:e4:2e:56
Nov  9 12:46:23 polaris kernel: iwn0: [ITHREAD]
Nov  9 12:46:23 polaris kernel: iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
Nov  9 12:46:23 polaris kernel: iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
Nov  9 12:46:23 polaris kernel: iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
Nov  9 12:46:23 polaris kernel: iwn0: 11na MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps
Nov  9 12:46:23 polaris kernel: iwn0: 11ng MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps
Nov  9 12:59:12 polaris kernel: iwn0: need multicast update callback
Nov  9 12:59:14 polaris kernel: iwn0: need multicast update callback
Nov  9 12:59:14 polaris kernel: iwn0: need multicast update callback
Nov  9 13:05:40 polaris kernel: iwn0: need multicast update callback
Nov  9 13:06:22 polaris kernel: iwn0: need multicast update callback
Nov  9 13:06:22 polaris kernel: iwn0: need multicast update callback
Nov  9 13:06:22 polaris kernel: iwn0: need multicast update callback
Nov  9 14:11:59 polaris kernel: iwn0: need multicast update callback
Nov  9 14:12:07 polaris kernel: iwn0: need multicast update callback
```

The first two lines seem to appear only on the first load of if_iwn. Apart from these messages, all seems to have worked well. If you need more information or some particular test, I will gladly help, if I can.


----------



## bschmidt (Nov 9, 2009)

Zephyrus said:
			
		

> These are the most relevant messages I found in the log files:
> 
> ```
> Nov  8 12:38:40 polaris kernel: iwn0: iwn_config: could not set TX power
> ...



What do you mean by "first load"? Does that mean you have to load if_iwn.ko twice to get a working device?


----------



## Zephyrus (Nov 9, 2009)

Wait, it seems that I cannot reproduce it anymore. And I also noticed that those lines were included by mystake, since they refer to yesterday. I will let you know if I come across that error again.
Just to be clear, the driver works on first load, at boot.
I also forgot to give my system information:

```
FreeBSD polaris 8.0-RC2 FreeBSD 8.0-RC2 #2: Fri Nov  6 22:55:22 CET 2009     toor@polaris:/usr/obj/usr/src/sys/POLARIS  amd64
```


----------



## thuglife (Nov 9, 2009)

I hope you can find anything useful.


```
1257789518.518887: State: ASSOCIATING -> ASSOCIATED
1257789518.518910: Associated to a new BSS: BSSID=00:05:59:0c:47:60
1257789518.518917: No keys have been configured - skip key clearing
1257789518.518926: Associated with 00:05:59:0c:47:60
1257789518.518932: WPA: Association event - clear replay counter
1257789518.518937: WPA: Clear old PTK
1257789518.518942: EAPOL: External notification - portEnabled=0
1257789518.518949: EAPOL: External notification - portValid=0
1257789518.518954: EAPOL: External notification - EAP success=0
1257789518.518960: EAPOL: External notification - portEnabled=1
1257789518.518965: EAPOL: SUPP_PAE entering state CONNECTING
1257789518.518970: EAPOL: enable timer tick
1257789518.518979: EAPOL: SUPP_BE entering state IDLE
1257789518.518987: Setting authentication timeout: 10 sec 0 usec
1257789518.518998: Cancelling scan request
1257789518.535316: RX EAPOL from 00:05:59:0c:47:60
1257789518.535329: RX EAPOL - hexdump(len=121): 01 03 00 75 02\
   00 8a 00 10 00 00 00 00 00 00 00 36 9d 16 28 05 dd 2a c7 7c\
   a6 bc c8 67 20 68 5f c1 4d 77 81 65 30 cc bb 57 d1 ea eb 36\
   ce 6b 1a e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 16 dd 14 00 0f ac 04\
   ed 90 07 d4 a2 38 80 e7 44 a9 d6 52 28 b4 4f 85
1257789518.535404: Setting authentication timeout: 10 sec 0 usec

...

1257789518.535606: State: ASSOCIATED -> 4WAY_HANDSHAKE
1257789518.535613: WPA: RX message 1 of 4-Way Handshake from 00:05:59:0c:47:60 (ver=2)
1257789518.535622: RSN: msg 1/4 key data - hexdump(len=22): dd 14 00 0f ac 04 ed 90 07 d4 a2 38 80 e7 44 a9 d6 52 28 b4 4f 85
1257789518.535644: RSN: PMKID from Authenticator - hexdump(len=16): ed 90 07 d4 a2 38 80 e7 44 a9 d6 52 28 b4 4f 85
1257789518.535658: RSN: no matching PMKID found
1257789518.535942: WPA: Renewed SNonce - hexdump(len=32): 10 65\
   26 99 e2 8f 6b ad dd 85 9d dc 9c 07 f6 bd af 96 86 98 9c e1\
   cf c1 1d 7c 35 99 75 58 9d 96
1257789518.536002: WPA: PTK derivation - A1=00:21:6a:6e:3d:b6 A2=00:05:59:0c:47:60
1257789518.536013: WPA: PMK - hexdump(len=32): [REMOVED]
1257789518.536019: WPA: PTK - hexdump(len=64): [REMOVED]
1257789518.536026: WPA: WPA IE for msg 2/4 - hexdump(len=22): 30\
   14 01 00 00 0f ac 02 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00
1257789518.536046: WPA: Sending EAPOL-Key 2/4
1257789518.536060: WPA: TX EAPOL-Key - hexdump(len=121): 01 03\
   00 75 02 01 0a 00 00 00 00 00 00 00 00 00 36 10 65 26 99 e2\
   8f 6b ad dd 85 9d dc 9c 07 f6 bd af 96 86 98 9c e1 cf c1 1d\
   7c 35 99 75 58 9d 96 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 22\
   ba 30 a3 fb 78 07 e3 2a e1 f4 6c 29 c7 2a 6f 00 16 30 14 01\
   00 00 0f ac 02 01 00 00 0f ac 04 01 00 00 0f ac 02 00 00
1257789518.589574: RX EAPOL from 00:05:59:0c:47:60
1257789518.589586: RX EAPOL - hexdump(len=179): 01 03 00 af 02\
   13 ca 00 10 00 00 00 00 00 00 00 37 9d 16 28 05 dd 2a c7 7c\
   a6 bc c8 67 20 68 5f c1 4d 77 81 65 30 cc bb 57 d1 ea eb 36\
   ce 6b 1a e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5 a6 af 23\
   31 3e f1 63 6f 1e 90 b6 91 14 39 1f 00 50 fd e0 e9 a4 21 d9\
   72 aa a4 94 22 25 8c 9a 43 ae ba 03 af 5b 3e b3 96 d7 19 96\
   23 cd cd 2c 07 41 f0 f2 31 33 2a 9a 3a d3 b9 49 e3 aa 94 ee\
   55 ef 0e b2 fe b1 0c b2 a2 5d 90 03 34 4c 17 b5 8a 61 e4 23\
   f7 15 b7 05 1b c8 98 28 2f 14 eb 4e ec 8c
1257789518.589683: IEEE 802.1X RX: version=1 type=3 length=175
1257789518.589690:   EAPOL-Key type=2
1257789518.589695:   key_info 0x13ca (ver=2 keyidx=0 rsvd=0 Pairwise Install Ack MIC Secure Encr)
1257789518.589705:   key_length=16 key_data_length=80
1257789518.589711:   replay_counter - hexdump(len=8): 00 00 00 00 00 00 00 37
1257789518.589722:   key_nonce - hexdump(len=32): 9d 16 28 05 dd\
   2a c7 7c a6 bc c8 67 20 68 5f c1 4d 77 81 65 30 cc bb 57 d1\
   ea eb 36 ce 6b 1a e0
1257789518.589742:   key_iv - hexdump(len=16): 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00
1257789518.589757:   key_rsc - hexdump(len=8): 00 00 00 00 00 00\
   00 00
1257789518.589767:   key_id (reserved) - hexdump(len=8): 00 00\
   00 00 00 00 00 00
1257789518.589777:   key_mic - hexdump(len=16): e5 a6 af 23 31\
   3e f1 63 6f 1e 90 b6 91 14 39 1f
1257789518.589792: WPA: RX EAPOL-Key - hexdump(len=179): 01 03\
   00 af 02 13 ca 00 10 00 00 00 00 00 00 00 37 9d 16 28 05 dd\
   2a c7 7c a6 bc c8 67 20 68 5f c1 4d 77 81 65 30 cc bb 57 d1\
   ea eb 36 ce 6b 1a e0 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e5\
   a6 af 23 31 3e f1 63 6f 1e 90 b6 91 14 39 1f 00 50 fd e0 e9\
   a4 21 d9 72 aa a4 94 22 25 8c 9a 43 ae ba 03 af 5b 3e b3 96\
   d7 19 96 23 cd cd 2c 07 41 f0 f2 31 33 2a 9a 3a d3 b9 49 e3\
   aa 94 ee 55 ef 0e b2 fe b1 0c b2 a2 5d 90 03 34 4c 17 b5 8a\
   61 e4 23 f7 15 b7 05 1b c8 98 28 2f 14 eb 4e ec 8c
1257789518.589901: RSN: encrypted key data - hexdump(len=80): fd\
   e0 e9 a4 21 d9 72 aa a4 94 22 25 8c 9a 43 ae ba 03 af 5b 3e\
   b3 96 d7 19 96 23 cd cd 2c 07 41 f0 f2 31 33 2a 9a 3a d3 b9\
   49 e3 aa 94 ee 55 ef 0e b2 fe b1 0c b2 a2 5d 90 03 34 4c 17\
   b5 8a 61 e4 23 f7 15 b7 05 1b c8 98 28 2f 14 eb 4e ec 8c
1257789518.605316: WPA: decrypted EAPOL-Key key data - hexdump(len=72): [REMOVED]
1257789518.605326: State: 4WAY_HANDSHAKE -> 4WAY_HANDSHAKE
1257789518.605333: WPA: RX message 3 of 4-Way Handshake from 00:05:59:0c:47:60 (ver=2)
1257789518.605342: WPA: IE KeyData - hexdump(len=72): 30 18 01\
   00 00 0f ac 02 02 00 00 0f ac 02 00 0f ac 04 01 00 00 0f ac\
   02 01 00 dd 26 00 0f ac 01 02 00 67 e1 4f 0d f4 55 5e 19 6d\
   72 53 1a f3 0c e6 41 96 3e 10 04 89 df fd d1 c7 8e ce c7 ce\
   fe 94 f5 dd 00 00 00 00 00
1257789518.605388: WPA: Sending EAPOL-Key 4/4
1257789518.605403: WPA: TX EAPOL-Key - hexdump(len=99): 01 03 00\
   5f 02 03 0a 00 00 00 00 00 00 00 00 00 37 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\
   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ba 38\
   c6 30 64 11 44 d1 f6 fe a3 f2 de 6c bd 69 00 00
1257789518.605476: WPA: Installing PTK to the driver.
1257789518.605522: wpa_driver_bsd_set_key: alg=CCMP addr=00:05:59:0c:47:60 key_idx=0 set_tx=1 seq_len=6 key_len=16
1257789518.605546: EAPOL: External notification - portValid=1
1257789518.605553: State: 4WAY_HANDSHAKE -> GROUP_HANDSHAKE
1257789518.605560: RSN: received GTK in pairwise handshake - hexdump(len=34): [REMOVED]
1257789518.605567: WPA: Group Key - hexdump(len=32): [REMOVED]
1257789518.605597: WPA: Installing GTK to the driver (keyidx=2 tx=0 len=32).
1257789518.605605: WPA: RSC - hexdump(len=6): 00 00 00 00 00 00
1257789518.605618: wpa_driver_bsd_set_key: alg=TKIP addr=ff:ff:ff:ff:ff:ff key_idx=2 set_tx=0 seq_len=6 key_len=32
1257789518.605643: WPA: Key negotiation completed with 00:05:59:0c:47:60 [PTK=CCMP GTK=TKIP]
1257789518.605650: Cancelling authentication timeout
1257789518.605657: State: GROUP_HANDSHAKE -> COMPLETED
1257789518.605669: CTRL-EVENT-CONNECTED - Connection to 00:05:59:0c:47:60 completed (auth) [id=0 id_str=]
1257789518.605675: EAPOL: External notification - portValid=1
1257789518.605681: EAPOL: External notification - EAP success=1
1257789518.605686: EAPOL: SUPP_PAE entering state AUTHENTICATING
1257789518.605691: EAPOL: SUPP_BE entering state SUCCESS
1257789518.605696: EAP: EAP entering state DISABLED
1257789518.605702: EAPOL: SUPP_PAE entering state AUTHENTICATED
1257789518.605707: EAPOL: SUPP_BE entering state IDLE
1257789518.605713: EAPOL authentication completed successfully
1257789519.607926: RSN: processing PMKSA candidate list
1257789519.607941: RSN: not in suitable state for new pre-authentication
1257789521.537606: EAPOL: startWhen --> 0
1257789521.537619: EAPOL: disable timer tick
1257791506.301473: RTM_IFINFO: Interface 'wlan0' DOWN
1257791506.301491: Configured interface was removed.
1257791506.301500: State: COMPLETED -> DISCONNECTED
1257791506.301508: EAPOL: External notification - portEnabled=0
1257791506.301514: EAPOL: SUPP_PAE entering state DISCONNECTED
1257791506.301519: EAPOL: SUPP_BE entering state INITIALIZE
1257791506.301527: EAPOL: External notification - portValid=0
1257791506.301533: EAPOL: External notification - EAP success=0
1257791506.301640: Removing interface wlan0
1257791506.301650: State: DISCONNECTED -> DISCONNECTED
1257791506.301657: wpa_driver_bsd_del_key: keyidx=0
1257791506.301672: wpa_driver_bsd_del_key: keyidx=1
1257791506.301681: wpa_driver_bsd_del_key: keyidx=2
1257791506.301691: wpa_driver_bsd_del_key: keyidx=3
1257791506.301703: EAPOL: External notification - portEnabled=0
1257791506.301710: EAPOL: External notification - portValid=0
1257791506.301717: wpa_driver_bsd_set_wpa: enabled=0
1257791506.301722: wpa_driver_bsd_set_wpa_internal: wpa=0 privacy=0
1257791506.301863: Failed to disable WPA in the driver.
1257791506.301868: wpa_driver_bsd_set_drop_unencrypted: enabled=0
1257791506.301879: wpa_driver_bsd_set_countermeasures: enabled=0
1257791506.301889: No keys have been configured - skip key clearing
1257791506.302284: Cancelling scan request
1257791506.302293: Cancelling authentication timeout
1257791506.315435: wpa_driver_bsd_set_wpa_internal: wpa=0 privacy=0
ELOOP: remaining socket: sock=4 eloop_data=0x800e0b1c0 user_data=0x800e070f0 handler=0x41fb29
```


----------



## thuglife (Nov 9, 2009)

```
Nov  9 20:00:08 optimus dhclient: New Subnet Mask (wlan0): 255.255.255.0
Nov  9 20:00:08 optimus dhclient: New Broadcast Address (wlan0): 192.168.0.255
Nov  9 20:00:08 optimus dhclient: New Routers (wlan0): 192.168.0.1

...

Nov  9 20:25:01 optimus kernel: nfs server megatron:/usr/local/samba/share: not responding
Nov  9 20:25:04 optimus last message repeated 2 times
Nov  9 20:25:30 optimus dhclient[1820]: send_packet: Host is down
Nov  9 20:28:05 optimus dhclient[1820]: send_packet: Host is down
Nov  9 20:28:56 optimus last message repeated 4 times
Nov  9 20:29:49 optimus kernel: drm0: [ITHREAD]
Nov  9 20:30:14 optimus kernel: iwn0: need multicast update callback
Nov  9 20:30:14 optimus kernel: iwn0: need multicast update callback
Nov  9 20:30:34 optimus login: ROOT LOGIN (root) ON ttyv0
Nov  9 20:31:26 optimus kernel: drm0: [ITHREAD]
Nov  9 20:31:46 optimus kernel: wlan0: link state changed to DOWN
Nov  9 20:31:46 optimus dhclient[1786]: connection closed
Nov  9 20:31:46 optimus dhclient[1786]: exiting.
Nov  9 20:31:51 optimus kernel: ifa_add_loopback_route: insertion failed
Nov  9 20:33:49 optimus kernel: ifa_add_loopback_route: insertion failed
Nov  9 20:33:51 optimus kernel: wlan0: link state changed to UP
Nov  9 20:34:40 optimus dhclient[2016]: connection closed
Nov  9 20:34:40 optimus dhclient[2016]: exiting.
Nov  9 20:35:05 optimus shutdown: reboot by root:
```

Second try.


```
1257795184.405635: Initializing interface 'wlan0' conf '/etc/wpa_supplicant.conf' driver 'bsd' ctrl_interface 'N/A' bridge 'N/A'
1257795184.405710: Configuration file '/etc/wpa_supplicant.conf' -> '/etc/wpa_supplicant.conf'
1257795184.405725: Reading configuration file '/etc/wpa_supplicant.conf'
1257795184.405794: Line: 1 - start of a new network block
1257795184.405822: ssid - hexdump_ascii(len=8):
     4c 69 61 73 6b 6f 73 32                           Liaskos2        
1257795184.405842: PSK (ASCII passphrase) - hexdump_ascii(len=8): [REMOVED]
1257795184.456526: PSK (from passphrase) - hexdump(len=32): [REMOVED]
1257795184.456567: Priority group 0
1257795184.456575:    id=0 ssid='Liaskos2'
1257795184.456581: Initializing interface (2) 'wlan0'
1257795184.463033: Own MAC address: 00:21:6a:6e:3d:b6
1257795184.463044: wpa_driver_bsd_set_wpa: enabled=1
1257795184.463050: wpa_driver_bsd_set_wpa_internal: wpa=3 privacy=1
1257795184.463066: wpa_driver_bsd_del_key: keyidx=0
1257795184.463170: wpa_driver_bsd_del_key: keyidx=1
1257795184.463255: wpa_driver_bsd_del_key: keyidx=2
1257795184.463341: wpa_driver_bsd_del_key: keyidx=3
1257795184.463426: wpa_driver_bsd_set_countermeasures: enabled=0
1257795184.463435: wpa_driver_bsd_set_drop_unencrypted: enabled=1
1257795184.463443: RSN: flushing PMKID list in the driver
1257795184.463471: Setting scan request: 0 sec 100000 usec
1257795184.483850: EAPOL: SUPP_PAE entering state DISCONNECTED
1257795184.483859: EAPOL: KEY_RX entering state NO_KEY_RECEIVE
1257795184.483864: EAPOL: SUPP_BE entering state INITIALIZE
1257795184.483871: EAP: EAP entering state DISABLED
1257795184.483882: Added interface wlan0
1257795184.566072: State: DISCONNECTED -> SCANNING
1257795184.566082: Starting AP scan (broadcast SSID)
1257795184.566087: Trying to get current scan results first without requesting a new scan to speed up initial association
1257795184.566172: Received 0 bytes of scan results (0 BSSes)
1257795184.566180: Scan results: 0
1257795184.566202: Cached scan results are empty - not posting
1257795184.566209: Selecting BSS from priority group 0
1257795184.566214: Try to find WPA-enabled AP
1257795184.566219: Try to find non-WPA AP
1257795184.566225: No suitable AP found.
1257795184.566232: Setting scan request: 0 sec 0 usec
1257795184.566255: Starting AP scan (broadcast SSID)
1257795185.488751: EAPOL: disable timer tick
1257795269.118856: CTRL-EVENT-TERMINATING - signal 2 received
1257795269.118872: Removing interface wlan0
1257795269.118878: State: SCANNING -> DISCONNECTED
1257795269.118885: No keys have been configured - skip key clearing
1257795269.118892: EAPOL: External notification - portEnabled=0
1257795269.118901: EAPOL: External notification - portValid=0
1257795269.118907: wpa_driver_bsd_set_wpa: enabled=0
1257795269.118912: wpa_driver_bsd_set_wpa_internal: wpa=0 privacy=0
1257795269.119054: Failed to disable WPA in the driver.
1257795269.119060: wpa_driver_bsd_set_drop_unencrypted: enabled=0
1257795269.119071: wpa_driver_bsd_set_countermeasures: enabled=0
1257795269.119079: No keys have been configured - skip key clearing
1257795269.119568: Cancelling scan request
1257795269.119577: Cancelling authentication timeout
1257795269.133995: wpa_driver_bsd_set_wpa_internal: wpa=0 privacy=0
ELOOP: remaining socket: sock=4 eloop_data=0x800e0b1c0 user_data=0x800e070f0 handler=0x41fb29
```


```
Nov  9 21:34:29 optimus kernel: wlan0: stop running, 1 vaps running
Nov  9 21:34:29 optimus kernel: wlan0: ieee80211_new_state_locked: SCAN -> INIT (nrunning 0 nscanning 0)
Nov  9 21:34:29 optimus kernel: wlan0: down parent iwn0
Nov  9 21:34:29 optimus kernel: wlan0: ieee80211_newstate_cb: SCAN -> INIT arg -1
Nov  9 21:34:29 optimus kernel: wlan0: sta_newstate: SCAN -> INIT (-1)
Nov  9 21:34:29 optimus kernel: wlan0: node_reclaim: remove 0xffffff80006c6000<00:21:6a:6e:3d:b6> from station table, refcnt 1
Nov  9 21:34:29 optimus kernel: wlan0: ieee80211_alloc_node 0xffffff8000854000<00:21:6a:6e:3d:b6> in station table
Nov  9 21:34:29 optimus kernel: wlan0: [00:21:6a:6e:3d:b6] ieee80211_alloc_node: inact_reload 2
Nov  9 21:34:29 optimus kernel: wlan0: ieee80211_scan_flush
Nov  9 21:34:39 optimus kernel: wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
Nov  9 21:34:39 optimus last message repeated 3 times
Nov  9 21:34:39 optimus kernel: wlan0: start running, 0 vaps running
Nov  9 21:34:39 optimus kernel: wlan0: ieee80211_start_locked: up parent iwn0
Nov  9 21:34:40 optimus kernel: iwn0: iwn5000_send_calibration: could not send calibration result, error 35
Nov  9 21:34:40 optimus kernel: iwn0: iwn_init_locked: could not initialize hardware, error 35
Nov  9 21:34:41 optimus kernel: wlan0: start running, 1 vaps running
```


----------



## bschmidt (Nov 10, 2009)

Weird.. On first glance I can't say for sure whats going on there. Seems like the re-init issued by net80211 doesn't work correctly. I look into that.


----------



## dinoex@ (Nov 15, 2009)

*Levnovo N500 crash when connecting to accespoint.*

After it worked on a friends laptop (diffrent hardware)
I build the driver from svn.

Trying on amd64 I get a panic when "Raidio" is on after a few seconds.

Cash does not happen when "Radio" is off.
When "Radio" is off on loading if_iwn the firmware is not loaded.

If the Accesspoint is off, no crash.

crashdump was not written in 7 out of 8 times.
further panics in bufwrite, diffrent errors while writing dump.

$ kldunload if_iwn


```
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
if_delmulti_locked: detaching ifnet instance 0xffffff00024ef800
lock order reversal:
 1st 0xffffff00024efbc8 if_afdata (if_afdata) @ /usr/src/sys/net/if.c:912
 2nd 0xffffffff80e0c120 mld_mtx (mld_mtx) @ /usr/src/sys/netinet6/mld6.c:569
ifaddr cache = 0xffffff00040e2700  is deleted
if_delmulti_ifma: ifnet 0xffffff00040c9000 disappeared
if_delmulti_ifma: ifnet 0xffffff00040c9000 disappeared
if_delmulti_ifma: ifnet 0xffffff00040c9000 disappeared
if_delmulti_ifma: ifnet 0xffffff00040c9000 disappeared
iwn0: detached
```


ReLoading with "Radio" on is sucessful:


```
iwn0: <Intel(R) PRO/Wireless 5100> mem 0xf4700000-0xf4701fff irq 18 at device 0.0 on pci4
pcib3: iwn0 requested memory range 0xf4700000-0xf4701fff: good
iwn0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 256 to local APIC 1 vector 52
iwn0: using IRQ 256 for MSI
iwn0: MIMO 1T2R, MoW, address 00:21:6b:a9:e4:22
[MPSAFE]
[ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11na MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300
Mbps
iwn0: 11ng MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300
Mbps
pci5: driver added
pci7: driver added
pci8: driver added
wlan0: bpf attached
wlan0: bpf attached
wlan0: Ethernet address: 00:21:6b:a9:e4:22

iwn0: need multicast update callbackif_delmulti_locked: detaching ifnet instance 0xffffff0003edc800

if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
iwn0: need multicast update callbackif_delmulti_locked: detaching ifnet instance 0xffffff0003edc800

if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
iwn0: need multicast update callbackif_delmulti_locked: detaching ifnet instance 0xffffff0003edc800

if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
if_delmulti_locked: detaching ifnet instance 0xffffff0003edc800
iwn0: need multicast update callbackExpensive timeout(9) function: 0xffffffff8060c4e0(0) 0.016176217 s

firmware: 'iwn5000fw' version 0: 353240 bytes loaded at 0xffffffff812bb0b0
 wpa_supplicant[2005]: CTRL-EVENT-SCAN-RESULTS
 wpa_supplicant[2005]: Trying to associate with 00:23:08:4e:07:08 (SSID='dinoex-hbw2' freq=2472 MHz)
```



```
# kldstat
Id Refs Address            Size     Name
 1   30 0xffffffff80100000 f1e358   kernel
 2    1 0xffffffff8101f000 55f0     acpi_ibm.ko
 4    1 0xffffffff81222000 223e     nullfs.ko
 5    1 0xffffffff81225000 1d1e7    linux.ko
 6    1 0xffffffff81243000 a8ca     fuse.ko
 7    1 0xffffffff8124e000 13846    snd_hda.ko
 8    1 0xffffffff81262000 40204    sound.ko
 9    1 0xffffffff812a3000 3fa7     sdhci.ko
10    1 0xffffffff812a7000 13af7    if_iwn.ko
11    1 0xffffffff812bb000 5658a    iwn5000fw.ko
```

from pciconv -lv

```
iwn0@pci0:4:0:0:        class=0x028000 card=0x12118086 chip=0x42378086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel (R) WiFi Link 5100 AGN (5100 AGN)'
    class      = network
```

FreeBSD 8.0-PRERELEASE #1: Sun Nov 15 13:01:02 CET 2009 amd64 GENERIC



```
$ tail /boot/loader.conf
if_iwn_load="yes"

$ tail /etc/rc.conf
wlans_iwn0="wlan0"
ifconfig_wlan0="country DE WPA DHCP"
```


```
Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0xffffff8000424000
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:0xffffffff80691921
stack pointer           = 0x28:0xffffff8000037af0
frame pointer           = 0x28:0xffffff8000037ba0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 12 (swi4: clock)
trap number             = 12
panic: page fault
cpuid = 0
Uptime: 8m56s
Physical memory: 4041 MB
Dumping 1477 MB: 1462 1446 1430 1414 1398 1382 1366

Fatal trap 12: page fault while in kernel mode
cpuid = 1; apic id = 01
fault virtual address   = 0x6de
fault code              = supervisor read instruction, page not present
instruction pointer     = 0x20:0x6de
stack pointer           = 0x28:0xffffff8074898b00
frame pointer           = 0x28:0xffffff8074898b30
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 12 (irq19: uhci4+)
trap number             = 12
```


```
(kgdb) bt
#0  doadump () at pcpu.h:223
#1  0xffffffff805b1ea5 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:416
#2  0xffffffff805b232c in panic (fmt=0xffffffff8095ec54 "%s") at /usr/src/sys/kern/kern_shutdown.c:579
#3  0xffffffff80893378 in trap_fatal (frame=0xffffff00024f1720, eva=Variable "eva" is not available.
) at /usr/src/sys/amd64/amd64/trap.c:857
#4  0xffffffff808936dd in trap_pfault (frame=0xffffff8000037a40, usermode=0) at /usr/src/sys/amd64/amd64/trap.c:773
#5  0xffffffff80894020 in trap (frame=0xffffff8000037a40) at /usr/src/sys/amd64/amd64/trap.c:499
#6  0xffffffff8087a583 in calltrap () at /usr/src/sys/amd64/amd64/exception.S:224
#7  0xffffffff80691921 in ieee80211_tx_mgt_timeout (arg=0xffffff8000424000) at /usr/src/sys/net80211/ieee80211_output.c:2476
#8  0xffffffff805c4748 in softclock (arg=Variable "arg" is not available.
) at /usr/src/sys/kern/kern_timeout.c:411
#9  0xffffffff8058cfa5 in intr_event_execute_handlers (p=Variable "p" is not available.
) at /usr/src/sys/kern/kern_intr.c:1165
#10 0xffffffff8058dbf2 in ithread_loop (arg=0xffffff00024dc6c0) at /usr/src/sys/kern/kern_intr.c:1178
#11 0xffffffff8058b47a in fork_exit (callout=0xffffffff8058db40 <ithread_loop>, arg=0xffffff00024dc6c0, frame=0xffffff8000037c80)
    at /usr/src/sys/kern/kern_fork.c:843
#12 0xffffffff8087aa5e in fork_trampoline () at /usr/src/sys/amd64/amd64/exception.S:561
#13 0x0000000000000000 in ?? ()
#14 0x0000000000000000 in ?? ()
#15 0x0000000000000001 in ?? ()
#16 0x0000000000000000 in ?? ()
#17 0x0000000000000000 in ?? ()
#18 0x0000000000000000 in ?? ()
#19 0x0000000000000000 in ?? ()
#20 0x0000000000000000 in ?? ()
#21 0x0000000000000000 in ?? ()
#22 0x0000000000000000 in ?? ()
#23 0x0000000000000000 in ?? ()
#24 0x0000000000000000 in ?? ()
#25 0x0000000000000000 in ?? ()
#26 0x0000000000000000 in ?? ()
#27 0x0000000000000000 in ?? ()
#28 0x0000000000000000 in ?? ()
#29 0x0000000000000000 in ?? ()
#30 0x0000000000000000 in ?? ()
#31 0x0000000000000000 in ?? ()
#32 0x0000000000000000 in ?? ()
#33 0x0000000000000000 in ?? ()
#34 0x0000000000000000 in ?? ()
#35 0x0000000000000000 in ?? ()
#36 0x0000000000000000 in ?? ()
#37 0x0000000001070000 in ?? ()
#38 0x0000000000000000 in ?? ()
#39 0xffffffff80c4a200 in affinity ()
#40 0xffffffff80c4a200 in affinity ()
#41 0xffffff000270cab0 in ?? ()
#42 0xffffff8000037320 in ?? ()
#43 0xffffff80000372d8 in ?? ()
#44 0xffffff00024f1720 in ?? ()
#45 0xffffffff805d5160 in sched_switch (td=0xffffff00024dc6c0, newtd=0xffffffff8058db40, flags=Variable "flags" is not available.
) at /usr/src/sys/kern/sched_ule.c:1858
Previous frame inner to this frame (corrupt stack?)
```


----------



## lubber (Nov 16, 2009)

I've upgrade my laptop to 8.0-RC3, should I apply iwn-20091024.tar.gz first then apply iwn_merge_20081028.diff.bz2, or apply iwn_merge_20081028.diff.bz2 directly? Thanks.


----------



## bschmidt (Nov 16, 2009)

lubber said:
			
		

> I've upgrade my laptop to 8.0-RC3, should I apply iwn-20091024.tar.gz first then apply iwn_merge_20081028.diff.bz2, or apply iwn_merge_20081028.diff.bz2 directly? Thanks.



Use the SVN version if possible.


----------



## bschmidt (Nov 16, 2009)

dinoex@ said:
			
		

> After it worked on a friends laptop (diffrent hardware)
> I build the driver from svn.
> 
> Trying on amd64 I get a panic when "Raidio" is on after a few seconds.
> ...



Radio button is something I have to rely on your Input.. I do not have one that is working. 



			
				dinoex@ said:
			
		

> If the Accesspoint is off, no crash.
> 
> crashdump was not written in 7 out of 8 times.
> further panics in bufwrite, diffrent errors while writing dump.



There is an issue with null data frames leading to memory corruption, actually bus_dmamap*(). I do have a fix for that which I will commit during the next couple of days.

Thanks for testing!


----------



## lubber (Nov 16, 2009)

Get compile error after checkout code from SVN

```
awk -f /usr/src/sys/tools/acpi_quirks2h.awk /usr/src/sys/dev/acpica/acpi_quirks
./aicasm -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys
/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys
/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/contrib/opensolaris/compat -I/usr/src/sys/dev/cxgb -I/usr/src/sys
/cam/scsi -I/usr/src/sys/dev/aic7xxx -o aic7xxx_seq.h -r aic7xxx_reg.h -p aic7xxx_reg_print.c -i /usr/src/sys/dev/aic7xxx/aic7xxx_osm.h 
/usr/src/sys/dev/aic7xxx/aic7xxx.seq
./aicasm: 880 instructions used
./aicasm -nostdinc  -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf -I/usr/src/sys
/dev/ath -I/usr/src/sys/dev/ath/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sys/gnu/fs/xfs/FreeBSD -I/usr/src/sys
/gnu/fs/xfs/FreeBSD/support -I/usr/src/sys/gnu/fs/xfs -I/usr/src/sys/contrib/opensolaris/compat -I/usr/src/sys/dev/cxgb -I/usr/src/sys
/cam/scsi -I/usr/src/sys/dev/aic7xxx -o aic79xx_seq.h -r aic79xx_reg.h -p aic79xx_reg_print.c -i /usr/src/sys/dev/aic7xxx/aic79xx_osm.h 
/usr/src/sys/dev/aic7xxx/aic79xx.seq
./aicasm: 826 instructions used
awk -f /usr/src/sys/tools/miidevs2h.awk /usr/src/sys/dev/mii/miidevs
awk -f /usr/src/sys/tools/pccarddevs2h.awk /usr/src/sys/dev/pccard/pccarddevs
make: don't know how to make /usr/src/sys/teken/gensequences. Stop
*** Error code 2

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
```

What should I do now?


----------



## bschmidt (Nov 16, 2009)

Are you using the instruction of #16?


----------



## lubber (Nov 16, 2009)

No. I checked out code and copied to /usr/src/sys, and then build kernel. I'll follow #16 soon.


----------



## lubber (Nov 16, 2009)

Thank you, ha, the wireless NIC is recognized, but has not result of scan.

1. dmesg | grep iwn0

```
iwn0: <Intel(R) PRO/Wireless 5300> mem 0xd8100000-0xd8101fff irq 17 at device 0.0 on pci3
iwn0: MIMO 3T3R, MoW, address 00:21:6a:11:84:7e
iwn0: [ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11na MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps
iwn0: 11ng MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps
```
2. ifconfig iwn0 (the mac address is masked)

```
iwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether xx:xx:xx:xx:xx:xx
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
```
3. ifconfig iwn0 scan

```
ifconfig: unable to get scan results
```
4. wpa_supplicant -i iwn0 -c /etc/wpa_supplicant.conf 

```
ioctl[SIOCG80211, op 98, len 32]: Invalid argument
Failed to initialize driver interface
ELOOP: remaining socket: sock=4 eloop_data=0x28406140 user_data=0x2840d040 handler=0x8069f40
```


----------



## bschmidt (Nov 16, 2009)

There have been some changes in 8.0, you now have to use wlan0 instead of iwn0.

```
ifconfig wlan0 create wlandev iwn0
ifconfig wlan0 scan
```


----------



## lubber (Nov 16, 2009)

Thank you very much! Great, I get connection without security.


----------



## lubber (Nov 16, 2009)

Get connection using WPA (TKIP),haha


----------



## lubber (Nov 17, 2009)

It works perfect if has no security setting or using WPA, connection drops frequently if using WPA2


----------



## MellowCat (Nov 17, 2009)

How frequently?

I was wondering the same - how can we debug dropped connections?

(Is it just a matter of turning on a sysctl debug switch?)


----------



## bschmidt (Nov 17, 2009)

I would start using wpa_supplicant with verbose logging something like `# wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf -d`. If that does not yield any useful information, the next one will be net80211 debuging `# wlandebug 0xffffffff`.

Do you get any firmware errors? If not, I'm not sure whether debuging messages of iwn do help.

Were your connections idle or active at that point?


----------



## bschmidt (Nov 17, 2009)

FYI: I just committed another bunch of changes which should address most of the reported issues (commit log).

Please let me know whether those stuff gets closer to a stable driver. I will spend the next couple of days with stability tests myself.

Thanks.


----------



## oliverh (Nov 18, 2009)

Rev 7 is rather unstable for me. I'm using FreeBSD 8.0 RC3 AMD64 (Dualcore, 4G of memory) and while using csup a sudden reset took place. I try it again with a freshly compiled stable today.


----------



## bschmidt (Nov 18, 2009)

Unstable as in? There has been yet another commit fixing something related to 5GHz channels.


----------



## jonsen (Nov 18, 2009)

Thank very much! I can use the AGN5100 now.
but have some question:
ONLY: 54M


```
iwn0: <Intel(R) PRO/Wireless 5100> mem 0xf2500000-0xf2501fff irq 17 at device 0.0 on pci3
iwn0: MIMO 1T2R, MoW, address 00:22:fa:61:93:8e
iwn0: [ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
```

My laptop: Lenovo X200
system:

```
% uname -a
FreeBSD x200.isyi.com 8.0-PRERELEASE FreeBSD 8.0-PRERELEASE #12: Thu Nov 12 15:57:34 CST 2009     ymm@x200.isyi.com:/usr/obj/usr/src/sys/MYX200  i386
```

pciconfig -vl:

```
iwn0@pci0:3:0:0:        class=0x028000 card=0x12118086 chip=0x42378086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel (R) WiFi Link 5100 AGN (5100 AGN)'
    class      = network
```


----------



## oliverh (Nov 18, 2009)

bschmidt said:
			
		

> Unstable as in? There has been yet another commit fixing something related to 5GHz channels.



Mmh I don't know, I'm just using the default configuration. My Fritz Box uses 2.4GHz (802.11b+g ; n is possible but not configured) at the moment. Unstable so far just by fetching the FreeBSD source with csup.


----------



## oliverh (Nov 18, 2009)

Some data:

*pciconf -lv*


```
iwn0@pci0:5:0:0:      class=0x028000 card=0x13018086 chip=0x42328086 rev=0x00 hdr=0x00
vendor    = 'Intel Corporation'
device    = 'Carte Intel WiFi Link 5100 AGN (Intel WiFi Link 5100)'
class     = network
```

*uname -a*


```
FreeBSD skarabrae 8.0-PRERELEASE FreeBSD 8.0-PRERELEASE #0: Wed Nov 18 03:40:49 CET 2009     acheron@skarabrae:/usr/obj/usr/src/sys/GENERIC  amd64
```

I'm using WPA2 for encryption.


----------



## bschmidt (Nov 19, 2009)

jonsen said:
			
		

> Thank very much! I can use the AGN5100 now.
> but have some question:
> ONLY: 54M



Correct, no support for 11n currently.



			
				oliverh said:
			
		

> I'm using WPA2 for encryption.



I'll look into that.


----------



## oliverh (Nov 19, 2009)

So after some testing with rev 8 and FreeBSD 8 stable (prerelease) it didn't change much. Sometimes a sudden reset occurs and it doesn't matter what I do. I

Is WPA2 a possible source for this problem?


----------



## bschmidt (Nov 19, 2009)

What does reset mean? Your computer is rebooting? Connection drops? Firmware errors? Look into /var/log/messages for some messages.


----------



## oliverh (Nov 19, 2009)

bschmidt said:
			
		

> What does reset mean? Your computer is rebooting? Connection drops? Firmware errors? Look into /var/log/messages for some messages.



Sorry, I meant 'reset' similar to pulling the power cord.


----------



## bschmidt (Nov 19, 2009)

Sounds like a panic. You've been in X when the issue occurred I guess? Can you try and reproduce it while X is not running so you see what's actually going on?


----------



## oliverh (Nov 19, 2009)

bschmidt said:
			
		

> Sounds like a panic. You've been in X when the issue occurred I guess? Can you try and reproduce it while X is not running so you see what's actually going on?



Once it happened while fetching the sources with csup (but I couldn't reproduce it), later while building Xorg.


```
Nov 18 22:04:26 skarabrae kernel: Fatal trap 12: page fault while in kernel mode
Nov 18 22:04:26 skarabrae kernel: cpuid = 1; apic id = 01
Nov 18 22:04:26 skarabrae kernel: fault virtual address = 0x1c
Nov 18 22:04:26 skarabrae kernel: fault code            = supervisor read data, page not present
Nov 18 22:04:26 skarabrae kernel: instruction pointer   = 0x20:0xffffffff80848af0
Nov 18 22:04:26 skarabrae kernel: stack pointer         = 0x28:0xffffff8075b4d900
Nov 18 22:04:26 skarabrae kernel: frame pointer         = 0x28:0xffffff8075b4d910
Nov 18 22:04:26 skarabrae kernel: code segment          = base 0x0, limit 0xfffff, type 0x1b
Nov 18 22:04:26 skarabrae kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Nov 18 22:04:26 skarabrae kernel: processor eflags      = interrupt enabled, resume, IOPL = 0
Nov 18 22:04:26 skarabrae kernel: current process               = 0 (iwn0 taskq)
Nov 18 22:04:26 skarabrae kernel: trap number           = 12
Nov 18 22:04:26 skarabrae kernel: panic: page fault
Nov 18 22:04:26 skarabrae kernel: cpuid = 1
Nov 18 22:04:26 skarabrae kernel: Uptime: 5m14s
Nov 18 22:04:26 skarabrae kernel: Cannot dump. Device not defined or unavailable.
Nov 18 22:04:26 skarabrae kernel: Automatic reboot in 15 seconds - press a key on the console to abort
Nov 18 22:04:26 skarabrae kernel: Rebooting...
```

Did some tests with heavy network load and rum0 device without any problems. Just to be sure ...

Later I saw this:


```
Nov 18 22:50:20 skarabrae kernel: iwn0: iwn_config: could not configure valid TX chains, error 35
Nov 18 22:50:20 skarabrae kernel: firmware error log:
Nov 18 22:50:20 skarabrae kernel: error type      = "SYSASSERT" (0x00000005)
Nov 18 22:50:20 skarabrae kernel: program counter = 0x00001E28
Nov 18 22:50:20 skarabrae kernel: source line     = 0x00000696
Nov 18 22:50:20 skarabrae kernel: error data      = 0x0000000100000696
Nov 18 22:50:20 skarabrae kernel: branch link     = 0x000008FA000008FA
Nov 18 22:50:20 skarabrae kernel: interrupt link  = 0x000008B200000000
Nov 18 22:50:20 skarabrae kernel: time            = 3978916211
Nov 18 22:50:20 skarabrae kernel: driver status:
Nov 18 22:50:20 skarabrae kernel: tx ring  0: qid=0  cur=174 queued=18 
Nov 18 22:50:20 skarabrae kernel: tx ring  1: qid=1  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  2: qid=2  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  3: qid=3  cur=8   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  4: qid=4  cur=154 queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  5: qid=5  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  6: qid=6  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  7: qid=7  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  8: qid=8  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring  9: qid=9  cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 10: qid=10 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 11: qid=11 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 12: qid=12 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 13: qid=13 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 14: qid=14 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 15: qid=15 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 16: qid=16 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 17: qid=17 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 18: qid=18 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: tx ring 19: qid=19 cur=0   queued=0  
Nov 18 22:50:20 skarabrae kernel: rx ring: cur=26
```


----------



## bschmidt (Nov 19, 2009)

Ah! we're getting closer. Can you now do `# wlandebug 0xffffffff` before the crash, so I get a clue where in the code this does happen?


----------



## oliverh (Nov 19, 2009)

```
Nov 19 15:42:43 skarabrae kernel: wlan0: received beacon from 00:1f:3f:d1:d6:e6 rssi 41
Nov 19 15:42:43 skarabrae kernel: wlan0: received beacon from 00:1f:3f:d1:d6:e6 rssi 42
Nov 19 15:43:35 skarabrae syslogd: kernel boot file is /boot/kernel/kernel
Nov 19 15:43:35 skarabrae kernel: wlan0: received beacon from 00:1f:3f:d1:d6:e6 rssi 39
Nov 19 15:43:35 skarabrae kernel: wlan0: received beacon from 00:1f:3f:d1:d6:e6 rssi 42
Nov 19 15:43:35 skarabrae kernel: wlan0: ieee80211_bg_scan: active scan, ticks 310880 duration 150
Nov 19 15:43:35 skarabrae kernel: wlan0: [00:1f:3f:d1:d6:e6] sta power save mode on
Nov 19 15:43:35 skarabrae kernel: wlan0: [00:1f:3f:d1:d6:e6] send QoS null data frame on channel 6, pwr mgt ena
Nov 19 15:43:35 skarabrae kernel: wlan0: scan_task: chan   6g ->   1g [active, dwell min 20ms max 150ms]
Nov 19 15:43:35 skarabrae kernel: 
Nov 19 15:43:35 skarabrae kernel: 
Nov 19 15:43:35 skarabrae kernel: Fatal trap 12: page fault while in kernel mode
Nov 19 15:43:35 skarabrae kernel: cpuid = 1; apic id = 01
Nov 19 15:43:35 skarabrae kernel: fault virtual address = 0x1c
Nov 19 15:43:35 skarabrae kernel: fault code            = supervisor read data, page not present
Nov 19 15:43:35 skarabrae kernel: instruction pointer   = 0x20:0xffffffff80848af0
Nov 19 15:43:35 skarabrae kernel: stack pointer         = 0x28:0xffffff8075b4d900
Nov 19 15:43:35 skarabrae kernel: frame pointer         = 0x28:0xffffff8075b4d910
Nov 19 15:43:35 skarabrae kernel: code segment          = base 0x0, limit 0xfffff, type 0x1b
Nov 19 15:43:35 skarabrae kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Nov 19 15:43:35 skarabrae kernel: processor eflags      = interrupt enabled, resume, IOPL = 0
Nov 19 15:43:35 skarabrae kernel: current process               = 0 (iwn0 taskq)
Nov 19 15:43:35 skarabrae kernel: trap number           = 12
Nov 19 15:43:35 skarabrae kernel: panic: page fault
Nov 19 15:43:35 skarabrae kernel: cpuid = 1
Nov 19 15:43:35 skarabrae kernel: Uptime: 5m13s
Nov 19 15:43:35 skarabrae kernel: Cannot dump. Device not defined or unavailable.
Nov 19 15:43:35 skarabrae kernel: Automatic reboot in 15 seconds - press a key on the console to abort
```

Well have a look at the uptime, it's almost the same time.


----------



## bschmidt (Nov 19, 2009)

Yep.. 300secs, that is the interval bgscan takes place. Strange though, that does not happen one my test system.

As a workaround, add -bgscan to your ifconfig_wlan0 line in rc.conf. That disables background scan completely.


----------



## oliverh (Nov 19, 2009)

Maybe because I have some APs nearby (not the same channel)?


----------



## bschmidt (Nov 19, 2009)

Doubt that, seems to be happening while driver switches channels. I'll try to reproduce that.


----------



## oliverh (Nov 19, 2009)

So the system is now 37 minutes up and running without any problems (-bgscan). Did some huge downloads and I hope it stays so ;-) Btw. thanks for this drivers.


----------



## lubber (Nov 19, 2009)

Thank you for the updated driver, I can get connection using WPA2. But a few minutes ago I got a panic, the laptop rebooted suddenly. I will report if it happens again.


----------



## oliverh (Nov 19, 2009)

Try the solution mentioned above (-bgscan).


----------



## lubber (Nov 19, 2009)

The laptop has no response after using about 20 minutes, trying -bgscan now.


----------



## lubber (Nov 20, 2009)

Runs normal after setting -bgscan.


----------



## bschmidt (Nov 22, 2009)

FYI: bgscan issues have been addressed.



			
				dinoex@ said:
			
		

> Trying on amd64 I get a panic when "Raidio" is on after a few seconds.
> 
> Cash does not happen when "Radio" is off.
> When "Radio" is off on loading if_iwn the firmware is not loaded.



Can you verify that RF kill switch now works as its supposed to? You should be able to toggle the cards status.


----------



## oliverh (Nov 22, 2009)

So it's now safe to use bgscan again? Well, I'm not found of to many crashes at once ;-)


----------



## bschmidt (Nov 22, 2009)

Yep, it should be safe now.


----------



## lubber (Nov 25, 2009)

The touch-sensitive control works, thank you.


----------



## darkbalder (Nov 26, 2009)

Hi,

Thanks for the driver . I have a problem, when I load if_iwn not at boot me, I have this error:


```
iwn0: iwn5000_post_alive: could not configure WiMAX coexistence, error 35
iwn0: iwn_init_locked: could not initialize hardware, error 35
```

When I am connected to WPA2 network, my connection freezes after 20~ min. I turn off RF switch and I turn on and I have this: 


```
iwn0: iwn_config: could not add broadcast
iwn0: iwn_init_locked: could not configure hardware, error 35
```

Only reboot is the option for use the card again

I am using sources from svn.


----------



## darkbalder (Nov 26, 2009)

Thanks bschmidt, 

Here, information about my laptop:

pciconf -lv without load module at boot time 


```
hostb0@pci0:0:0:0:	class=0x060000 card=0x3a0017aa chip=0x2a408086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Mobile Memory Controller Hub'
    class      = bridge
    subclass   = HOST-PCI
vgapci0@pci0:0:2:0:	class=0x030000 card=0x3a0217aa chip=0x2a428086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel Mobile Graphic (Mobile Intel 4 Series Chipset Family)'
    class      = display
    subclass   = VGA
vgapci1@pci0:0:2:1:	class=0x038000 card=0x3a0217aa chip=0x2a438086 rev=0x07 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel Mobile Graphic (Mobile Intel 4 Series Chipset Family)'
    class      = display
uhci0@pci0:0:26:0:	class=0x0c0300 card=0x3a0a17aa chip=0x29378086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci1@pci0:0:26:1:	class=0x0c0300 card=0x3a0b17aa chip=0x29388086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci2@pci0:0:26:2:	class=0x0c0300 card=0x3a0917aa chip=0x29398086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
ehci0@pci0:0:26:7:	class=0x0c0320 card=0x3a0c17aa chip=0x293c8086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB2 Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
hdac0@pci0:0:27:0:	class=0x040300 card=0x3a0d17aa chip=0x293e8086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) HD Audio Controller'
    class      = multimedia
    subclass   = HDA
pcib1@pci0:0:28:0:	class=0x060400 card=0x3a0e17aa chip=0x29408086 rev=0x03 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 1'
    class      = bridge
    subclass   = PCI-PCI
pcib2@pci0:0:28:1:	class=0x060400 card=0x3a0f17aa chip=0x29428086 rev=0x03 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 2'
    class      = bridge
    subclass   = PCI-PCI
pcib3@pci0:0:28:2:	class=0x060400 card=0x3a1017aa chip=0x29448086 rev=0x03 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) PCIe Root Port 3'
    class      = bridge
    subclass   = PCI-PCI
uhci3@pci0:0:29:0:	class=0x0c0300 card=0x3a1417aa chip=0x29348086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci4@pci0:0:29:1:	class=0x0c0300 card=0x3a1517aa chip=0x29358086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
uhci5@pci0:0:29:2:	class=0x0c0300 card=0x3a1617aa chip=0x29368086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB Universal Host Controller'
    class      = serial bus
    subclass   = USB
ehci1@pci0:0:29:7:	class=0x0c0320 card=0x3a1717aa chip=0x293a8086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) USB2 Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
pcib4@pci0:0:30:0:	class=0x060401 card=0x383f17aa chip=0x24488086 rev=0x93 hdr=0x01
    vendor     = 'Intel Corporation'
    device     = '82801 Family (ICH2/3/4/5/6/7/8/9-M) Hub Interface to PCI Bridge'
    class      = bridge
    subclass   = PCI-PCI
isab0@pci0:0:31:0:	class=0x060100 card=0x3a1917aa chip=0x29198086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'ICH9M LPC Interface Controller'
    class      = bridge
    subclass   = PCI-ISA
atapci0@pci0:0:31:2:	class=0x010601 card=0x3a1b17aa chip=0x29298086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = '82801IB/IR/IH (ICH9 Family) Mobile SATA AHCI Controller'
    class      = mass storage
    subclass   = SATA
bge0@pci0:1:0:0:	class=0x020000 card=0x3d7e17aa chip=0x171314e4 rev=0x02 hdr=0x00
    vendor     = 'Broadcom Corporation'
    device     = 'Broadcom NetLink (TM) Fast Ethernet (BCM5906m)'
    class      = network
    subclass   = ethernet
none0@pci0:2:0:0:	class=0x028000 card=0x12118086 chip=0x42378086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel (R) WiFi Link 5100 AGN (5100 AGN)'
    class      = network
fwohci0@pci0:6:3:0:	class=0x0c0010 card=0x3d9417aa chip=0x08321180 rev=0x05 hdr=0x00
    vendor     = 'Ricoh Company, Ltd.'
    device     = 'IEEE 1394 (4 pin firewire) chip) (30CF103C)'
    class      = serial bus
    subclass   = FireWire
none1@pci0:6:3:1:	class=0x080500 card=0x3d9017aa chip=0x08221180 rev=0x22 hdr=0x00
    vendor     = 'Ricoh Company, Ltd.'
    device     = 'SDA Standard Compliant SD Host Controller (R5C832, R5C843)'
    class      = base peripheral
    subclass   = SD host controller
none2@pci0:6:3:2:	class=0x088000 card=0x3d9217aa chip=0x05921180 rev=0x12 hdr=0x00
    vendor     = 'Ricoh Company, Ltd.'
    device     = 'Ricoh Memory Stick Host Controller (13871043)'
    class      = base peripheral
none3@pci0:6:3:3:	class=0x088000 card=0x3d9117aa chip=0x08521180 rev=0x12 hdr=0x00
    vendor     = 'Ricoh Company, Ltd.'
    device     = 'Ricoh xD-Picture Card Host Controller (01cf1028)'
    class      = base peripheral
```

dmesg after:

kldload if_iwn
 ifconfig wlan0 create wlandev iwn0
 ifconfig wlan0 up
 ifconfig wlan0 scan​

```
pci0: driver added
pci1: driver added
pci2: driver added
found->	vendor=0x8086, dev=0x4237, revid=0x00
	domain=0, bus=2, slot=0, func=0
	class=02-80-00, hdrtype=0x00, mfdev=0
	cmdreg=0x0006, statreg=0x0010, cachelnsz=16 (dwords)
	lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=a, irq=17
	powerspec 3  supports D0 D3  current D0
	MSI supports 1 message, 64 bit
pci0:2:0:0: reprobing on driver added
iwn0: <Intel(R) PRO/Wireless 5100> mem 0xd1400000-0xd1401fff irq 17 at device 0.0 on pci2
iwn0: Reserved 0x2000 bytes for rid 0x10 type 3 at 0xd1400000
iwn0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 258 to local APIC 1 vector 53
iwn0: using IRQ 258 for MSI
iwn0: MIMO 1T2R, MoW, address 00:22:fa:9d:79:48
iwn0: [MPSAFE]
iwn0: [ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
pci3: driver added
pci6: driver added
found->	vendor=0x1180, dev=0x0822, revid=0x22
	domain=0, bus=6, slot=3, func=1
	class=08-05-00, hdrtype=0x00, mfdev=1
	cmdreg=0x0006, statreg=0x0210, cachelnsz=16 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=b, irq=21
	powerspec 2  supports D0 D1 D2 D3  current D0
pci0:6:3:1: reprobing on driver added
found->	vendor=0x1180, dev=0x0592, revid=0x12
	domain=0, bus=6, slot=3, func=2
	class=08-80-00, hdrtype=0x00, mfdev=1
	cmdreg=0x0006, statreg=0x0210, cachelnsz=16 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=b, irq=21
	powerspec 2  supports D0 D1 D2 D3  current D0
pci0:6:3:2: reprobing on driver added
found->	vendor=0x1180, dev=0x0852, revid=0x12
	domain=0, bus=6, slot=3, func=3
	class=08-80-00, hdrtype=0x00, mfdev=1
	cmdreg=0x0006, statreg=0x0210, cachelnsz=16 (dwords)
	lattimer=0x20 (960 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns)
	intpin=b, irq=21
	powerspec 2  supports D0 D1 D2 D3  current D0
pci0:6:3:3: reprobing on driver added
wlan0: bpf attached
wlan0: bpf attached
wlan0: Ethernet address: 00:22:fa:9d:79:48
firmware: 'iwn5000fw' version 0: 353240 bytes loaded at 0xffffffff810380b0
interrupt reg1=8000000 reg2=1
interrupt reg1=8000000 reg2=1
interrupt reg1=8000000 reg2=1
interrupt reg1=8000000 reg2=1
interrupt reg1=80000001 reg2=40010000
interrupt reg1=80000001 reg2=40010000
iwn_notif_intr: qid 0 idx 0 flags 0 type 0(UNKNOWN INTR NOTIF/CMD) len 0
iwn5000_ict_reset: enabling ICT
iwn5000_send_wimax_coex: Configuring WiMAX coexistence
iwn_cmd: IWN5000_CMD_WIMAX_COEX (0x5a) flags 0 qid 4 idx 0
interrupt reg1=80000000 reg2=0
interrupt reg1=80000000 reg2=0
iwn_notif_intr: qid 0 idx 0 flags 0 type 0(UNKNOWN INTR NOTIF/CMD) len 0
interrupt reg1=10000000 reg2=0
interrupt reg1=10000000 reg2=0
iwn0: iwn5000_post_alive: could not configure WiMAX coexistence, error 35
iwn0: iwn_init_locked: could not initialize hardware, error 35
```


----------



## lubber (Nov 27, 2009)

Pls refer to #36.


----------



## jogi (Dec 1, 2009)

Hi all, 
I did this commands:


```
$ cd /usr/src/syssvn co [url]http://svn.techwires.net/svn/projects/freebsd[/url]
$ cd freebsd/sys/modules/iwnfw
$ make
$ make install
$ cd ../iwn
$ env CFLAGS=-I$PWD/../../ make
$ make install
```

After that I built the kernel.


```
$ ifconfig wlan0 create wlandev iwn0
$ ifconfig wlan0 scan
$ ifconfig wlan0 bgscan
$ wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf -ddt
```
I have FreeBSD 8.0-Release, x86, CPU IntelCoreDuo, Intel Pro 5300. 

This is my wpa_supplicant.conf


```
ctrl_interface=/var/run/wpa_supplicant
#ap_scan=2

network={
       ssid="my"
       scan_ssid=1
       proto=WPA
       key_mgmt=WPA-PSK
       pairwise=TKIP
       psk=my_psk
}
```

Can you help me, pls?


----------



## jogi (Dec 1, 2009)

Sorry, I didn't write my problem.  Still automatic restart when I switch off my AP.


----------



## bschmidt (Dec 1, 2009)

jogi said:
			
		

> Sorry, I didn't write my problem.  Still automatic restart when I switch off my AP.



Switch to console, enable debugging

```
wlandebug 0xffffffff
sysctl dev.iwn.0.debug=0xffffffff
```

and post the output please.


----------



## jogi (Dec 2, 2009)

bschmidt said:
			
		

> Switch to console, enable debugging
> 
> ```
> wlandebug 0xffffffff
> ...



Thanks for reply, bschmidt. I lost all data on my hard disc drive and I had to change my partitions too, so I reinstalled OS and it's fully working now. I'm very sorry and thank you for your time.


----------



## bschmidt (Dec 2, 2009)

You're welcome, glad to hear that it works now. Hope you didn't loose to much data.


----------



## oliverh (Dec 2, 2009)

It's unusable now with rev 17. 


```
[B]uname[/B]

FreeBSD 8.0-STABLE #0: Wed Dec  2 18:11:00 CET 2009     acheron@:/usr/obj/usr/src/sys/GENERIC

[B]ifconfig[/B]

wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:21:5d:f3:8b:8c
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 9 (2452 Mhz 11g)
        country US authmode OPEN privacy OFF txpower 15 bmiss 10 scanvalid 60
        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
        protmode CTS wme bintval 0


[B]dmesg[/B]

iwn0: device timeout
iwn0: iwn5000_post_alive: could not configure WiMAX coexistence, error 35
iwn0: iwn_init_locked: could not initialize hardware, error 35


[B]debug[/B]

wlan0: ieee80211_vap_detach: STA parent iwn0
wlan0: stop running, 0 vaps running
wlan0: ieee80211_new_state_locked: INIT -> INIT (nrunning 0 nscanning 0)
wlan0: ieee80211_newstate_cb: INIT -> INIT arg -1
iwn_newstate: INIT -> INIT
wlan0: sta_newstate: INIT -> INIT (-1)
wlan0: sta_newstate: unexpected state transition INIT -> INIT
wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
wlan0: node_reclaim: remove 0xffffff8001cdb000<00:21:5d:f3:8b:8c> from station table, refcnt 1
wlan0: Ethernet address: 00:21:5d:f3:8b:8c
interrupt reg1=8000000 reg2=1
interrupt reg1=8000000 reg2=1
interrupt reg1=80000001 reg2=40010000
iwn_notif_intr: qid 0 idx 0 flags 0 type 0(UNKNOWN INTR NOTIF/CMD) len 0
iwn5000_ict_reset: enabling ICT
iwn5000_send_wimax_coex: Configuring WiMAX coexistence
iwn_cmd: IWN5000_CMD_WIMAX_COEX (0x5a) flags 0 qid 4 idx 0
interrupt reg1=80000000 reg2=0
iwn_notif_intr: qid 0 idx 0 flags 1 type 49(UNKNOWN INTR NOTIF/CMD) len 61
interrupt reg1=10000000 reg2=0
iwn0: iwn5000_post_alive: could not configure WiMAX coexistence, error 35
iwn0: iwn_init_locked: could not initialize hardware, error 35
```


----------



## bschmidt (Dec 3, 2009)

oliverh said:
			
		

> It's unusable now with rev 17.



What is the last rev that did work? 16?

I might have seen the cause.. PREWRITE vs. POSTREAD. I'll look into this tonight.


----------



## oliverh (Dec 3, 2009)

No, this was the first update since rev 14


----------



## dinoex@ (Dec 4, 2009)

with rev 17. the systems freezes hard on my Lenovo N 500, FreeeBD 8.0 amd64, with a kernal panic after i enable rthe radio switch.

I can not obtain any dump.


```
pci0:4:0:0: reprobing on driver added
iwn0: <Intel(R) PRO/Wireless 5100> mem 0xf4700000-0xf4701fff irq 18 at device 0.0 on pci4
pcib3: iwn0 requested memory range 0xf4700000-0xf4701fff: good
iwn0: attempting to allocate 1 MSI vectors (1 supported)
msi: routing MSI IRQ 256 to local APIC 0 vector 48
iwn0: using IRQ 256 for MSI
iwn0: MIMO 1T2R, MoW, address 00:21:6b:a9:e4:22
iwn0: [MPSAFE]
iwn0: [ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbp
wlan0: bpf attached
wlan0: bpf attached
wlan0: Ethernet address: 00:21:6b:a9:e4:22
if_delmulti_locked: detaching ifnet instance 0xffffff011f5c0000
last message repeated 11 times
Expensive timeout(9) function: 0xffffffff8060c4e0(0) 0.076722181 siwn0: 
kernel: radio is disabled by hardware switch
wpa_supplicant[2033]: Failed to initiate AP scan.
iwn0: radio is disabled by hardware switch
wpa_supplicant[2033]: Failed to initiate AP scan.

wpa_supplicant[2033]: Failed to initiate AP scan.
wpa_supplicant[2033]: Failed to initiate AP scan.
kernel: iwn0: RF switch: radio enabled
kernel: firmware: 'iwn5000fw' version 0: 353240 bytes loaded at 0xffffffff812bb0b0
kernel: ugen0.2: <Broadcom Corp> at usbus0
syslogd: restart
```

With full "Debugging On" the computer does not crash.
It seems to work a little. But it can't hold the conenction.


```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:21:6b:a9:e4:22
        inet6 fe80::221:6bff:fea9:e422%wlan0 prefixlen 64 scopeid 0x6 
        inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
        media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g
        status: associated
        ssid dinoex-hbw2 channel 13 (2472 Mhz 11g) bssid 00:23:08:4e:07:08
        regdomain ETSI country DE authmode WPA2/802.11i privacy ON
        deftxkey UNDEF txpower 30 bmiss 10 scanvalid 450 bgscan
        bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
        wme roaming MANUAL
```

full log in http://people.freebsd.org/~dinoex/logs/iwn0.log


----------



## bschmidt (Dec 4, 2009)

I committed several changes a minute ago, which also changes a bus_dmamap_sync() call. This might fix a bunch of initialization and random firmware errors. It also prevents a deadlock condition.

for the last 14 hours, with that version, I had no connection loss, no packet loss, no LOR and no dead lock using a 5100 over a WPA connection.




			
				dinoex@ said:
			
		

> with rev 17. the systems freezes hard on my Lenovo N 500, FreeeBD 8.0 amd64, with a kernal panic after i enable rthe radio switch.
> 
> I can not obtain any dump.



Not even a backtrace?



			
				dinoex@ said:
			
		

> With full "Debugging On" the computer does not crash.
> It seems to work a little. But it can't hold the conenction.



Firmware errors re-init the driver almost completely, dropping connection is expected. So we must prevent any of this.

Let me know whether those still occur in rev20, if they do, we have to find the cause.


----------



## oliverh (Dec 4, 2009)

I tried rev21 and I have no problem so far.

This is the debug output (it's some kind of lengthy mess):

http://bsdpaste.bsdgroup.de/9010

but it works again


----------



## oliverh (Dec 5, 2009)

Well, I had a panic (at least I suppose so) after about an hour. I didn't find anything in the logs.


----------



## bschmidt (Dec 6, 2009)

oliverh said:
			
		

> Well, I had a panic (at least I suppose so) after about an hour. I didn't find anything in the logs.



Let me know if that still happens with rev23. You might also want to add

```
dumpdev=AUTO
```
to /etc/rc.conf to get a vmcore to analyse.


----------



## oliverh (Dec 6, 2009)

Tried rev23 but still no success. The machine paniced after about 10 minutes.


```
[B]uname[/B]

FreeBSD skarabrae 8.0-STABLE FreeBSD 8.0-STABLE #1: Sun Dec  6 11:34:44 CET 2009     acheron@skarabrae:/usr/obj/usr/src/sys/GENERIC  amd64
```

I tried this a 2nd time in the console and I didn't see a thing, it just freezes and I have to press the power button.


----------



## oliverh (Dec 6, 2009)

Tried it two times to get something useful. 2nd crash followed after 50s uptime.


```
Dec  6 13:38:23 skarabrae kernel: Fatal trap 12: page fault while in kernel mode
Dec  6 13:38:23 skarabrae kernel: cpuid = 0; apic id = 00
Dec  6 13:38:23 skarabrae kernel: fault virtual address = 0x28
Dec  6 13:38:23 skarabrae kernel: fault code            = supervisor write data, page not present
Dec  6 13:38:23 skarabrae kernel: instruction pointer   = 0x20:0xffffffff80849f95
Dec  6 13:38:23 skarabrae kernel: stack pointer         = 0x28:0xffffff8075b4aa90
Dec  6 13:38:23 skarabrae kernel: frame pointer         = 0x28:0xffffff8075b4aac0
Dec  6 13:38:23 skarabrae kernel: code segment          = base 0x0, limit 0xfffff, type 0x1b
Dec  6 13:38:23 skarabrae kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Dec  6 13:38:23 skarabrae kernel: processor eflags      = interrupt enabled, resume, IOPL = 0
Dec  6 13:38:23 skarabrae kernel: current process               = 12 (irq258: iwn0)
Dec  6 13:38:23 skarabrae kernel: trap number           = 12
Dec  6 13:38:23 skarabrae kernel: panic: page fault
Dec  6 13:38:23 skarabrae kernel: cpuid = 0
Dec  6 13:38:23 skarabrae kernel: Uptime: 50s
```


*core.txt.0*

http://bsdpaste.bsdgroup.de/9097


----------



## bschmidt (Dec 6, 2009)

oliverh said:
			
		

> Tried it two times to get something useful. 2nd crash followed after 50s uptime.
> 
> http://bsdpaste.bsdgroup.de/9097



Thanks that did help.

I'm running stable/8 now with rev 24 without a panic. What I haven't seen yet is the freeze you've mentioned. I'll poke around a bit and try to reproduce it.


----------



## oliverh (Dec 6, 2009)

Well, I will test rev24 now. Thx a lot for the quick response.


----------



## oliverh (Dec 6, 2009)

Well it works ... sort of. At least I see no panic, but the connection transmits garbage only. I can see this with elinks, Firefox stops working at once, if I try to load something.


----------



## oliverh (Dec 7, 2009)

Did another test just to be sure without acpi_sony_load="YES" and kern.hz=100 in /boot/loader.conf. The result: another panic with if_iwn rev24.

Details: http://bsdpaste.bsdgroup.de/9149


Btw. I'm not able to reproduce the garbarge, maybe just bad luck.


----------



## bschmidt (Dec 8, 2009)

oliverh said:
			
		

> Did another test just to be sure without acpi_sony_load="YES" and kern.hz=100 in /boot/loader.conf. The result: another panic with if_iwn rev24.
> 
> Details: http://bsdpaste.bsdgroup.de/9149
> 
> ...



I'll will look into that, thanks!


----------



## LesJen (Dec 8, 2009)

I just found out that a driver for the Intel 5300 AGN is availible. I've read the thread and I'm a little unsure on the installation. The driver that comes with 8.0-RELEASE does not load so it's clear I'll have to get it from somewhere. My machine is a DELL Latitude 6500 with the above WiFi card. I'm using a usb wifi a the moment and it would be great to be able to use the built in Intel card. Thanks for any hints


----------



## oliverh (Dec 8, 2009)

LesJen said:
			
		

> I just found out that a driver for the Intel 5300 AGN is availible. I've read the thread and I'm a little unsure on the installation. The driver that comes with 8.0-RELEASE does not load so it's clear I'll have to get it from somewhere. My machine is a DELL Latitude 6500 with the above WiFi card. I'm using a usb wifi a the moment and it would be great to be able to use the built in Intel card. Thanks for any hints




http://forums.freebsd.org/showpost.php?p=47627&postcount=16


----------



## LesJen (Dec 8, 2009)

Thanks!

I'm not used to use patches, so I wrote because I got an error when I tried what is described in the link.

The command
svn co http://svn.techwires.net/svn/projects/freebsd
Gives
svn: Command not found

What do I need to install?


----------



## jonsen (Dec 8, 2009)

LesJen said:
			
		

> Thanks!
> 
> I'm not used to use patches, so I wrote because I got an error when I tried what is described in the link.
> 
> ...



install svn:

```
# cd /usr/ports/devel/subversion
# make install clean
```


----------



## oliverh (Dec 8, 2009)

Yes sorry, of course you have to install subversion first, as mentioned above.


----------



## LesJen (Dec 8, 2009)

Thank you!

It works fine. Had to configure the wlan0 in rc.conf, then it connected.

Thanks to bschmidt for the driver 

If I can provide information or other feedback, Please let me know.


----------



## LesJen (Dec 9, 2009)

Update! I've had two reboots since installing the iwn driver. It starts with the PC getting unresponsive, the wifi lamp/indicator flashes, it's usually on, and then the computer reboots. Another thing I've noticed is that the xfce's wavelan indicator in the beginning shows low signal strenght but after 10 - 15 minutes it's indicating full level strenght. This is without moving the computer. Any comments?


----------



## bschmidt (Dec 9, 2009)

LesJen said:
			
		

> Update! I've had two reboots since installing the iwn driver. It starts with the PC getting unresponsive, the wifi lamp/indicator flashes, it's usually on, and then the computer reboots.



More input please. Check your /var/log/messages if there is something about a panic.



			
				LesJen said:
			
		

> Another thing I've noticed is that the xfce's wavelan indicator in the beginning shows low signal strenght but after 10 - 15 minutes it's indicating full level strenght. This is without moving the computer. Any comments?



On initial connect the rate is set to 36Mbit/s after the first few packets go through the rate control algo ups it to 54Mbit/s. That is probably what you are seeing.


----------



## LesJen (Dec 9, 2009)

I looked for signs of a panic but could not find any. I'll keep you posted if it happens again.


----------



## oliverh (Dec 9, 2009)

I get panics shortly after a reboot (50-60s) or sometimes after about 10 minutes. Are there any special flags to set e.g. in wpa_supplicant.conf or something else to consider?


----------



## bschmidt (Dec 9, 2009)

oliverh said:
			
		

> I get panics shortly after a reboot (50-60s) or sometimes after about 10 minutes. Are there any special flags to set e.g. in wpa_supplicant.conf or something else to consider?



This is what I'm using currently, nothing fancy.

```
ap_scan=1

network={
        ssid="XYZ"
        scan_ssid=1
        key_mgmt=WPA-PSK
        proto=RSN
        pairwise=CCMP
        group=CCMP
        psk="deadbeef"
}
```

I'm curious, do you have systems with >= 4GB of RAM?


----------



## oliverh (Dec 9, 2009)

Yes I'm using FreeBSD 8.0-stable (AMD64) with 4G of memory.


----------



## LesJen (Dec 11, 2009)

I had a reboot now! This is what I have in /var/log/messages


```
Dec 11 09:23:41 bljbsd01 wpa_supplicant[393]: CTRL-EVENT-SCAN-RESULTS
Dec 11 09:29:09 bljbsd01 wpa_supplicant[393]: CTRL-EVENT-SCAN-RESULTS
Dec 11 09:34:17 bljbsd01 wpa_supplicant[393]: CTRL-EVENT-SCAN-RESULTS
Dec 11 09:40:22 bljbsd01 syslogd: kernel boot file is /boot/kernel/kernel
```


----------



## bschmidt (Dec 12, 2009)

Hi,

I do now have 4GB of RAM and the first thing I got when loading if_iwn.ko with more than 3.2GB RAM in use was a panic.. :x

The condition leading to the panic could only occur with more than 2GB addressable memory, that's why I couldn't reproduce it with my setup.

Fixed with rev 25.


----------



## LesJen (Dec 12, 2009)

I have a question! Is it just a matter of repeating the steps outlined in post 71 in order to "upgrade" to rev. 25?
Thanks


----------



## bschmidt (Dec 12, 2009)

LesJen said:
			
		

> I have a question! Is it just a matter of repeating the steps outlined in post 71 in order to "upgrade" to rev. 25?
> Thanks



If you did it like that, for an update:

```
$ cd /usr/src/syssvn/freebsd
$ svn up
$ cd sys/modules/iwnfw
$ make
$ make install
$ cd ../iwn
$ env CFLAGS=-I$PWD/../../ make
$ make install
```


----------



## LesJen (Dec 12, 2009)

$ cd /usr/src/syssvn/freebsd
Is this path correct? I don't have it!


----------



## oliverh (Dec 12, 2009)

LesJen said:
			
		

> $ cd /usr/src/syssvn/freebsd
> Is this path correct? I don't have it!




No, you certainly have a different path, look for the directory freebsd in /home/user or /root


----------



## oliverh (Dec 12, 2009)

bschmidt said:
			
		

> Hi,
> 
> I do now have 4GB of RAM and the first thing I got when loading if_iwn.ko with more than 3.2GB RAM in use was a panic.. :x
> 
> ...




Seems to work - I do some tests now. But I have another question, if I stop the network with /etc/rc.d/netif stop and start it later the system throws a panic. This has nothing to do with if_iwn, but is common behaviour since FreeBSD 8.0R (and stable) at least while using anything Wifi (if_rum, if_iwn, if_ath and if_wpi) .


----------



## oliverh (Dec 12, 2009)

Well, after about 2h: panic.


----------



## err0r (Dec 13, 2009)

Hi,

I have Toshiba U400 with Intel wireless 5100 and Marvell Yukon 88e8072 ethernet card and I have FreeBSD 8.0-RELEASE installed. BTW my ethernet card doesn't work and in forums they say that it should work with ACPI disabled, but FreeBSD doesn't boot in that case . So if I have ethernet enabled in BIOS and try to load if_iwn all I have is kernel panic with no dump. If ethernet is disabled in BIOS I get error "could not allocate memory resource". May be I did something wrong...
BTW it works under OpenBSD but after some inactivity timeout the connection is lost. So I have two ways either send small packets (like ping) with some timeout or reconnect after connection is lost.
If you need some information like logs/dumps please let me know.

Thank You


----------



## LesJen (Dec 13, 2009)

rev. 25 made my card unable to connect. Wifi indicator blinking all the time, no signal strength at all. /var/log/messages says nothing! So in my case this was a downgrade :-(


```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:16:ea:61:01:e8
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        ssid "" channel 1 (2412 Mhz 11g)
        country US authmode WPA1+WPA2/802.11i privacy ON deftxkey UNDEF
        txpower 15 bmiss 10 scanvalid 450 bgscan bgscanintvl 300
        bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
        bintval 0
```


----------



## bschmidt (Dec 13, 2009)

err0r said:
			
		

> Hi,
> 
> I have Toshiba U400 with Intel wireless 5100 and Marvell Yukon 88e8072 ethernet card and I have FreeBSD 8.0-RELEASE installed. BTW my ethernet card doesn't work and in forums they say that it should work with ACPI disabled, but FreeBSD doesn't boot in that case . So if I have ethernet enabled in BIOS and try to load if_iwn all I have is kernel panic with no dump. If ethernet is disabled in BIOS I get error "could not allocate memory resource". May be I did something wrong...
> BTW it works under OpenBSD but after some inactivity timeout the connection is lost. So I have two ways either send small packets (like ping) with some timeout or reconnect after connection is lost.
> ...



You should get at least a message while being on console.


----------



## oliverh (Dec 13, 2009)

There is another problem, while using the driver (rev25) I saw several checksum errors while downloading and installing different ports. I can reproduce this 'garbage' after 1-2 hours.


----------



## bschmidt (Dec 13, 2009)

Ok, I had a panic half an hour ago, about bounce pages not being allocated. Smells like a wrong DMA tag is used somewhere or incorrect alignment.



			
				oliverh said:
			
		

> There is another problem, while using the driver (rev25) I saw several checksum errors while downloading and installing different ports. I can reproduce this 'garbage' after 1-2 hours.



Might be related to the above, if a wrong DMA tag or map is used, memory gets totally cluttered.

Working on that.


----------



## bschmidt (Dec 14, 2009)

I'm working on an overhaul of the bus_dma*() related stuff, actually I missed quite a few bits while merging Sam's and OpenBSD's code. Sorry for that.

It looks promising, just needs some clean up and another few hours of testing before I commit it.


----------



## dduong (Dec 14, 2009)

Keep up the good work!  I've been using this driver and so far it's ok besides the restarts (which seems that you might have find the issue)


----------



## eyebone (Dec 15, 2009)

great! thank you very much for your work. 
i will test the driver the next days, i go with 5300AGN, lets see what the results are.


----------



## Arne (Dec 15, 2009)

*25 ist working*

Hello,

Lenovo Thinkpad W500, Intel(R) PRO/Wireless 5300, FreeBSD 8.0 stable

Rev. 25 ist the first revision which is working without any visible problems on my Thinkpad.

All revs < 25 had problems with unreliable connections.

Thank you very much!

.//. Arne


----------



## LesJen (Dec 16, 2009)

I don't know if it's of any use but I got this when I tried to "ifconfig wlan0 down"


```
wpa_supplicant [397]: Failed to disable WPA in the driver
```


----------



## bschmidt (Dec 19, 2009)

bschmidt said:
			
		

> I'm working on an overhaul of the bus_dma*() related stuff, actually I missed quite a few bits while merging Sam's and OpenBSD's code. Sorry for that.
> 
> It looks promising, just needs some clean up and another few hours of testing before I commit it.



Finally committed. Please give it a try and let me know how it works.

Thanks


----------



## oliverh (Dec 19, 2009)

Did some tests for almost 2h now. Almost 45 min download at full speed (DSL 1.7MiB/s) and at the same time lots of network traffic. So far so good, I didn't experience any drops of the connection, slow downs or data garbage.

[addendum]now over 4h without any problems and heavy traffic


----------



## Defre (Dec 20, 2009)

Hi,

I compiled and loaded rev. 26 today, it works very well with wpa_supplicant on a WPA TKIP network (rev. 25 made the computer freeze).

My hardware:

```
iwn0@pci0:5:0:0:        class=0x028000 card=0x13018086 chip=0x42328086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Carte Intel WiFi Link 5100 AGN (Intel WiFi Link 5100)'
    class      = network
```

Init code:

```
kldload ./iwn5000fw.ko
kldload ./if_iwn.ko
```

Dmesg:

```
iwn0: <Intel(R) PRO/Wireless 5100> mem 0xfeafe000-0xfeafffff irq 18 at device 0.0 on pci5
iwn0: MIMO 1T2R, MoW, address 00:22:fb:b7:43:ea
iwn0: [ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
```

However, tested for almost 15 min now .


----------



## thuglife (Dec 20, 2009)

Rev 26 seems very stable, i am using it since you did the commit and i have zero issues. Rev 25 was almost unusable for me.


----------



## oliverh (Dec 20, 2009)

Another status report: after almost 12h - in 2 days - I haven't experienced any problems at all. Hope we will see this great driver in FBSD 8.1.


----------



## dduong (Dec 20, 2009)

I can also say that I haven't had any issues on rev26.  I'm running 8.0 (AMD64) on an X200 with an Intel 5300.


----------



## LesJen (Dec 21, 2009)

Hello
I've upgraded as well, it took a little while to figure out that I needed to load yet another module (iwn5000fw.ko).
Now wlan0 connects but not to the network specified in wpa_supplicant.conf!
I get an IP-address from someone elses network! How do I avoid this?
Thanks
/Leslie


----------



## oliverh (Dec 21, 2009)

Without any further details it's just wild guessing.


----------



## LesJen (Dec 21, 2009)

oliverh said:
			
		

> Without any further details it's just wild guessing.



What details would you like me to provide?


----------



## oliverh (Dec 21, 2009)

Your part of /etc/rc.conf regarding the wifi config and /etc/wpa_supplicant.conf _without_ your password ;-)


----------



## LesJen (Dec 21, 2009)

I just want to ad that this config worked with v.24 of this driver!

rc.conf


```
wpa_supplicant_enable="YES"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
```


wpa_supplicant.conf


```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
#
network={
        ssid="my ssid"
        scan_ssid=1
        priority=1
        psk="hidden password"
}
```


----------



## eyebone (Dec 22, 2009)

so finally some time to test it. rev. 26 compiles and works so far on:


```
kernel: iwn0: <Intel(R) PRO/Wireless 5300> mem 0xf2500000-0xf2501fff irq 17 at device 0.0 on pci3
```

wpa_supplicant with WPA key + AP connection working perfeclty, doing some stress tests ...

observations i made:
1. changing the mac address of wlan0 ends up in a flapping connection with a former working wpa_supplicant configuration.


```
kernel: wlan0: link state changed to DOWN
kernel: wlan0: link state changed to UP
kernel: wlan0: link state changed to DOWN
kernel: wlan0: link state changed to UP
```

2. changing both, wlan0 and iwn0 to the same (fake) mac address results in no connection to the AP at all, even no flapping stuff.

3. i tried the also the aircrack-ng suite, now listening for other networks seems so far not to work i guess this would be also the same for injecting, but i didnt test that so far

if you need wpa_supplicant output i can paste you, but i guess you can reproduce the problem without problems.

in anyway thank you for a working wireless driver  !!

regards,


----------



## LesJen (Dec 22, 2009)

If I have ifconfig_wlan0="WPA DHCP" in rc.conf. It will connect and work.
If I have ifconfig_wlan0="inet 172.17.0.159 netmask 255.255.255.0" it won't connect!
Any ideas on what's the problem?


----------



## bschmidt (Dec 22, 2009)

eyebone said:
			
		

> observations i made:
> 1. changing the mac address of wlan0 ends up in a flapping connection with a former working wpa_supplicant configuration.
> 
> 
> ...



Never actually tried that, added to my TODO list.



			
				eyebone said:
			
		

> 3. i tried the also the aircrack-ng suite, now listening for other networks seems so far not to work i guess this would be also the same for injecting, but i didnt test that so far



Yup, radiotap/monitor mode is another point on the TODO list.


----------



## bschmidt (Dec 22, 2009)

LesJen said:
			
		

> If I have ifconfig_wlan0="WPA DHCP" in rc.conf. It will connect and work.
> If I have ifconfig_wlan0="inet 172.17.0.159 netmask 255.255.255.0" it won't connect!
> Any ideas on what's the problem?



Add a SSID maybe?


----------



## LesJen (Dec 22, 2009)

I saw now in the handbook what you mean! Unfortunately it won't connect with the line:

ifconfig_wlan0="ssid my_ssid inet 172.17.0.159 netmask 255.255.255.0"

Is there anything else I can do to make it connect?


----------



## bschmidt (Dec 22, 2009)

LesJen said:
			
		

> Do you mean the SSID that I have in wpa_supplicant.conf? Where should I put it?




```
ifconfig_wlan0="ssid YOURSSID 172.17.0.159 netmask 255.255.255.0"
```


----------



## LesJen (Dec 22, 2009)

I've tried now for more than ten minutes. It won't connect when an IP-address is set. DHCP is ok. If it's dependent of the ssid parameter when setting the IP-address, how come the ssid is not needed when using DCHP?
Could it be something else that's preventing it from connecting?


----------



## robbak (Dec 24, 2009)

In the first line you were trying to connect with WPA (ifconfig_xxx0 WPA DHCP). Now you are trying to connect without it (ifconfig_xxx0 ssid YOURID youraddress netmask yournetmask)

Have you turned off encryption on the network, or have you just forgotten  WPA?


----------



## oliverh (Dec 25, 2009)

Using rev27 for about an hour without any problems so far, runs very smooth


----------



## LesJen (Dec 26, 2009)

robbak said:
			
		

> In the first line you were trying to connect with WPA (ifconfig_xxx0 WPA DHCP). Now you are trying to connect without it (ifconfig_xxx0 ssid YOURID youraddress netmask yournetmask)
> 
> Have you turned off encryption on the network, or have you just forgotten  WPA?



Thank you very much for this answer  No I have not turned off the encryption! But I have forgotten to put WPA in the ifconfig line. Very observant of you and I need to polish my glasses 

PS: SSID is not needed now


----------



## dduong (Dec 27, 2009)

Is there a way I can check the rev that I'm using?  I want to know if I applied the svn patch correctly.

Thanks!


----------



## bschmidt (Dec 27, 2009)

dduong said:
			
		

> Is there a way I can check the rev that I'm using?  I want to know if I applied the svn patch correctly.
> 
> Thanks!



If you mean something like

```
iwn revsion XY loaded
```
then no, there isn't.

The best way to ensure that you are using the latest SVN version, is to remove any if_iwn.ko and iwn??00fw.ko modules from /boot/kernel/ and checkout/build the driver afterward.


----------



## dduong (Dec 27, 2009)

Thanks bschmidt.

I've recently upgraded my X200 to 4gb of RAM and after checkout/build of the rev 27 driver plus recompile the kernel; everytime I start wpa_supplicant, my wireless LED shows up and my whole laptop crashes and reboots.  I enabled the debug and this is what I see:


```
Dec 27 10:38:58 dduong-freebsd kernel: Fatal trap 12: page fault while in kernel mode
Dec 27 10:38:58 dduong-freebsd kernel: cpuid = 0; apic id = 00
Dec 27 10:38:58 dduong-freebsd kernel: fault virtual address    = 0x1c
Dec 27 10:38:58 dduong-freebsd kernel: fault code               = supervisor read data, page not present
Dec 27 10:38:58 dduong-freebsd kernel: instruction pointer      = 0x20:0xffffffff80550a20
Dec 27 10:38:58 dduong-freebsd kernel: stack pointer            = 0x28:0xffffff8072b508f0
Dec 27 10:38:58 dduong-freebsd kernel: frame pointer            = 0x28:0xffffff8072b50900
Dec 27 10:38:58 dduong-freebsd kernel: code segment             = base 0x0, limit 0xfffff, type 0x1b
Dec 27 10:38:58 dduong-freebsd kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Dec 27 10:38:58 dduong-freebsd kernel: processor eflags = interrupt enabled, resume, IOPL = 0
Dec 27 10:38:58 dduong-freebsd kernel: current process          = 0 (iwn0 taskq)
Dec 27 10:38:58 dduong-freebsd kernel: trap number              = 12
Dec 27 10:38:58 dduong-freebsd kernel: panic: page fault
Dec 27 10:38:58 dduong-freebsd kernel: cpuid = 0
Dec 27 10:38:58 dduong-freebsd kernel: Uptime: 1m32s
Dec 27 10:38:58 dduong-freebsd kernel: Cannot dump. Device not defined or unavailable.
Dec 27 10:38:58 dduong-freebsd kernel: Automatic reboot in 15 seconds - press a key on the console to abort
Dec 27 10:38:58 dduong-freebsd kernel: Rebooting...
Dec 27 10:38:58 dduong-freebsd kernel: cpu_reset: Stopping other CPUs
```

Sorry, I'm new to this whole debugging process and I've only learned how to do it from the previous posts.  I will try to provide you as much info as possible if requested.


----------



## bschmidt (Dec 27, 2009)

Did you build/install the kernel before or after you've compiled the wireless driver? I just ask, because if you install a kernel afterwards it overwrites the wireless driver.


----------



## dduong (Dec 27, 2009)

I built/installed the kernel after compiling the wireless driver. 

I assume that I was suppose to compile the wireless driver without build/install the kernel?


----------



## bschmidt (Dec 27, 2009)

Exactly, there's usually no reason to rebuild the kernel, just the driver is enough.

Let me know if the panic still exists.


----------



## dduong (Dec 27, 2009)

Thanks!

Here is what I did so far.

1) Removed any if_iwn.ko and iwn??00fw.ko modules in /boot/kernel/
2) Build/Install kernel (start things from scratch)
3) Followed your instructions on post #16.
4) For kicks, I've rebooted

Kernel sees the hardware:


```
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: <Intel(R) PRO/Wireless 5300> mem 0xf2500000-0xf2501fff irq 17 at device 0.0 on pci3
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: MIMO 3T3R, MoW, address 00:21:6a:85:55:e0
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: [ITHREAD]
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: 11na MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps
Dec 27 12:14:42 dduong-freebsd kernel: iwn0: 11ng MCS: 15Mbps 30Mbps 45Mbps 60Mbps 90Mbps 120Mbps 135Mbps 150Mbps 30Mbps 60Mbps 90Mbps 120Mbps 180Mbps 240Mbps 270Mbps 300Mbps
```

When I tried to start up the wpa_supplicDec 27 12:13:41 dduong-


```
freebsd kernel: wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
Dec 27 12:13:41 dduong-freebsd last message repeated 3 times
Dec 27 12:13:41 dduong-freebsd kernel: wlan0: start running, 0 vaps running
Dec 27 12:13:41 dduong-freebsd kernel: wlan0: ieee80211_start_locked: up parent iwn0
Dec 27 12:14:42 dduong-freebsd syslogd: kernel boot file is /boot/kernel/kernel
Dec 27 12:14:42 dduong-freebsd kernel: 
Dec 27 12:14:42 dduong-freebsd kernel: 
Dec 27 12:14:42 dduong-freebsd kernel: Fatal trap 12: page fault while in kernel mode
Dec 27 12:14:42 dduong-freebsd kernel: cpuid = 0; apic id = 00
Dec 27 12:14:42 dduong-freebsd kernel: fault virtual address    = 0x1c
Dec 27 12:14:42 dduong-freebsd kernel: fault code               = supervisor read data, page not present
Dec 27 12:14:42 dduong-freebsd kernel: instruction pointer      = 0x20:0xffffffff80550a20
Dec 27 12:14:42 dduong-freebsd kernel: stack pointer            = 0x28:0xffffff8072b508f0
Dec 27 12:14:42 dduong-freebsd kernel: frame pointer            = 0x28:0xffffff8072b50900
Dec 27 12:14:42 dduong-freebsd kernel: code segment             = base 0x0, limit 0xfffff, type 0x1b
Dec 27 12:14:42 dduong-freebsd kernel: = DPL 0, pres 1, long 1, def32 0, gran 1
Dec 27 12:14:42 dduong-freebsd kernel: processor eflags = interrupt enabled, resume, IOPL = 0
Dec 27 12:14:42 dduong-freebsd kernel: current process          = 0 (iwn0 taskq)
Dec 27 12:14:42 dduong-freebsd kernel: trap number              = 12
Dec 27 12:14:42 dduong-freebsd kernel: panic: page fault
Dec 27 12:14:42 dduong-freebsd kernel: cpuid = 0
Dec 27 12:14:42 dduong-freebsd kernel: Uptime: 2m10s
Dec 27 12:14:42 dduong-freebsd kernel: Cannot dump. Device not defined or unavailable.
Dec 27 12:14:42 dduong-freebsd kernel: Automatic reboot in 15 seconds - press a key on the console to abort
Dec 27 12:14:42 dduong-freebsd kernel: Rebooting...
Dec 27 12:14:42 dduong-freebsd kernel: cpu_reset: Stopping other CPUs
ant, it crashes again:
```


----------



## bschmidt (Dec 27, 2009)

dduong said:
			
		

> ```
> Dec 27 12:14:42 dduong-freebsd kernel: iwn0: <Intel(R) PRO/Wireless 5300> mem 0xf2500000-0xf2501fff irq 17 at device 0.0 on pci3
> Dec 27 12:14:42 dduong-freebsd kernel: iwn0: MIMO 3T3R, MoW, address 00:21:6a:85:550
> Dec 27 12:14:42 dduong-freebsd kernel: iwn0: [ITHREAD]
> ...



Unfortunately that is still an old driver, the latest version doesn't print the 11n rates.

Can you do

```
# ls -l /boot/kernel/if_iwn*
# svn co http://svn.techwires.net/svn/projects/freebsd
# cd freebsd/sys/modules/iwnfw
# make
# make install
# cd ../iwn
# env CFLAGS=-I$PWD/../../ make
# make install
# ls -l /boot/kernel/if_iwn*
```
and post its output?


----------



## dduong (Dec 27, 2009)

Sure.


```
[root@dduong-freebsd /var/log]# ls -l /boot/kernel/if_iwn*
-r-xr-xr-x  1 root  wheel  136160 Dec 27 12:09 /boot/kernel/if_iwn.ko
-r-xr-xr-x  1 root  wheel  430616 Dec 27 12:07 /boot/kernel/if_iwn.ko.symbols
```


```
[root@dduong-freebsd /usr/src/syssvn]# svn co [url]http://svn.techwires.net/svn/projects/freebsd[/url]
A    freebsd/sys
A    freebsd/sys/contrib
A    freebsd/sys/contrib/dev
A    freebsd/sys/contrib/dev/iwn
A    freebsd/sys/contrib/dev/iwn/LICENSE
A    freebsd/sys/contrib/dev/iwn/iwlwifi-6000-9.176.4.1.fw.uu
A    freebsd/sys/contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu
A    freebsd/sys/contrib/dev/iwn/iwlwifi-1000-128.50.3.1.fw.uu
A    freebsd/sys/contrib/dev/iwn/iwlwifi-5000-8.24.2.12.fw.uu
A    freebsd/sys/contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu
A    freebsd/sys/conf
A    freebsd/sys/conf/files
A    freebsd/sys/modules
A    freebsd/sys/modules/iwnfw
A    freebsd/sys/modules/iwnfw/iwn5000
A    freebsd/sys/modules/iwnfw/iwn5000/Makefile
A    freebsd/sys/modules/iwnfw/iwn6000
A    freebsd/sys/modules/iwnfw/iwn6000/Makefile
A    freebsd/sys/modules/iwnfw/Makefile.inc
A    freebsd/sys/modules/iwnfw/iwn4965
A    freebsd/sys/modules/iwnfw/iwn4965/Makefile
A    freebsd/sys/modules/iwnfw/iwn5150
A    freebsd/sys/modules/iwnfw/iwn5150/Makefile
A    freebsd/sys/modules/iwnfw/Makefile
A    freebsd/sys/modules/iwnfw/iwn1000
A    freebsd/sys/modules/iwnfw/iwn1000/Makefile
A    freebsd/sys/modules/iwn
A    freebsd/sys/modules/iwn/Makefile
A    freebsd/sys/dev
A    freebsd/sys/dev/iwn
A    freebsd/sys/dev/iwn/if_iwnreg.h
A    freebsd/sys/dev/iwn/if_iwnvar.h
A    freebsd/sys/dev/iwn/if_iwn.c
Checked out revision 27.
```


```
[root@dduong-freebsd /usr/src/syssvn]# cd freebsd/sys/modules/iwnfw
[root@dduong-freebsd /usr/src/syssvn/freebsd/sys/modules/iwnfw]# make
===> iwn1000 (all)
Warning: Object directory not changed from original /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn1000
uudecode -p /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn1000/../../../contrib/dev/iwn/iwlwifi-1000-128.50.3.1.fw.uu > iwlwifi-1000-128.50.3.1.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
iwlwifi-1000-128.50.3.1.fw iwlwifi-1000-128.50.3.1.fw
awk -f @/tools/fw_stub.awk iwlwifi-1000-128.50.3.1.fw:iwn1000fw -miwn1000fw -ciwn1000fw.c  
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-
unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse 
-mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 
-fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -fformat-extensions -c iwn1000fw.c
ld  -d -warn-common -r -d -o iwn1000fw.ko iwlwifi-1000-128.50.3.1.fw.fwo iwn1000fw.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk iwn1000fw.ko  export_syms | xargs -J% objcopy % iwn1000fw.ko
objcopy --strip-debug iwn1000fw.ko
===> iwn4965 (all)
Warning: Object directory not changed from original /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn4965
uudecode -p /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn4965/../../../contrib/dev/iwn/iwlwifi-4965-228.61.2.24.fw.uu > iwlwifi-
4965-228.61.2.24.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
iwlwifi-4965-228.61.2.24.fw iwlwifi-4965-228.61.2.24.fw
awk -f @/tools/fw_stub.awk iwlwifi-4965-228.61.2.24.fw:iwn4965fw -miwn4965fw -ciwn4965fw.c  
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-
unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse 
-mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 
-fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -fformat-extensions -c iwn4965fw.c
ld  -d -warn-common -r -d -o iwn4965fw.ko iwlwifi-4965-228.61.2.24.fw.fwo iwn4965fw.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk iwn4965fw.ko  export_syms | xargs -J% objcopy % iwn4965fw.ko
objcopy --strip-debug iwn4965fw.ko
===> iwn5000 (all)
Warning: Object directory not changed from original /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn5000
uudecode -p /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn5000/../../../contrib/dev/iwn/iwlwifi-5000-8.24.2.12.fw.uu > iwlwifi-5000-8.24.2.12.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
iwlwifi-5000-8.24.2.12.fw iwlwifi-5000-8.24.2.12.fw
awk -f @/tools/fw_stub.awk iwlwifi-5000-8.24.2.12.fw:iwn5000fw -miwn5000fw -ciwn5000fw.c  
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-
unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse 
-mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 
-fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -fformat-extensions -c iwn5000fw.c
ld  -d -warn-common -r -d -o iwn5000fw.ko iwlwifi-5000-8.24.2.12.fw.fwo iwn5000fw.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk iwn5000fw.ko  export_syms | xargs -J% objcopy % iwn5000fw.ko
objcopy --strip-debug iwn5000fw.ko
===> iwn5150 (all)
Warning: Object directory not changed from original /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn5150
uudecode -p /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn5150/../../../contrib/dev/iwn/iwlwifi-5150-8.24.2.2.fw.uu > iwlwifi-5150-8.24.2.2.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
iwlwifi-5150-8.24.2.2.fw iwlwifi-5150-8.24.2.2.fw
awk -f @/tools/fw_stub.awk iwlwifi-5150-8.24.2.2.fw:iwn5150fw -miwn5150fw -ciwn5150fw.c  
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-
unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse 
-mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 
-fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -fformat-extensions -c iwn5150fw.c
ld  -d -warn-common -r -d -o iwn5150fw.ko iwlwifi-5150-8.24.2.2.fw.fwo iwn5150fw.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk iwn5150fw.ko  export_syms | xargs -J% objcopy % iwn5150fw.ko
objcopy --strip-debug iwn5150fw.ko
===> iwn6000 (all)
Warning: Object directory not changed from original /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn6000
uudecode -p /usr/src/syssvn/freebsd/sys/modules/iwnfw/iwn6000/../../../contrib/dev/iwn/iwlwifi-6000-9.176.4.1.fw.uu > iwlwifi-6000-9.176.4.1.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
iwlwifi-6000-9.176.4.1.fw iwlwifi-6000-9.176.4.1.fw
awk -f @/tools/fw_stub.awk iwlwifi-6000-9.176.4.1.fw:iwn6000fw -miwn6000fw -ciwn6000fw.c  
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-
unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse 
-mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 
-fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  
-Wundef -Wno-pointer-sign -fformat-extensions -c iwn6000fw.c
ld  -d -warn-common -r -d -o iwn6000fw.ko iwlwifi-6000-9.176.4.1.fw.fwo iwn6000fw.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk iwn6000fw.ko  export_syms | xargs -J% objcopy % iwn6000fw.ko
objcopy --strip-debug iwn6000fw.ko
```


----------



## dduong (Dec 27, 2009)

Continue.....


```
[root@dduong-freebsd /usr/src/syssvn/freebsd/sys/modules/iwnfw]# make install
===> iwn1000 (install)
install -o root -g wheel -m 555   iwn1000fw.ko /boot/kernel
kldxref /boot/kernel
===> iwn4965 (install)
install -o root -g wheel -m 555   iwn4965fw.ko /boot/kernel
kldxref /boot/kernel
===> iwn5000 (install)
install -o root -g wheel -m 555   iwn5000fw.ko /boot/kernel
kldxref /boot/kernel
===> iwn5150 (install)
install -o root -g wheel -m 555   iwn5150fw.ko /boot/kernel
kldxref /boot/kernel
===> iwn6000 (install)
install -o root -g wheel -m 555   iwn6000fw.ko /boot/kernel
kldxref /boot/kernel
```


```
[root@dduong-freebsd /usr/src/syssvn/freebsd/sys/modules/iwnfw]# cd ../iwn
[root@dduong-freebsd /usr/src/syssvn/freebsd/sys/modules/iwn]# env CFLAGS=-I$PWD/../../ make
Warning: Object directory not changed from original /usr/src/syssvn/freebsd/sys/modules/iwn
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
cc -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I/usr/src/syssvn/freebsd/sys/modules/iwn/../../ -I. -I@ -I@/contrib/altq -finline-limit=8000 
--param inline-unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  
-mfpmath=387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector 
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c /usr/src/syssvn/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c
ld  -d -warn-common -r -d -o if_iwn.ko if_iwn.o
:> export_syms
awk -f /sys/conf/kmod_syms.awk if_iwn.ko  export_syms | xargs -J% objcopy % if_iwn.ko
objcopy --strip-debug if_iwn.ko
```


```
[root@dduong-freebsd /usr/src/syssvn/freebsd/sys/modules/iwn]# make install
install -o root -g wheel -m 555   if_iwn.ko /boot/kernel
kldxref /boot/kernel
```


```
[root@dduong-freebsd /usr/src/syssvn/freebsd/sys/modules/iwn]# ls -l /boot/kernel/if_iwn*
-r-xr-xr-x  1 root  wheel  136160 Dec 27 12:47 /boot/kernel/if_iwn.ko
-r-xr-xr-x  1 root  wheel  430616 Dec 27 12:07 /boot/kernel/if_iwn.ko.symbols
```


----------



## DutchDaemon (Dec 27, 2009)

dduong, use proper tags for posting output! System output requires 
	
	



```
, not [quote].

[url=http://forums.freebsd.org/showthread.php?t=8816]Posting and Editing in the FreeBSD Forums[/url]
```


----------



## dduong (Dec 27, 2009)

Sorry and thank you.


----------



## bschmidt (Dec 27, 2009)

Ok, thanks, module got installed. If you are sure you do NOT have

```
device iwn
```
in you kernel configuration file, the correct driver will be used.


----------



## dduong (Dec 27, 2009)

You're welcome.

I do have that entry in my custom kernel configuration file.  Do I remove that and recompile and install the drivers?


----------



## bschmidt (Dec 27, 2009)

Remove the entry from the configuration file, build and install kernel, build and install driver.


----------



## dduong (Dec 27, 2009)

ok.  I will go ahead and do that and report back


----------



## dduong (Dec 27, 2009)

Back.  Works like a charm and using the wireless right now as I'm typing 

Thanks for everything!  I will continue testing and see if anything pops up.


```
iwn0: <Intel(R) PRO/Wireless 5300> mem 0xf2500000-0xf2501fff irq 17 at device 0.0 on pci3
iwn0: MIMO 3T3R, MoW, address 00:21:6a:85:55:e0
iwn0: [ITHREAD]
iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
```


----------



## bjk (Dec 28, 2009)

*Running wpa_supplicant manually?*

I've got

```
hysteresis# svnversion
27
```
and if I load if_iwn.ko with the following line in rc.conf:

```
ifconfig_wlan0="WPA DHCP"
```
my wlan0 interface gets created and associates to my network just fine.

However, if I instead have the line:

```
ifconfig_wlan0="ssid MIT mode 11g DHCP"
```
and then manually do

```
ifconfig wlan0 destroy
ifconfig wlan0 create wlandev iwn0
wpa_supplicant -dd -i wlan0 -c /etc/wpa_supplicant.conf
```
the supplicant fails to associate, and I see

```
CTRL-EVENT-SCAN-RESULTS
Selecting BSS from priority group 0
Try to find WPA-enabled AP
0: 00:18:39:bf:46:0c ssid='423' wpa_ie_len=0 rsn_ie_len=20 caps=0x11
   selected based on RSN IE
   selected WPA AP 00:18:39:bf:46:0c ssid='423'
Trying to associate with 00:18:39:bf:46:0c (SSID='423' freq=2437 MHz)
Cancelling scan request
WPA: clearing own WPA/RSN IE
Automatic auth_alg selection: 0x1
wpa_driver_bsd_set_auth_alg alg 0x1 authmode 1
RSN: using IEEE 802.11i/D9.0
WPA: Selected cipher suites: group 16 pairwise 16 key_mgmt 2 proto 2
WPA: clearing AP WPA IE
WPA: set AP RSN IE - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04
01 00 00 0f ac 02 00 00
WPA: using GTK CCMP
WPA: using PTK CCMP
WPA: using KEY_MGMT WPA-PSK
WPA: Set own WPA IE default - hexdump(len=22): 30 14 01 00 00 0f ac 04 01 00 00
0f ac 04 01 00 00 0f ac 02 00 00
No keys have been configured - skip key clearing
wpa_driver_bsd_set_drop_unencrypted: enabled=1
State: SCANNING -> ASSOCIATING
wpa_driver_bsd_associate: ssid '423' wpa ie len 22 pairwise 3 group 3 key mgmt 1
wpa_driver_bsd_associate: set PRIVACY 1
ioctl[SIOCS80211, op 21, len 42]: No such file or directory
Association request to the driver failed
Setting authentication timeout: 5 sec 0 usec
EAPOL: External notification - EAP success=0
EAPOL: External notification - EAP fail=0
EAPOL: External notification - portControl=Auto
RSN: Ignored PMKID candidate without preauth flag
EAPOL: disable timer tick
Authentication with 00:18:39:bf:46:0c timed out.
Added BSSID 00:18:39:bf:46:0c into blacklist
No keys have been configured - skip key clearing
State: ASSOCIATING -> DISCONNECTED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
EAPOL: External notification - EAP success=0
Setting scan request: 0 sec 0 usec
State: DISCONNECTED -> SCANNING
```
et seq.
That SIOCS80211 has showed up previously, as google will tell, and it was usually operator error relating to the device cloning.  Is it not possible to manually run wpa_supplicant like this, or am I just doing something wrong?


----------



## bschmidt (Dec 28, 2009)

The settings you made in rc.conf are interfering with what you're are trying to achieve. As soon as you create wlan0 the settings from rc.conf will be applied and that is what wpa_supplicant doesn't like.


```
# grep wlan /etc/rc.conf
wlans_iwn0="wlan0"
ifconfig_wlan0="ssid testtest mode 11g 192.168.30.2 up"
# ifconfig wlan0 destroy
# ifconfig wlan0 create wlandev iwn0 wlanmode sta
# ifconfig wlan0
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:22:fa:02:d9:b2
        inet6 fe80::222:faff:fe02:d9b2%wlan0 prefixlen 64 tentative scopeid 0x6
        inet 192.168.30.2 netmask 0xffffff00 broadcast 192.168.30.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
        status: no carrier
        ssid testtest channel 3 (2422 Mhz 11g)
        country US authmode OPEN privacy OFF txpower 15 bmiss 10 scanvalid 60
        bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5
        protmode CTS wme bintval 0
```

To prevent this, you can name the VAP wlan1.


```
# ifconfig wlan1 create wlandev iwn0
# wpa_supplicant -Dbsd -iwlan1 -c/etc/wpa_supplicant.conf -dd
```


----------



## hlg (Dec 28, 2009)

First of all, I would like to apologize for the long post -- I'm a very unadvanced user with an advanced PC, providing as many details as I can in the hope that some of them might actually be useful.
The advanced PC is a Dell Precision M6400 with an Intel 5300AGN WiFi card. It runs FreeBSD 8.0. I've recompiled the kernel without the ukbd, ums and uhid modules.

I installed the WiFi driver (r27), and then performed the steps described below.

1., Reboot, log in as root, issue the following two commands:

`# kldload iwn5000fw`
`# kldload if_iwn`

which generates in /var/log/messages:


```
Dec 27 21:55:15  kernel: iwn0: <Intel(R) PRO/Wireless 5300> mem 0xf1ffe000-0xf1ffffff irq 17 at device 0.0 on pci12
Dec 27 21:55:15  kernel: iwn0: MIMO 3T3R, MoW, address 00:16:ea:e3:dc:88
Dec 27 21:55:15  kernel: iwn0: [ITHREAD]
Dec 27 21:55:15  kernel: iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
Dec 27 21:55:15  kernel: iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
Dec 27 21:55:15  kernel: iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
```

2., Turn the hardware switch on. The Bluetooth LED comes on -- even though the ng_ubt module is not loaded -- the WiFi LED, on the other hand, does not. At the same time, the following messages are generated in /var/log/messages:

```
Dec 27 21:55:21  kernel: ugen0.2: <Broadcom> at usbus0
Dec 27 21:55:21  kernel: uhub8: <Broadcom BCM2046B1, class 9/0, rev 2.00/1.00, addr 2> on usbus0
Dec 27 21:55:22  kernel: uhub8: 3 ports with 0 removable, self powered
Dec 27 21:55:22  root: Unknown USB device: vendor 0x413c product 0x8157 bus uhub8
Dec 27 21:55:22  kernel: ugen0.3: <vendor 0x413c> at usbus0
Dec 27 21:55:23  root: Unknown USB device: vendor 0x413c product 0x8158 bus uhub8
Dec 27 21:55:23  kernel: ugen0.4: <vendor 0x413c> at usbus0
```

3., Issue the command:

`# ifconfig iwn0 up scan`

which results in the output:


```
ifconfig: unable to get scan results
```

4., Turn the hardware switch off again. This causes a kernel panic and a reboot. Before rebooting, the machine displays a screen for 15 seconds -- the best copy of it that I could make after several tries is below.


```
iwn0: RF switch: radio disabled

Fatal trap 12: page fault while in kernel mode
cpuid = 2; apic id =02
fault virtual address   = 0x58
fault code              = supervisor read data, page not present
instruction pointer     = 0x20:ffffffffff80661817
stack pointer           = 0x28:ffffffff80eb741b50
frame pointer           = 0x28:ffffffff80eb741b80
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 0 (iwn0 taskq)
trap number             = 12
panic: page fault
cpuid = 1
uptime: 39s

Cannot dump. Device not defined or unavailable.
```

(These messages -- as far as I can tell -- are quite similar to those in post #144.)

Turning the hardware switch on _after_ issuing the above ifconfig command also causes the machine to freeze and display a screen similar to the one above, without, however, a reboot.

Finally, just in case this piece of information helps: After

`# kldload ukbd`
`# kldload ums`

turning the hardware switch on generates in /var/log/messages:


```
Dec 28 14:55:07  kernel: ugen0.2: <Broadcom> at usbus0
Dec 28 14:55:07  kernel: uhub8: <Broadcom BCM2046B1, class 9/0, rev 2.00/1.00, addr 2> on usbus0
Dec 28 14:55:08  kernel: uhub8: 3 ports with 0 removable, self powered
Dec 28 14:55:09  kernel: ugen0.3: <vendor 0x413c> at usbus0
Dec 28 14:55:09  kernel: ukbd0: <vendor 0x413c product 0x8157, class 0/0, rev 2.00/1.00, addr 3> on usbus0
Dec 28 14:55:09  kernel: kbd2 at ukbd0
Dec 28 14:55:09  kernel: ugen0.4: <vendor 0x413c> at usbus0
Dec 28 14:55:09  kernel: ums0: <vendor 0x413c product 0x8158, class 0/0, rev 2.00/1.00, addr 4> on usbus0
Dec 28 14:55:09  kernel: ums0: 3 buttons and [XY] coordinates ID=2
```

This is the same whether if_iwn is loaded or not. There isn't any usb mouse or keyboard connected to the laptop that I know of.

What have I done wrong? What should I try next? I would really appreciate any help.


----------



## bschmidt (Dec 28, 2009)

hlg said:
			
		

> 3., Issue the command:
> 
> `# ifconfig iwn0 up scan`
> 
> ...



As of 8.0 and VAPs correct commands are:
`# ifconfig wlan0 create wlandev iwn0
# ifconfig wlan0 up
# ifconfig wlan0 scan`



			
				hlg said:
			
		

> 4., Turn the hardware switch off again. This causes a kernel panic and a reboot. Before rebooting, the machine displays a screen for 15 seconds -- the best copy of it that I could make after several tries is below.
> 
> 
> ```
> ...



Thanks for catching this, fix has been committed as revision 28.


----------



## hlg (Dec 28, 2009)

1., Thank you.
2., Vielen dank.
3., Seems to work. Pretty little blue WiFi indicator light comes on after

`# ifconfig wlan0 up`

and goes off when hardware switch is turned off. Scanning available networks is possible as well.
4., I tried to follow the instructions of the handbook (http://www.freebsd.org/doc/en/books/handbook/network-wireless.html). Where can I find a more up-to-date description aimed at newbies with limited mental resources like myself?
5., Just pondering: Would a donated 802.11n-capable router bring the possibility of a 802.11n-capable FreeBSD driver closer?


----------



## wobsite (Dec 28, 2009)

Hi,

I'm using revision 28, and I can successfully scan, associate, and recieve an ip via dhcp. however, once I have an IP address, I can't ping anything, and have no connectivity. 

here's what I've done:

after compiling and installing the module, 


```
kldload iwn5000fw
kldload if_iwn
```

which adds the following to /var/log/messages:

```
Dec 28 17:23:25 tezzeret kernel: iwn0: detached
Dec 28 17:25:23 tezzeret kernel: iwn0: <Intel(R) PRO/Wireless 5100> mem 0xf4300000-0xf4301fff irq 17 at device 0.0 on pci3
Dec 28 17:25:23 tezzeret kernel: iwn0: MIMO 1T2R, MoW, address 00:1e:65:6b:33:18
Dec 28 17:25:23 tezzeret kernel: iwn0: [ITHREAD]
Dec 28 17:25:23 tezzeret kernel: iwn0: 11a rates: 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
Dec 28 17:25:23 tezzeret kernel: iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
Dec 28 17:25:23 tezzeret kernel: iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
```

I can then do:


```
ifconfig wlan0 create wlandev iwn0
ifconfig wlan0 up
ifconfig wlan0 scan
```

which gives me an accurate listing of the wireless networks in the area.

I then compose this wpa_supplicant config file:

```
network={
	ssid="my ssid"
	psk="my psk"
}
```

and execute wpa_supplicant -i wlan0 -Dbsd -c <path to config>

which yeilds:


```
CTRL-EVENT-SCAN-RESULTS
Trying to associate with 00:18:01:ec:f4:ac (SSID='my ssid' freq 2462=MHz)
Associated with 00:18:01:ec:f4:ac
WPA: Key negotiation completed with 00:18:01:ec:f4:ac [PTK=CCMP GTK=TKIP]
CTRL-EVENT-CONNECTED - Connection to 00:18:01:ec:f4:ac completed (auth) [id=0 id_str=]
```

then dhclient wlan0 :

```
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.6 -- renewal in 43200 seconds.
```

so it looks like all is well. but then as stated, I can't ping anything (not even the router) and I have no connectivity. there's nothing helpful in /var/log/messages either. any ideas?


----------



## wobsite (Dec 29, 2009)

I got it working. I believe it was still trying to send pings across the wired interface; I rebooted without having the ethernet cable connected and the wireless worked.


----------



## bschmidt (Dec 29, 2009)

hlg said:
			
		

> 5., Just pondering: Would a donated 802.11n-capable router bring the possibility of a 802.11n-capable FreeBSD driver closer?



Sure it would. I will get one myself soon, just have to decide on which one. All APs available at local shops here are either not supporting 11NA or only have a 100 Mbit/s uplink. With theoretical bandwidth up to 300 Mbit/s (haven't seen one with 450 Mbit/s yet) this is kinda .. you know.


----------



## bschmidt (Dec 29, 2009)

wobsite said:
			
		

> I got it working. I believe it was still trying to send pings across the wired interface; I rebooted without having the ethernet cable connected and the wireless worked.



I thought about something like that, just wanted to ask for `# ifconfig -a` and `# netstat -r`. Good you got it working though.


----------



## joel@ (Dec 29, 2009)

bschmidt, I haven't been following this thread or the development in svn very closely, but I have one quick question: Is all of this available in FreeBSD-Current? If not, do you have a committer working on committing your changes to the FreeBSD svn repo?


----------



## bschmidt (Dec 29, 2009)

joel@ said:
			
		

> bschmidt, I haven't been following this thread or the development in svn very closely, but I have one quick question: Is all of this available in FreeBSD-Current? If not, do you have a committer working on committing your changes to the FreeBSD svn repo?



I created my SVN repo based on the last commit to HEAD. So, no, none of that is in HEAD. And I am also not aware of anyone working on getting that into the tree, maybe Rui Paulo, as he was the one committing the first changes.


----------



## oliverh (Dec 29, 2009)

>And I am also not aware of anyone working on getting that into the tree, maybe Rui Paulo, as he was the one committing the first changes. 

I hope so, this driver is already better than if_rum or if_wpi. Imo a driver for the upcoming FreeBSD 8.1. I couldn't use any Wifi without it, if_rum is a mere mess and this one is almost perfect


----------



## joel@ (Dec 29, 2009)

bschmidt said:
			
		

> I created my SVN repo based on the last commit to HEAD. So, no, none of that is in HEAD. And I am also not aware of anyone working on getting that into the tree, maybe Rui Paulo, as he was the one committing the first changes.


Hm, ok. The driver seems to be in good shape (at least if you count the number of "it works" reports) so it might be a good time to ping Rui again.


----------



## bschmidt (Dec 29, 2009)

eyebone said:
			
		

> 3. i tried the also the aircrack-ng suite, now listening for other networks seems so far not to work i guess this would be also the same for injecting, but i didnt test that so far



Can you confirm that there is actually a card/driver which does support that? Looking over the code, I doubt there is, as the output function in net80211 drops every packet while in monitor mode. Monitor mode with tcpdump works though.


----------



## bschmidt (Dec 29, 2009)

joel@ said:
			
		

> Hm, ok. The driver seems to be in good shape (at least if you count the number of "it works" reports) so it might be a good time to ping Rui again.



Will do so.


----------



## bschmidt (Dec 29, 2009)

rpaulo@ just committed all changes as r201209 to HEAD.

Thanks to him and thanks everyone for testing and feedback!


----------



## joel@ (Dec 29, 2009)

bschmidt said:
			
		

> rpaulo@ just committed all changes as r201209 to HEAD.
> 
> Thanks to him and thanks everyone for testing and feedback!


Good news!


----------



## hlg (Dec 30, 2009)

bschmidt said:
			
		

> Sure it would. I will get one myself soon, just have to decide on which one. All APs available at local shops here are either not supporting 11NA or only have a 100 Mbit/s uplink. With theoretical bandwidth up to 300 Mbit/s (haven't seen one with 450 Mbit/s yet) this is kinda .. you know.



Had a quick look around the Web today. What you're looking for seems to be available here in Budapest -- unfortunately, it costs more than what I can afford right now. Maybe if someone else living here follows this thread and is ready to share the costs... Sorry I spoke too soon.


----------



## bschmidt (Dec 30, 2009)

hlg said:
			
		

> Had a quick look around the Web today. What you're looking for seems to be available here in Budapest -- unfortunately, it costs more than what I can afford right now. Maybe if someone else living here follows this thread and is ready to share the costs... Sorry I spoke too soon.



Not a problem, just got one myself finally


----------



## oliverh (Jan 4, 2010)

Rev 31 runs smooth too. Is there any possibility to see some kind of a changelog?


----------



## bschmidt (Jan 5, 2010)

oliverh said:
			
		

> Rev 31 runs smooth too. Is there any possibility to see some kind of a changelog?



Yep, there is here.

The next commits will hopefully be related to 11n, we'll see..


----------



## eyebone (Jan 5, 2010)

hm. is monitor mode working and changing of mac address? havent tested latest driver yet, will do the next hours.


----------



## bschmidt (Jan 5, 2010)

eyebone said:
			
		

> hm. is monitor mode working and changing of mac address? havent tested latest driver yet, will do the next hours.



#172

Have not yet tested whether it is possible to change the MAC address.


----------



## eyebone (Jan 5, 2010)

just tested it, same problem as described already in my earlier post. so changing wlan0 mac you get a flapping connection(UP/DOWN/UP/DOWN) changing mac of iwn0 and wlan0 to same but fake address results in no connection at all. 
also gave it a short try with airodump, tool quits with no results, maybe a airodump problem


----------



## eyebone (Jan 5, 2010)

bschmidt said:
			
		

> #172
> 
> Have not yet tested whether it is possible to change the MAC address.



sorry i completly missed this post from you(#172), iam not sure if i understood what u mean. i dont know how the injection is done on driverside. i know that it is working (at least for some) atheros drivers, but thats common knowledge ...


----------



## bschmidt (Jan 5, 2010)

eyebone said:
			
		

> sorry i completly missed this post from you(#172), iam not sure if i understood what u mean. i dont know how the injection is done on driverside. i know that it is working (at least for some) atheros drivers, but thats common knowledge ...



If I'm not totally mistaken, injection as in transmitting packets in monitor mode does not work even for ath(4).


```
if (vap->iv_opmode == IEEE80211_M_MONITOR) {
                /* NB: disallow transmit */
                ifp->if_transmit = null_transmit;
                ifp->if_output = null_output;
        } else { 
                /* hook output method setup by ether_ifattach */
                vap->iv_output = ifp->if_output;
                ifp->if_output = ieee80211_output;
        }
```

null_transmit() just discards every packet and I have yet to see a driver which does bypass that. 

If I'm on the wrong track, let me know.


----------



## eyebone (Jan 5, 2010)

i'am not deep enough(sourcecode base) in the topic, but i can confirm that injection and listening to incoming data via airodump and aireplay is/was working on 7.x via atheros cards. maybe aircrack-ng suite implemented some magic ... or it was never real monitor mode


----------



## richardpl (Jan 5, 2010)

For injection on 8.0 you need to use AHDEMO mode instead of MONITOR.

aircrack-ng suite is miles behind net80211 code ...


----------



## bschmidt (Jan 5, 2010)

eyebone said:
			
		

> i'am not deep enough(sourcecode base) in the topic, but i can confirm that injection and listening to incoming data via airodump and aireplay is/was working on 7.x via atheros cards. maybe aircrack-ng suite implemented some magic ... or it was never real monitor mode



Smells like a regression.. The code in question is not in 7.x.

I'll play around with an Atheros card next week, let's see whether I can come with something. Anyone wanna jump in?


----------



## eyebone (Jan 5, 2010)

richardpl said:
			
		

> For injection on 8.0 you need to use AHDEMO mode instead of MONITOR.
> 
> aircrack-ng suite is miles behind net80211 code ...



hum? ok. is there an interface for injection via net80211 code?


----------



## bschmidt (Jan 5, 2010)

richardpl said:
			
		

> For injection on 8.0 you need to use AHDEMO mode instead of MONITOR.
> 
> aircrack-ng suite is miles behind net80211 code ...



Ah, ok, thanks.


----------



## bschmidt (Jan 5, 2010)

eyebone said:
			
		

> hum? ok. is there an interface for injection via net80211 code?



`# wlanconfig wlan0 create wlandev ath0 wlanmode ahdemo`


----------



## eyebone (Jan 5, 2010)

bschmidt said:
			
		

> `# wlanconfig wlan0 create wlandev ath0 wlanmode ahdemo`




```
# ifconfig wlan0 create wlandev ath0 wlanmode ahdemo
ifconfig: create: bad value
```

in which package can i find wlanconfig(just see this at linux)?


----------



## oliverh (Jan 5, 2010)

>in which package can i find wlanconfig(just see this at linux)? 

What Linux? I'm using e.g. Slackware and I've never heard of it.


----------



## bschmidt (Jan 5, 2010)

err.. I'm sorry, of course there's no wlanconfig. That's for madwifi (yeah.. yah).

So, correct command would be
`# ifconfig wlan0 create wlandev ath0 wlanmode ahdemo`
for an Atheros device and
`# ifconfig wlan0 create wlandev iwn0 wlanmode ahdemo`
for an Intel chip. But as you might know, adhoc is not (yet?) supported. Ahdemo might though, have to look into that.

Sorry for the confusion.


----------



## datastream (Jan 8, 2010)

At rev 28 it works well with kernel rev201112.but 30mins ago i got the error.

```
firmware error log:
  error type      = "NMI_INTERRUPT_WDG" (0x00000004)
  program counter = 0x0000046C
  source line     = 0x000000D0
  error data      = 0x0000000202630000
  branch link     = 0x00004B0C000004C2
  interrupt link  = 0x000006DE00004B22
  time            = 2231169475
driver status:
  tx ring  0: qid=0  cur=168 queued=0  
  tx ring  1: qid=1  cur=0   queued=0  
  tx ring  2: qid=2  cur=0   queued=0  
  tx ring  3: qid=3  cur=20  queued=0  
  tx ring  4: qid=4  cur=36  queued=0  
  tx ring  5: qid=5  cur=0   queued=0  
  tx ring  6: qid=6  cur=0   queued=0  
  tx ring  7: qid=7  cur=0   queued=0  
  tx ring  8: qid=8  cur=0   queued=0  
  tx ring  9: qid=9  cur=0   queued=0  
  tx ring 10: qid=10 cur=0   queued=0  
  tx ring 11: qid=11 cur=0   queued=0  
  tx ring 12: qid=12 cur=0   queued=0  
  tx ring 13: qid=13 cur=0   queued=0  
  tx ring 14: qid=14 cur=0   queued=0  
  tx ring 15: qid=15 cur=0   queued=0  
  rx ring: cur=8
```
no kernel panic,but i lost the wireless connection.i notice wireless light is off and wlan0 stats is ok.

```
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:1d:e0:48:13:2e
	inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
	media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11g
	status: associated
	ssid DAROOT channel 11 (2462 Mhz 11g) bssid 02:22:6b:70:08:07
	country US authmode WPA privacy ON deftxkey UNDEF AES-CCM 3:128-bit
	txpower 14 bmiss 10 scanvalid 450 bgscan bgscanintvl 300
	bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS wme roaming MANUAL
```


```
iwn0@pci0:3:0:0:        class=0x028000 card=0x10108086 chip=0x42308086 rev=0x61 
hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Intel Wireless WiFi Link 4965AGN (Intel 4965AGN)'
    class      = network
```
it is a intel4965AG wireless card.


----------



## bschmidt (Jan 8, 2010)

datastream said:
			
		

> ```
> firmware error log:
> error type      = "NMI_INTERRUPT_WDG" (0x00000004)
> program counter = 0x0000046C
> ...



Seems to be a known issue within the Intel firmware. At least the source lines where the error occurs are equal.

I try to reproduce that.


----------



## drbsd (Jan 9, 2010)

*intel 1000 link*

Hi,

I have a Thinkpad SL510 with Intel 1000 link wireless card and I had to modify if_iwn.c in the code found on svn co http://svn.techwires.net/svn/projects/freebsd/ to make it works (otherwise it panic)

Apparently the problem is, for this chip, the driver try to read a OTPROM in place of an EEPROM, then I comment line 1479 :


```
// sc->sc_flags |= IWN_FLAG_HAS_OTPROM;
```

to workaround this... And it works well, I downloaded the entire FreeBSD sources and ports with the computer.

I know it's bad but it works, and I am not good enough to do something else, but maybe someone could make something better.


----------



## bschmidt (Jan 10, 2010)

drbsd said:
			
		

> Hi,
> 
> I have a Thinkpad SL510 with Intel 1000 link wireless card and I had to modify if_iwn.c in the code found on svn co http://svn.techwires.net/svn/projects/freebsd/ to make it works (otherwise it panic)
> 
> ...



That is a real interesting fact. Can you post `# pciconf -lv` and `# dmesg` of your card?


----------



## drbsd (Jan 10, 2010)

pciconf -lv :

```
iwn0@pci0:5:0:0:	class=0x028000 card=0x13158086 chip=0x00848086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = network
```

dmesg :

```
iwn0: <Intel(R) PRO/Wireless 1000> mem 0xf2200000-0xf2201fff irq 19 at device 0.0 on pci5
iwn0: MIMO 1T2R, BGS, address 00:1e:64:57:95:66
iwn0: [ITHREAD]
iwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
```


----------



## dinoex@ (Jan 15, 2010)

*rev33 is working on N500*

rev33 ist working now here


```
Lenovo N500, 4GB RAM, Intel(R) PRO/Wireless 5100
FreeBSD 8.0 STABLE 08th Jan 2010
```

Thank you very much.


----------



## LesJen (Jan 23, 2010)

Since updating to rev. 33 I've seen some disconnetcs after a few hours. 
I loose connection on the machine, my router and the outside can be pinged from other machines on the internal network.


```
ifconfig wlan0 down
ifconfig wlan0 up
```

Does not bring the interface online again. A reboot solves the problem.

I forgot to try /etc/rc.d/netif restart. Will do it at the next time network goes down.


----------



## bschmidt (Jan 23, 2010)

If possible try do reproduce it which some debug information, .e.g `# wlandebug 0xffffffff`. Also post some information about your configuration.

I've seen APs kicking idle clients, might be related.


----------



## eMxyzptlk (Jan 24, 2010)

Does this driver work on 8-RELEASE or is it only 9-CURRENT?

I am running 8-RELEASE and I can't make it..

http://freebsd.pastebin.com/f5b8a8db2


----------



## bschmidt (Jan 24, 2010)

eMxyzptlk said:
			
		

> Does this driver work on 8-RELEASE or is it only 9-CURRENT?
> 
> I am running 8-RELEASE and I can't make it..
> 
> http://freebsd.pastebin.com/f5b8a8db2



It works with 8.0-RELEASE. Did you use the same build commands as in this post?


----------



## eMxyzptlk (Jan 24, 2010)

bschmidt said:
			
		

> It works with 8.0-RELEASE. Did you use the same build commands as in this post?



Yes this is what I did exactly, I am using a custom kernel with just some additions (without iwn)

here's the kernel config http://freebsd.pastebin.com/d6c4c191e


----------



## bschmidt (Jan 24, 2010)

Try replacing sys/modules/iwn/Makefile with

```
# $FreeBSD: head/sys/modules/iwn/Makefile 179215 2008-05-22 21:53:15Z sam $

.PATH:  ${.CURDIR}/../../dev/iwn

CFLAGS+=-I${.CURDIR}/../../
KMOD    = if_iwn
SRCS    = if_iwn.c device_if.h bus_if.h pci_if.h

.include <bsd.kmod.mk>
```


----------



## eMxyzptlk (Jan 24, 2010)

This worked for me, addning CFLAGS in the Makefile..

Thanks


----------



## LesJen (Jan 25, 2010)

bschmidt said:
			
		

> If possible try do reproduce it which some debug information, .e.g `# wlandebug 0xffffffff`. Also post some information about your configuration.
> 
> I've seen APs kicking idle clients, might be related.




This is what I got!


```
wlandebug 0xffffffff
net.wlan.0.debug: 0x0 => 0xffffffff<11n,debug,dumppkts,crypto,input,xrate,elemid,node,assoc,auth,scan,output,state,power,hwmp,dot1xsm,radius,raddump,mesh,wpa,acl,wme,
superg,doth,inact,roam,rate,action,wds,ioctl,tdma>
```


```
/etc/rc.d/netif restart
wpa_supplicant not running? (check /var/run/wpa_supplicant/wlan0.pid).
ifconfig: interface wlan0 does not exist
Stopping Network: lo0 em0 iwn0 fwe0 fwip0 vboxnet0 wlan0 pflog0.
lo0: flags=8048<LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 
	inet6 ::1 prefixlen 128 

iwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:16:ea:61:01:e8
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier

ifconfig: interface wlan0 does not exist
pflog0: flags=100<PROMISC> metric 0 mtu 33152
Starting wpa_supplicant.
Starting Network: lo0 em0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 
	inet6 ::1 prefixlen 128 
	inet 127.0.0.1 netmask 0xff000000
```


----------



## LesJen (Jan 25, 2010)

I don't know if this is useful for you! It's from the daily security output.

I've done /etc/rc.d/netif restart a few times today. It brings up the interface after it stops working, usually after around two hours.


```
+wlan0: received beacon from 00:21:91:02:e9:13 rssi 71
+wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
+wlan0: received beacon from 00:21:91:02:e9:13 rssi 70
+wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
+wlan0: received beacon from 00:21:91:02:e9:13 rssi 67
+wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
+wlan0: ieee80211_vap_detach: STA parent iwn0
+ifa_del_loopback_route: deletion failed
+ifa_del_loopback_route: deletion failed
+wlan0: stop running, 1 vaps running
+wlan0: ieee80211_new_state_locked: RUN -> INIT (nrunning 0 nscanning 0)
+wlan0: ieee80211_newstate_cb: RUN -> INIT arg -1
+wlan0: sta_newstate: RUN -> INIT (-1)
+wlan0: ieee80211_ref_node (ieee80211_send_mgmt:1876) 0xffffff800087e000<00:21:91:02:e9:13> refcnt 3
+wlan0: [00:21:91:02:e9:13] send station disassociate (reason 8)
+[00:21:91:02:e9:13] send disassoc on channel 1
+wlan0: _ieee80211_crypto_delkey: TKIP keyix 0 flags 0x1f3 rsc 0 tsc 43898 len 16
+wlan0: [00:21:91:02:e9:13] bss node leave
+wlan0: node_reclaim: remove 0xffffff800087e000<00:21:91:02:e9:13> from station table, refcnt 1
+wlan0: ieee80211_alloc_node 0xffffff80006ca000<00:16:ea:61:01:e8> in station table
+wlan0: [00:16:ea:61:01:e8] ieee80211_alloc_node: inact_reload 2
+wlan0: ieee80211_scan_flush
+wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
+wlan0: _ieee80211_crypto_delkey: TKIP keyix 1 flags 0x1f6 rsc 0 tsc 1 len 16
+wlan0: _ieee80211_crypto_delkey: TKIP keyix 2 flags 0x1f6 rsc 59 tsc 1 len 16
+wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
+wlan0: node_reclaim: remove 0xffffff80006ca000<00:16:ea:61:01:e8> from station table, refcnt 1
+wlan0: Ethernet address: 00:16:ea:61:01:e8
+ifa_del_loopback_route: deletion failed
+ifa_del_loopback_route: deletion failed
+wlan0: Ethernet address: 00:16:ea:61:01:e8
```


----------



## bschmidt (Jan 25, 2010)

Those messages do help, though, the ones you posted are a bit too late. Before running
`# /etc/rc.d/netif restart`
next time, do
`# grep wlan0 /var/log/message | tail -n 100`
and post that.

It will hopefully contain the reason for the issue.

On a side note, are you sure it is related to r33? What was the last revision without the issue? If you could verify that it does not happend with lets say r30, that would help a lot. You could get the exact revision with
`# svn co [url]http://svn.techwires.net/svn/projects/freebsd[/url] -r30`
and use the usual build commands.


----------



## LesJen (Jan 25, 2010)

Here's the output you asked for!

I'll try revert to -r30 tomorrow.


```
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 69
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 70
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 71
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 71
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 70
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 70
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:56:59 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:56:59 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 73
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 72
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 71
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 70
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 kernel: wlan0: received beacon from 00:21:91:02:e9:13 rssi 67
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] discard WME information element, too short, len 7
Jan 25 15:57:00 dhclient[1542]: receive_packet failed on wlan0: Device not configured
Jan 25 15:57:00 kernel: wlan0: ieee80211_vap_detach: STA parent iwn0
Jan 25 15:57:00 dhclient[1542]: ioctl(SIOCGIFFLAGS) on wlan0: Operation not permitted
Jan 25 15:57:00 dhclient[1542]: Interface wlan0 no longer appears valid.
Jan 25 15:57:00 kernel: wlan0: stop running, 1 vaps running
Jan 25 15:57:00 kernel: wlan0: ieee80211_new_state_locked: RUN -> INIT (nrunning 0 nscanning 0)
Jan 25 15:57:00 kernel: wlan0: ieee80211_newstate_cb: RUN -> INIT arg -1
Jan 25 15:57:00 kernel: wlan0: sta_newstate: RUN -> INIT (-1)
Jan 25 15:57:00 kernel: wlan0: ieee80211_ref_node (ieee80211_send_mgmt:1876) 0xffffff800087e000<00:21:91:02:e9:13> refcnt 3
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] send station disassociate (reason 8)
Jan 25 15:57:00 kernel: wlan0: _ieee80211_crypto_delkey: TKIP keyix 0 flags 0x1f3 rsc 0 tsc 43898 len 16
Jan 25 15:57:00 kernel: wlan0: [00:21:91:02:e9:13] bss node leave
Jan 25 15:57:00 kernel: wlan0: node_reclaim: remove 0xffffff800087e000<00:21:91:02:e9:13> from station table, refcnt 1
Jan 25 15:57:00 kernel: wlan0: ieee80211_alloc_node 0xffffff80006ca000<00:16:ea:61:01:e8> in station table
Jan 25 15:57:00 kernel: wlan0: [00:16:ea:61:01:e8] ieee80211_alloc_node: inact_reload 2
Jan 25 15:57:00 kernel: wlan0: ieee80211_scan_flush
Jan 25 15:57:00 kernel: wlan0: link state changed to DOWN
Jan 25 15:57:00 kernel: wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
Jan 25 15:57:00 kernel: wlan0: _ieee80211_crypto_delkey: TKIP keyix 1 flags 0x1f6 rsc 0 tsc 1 len 16
Jan 25 15:57:00 kernel: wlan0: _ieee80211_crypto_delkey: TKIP keyix 2 flags 0x1f6 rsc 59 tsc 1 len 16
Jan 25 15:57:00 kernel: wlan0: _ieee80211_crypto_delkey: NONE keyix 65535 flags 0x3 rsc 0 tsc 0 len 0
Jan 25 15:57:00 kernel: wlan0: node_reclaim: remove 0xffffff80006ca000<00:16:ea:61:01:e8> from station table, refcnt 1
Jan 25 15:57:01 kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
Jan 25 15:57:01 wpa_supplicant[4171]: Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Jan 25 15:57:23 kernel: wlan0: link state changed to UP
Jan 25 15:57:28 dhclient: New IP Address (wlan0): 172.17.0.140
Jan 25 15:57:28 dhclient: New Subnet Mask (wlan0): 255.255.255.0
Jan 25 15:57:28 dhclient: New Broadcast Address (wlan0): 172.17.0.255
Jan 25 15:57:28 dhclient: New Routers (wlan0): 172.17.0.1
Jan 25 17:46:41 dhclient[4436]: receive_packet failed on wlan0: Device not configured
Jan 25 17:46:41 kernel: wlan0: link state changed to DOWN
Jan 25 17:46:41 dhclient[4436]: ioctl(SIOCGIFFLAGS) on wlan0: Operation not permitted
Jan 25 17:46:41 dhclient[4436]: Interface wlan0 no longer appears valid.
Jan 25 17:46:41 kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
Jan 25 17:46:41 wpa_supplicant[5367]: Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Jan 25 17:46:50 kernel: wlan0: link state changed to UP
Jan 25 17:46:57 dhclient: New IP Address (wlan0): 172.17.0.140
Jan 25 17:46:57 dhclient: New Subnet Mask (wlan0): 255.255.255.0
Jan 25 17:46:57 dhclient: New Broadcast Address (wlan0): 172.17.0.255
Jan 25 17:46:57 dhclient: New Routers (wlan0): 172.17.0.1
Jan 25 19:45:24 kernel: wlan0: link state changed to DOWN
Jan 25 19:45:24 dhclient[5632]: receive_packet failed on wlan0: Device not configured
Jan 25 19:45:24 dhclient[5632]: ioctl(SIOCGIFFLAGS) on wlan0: Operation not permitted
Jan 25 19:45:24 dhclient[5632]: Interface wlan0 no longer appears valid.
Jan 25 19:45:24 kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
Jan 25 19:45:24 wpa_supplicant[10526]: Delete '/var/run/wpa_supplicant/wlan0' manually if it is not used anymore
Jan 25 19:45:40 kernel: wlan0: link state changed to UP
Jan 25 19:45:45 dhclient: New IP Address (wlan0): 172.17.0.140
Jan 25 19:45:45 dhclient: New Subnet Mask (wlan0): 255.255.255.0
Jan 25 19:45:45 dhclient: New Broadcast Address (wlan0): 172.17.0.255
Jan 25 19:45:45 dhclient: New Routers (wlan0): 172.17.0.1
Jan 25 20:51:54 kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
Jan 25 20:51:54 kernel: wlan0: link state changed to UP
Jan 25 20:51:54 dhclient: New IP Address (wlan0): 172.17.0.140
Jan 25 20:51:54 dhclient: New Subnet Mask (wlan0): 255.255.255.0
Jan 25 20:51:54 dhclient: New Broadcast Address (wlan0): 172.17.0.255
Jan 25 20:51:54 dhclient: New Routers (wlan0): 172.17.0.1
Jan 25 21:39:24 kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
Jan 25 21:39:31 kernel: wlan0: link state changed to UP
Jan 25 21:39:35 dhclient: New IP Address (wlan0): 172.17.0.140
Jan 25 21:39:35 dhclient: New Subnet Mask (wlan0): 255.255.255.0
Jan 25 21:39:35 dhclient: New Broadcast Address (wlan0): 172.17.0.255
Jan 25 21:39:35 dhclient: New Routers (wlan0): 172.17.0.1
```


----------



## LesJen (Jan 26, 2010)

Version -r30 does the same after about two hours.

Do you want me to try another version?


----------



## bschmidt (Jan 27, 2010)

Hmm, the log indicates that the connection is still available. Can you do `# tcpdump -ni wlan0` as soon as the connection fails? Start a ping or something, it will show you whether there is even an attempt to send packets.

If packets are transmitted, or at least tcpdump says that, `# sysctl dev.iwn.0.debug=1` should print tx_done messages. If those are missing, there's definitively a driver issue.


----------



## LesJen (Jan 27, 2010)

I can ping my printer but not my router! I did tcpdump, but I'm not sure how to handle the second command. I tried, if it's wrong please tell me how to.


```
tcpdump -ni wlan0 
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 96 bytes
21:30:02.038918 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 0, length 64
21:30:03.042543 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 1, length 64
21:30:04.044708 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 2, length 64
21:30:05.047747 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 3, length 64
21:30:06.051648 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 4, length 64
21:30:07.054322 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 5, length 64
21:30:08.057351 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 6, length 64
21:30:09.060399 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 7, length 64
21:30:10.063434 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 8, length 64
21:30:11.066475 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 9, length 64
21:30:12.069530 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 10, length 64
21:30:13.073433 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 8719, seq 11, length 64
21:30:16.049381 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 0, length 64
21:30:16.050023 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 0, length 64
21:30:17.054064 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 1, length 64
21:30:17.054676 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 1, length 64
21:30:18.058095 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 2, length 64
21:30:18.058753 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 2, length 64
21:30:19.062134 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 3, length 64
21:30:19.062767 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 3, length 64
21:30:20.066157 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 4, length 64
21:30:20.066771 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 4, length 64
21:30:21.070193 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 5, length 64
21:30:21.070805 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 5, length 64
21:30:22.074226 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 6, length 64
21:30:22.074839 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 6, length 64
21:30:23.078260 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 7, length 64
21:30:23.078914 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 7, length 64
21:30:24.082280 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 8, length 64
21:30:24.082884 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 8, length 64
21:30:25.086298 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 9, length 64
21:30:25.086913 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 9, length 64
21:30:26.090333 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 10, length 64
21:30:26.090950 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 10, length 64
21:30:27.094862 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 11, length 64
21:30:27.095476 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 11, length 64
21:30:28.098894 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 12, length 64
21:30:28.099534 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 12, length 64
21:30:29.102932 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 8975, seq 13, length 64
21:30:29.103539 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 8975, seq 13, length 64





 sysctl dev.iwn.0.debug=1
dev.iwn.0.debug: 0 -> 1

tcpdump -ni wlan0

tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlan0, link-type EN10MB (Ethernet), capture size 96 bytes
21:32:36.606504 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 0, length 64
21:32:37.610557 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 1, length 64
21:32:38.613622 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 2, length 64
21:32:39.616695 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 3, length 64
21:32:40.619753 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 4, length 64
21:32:41.622836 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 5, length 64
21:32:42.625910 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 6, length 64
21:32:43.628973 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 7, length 64
21:32:44.632033 IP 172.17.0.140 > 172.17.0.1: ICMP echo request, id 9743, seq 8, length 64
21:32:48.588427 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 9999, seq 0, length 64
21:32:48.589101 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 9999, seq 0, length 64
21:32:49.592652 IP 172.17.0.140 > 172.17.0.200: ICMP echo request, id 9999, seq 1, length 64
21:32:49.593276 IP 172.17.0.200 > 172.17.0.140: ICMP echo reply, id 9999, seq 1, length 64
```


----------



## bschmidt (Jan 27, 2010)

Which type of router is that? FreeBSD based one? With a bridge? In case it is, check `# arp -an` on the router, it should show your clients IP and HW addr.


----------



## LesJen (Jan 27, 2010)

It's a Dlink dir-615


----------



## bschmidt (Jan 27, 2010)

To get that right, over the wireless link you can not ping the router itself but another IP behind the router?

Google says that there probably is in issue with WPA re-keying and setting "Group Key Interval Update" to lower value might help. Sounds unrelated though.


----------



## LesJen (Jan 27, 2010)

Yes that is correct!

From another pc I can ping the router and there's full Internet access.

If I do a ping http://www.google.com from the wireless pc it can't resolve the address.

Anything else I can try?


----------



## iegeorgiev (Jan 28, 2010)

bschmidt said:
			
		

> Google says that there probably is in issue with WPA re-keying and setting "Group Key Interval Update" to lower value might help. Sounds unrelated though.



Hi,
This fixes my problem. Here is some more info.

My device is recognized as:

```
iwn0: <Intel(R) PRO/Wireless 5100> mem 0xf4200000-0xf4201fff irq 18 at device 0.0 on pci4
```

I am connecting to a router with WPA-PSK security set up.

My connection would be fine for about 5 minutes and then the internet disappears. The device is still associated and i can ping other computers on the network, but not the router or, anything outside.

doing /etc/rc.d/netif restart fixes for another 5 minutes, and i noticed when restarting that wpa_supplicant had already gone down for some reason.

After seeing your post i disabled the re-keying on the router(was set to 30 seconds) and have not had the problem for about 2 hours.

Let me know if i can help with any additional info.


----------



## LesJen (Jan 28, 2010)

My problem is similar, it drops after about two hours. In the router the "Group Key Update Interval" is set to 3600 seconds. I'll try to change it and see what happens.


----------



## MellowCat (Jan 28, 2010)

I get the same dropped connections after a certain interval, but I've checked my router config and there is no 'group key update' option to change. 
I'm using WPA-PSK as well, on a Belkin Pre-N router.
Probably quite obsolete by now.

Thanks for any info
/K


----------



## LesJen (Jan 28, 2010)

I lowerd my setting to 1800 sec (half an hour!) and I stil have the problem after about two hours!! I can see in /var/log/messages that:


```
PA: Group rekeying completed with 00:21:91:02:e9:13 [GTK=TKIP]
```

So I recon it must be something else. I'll try different settings, at the moment I'm at 900 sec. after that I'll try 7200 sec's and see what happens.


----------



## LesJen (Jan 28, 2010)

Here's my findings so far! At the begining I had my setting at 3600 (one hour) and the disconnection came after roughly two hours.
I've tried with 1800 (half an hour) and the disconnection is at about one hour!! Then I tried 900 (15 minutes) and disconnection was in about 30 minutes and lastly I had 450 (7 min 30 sec) and disconnection came after 15 min.

I've now set 7200 sec (two hours) and if I'm right the disconnection should appear after four hours.

So it seems that it's the second negotiation that is not successful.

Any comments?


----------



## bschmidt (Jan 28, 2010)

LesJen said:
			
		

> Here's my findings so far! At the begining I had my setting at 3600 (one hour) and the disconnection came after roughly two hours.
> I've tried with 1800 (half an hour) and the disconnection is at about one hour!! Then I tried 900 (15 minutes) and disconnection was in about 30 minutes and lastly I had 450 (7 min 30 sec) and disconnection came after 15 min.
> 
> I've now set 7200 sec (two hours) and if I'm right the disconnection should appear after four hours.
> ...



That is a very interesting fact, indeed. I try to get up with a test with which I'm able to reproduce that. Currently I not had any luck with that.

Btw, there is even a PR with the exact same issue.


----------



## LesJen (Jan 28, 2010)

> Btw, there is even a PR with the exact same issue.
> Reply With Quote



Do you have a link?


----------



## bschmidt (Jan 28, 2010)

bin/142547


----------



## iegeorgiev (Jan 28, 2010)

I see a similar problem reported in NetBSD, but it looks old.
I wonder if it might be some sort of a regression. I will post
the link anyways, might be helpful.

http://mail-index.netbsd.org/current-users/2008/04/18/msg001879.html


----------



## LesJen (Jan 30, 2010)

LesJen said:
			
		

> I've now set 7200 sec (two hours) and if I'm right the disconnection should appear after four hours.



I think I'm right  Now I had the computer on for more than four hours and it lost connection right after

```
WPA: Group rekeying completed with 00:21:91:02:e9:13 [GTK=TKIP]
```


----------



## oliverh (Jan 31, 2010)

I have loss of connection while using a different router (AVM Fritz Box, 802.11n), whereas my old Links WRT54GL works like a charm for days. So imho it depends on the AP/router.


----------



## bschmidt (Jan 31, 2010)

oliverh said:
			
		

> I have loss of connection while using a different router (AVM Fritz Box, 802.11n), whereas my old Links WRT54GL works like a charm for days. So imho it depends on the AP/router.



True. It's very hard for me to reproduce this issue with the hardware I have. It runs for days without a single packet loss..

Anyway, for those who have the issue with rekeying, apply

```
Index: sys/net80211/ieee80211_crypto_tkip.c
===================================================================
--- sys/net80211/ieee80211_crypto_tkip.c	(revision 203242)
+++ sys/net80211/ieee80211_crypto_tkip.c	(working copy)
@@ -144,6 +144,8 @@ tkip_setkey(struct ieee80211_key *k)
 		return 0;
 	}
 	k->wk_keytsc = 1;		/* TSC starts at 1 */
+	if (k->wk_flags & IEEE80211_KEY_GROUP)
+		ctx->rx_phase1_done = 0;
 	return 1;
 }
```
and rebuild your kernel and driver.

Let me know whether that does help.


----------



## bschmidt (Jan 31, 2010)

To those who don't have that issue.. please also test.
Thanks


----------



## LesJen (Jan 31, 2010)

bschmidt said:
			
		

> Anyway, for those who have the issue with rekeying, apply
> 
> ```
> Index: sys/net80211/ieee80211_crypto_tkip.c
> ...



I need instructions on how to apply, sorry.


----------



## bschmidt (Jan 31, 2010)

LesJen said:
			
		

> I need instructions on how to apply, sorry.



Copy the content from the post to a file rekey.diff, go to /usr/src and apply the patch, after that rebuild your kernel.
`# cd /usr/src`
`# patch -p0 < /path/to/rekey.diff`
`# make buildkernel`
`# make installkernel`

Finally rebuild the iwn driver as you did before and reboot.


----------



## LesJen (Jan 31, 2010)

OK! That's done, rebooted and changed the negotiation time in the firewall to 900 sec (15 min) so in half a hour I should see a disconnetion again. What information do you need from me then?

One comment about the hardware. I'm also using W7 on the same machine and I've not seen this problem when running W7. I'm aware that it's no guaranty of anyhting, so Please no flame war ;-) I'm just trying to help


----------



## LesJen (Jan 31, 2010)

I've now been connected for over an hour and should have lost connection twice but there's been no disconnection so far.


----------



## bschmidt (Jan 31, 2010)

LesJen said:
			
		

> I've now been connected for over an hour and should have lost connection twice but there's been no disconnection so far.



That is good news 

Btw, you can do `# wlandebug +crypto` which will log rekeying events.


----------



## hellwig (Jan 31, 2010)

*Will this be available in RELENG_8?*

Thanks for the port, with the addition of the tkip patch I haven't seen any issues yet. Any chance we will see this in RELENG_8 soon?


----------



## YuriS (Feb 2, 2010)

Hello!
Recently upgrade my FreeNAS by Intel 5100 ABG mini PCI-e WLAN card. But in FreeNas system I haven't any compiler, and I need precompiled (Intel 64) drivers iwn5000fw.ko and if_iwn.ko
Can anyone help me?
Thanks.
Yuri.


----------



## bschmidt (Feb 2, 2010)

YuriS said:
			
		

> Hello!
> Recently upgrade my FreeNAS by Intel 5100 ABG mini PCI-e WLAN card. But in FreeNas system I haven't any compiler, and I need precompiled (Intel 64) drivers iwn5000fw.ko and if_iwn.ko
> Can anyone help me?
> Thanks.
> Yuri.



`$ uname -a` please, including SVN revision.


----------



## bschmidt (Feb 2, 2010)

drbsd said:
			
		

> Hi,
> 
> I have a Thinkpad SL510 with Intel 1000 link wireless card and I had to modify if_iwn.c in the code found on svn co http://svn.techwires.net/svn/projects/freebsd/ to make it works (otherwise it panic)
> 
> ...



Revision 38 should read the EEPROM correctly. Can you verify this?


----------



## dpetrov (Feb 3, 2010)

bschmidt said:
			
		

> Revision 38 should read the EEPROM correctly. Can you verify this?



I just tried it, and rev. 38 seems to be working just fine (previously I got panic/reboot on kldload). Great!


----------



## drbsd (Feb 3, 2010)

bschmidt said:
			
		

> Revision 38 should read the EEPROM correctly. Can you verify this?


Hi,

It works great now !
But where are changes ?


----------



## bschmidt (Feb 3, 2010)

drbsd said:
			
		

> Hi,
> 
> It works great now !
> But where are changes ?



r38 diff
Small change, but.. you know, the small ones are the hard ones.


----------



## oliverh (Feb 3, 2010)

Btw. which version is in 8-STABLE?


----------



## bschmidt (Feb 3, 2010)

oliverh said:
			
		

> Btw. which version is in 8-STABLE?



The same as in HEAD, has been MFCed a couple of days ago. HEAD lags behind a few commits compared to my repo, nothing major though.


----------



## dpetrov (Feb 3, 2010)

bschmidt said:
			
		

> True. It's very hard for me to reproduce this issue with the hardware I have. It runs for days without a single packet loss..
> 
> Anyway, for those who have the issue with rekeying, apply
> 
> ...



I hope this is going to be committed to 8-HEAD/STABLE eventually?


----------



## bschmidt (Feb 3, 2010)

dpetrov said:
			
		

> I hope this is going to be committed to 8-HEAD/STABLE eventually?



Sure, I'll poke net@ in a couple of days. I just want to make sure that this is a correct fix and I'm not missing something else. I'm also waiting on reply from the PR.


----------



## LesJen (Feb 4, 2010)

I just want to report that after the rekey.diff I've had no problem what so ever 

I do have one question: How would you solve that at boot I have ntpd, noipd and bsdstats complaining of no network. I'm aware that it has to do with the time it takes for the network to get on line. Is there a way for checking or waiting to start services untill the network is up?

Thanks again
/Leslie


----------



## bschmidt (Feb 4, 2010)

LesJen said:
			
		

> I just want to report that after the rekey.diff I've had no problem what so ever
> 
> I do have one question: How would you solve that at boot I have ntpd, noipd and bsdstats complaining of no network. I'm aware that it has to do with the time it takes for the network to get on line. Is there a way for checking or waiting to start services untill the network is up?
> 
> ...



It might be as easy as replacing DHCP with SYNCDHCP in /etc/rc.conf


----------



## LesJen (Feb 4, 2010)

bschmidt said:
			
		

> I might be as easy as replacing DHCP with SYNCDHCP in /etc/rc.conf



You're rigth, nice and simple. Thank you


----------



## LesJen (Feb 5, 2010)

Yesterday I saw that the newest version is 39. I was on 33 with the rekey.diff. I upgraded to 39 and the disconnections are back. Do I have to apply the rekey.diff even to the latest version?

Thanks


----------



## bschmidt (Feb 5, 2010)

LesJen said:
			
		

> Yesterday I saw that the newest version is 39. I was on 33 with the rekey.diff. I upgraded to 39 and the disconnections are back. Do I have to apply the rekey.diff even to the latest version?
> 
> Thanks



The patch is for the kernel not for the iwn driver. If you did just update iwn and not the kernel, there is no need to apply the patch again.

Use `# wlandebug +crypto` to see if it is again the rekeying issue.


----------



## YuriS (Feb 5, 2010)

bschmidt said:
			
		

> `$ uname -a` please, including SVN revision.





			
				YuriS said:
			
		

> Hello!
> Recently upgrade my FreeNAS by Intel 5100 ABG mini PCI-e WLAN card. But in FreeNas system I haven't any compiler, and I need precompiled (Intel 64) drivers iwn5000fw.ko and if_iwn.ko
> Can anyone help me?
> Thanks.
> Yuri.




```
FreeBSD freenas.local 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #0: Fri Oct 16 16:53:48 UTC 2009     root@vmbsd72amd64:/usr/obj/freenas/usr/src/sys/FREENAS-amd64  amd64
```
PS,
Sorry forr delayed response 
Yuri.


----------



## YuriS (Feb 5, 2010)

FreeNAS version is FreeNAS-amd64-0.7.4919


----------



## bschmidt (Feb 5, 2010)

YuriS said:
			
		

> ```
> FreeBSD freenas.local 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #0: Fri Oct 16 16:53:48 UTC 2009     root@vmbsd72amd64:/usr/obj/freenas/usr/src/sys/FREENAS-amd64  amd64
> ```
> PS,
> ...



The driver is only for 8.0 and later, there have been to many changes in net80211 to simply backport it. If you can't get Freenas to use a newer kernel you are out of luck with that Intel card.


----------



## YuriS (Feb 6, 2010)

They said, that 0.7 version is last.  . And I don't know about the plans of future development & support FreeNAS. I try to change my card by older Intel 3945abg. Thank you anyway!
Yuri.


----------



## comfortableodo (Feb 6, 2010)

Hello bschmidt,

if I am not mistaken, you became a new comitter for src?! Congratulations!!
Thanks for the driver by the way! Works like a charm.


----------



## bschmidt (Feb 6, 2010)

comfortableodo said:
			
		

> Hello bschmidt,
> 
> if I am not mistaken, you became a new comitter for src?! Congratulations!!
> Thanks for the driver by the way! Works like a charm.



Thanks and you are welcome


----------



## LesJen (Feb 8, 2010)

bschmidt said:
			
		

> It might be as easy as replacing DHCP with SYNCDHCP in /etc/rc.conf



Now after installing ver 39 it takes so long that I get a "giving up" message when booting. It takes about another 10 sec. before the wlan is up. I liked it when it waited to aquire an IP-address. Any chance it can be fixed?

Thanks


----------



## bschmidt (Feb 15, 2010)

LesJen said:
			
		

> Now after installing ver 39 it takes so long that I get a "giving up" message when booting. It takes about another 10 sec. before the wlan is up. I liked it when it waited to aquire an IP-address. Any chance it can be fixed?
> 
> Thanks



I expect that to be related with scanning. It doesn't find the desired AP on the first few tries, can you confirm that?


----------



## LesJen (Feb 15, 2010)

bschmidt said:
			
		

> I expect that to be related with scanning. I doesn't find the desired AP on the first few tries, can you confirm that?



What I've done is waiting some seconds before I turn on the PC. I have one power switch that used to start everything at the same time. After I changed my rutine I usually get link and DHCP offer. It has failed a few times but I'm not sure if it's the scanning or just a time out that's to short!

Thanks


----------



## bschmidt (Feb 15, 2010)

LesJen said:
			
		

> What I've done is waiting some seconds before I turn on the PC. I have one power switch that used to start everything at the same time. After I changed my rutine I usually get link and DHCP offer. It has failed a few times but I'm not sure if it's the scanning or just a time out that's to short!
> 
> Thanks



"Everything" as in both computer and the AP? Ok.. as of the lag of information I assume the AP is not yet up when the computer tries to associate.

On a site note, I've noticed that (at least with wpa_supplicant) the first scan barely returns scan results. I believe that is related with way to short dwell times. Looking into that..


----------



## LesJen (Feb 15, 2010)

bschmidt said:
			
		

> "Everything" as in both computer and the AP? Ok.. as of the lag of information I assume the AP is not yet up when the computer tries to associate.
> 
> On a site note, I've noticed that (at least with wpa_supplicant) the first scan barely returns scan results. I believe that is related with way to short dwell times. Looking into that..



Your assumption is correct, the AP was probaly not ready. But as I mentioned before, I started seeing this when I went from r33 to r39.

I look forward to your findings concerning the scan results.

/Leslie


----------



## bschmidt (Feb 15, 2010)

LesJen said:
			
		

> Your assumption is correct, the AP was probaly not ready. But as I mentioned before, I started seeing this when I went from r33 to r39.
> 
> I look forward to your findings concerning the scan results.
> 
> /Leslie



Would you try that again with r33? I can't point my finger on a change which might cause the issue.


----------



## LesJen (Feb 15, 2010)

bschmidt said:
			
		

> Would you try that again with r33? I can't point my finger on a change which might cause the issue.



This is what I've done. Reverted to r33 and rebooted, then r34, r35 and r36 I did not see the giving up message. With r37 I saw it once, r38 more than once (2 out of three reboots) with r39 it's more often than not that I get the giving up message, 5 out of 6 reboots. AP was powered on all the time!

/L


----------



## bschmidt (Feb 15, 2010)

LesJen said:
			
		

> This is what I've done. Reverted to r33 and rebooted, then r34, r35 and r36 I did not see the giving up message. With r37 I saw it once, r38 more than once (2 out of three reboots) with r39 it's more often than not that I get the giving up message, 5 out of 6 reboots. AP was powered on all the time!
> 
> /L



Ok, thanks. The only thing worth investigating is that starting with r37 there is support for HT channels. But those are only read from the EEPROM, that shouldn't be an issue.. I'll look into that.


----------



## LesJen (Feb 17, 2010)

I need your input on this. Today for some reason my wlan would not connect. I tried to rebuild the driver but it did not help. One thing that I don't believe should affect is that I have the following line in my system /etc/crontab
@daily                           root    freebsd-update cron
I got a message from this job that it had downloaded patches for
8.0-RELEASE-p2 which my system already is and it also said that the files on my system where manually changed, which is correct, that's the rekey.diff.
I've tried to revert back through the versions but it did not help either. By chance I gave the command wlandebug +crypto to follow what was happening, see below.
Within one minute of issuing the wlandebug command it connected! I thought it was by chance so I rebooted and did it all over again and the same behaviour after the command wlandebug it connected shortly after. Please comment because I do not understand this.



```
Feb 17 19:19:02  wpa_supplicant[411]: WPA: Key negotiation completed with 00:21:91:02:e9:13 [PTK=TKIP GTK=TKIP]
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_newkey: cipher 1 flags 0x3 keyix 65535
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_newkey: no h/w support for cipher TKIP, falling back to s/w
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_newkey: no h/w support for TKIP MIC, falling back to s/w
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_setkey: TKIP keyix 0 flags 0x1f3 mac 00:21:91:02:e9:13 rsc 0 tsc 0 len 16
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_newkey: cipher 1 flags 0x6 keyix 2
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_newkey: no h/w support for cipher TKIP, falling back to s/w
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_newkey: no h/w support for TKIP MIC, falling back to s/w
Feb 17 19:19:02  kernel: wlan0: ieee80211_crypto_setkey: TKIP keyix 2 flags 0x1f6 mac ff:ff:ff:ff:ff:ff rsc 7 tsc 0 len 16
Feb 17 19:19:02  wpa_supplicant[411]: CTRL-EVENT-CONNECTED - Connection to 00:21:91:02:e9:13 completed (auth) [id=0 id_str=]
Feb 17 19:19:06  dhclient: New IP Address (wlan0): 172.17.0.140
Feb 17 19:19:06  dhclient: New Subnet Mask (wlan0): 255.255.255.0
Feb 17 19:19:06  dhclient: New Broadcast Address (wlan0): 172.17.0.255
Feb 17 19:19:06  dhclient: New Routers (wlan0): 172.17.0.1
```


----------



## chess (Feb 17, 2010)

Bschmidt, I wanted to let you know that I built and installed your driver for the Intel 5100 on my Thinkpad x201s (I pulled from SVN about a week ago) and it has been working great.  Thank you!


----------



## bschmidt (Feb 18, 2010)

chess said:
			
		

> Bschmidt, I wanted to let you know that I built and installed your driver for the Intel 5100 on my Thinkpad x201s (I pulled from SVN about a week ago) and it has been working great.  Thank you!



You're welcome


----------



## bschmidt (Feb 18, 2010)

LesJen said:
			
		

> Within one minute of issuing the wlandebug command it connected! I thought it was by chance so I rebooted and did it all over again and the same behaviour after the command wlandebug it connected shortly after. Please comment because I do not understand this.



That really sounds like the scanning issue I was talking about. The card will not "find" an AP because of really short hardcoded dwell times. Dwell times define how long to stay on a channel before considering it as "quiet" without an AP and switching to the next one. Also once a assoc/auth attempt is made, the driver uses even shorter dwell times for backgrounds scans. Because I missed that part initially, the driver does not clean up dwell times correctly on connection loss and sticks to using those short dwell times with almost no way to get a scan result.

I'm working on that one. Especially using dynamic dwell times provides by net80211, it will take a another couple of days of testing before I consider it worth committing though.

You can verify that with `# wlandebug +scan +state` which will print the scanning process and results.


----------



## epopen (Feb 19, 2010)

Thanks work.
I had been update system source code, complier, install, and use it(intel 5100agn in Toshiba M800.
But I haven't AccessPoint, So I can't test it.
Anyway... I saw boot message(dmesg), iwn0 output have 802.11abg support message.
But haven't 802.11n support, Is it iwn driver or FreeBSD issue?
Thanks you very much.


----------



## bschmidt (Feb 19, 2010)

epopen said:
			
		

> Thanks work.
> I had been update system source code, complier, install, and use it(intel 5100agn in Toshiba M800.
> But I haven't AccessPoint, So I can't test it.
> Anyway... I saw boot message(dmesg), iwn0 output have 802.11abg support message.
> ...



The driver does currently not have any kind of 11n support. This is still on my TODO list.


----------



## BitUnique (Feb 19, 2010)

I'm trying to upgrade my iwn/iwnfw using the method described bellow;


```
svn co http://svn.techwires.net/svn/projects/freebsd
cd freebsd/sys/modules/iwnfw
make
make install
cd ../iwn
env CFLAGS=-I$PWD/../../ make
make install
```

And it gives the following warning when i run env CFLAGS=-I$PWD/../../ make;


```
pandora# env CFLAGS=-I$PWD/../../ make
===> iwn1000 (all)
Warning: Object directory not changed from original /root/freebsd/sys/modules/iwnfw/iwn1000
===> iwn4965 (all)
Warning: Object directory not changed from original /root/freebsd/sys/modules/iwnfw/iwn4965
===> iwn5000 (all)
Warning: Object directory not changed from original /root/freebsd/sys/modules/iwnfw/iwn5000
===> iwn5150 (all)
Warning: Object directory not changed from original /root/freebsd/sys/modules/iwnfw/iwn5150
===> iwn6000 (all)
Warning: Object directory not changed from original /root/freebsd/sys/modules/iwnfw/iwn6000
```

Is this the reason that after updating the driver and rebooting, i can no longer get online?

Thanks
Bit


----------



## LesJen (Feb 23, 2010)

bschmidt said:
			
		

> That really sounds like the scanning issue I was talking about. The card will not "find" an AP because of really short hardcoded dwell times. Dwell times define how long to stay on a channel before considering it as "quiet" without an AP and switching to the next one. Also once a assoc/auth attempt is made, the driver uses even shorter dwell times for backgrounds scans. Because I missed that part initially, the driver does not clean up dwell times correctly on connection loss and sticks to using those short dwell times with almost no way to get a scan result.
> 
> I'm working on that one. Especially using dynamic dwell times provides by net80211, it will take a another couple of days of testing before I consider it worth committing though.
> 
> You can verify that with `# wlandebug +scan +state` which will print the scanning process and results.



I've had other things to do so sorry for the delay! Here's the output on a working connection. I'm still on -r 41.



```
Feb 23 23:10:01  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 641239 duration 150
Feb 23 23:10:01  kernel: wlan0: scan_task: chan   1g ->   1g [active, dwell min 20ms max 150ms]
Feb 23 23:10:01  kernel: wlan0: scan_task: chan   1g ->   6g [active, dwell min 20ms max 139ms]
Feb 23 23:10:01  kernel: [00:19:cb:4d:93:48] new beacon on chan 6 (bss chan 6) "peter" rssi 11
Feb 23 23:10:01  kernel: [00:19:cb:4d:93:48] caps 0x431 bintval 100 erp 0x100
Feb 23 23:10:01  kernel: wlan0: scan_task: chan   6g ->  11g [active, dwell min 20ms max 123ms]
Feb 23 23:10:01  kernel: [00:22:6b:7a:18:89] new beacon on chan 11 (bss chan 11) "linksys" rssi 9
Feb 23 23:10:01  kernel: [00:22:6b:7a:18:89] caps 0x411 bintval 100 erp 0x104
Feb 23 23:10:01  kernel: wlan0: scan_task: chan  11g ->   7g [active, dwell min 20ms max 106ms]
Feb 23 23:10:01  kernel: wlan0: scan_task: chan   7g ->  13g [passive, dwell min 20ms max 90ms]
Feb 23 23:10:01  kernel: wlan0: ieee80211_cancel_anyscan: cancel active scan
Feb 23 23:10:01  kernel: wlan0: scan_task: done, [ticks 641304, dwell min 20 scanend 641392]
Feb 23 23:10:02  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 642058 duration 150
Feb 23 23:10:02  kernel: wlan0: scan_task: chan   1g ->  52a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:02  kernel: wlan0: scan_task: chan  52a ->  56a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:02  kernel: wlan0: scan_task: stopped, [ticks 642246, dwell min 20 scanend 642210]
Feb 23 23:10:02  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 642263 duration 150
Feb 23 23:10:02  kernel: wlan0: scan_task: chan   1g ->  60a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan  60a ->  64a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:03  kernel: wlan0: ieee80211_cancel_anyscan: cancel active scan
Feb 23 23:10:03  kernel: wlan0: scan_task: done, [ticks 642349, dwell min 20 scanend 642413]
Feb 23 23:10:03  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 642672 duration 150
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   1g ->  36a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan  36a ->  40a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: stopped, [ticks 642860, dwell min 20 scanend 642824]
Feb 23 23:10:03  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 642877 duration 150
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   1g ->  44a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan  44a ->  48a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: stopped, [ticks 643064, dwell min 20 scanend 643027]
Feb 23 23:10:03  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 643082 duration 150
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   1g ->   2g [active, dwell min 20ms max 150ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   2g ->   3g [active, dwell min 20ms max 134ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   3g ->   4g [active, dwell min 20ms max 118ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   4g ->   5g [active, dwell min 20ms max 101ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   5g ->   8g [active, dwell min 20ms max 85ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   8g ->   9g [active, dwell min 20ms max 32ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: stopped, [ticks 643217, dwell min 20 scanend 643232]
Feb 23 23:10:03  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 643286 duration 150
Feb 23 23:10:03  kernel: wlan0: scan_task: chan   1g ->  10g [active, dwell min 20ms max 150ms]
Feb 23 23:10:03  kernel: wlan0: scan_task: chan  10g ->  12g [passive, dwell min 20ms max 133ms]
Feb 23 23:10:04  kernel: wlan0: scan_task: stopped, [ticks 643466, dwell min 20 scanend 643436]
Feb 23 23:10:04  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 643491 duration 150
Feb 23 23:10:04  kernel: wlan0: scan_task: chan   1g -> 149a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:04  kernel: wlan0: scan_task: chan 149a -> 153a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:04  kernel: wlan0: ieee80211_cancel_anyscan: cancel active scan
Feb 23 23:10:04  kernel: wlan0: scan_task: done, [ticks 643647, dwell min 20 scanend 643641]
Feb 23 23:10:04  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 644105 duration 150
Feb 23 23:10:04  kernel: wlan0: scan_task: chan   1g -> 157a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:04  kernel: wlan0: scan_task: chan 157a -> 161a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:04  kernel: wlan0: scan_task: stopped, [ticks 644293, dwell min 20 scanend 644258]
Feb 23 23:10:04  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 644310 duration 150
Feb 23 23:10:04  kernel: wlan0: scan_task: chan   1g -> 165a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: chan 165a -> 100a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: stopped, [ticks 644497, dwell min 20 scanend 644460]
Feb 23 23:10:05  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 644515 duration 150
Feb 23 23:10:05  kernel: wlan0: scan_task: chan   1g -> 104a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: chan 104a -> 108a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: stopped, [ticks 644702, dwell min 20 scanend 644665]
Feb 23 23:10:05  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 644719 duration 150
Feb 23 23:10:05  kernel: wlan0: scan_task: chan   1g -> 112a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: chan 112a -> 116a [passive, dwell min 20ms max 64ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: stopped, [ticks 644907, dwell min 20 scanend 644869]
Feb 23 23:10:05  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 644924 duration 150
Feb 23 23:10:05  kernel: wlan0: scan_task: chan   1g -> 120a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: chan 120a -> 124a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: stopped, [ticks 645111, dwell min 20 scanend 645074]
Feb 23 23:10:05  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 645129 duration 150
Feb 23 23:10:05  kernel: wlan0: scan_task: chan   1g -> 128a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: chan 128a -> 132a [passive, dwell min 20ms max 65ms]
Feb 23 23:10:05  kernel: wlan0: scan_task: stopped, [ticks 645316, dwell min 20 scanend 645279]
Feb 23 23:10:05  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 645333 duration 150
Feb 23 23:10:05  kernel: wlan0: scan_task: chan   1g -> 136a [passive, dwell min 20ms max 150ms]
Feb 23 23:10:06  wpa_supplicant[411]: CTRL-EVENT-SCAN-RESULTS 
Feb 23 23:10:06  kernel: wlan0: scan_task: chan 136a -> 140a [passive, dwell min 20ms max 64ms]
Feb 23 23:10:06  kernel: wlan0: scan_task: done, [ticks 645521, dwell min 20 scanend 645483]
Feb 23 23:10:06  kernel: wlan0: notify scan done
```


I'll get back to you when/if the problem will reocour.


----------



## bschmidt (Feb 25, 2010)

I've committed an update to scanning in general recently r42, it should now be much more reliable. And also be able to scan *all* 5GHz by now.



			
				LesJen said:
			
		

> I've had other things to do so sorry for the delay! Here's the output on a working connection. I'm still on -r 41.



No problem.



			
				LesJen said:
			
		

> ```
> Feb 23 23:10:01  kernel: wlan0: ieee80211_bg_scan: active scan, ticks 641239 duration 150
> Feb 23 23:10:01  kernel: wlan0: scan_task: chan   1g ->   1g [active, dwell min 20ms max 150ms]
> ..
> ...



Thx, though, I missed giving you another command to set, sry.


```
# wlandebug +scan +state
# sysctl dev.iwn.0.debug=0x2000
```


----------



## LesJen (Feb 26, 2010)

I'm using -r 43 now and it behaves very well. I've not seen any problems with getting a link from the AP. When a rescan is done it's very quick and the log just confirms that it has taken place. To me this was a very big step forward, the driver seems stable, so once again Thank you 
/L


----------



## digrouz (Feb 26, 2010)

I'm trying to compile it like you've said 
	
	



```
svn co http://svn.techwires.net/svn/projects/freebsd
cd freebsd/sys/modules/iwnfw
make
make install
cd ../iwn
env CFLAGS=-I$PWD/../../ make
make install
```

and I get the following error: http://pastebin.com/eQF8uD04

How can I solve it?


----------



## bschmidt (Feb 26, 2010)

digrouz said:
			
		

> I'm trying to compile it like you've said
> 
> 
> 
> ...



Try that.


----------



## digrouz (Feb 26, 2010)

Thanks, it works!

I'm able to connect on my ap with an hidden and using WPA encryption


----------



## eyebone (Mar 3, 2010)

@bschmidt,

do you have a changelog and/or todo list? i like to add the mac changing and usage of monitor mode as a nice feature, or is this already implemented and i just made some mistakes.


----------



## bschmidt (Mar 4, 2010)

eyebone said:
			
		

> @bschmidt,
> 
> do you have a changelog and/or todo list? i like to add the mac changing and usage of monitor mode as a nice feature, or is this already implemented and i just made some mistakes.



You can use the svn revision history as some kind of changelog.

I do not have a TODO list, at least nothing written down. What I still want to do is:

11n
IBSS mode
hostap mode

Monitor Mode should work with something like
`# wlanconfig wlan0 create wlandev iwn0 wlanmode monitor`
`# ifconfig wlan0 channel 11 up`
`# tcpdump -ne -y IEEE802_11_RADIO -i wlan0`

For tools like aircrack, it's not the driver which has to be modified to get things going. It's either net80211 or the tools itself.

I didn't have a look into changing the MAC addr, if you want to jump in there, I'd appreciate that.


----------



## LesJen (Mar 18, 2010)

I'm on a 8.0-RELEASE-p2 system.

Trying to get aggregation to work but I get a kernel panic.

After testing I found out that the line


```
ifconfig_iwn0="ether 00:16:ea:61:01:e8"
```
in my rc.conf is the culprit. If I comment it out the system will start but only with the wired interface working.

I have 
	
	



```
if_lagg_load="YES"
```
 in /boot/loader.conf

and the following in /etc/rc.conf


```
wpa_supplicant_enable="YES"
ifconfig_em0="up"
# ifconfig_iwn0="ether 00:16:ea:61:01:e8"
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA"
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto failover laggport em0 laggport wlan0 DHCP"
```
I've posted this to freebsd-questions and to freeebsd-net. I thought I'll let the list know just in case it is driver related.


----------



## sylvio (Mar 18, 2010)

Hi, 

I have a notebook Dell Latitude E4300 with a Intel wireless 5100, I have installed:

```
FreeBSD desk.scjamorim.org 9.0-CURRENT-201002 FreeBSD 9.0-CURRENT-201002 #0: Fri Feb 12 22:10:17 UTC 2010     root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64
```

My device wireless:

```
# pciconf -vl
iwn0@pci0:12:0:0:	class=0x028000 card=0x13218086 chip=0x42328086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Carte Intel WiFi Link 5100 AGN (Intel WiFi Link 5100)'
    class      = network
```

My /boot/loader.conf

```
# cat /boot/loader.conf 
if_iwn_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```

My ifconfig:


```
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC>
	ether 00:21:70:f8:bd:7e
	inet6 fe80::221:70ff:fef8:bd7e%em0 prefixlen 64 scopeid 0x1 
	inet 172.18.22.55 netmask 0xffffff00 broadcast 172.18.22.255
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
	media: Ethernet autoselect (100baseTX <full-duplex>)
	status: active
iwn0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 2290
	ether 00:21:5d:27:93:18
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 32:4f:c0:7f:62:01
	ch 1 dma -1
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	lladdr 32.4f.c0.0.18.7f.62.1.a.2.ff.fe.0.0.0.0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=3<RXCSUM,TXCSUM>
	inet 127.0.0.1 netmask 0xff000000 
	inet6 ::1 prefixlen 128 
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5 
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
wlan0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:21:5d:27:93:18
	media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
	status: no carrier
	ssid "" channel 1 (2412 MHz 11b)
	country US authmode OPEN privacy OFF txpower 15 bmiss 10 scanvalid 60
	bgscan bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 1 wme
	bintval 0
```

My /etc/rc.conf:


```
# WIFI
wlans_iwn0="wlan0"
```

But command return error:

```
# ifconfig wlan0 create wlandev iwn0 wlanmode monitor
# ifconfig: create: bad value
```

Why?

Other thing, same idea of when iwn will have support to:
    * 11n
    * IBSS mode
    * hostap mode
??
Thanks,

Sylvio


----------



## oliverh (Mar 18, 2010)

>wlans_iwn0="wlan0"

Nothing else? Why are using current btw.? It's not the latest and greatest, it's FreeBSD under heavy development, a moving target. If you want to use something reliable try stable or release.


----------



## bschmidt (Mar 19, 2010)

sylvio said:
			
		

> My /etc/rc.conf:
> 
> 
> ```
> ...



iwn does only support one VAP, this won't change anytime soon. So, either remove that entry from rc.conf or delete the VAP first.

`# ifconfig wlan0 destroy`
`# ifconfig wlan0 create wlandev iwn0 wlanmode monitor`



			
				sylvio said:
			
		

> Other thing, same idea of when iwn will have support to:
> * 11n
> * IBSS mode
> * hostap mode
> ??



There are still issues within net80211 regarding 11n, Rui Paulo is working on that and I try to help him where and if I can.

I have no timeline for IBSS/HOSTAP, but it's definitely on my TODO list.


----------



## sylvio (Mar 19, 2010)

Thanks Bschmidt.


----------



## geek_nomad (Apr 24, 2010)

i'm a newbie to freebsd. i started using it only today.
i followed the instructions from post 16.
After that, when i tried to do

```
ifconfig wlan0 create wlandev iwn0
```

i get the following output

```
ifconfig: SIOCIFCREATE2: Device not configured
```

and the i tried 

```
ifconfig iwn0 up
```

my system gets restarted.
Can anyone help me?


----------



## bschmidt (Apr 24, 2010)

Please post the output of `# ifconfig -a` before you do `# wlanconfig wlan0 create wlandev iwn0`. Also post the output of `# kldstat`.

Usually you issue commands directly to wlan0 not to iwn0, though, that shouldn't panic.

Did you configure something in rc.conf?


----------



## geek_nomad (Apr 26, 2010)

I removed freebsd. I used to have ethernet connection but i dont have it anymore. So is there a way i can install the wifi driver offline like without the subversion part? If so, then can you also provide step by step instructions in installing it? I'm ready to try freebsd again.


----------



## geek_nomad (Apr 28, 2010)

I managed to compile and install the driver. These were the steps i tried.

[cmd=]kldload if_iwn[/cmd]

and then

[cmd=]ifconfig wlan0 create wlandev iwn0[/cmd]

i get this


```
ifconfig: create: bad value
```


----------



## nihplod (Apr 28, 2010)

I tried this driver out, works perfectly. BUT!

When i am connected to a non-secure connection it can be connected for 7 days in a row with no disturbance

When i am connected to a WPA/WPA2 connection the interface goes down every 30 min and then usally back up again. But this makes me loose my connection and i cry about this 

I have tried to have -bgscan for the interface and there is no difference.
And i tried to have apscan=1 and just comment that one out. No difference at all.

Any idea, where am i doing a boo boo?


----------



## bschmidt (Apr 28, 2010)

Try to apply this patch.


----------



## nihplod (Apr 29, 2010)

bschmidt said:
			
		

> Try to apply this patch.



Myees, well for a deadly normal human being. How and where do i apply this magical patch?


----------



## bschmidt (Apr 29, 2010)

Download the patch and then
`# cd /usr/src`
`# patch -p1 < /PATH/TO/PATCH`
`# make buildkernel`
`# make installkernel`


----------



## nihplod (Apr 29, 2010)

bschmidt said:
			
		

> Download the patch and then
> `# cd /usr/src`
> `# patch -p1 < /PATH/TO/PATCH`
> `# make buildkernel`
> `# make installkernel`



the make buildkernel does not work for me
I always compile the kernel via /usr/src/sys/i386/conf where i config Kernelconf then cd../compile/Kernelconf and make cleandepend && make depend && make && make install

Should this also work?
Cause the make buildkernel says

```
> make buildkernel
make: don't know how to make buildkernel. Stop
```


----------



## bschmidt (Apr 29, 2010)

Using config.. should also work.


----------



## nihplod (Apr 30, 2010)

bschmidt said:
			
		

> Using config.. should also work.



Latest patch seems stable, connected to an WPA2 network for 2 hours now with no disconnect.

Other question, if i do the svn bla bla make install stuff iwnfw tjohoo thing and then recompiles the kernel the drivers are gone. But if i recompile kernel, reboots, does the svn stuff and then reboots the drivers are there.

Which is the correct procedure in the end? Or should i remove iwnfw from the kernel too?


----------



## bschmidt (Apr 30, 2010)

nihplod said:
			
		

> Latest patch seems stable, connected to an WPA2 network for 2 hours now with no disconnect.
> 
> Other question, if i do the svn bla bla make install stuff iwnfw tjohoo thing and then recompiles the kernel the drivers are gone. But if i recompile kernel, reboots, does the svn stuff and then reboots the drivers are there.
> 
> Which is the correct procedure in the end? Or should i remove iwnfw from the kernel too?



If you use the SVN checkout for the iwn stuff, you should include neither iwn nor iwnfw in the kernel config. Only use modules. /usr/src has an older version of iwn and iwnfw which is used when included in the kernel config.


----------



## LesJen (May 4, 2010)

Hello again. I'm still seeing problems with connecting to the ap!! This is only when I boot into FreeBSD.
Because of my work I also have Win7 on this machine and I never see problems there.
Can I adjust some setting to make it more willing to connect?
Usually I must restart the ap to get a connection. 
	
	



```
/etc/netif restart
```
 won't do it. 
When connected everything works fine 


```
May  4 07:27:32  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:27:40  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:27:40  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:27:50  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:27:57  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:27:57  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:28:07  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:28:15  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:28:15  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:28:25  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:28:32  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:28:32  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:28:42  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:28:50  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:28:50  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:29:00  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:29:07  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:29:07  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:29:17  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:29:25  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:29:25  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:29:35  wpa_supplicant[414]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:29:43  wpa_supplicant[414]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:29:43  wpa_supplicant[414]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:29:46  wpa_supplicant[414]: Failed to disable WPA in the driver.
May  4 07:29:47  kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
May  4 07:29:54  wpa_supplicant[2477]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:29:54  wpa_supplicant[2477]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:30:04  wpa_supplicant[2477]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:30:06  wpa_supplicant[2477]: Failed to disable WPA in the driver.
May  4 07:30:06  kernel: wlan0: Ethernet address: 00:16:ea:61:01:e8
May  4 07:30:14  wpa_supplicant[3415]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:30:14  wpa_supplicant[3415]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:30:24  wpa_supplicant[3415]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:30:32  wpa_supplicant[3415]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:30:32  wpa_supplicant[3415]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:30:42  wpa_supplicant[3415]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:30:49  wpa_supplicant[3415]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:30:49  wpa_supplicant[3415]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:30:59  wpa_supplicant[3415]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:31:07  wpa_supplicant[3415]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:31:07  wpa_supplicant[3415]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2467 MHz)
May  4 07:31:17  wpa_supplicant[3415]: Authentication with 00:21:91:02:e9:13 timed out.
May  4 07:31:24  wpa_supplicant[3415]: CTRL-EVENT-SCAN-RESULTS 
May  4 07:31:24  wpa_supplicant[3415]: Trying to associate with 00:21:91:02:e9:13 (SSID='myssid' freq=2412 MHz)
May  4 07:31:24  wpa_supplicant[3415]: Associated with 00:21:91:02:e9:13
May  4 07:31:24  kernel: wlan0: link state changed to UP
May  4 07:31:27  wpa_supplicant[3415]: WPA: Key negotiation completed with 00:21:91:02:e9:13 [PTK=TKIP GTK=TKIP]
May  4 07:31:27  wpa_supplicant[3415]: CTRL-EVENT-CONNECTED - Connection to 00:21:91:02:e9:13 completed (auth) [id=0 id_str=]
May  4 07:31:27  dhclient: New IP Address (wlan0): 172.17.0.138
May  4 07:31:27  dhclient: New Subnet Mask (wlan0): 255.255.255.0
May  4 07:31:27  dhclient: New Broadcast Address (wlan0): 172.17.0.255
May  4 07:31:27  dhclient: New Routers (wlan0): 172.17.0.1
```


----------



## bschmidt (May 4, 2010)

Don't use `# /etc/rc.d/netif restart` for now, as there is an issue with devd. Short version: wpa_supplicant gets started twice, which results in a lot of funny behavior.. You should be able to do same with just `# kldunload if_iwn``# kldload if_iwn`

Can't help much without knowing your configuration.


----------



## LesJen (May 4, 2010)

My config is here.
http://forums.freebsd.org/showpost.php?p=57319&postcount=131
Do you need further info?

Thanks


----------



## bschmidt (May 6, 2010)

Might you try a different channel? I don't see it yet, but there might be an issue with channel 12 and 13.


----------



## bschmidt (May 6, 2010)

Arg.. I mixed up a few things here.

The issue you see is a race between devd and netif. Please don't use netif for now. Short version: wpa_supplicant is started twice (you can verify this with ps).

To restart/reload wireless settings use
`# kldunload if_iwn`
`# kldload if_iwn`
instead, devd will call netif then.


----------



## LesJen (May 6, 2010)

There is a choice called "Enable Auto Channel Scan" that makes the ap choose the channel. I've now disabled it and choosen channel 6. I'll let you know if it makes any difference.

/Leslie


----------



## LesJen (May 10, 2010)

I wrote earlier about a problem with LAGG. See
http://forums.freebsd.org/showpost.php?p=73301&postcount=281

I've now got some help to make a kernel debug and also suggestions on trying STABLE because of the updates.

If you have developed the driver beyond version 62 which is the latest according to
http://svn.techwires.net/viewvc/viewvc.cgi/svnrepos/projects/freebsd/sys/dev/iwn/?view=log

If there are updates that are in STABLE but not posted on the above list, would you consider making it availible?

Thanks


----------



## bschmidt (May 11, 2010)

Actually stable lags behind  There are some changes in head/stable which I won't commit, simply because those require changes to net80211 which breaks support for release users.


----------



## LesJen (May 11, 2010)

bschmidt said:
			
		

> Actually stable lags behind  There are some changes in head/stable which I won't commit, simply because those require changes to net80211 which breaks support for release users.



OK! Thanks for answering. I'll keep my cool until 8.1 is released


----------



## Ysaldor (May 12, 2010)

Hello !

I'am a newbie to FreeBSD and im runing on PC-BSD release.

I'have installed your drivers normally.
I can see the networks ssid in the kde-network config but when i try to connect(a box by DHCP), the OS crashes and reboot....x(

Thank you in advance and forgive me for my bad English.:e


----------



## LesJen (May 12, 2010)

Can you post your /boot/loader.conf and /etc/rc.conf.

Also look in /var/log/messages for errors.


----------



## djeeke (Jun 10, 2010)

*driver build issue*

Hi,

I'm a newbie and I'm trying to get my 5100 to work on my laptop...

I'm not sure this thread is still being monitored as I see its 'Finished'.
But I want to give it a try ...

When following instructions as per post 16 I get an error at the second 'make' command ...
Anybody any idea why this would be the case ?

The error message : 

```
FreeBeaSD# env CFLAGS=-I$PWD/../../ make
Warning: Object directory not changed from original /usr/src/sys/freebsd/sys/modules/iwn
cc -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I/usr/src/sys/freebsd/sys/modules/iwn/../../ -I. -I@ -I@/contrib/altq -finline-limit=8000 --param 
inline-unit-growth=100 --param large-function-growth=1000 -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-
3dnow -mno-sse -mno-sse2 -mno-sse3 -ffreestanding -fstack-protector -std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-
externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c 
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c
cc1: warnings being treated as errors
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c: In function 'iwn_vap_create':
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:757: warning: implicit declaration of function 'ieee80211_amrr_init'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:757: warning: nested extern declaration of 'ieee80211_amrr_init'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c: In function 'iwn_vap_delete':
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:774: warning: implicit declaration of function 'ieee80211_amrr_cleanup'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:774: warning: nested extern declaration of 'ieee80211_amrr_cleanup'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c: In function 'iwn_newassoc':
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:1880: warning: implicit declaration of function 'ieee80211_amrr_node_init'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:1880: warning: nested extern declaration of 'ieee80211_amrr_node_init'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c: In function 'iwn_tx_done':
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2361: warning: implicit declaration of function 'ieee80211_amrr_tx_complete'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2361: warning: nested extern declaration of 'ieee80211_amrr_tx_complete'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2362: error: 'IEEE80211_AMRR_FAILURE' undeclared (first use in this function)
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2362: error: (Each undeclared identifier is reported only once
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2362: error: for each function it appears in.)
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2365: error: 'IEEE80211_AMRR_SUCCESS' undeclared (first use in this function)
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c: In function 'iwn_tx_data':
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2855: warning: implicit declaration of function 'ieee80211_amrr_choose'
/usr/src/sys/freebsd/sys/modules/iwn/../../dev/iwn/if_iwn.c:2855: warning: nested extern declaration of 'ieee80211_amrr_choose'
*** Error code 1

Stop in /usr/src/sys/freebsd/sys/modules/iwn.
FreeBeaSD#
```
My newly installed system : 

```
FreeBeaSD# uname -a
FreeBSD FreeBeaSD.local.net 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #0: Thu Jun 10 13:02:11 CEST 2010     
djeeke@FreeBeaSD.local.net:/usr/obj/usr/src/sys/GENERIC  i386
FreeBeaSD#
```
I installed from an 8.0 RELEASE and read somewhere 8.0 stable has a good driver so I tried to upgrade to stable but ended up with this 8.1 Prerelease... Guess I missed out something in cvs) Never mind as long as I can get my wireless up and running...

Thanks for any hints !!! (or telling me I should put on my glasses :e )

Replying can take a while as I don't often have a 'wired access' ï¿½e


----------



## oliverh (Jun 10, 2010)

@djeeke

Stable already has this driver, so no real need to install the separate driver.


----------



## djeeke (Jun 10, 2010)

OK Oliver,

Will try to see what I did wrong with CVSUP so it fetched 8.1 Prerelease instead of 8.0 stable... 

Thanks !


----------



## djeeke (Jun 11, 2010)

hmmmmm....

I checked and I did use RELENG_8 

Why did I end up with 8.1 Prerelease ????

Will retry once I get a wired connection again...


----------



## DutchDaemon (Jun 11, 2010)

RELENG_8 = the 8-STABLE tree, and the 8-STABLE tree is now at version 8.1-PRERELEASE. There may be some RC (Release Candidate) versions, and after the appearance of 8.1-RELEASE it will become 8.1-STABLE.


----------



## epopen (Jun 11, 2010)

Hello.

I have problem about WEP wifi connect fail (associated, but dhcilent always can't get IP)
Please reference http://forums.freebsd.org/showpost.php?p=86388&postcount=6

Thanks everyone very much


----------



## djeeke (Jun 11, 2010)

DutchDaemon said:
			
		

> RELENG_8 = the 8-STABLE tree, and the 8-STABLE tree is now at version 8.1-PRERELEASE. There may be some RC (Release Candidate) versions, and after the appearance of 8.1-RELEASE it will become 8.1-STABLE.



OK, so this means it's correct that I'm at 8.1 Prerelease ...
So I did not mess up my CVSUP  

I mentioned I had this one in my first posting and got told I needed STABLE to get the wireless driver...

So back to start...
How do I get STABLE today ????
I would like to get my wireless up and running !!!!

Thanks guys :stud


----------



## DutchDaemon (Jun 11, 2010)

Like I said 'STABLE today' == '8.1-PRERELEASE right now'.


----------



## djeeke (Jun 11, 2010)

DutchDaemon said:
			
		

> Like I said 'STABLE today' == '8.1-PRERELEASE right now'.



OK, 

Thanks DutchDaemon, then I guess my wireless card should be supported...

It's not


----------



## bschmidt (Jun 12, 2010)

`# dmesg` and `# pciconf -lv` please.


----------



## djeeke (Jun 12, 2010)

Thanks bschmidt !

I'll try to get those sent when I get a wired connection again...


----------



## djeeke (Jun 13, 2010)

Got my wire connected ;-)

answered here sorry for the double post :r


----------



## mikejc (Jun 17, 2010)

any idea how to get the wifi card on when it says disabled by hardware switch? the hardware switch itself is on, but this laptop requires a fn+f2 keypress also. in windows, its a seperate driver called WSS. 
wlan0: Ethernet address: 00:13:e8:06:bc:9b
iwn0: radio is disabled by hardware switch

as I stated, the physical switch that is a capacitive switch is on. The FN+F2 keypress does not turn on the wifi LED.


----------



## bschmidt (Jun 17, 2010)

Does this work on Linux? I guess the other Fn-keys aren't working too?


----------



## yoshisakan (Aug 18, 2010)

drbsd said:
			
		

> Hi,
> 
> I have a Thinkpad SL510 with Intel 1000 link wireless card and I had to modify if_iwn.c in the code found on svn co http://svn.techwires.net/svn/projects/freebsd/ to make it works (otherwise it panic)
> 
> ...



Thanks for the find here. After 2 hours of searching, I finally found that. I am using an ASUS laptop with an Intel wifi 1000 adapter. FreeBSD 8.1 amd64. I am new to the console world, besides using DOS when I was 6 or 7 years old. My newb question is, where do I put the file? Then I'm going to want to run kldload on it to execute, and put a line in my loader.conf? Then add a few lines to the rc.conf to tell it what to do with the adapter, such as assign DHCP automatically, and select a type of encryption that I'd like to use. I've been going at this freeBSD thing for the past 4 days so I apologize for my lack of knowledge. I did manage to get an apache and an unreal ircd server running though!


----------



## bschmidt (Aug 18, 2010)

The 1000 series card should work without any kind of modifications in 8.1. If that is not the case, please let me know what doesn't work.

For a howto on setting up wireless in FreeBSD, read the handbook, you will find everything you need there.


----------



## yoshisakan (Aug 18, 2010)

THanks for the reply. I've been reading the manual and im confident that I can set up the device, once it is detected. An ifconfig displays my ethernet and the lo0 loop back, but no wireless adapter. I figured i would need to do a kldload on the driver and then put something in loader.conf. Im new to all this though, and I haven't successfully executed anything with kldload, no that it fails, its just that I dont know what type of files it will open. Now that I found the 1000 series wireless driver, what folder do I want to put it in? When all this is done, im going to start making a FreeBSD for noobs FAQ thread.


----------



## bschmidt (Aug 19, 2010)

You should be able to just call `# kldload if_iwn` to get the driver loaded. After that `# ifconfig iwn0` will show the device. You do NOT need to install additional drivers. If this does for whatever reason not work, post the output of `# pciconf -lv`.


----------



## yoshisakan (Aug 21, 2010)

Thanks! That worked! I tried editing the rc.conf to get that to perform automatically, it was however, unsuccessful. I added the following lines 


```
if_iwn_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
ifconfig_iwn="SSID NAME DHCP"
```

Even after I load it automatically with the kldload though, I cant successfully connect to an unsecured network. I tried the wlan command to no avail. I tried changing wlan in the rc.conf to iwn because I figured that it might have just been a generic adapter name.


----------



## yoshisakan (Aug 21, 2010)

Nevermind all that, I realized that some thing that were in rc.conf needed to be in loader.conf. I figured out how to connect. Thanks again for all your help. Now its time to make a new thread and get xorg running.


----------



## comfortableodo (Sep 7, 2010)

*System crash due to iwn5100 loading on resume*

Hello,

after I installed the new nvidia video driver, my system was finally going to suspend to RAM. Resume on the other hand made the system crash. I figured out that this was due to the if_iwn.ko. Interestingly, even adding the driver to rc.suspend and reloading the module manually after resume makes the system crash...!?

The driver works perfectly fine otherwise.


```
System: 8.1-STABLE #0: Sat Jul 31 19:34:59 IST 2010 /usr/obj/usr/src/sys/GENERIC amd64
```

Thanks in advance!


----------



## bschmidt (Sep 7, 2010)

comfortableodo said:
			
		

> Hello,
> 
> after I installed the new nvidia video driver, my system was finally going to suspend to RAM. Resume on the other hand made the system crash. I figured out that this was due to the if_iwn.ko. Interestingly, even adding the driver to rc.suspend and reloading the module manually after resume makes the system crash...!?
> 
> ...



I'm aware of a similar issue where it is not possible to use an iwn(4) device after resume. That is not related to the driver itself though, but to ACPI. Somehow the PCI resources aren't restored correctly by either ACPI of the BIOS. Can you compare the `# pciconf -l -bcv` output before suspend and after resume without the driver loaded?


----------



## comfortableodo (Sep 9, 2010)

bschmidt said:
			
		

> I'm aware of a similar issue where it is not possible to use an iwn(4) device after resume. That is not related to the driver itself though, but to ACPI. Somehow the PCI resources aren't restored correctly by either ACPI of the BIOS. Can you compare the `# pciconf -l -bcv` output before suspend and after resume without the driver loaded?



Hello,

sorry for the late reply. I attached the output of `# pciconf -l -bcv` before suspend (pciconf.suspend) and after resume (pciconf.resume).

Here the output of `# diff pciconf.suspend pciconf.resume` for convenience:


```
12c12
<     cap 0d[88] = PCI Bridge card=0x408c17c0
---
>     cap 0d[88] = PCI Bridge card=0x00008086
181,183d180
<     cap 01[c8] = powerspec 3  supports D0 D3  current D0
<     cap 05[d0] = MSI supports 1 message, 64 bit 
<     cap 10[e0] = PCI-Express 1 endpoint max data 128(128) link x1(x1)
```


----------



## comfortableodo (Sep 9, 2010)

comfortableodo said:
			
		

> Hello,
> 
> sorry for the late reply. I attached the output of `# pciconf -l -bcv` before suspend (pciconf.suspend) and after resume (pciconf.resume).
> 
> ...



...


----------



## bschmidt (Sep 10, 2010)

comfortableodo said:
			
		

> Hello,
> 
> sorry for the late reply. I attached the output of `# pciconf -l -bcv` before suspend (pciconf.suspend) and after resume (pciconf.resume).
> 
> ...



Yeah, that's what I expected, caps aren't restored correctly.

I'm not aware that this is in 8-stable already, mind giving it a shot? It seems to be related.


----------



## comfortableodo (Sep 25, 2010)

bschmidt said:
			
		

> Yeah, that's what I expected, caps aren't restored correctly.
> 
> I'm not aware that this is in 8-stable already, mind giving it a shot? It seems to be related.



Dear Bernhard,

what would actually be the best way to apply those patches. Just manually, by downloading them and overwriting the original source files or is there any other/better way?

Regards!


----------



## CalBear96 (Oct 19, 2010)

I was redirected over here from another thread regarding the Intel Centrino 6300 card.  Will this patch for the 5300 work for the updated card?


----------



## bschmidt (Oct 20, 2010)

CalBear96 said:
			
		

> I was redirected over here from another thread regarding the Intel Centrino 6300 card.  Will this patch for the 5300 work for the updated card?



Basic support (as in you're able to use it) for 6300 series cards should be in 8-stable and head. There are a few features missing, though, that shouldn't matter that much. Please let me know if that works for you.


----------



## CalBear96 (Oct 21, 2010)

bschmidt said:
			
		

> Basic support (as in you're able to use it) for 6300 series cards should be in 8-stable and head. There are a few features missing, though, that shouldn't matter that much. Please let me know if that works for you.



Thank you, I will.  My new laptop is about to be ordered and after I get it I will be sure to post results.  I just wanted to make sure that FreeBSD would work with the majority of the hardware found on the new computer.  I currently use Ubuntu on my old laptop, but would like to learn more about "what's under the hood" and thought BSD was a good choice.  Especially since it was being developed while I was at Berkeley.


----------



## Heya (Oct 24, 2010)

*I fail!*


```
Heyas-iMac:~ Heya$ svn co [url]http://svn.techwires.net/svn/projects/freebsd[/url]
Checked out revision 117.
Heyas-iMac:~ Heya$ cd freebsd/sys/modules/iwnfw
Heyas-iMac:iwnfw Heya$ make
Makefile:5: *** missing separator.  Stop.
Heyas-iMac:iwnfw Heya$ make install
Makefile:5: *** missing separator.  Stop.
Heyas-iMac:iwnfw Heya$ cd ../iwn
Heyas-iMac:iwn Heya$ env CFLAGS=-I$PWD/../../ make
Makefile:8: *** missing separator.  Stop.
Heyas-iMac:iwn Heya$ make install
Makefile:8: *** missing separator.  Stop.
Heyas-iMac:iwn Heya$
```

Thats all I get when I run the SVN in post #16. I can figure out the manual install.


----------



## bschmidt (Oct 24, 2010)

Heya said:
			
		

> ```
> Heyas-iMac:~ Heya$ svn co [url]http://svn.techwires.net/svn/projects/freebsd[/url]
> Checked out revision 117.
> Heyas-iMac:~ Heya$ cd freebsd/sys/modules/iwnfw
> ...



Do you have the FreeBSD sources installed in /usr/src?

What are you trying to achieve? Everything from the repository is already available in 8.1-RELEASE.


----------



## blah1234 (Dec 3, 2010)

*iwin0 - error 22 - unable to initialize hardware*

Hi,

I've previously posted on this thread - http://forums.freebsd.org/showthread.php?t=19839 - regarding the inability the failure of my *IntelÂ® CentrinoÂ® Advanced-N + WiMAX 6250* wireless card to properly initialize.

The exact error:


```
iwn0: <Intel(R) PRO/Wireless 6250> mem 0xd7300000-0xd7301fff irq 17 at device 0.0 on pci7
iwn0: MIMO 2T2R, MoW, address 00:23:15:6a:77:f0
iwn0: iwn5000-send-calib_results: could not send calibration result idx=1, error=22
iwn0: iwn_init_locked: could not initialize hardware, error 22
```

If anybody can help me get this wireless interface working, I'd be much obliged.   BTW, it works perfectly fine on 64-bit Windows 7 (I dual-boot the laptop).

Thanks.

Tom


----------

