# iwn driver - error 22 - unable to initialize



## blah1234 (Dec 2, 2010)

I have a Toshiba Satellite A665 laptop running 8.1 on amd64.

The laptop comes with an *IntelÂ® CentrinoÂ® Advanced-N + WiMAX 6250* wireless card.

With device iwn and variations of *device iwn* | *device iwnXXXXfw* compiled into the kernel, I keep getting error 22 - failure to initialize firmware - upon boot.

With the following in rc.conf and testing on a public/open network:


```
wlans_iwn="wlan0"
ifconfig_wlan0="DHCP"
```

iwn is associated, but wlan0 reports "no carrier".
dhclient reports link down.

Since I am getting error 22, I suspect that the firmware I need isn't available in /usr/src/sys/contrib/dev/iwn.

Is there any way of getting the appropriate firmware so I can use this adapter?   Any help would be much appreciated.

Tom


----------



## richardpl (Dec 2, 2010)

iwn(4)


----------



## blah1234 (Dec 2, 2010)

richardpl said:
			
		

> iwn(4)



Yeah, already read the man page, many times.

In fact, I've been using FreeBSD since 1999.   The only problems I've ever had have been wireless and wine...   Persistent problems for 11 years...    Wireless is the way of the future (actually, it has been for 5+ years).   It'd be nice if the development team would push it to the front/top of the priority list...

Enough of the editorial - back to the issue at hand:


I've already tried every version of "device xxxx", rebuilding and booting the new kernel.

Doesn't eliminate the fact that the driver is unable to initialize the firmware, and craps out with an error 22 very time.

On the Intel site, it appears the appropriate firmware file is available and has been released/included in one of the more recent Linux kernels:  http://www.linuxwimax.org/Download.

if_iwn.c mentions the 6250, but it still gets the firmware init error.   If the firmware in contrib/dev/iwn is up-to-date (the timestamp is late July 2010 for iwn6050fw), then something else is causing the problem.


----------



## richardpl (Dec 2, 2010)

"kldstat -v" output please.
Are you sure that iwn firmware is loaded at all?


----------



## blah1234 (Dec 2, 2010)

Richard,

Please see the attached file..

Thanks for your interest!  ;-)

Tom


----------



## blah1234 (Dec 3, 2010)

Looks like I've been reporting the wrong error message, per the netif script output.

The error # is still 22, but the message is "failure to initialize hardware", not firmware.

Alas, the inconvenience of having to reboot into Windows to use the wireless card and report the issue....

Sorry for the mistake...


----------



## richardpl (Dec 3, 2010)

Try/find/contact iwn developer/maintainer directly.
I can not help you with this problem.

iwn(4) is not my area of expertize, ndis(4) is.

Perhaps device needs newer version of firmware.


----------



## PseudoCylon (Dec 3, 2010)

Post on this [thread=8041]thread[/thread]. A committer/maintainer of iwn(4) will respond.

Excerpt from your attached file, following output might help pinpoint the problem.
	
	



```
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
```

My laptop has 4965, but I have very limited knowledge about the chip. It seems size of Rx'd calib result of IWN5000_PHY_CALIB_DC is larger than MCLBYTES.


----------



## bschmidt (Dec 4, 2010)

blah1234 said:
			
		

> Richard,
> 
> Please see the attached file..
> 
> ...



Can you give iwn6000_runtime_calibration.diff a shot? Seems like in newer versions of the reference driver the DC calibration results for 6000 series and newer devices are no longer requested from the boot firmware and sent to the runtime firmware. Instead the runtime firmware is supposed to do the DC calibration itself.


----------



## blah1234 (Dec 4, 2010)

*Success!*

The patch did the trick.    I'm writing this post from FreeBSD with a working iwn device!

Thank you so much for the quick response and the successful patch!

Happy holidays!

Tom


----------



## bschmidt (Dec 5, 2010)

blah1234 said:
			
		

> The patch did the trick.    I'm writing this post from FreeBSD with a working iwn device!
> 
> Thank you so much for the quick response and the successful patch!
> 
> ...



Glad to hear that 
Patch committed, MFC probably next weekend, thanks!


----------

