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

2020-07-06 Thread Stefan Sperling
On Mon, Jul 06, 2020 at 11:10:13AM +, Kevin Chadwick wrote:
> With this patch I have been able to bring the device down and back up with a 
> subsequently successful dhclient and http download.
> 
> Annoying how quirky and poorly documented, chips often are!
> 
> Thank You
> 

Thanks for confirming. The fix has been committed :)



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

2020-07-06 Thread Kevin Chadwick
With this patch I have been able to bring the device down and back up with a 
subsequently successful dhclient and http download.

Annoying how quirky and poorly documented, chips often are!

Thank You



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

2020-07-05 Thread Stefan Sperling
On Mon, Jun 29, 2020 at 12:09:12PM +, 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=159380123409160=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_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);



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

2020-06-29 Thread Kapfhammer, Stefan
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: owner-m...@openbsd.org  Im Auftrag
> von Austin Hook
> Gesendet: Sonntag, 28. Juni 2020 23:43
> An: Kevin Chadwick 
> Cc: misc@openbsd.org
> 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.
> >



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

2020-06-29 Thread Kevin Chadwick
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
dera...@amd64.openbsd.org:/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 0xf800, bus 0-64
acpimadt0 at acpi0 addr 0xfee0: 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 0xfec0, version 21, 24 pins
ioapic1 at mainbus0: apid 5 pa 0xfec2, 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 

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

2020-06-29 Thread Kevin Chadwick
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=159100149411516=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.



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

2020-06-29 Thread Stefan Sperling
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=159100149411516=2
Perhaps that applies to your situation? Could you check if a -current
bsd.rd kernel is able to connect to this problematic AP?



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

2020-06-28 Thread Austin Hook


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



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

2020-06-26 Thread Kevin Chadwick
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.