# iwn wifi driver 20%-100% packet loss



## ybungalobill (Mar 25, 2013)

I have an Intel Centrino Advanced-N 6205 wireless card on my Dell E6530 laptop, and am using FreeBSD 9.1 RELEASE for a week now. I have serious connectivity problems: 20%-100% packet loss when pinging my router. I've booted from an Ubuntu USB stick and got there 0 out of 300 packets lost, so I find it very unlikely to be a hardware problem.

How can I debug/solve this?

Thank you for any help.


----------



## dza (Mar 28, 2013)

I have got the exact same chipset as you (6205) on ThinkPad T530.

My problem is:

```
iwn0: device timeout
```

on any small package download or any other 10 secs+ network activity.

It's pretty random. Sometimes I can download the whole xorg set, but other times it just fails from bootup. x(


----------



## ybungalobill (Mar 29, 2013)

Good to know I'm not alone. I've submitted a problem report at http://www.freebsd.org/cgi/query-pr.cgi?pr=177465.


----------



## dza (Mar 29, 2013)

ybungalobill said:
			
		

> Good to know I'm not alone. I've submitted a problem report at http://www.freebsd.org/cgi/query-pr.cgi?pr=177465.



Hello and thanks for the comment!

Watching and reading the OpenBSD changelog, I might try their source in my kernel.

http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/if_iwn.c

Points of interest:


```
Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Nov 17 14:02:51 2012 UTC (4 months, 1 week ago) by kettenis
Branches: MAIN
CVS tags: OPENBSD_5_3_BASE, OPENBSD_5_3, HEAD
Diff to: previous 1.117: preferred, coloured
Changes since revision 1.117: +6 -8 lines

Newer chips feature "advanced" bluetooth coexistence, which is why sending
them the "normal" command to configure bluetooth coexistence fails and
makes the firmware crash.  Rename the IWN_FLAG_NO_BT_COEX flag and adjust some
comments to reflect this knowledge.

ok jcs@, mikeb@, mpi@

 Revision 1.112: download - view: text, markup, annotated - select for diffs
Fri Sep 2 18:49:36 2011 UTC (18 months, 3 weeks ago) by kettenis
Branches: MAIN
Diff to: previous 1.111: preferred, coloured
Changes since revision 1.111: +9 -1 lines

Differential gain calibration makes the 6005 firmware crap out, so skip it for
now until we figure out why.  This probably means the device won't function
optimally, but that's better than not functioning at all.  Makes my
"Intel Centrinto Advanced-N 6205" work quite well.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Thu Sep 1 18:49:56 2011 UTC (18 months, 3 weeks ago) by kettenis
Branches: MAIN
Diff to: previous 1.110: preferred, coloured
Changes since revision 1.110: +25 -1 lines

The 6005 and 6050-based parts need DC calibration turned on, otherwise the
firmware will crap out, at least on the 6005.  First step to getting my
"Intel Centrino Advanced-N 6205" to work.
```


----------



## ybungalobill (Mar 31, 2013)

dza said:
			
		

> Watching and reading the OpenBSD changelog, I might try their source in my kernel.



Thank you very much! I merged Revision 1.111 to my kernel. Running ping for a few hours now with 0.0% packet loss. I'm afraid that, due to its non-deterministic nature, it's too early to be sure that it works. Let's wait and see.

However, the average roundtrip time still seems to be about twice longer than with another Windows machine. Though I'm not sure about this point, and it is not critical anyway.


----------



## dza (Apr 1, 2013)

ybungalobill said:
			
		

> Thank you very much! I merged Revision 1.111 to my kernel. Running ping for a few hours now with 0.0% packet loss. I'm afraid that, due to its non-deterministic nature, it's too early to be sure that it works. Let's wait and see.



*I'm so glad to hear that my little discovery helped you * Something must have worked!

Two quick questions:

1. Did you experience: "iwn0: device timeout" as well? Or none?
2. On both 9.1 and the OpenBSD sources?

I gave up on CVS, I couldn't figure out the correct way to download the OpenBSD sources (I use GIT whenever I can and used the others too few times), and meanwhile I deleted my workstation-partition while figuring out the OpenBSD partition manager, whoops 

Intel drivers were also a pain in the butt for me. It worked the first time, then I reinstalled FreeBSD 9.1 and suddenly I couldn't get them to work at all!


```
(EE) No deviced detected
```
 and 
	
	



```
WITH_KMS=yes
WITH_NEW_XORG=yes
```
 and rebuilt all dependecies after instruction from the other thread.

The inability to VT switch was also pretty bad. In general there were a few glitches!

Are you using it for a workstation? My wish was to use FreeBSD entirely for my workstation to get used to it and really familiar with its tools, kernel, system.


----------



## ybungalobill (Apr 2, 2013)

dza said:
			
		

> 1. Did you experience: "iwn0: device timeout" as well? Or none?
> 2. On both 9.1 and the OpenBSD sources?



1. No. I experienced high packet loss. Now the packet loss part solved, but I see that it connects with 56Mbps through 11g whereas my equipment should support 300Mbps through 11n. I hope I'll solve this later.
2. I did not try OpenBSD.



> I gave up on CVS, I couldn't figure out the correct way to download the OpenBSD sources [...]



The patches you mentioned are small enough to be merged by hand. Why would you download the whole sources?



> Are you using it for a workstation?



Yes.


----------



## ohyes (Apr 3, 2013)

FreeBSD'hello :f

I don't know really know if the problem is the same but what I know is, when computer (with iwn WiFi card) is far away from the source, the conne*ct*ion is not good (FreeBSD 9.1). At the same place, if I boot under Windows, signal is not very good but the WiFi conne*ct*ion is OK. Slow but OK with no interruptions.

With the wifimgr front-end (or a scan with ifconfig) the computer under FreeBSD always gets the signal.

As ifconfig <interface> says that the iwn driver is on autoselect mode my first idea was to force 11n mode. I don't know how,  not sure that the _far away_ conne*ct*ion will be better with this.

(Thanks a lot for the iwn driver, cause except far-away there's no problem for my computer).


----------

