DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 31st May 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default Firmware load of athn-ar9271 fails

I've installed OpenBSD 5.3 release onto two machines: the laptop (amd64) and main "desktop" (i386). dmesgs for each are attached to this post.

On each machine I have the same trouble with a USB wireless N adapter: the firmware won't load. The adapter is a NETGEAR WNA1100, based on Atheros chip. Excerpted from one of the dmesgs are the following lines:

Code:
athn0 at uhub0 port 2 "NETGEAR WNA WNA1100" rev 2.00/1.08 addr 2
...
athn0: failed loadfirmware of file athn-ar9271 (error 2)
athn0: could not load firmware
The firmware package athn-firmware-1.1p0 was installed using fw_update(1). I also tried an older package athn-firmware-1.1, with the same result (not surprising since the firmware file athn-ar9271 is the same in the two versions of the package).

The man page for the loadfirmware(9) function says it returns an errno(2) code on failure, and errno code 2 is "No such file or directory". Well the files seem to be there:

Code:
-r--r--r-- 1 root bin 70624 Jun 16  2011 /etc/firmware/athn-ar7010
-r--r--r-- 1 root bin 70624 Jun 16  2011 /etc/firmware/athn-ar7010-11
-r--r--r-- 1 root bin 51280 Jun 16  2011 /etc/firmware/athn-ar9271
-r--r--r-- 1 root bin  2221 Jun 16  2011 /etc/firmware/athn-license
I also tried replacing athn-ar9271 with the firmware file from Linux, htc_9271.fw; same result, it wouldn't load. (The adapter works under Linux.)

Another data point: when I first got the adapter (1-2 years ago), I tried it under OpenBSD on another machine, and it did work then. So, there was at that time no problem loading the firmware for it.

I tried google-ing the error message above, but didn't find anything useful.

I wanted to try loading the firmware manually by writing a simple C wrapper for loadfirmware(9), to see what happens, but the man page doesn't say what library to link it with.

Any suggestions for how to proceed? Thanks!
Attached Files
File Type: tgz dmesgs-5.3.tgz (4.1 KB, 29 views)
Reply With Quote
  #2   (View Single Post)  
Old 1st June 2013
vanGrimoire vanGrimoire is offline
Port Guard
 
Join Date: Nov 2012
Posts: 10
Thanked 0 Times in 0 Posts
Default

I forget exactly which tools, but linux usually has something you can poke the device with. If the storage on the card is faulty and or it works on linux you've narrowed things down a bit. FreeBSD might be preferable to linux too, I don't know. Is it the hardware?
Reply With Quote
  #3   (View Single Post)  
Old 1st June 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by vanGrimoire
I forget exactly which tools, but linux usually has something you can poke the device with. If the storage on the card is faulty and or it works on linux you've narrowed things down a bit.
Hi and thanks for replying . That's a good idea, I should have a look for such tools and see if there are any I haven't installed.

Quote:
FreeBSD might be preferable to linux too, I don't know.
It wouldn't be something I'd consider, but that's just me!

Quote:
Is it the hardware?
Good question too. As mentioned, the device does work under Linux (Slackware 14.0). But ... the card was refurbished when I bought it, and there is a little bit of funkyness worth mention. To scout the network neighbourhood, I use airodump-ng. In that program, with the Netgear/Atheros device, the ESSID (or network name) sometimes gets corrupted with random characters. (Other than that it works great, and was under $10, so not worth returning.)

So what's causing that random bug? I doubt it's airodump-ng, since it doesn't happen with other wireless devices I used. It could very well be a bug in the Linux ath9k driver. Or it could be a bug in the hardware. But, even if so, the device otherwise works which indicates that the firmware is getting loaded. (Note to self: try to load the OpenBSD firmware under Linux.)

The other thing I should do is search the OpenBSD mailing lists about this (I'd sorta assumed google might pick them up, but maybe not.)

ADDED: The following is from the Linux dmesg, indicating firmware htc_9271.fw is loaded (the file size in this case is 51272 bytes):
Code:
[   12.555628] usb 1-1.4: ath9k_htc: Transferred FW: htc_9271.fw, size: 51272
[   12.799589] ath9k_htc 1-1.4:1.0: ath9k_htc: HTC initialized with 33 credits
[   13.231526] ath9k_htc 1-1.4:1.0: ath9k_htc: FW Version: 1.3
[   13.231634] ath: EEPROM regdomain: 0x60
[   13.231639] ath: EEPROM indicates we should expect a direct regpair map
[   13.231656] ath: Country alpha2 being used: 00
[   13.231661] ath: Regpair used: 0x60
[   13.235546] ieee80211 phy0: Atheros AR9271 Rev:1
[   13.241914] Registered led device: ath9k_htc-phy0
[   13.241935] usb 1-1.4: ath9k_htc: USB layer initialized
[   13.243799] usbcore: registered new interface driver ath9k_htc

Last edited by IdOp; 1st June 2013 at 08:21 PM. Reason: append dmesg output
Reply With Quote
  #4   (View Single Post)  
Old 1st June 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default

I searched openbsd-bugs and openbsd-misc on marc.info for "athn-ar9271". There is one very relevant, unresolved, mailing dated yesterday!

atheros AR9271 fails to load firmware

Given the coincidence in dates, for the record, no, it was not me who submitted that.
Reply With Quote
  #5   (View Single Post)  
Old 2nd June 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default

This gets weirder. This morning I booted (i386) directly into OpenBSD. This time the firmware loaded, and the athn0 interface was there! Was it a case of cold boot vs warm boot? I rebooted, and again it was working.

So decided to check it out. Scan for APs:

# ifconfig athn0 scan

>> half a dozen reasonable results were returned

Scanned for APs again.

>> Lots of repeated kernel error messages fill the screen, after several seconds they stop.

Scan again.

>> Lots of repeated kernel error messages fill the screen, but they never stop.

So I disconnected the Netgear USB adapter. System crashes into debugger.

Tried rebooting a few more times. Firmware wouldn't load again.

As an experiment, I tried loading the firmware from OpenBSD under Linux. It would load, but the device never initialized. I have no idea if this ever had any chance of working, but it didn't.

Obviously, a lot of difficult and specialized work goes into writing these device drivers. Hopefully with a little more testing and debugging athn+9271 will come to full fruition.
Reply With Quote
  #6   (View Single Post)  
Old 5th June 2013
vanGrimoire vanGrimoire is offline
Port Guard
 
Join Date: Nov 2012
Posts: 10
Thanked 0 Times in 0 Posts
Default Did some searching

Okay, it worked in Linux, not in OpenBSD. It shows in the man page for obsd, so if I were you I would feel okay going to the lists, unless you can buy another card and test that. I did check freebsd and it's not supported, hehe.
Reply With Quote
  #7   (View Single Post)  
Old 9th June 2013
vanGrimoire vanGrimoire is offline
Port Guard
 
Join Date: Nov 2012
Posts: 10
Thanked 0 Times in 0 Posts
Default here's the link

https://wiki.freebsd.org/dev/ath_hal...ardwareSupport

The developer says he'll help others that want to work on it, yet he refuses, maybe there's an issue with the USB portion?
Reply With Quote
  #8   (View Single Post)  
Old 9th June 2013
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,883
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by vanGrimoire View Post
...maybe there's an issue with the USB portion?
While I applaud you for attempting to identify causes, I don't believe that questioning the USB subsystem is likely to be a fruitful endeavour.

Integrated circuit manufacture has at multiple points in the process opportunities which features/bug fixes can be layered on to the chips themselves. In the case of wireless chips (which is a volatile market...), chips with the same model number may or may not have features enabled. The production of any particular chip may be interrupted in order to fix identified problems or add/subtract features -- all while the model number remains the same. Who gets what chip depends upon the time contracts are finalized with customers & what is specified in the contract.

I have no knowledge of what chip was used when the driver was developed & what are the differences between it & the chip discussed in this thread, but I suspect there are driver differences between the operating systems mentioned. This would account for why differences are seen in the behaviour between operating systems.

When it comes to compatibility questions where wireless chips work in one operating system but not another, the most direct approach to isolating root causes is to study the source code to the driver itself. Given the contention between the GNU & most other licences, Linux driver code cannot be officially ported to the *BSD's & vice versa. Note that the supporting structure around either environment is likely to be different, so thinking that code from one platform can be dropped into another without modification is not realistic. Nevertheless, if you are serious about attempting to resolve compatibility problems, study the driver code, & debug. If you get something to work, post diff(1)'s to OpenBSD's tech@ mailing list, & see what the project developers say.

Last edited by ocicat; 9th June 2013 at 09:20 PM. Reason: clarity
Reply With Quote
  #9   (View Single Post)  
Old 10th June 2013
unkmail unkmail is offline
New User
 
Join Date: May 2013
Posts: 6
Thanked 0 Times in 0 Posts
Default

But loadfirmware() just read whole file into malloced kernel memory buffer, it known nothing about underlaing wifi chip. So for me this looks like strange FS problem.
Reply With Quote
Old 10th June 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by unkmail View Post
But loadfirmware() just read whole file into malloced kernel memory buffer, it known nothing about underlaing wifi chip. So for me this looks like strange FS problem.
Glad you mentioned that. I took another look at the dmesg's. The part related to potential filesystem problem is this line:

Code:
athn0: failed loadfirmware of file athn-ar9271 (error 2)
This line was not displayed all the time, in fact it may have only happened the first time. What I now suspect is that there is no problem related to that line, probably the firmware was just not installed yet on that boot. How it got into my problem report here is that the dmesg command (run after several reboots) printed several complete dmesg's (it seems to print a whole buffer). Only the first one had this particular error (which may have happened just once on each machine). The above line occurs only in the amd64 dmesg I posted, for example.

So I strongly suspect that little part of the mystery is now solved. The main events remain, of course.
Reply With Quote
Old 26th June 2013
bsdplus bsdplus is offline
Real Name: Alan Cheng
Port Guard
 
Join Date: Jun 2009
Location: Shanghai, China
Posts: 21
Thanked 0 Times in 0 Posts
Default

This happened to me ever since 5.2 I think, on both i386/amd64/Loongson.

It's for USB card only, as I also have an PCI athn card (should be ar92xx something) and it has been working great.

And, if I unplug that USB card, it causes system panic.
Reply With Quote
Old 26th June 2013
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by bsdplus View Post
This happened to me ever since 5.2 I think, on both i386/amd64/Loongson.
I also recall some trouble with it earlier, roughly 5.0-ish?, but didn't pursue it much since it was on a little-used machine, etc.
Reply With Quote
Old 22nd March 2014
cynwulf cynwulf is offline
Port Guard
 
Join Date: Mar 2014
Posts: 34
Thanked 0 Times in 0 Posts
Default

Same problem here (USB device based on AR9271) - anyone had any luck with this? Searching only reveals this thread and the bug report (0 replies).

Thanks
Code:
$ dmesg | egrep -i 'ar9271|athn1'
athn1 at uhub0 port 1 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 2
athn1: failed loadfirmware of file athn-ar9271 (error 2)
athn1: could not load firmware
Installed firmware with fw_update
Code:
$ ls -l /etc/firmware/athn*
-r--r--r--  1 root  bin  70624 Jul 20  2013 /etc/firmware/athn-ar7010
-r--r--r--  1 root  bin  70624 Jul 20  2013 /etc/firmware/athn-ar7010-11
-r--r--r--  1 root  bin  51280 Jul 20  2013 /etc/firmware/athn-ar9271
-r--r--r--  1 root  bin   2221 Jul 20  2013 /etc/firmware/athn-license
Code:
$ uname -mrsv
OpenBSD 5.4 GENERIC.MP#44 i386

Last edited by cynwulf; 22nd March 2014 at 03:35 PM.
Reply With Quote
Old 22nd March 2014
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 563
Thanked 14 Times in 13 Posts
Default

Welcome to the forum! Unfortunately, I haven't had a chance to pursue this problem any further. The only vaguely related info to relate is that last year the OpenBSD athn(4) driver was ported to NetBSD -current. I had slightly more luck with it there, at that time, but only slightly: in the end it was also unstable and unreliable. Again, haven't tried it in the last few months there either.

Last edited by IdOp; 22nd March 2014 at 10:29 PM. Reason: man page reference
Reply With Quote
Old 22nd March 2014
ibara's Avatar
ibara ibara is offline
Shell Scout
 
Join Date: Jan 2014
Posts: 116
Thanked 0 Times in 0 Posts
Default

Honestly, this is the kind of thing that needs a bug report filed (yes, another one). Things that aren't known won't get fixed, and things that are not on bugs@ aren't known.

Please read sendbug(1) and send something.
__________________
@bcallah on app.net
Reply With Quote
Old 23rd March 2014
cynwulf cynwulf is offline
Port Guard
 
Join Date: Mar 2014
Posts: 34
Thanked 0 Times in 0 Posts
Default

Thanks, I'll try reporting a bug once I figure out how to get reportbug to work (I assume I need to set something else up, e.g. sendmail first)...
Reply With Quote
Old 23rd March 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,883
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by cynwulf View Post
...I'll try reporting a bug once I figure out how to get reportbug to work (I assume I need to set something else up, e.g. sendmail first)...
Welcome!

sendmail(8) will already be configured for sending mail from one account to another within the same system, however, this is not a requirement for sending bug reports.

The point of using sendbug(1) is to fill in the existing template to create as complete a report as possible which will be more useful to the developers. The template can be saved as text & mailed from a different system and/or mail system if this is more convenient.

Completeness is key. It will help you in articulating your findings, & it will help developers discern root causes. More information on what information is useful can be found at the following:

http://www.openbsd.org/report.html
Reply With Quote
Old 23rd March 2014
cynwulf cynwulf is offline
Port Guard
 
Join Date: Mar 2014
Posts: 34
Thanked 0 Times in 0 Posts
Default

Thanks, I find it somewhat confusing, but have managed to send a bug report in. I had trouble confirming the bug as it kept getting rejected, though I think I've manage it now...

"The accept command did not succeed.

The token "XXXX-XXXX-XXXX" is unavailable.

The request may have been accepted or rejected by another person,
or its lifetime may have expired.

For assistance, contact the openbsd.org administrators. "

I tried replying to the specified email with the token and "accept" in the message body as suggested in the confirmation email.
Reply With Quote
Old 23rd March 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,686
Thanked 214 Times in 189 Posts
Default

Welcome!

Yes, your report was posted to the bugs@ mailing list. It was only slightly mangled during receipt, as shown in this mail archive record.
Reply With Quote
Old 23rd March 2014
cynwulf cynwulf is offline
Port Guard
 
Join Date: Mar 2014
Posts: 34
Thanked 0 Times in 0 Posts
Default

Ah, I see it thanks!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to upgrade firmware? tls OpenBSD Installation and Upgrading 9 30th April 2012 10:50 PM
How to build upgt firmware AnilG FreeBSD Installation and Upgrading 2 20th March 2012 12:06 PM
How do I manually load firmware in OpenBSD? Shagbag OpenBSD Packages and Ports 3 18th September 2008 08:37 PM
NVIDIA driver fails to load, freebsd 7.0 mc_i2020 FreeBSD General 18 18th July 2008 01:12 PM
location for wpi-firmware-.tgz bsdnewbie999 OpenBSD General 1 18th June 2008 04:20 AM


All times are GMT. The time now is 05:58 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick