DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
Old 24th 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: 646
Thanked 14 Times in 13 Posts
Default

This thread is about a hardware driver. I'm puzzled why it was moved from "OpenBSD General" to "OpenBSD Installation and Upgrading" about 10 months after creation?
Reply With Quote
Old 24th March 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,111
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by IdOp View Post
This thread is about a hardware driver. I'm puzzled why it was moved from "OpenBSD General" to "OpenBSD Installation and Upgrading" about 10 months after creation?
The "General" section is vastly overcrowded, & given that the original question(s) focused on loading firmware problems, this is handled intentionally by fw_update(1), a utility which is called upon first boot.

Should there be a reorganization of subforae? Perhaps, but there is no agreement upon how that should be accomplished.
Reply With Quote
Old 25th 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: 646
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by ocicat View Post
The "General" section is vastly overcrowded, & given that the original question(s) focused on loading firmware problems, this is handled intentionally by fw_update(1), a utility which is called upon first boot.
It can be, but, all these issues can arise much after installation if someone adds the USB device to their system then. Anyway, no biggy, I was just curious why it was moved, and thanks for taking the time to reply to my question.

Quote:
Should there be a reorganization of subforae? Perhaps, but there is no agreement upon how that should be accomplished.
The organization seems fine to me.
Reply With Quote
Old 25th March 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,111
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by IdOp View Post
...all these issues can arise much after installation if someone adds the USB device to their system then.
...which is the installation of a new device.

Reply With Quote
Old 6th April 2014
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

I got a few mails from an OpenBSD developer and have tried as he suggested but pretty much reached the limit of my understanding rather quickly. I'll post what I have tried here, in the hope that it may be useful to others.

Firstly it was suggested to look at kernel source code for the athn driver and make a few changes in order to try and show where the firmware loading is falling down. I was advised to look at these two areas:

sys/dev/usb/if_athn_usb.c

Code:
                error = usbd_do_request(usc->sc_udev, &req, ptr);
                if (error != 0) {
                        free(fw, M_DEVBUF);
                        return (error);
                }
Code:
        error = usbd_do_request(usc->sc_udev, &req, NULL);
        /* Wait at most 1 second for firmware to boot. */
        if (error == 0 && usc->wait_msg_id != 0)
                error = tsleep(&usc->wait_msg_id, 0, "athnfw", hz);
        usc->wait_msg_id = 0;
        splx(s);
        return (error);
Add some printf() functions (luckily I have some very basic c knowledge), recompile the kernel and see what happened.

I modified as follows:

Code:
error = usbd_do_request(usc->sc_udev, &req, ptr);
        printf("usbd_do_request #1\n");
        if (error != 0) {
            free(fw, M_DEVBUF);
            printf("usbd_do_request ERROR #1\n");
            return (error);           
        }

Code:
error = usbd_do_request(usc->sc_udev, &req, NULL);
    printf("usbd_do_request #2\n");
    /* Wait at most 1 second for firmware to boot. */
    if (error == 0 && usc->wait_msg_id != 0)
        error = tsleep(&usc->wait_msg_id, 0, "athnfw", hz);
    usc->wait_msg_id = 0;
    splx(s);
    printf("usbd_do_request ERROR #2\n");
    return (error);
Recompiled the kernel and dmesg shows:

Code:
athn1 at uhub0 port 1 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 2
[...]
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #1
usbd_do_request #2
usbd_do_request ERROR #2
athn1: could not load firmware
As advised I next modified the second section to make it wait longer for the firmware - which I had no idea how to do - so I tried the following:

Code:
error = usbd_do_request(usc->sc_udev, &req, NULL);
    printf("usbd_do_request #2\n");
    /* Wait at most 1 second for firmware to boot. */
    if (error == 0 && usc->wait_msg_id != 0)
        error = tsleep(&usc->wait_msg_id, 0, "athnfw", hz*10);
    usc->wait_msg_id = 0;
    splx(s);
    printf("usbd_do_request ERROR #2\n");
    return (error);
(5th line "hz*10")

It waits at that point for about 10 seconds, but proceeds with exactly the same result.

Beyond that I've no idea (I think I put the extra wait time in the wrong place...)

Last edited by cynwulf; 6th April 2014 at 02:04 PM.
Reply With Quote
Old 7th April 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: 646
Thanked 14 Times in 13 Posts
Default

Quote:
Originally Posted by cynwulf
I think I put the extra wait time in the wrong place...
I'm also entirely unfamiliar with this code, but it looks like a reasonable change to me, given the request. The man page for tsleep(9) says the final argument, when divided by hz, gives the max number of seconds it will sleep. So it originally slept (up to) 1 second, which ties in with the comment in the code, and then 10 seconds with your change.
Reply With Quote
Old 17th September 2014
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

Found a related (albeit NetBSD) bug report for athn with the same device:

http://mail-index.netbsd.org/current...msg024793.html

Again refers to the theory that it simply doesn't wait long enough to allow the firmware to load.
Reply With Quote
Old 5th March 2015
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: 646
Thanked 14 Times in 13 Posts
Default

Bump.

Based on this post by jggimi in the OpenBSD Router & Wireless AP setup thread, which reports recent changes to the athn(4) driver, I gave the latest snapshot a whirl.

Code:
OpenBSD 5.7-beta (GENERIC.MP) #757
i386
In a few tests (all on one particular machine) the firmware is loading now and the USB device seems to work as a client. I tried OPEN and WPA2. Nice.
Reply With Quote
Old 5th March 2015
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

Thanks for updating the thread, I will give it ago.
Reply With Quote
Old 5th March 2015
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: 646
Thanked 14 Times in 13 Posts
Default

Another update. I installed the same on 3 more computers today, for a total of 4. On three of them it seems to work ok, but on the laptop the firmware still won't load.

And a minor note: Up-thread I mentioned that under Linux corrupt network names were seen using airodump-ng with the device. Some time ago I updated to aircrack-ng-1.2-beta3. Using its airodump-ng the problem went away, so it had something to do with this program and its interaction with the driver, it seems.
Reply With Quote
Old 8th March 2015
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

Built and installed -current, but much the same here.
Code:
$ uname -mrsv  
OpenBSD 5.7 GENERIC.MP#0 amd64
Code:
$ dmesg|grep athn1 
athn1 at uhub0 port 8 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 2
athn1: could not load firmware
Code:
$ pkg_info|grep athn         
athn-firmware-1.1p1 firmware binary images for athn(4) driver
Reply With Quote
Old 9th March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,497
Thanked 214 Times in 189 Posts
Default

Do you have an athn0?
Reply With Quote
Old 9th March 2015
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

Yes athn0 is a PCI Atheros AR9227 card which does not require any kind of firmware.
Reply With Quote
Old 9th March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,497
Thanked 214 Times in 189 Posts
Default

I wonder if disabling athn0 in BIOS or in the kernel (with boot -c) would have any impact on firmware load success.

The three athn drivers -- USB, PCI, CardBus -- share a name, a man page, and a common set of AR* chipset drivers.
Reply With Quote
Old 9th March 2015
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

I will certainly give it a try. It's a PCI card so I will just pull it out. Will post back later tonight or tomorrow morning. Thanks
Reply With Quote
Old 9th March 2015
cynwulf cynwulf is offline
Shell Scout
 
Join Date: Mar 2014
Posts: 106
Thanked 0 Times in 0 Posts
Default

Removed the PCI card and same result:
Code:
$ cat athn         
athn0 at uhub0 port 1 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 2
athn0: could not load firmware
It was worth a try though, thanks for the suggestion.
Reply With Quote
Old 9th March 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 4,497
Thanked 214 Times in 189 Posts
Default

Oh, well. Thanks for trying it.
Reply With Quote
Old 7th July 2015
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: 646
Thanked 14 Times in 13 Posts
Default

In this post, cynwulf made the following observation about the present topic on a Pentium III:
Quote:
Originally Posted by cynwulf
... Then I remembered the USB device, plugged in, loaded firmware - working...

This device still does not work on my main system, but it works without complaint on this ancient system. I will look into this further and post more info and also the dmesg for the working system.

I suppose delaying the firmware loading would not be as big an issue on an older and slower system?
So I took a look at the CVSweb entry for if_athn_usb.c, and found a number of changes added this year. Based on all this it seemed worth giving my NETGEAR WNA1100 USB device another try.

On the laptop (AMD E350) running OpenBSD -release 5.7 amd64, the story is the same, firmware wouldn't load.

I then tried on a P4 machine running OpenBSD -release 5.7 i386. Here the firmware loaded fine, and in a brief test I had some success using it. So it looks like there has been progress. Following is a dmesg for this machine:

Code:
OpenBSD 5.7 (GENERIC.MP) #767: Sun Mar  8 11:04:48 MDT 2015
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Pentium(R) 4 CPU 2.40GHz ("GenuineIntel" 686-class) 2.40 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,CNXT-ID,xTPR,PERF
real mem  = 1609252864 (1534MB)
avail mem = 1570562048 (1497MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 08/15/05, BIOS32 rev. 0 @ 0xf0010, SMBIOS rev. 2.3 @ 0xf04b0 (68 entries)
bios0: vendor American Megatrends Inc. version "1021.006" date 08/15/2005
bios0: ASUSTeK Computer Inc. P4P800
acpi0 at bios0: rev 0
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC OEMB
acpi0: wakeup devices P0P4(S4) MC97(S4) USB1(S4) USB2(S4) USB3(S4) USB4(S4) EUSB(S4) PS2K(S4) PS2M(S4) ILAN(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 199MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Pentium(R) 4 CPU 2.40GHz ("GenuineIntel" 686-class) 2.40 GHz
cpu1: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,CNXT-ID,xTPR,PERF
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (P0P4)
acpiprt2 at acpi0: bus -1 (P0P2)
acpicpu0 at acpi0
acpicpu1 at acpi0
acpibtn0 at acpi0: PWRB
bios0: ROM list: 0xc0000/0xd000
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82865G Host" rev 0x02
intelagp0 at pchb0
agp0 at intelagp0: aperture at 0xf8000000, size 0x4000000
ppb0 at pci0 dev 1 function 0 "Intel 82865G AGP" rev 0x02
pci1 at ppb0 bus 1
radeondrm0 at pci1 dev 0 function 0 "ATI Radeon 9200" rev 0x01
drm0 at radeondrm0
radeondrm0: apic 2 int 16
"ATI Radeon 9200 Sec" rev 0x01 at pci1 dev 0 function 1 not configured
uhci0 at pci0 dev 29 function 0 "Intel 82801EB/ER USB" rev 0x02: apic 2 int 16
uhci1 at pci0 dev 29 function 1 "Intel 82801EB/ER USB" rev 0x02: apic 2 int 19
ehci0 at pci0 dev 29 function 7 "Intel 82801EB/ER USB2" rev 0x02: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb1 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xc2
pci2 at ppb1 bus 2
"VIA VT6306 FireWire" rev 0x80 at pci2 dev 3 function 0 not configured
skc0 at pci2 dev 5 function 0 "3Com 3c940" rev 0x12, Yukon (0x1): apic 2 int 22
sk0 at skc0 port A: address de:ad:be:ef:00:01
eephy0 at sk0 phy 0: 88E1011 Gigabit PHY, rev. 3
ral0 at pci2 dev 10 function 0 "Ralink RT2560" rev 0x01: apic 2 int 22, address de:ad:be:ef:00:02
ral0: MAC/BBP RT2560 (rev 0x04), RF RT2525
ichpcib0 at pci0 dev 31 function 0 "Intel 82801EB/ER LPC" rev 0x02
pciide0 at pci0 dev 31 function 1 "Intel 82801EB/ER IDE" rev 0x02: DMA, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0: <SAMSUNG SP0411N>
wd0: 16-sector PIO, LBA48, 38204MB, 78242976 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide0 channel 1 drive 0
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <HL-DT-ST, DVD-RW GWA-4165B, DG01> ATAPI 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
ichiic0 at pci0 dev 31 function 3 "Intel 82801EB/ER SMBus" rev 0x02: apic 2 int 17
iic0 at ichiic0
lm1 at iic0 addr 0x2f: W83791SD
spdmem0 at iic0 addr 0x50: 512MB DDR SDRAM non-parity PC3200CL3.0
spdmem1 at iic0 addr 0x51: 256MB DDR SDRAM non-parity PC3200CL3.0
spdmem2 at iic0 addr 0x52: 512MB DDR SDRAM non-parity PC3200CL3.0
spdmem3 at iic0 addr 0x53: 256MB DDR SDRAM non-parity PC3200CL3.0
auich0 at pci0 dev 31 function 5 "Intel 82801EB/ER AC97" rev 0x02: apic 2 int 17, ICH5 AC97
ac97: codec id 0x41445375 (Analog Devices AD1985)
ac97: codec features headphone, 20 bit DAC, No 3D Stereo
audio0 at auich0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
wbsio0 at isa0 port 0x2e/2: W83627THF rev 0x82
lm2 at wbsio0 port 0x290/8: W83627THF
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
athn0 at uhub0 port 3 "NETGEAR WNA WNA1100" rev 2.00/1.08 addr 2
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on wd0a (6ffeed7419424d8b.a) swap on wd0b dump on wd0b
radeondrm0: 1280x1024
wsdisplay0 at radeondrm0 mux 1: console (std, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (std, vt100 emulation)
athn0: AR9271 rev 1 (1T1R), ROM rev 15, address de:ad:be:ef:00:03
Reply With Quote
Old 7th July 2015
shep shep is offline
Fsck Surgeon
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 753
Thanked 9 Times in 9 Posts
Default

You may want to try amd64 -current. There have been a number of commits to the driver link you provided since the February 2015 code freeze - some dealing with firmware.
Reply With Quote
Old 7th July 2015
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: 646
Thanked 14 Times in 13 Posts
Default

Thanks shep, that's a good idea.
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 11:13 AM.


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