An Athn ar9280 client seems to require cold boots of late?

Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

An Athn ar9280 client seems to require cold boots of late?

Kevin Chadwick-4
After upgrading via sysupgrade for a few releases, I have had to cold boot to
get dhclient athn0 working on an ar9280 in client mode.

Since my latest upgrade to a snapshot of Jun 17 kernel #275 with the previous
kernel being from Jun 2nd #237. I seem to have to cold boot after running
ifconfig athn0 down and then back up, where I'm *fairly* sure that I didn't need
to before that Jun 17th upgrade. ifconfig debug mode shows the wireless
handshake completing 4/4. Yet dhclient can't establish a link until cold booted.
A warm reboot does not resolve the problem.

Has anyone else seen this or can reproduce it?

I'll try a sysupgrade in the meantime but I'm not sure there has been any code
changes in areas that could resolve it.

Reply | Threaded
Open this post in threaded view
|

Re: An Athn ar9280 client seems to require cold boots of late?

austin

I have a similar problem with the 6.7 release which I just installed today
on an 8Tb drive I'm using with my older ASUS laptop.

athn0 at pci3 dev 0 function 0 "Atheros AR9285" rev 0x01: apic 2 int 17
athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 74:f0:6d:7a:42:7f

Can't seem to shake it with a cold boot.  However I have some interesting
other effects.  I have several wireless routers, one of which is quite old
and doesn't even do wpa.   It's a UBNT antenna that I use to broadcast
around the farm. So without any password at all, even the old kind,  if I

ifconfig athn0 -wpakey
ifconfig athn0 nwid UBNT
dhclient athn0

That works fine.

Now, I can also project wireless from my cellphone using wpa2. Sometimes
it works and sometimes it doesn't.  I don't know if it's after a cold boot
of the laptop, but what does work for me it to just disable the hotspot
from the cellphone for a moment, and then re-enable it.  Then it works
fine with the nwid I set up and the wpa2 password I require.

However no matter what I do I can't get a connection to my farmhouse
wireless router.  It's a DIR822 Dlink.  Of course I know that's a low end
router.  Recently they recommended a firmware upgrade, and since then I
found that I was unable to set it up for no password, and had to add one,
and then add that password to all the other devices in the house.

Just now I saw that I can enable projecting a separate "guest" zone
network from it, and that seems to allow having a null password.  However
neither with a null password nor with an 8 letter password and can I get
it to connect to the ASUS athn0

I think I have had athn problems before with the ASUS, and I used to have
a spare USB wireless of some sort that was more reliable, but I gave it
away, after not having such problems with some other more recent releases
(but before 6.7).  Wish I could remember what it was.

If anyone has a recommendation for a reliable USB wireless stick that
I can find on eBay, and plays well with athn, I'd be grateful.

Moreover, if anyone can fix the problem before I go to that extreme, I'll
send him the shirt off my back...  Happens I have about 1,000 OpenBSD
T-shirts :-)

Austin



On Fri, 26 Jun 2020, Kevin Chadwick wrote:

> After upgrading via sysupgrade for a few releases, I have had to cold boot to
> get dhclient athn0 working on an ar9280 in client mode.
>
> Since my latest upgrade to a snapshot of Jun 17 kernel #275 with the previous
> kernel being from Jun 2nd #237. I seem to have to cold boot after running
> ifconfig athn0 down and then back up, where I'm *fairly* sure that I didn't need
> to before that Jun 17th upgrade. ifconfig debug mode shows the wireless
> handshake completing 4/4. Yet dhclient can't establish a link until cold booted.
> A warm reboot does not resolve the problem.
>
> Has anyone else seen this or can reproduce it?
>
> I'll try a sysupgrade in the meantime but I'm not sure there has been any code
> changes in areas that could resolve it.
>

Reply | Threaded
Open this post in threaded view
|

Re: An Athn ar9280 client seems to require cold boots of late?

Stefan Sperling-5
On Sun, Jun 28, 2020 at 03:43:09PM -0600, Austin Hook wrote:
>
> I have a similar problem with the 6.7 release which I just installed today
> on an 8Tb drive I'm using with my older ASUS laptop.
>
> athn0 at pci3 dev 0 function 0 "Atheros AR9285" rev 0x01: apic 2 int 17
> athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 74:f0:6d:7a:42:7f
>
> Can't seem to shake it with a cold boot.

Even if "cold boot" helped, the problem would still be narrowed down much
further before it could be addressed. There's no obvious code change anyone
could make based on the knowledge that something only works after a cold boot.

> However no matter what I do I can't get a connection to my farmhouse
> wireless router.  It's a DIR822 Dlink.  Of course I know that's a low end
> router.  Recently they recommended a firmware upgrade, and since then I
> found that I was unable to set it up for no password, and had to add one,
> and then add that password to all the other devices in the house.

There is one interop problem in 6.7 which has been fixed in -current
by reverting a change which was committted between 6.6 and 6.7:
https://marc.info/?l=openbsd-cvs&m=159100149411516&w=2
Perhaps that applies to your situation? Could you check if a -current
bsd.rd kernel is able to connect to this problematic AP?

Reply | Threaded
Open this post in threaded view
|

Re: An Athn ar9280 client seems to require cold boots of late?

Kevin Chadwick-4
On 2020-06-29 07:36, Stefan Sperling wrote:
> There is one interop problem in 6.7 which has been fixed in -current
> by reverting a change which was committted between 6.6 and 6.7:
> https://marc.info/?l=openbsd-cvs&m=159100149411516&w=2
> Perhaps that applies to your situation? Could you check if a -current
> bsd.rd kernel is able to connect to this problematic AP?

After leaving this up all weekend, the issue seems to have occurred without an
ifconfig down command too. Though the down triggers it immediately.

Reply | Threaded
Open this post in threaded view
|

Re: An Athn ar9280 client seems to require cold boots of late?

Kevin Chadwick-4
On 2020-06-29 08:35, Kevin Chadwick wrote:
> After leaving this up all weekend, the issue seems to have occurred without an
> ifconfig down command too. Though the down triggers it immediately.

Perhaps it's a hw issue. I have tried updating the coreboot firmware to see if
it helps as well as toggling the few bios options but the issue still occurs.
I shall try older firmware if newer snapshots or coreboot releases don't solve it.
Rebooting it isn't a huge issue for now and I can't really afford any more time.

Does anyone have any tips on the best pcengines apu4 bios settings for OpenBSD?

I notice some extent acpipci, Perhaps of interest to someone.


OpenBSD 6.7-current (GENERIC.MP) #313: Sun Jun 28 22:05:28 MDT 2020
    [hidden email]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 1996484608 (1903MB)
avail mem = 1921003520 (1832MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0x7ee9e020 (13 entries)
bios0: vendor coreboot version "v4.12.0.1" date 05/29/2020
bios0: PC Engines apu4
acpi0 at bios0: ACPI 6.0
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP SSDT MCFG APIC HEST SSDT SSDT HPET
acpi0: wakeup devices PWRB(S4) PBR4(S4) PBR5(S4) PBR6(S4) PBR7(S4) PBR8(S4) UOH1(S3) UOH2(S3) UOH3(S3) UOH4(S3) UOH5(S3) UOH6(S3) XHC0(S4)
acpitimer0 at acpi0: 3579545 Hz, 32 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xf8000000, bus 0-64
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD GX-412TC SOC, 998.40 MHz, 16-30-01
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PERFTSC,PCTRL3,ITSC,BMI1,XSAVEOPT
cpu0: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 2MB 64b/line 16-way L2 cache
cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu0: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
cpu0: TSC skew=0 observed drift=0
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: AMD GX-412TC SOC, 998.19 MHz, 16-30-01
cpu1: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PERFTSC,PCTRL3,ITSC,BMI1,XSAVEOPT
cpu1: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 2MB 64b/line 16-way L2 cache
cpu1: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu1: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
cpu1: TSC skew=32 observed drift=0
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: AMD GX-412TC SOC, 998.13 MHz, 16-30-01
cpu2: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PERFTSC,PCTRL3,ITSC,BMI1,XSAVEOPT
cpu2: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 2MB 64b/line 16-way L2 cache
cpu2: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu2: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
cpu2: TSC skew=31 observed drift=0
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: AMD GX-412TC SOC, 998.14 MHz, 16-30-01
cpu3: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,MWAIT,SSSE3,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AES,XSAVE,AVX,F16C,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,EAPICSP,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,IBS,SKINIT,TOPEXT,DBKP,PERFTSC,PCTRL3,ITSC,BMI1,XSAVEOPT
cpu3: 32KB 64b/line 2-way I-cache, 32KB 64b/line 8-way D-cache, 2MB 64b/line 16-way L2 cache
cpu3: ITLB 32 4KB entries fully associative, 8 4MB entries fully associative
cpu3: DTLB 40 4KB entries fully associative, 8 4MB entries fully associative
cpu3: TSC skew=28 observed drift=0
cpu3: smt 0, core 3, package 0
ioapic0 at mainbus0: apid 4 pa 0xfec00000, version 21, 24 pins
ioapic1 at mainbus0: apid 5 pa 0xfec20000, version 21, 32 pins
acpihpet0 at acpi0: 14318180 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PBR4)
acpiprt2 at acpi0: bus 2 (PBR5)
acpiprt3 at acpi0: bus 3 (PBR6)
acpiprt4 at acpi0: bus 4 (PBR7)
acpiprt5 at acpi0: bus 5 (PBR8)
acpicpu0 at acpi0: C2(0@400 io@0x1771), C1(@1 halt!), PSS
acpicpu1 at acpi0: C2(0@400 io@0x1771), C1(@1 halt!), PSS
acpicpu2 at acpi0: C2(0@400 io@0x1771), C1(@1 halt!), PSS
acpicpu3 at acpi0: C2(0@400 io@0x1771), C1(@1 halt!), PSS
acpitz0 at acpi0: critical temperature is 115 degC
acpibtn0 at acpi0: PWRB
acpipci0 at acpi0 PCI0: 0x00000000 0x00000011 0x00000001
extent `acpipci0 pcibus' (0x0 - 0xff), flags=0
extent `acpipci0 pciio' (0x0 - 0xffffffff), flags=0
     0xcf8 - 0xcff
     0x10000 - 0xffffffff
extent `acpipci0 pcimem' (0x0 - 0xffffffffffffffff), flags=0
     0x0 - 0x9ffff
     0xe0000 - 0x7effffff
     0x100000000 - 0xffffffffffffffff
acpicmos0 at acpi0
amdgpio0 at acpi0 GPIO uid 0 addr 0xfed81500/0x300 irq 7, 184 pins
"PRP0001" at acpi0 not configured
"PRP0001" at acpi0 not configured
"PRP0001" at acpi0 not configured
"PRP0001" at acpi0 not configured
"PRP0001" at acpi0 not configured
"PRP0001" at acpi0 not configured
"BOOT0000" at acpi0 not configured
cpu0: 998 MHz: speeds: 1000 800 600 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "AMD 16h Root Complex" rev 0x00
vendor "AMD", unknown product 0x1567 (class system subclass IOMMU, rev 0x00) at pci0 dev 0 function 2 not configured
pchb1 at pci0 dev 2 function 0 "AMD 16h Host" rev 0x00
ppb0 at pci0 dev 2 function 1 "AMD 16h PCIE" rev 0x00: msi
pci1 at ppb0 bus 1
em0 at pci1 dev 0 function 0 "Intel I211" rev 0x03: msi, address 00:0d:b9:51:52:98
ppb1 at pci0 dev 2 function 2 "AMD 16h PCIE" rev 0x00: msi
pci2 at ppb1 bus 2
em1 at pci2 dev 0 function 0 "Intel I211" rev 0x03: msi, address 00:0d:b9:51:52:99
ppb2 at pci0 dev 2 function 3 "AMD 16h PCIE" rev 0x00: msi
pci3 at ppb2 bus 3
em2 at pci3 dev 0 function 0 "Intel I211" rev 0x03: msi, address 00:0d:b9:51:52:9a
ppb3 at pci0 dev 2 function 4 "AMD 16h PCIE" rev 0x00: msi
pci4 at ppb3 bus 4
em3 at pci4 dev 0 function 0 "Intel I211" rev 0x03: msi, address 00:0d:b9:51:52:9b
ppb4 at pci0 dev 2 function 5 "AMD 16h PCIE" rev 0x00: msi
pci5 at ppb4 bus 5
athn0 at pci5 dev 0 function 0 "Atheros AR9281" rev 0x01: apic 5 int 16
athn0: AR9280 rev 2 (2T2R), ROM rev 22, address 04:f0:21:54:95:42
ccp0 at pci0 dev 8 function 0 "AMD 16h Crypto" rev 0x00
xhci0 at pci0 dev 16 function 0 "AMD Bolton xHCI" rev 0x11: msi, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "AMD xHCI root hub" rev 3.00/1.00 addr 1
ahci0 at pci0 dev 17 function 0 "AMD Hudson-2 SATA" rev 0x40: apic 4 int 19, AHCI 1.3
ahci0: port 0: 6.0Gb/s
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, SATA SSD, SBFM> naa.0000000000000000
sd0: 57241MB, 512 bytes/sector, 117231408 sectors, thin
ehci0 at pci0 dev 19 function 0 "AMD Hudson-2 USB2" rev 0x39: apic 4 int 18
usb1 at ehci0: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 addr 1
piixpm0 at pci0 dev 20 function 0 "AMD Hudson-2 SMBus" rev 0x42: SMI
iic0 at piixpm0
iic1 at piixpm0
iic1: addr 0x4c 3e=00 48=00 4a=00 4e=00 fc=00 fe=00 words 00=ffff 01=ffff 02=ffff 03=ffff 04=ffff 05=ffff 06=ffff 07=ffff
pcib0 at pci0 dev 20 function 3 "AMD Hudson-2 LPC" rev 0x11
sdhc0 at pci0 dev 20 function 7 "AMD Bolton SD/MMC" rev 0x01: apic 4 int 16
sdhc0: SDHC 2.0, 50 MHz base clock
sdmmc0 at sdhc0: 4-bit, sd high-speed, mmc high-speed, dma
pchb2 at pci0 dev 24 function 0 "AMD 16h Link Cfg" rev 0x00
pchb3 at pci0 dev 24 function 1 "AMD 16h Address Map" rev 0x00
pchb4 at pci0 dev 24 function 2 "AMD 16h DRAM Cfg" rev 0x00
km0 at pci0 dev 24 function 3 "AMD 16h Misc Cfg" rev 0x00
pchb5 at pci0 dev 24 function 4 "AMD 16h CPU Power" rev 0x00
pchb6 at pci0 dev 24 function 5 "AMD 16h Misc Cfg" rev 0x00
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
com2 at isa0 port 0x3e8/8 irq 5: ns16550a, 16 byte fifo
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
intr_establish: pic ioapic0 pin 7: can't share type 3 with 2
wbsio0 at isa0 port 0x2e/2: NCT5104D rev 0x53
vmm0 at mainbus0: SVM/RVI
uhub2 at uhub1 port 1 configuration 1 interface 0 "Advanced Micro Devices Hub" rev 2.00/0.18 addr 2
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
root on sd0a (58b2532f32d66db2.a) swap on sd0b dump on sd0b
Process (pid 1) got signal 31

Reply | Threaded
Open this post in threaded view
|

Re: An Athn ar9280 client seems to require cold boots of late?

Kapfhammer, Stefan
In reply to this post by austin
Hi,

I am using exactly the same WLE-200NX wifi card in an APU2B4. I have a BlackBerry KeyONE
running at Android 8.1 / Version ABT975 which I use as hotspot for the APU2.

After setting athn0 down, it is impossible to establish the connection - without further intervention -
a second time.

What helps is:

First:
#/bin/sh
/sbin/ifconfig athn0
/sbin/ifconfig athn0 down -inet -inet6 -join bbk1 -wpakey -chan -bssid
/sbin/ifconfig athn0

Second:
Disabling the hotspot on bbk1 and re-enabling it

Third:
sh -x /etc/netstart athn0

This prevents to do a coldboot on the APU2 - reducing downtime.
AND: It works reliably everytime since month!

Regards,
Stefan



> -----Urspr√ľngliche Nachricht-----
> Von: [hidden email] <[hidden email]> Im Auftrag
> von Austin Hook
> Gesendet: Sonntag, 28. Juni 2020 23:43
> An: Kevin Chadwick <[hidden email]>
> Cc: [hidden email]
> Betreff: Re: An Athn ar9280 client seems to require cold boots of late?
>
>
> I have a similar problem with the 6.7 release which I just installed today on an
> 8Tb drive I'm using with my older ASUS laptop.
>
> athn0 at pci3 dev 0 function 0 "Atheros AR9285" rev 0x01: apic 2 int 17
> athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 74:f0:6d:7a:42:7f
>
> Can't seem to shake it with a cold boot.  However I have some interesting
> other effects.  I have several wireless routers, one of which is quite old
> and doesn't even do wpa.   It's a UBNT antenna that I use to broadcast
> around the farm. So without any password at all, even the old kind,  if I
>
> ifconfig athn0 -wpakey
> ifconfig athn0 nwid UBNT
> dhclient athn0
>
> That works fine.
>
> Now, I can also project wireless from my cellphone using wpa2. Sometimes it
> works and sometimes it doesn't.  I don't know if it's after a cold boot of the
> laptop, but what does work for me it to just disable the hotspot from the
> cellphone for a moment, and then re-enable it.  Then it works fine with the
> nwid I set up and the wpa2 password I require.
>
> However no matter what I do I can't get a connection to my farmhouse
> wireless router.  It's a DIR822 Dlink.  Of course I know that's a low end router.
> Recently they recommended a firmware upgrade, and since then I found
> that I was unable to set it up for no password, and had to add one, and then
> add that password to all the other devices in the house.
>
> Just now I saw that I can enable projecting a separate "guest" zone network
> from it, and that seems to allow having a null password.  However neither
> with a null password nor with an 8 letter password and can I get it to connect
> to the ASUS athn0
>
> I think I have had athn problems before with the ASUS, and I used to have a
> spare USB wireless of some sort that was more reliable, but I gave it away,
> after not having such problems with some other more recent releases (but
> before 6.7).  Wish I could remember what it was.
>
> If anyone has a recommendation for a reliable USB wireless stick that I can
> find on eBay, and plays well with athn, I'd be grateful.
>
> Moreover, if anyone can fix the problem before I go to that extreme, I'll send
> him the shirt off my back...  Happens I have about 1,000 OpenBSD T-shirts :-)
>
> Austin
>
>
>
> On Fri, 26 Jun 2020, Kevin Chadwick wrote:
>
> > After upgrading via sysupgrade for a few releases, I have had to cold
> > boot to get dhclient athn0 working on an ar9280 in client mode.
> >
> > Since my latest upgrade to a snapshot of Jun 17 kernel #275 with the
> > previous kernel being from Jun 2nd #237. I seem to have to cold boot
> > after running ifconfig athn0 down and then back up, where I'm *fairly*
> > sure that I didn't need to before that Jun 17th upgrade. ifconfig
> > debug mode shows the wireless handshake completing 4/4. Yet dhclient
> can't establish a link until cold booted.
> > A warm reboot does not resolve the problem.
> >
> > Has anyone else seen this or can reproduce it?
> >
> > I'll try a sysupgrade in the meantime but I'm not sure there has been
> > any code changes in areas that could resolve it.
> >

Reply | Threaded
Open this post in threaded view
|

Re: An Athn ar9280 client seems to require cold boots of late?

Stefan Sperling-5
On Mon, Jun 29, 2020 at 12:09:12PM +0000, Kapfhammer, Stefan wrote:

> Hi,
>
> I am using exactly the same WLE-200NX wifi card in an APU2B4. I have a BlackBerry KeyONE
> running at Android 8.1 / Version ABT975 which I use as hotspot for the APU2.
>
> After setting athn0 down, it is impossible to establish the connection - without further intervention -
> a second time.
>
> What helps is:
>
> First:
> #/bin/sh
> /sbin/ifconfig athn0
> /sbin/ifconfig athn0 down -inet -inet6 -join bbk1 -wpakey -chan -bssid
> /sbin/ifconfig athn0
>
> Second:
> Disabling the hotspot on bbk1 and re-enabling it
>
> Third:
> sh -x /etc/netstart athn0
>
> This prevents to do a coldboot on the APU2 - reducing downtime.
> AND: It works reliably everytime since month!
>

In case you missed it, a fix was proposed on the bugs@ list on Friday:
https://marc.info/?l=openbsd-bugs&m=159380123409160&w=2
The same patch is copied below.

If anyone else could confirm that this makes athn(4) work again as
a client against a WPA2 AP then I will commit this.

diff refs/heads/master refs/heads/athn-ccmpfix
blob - 3a28d87bc88a0e7b9ed6c873bd7a07682cc91a0b
blob + 1d739529d7d214bea314e50e847594dc01021a41
--- sys/dev/ic/ar5008.c
+++ sys/dev/ic/ar5008.c
@@ -811,12 +811,20 @@ ar5008_ccmp_decap(struct athn_softc *sc, struct mbuf *
  /* Sanity checks to ensure this is really a key we installed. */
  entry = (uintptr_t)k->k_priv;
  if (k->k_flags & IEEE80211_KEY_GROUP) {
- if (k->k_id > IEEE80211_WEP_NKID ||
+ if (k->k_id >= IEEE80211_WEP_NKID ||
     entry != k->k_id)
  return 1;
- } else if (entry != IEEE80211_WEP_NKID +
-    IEEE80211_AID(ni->ni_associd))
- return 1;
+ } else {
+#ifndef IEEE80211_STA_ONLY
+ if (ic->ic_opmode == IEEE80211_M_HOSTAP) {
+ if (entry != IEEE80211_WEP_NKID +
+    IEEE80211_AID(ni->ni_associd))
+ return 1;
+ } else
+#endif
+ if (entry != IEEE80211_WEP_NKID)
+ return 1;
+ }
 
  /* Check that ExtIV bit is set. */
  if (!(ivp[3] & IEEE80211_WEP_EXTIV))
blob - 40725b02c43b54e10a87de333acdfd3b8270534d
blob + f7aa77ba15cae787a42fdbffb8a9d9cd2d0226d2
--- sys/dev/ic/athn.c
+++ sys/dev/ic/athn.c
@@ -1037,12 +1037,17 @@ athn_set_key(struct ieee80211com *ic, struct ieee80211
  }
 
  if (!(k->k_flags & IEEE80211_KEY_GROUP)) {
- entry = IEEE80211_WEP_NKID + IEEE80211_AID(ni->ni_associd);
+#ifndef IEEE80211_STA_ONLY
+ if (ic->ic_opmode == IEEE80211_M_HOSTAP)
+ entry = IEEE80211_WEP_NKID + IEEE80211_AID(ni->ni_associd);
+ else
+#endif
+ entry = IEEE80211_WEP_NKID;
  if (entry >= sc->kc_entries - IEEE80211_WEP_NKID)
  return ENOSPC;
  } else {
  entry = k->k_id;
- if (entry > IEEE80211_WEP_NKID)
+ if (entry >= IEEE80211_WEP_NKID)
  return ENOSPC;
  }
  k->k_priv = (void *)entry;
@@ -3056,10 +3061,6 @@ athn_init(struct ifnet *ifp)
  else
  athn_config_pcie(sc);
 
- /* Reset HW key cache entries. */
- for (i = 0; i < sc->kc_entries; i++)
- athn_reset_key(sc, i);
-
  ops->enable_antenna_diversity(sc);
 
 #ifdef ATHN_BT_COEXISTENCE
@@ -3086,6 +3087,10 @@ athn_init(struct ifnet *ifp)
  /* Enable Rx. */
  athn_rx_start(sc);
 
+ /* Reset HW key cache entries. */
+ for (i = 0; i < sc->kc_entries; i++)
+ athn_reset_key(sc, i);
+
  /* Enable interrupts. */
  athn_enable_interrupts(sc);
 
@@ -3121,7 +3126,7 @@ athn_stop(struct ifnet *ifp, int disable)
 {
  struct athn_softc *sc = ifp->if_softc;
  struct ieee80211com *ic = &sc->sc_ic;
- int qid;
+ int qid, i;
 
  ifp->if_timer = sc->sc_tx_timer = 0;
  ifp->if_flags &= ~IFF_RUNNING;
@@ -3158,6 +3163,10 @@ athn_stop(struct ifnet *ifp, int disable)
  AR_WRITE_BARRIER(sc);
  athn_set_rxfilter(sc, 0);
  athn_stop_rx_dma(sc);
+
+ /* Reset HW key cache entries. */
+ for (i = 0; i < sc->kc_entries; i++)
+ athn_reset_key(sc, i);
 
  athn_reset(sc, 0);
  athn_init_pll(sc, NULL);