11n support for athn(4)

classic Classic list List threaded Threaded
53 messages Options
123
Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5
On 14 January 2017 at 11:23, Stefan Sperling <[hidden email]> wrote:
> On Sat, Jan 14, 2017 at 11:03:24AM +0000, Peter Kay wrote:
>> On 12 January 2017 at 15:06, Stefan Sperling <[hidden email]> wrote:

> So your first test might not have had 11n enabled since the first two
> versions of my patch had a bug where 11n was left disabled on 2GHz only
> devices. Please check with 'ifconfig media athn0' whether 11n mode is
> actually supported.
'bad value' regardless of what interface I run this on?

> What does your /etc/hostname.athn0 file look like?
> Please specify 'mode 11n' in your /etc/hostname.athn0, and also fix the
> channel with a line such as 'chan 1'. There are known problems otherwise.
> For reference, this is what I am using:
>
>   media autoselect mode 11n mediaopt hostap chan 10
>   nwid stsp.name wpakey xxxxxxx
>   up
inet 1.1.1.1 255.255.255.0 1.1.1.255 description "802.11b/g wireless"
media autoselect mode 11n mediaopt hostap chan 9 nwid "myap" wpakey
"ultrasecurepassword" wpaprotos "wpa2"

I'll try applying the latest patch if it will make a difference, but
the clients did think they had a carrier at greater than g speeds.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Sat, Jan 14, 2017 at 11:31:00AM +0000, Peter Kay wrote:

> On 14 January 2017 at 11:23, Stefan Sperling <[hidden email]> wrote:
> > On Sat, Jan 14, 2017 at 11:03:24AM +0000, Peter Kay wrote:
> >> On 12 January 2017 at 15:06, Stefan Sperling <[hidden email]> wrote:
>
> > So your first test might not have had 11n enabled since the first two
> > versions of my patch had a bug where 11n was left disabled on 2GHz only
> > devices. Please check with 'ifconfig media athn0' whether 11n mode is
> > actually supported.
> 'bad value' regardless of what interface I run this on?
>
> > What does your /etc/hostname.athn0 file look like?
> > Please specify 'mode 11n' in your /etc/hostname.athn0, and also fix the
> > channel with a line such as 'chan 1'. There are known problems otherwise.
> > For reference, this is what I am using:
> >
> >   media autoselect mode 11n mediaopt hostap chan 10
> >   nwid stsp.name wpakey xxxxxxx
> >   up
> inet 1.1.1.1 255.255.255.0 1.1.1.255 description "802.11b/g wireless"
> media autoselect mode 11n mediaopt hostap chan 9 nwid "myap" wpakey
> "ultrasecurepassword" wpaprotos "wpa2"
>
> I'll try applying the latest patch if it will make a difference,

Please upgrade to the latest snapshot instead. It should have all the changes.

> but the clients did think they had a carrier at greater than g speeds.

If you upgraded from 6.0 to -current to test the 11n patches, note
also that we recently disabled the TKIP pairwise cipher in -current:
https://marc.info/?l=openbsd-cvs&m=148224048415556&w=2

If one of your clients says it cannot authenticate, then this client may be
trying to use TKIP/WPA1. You can enable wpa1 explicitly for such clients:
  ifconfig athn0 wpaprotos wpa1,wpa2
But understand that you'll be running broken WEP-grade crypto if you do this.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5
On 14 January 2017 at 12:02, Stefan Sperling <[hidden email]> wrote:
> On Sat, Jan 14, 2017 at 11:31:00AM +0000, Peter Kay wrote:
>> On 14 January 2017 at 11:23, Stefan Sperling <[hidden email]> wrote:

> If one of your clients says it cannot authenticate, then this client may be
> trying to use TKIP/WPA1. You can enable wpa1 explicitly for such clients:
>   ifconfig athn0 wpaprotos wpa1,wpa2
> But understand that you'll be running broken WEP-grade crypto if you do this.
I'll upgrade to the latest snapshot. It's not a TKIP/WPA1 issue as a
reboot fixes it.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Sat, Jan 14, 2017 at 12:42:09PM +0000, Peter Kay wrote:

> On 14 January 2017 at 12:02, Stefan Sperling <[hidden email]> wrote:
> > On Sat, Jan 14, 2017 at 11:31:00AM +0000, Peter Kay wrote:
> >> On 14 January 2017 at 11:23, Stefan Sperling <[hidden email]> wrote:
>
> > If one of your clients says it cannot authenticate, then this client may be
> > trying to use TKIP/WPA1. You can enable wpa1 explicitly for such clients:
> >   ifconfig athn0 wpaprotos wpa1,wpa2
> > But understand that you'll be running broken WEP-grade crypto if you do this.
> I'll upgrade to the latest snapshot. It's not a TKIP/WPA1 issue as a
> reboot fixes it.

A reboot is very drastic and won't help with narrowing down the
cause of your issue.

Can you find a better way to unwedge the AP when it runs into problems?
Does 'ifconfig iwn0 scan' on the client help?
Does 'ifconfig athn0 down up' on the AP help?

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Olivier Cherrier
In reply to this post by Stefan Sperling-5
On Mon, Jan 09, 2017 at 01:54:55PM +0100, [hidden email] wrote:
> Date: Mon, 9 Jan 2017 13:54:55 +0100
> From: Stefan Sperling <[hidden email]>
> To: [hidden email]
> Subject: 11n support for athn(4)

        Hi Stefan,

Thank you for this extended work !

I just tested today the latest snapshot on my Alix GW.
After some time, I got this uvm_fault :

Script started on Mon Dec 26 11:51:10 2016
11:52:05 oclocal@odile $
11:52:05 oclocal@odile $ doas cu -l /dev/cuaU0 -s 38400
Connected to /dev/cuaU0 (speed 38400)

ddb> show panic
the kernel did not panic
ddb> ps
   PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
 19968  32902  32902      0  3    0x100081  netio         tcpdump
 32902   5116  32902     76  3    0x100093  bpf           tcpdump
  5116  18692   5116      0  3    0x10008b  pause         ksh
 49320  80074  49320      0  3    0x100083  kqread        tmux
 68772  54609  54609      0  3    0x100081  netio         tcpdump
 54609  10608  54609     76  3    0x100093  bpf           tcpdump
 10608  18692  10608      0  3    0x10008b  pause         ksh
 18692      1  18692      0  3    0x100080  kqread        tmux
 61250  80815  61250      0  3    0x100083  kqread        tmux
 80815   5768  80815      0  3    0x10008b  pause         ksh
  5768  55189   5768   1000  3    0x10008b  pause         ksh
 55189  26739  26739   1000  3        0x90  select        sshd
 26739  17529  26739      0  3        0x92  poll          sshd
 80074  22879  80074      0  3    0x10008b  pause         ksh
 73882   9948  73882   1000  3    0x100083  ttyin         ksh
  9948  84034  84034   1000  3        0x90  select        sshd
 84034  17529  84034      0  3        0x92  poll          sshd
 22879  53776  22879   1000  3    0x10008b  pause         ksh
 53776  94675  94675   1000  3        0x90  select        sshd
 94675  17529  94675      0  3        0x92  poll          sshd
 32955      1  32955      0  3    0x100083  ttyin         getty
--db_more--             8336  84223  84223     74  3    0x100090  bpf           pflogd
 84223      1  84223      0  3        0x80  netio         pflogd
 61055  66055  66055     74  3    0x100090  bpf           pflogd
 66055      1  66055      0  3        0x80  netio         pflogd
 50995      1  50995      0  3    0x100098  poll          cron
 45087      1  45087    110  3    0x100090  poll          sndiod
  7545      1   7545     99  3    0x100090  poll          sndiod
 66227      1  66227    109  3        0x90  kqread        ftp-proxy
 21402  82173  82173     95  3    0x100092  kqread        smtpd
 11513  82173  82173    103  3    0x100092  kqread        smtpd
 54208  82173  82173     95  3    0x100092  kqread        smtpd
   965  82173  82173     95  3    0x100092  kqread        smtpd
   679  82173  82173     95  3    0x100092  kqread        smtpd
 80539  82173  82173     95  3    0x100092  kqread        smtpd
 82173      1  82173      0  3    0x100080  kqread        smtpd
 74992      1  74992     77  3    0x100090  poll          dhcpd
 17529      1  17529      0  3        0x80  select        sshd
 22010      1  22010      0  3    0x100080  poll          ntpd
 31230  58512  31230     83  3    0x100092  poll          ntpd
 58512      1  58512     83  3    0x100092  poll          ntpd
 89749      1  89749     53  3        0x90  kqread        unbound
 38285   2753  92830     97  3    0x100090  kqread        nsd
  2753  92830  92830     97  3    0x100090  poll          nsd
--db_more--            92830      1  92830     97  3    0x100090  kqread        nsd
  7026  26000  26000     73  2    0x100090                syslogd
 26000      1  26000      0  3    0x100082  netio         syslogd
 74378      1  74378      0  3        0x80  mfsidl        mount_mfs
 16009      0      0      0  3     0x14200  pgzero        zerothread
 57007      0      0      0  3     0x14200  aiodoned      aiodoned
 67486      0      0      0  3     0x14200  syncer        update
 65321      0      0      0  3     0x14200  cleaner       cleaner
 23106      0      0      0  3     0x14200  reaper        reaper
 51825      0      0      0  3     0x14200  pgdaemon      pagedaemon
 66180      0      0      0  3     0x14200  bored         crynlk
 23157      0      0      0  3     0x14200  bored         crypto
 83928      0      0      0  3     0x14200  pftm          pfpurge
 63889      0      0      0  3     0x14200  usbtsk        usbtask
 16061      0      0      0  3     0x14200  usbatsk       usbatsk
 81215      0      0      0  3     0x14200  bored         sensors
 56615      0      0      0  3     0x14200  bored         softnet
 31641      0      0      0  3     0x14200  bored         systqmp
 59547      0      0      0  3     0x14200  bored         systq
 73733      0      0      0  3  0x40014200  bored         softclock
*23402      0      0      0  7  0x40014200                idle0
  3265      0      0      0  3     0x14200  kmalloc       kmthread
     1      0      1      0  3        0x82  wait          init
--db_more--                0     -1      0      0  3     0x10200  scheduler     swapper
ddb> trace
ieee80211_input_ba(d13a2030,d5778a00,d1290000,0,f3636eb0) at ieee80211_input_ba
+0x1b9
ieee80211_input(d13a2030,d5778a00,d1290000,f3636eb0,1) at ieee80211_input+0x5b0

ar5008_rx_intr(d13a2000,c0,d0bdb7cc,d57672d0,f3636f08) at ar5008_rx_intr+0x2f2
ar5008_intr(d13a2000,d12b85c0) at ar5008_intr+0x235
Xintr_legacy9() at Xintr_legacy9+0x85
--- interrupt ---
cpu_idle_cycle(d0c6c980) at cpu_idle_cycle+0xf
ddb> show register
ds                  0x10
es                  0x10
fs                  0x20        clean_idt
gs                     0
edi           0xd12905d0        end+0x6205d0
esi                    0
ebp           0xf3636dbc
ebx           0xd1290000        end+0x620000
edx                    0
ecx                0x340        clean_idt+0x320
eax                0x340        clean_idt+0x320
eip           0xd0455fd9        ieee80211_input_ba+0x1b9
cs                  0x50        clean_idt+0x30
eflags           0x10202        __ALIGN_SIZE+0xf202
esp           0xf3636d64
ss                  0x10
ieee80211_input_ba+0x1b9:       movl    0(%eax),%edx
ddb> dmesg
OpenBSD 6.0-current (GENERIC) #136: Sat Jan 14 19:44:45 MST 2017
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Geode(TM) Integrated Processor by AMD PCS ("AuthenticAMD" 586-class) 499 M
Hz
cpu0: FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CFLUSH,MMX,MMXX,3DNOW2,3DNOW
real mem  = 267931648 (255MB)
avail mem = 250175488 (238MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 11/05/08, BIOS32 rev. 0 @ 0xfd088
pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000
pcibios0: pcibios_get_intr_routing - function not supported
pcibios0: PCI IRQ Routing information unavailable.
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xe0000/0xa800
cpu0 at mainbus0: (uniprocessor)
mtrr: K6-family MTRR support (2 registers)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 1 function 0 "AMD Geode LX" rev 0x33
glxsb0 at pci0 dev 1 function 2 "AMD Geode LX Crypto" rev 0x00: RNG AES
vr0 at pci0 dev 9 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 10, address 0
--db_more--           0:0d:b9:2b:62:c8
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x004063,
 model 0x0034
vr1 at pci0 dev 10 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 11, address 0
0:0d:b9:2b:62:c9
ukphy1 at vr1 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x004063,
 model 0x0034
vr2 at pci0 dev 11 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 15, address 0
0:0d:b9:2b:62:ca
ukphy2 at vr2 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x004063,
 model 0x0034
athn0 at pci0 dev 12 function 0 "Atheros AR9280" rev 0x01: irq 9
athn0: AR9280 rev 2 (2T2R), ROM rev 21, address 30:14:4a:15:ba:bb
glxpcib0 at pci0 dev 15 function 0 "AMD CS5536 ISA" rev 0x03: rev 3, 32-bit 357
9545Hz timer, watchdog, gpio, i2c
gpio0 at glxpcib0: 32 pins
iic0 at glxpcib0
maxtmp0 at iic0 addr 0x4c: lm86
pciide0 at pci0 dev 15 function 2 "AMD CS5536 IDE" rev 0x01: DMA, channel 0 wir
ed to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <CF 4GB>
wd0: 1-sector PIO, LBA, 3831MB, 7847280 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
--db_more--           pciide0: channel 1 ignored (disabled)
ohci0 at pci0 dev 15 function 4 "AMD CS5536 USB" rev 0x02: irq 12, version 1.0,
 legacy support
ehci0 at pci0 dev 15 function 5 "AMD CS5536 USB" rev 0x02: irq 12
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 add
r 1
isa0 at glxpcib0
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
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "AMD OHCI root hub" rev 1.00/1.00 add
r 1
vmm at mainbus0 not configured
nvram: invalid checksum
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
--db_more--           scsibus2 at softraid0: 256 targets
root on wd0a (9a03e090a85ec7ef.a) swap on wd0b dump on wd0b
clock: unknown CMOS layout
uvm_fault(0xd0ba9760, 0x0, 0, 1) -> e
kernel: page fault trap, code=0
Stopped at      ieee80211_input_ba+0x1b9:       movl    0(%eax),%edx
ddb> the kernel did not panic
ddb>    PID   PPID   PGRP    UID  S       FLAGS  WAIT          COMMAND
 19968  32902  32902      0  3    0x100081  netio         tcpdump
 32902   5116  32902     76  3    0x100093  bpf           tcpdump
  5116  18692   5116      0  3    0x10008b  pause         ksh
 49320  80074  49320      0  3    0x100083  kqread        tmux
 68772  54609  54609      0  3    0x100081  netio         tcpdump
 54609  10608  54609     76  3    0x100093  bpf           tcpdump
 10608  18692  10608      0  3    0x10008b  pause         ksh
 18692      1  18692      0  3    0x100080  kqread        tmux
 61250  80815  61250      0  3    0x100083  kqread        tmux
 80815   5768  80815      0  3    0x10008b  pause         ksh
  5768  55189   5768   1000  3    0x10008b  pause         ksh
 55189  26739  26739   1000  3        0x90  select        sshd
 26739  17529  26739      0  3        0x92  poll          sshd
 80074  22879  80074      0  3    0x10008b  pause         ksh
 73882   9948  73882   1000  3    0x100083  ttyin         ksh
--db_more--             9948  84034  84034   1000  3        0x90  select        sshd
 84034  17529  84034      0  3        0x92  poll          sshd
 22879  53776  22879   1000  3    0x10008b  pause         ksh
 53776  94675  94675   1000  3        0x90  select        sshd
 94675  17529  94675      0  3        0x92  poll          sshd
 32955      1  32955      0  3    0x100083  ttyin         getty
  8336  84223  84223     74  3    0x100090  bpf           pflogd
 84223      1  84223      0  3        0x80  netio         pflogd
 61055  66055  66055     74  3    0x100090  bpf           pflogd
 66055      1  66055      0  3        0x80  netio         pflogd
 50995      1  50995      0  3    0x100098  poll          cron
 45087      1  45087    110  3    0x100090  poll          sndiod
  7545      1   7545     99  3    0x100090  poll          sndiod
 66227      1  66227    109  3        0x90  kqread        ftp-proxy
 21402  82173  82173     95  3    0x100092  kqread        smtpd
 11513  82173  82173    103  3    0x100092  kqread        smtpd
 54208  82173  82173     95  3    0x100092  kqread        smtpd
   965  82173  82173     95  3    0x100092  kqread        smtpd
   679  82173  82173     95  3    0x100092  kqread        smtpd
 80539  82173  82173     95  3    0x100092  kqread        smtpd
 82173      1  82173      0  3    0x100080  kqread        smtpd
 74992      1  74992     77  3    0x100090  poll          dhcpd
 17529      1  17529      0  3        0x80  select        sshd
--db_more--            22010      1  22010      0  3    0x100080  poll          ntpd
 31230  58512  31230     83  3    0x100092  poll          ntpd
 58512      1  58512     83  3    0x100092  poll          ntpd
 89749      1  89749     53  3        0x90  kqread        unbound
 38285   2753  92830     97  3    0x100090  kqread        nsd
  2753  92830  92830     97  3    0x100090  poll          nsd
 92830      1  92830     97  3    0x100090  kqread        nsd
  7026  26000  26000     73  2    0x100090                syslogd
 26000      1  26000      0  3    0x100082  netio         syslogd
 74378      1  74378      0  3        0x80  mfsidl        mount_mfs
 16009      0      0      0  3     0x14200  pgzero        zerothread
 57007      0      0      0  3     0x14200  aiodoned      aiodoned
 67486      0      0      0  3     0x14200  syncer        update
 65321      0      0      0  3     0x14200  cleaner       cleaner
 23106      0      0      0  3     0x14200  reaper        reaper
 51825      0      0      0  3     0x14200  pgdaemon      pagedaemon
 66180      0      0      0  3     0x14200  bored         crynlk
 23157      0      0      0  3     0x14200  bored         crypto
 83928      0      0      0  3     0x14200  pftm          pfpurge
 63889      0      0      0  3     0x14200  usbtsk        usbtask
 16061      0      0      0  3     0x14200  usbatsk       usbatsk
 81215      0      0      0  3     0x14200  bored         sensors
 56615      0      0      0  3     0x14200  bored         softnet
--db_more--            31641      0      0      0  3     0x14200  bored         systqmp
 59547      0      0      0  3     0x14200  bored         systq
 73733      0      0      0  3  0x40014200  bored         softclock
*23402      0      0      0  7  0x40014200                idle0
  3265      0      0      0  3     0x14200  kmalloc       kmthread
     1      0      1      0  3        0x82  wait          init
     0     -1      0      0  3     0x10200  scheduler     swapper
ddb> ieee80211_input_ba(d13a2030,d5778a00,d1290000,0,f3636eb0) at ieee80211_inp
ut_ba+0x1b9
ieee80211_input(d13a2030,d5778a00,d1290000,f3636eb0,1) at ieee80211_input+0x5b0

ar5008_rx_intr(d13a2000,c0,d0bdb7cc,d57672d0,f3636f08) at ar5008_rx_intr+0x2f2
ar5008_intr(d13a2000,d12b85c0) at ar5008_intr+0x235
Xintr_legacy9() at Xintr_legacy9+0x85
--- interrupt ---
cpu_idle_cycle(d0c6c980) at cpu_idle_cycle+0xf
ddb> ds                  0x10
es                  0x10
fs                  0x20        clean_idt
gs                     0
edi           0xd12905d0        end+0x6205d0
esi                    0
ebp           0xf3636dbc
--db_more--           ebx           0xd1290000        end+0x620000
edx                    0
ecx                0x340        clean_idt+0x320
eax                0x340        clean_idt+0x320
eip           0xd0455fd9        ieee80211_input_ba+0x1b9
cs                  0x50        clean_idt+0x30
eflags           0x10202        __ALIGN_SIZE+0xf202
esp           0xf3636d64
ss                  0x10
ieee80211_input_ba+0x1b9:       movl    0(%eax),%edx
ddb>
ddb>   help
machine     print       examine     x           search      set
write       w           delete      d           break       dwatch
watch       step        s           continue    c           until
next        match       trace       call        ps          callout
show        boot        help        hangman     dmesg
ddb> boot reboot
rebooting...
PC Engines ALIX.2 v0.99h
640 KB Base Memory
153603174448128645128089697280113664130048146432162816179200195584211968228352244736261120 KB Extended Memory

01F0 Master 044A CF 4GB                                  
Phys C/H/S 7785/16/63 Log C/H/S 973/128/63
Using drive 0, partition 3.
Loading......
probing: pc0 com0 com1 pci mem[640K 255M a20=on]
disk: hd0+
>> OpenBSD/i386 BOOT 3.31
|/-\|/-switching console to com0
>> OpenBSD/i386 BOOT 3.31
boot>
\|/-\|/booting hd0a:/bsd: -\|/-7607812\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\+2049028|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\|+173180/-\|/-\|/-\+0+1105920 [72+496864|/-\|/-\|/-\|/-\|/-\|/-\|/-\|/+495981-\|/-\|/-\|/-\|/-\|/-\|/-\|/-\]=0xb62834
entry point at 0x2000d4

[ using 993332 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2017 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.0-current (GENERIC) #136: Sat Jan 14 19:44:45 MST 2017
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Geode(TM) Integrated Processor by AMD PCS ("AuthenticAMD" 586-class) 499 MHz
cpu0: FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CFLUSH,MMX,MMXX,3DNOW2,3DNOW
real mem  = 267931648 (255MB)
avail mem = 250175488 (238MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 11/05/08, BIOS32 rev. 0 @ 0xfd088
pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000
pcibios0: pcibios_get_intr_routing - function not supported
pcibios0: PCI IRQ Routing information unavailable.
pcibios0: PCI bus #0 is the last bus
bios0: ROM list: 0xe0000/0xa800
cpu0 at mainbus0: (uniprocessor)
mtrr: K6-family MTRR support (2 registers)
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 1 function 0 "AMD Geode LX" rev 0x33
glxsb0 at pci0 dev 1 function 2 "AMD Geode LX Crypto" rev 0x00: RNG AES
vr0 at pci0 dev 9 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 10, address 00:0d:b9:2b:62:c8
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x004063, model 0x0034
vr1 at pci0 dev 10 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 11, address 00:0d:b9:2b:62:c9
ukphy1 at vr1 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x004063, model 0x0034
vr2 at pci0 dev 11 function 0 "VIA VT6105M RhineIII" rev 0x96: irq 15, address 00:0d:b9:2b:62:ca
ukphy2 at vr2 phy 1: Generic IEEE 802.3u media interface, rev. 3: OUI 0x004063, model 0x0034
athn0 at pci0 dev 12 function 0 "Atheros AR9280" rev 0x01: irq 9
athn0: AR9280 rev 2 (2T2R), ROM rev 21, address 30:14:4a:15:ba:bb
glxpcib0 at pci0 dev 15 function 0 "AMD CS5536 ISA" rev 0x03: rev 3, 32-bit 3579545Hz timer, watchdog, gpio, i2c
gpio0 at glxpcib0: 32 pins
iic0 at glxpcib0
maxtmp0 at iic0 addr 0x4c: lm86
pciide0 at pci0 dev 15 function 2 "AMD CS5536 IDE" rev 0x01: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <CF 4GB>
wd0: 1-sector PIO, LBA, 3831MB, 7847280 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 2
pciide0: channel 1 ignored (disabled)
ohci0 at pci0 dev 15 function 4 "AMD CS5536 USB" rev 0x02: irq 12, version 1.0, legacy support
ehci0 at pci0 dev 15 function 5 "AMD CS5536 USB" rev 0x02: irq 12
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "AMD EHCI root hub" rev 2.00/1.00 addr 1
isa0 at glxpcib0
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
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "AMD OHCI root hub" rev 1.00/1.00 addr 1
vmm at mainbus0 not configured
nvram: invalid checksum
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (9a03e090a85ec7ef.a) swap on wd0b dump on wd0b
WARNING: / was not properly unmounted
clock: unknown CMOS layout
Automatic boot in progress: starting file system checks.
/dev/wd0a (9a03e090a85ec7ef.a): UNREF FILE  I=5916  OWNER=root MODE=100555
/dev/wd0a: SIZE=296300 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0a (9a03e090a85ec7ef.a): NO lost+found DIRECTORY (CREATED)
/dev/wd0a (9a03e090a85ec7ef.a): UNREF FILE  I=5938  OWNER=root MODE=100555
/dev/wd0a: SIZE=431596 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0a (9a03e090a85ec7ef.a): UNREF FILE  I=7205  OWNER=root MODE=100555
/dev/wd0a: SIZE=211304 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0a (9a03e090a85ec7ef.a): UNREF FILE  I=17709  OWNER=root MODE=100555
/dev/wd0a: SIZE=448332 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0a (9a03e090a85ec7ef.a): FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/wd0a (9a03e090a85ec7ef.a): SUMMARY INFORMATION BAD (SALVAGED)
/dev/wd0a (9a03e090a85ec7ef.a): 1743 files, 24691 used, 66100 free (228 frags, 8234 blocks, 0.3% fragmentation)
/dev/wd0a (9a03e090a85ec7ef.a): MARKING FILE SYSTEM CLEAN
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=17  OWNER=root MODE=100555
/dev/wd0d: SIZE=657792 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): NO lost+found DIRECTORY (CREATED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=30  OWNER=root MODE=100555
/dev/wd0d: SIZE=42312 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=33  OWNER=root MODE=100555
/dev/wd0d: SIZE=125736 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=40  OWNER=root MODE=100555
/dev/wd0d: SIZE=25696 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=86  OWNER=root MODE=100555
/dev/wd0d: SIZE=466304 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=134  OWNER=root MODE=100555
/dev/wd0d: SIZE=464824 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=138  OWNER=root MODE=100555
/dev/wd0d: SIZE=747980 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=143  OWNER=root MODE=100555
/dev/wd0d: SIZE=75640 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=194  OWNER=root MODE=100555
/dev/wd0d: SIZE=83164 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=25989  OWNER=root MODE=100444
/dev/wd0d: SIZE=125461 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26013  OWNER=root MODE=100444
/dev/wd0d: SIZE=125555 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26014  OWNER=root MODE=100444
/dev/wd0d: SIZE=165456 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26096  OWNER=root MODE=100444
/dev/wd0d: SIZE=2849033 MTIME=Jan 15 11:49 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26099  OWNER=root MODE=100444
/dev/wd0d: SIZE=5524952 MTIME=Jan 15 02:38 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26103  OWNER=root MODE=100444
/dev/wd0d: SIZE=306431 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26114  OWNER=root MODE=100444
/dev/wd0d: SIZE=463396 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26117  OWNER=root MODE=100444
/dev/wd0d: SIZE=115099 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=26118  OWNER=root MODE=100444
/dev/wd0d: SIZE=1288609 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=52144  OWNER=root MODE=100555
/dev/wd0d: SIZE=80160 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=129950  OWNER=root MODE=100555
/dev/wd0d: SIZE=22968 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): UNREF FILE  I=129951  OWNER=root MODE=100444
/dev/wd0d: SIZE=190102 MTIME=Jan 15 02:39 2017  (RECONNECTED)
/dev/wd0d (9a03e090a85ec7ef.d): FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/wd0d (9a03e090a85ec7ef.d): SUMMARY INFORMATION BAD (SALVAGED)
/dev/wd0d (9a03e090a85ec7ef.d): 12116 files, 182491 used, 422540 free (2732 frags, 52476 blocks, 0.5% fragmentation)
/dev/wd0d (9a03e090a85ec7ef.d): MARKING FILE SYSTEM CLEAN
/dev/wd0e (9a03e090a85ec7ef.e): INCORRECT BLOCK COUNT I=26029 (4 should be 0) (CORRECTED)
/dev/wd0e (9a03e090a85ec7ef.e): ZERO LENGTH DIR I=26029  OWNER=root MODE=40755
/dev/wd0e: SIZE=0 MTIME=Jan 15 17:40 2017  (CLEARED)
/dev/wd0e (9a03e090a85ec7ef.e): FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED)
/dev/wd0e (9a03e090a85ec7ef.e): SUMMARY INFORMATION BAD (SALVAGED)
/dev/wd0e (9a03e090a85ec7ef.e): BLK(S) MISSING IN BIT MAPS (SALVAGED)
/dev/wd0e (9a03e090a85ec7ef.e): 686 files, 73701 used, 531330 free (482 frags, 66356 blocks, 0.1% fragmentation)
/dev/wd0e (9a03e090a85ec7ef.e): MARKING FILE SYSTEM CLEAN
mount_mfs: reduced number of fragments per cylinder group from 16880 to 16744 to enlarge last cylinder group
setting tty flags
pf enabled
net.inet.ip.forwarding: 0 -> 1
net.inet6.ip6.forwarding: 0 -> 1
starting network
reordering libraries: done.
starting early daemons: syslogd pflogd nsd unbound ntpd.
starting RPC daemons:.
savecore: no core dump
acpidump: Can't find ACPI information
checking quotas: done.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
starting network daemons: sshd dhcpd smtpd ftpproxy sndiod.
starting package daemons: pflogd1(failed).
starting local daemons: cron.
Sun Jan 15 23:06:28 CET 2017

OpenBSD/i386 (alix.symacx.com) (tty00)

login:

Script done on Mon Dec 26 11:57:53 2016



Thank you,
Best

--
Olivier Cherrier
Phone: +352691754777
mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Sun, Jan 15, 2017 at 10:31:29PM +0000, Olivier Cherrier wrote:

> On Mon, Jan 09, 2017 at 01:54:55PM +0100, [hidden email] wrote:
> > Date: Mon, 9 Jan 2017 13:54:55 +0100
> > From: Stefan Sperling <[hidden email]>
> > To: [hidden email]
> > Subject: 11n support for athn(4)
>
> Hi Stefan,
>
> Thank you for this extended work !
>
> I just tested today the latest snapshot on my Alix GW.
> After some time, I got this uvm_fault :

> ieee80211_input_ba(d13a2030,d5778a00,d1290000,0,f3636eb0) at ieee80211_input_ba
> +0x1b9
> ieee80211_input(d13a2030,d5778a00,d1290000,f3636eb0,1) at ieee80211_input+0x5b0
>
> ar5008_rx_intr(d13a2000,c0,d0bdb7cc,d57672d0,f3636f08) at ar5008_rx_intr+0x2f2
> ar5008_intr(d13a2000,d12b85c0) at ar5008_intr+0x235
> Xintr_legacy9() at Xintr_legacy9+0x85

Please try this diff:

Index: ieee80211_node.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_node.c,v
retrieving revision 1.111
diff -u -p -r1.111 ieee80211_node.c
--- ieee80211_node.c 9 Jan 2017 20:18:59 -0000 1.111
+++ ieee80211_node.c 15 Jan 2017 11:26:42 -0000
@@ -1638,6 +1638,7 @@ ieee80211_node_leave_ht(struct ieee80211
  int i;
 
  /* free all Block Ack records */
+ ieee80211_ba_del(ni);
  for (tid = 0; tid < IEEE80211_NUM_TID; tid++) {
  ba = &ni->ni_rx_ba[tid];
  if (ba->ba_buf != NULL) {

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Uwe Werler
In reply to this post by Stefan Sperling-5
Hello Stefan,

many many thanks for this work!

I tested today with the latest snapshot from yesterday and a custom compiled kernel
from today's sources. AP is my APU1D4 and Client is my ThinkPad T530 with iwn:

AP:

athn0 at pci4 dev 0 function 0 "Atheros AR9281" rev 0x01: apic 2 int 19
athn0: AR9280 rev 2 (2T2R), ROM rev 22, address 04:f0:21:17:40:ba

athn0: flags=8947 mtu 1500
        lladdr 04:f0:21:17:40:ba
        index 4 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (autoselect hostap)
        status: active
        ieee80211: nwid TEST chan 1 bssid 04:f0:21:17:40:ba wpakey XXX wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp

athn0: sending auth to 6c:88:14:36:27:b0 on channel 1 mode auto
athn0: station 6c:88:14:36:27:b0 newly authenticated (open)
athn0: sending assoc_resp to 6c:88:14:36:27:b0 on channel 1 mode auto
athn0: sending msg 1/4 of the 4-way handshake to 6c:88:14:36:27:b0
athn0: received auth from 6c:88:14:36:27:b0 rssi 34 mode auto
athn0: received assoc_req from 6c:88:14:36:27:b0 rssi 33 mode auto
athn0: sending msg 1/4 of the 4-way handshake to 6c:88:14:36:27:b0
athn0: received msg 2/4 of the 4-way handshake from 6c:88:14:36:27:b0
athn0: sending msg 3/4 of the 4-way handshake to 6c:88:14:36:27:b0
athn0: received msg 4/4 of the 4-way handshake from 6c:88:14:36:27:b0

Client:

iwn0 at pci2 dev 0 function 0 "Intel Centrino Advanced-N 6205" rev 0x34: msi, MIMO 2T2R, MoW, address 6c:88:14:36:27:b0

iwn0: end active scan
iwn0: sending auth to 04:f0:21:17:40:ba on channel 1 mode 11g
iwn0: sending assoc_req to 04:f0:21:17:40:ba on channel 1 mode 11g
iwn0: received auth from 04:f0:21:17:40:ba rssi -20 mode 11g
iwn0: associated with 04:f0:21:17:40:ba ssid "TEST" channel 1 start MCS 0 short preamble long slot time HT enabled
iwn0: received assoc_resp from 04:f0:21:17:40:ba rssi -21 mode 11g
iwn0: received msg 1/4 of the 4-way handshake from 04:f0:21:17:40:ba
iwn0: sending msg 2/4 of the 4-way handshake to 04:f0:21:17:40:ba
iwn0: received msg 3/4 of the 4-way handshake from 04:f0:21:17:40:ba
iwn0: sending msg 4/4 of the 4-way handshake to 04:f0:21:17:40:ba

iwn0: flags=208847 mtu 1500
        lladdr 6c:88:14:36:27:b0
        index 2 priority 4 llprio 3
        groups: wlan egress
        media: IEEE802.11 autoselect mode 11n (HT-MCS2 mode 11n)
        status: active
        ieee80211: nwid TEST chan 1 bssid 04:f0:21:17:40:ba -20dBm wpakey XXX wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp

Unfortunately the throughput is very low, only ~7 MBit. With mode 11g I get ~16 MBit.


zarathustra:~# tcpbench apu01
  elapsed_ms          bytes         mbps   bwidth
        1004         748272        5.962  100.00%
Conn:   1 Mbps:        5.962 Peak Mbps:        5.962 Avg Mbps:        5.962
        2007         839664        6.697  100.00%
Conn:   1 Mbps:        6.697 Peak Mbps:        6.697 Avg Mbps:        6.697
        3010         818244        6.533  100.00%
Conn:   1 Mbps:        6.533 Peak Mbps:        6.697 Avg Mbps:        6.533
        4013         909636        7.255  100.00%
Conn:   1 Mbps:        7.255 Peak Mbps:        7.255 Avg Mbps:        7.255
        5014         856800        6.848  100.00%
Conn:   1 Mbps:        6.848 Peak Mbps:        7.255 Avg Mbps:        6.848
        6015         868224        6.946  100.00%
Conn:   1 Mbps:        6.946 Peak Mbps:        7.255 Avg Mbps:        6.946
        7021         872508        6.945  100.00%
Conn:   1 Mbps:        6.945 Peak Mbps:        7.255 Avg Mbps:        6.945
        8023         835380        6.670  100.00%
Conn:   1 Mbps:        6.670 Peak Mbps:        7.255 Avg Mbps:        6.670
        9025         848232        6.779  100.00%
Conn:   1 Mbps:        6.779 Peak Mbps:        7.255 Avg Mbps:        6.779
       10028         843948        6.731  100.00%
Conn:   1 Mbps:        6.731 Peak Mbps:        7.255 Avg Mbps:        6.731
       11036         831096        6.596  100.00%
Conn:   1 Mbps:        6.596 Peak Mbps:        7.255 Avg Mbps:        6.596

I'm now ready to test furhter.

Many thanks again!


Regards Uwe



Am 09.01.2017 13:54:55, schrieb Stefan Sperling:

> This diff adds 11n support to the athn(4) driver.
> Requires -current net80211 code from today.
>
> Tested in hostap mode and client mode with:
> athn0 at pci1 dev 0 function 0 "Atheros AR9281" rev 0x01: apic 2 int 16
> athn0: AR9280 rev 2 (2T2R), ROM rev 22, adddress xx:xx:xx:xx:xx:xx
>
> And in client mode with:
> athn0 at uhub1 port 2 configuration 1 interface 0 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 2
> athn0: AR9271 rev 1 (1T1R), ROM rev 13, address xx:xx:xx:xx:xx:xx
>
> Hostap performance is not perfect yet but should be no worse than
> 11a/b/g modes in the same environment.
>
> For Linux clients a fix for WME params is needed which I also posted to tech@.
>
> This diff does not modify the known-broken and disabled ar9003 code,
> apart from making sure it still builds.
>
> I'm looking for both tests and OKs.
>
> Index: dev/cardbus/if_athn_cardbus.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/cardbus/if_athn_cardbus.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 if_athn_cardbus.c
> --- dev/cardbus/if_athn_cardbus.c 24 Nov 2015 17:11:39 -0000 1.14
> +++ dev/cardbus/if_athn_cardbus.c 8 Jan 2017 09:31:28 -0000
> @@ -43,6 +43,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/ar5008.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar5008.c,v
> retrieving revision 1.37
> diff -u -p -r1.37 ar5008.c
> --- dev/ic/ar5008.c 29 Nov 2016 10:22:30 -0000 1.37
> +++ dev/ic/ar5008.c 9 Jan 2017 10:14:41 -0000
> @@ -51,6 +51,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> @@ -217,7 +218,7 @@ ar5008_attach(struct athn_softc *sc)
>   sc->flags |= ATHN_FLAG_11A;
>   if (base->opCapFlags & AR_OPFLAGS_11G)
>   sc->flags |= ATHN_FLAG_11G;
> - if (base->opCapFlags & AR_OPFLAGS_11N)
> + if ((base->opCapFlags & AR_OPFLAGS_11N_DISABLED) == 0)
>   sc->flags |= ATHN_FLAG_11N;
>  
>   IEEE80211_ADDR_COPY(ic->ic_myaddr, base->macAddr);
> @@ -952,9 +953,11 @@ ar5008_tx_process(struct athn_softc *sc,
>   struct ifnet *ifp = &ic->ic_if;
>   struct athn_txq *txq = &sc->txq[qid];
>   struct athn_node *an;
> + struct ieee80211_node *ni;
>   struct athn_tx_buf *bf;
>   struct ar_tx_desc *ds;
>   uint8_t failcnt;
> + int txfail;
>  
>   bf = SIMPLEQ_FIRST(&txq->head);
>   if (bf == NULL)
> @@ -970,13 +973,16 @@ ar5008_tx_process(struct athn_softc *sc,
>  
>   sc->sc_tx_timer = 0;
>  
> - if (ds->ds_status1 & AR_TXS1_EXCESSIVE_RETRIES)
> + txfail = (ds->ds_status1 & AR_TXS1_EXCESSIVE_RETRIES);
> + if (txfail)
>   ifp->if_oerrors++;
>  
>   if (ds->ds_status1 & AR_TXS1_UNDERRUN)
>   athn_inc_tx_trigger_level(sc);
>  
>   an = (struct athn_node *)bf->bf_ni;
> + ni = (struct ieee80211_node *)bf->bf_ni;
> +
>   /*
>   * NB: the data fail count contains the number of un-acked tries
>   * for the final series used.  We must add the number of tries for
> @@ -987,10 +993,27 @@ ar5008_tx_process(struct athn_softc *sc,
>   failcnt += MS(ds->ds_status9, AR_TXS9_FINAL_IDX) * 2;
>  
>   /* Update rate control statistics. */
> - an->amn.amn_txcnt++;
> - if (failcnt > 0)
> - an->amn.amn_retrycnt++;
> -
> + if (ni->ni_flags & IEEE80211_NODE_HT) {
> + an->mn.frames++;
> + an->mn.ampdu_size = bf->bf_m->m_pkthdr.len + IEEE80211_CRC_LEN;
> + an->mn.agglen = 1; /* XXX We do not yet support Tx agg. */
> + if (failcnt > 0)
> + an->mn.retries++;
> + if (txfail)
> + an->mn.txfail++;
> + if ((ic->ic_opmode == IEEE80211_M_STA &&
> +    ic->ic_state == IEEE80211_S_RUN)
> +#ifndef IEEE80211_STA_ONLY
> +    || (ic->ic_opmode == IEEE80211_M_HOSTAP &&
> +    ni->ni_state == IEEE80211_STA_ASSOC)
> +#endif
> +    )
> + ieee80211_mira_choose(&an->mn, ic, ni);
> + } else {
> + an->amn.amn_txcnt++;
> + if (failcnt > 0)
> + an->amn.amn_retrycnt++;
> + }
>   DPRINTFN(5, ("Tx done qid=%d status1=%d fail count=%d\n",
>      qid, ds->ds_status1, failcnt));
>  
> @@ -1110,7 +1133,7 @@ ar5008_swba_intr(struct athn_softc *sc)
>   ds->ds_ctl2 = SM(AR_TXC2_XMIT_DATA_TRIES0, 1);
>  
>   /* Write Tx rate. */
> - ridx = (ic->ic_curmode == IEEE80211_MODE_11A) ?
> + ridx = IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) ?
>      ATHN_RIDX_OFDM6 : ATHN_RIDX_CCK1;
>   hwrate = athn_rates[ridx].hwrate;
>   ds->ds_ctl3 = SM(AR_TXC3_XMIT_RATE0, hwrate);
> @@ -1315,15 +1338,25 @@ ar5008_tx(struct athn_softc *sc, struct
>      IEEE80211_FC0_TYPE_DATA) {
>   /* Use lowest rate for all tries. */
>   ridx[0] = ridx[1] = ridx[2] = ridx[3] =
> -    (ic->ic_curmode == IEEE80211_MODE_11A) ?
> - ATHN_RIDX_OFDM6 : ATHN_RIDX_CCK1;
> +    (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) ?
> + ATHN_RIDX_OFDM6 : ATHN_RIDX_CCK1);
> + } else if ((ni->ni_flags & IEEE80211_NODE_HT) &&
> +    ic->ic_fixed_mcs != -1) {
> + /* Use same fixed rate for all tries. */
> + ridx[0] = ridx[1] = ridx[2] = ridx[3] =
> +    ATHN_RIDX_MCS0 + ic->ic_fixed_mcs;
>   } else if (ic->ic_fixed_rate != -1) {
>   /* Use same fixed rate for all tries. */
>   ridx[0] = ridx[1] = ridx[2] = ridx[3] =
>      sc->fixed_ridx;
>   } else {
> - int txrate = ni->ni_txrate;
>   /* Use fallback table of the node. */
> + int txrate;
> +
> + if (ni->ni_flags & IEEE80211_NODE_HT)
> + txrate = ATHN_NUM_LEGACY_RATES + ni->ni_txmcs;
> + else
> + txrate = ni->ni_txrate;
>   for (i = 0; i   ridx[i] = an->ridx[txrate];
>   txrate = an->fallback[txrate];
> @@ -1337,7 +1370,10 @@ ar5008_tx(struct athn_softc *sc, struct
>  
>   tap->wt_flags = 0;
>   /* Use initial transmit rate. */
> - tap->wt_rate = athn_rates[ridx[0]].rate;
> + if (athn_rates[ridx[0]].hwrate & 0x80) /* MCS */
> + tap->wt_rate = athn_rates[ridx[0]].hwrate;
> + else
> + tap->wt_rate = athn_rates[ridx[0]].rate;
>   tap->wt_chan_freq = htole16(ic->ic_bss->ni_chan->ic_freq);
>   tap->wt_chan_flags = htole16(ic->ic_bss->ni_chan->ic_flags);
>   tap->wt_hwqueue = qid;
> @@ -1455,11 +1491,16 @@ ar5008_tx(struct athn_softc *sc, struct
>  
>   /* Check if frame must be protected using RTS/CTS or CTS-to-self. */
>   if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
> + enum ieee80211_htprot htprot;
> +
> + htprot = (ic->ic_bss->ni_htop1 & IEEE80211_HTOP1_PROT_MASK);
>   /* NB: Group frames are sent using CCK in 802.11b/g. */
>   if (totlen > ic->ic_rtsthreshold) {
>   ds->ds_ctl0 |= AR_TXC0_RTS_ENABLE;
> - } else if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
> -    athn_rates[ridx[0]].phy == IEEE80211_T_OFDM) {
> + } else if (((ic->ic_flags & IEEE80211_F_USEPROT) &&
> +    athn_rates[ridx[0]].phy == IEEE80211_T_OFDM) ||
> +    ((ic->ic_flags & IEEE80211_F_HTON) &&
> +    htprot != IEEE80211_HTPROT_NONE)) {
>   if (ic->ic_protmode == IEEE80211_PROT_RTSCTS)
>   ds->ds_ctl0 |= AR_TXC0_RTS_ENABLE;
>   else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY)
> @@ -1523,9 +1564,10 @@ ar5008_tx(struct athn_softc *sc, struct
>      SM(AR_TXC7_CHAIN_SEL1, sc->txchainmask) |
>      SM(AR_TXC7_CHAIN_SEL2, sc->txchainmask) |
>      SM(AR_TXC7_CHAIN_SEL3, sc->txchainmask);
> +
>  #ifdef notyet
>   /* Use the same short GI setting for all tries. */
> - if (ic->ic_flags & IEEE80211_F_SHGI)
> + if (ni->ni_htcaps & IEEE80211_HTCAP_SGI20)
>   ds->ds_ctl7 |= AR_TXC7_GI0123;
>   /* Use the same channel width for all tries. */
>   if (ic->ic_flags & IEEE80211_F_CBW40)
> @@ -1542,7 +1584,7 @@ ar5008_tx(struct athn_softc *sc, struct
>   ds->ds_ctl5 |= AR_TXC5_RTSCTS_QUAL23;
>   }
>   /* Select protection rate (suboptimal but ok). */
> - protridx = (ic->ic_curmode == IEEE80211_MODE_11A) ?
> + protridx = IEEE80211_IS_CHAN_5GHZ(ni->ni_chan) ?
>      ATHN_RIDX_OFDM6 : ATHN_RIDX_CCK2;
>   if (ds->ds_ctl0 & AR_TXC0_RTS_ENABLE) {
>   /* Account for CTS duration. */
> Index: dev/ic/ar5008reg.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar5008reg.h,v
> retrieving revision 1.3
> diff -u -p -r1.3 ar5008reg.h
> --- dev/ic/ar5008reg.h 31 Dec 2010 17:50:48 -0000 1.3
> +++ dev/ic/ar5008reg.h 8 Jan 2017 15:08:19 -0000
> @@ -950,12 +950,13 @@ struct ar_base_eep_header {
>   uint8_t opCapFlags;
>  #define AR_OPFLAGS_11A 0x01
>  #define AR_OPFLAGS_11G 0x02
> +/* NB: If set, 11n is _disabled_ in the corresponding mode: */
>  #define AR_OPFLAGS_11N_5G40 0x04
>  #define AR_OPFLAGS_11N_2G40 0x08
>  #define AR_OPFLAGS_11N_5G20 0x10
>  #define AR_OPFLAGS_11N_2G20 0x20
> -/* Shortcut. */
> -#define AR_OPFLAGS_11N 0x3c
> +/* Shortcut for "all of 11n is disabled". */
> +#define AR_OPFLAGS_11N_DISABLED 0x3c
>  
>   uint8_t eepMisc;
>   uint16_t regDmn[2];
> Index: dev/ic/ar5416.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar5416.c,v
> retrieving revision 1.19
> diff -u -p -r1.19 ar5416.c
> --- dev/ic/ar5416.c 5 Jan 2016 18:41:15 -0000 1.19
> +++ dev/ic/ar5416.c 8 Jan 2017 09:29:59 -0000
> @@ -51,6 +51,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/ar9003.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar9003.c,v
> retrieving revision 1.41
> diff -u -p -r1.41 ar9003.c
> --- dev/ic/ar9003.c 29 Nov 2016 10:22:30 -0000 1.41
> +++ dev/ic/ar9003.c 8 Jan 2017 09:30:50 -0000
> @@ -51,6 +51,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/ar9280.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar9280.c,v
> retrieving revision 1.25
> diff -u -p -r1.25 ar9280.c
> --- dev/ic/ar9280.c 5 Jan 2016 18:41:15 -0000 1.25
> +++ dev/ic/ar9280.c 8 Jan 2017 09:30:11 -0000
> @@ -51,6 +51,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/ar9285.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar9285.c,v
> retrieving revision 1.26
> diff -u -p -r1.26 ar9285.c
> --- dev/ic/ar9285.c 5 Jan 2016 18:41:15 -0000 1.26
> +++ dev/ic/ar9285.c 8 Jan 2017 09:30:24 -0000
> @@ -52,6 +52,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/ar9287.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar9287.c,v
> retrieving revision 1.24
> diff -u -p -r1.24 ar9287.c
> --- dev/ic/ar9287.c 5 Jan 2016 18:41:15 -0000 1.24
> +++ dev/ic/ar9287.c 8 Jan 2017 09:30:37 -0000
> @@ -51,6 +51,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/ar9380.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/ar9380.c,v
> retrieving revision 1.24
> diff -u -p -r1.24 ar9380.c
> --- dev/ic/ar9380.c 5 Jan 2016 18:41:15 -0000 1.24
> +++ dev/ic/ar9380.c 8 Jan 2017 15:10:10 -0000
> @@ -49,6 +49,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/ic/athn.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/athn.c,v
> retrieving revision 1.93
> diff -u -p -r1.93 athn.c
> --- dev/ic/athn.c 13 Apr 2016 10:49:26 -0000 1.93
> +++ dev/ic/athn.c 9 Jan 2017 10:01:20 -0000
> @@ -53,6 +53,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> @@ -93,7 +94,7 @@ int athn_set_key(struct ieee80211com *,
>      struct ieee80211_key *);
>  void athn_delete_key(struct ieee80211com *, struct ieee80211_node *,
>      struct ieee80211_key *);
> -void athn_iter_func(void *, struct ieee80211_node *);
> +void athn_iter_calib(void *, struct ieee80211_node *);
>  void athn_calib_to(void *);
>  int athn_init_calib(struct athn_softc *,
>      struct ieee80211_channel *, struct ieee80211_channel *);
> @@ -120,10 +121,12 @@ void athn_init_qos(struct athn_softc *)
>  int athn_hw_reset(struct athn_softc *, struct ieee80211_channel *,
>      struct ieee80211_channel *, int);
>  struct ieee80211_node *athn_node_alloc(struct ieee80211com *);
> +void athn_node_free(struct ieee80211com *, struct ieee80211_node *);
>  void athn_newassoc(struct ieee80211com *, struct ieee80211_node *,
>      int);
>  int athn_media_change(struct ifnet *);
>  void athn_next_scan(void *);
> +void athn_iter_newstate(void *, struct ieee80211_node *);
>  int athn_newstate(struct ieee80211com *, enum ieee80211_state,
>      int);
>  void athn_updateedca(struct ieee80211com *);
> @@ -289,11 +292,15 @@ athn_attach(struct athn_softc *sc)
>   int i, ntxstreams, nrxstreams;
>  
>   /* Set HT capabilities. */
> - ic->ic_htcaps =
> -    IEEE80211_HTCAP_SMPS_DIS |
> -    IEEE80211_HTCAP_CBW20_40 |
> + ic->ic_htcaps = (IEEE80211_HTCAP_SMPS_DIS  +    IEEE80211_HTCAP_SMPS_SHIFT);
> +#ifdef notyet
> + ic->ic_htcaps |= IEEE80211_HTCAP_CBW20_40 |
>      IEEE80211_HTCAP_SGI40 |
>      IEEE80211_HTCAP_DSSSCCK40;
> +#endif
> + ic->ic_htxcaps = 0;
> +#ifdef notyet
>   if (AR_SREV_9271(sc) || AR_SREV_9287_10_OR_LATER(sc))
>   ic->ic_htcaps |= IEEE80211_HTCAP_SGI20;
>   if (AR_SREV_9380_10_OR_LATER(sc))
> @@ -302,6 +309,7 @@ athn_attach(struct athn_softc *sc)
>   ic->ic_htcaps |= IEEE80211_HTCAP_TXSTBC;
>   ic->ic_htcaps |= 1   }
> +#endif
>   ntxstreams = sc->ntxchains;
>   nrxstreams = sc->nrxchains;
>   if (!AR_SREV_9380_10_OR_LATER(sc)) {
> @@ -316,6 +324,11 @@ athn_attach(struct athn_softc *sc)
>   ic->ic_tx_mcs_set |= IEEE80211_TX_RX_MCS_NOT_EQUAL;
>   ic->ic_tx_mcs_set |= (ntxstreams - 1)   }
> +
> + DPRINTF(("%s: htcaps=0x%x, MCS 0x%x%x%x%x\n",
> +    sc->sc_dev.dv_xname, ic->ic_htcaps,
> +    ic->ic_sup_mcs[0], ic->ic_sup_mcs[1],
> +    ic->ic_sup_mcs[2], ic->ic_sup_mcs[3]));
>   }
>  
>   /* Set supported rates. */
> @@ -346,6 +359,8 @@ athn_attach(struct athn_softc *sc)
>   if_attach(ifp);
>   ieee80211_ifattach(ifp);
>   ic->ic_node_alloc = athn_node_alloc;
> + sc->sc_node_free = ic->ic_node_free;
> + ic->ic_node_free = athn_node_free;
>   ic->ic_newassoc = athn_newassoc;
>   ic->ic_updateslot = athn_updateslot;
>   ic->ic_updateedca = athn_updateedca;
> @@ -425,6 +440,9 @@ athn_get_chanlist(struct athn_softc *sc)
>   ic->ic_channels[chan].ic_flags =
>      IEEE80211_CHAN_CCK | IEEE80211_CHAN_OFDM |
>      IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ;
> + if (sc->flags & ATHN_FLAG_11N)
> + ic->ic_channels[chan].ic_flags |=
> +    IEEE80211_CHAN_HT;
>   }
>   }
>   if (sc->flags & ATHN_FLAG_11A) {
> @@ -433,6 +451,9 @@ athn_get_chanlist(struct athn_softc *sc)
>   ic->ic_channels[chan].ic_freq =
>      ieee80211_ieee2mhz(chan, IEEE80211_CHAN_5GHZ);
>   ic->ic_channels[chan].ic_flags = IEEE80211_CHAN_A;
> + if (sc->flags & ATHN_FLAG_11N)
> + ic->ic_channels[chan].ic_flags |=
> +    IEEE80211_CHAN_HT;
>   }
>   }
>  }
> @@ -1206,12 +1227,13 @@ athn_btcoex_disable(struct athn_softc *s
>  #endif
>  
>  void
> -athn_iter_func(void *arg, struct ieee80211_node *ni)
> +athn_iter_calib(void *arg, struct ieee80211_node *ni)
>  {
>   struct athn_softc *sc = arg;
>   struct athn_node *an = (struct athn_node *)ni;
>  
> - ieee80211_amrr_choose(&sc->amrr, ni, &an->amn);
> + if ((ni->ni_flags & IEEE80211_NODE_HT) == 0)
> + ieee80211_amrr_choose(&sc->amrr, ni, &an->amn);
>  }
>  
>  void
> @@ -1251,9 +1273,9 @@ athn_calib_to(void *arg)
>  #endif
>   if (ic->ic_fixed_rate == -1) {
>   if (ic->ic_opmode == IEEE80211_M_STA)
> - athn_iter_func(sc, ic->ic_bss);
> + athn_iter_calib(sc, ic->ic_bss);
>   else
> - ieee80211_iterate_nodes(ic, athn_iter_func, sc);
> + ieee80211_iterate_nodes(ic, athn_iter_calib, sc);
>   }
>   timeout_add_msec(&sc->calib_to, 500);
>   splx(s);
> @@ -1377,7 +1399,7 @@ athn_ani_ofdm_err_trigger(struct athn_so
>   ani->firstep_level++;
>   ops->set_firstep_level(sc, ani->firstep_level);
>   }
> - } else if (sc->sc_ic.ic_curmode != IEEE80211_MODE_11A) {
> + } else if (IEEE80211_IS_CHAN_2GHZ(sc->sc_ic.ic_bss->ni_chan)) {
>   /*
>   * Beacon RSSI is low, if in b/g mode, turn off OFDM weak
>   * signal detection and zero first step level to maximize
> @@ -1427,7 +1449,7 @@ athn_ani_cck_err_trigger(struct athn_sof
>   ani->firstep_level++;
>   ops->set_firstep_level(sc, ani->firstep_level);
>   }
> - } else if (sc->sc_ic.ic_curmode != IEEE80211_MODE_11A) {
> + } else if (IEEE80211_IS_CHAN_2GHZ(sc->sc_ic.ic_bss->ni_chan)) {
>   /*
>   * Beacon RSSI is low, zero first step level to maximize
>   * CCK sensitivity.
> @@ -1790,11 +1812,17 @@ athn_stop_tx_dma(struct athn_softc *sc,
>  int
>  athn_txtime(struct athn_softc *sc, int len, int ridx, u_int flags)
>  {
> + struct ieee80211com *ic = &sc->sc_ic;
>  #define divround(a, b) (((a) + (b) - 1) / (b))
>   int txtime;
>  
> - /* XXX HT. */
> - if (athn_rates[ridx].phy == IEEE80211_T_OFDM) {
> + if (athn_rates[ridx].hwrate & 0x80) { /* MCS */
> + /* Assumes a 20MHz channel, HT-mixed frame format, no STBC. */
> + txtime = 8 + 8 + 4 + 4 + 4 * 4 + 8 /* HT PLCP */
> +    + 4 * ((8 * len + 16 + 6) / (athn_rates[ridx].rate * 2));
> + if (IEEE80211_IS_CHAN_2GHZ(ic->ic_bss->ni_chan))
> + txtime += 6; /* aSignalExtension */
> + } else if (athn_rates[ridx].phy == IEEE80211_T_OFDM) {
>   txtime = divround(8 + 4 * len + 3, athn_rates[ridx].rate);
>   /* SIFS is 10us for 11g but Signal Extension adds 6us. */
>   txtime = 16 + 4 + 4 * txtime + 16;
> @@ -2310,6 +2338,19 @@ athn_node_alloc(struct ieee80211com *ic)
>  }
>  
>  void
> +athn_node_free(struct ieee80211com *ic, struct ieee80211_node *ni)
> +{
> + struct athn_softc *sc = ic->ic_softc;
> + struct athn_node *an = (void *)ni;
> +
> + if ((ni->ni_flags & IEEE80211_NODE_HT) &&
> +    ic->ic_state == IEEE80211_S_RUN)
> + ieee80211_mira_node_destroy(&an->mn);
> +
> + sc->sc_node_free(ic, ni);
> +}
> +
> +void
>  athn_newassoc(struct ieee80211com *ic, struct ieee80211_node *ni, int isnew)
>  {
>   struct athn_softc *sc = ic->ic_softc;
> @@ -2318,7 +2359,11 @@ athn_newassoc(struct ieee80211com *ic, s
>   uint8_t rate;
>   int ridx, i, j;
>  
> - ieee80211_amrr_node_init(&sc->amrr, &an->amn);
> + if (ni->ni_flags & IEEE80211_NODE_HT)
> + ieee80211_mira_node_init(&an->mn);
> + else
> + ieee80211_amrr_node_init(&sc->amrr, &an->amn);
> +
>   /* Start at lowest available bit-rate, AMRR will raise. */
>   ni->ni_txrate = 0;
>  
> @@ -2343,6 +2388,35 @@ athn_newassoc(struct ieee80211com *ic, s
>   }
>   DPRINTFN(2, ("%d fallbacks to %d\n", i, an->fallback[i]));
>   }
> +
> + /* In 11n mode, start at lowest available bit-rate, MiRA will raise. */
> + ni->ni_txmcs = 0;
> +
> + for (i = 0; i  + /* Map MCS index to HW rate index. */
> + ridx = ATHN_NUM_LEGACY_RATES + i;
> + an->ridx[ridx] = ATHN_RIDX_MCS0 + i;
> +
> + DPRINTFN(2, ("mcs %d index %d ", i, ridx));
> + /* Compute fallback rate for retries. */
> + if (i == 0 || i == 8) {
> + /* MCS 0 and 8 fall back to the lowest legacy rate. */
> + if (IEEE80211_IS_CHAN_5GHZ(ni->ni_chan))
> + an->fallback[ridx] = ATHN_RIDX_OFDM6;
> + else
> + an->fallback[ridx] = ATHN_RIDX_CCK1;
> + } else {
> + /* Other MCS fall back to next supported lower MCS. */
> + an->fallback[ridx] = ATHN_NUM_LEGACY_RATES + i;
> + for (j = i - 1; j >= 0; j--) {
> + if (!isset(ni->ni_rxmcs, j))
> + continue;
> + an->fallback[ridx] = ATHN_NUM_LEGACY_RATES + j;
> + break;
> + }
> + }
> + DPRINTFN(2, (" fallback to %d\n", an->fallback[ridx]));
> + }
>  }
>  
>  int
> @@ -2387,6 +2461,19 @@ athn_next_scan(void *arg)
>   splx(s);
>  }
>  
> +void
> +athn_iter_newstate(void *arg, struct ieee80211_node *ni)
> +{
> + struct athn_softc *sc = arg;
> + struct ieee80211com *ic = &sc->sc_ic;
> + struct athn_node *an = (struct athn_node *)ni;
> +
> + /* Destroy MiRA node when hopping out of RUN state. */
> + if ((ni->ni_flags & IEEE80211_NODE_HT) &&
> +    ic->ic_state == IEEE80211_S_RUN)
> + ieee80211_mira_node_destroy(&an->mn);
> +}
> +
>  int
>  athn_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg)
>  {
> @@ -2397,6 +2484,11 @@ athn_newstate(struct ieee80211com *ic, e
>  
>   timeout_del(&sc->calib_to);
>  
> + if (ic->ic_opmode == IEEE80211_M_STA)
> + athn_iter_newstate(sc, ic->ic_bss);
> + else
> + ieee80211_iterate_nodes(ic, athn_iter_newstate, sc);
> +
>   switch (nstate) {
>   case IEEE80211_S_INIT:
>   athn_set_led(sc, 0);
> @@ -2497,7 +2589,7 @@ athn_clock_rate(struct athn_softc *sc)
>   struct ieee80211com *ic = &sc->sc_ic;
>   int clockrate; /* MHz. */
>  
> - if (ic->ic_curmode == IEEE80211_MODE_11A) {
> + if (IEEE80211_IS_CHAN_5GHZ(ic->ic_bss->ni_chan)) {
>   if (sc->flags & ATHN_FLAG_FAST_PLL_CLOCK)
>   clockrate = AR_CLOCK_RATE_FAST_5GHZ_OFDM;
>   else
> Index: dev/ic/athnvar.h
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/athnvar.h,v
> retrieving revision 1.36
> diff -u -p -r1.36 athnvar.h
> --- dev/ic/athnvar.h 5 Jan 2016 18:41:15 -0000 1.36
> +++ dev/ic/athnvar.h 8 Jan 2017 22:41:47 -0000
> @@ -120,14 +120,18 @@ struct athn_rxq {
>  #define ATHN_RIDX_CCK2 1
>  #define ATHN_RIDX_OFDM6 4
>  #define ATHN_RIDX_MCS0 12
> +#define ATHN_RIDX_MCS8 (ATHN_RIDX_MCS0 + 8)
>  #define ATHN_RIDX_MCS15 27
>  #define ATHN_RIDX_MAX 27
> +#define ATHN_MCS_MAX 15
> +#define ATHN_NUM_MCS (ATHN_MCS_MAX + 1)
>  #define ATHN_IS_HT_RIDX(ridx) ((ridx) >= ATHN_RIDX_MCS0)
> +#define ATHN_IS_MIMO_RIDX(ridx) ((ridx) >= ATHN_RIDX_MCS8)
>  
>  static const struct athn_rate {
> - uint8_t rate; /* Rate in 500Kbps unit or MCS if 0x80. */
> - uint8_t hwrate; /* HW representation. */
> - uint8_t rspridx; /* Control Response Frame rate index. */
> + uint16_t rate; /* Rate in 500Kbps unit. */
> + uint8_t hwrate; /* HW representation. */
> + uint8_t rspridx; /* Control Response Frame rate index. */
>   enum ieee80211_phytype phy;
>  } athn_rates[] = {
>   {    2, 0x1b, 0, IEEE80211_T_DS },
> @@ -142,22 +146,22 @@ static const struct athn_rate {
>   {   72, 0x0d, 8, IEEE80211_T_OFDM },
>   {   96, 0x08, 8, IEEE80211_T_OFDM },
>   {  108, 0x0c, 8, IEEE80211_T_OFDM },
> - { 0x80, 0x80, 8, IEEE80211_T_OFDM },
> - { 0x81, 0x81, 8, IEEE80211_T_OFDM },
> - { 0x82, 0x82, 8, IEEE80211_T_OFDM },
> - { 0x83, 0x83, 8, IEEE80211_T_OFDM },
> - { 0x84, 0x84, 8, IEEE80211_T_OFDM },
> - { 0x85, 0x85, 8, IEEE80211_T_OFDM },
> - { 0x86, 0x86, 8, IEEE80211_T_OFDM },
> - { 0x87, 0x87, 8, IEEE80211_T_OFDM },
> - { 0x88, 0x88, 8, IEEE80211_T_OFDM },
> - { 0x89, 0x89, 8, IEEE80211_T_OFDM },
> - { 0x8a, 0x8a, 8, IEEE80211_T_OFDM },
> - { 0x8b, 0x8b, 8, IEEE80211_T_OFDM },
> - { 0x8c, 0x8c, 8, IEEE80211_T_OFDM },
> - { 0x8d, 0x8d, 8, IEEE80211_T_OFDM },
> - { 0x8e, 0x8e, 8, IEEE80211_T_OFDM },
> - { 0x8f, 0x8f, 8, IEEE80211_T_OFDM }
> + {   13, 0x80, 4, IEEE80211_T_OFDM },
> + {   26, 0x81, 6, IEEE80211_T_OFDM },
> + {   39, 0x82, 6, IEEE80211_T_OFDM },
> + {   52, 0x83, 8, IEEE80211_T_OFDM },
> + {   78, 0x84, 8, IEEE80211_T_OFDM },
> + {  104, 0x85, 8, IEEE80211_T_OFDM },
> + {  117, 0x86, 8, IEEE80211_T_OFDM },
> + {  130, 0x87, 8, IEEE80211_T_OFDM },
> + {   26, 0x88, 4, IEEE80211_T_OFDM },
> + {   52, 0x89, 6, IEEE80211_T_OFDM },
> + {   78, 0x8a, 8, IEEE80211_T_OFDM },
> + {  104, 0x8b, 8, IEEE80211_T_OFDM },
> + {  156, 0x8c, 8, IEEE80211_T_OFDM },
> + {  208, 0x8d, 8, IEEE80211_T_OFDM },
> + {  234, 0x8e, 8, IEEE80211_T_OFDM },
> + {  260, 0x8f, 8, IEEE80211_T_OFDM }
>  };
>  
>  struct athn_series {
> @@ -288,11 +292,14 @@ static const uint16_t ar_mcs_ndbps[][2]
>  #define ATHN_POWER_OFDM_EXT 67
>  #define ATHN_POWER_COUNT 68
>  
> +#define ATHN_NUM_LEGACY_RATES IEEE80211_RATE_MAXSIZE
> +#define ATHN_NUM_RATES (ATHN_NUM_LEGACY_RATES + ATHN_NUM_MCS)
>  struct athn_node {
>   struct ieee80211_node ni;
>   struct ieee80211_amrr_node amn;
> - uint8_t ridx[IEEE80211_RATE_MAXSIZE];
> - uint8_t fallback[IEEE80211_RATE_MAXSIZE];
> + struct ieee80211_mira_node mn;
> + uint8_t ridx[ATHN_NUM_RATES];
> + uint8_t fallback[ATHN_NUM_RATES];
>   uint8_t sta_index;
>  };
>  
> @@ -429,6 +436,8 @@ struct athn_softc {
>  
>   int (*sc_newstate)(struct ieee80211com *,
>      enum ieee80211_state, int);
> + void (*sc_node_free)(struct ieee80211com *,
> +    struct ieee80211_node *);
>  
>   bus_dma_tag_t sc_dmat;
>  
> Index: dev/pci/if_athn_pci.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/if_athn_pci.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 if_athn_pci.c
> --- dev/pci/if_athn_pci.c 24 Nov 2015 17:11:39 -0000 1.18
> +++ dev/pci/if_athn_pci.c 8 Jan 2017 09:31:15 -0000
> @@ -43,6 +43,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> Index: dev/usb/if_athn_usb.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/if_athn_usb.c,v
> retrieving revision 1.43
> diff -u -p -r1.43 if_athn_usb.c
> --- dev/usb/if_athn_usb.c 29 Nov 2016 10:22:30 -0000 1.43
> +++ dev/usb/if_athn_usb.c 9 Jan 2017 10:57:15 -0000
> @@ -48,6 +48,7 @@
>  
>  #include
>  #include
> +#include
>  #include
>  
>  #include
> @@ -1132,7 +1133,7 @@ athn_usb_newassoc_cb(struct athn_usb_sof
>  
>   s = splnet();
>   /* NB: Node may have left before we got scheduled. */
> - if (ni->ni_associd != 0)
> + if (ni->ni_associd != 0 && ni->ni_state == IEEE80211_STA_ASSOC)
>   (void)athn_usb_create_node(usc, ni);
>   ieee80211_release_node(ic, ni);
>   splx(s);
> @@ -1224,7 +1225,7 @@ athn_usb_create_node(struct athn_usb_sof
>   struct athn_node *an = (struct athn_node *)ni;
>   struct ar_htc_target_sta sta;
>   struct ar_htc_target_rate rate;
> - int error;
> + int error, i, j;
>  
>   /* Firmware cannot handle more than 8 STAs. */
>   if (usc->nnodes > AR_USB_MAX_STA)
> @@ -1257,8 +1258,16 @@ athn_usb_create_node(struct athn_usb_sof
>      ni->ni_rates.rs_nrates);
>   if (ni->ni_flags & IEEE80211_NODE_HT) {
>   rate.capflags |= htobe32(AR_RC_HT_FLAG);
> + /* Setup HT rates. */
> + for (i = 0, j = 0; i  + if (!isset(ni->ni_rxmcs, i))
> + continue;
> + if (j >= AR_HTC_RATE_MAX)
> + break;
> + rate.ht_rates.rs_rates[j++] = i;
> + }
> + rate.ht_rates.rs_nrates = j;
>  #ifdef notyet
> - /* XXX setup HT rates */
>   if (ni->ni_htcaps & IEEE80211_HTCAP_CBW20_40)
>   rate.capflags |= htobe32(AR_RC_40_FLAG);
>   if (ni->ni_htcaps & IEEE80211_HTCAP_SGI40)
>
>

--
Sent with love from the Tine 2.0 email client ...
Please visit http://www.tine20.com

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5
In reply to this post by Stefan Sperling-5
I'm still having issues with this.

When the access point wedges, it seems to affect my Android phone more
than the iwn laptop. ifconfig athn0 down up does resolve the problem
in the short term.

I see the changes have already been committed, so it's no longer
necessary to patch recent snapshots (running 14th, #133).

ifconfig athn0 media produces

athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr x:x:x:x
        description: 802.11b/g wireless
        index 1 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (autoselect mode 11n hostap)
        status: active
        ieee80211: nwid myAP chan 9 bssid x:x:x:x wpakey 0xdeadbeef
wpaprotos wpa2 wpaakms psk paciphers ccmp wpagroupcipher ccmp
        supported media:
                media autoselect
                media autoselect mediaopt hostap
                media autoselect mediaopt monitor
                media autoselect mode 11b
                media autoselect mode 11b mediaopt hostap
                media autoselect mode 11b mediaopt monitor
                media autoselect mode 11g
                media autoselect mode 11g mediaopt hostap
                media autoselect mode 11g mediaopt monitor
                media autoselect mode 11n
                media autoselect mode 11n mediaopt hostap
                media autoselect mode 11n mediaopt monitor
        inet 1.1.1.1 netmask 0xffffff00 broadcast 1.1.1.255

I can possibly try switching developer options on one of the Android
phones I have lying around.


On 14 January 2017 at 12:53, Stefan Sperling <[hidden email]> wrote:

> On Sat, Jan 14, 2017 at 12:42:09PM +0000, Peter Kay wrote:
>> On 14 January 2017 at 12:02, Stefan Sperling <[hidden email]> wrote:
>> > On Sat, Jan 14, 2017 at 11:31:00AM +0000, Peter Kay wrote:
>> >> On 14 January 2017 at 11:23, Stefan Sperling <[hidden email]> wrote:
>>
>> > If one of your clients says it cannot authenticate, then this client may be
>> > trying to use TKIP/WPA1. You can enable wpa1 explicitly for such clients:
>> >   ifconfig athn0 wpaprotos wpa1,wpa2
>> > But understand that you'll be running broken WEP-grade crypto if you do this.
>> I'll upgrade to the latest snapshot. It's not a TKIP/WPA1 issue as a
>> reboot fixes it.
>
> A reboot is very drastic and won't help with narrowing down the
> cause of your issue.
>
> Can you find a better way to unwedge the AP when it runs into problems?
> Does 'ifconfig iwn0 scan' on the client help?
> Does 'ifconfig athn0 down up' on the AP help?

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Mon, Jan 16, 2017 at 07:18:04PM +0000, Peter Kay wrote:
> I'm still having issues with this.
>
> When the access point wedges, it seems to affect my Android phone more
> than the iwn laptop. ifconfig athn0 down up does resolve the problem
> in the short term.

Do you have 2 antennas properly connected to the athn card?

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5
On 16 January 2017 at 23:30, Stefan Sperling <[hidden email]> wrote:
> On Mon, Jan 16, 2017 at 07:18:04PM +0000, Peter Kay wrote:
>> I'm still having issues with this.
>>
>> When the access p64 bytes from 192.168.1.251: icmp_seq=678 ttl=255 time=4.502 ms
oint wedges, it seems to affect my Android phone more
>> than the iwn laptop. ifconfig athn0 down up does resolve the problem
>> in the short term.
>
> Do you have 2 antennas properly connected to the athn card?

Three, yes, but note that unless the antennas have been unreasonably
disturbed during the snapshot upgrade nothing has changed. Also, it
takes a day or so for the access point to start failing, so I'm
suspecting a software issue.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Mon, Jan 16, 2017 at 11:58:51PM +0000, Peter Kay wrote:
> On 16 January 2017 at 23:30, Stefan Sperling <[hidden email]> wrote:
> > Do you have 2 antennas properly connected to the athn card?
>
> Three, yes, but note that unless the antennas have been unreasonably
> disturbed during the snapshot upgrade nothing has changed. Also, it
> takes a day or so for the access point to start failing, so I'm
> suspecting a software issue.

Fair enough. But I can't see anything in your reports that would guide me
where to look for bugs in the code. Let me know if you find out more.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5



  Original Message  
From: [hidden email]
Sent: 17 January 2017 10:00 a.m.
To: [hidden email]
Cc: [hidden email]
Subject: Re: 11n support for athn(4)

On Mon, Jan 16, 2017 at 11:58:51PM +0000, Peter Kay wrote:
>>
>> Three, yes, but note that unless the antennas have been unreasonably
>> disturbed during the snapshot upgrade nothing has changed. Also, it
>> takes a day or so for the access point to start failing, so I'm
>> suspecting a software issue.

>Fair enough. But I can't see anything in your reports >that would guide me
>where to look for bugs in the code. Let me know if >you find out more.

What diagnostics are available to narrow down the cause of this issue?
Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Tue, Jan 17, 2017 at 10:19:39AM +0000, Peter Kay wrote:

> From: [hidden email]
> Sent: 17 January 2017 10:00 a.m.
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: 11n support for athn(4)
>
> On Mon, Jan 16, 2017 at 11:58:51PM +0000, Peter Kay wrote:
> >>
> >> Three, yes, but note that unless the antennas have been unreasonably
> >> disturbed during the snapshot upgrade nothing has changed. Also, it
> >> takes a day or so for the access point to start failing, so I'm
> >> suspecting a software issue.
>
> >Fair enough. But I can't see anything in your reports >that would guide me
> >where to look for bugs in the code. Let me know if >you find out more.
>
> What diagnostics are available to narrow down the cause of this issue?

The best you could give me is a way to reproduce your problem independently
in my own environment. Right now, I cannot reproduce it. My athn APs (and
those of several other people) seem to be working just fine.

Without more details, all I can do is guess.
I made one guess already (antennas) and sadly I guessed wrong.

If you are unable to narrow down the problem without a lot of handholding,
please ask an expert you know for additional help, or just use 11g mode.
I don't have enough time right now to guide you through all the details.

If there is a real problem, someone else will eventually also run into it.
Then we might learn more.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Tue, Jan 17, 2017 at 11:56:09AM +0100, Stefan Sperling wrote:
> Without more details, all I can do is guess.
> I made one guess already (antennas) and sadly I guessed wrong.

Another thing where your setup differs from mine is that you are
using a device with 3 antennas, whereas my devices only have 2.

I have already ordered a 3 antenna device two days ago so I should
have one to test with soon. Perhaps I will see a problem then.

Is anyone else reading this list using a 3 antenna device?
Please let us know whether it works.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5



  Original Message  
From: [hidden email]
Sent: 17 January 2017 12:25 p.m.
To: [hidden email]; [hidden email]
Subject: Re: 11n support for athn(4)

On Tue, Jan 17, 2017 at 11:56:09AM +0100, Stefan Sperling wrote:
>> Without more details, all I can do is guess.
>> I made one guess already (antennas) and sadly I >guessed wrong.

>Another thing where your setup differs from mine is >that you are
>using a device with 3 antennas, whereas my devices >only have 2.

>I have already ordered a 3 antenna device two days >ago so I should
>have one to test with soon. Perhaps I will see a >problem then.

>Is anyone else reading this list using a 3 antenna >device?
>Please let us know whether it works.
Assuming my firewall hangs again tonight, I'll revert to 11g and see if the issue persists. Would ssh access help to diagnose the problem? I can put other hardware in to do firewall duties and swap my current box out
Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Uwe Werler
In reply to this post by Uwe Werler
On 16. Jan 17:46:48, Uwe Werler wrote:

>
> Unfortunately the throughput is very low, only ~7 MBit. With mode 11g I get ~16 MBit.
>
>
> zarathustra:~# tcpbench apu01
>   elapsed_ms          bytes         mbps   bwidth
>         1004         748272        5.962  100.00%
> Conn:   1 Mbps:        5.962 Peak Mbps:        5.962 Avg Mbps:        5.962
>         2007         839664        6.697  100.00%
> Conn:   1 Mbps:        6.697 Peak Mbps:        6.697 Avg Mbps:        6.697
>         3010         818244        6.533  100.00%
> Conn:   1 Mbps:        6.533 Peak Mbps:        6.697 Avg Mbps:        6.533
>         4013         909636        7.255  100.00%
> Conn:   1 Mbps:        7.255 Peak Mbps:        7.255 Avg Mbps:        7.255
>         5014         856800        6.848  100.00%
> Conn:   1 Mbps:        6.848 Peak Mbps:        7.255 Avg Mbps:        6.848
>         6015         868224        6.946  100.00%
> Conn:   1 Mbps:        6.946 Peak Mbps:        7.255 Avg Mbps:        6.946
>         7021         872508        6.945  100.00%
> Conn:   1 Mbps:        6.945 Peak Mbps:        7.255 Avg Mbps:        6.945
>         8023         835380        6.670  100.00%
> Conn:   1 Mbps:        6.670 Peak Mbps:        7.255 Avg Mbps:        6.670
>         9025         848232        6.779  100.00%
> Conn:   1 Mbps:        6.779 Peak Mbps:        7.255 Avg Mbps:        6.779
>        10028         843948        6.731  100.00%
> Conn:   1 Mbps:        6.731 Peak Mbps:        7.255 Avg Mbps:        6.731
>        11036         831096        6.596  100.00%
> Conn:   1 Mbps:        6.596 Peak Mbps:        7.255 Avg Mbps:        6.596
>
> I'm now ready to test furhter.
>

I tested yesterday with my Android phone (Galaxy S7) and got only ~4 MBit.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Stefan Sperling-5
On Wed, Jan 18, 2017 at 09:19:28AM +0100, Uwe Werler wrote:

> On 16. Jan 17:46:48, Uwe Werler wrote:
> >
> > Unfortunately the throughput is very low, only ~7 MBit. With mode 11g I get ~16 MBit.
> >
> >
> > zarathustra:~# tcpbench apu01
> >   elapsed_ms          bytes         mbps   bwidth
> >         1004         748272        5.962  100.00%
> > Conn:   1 Mbps:        5.962 Peak Mbps:        5.962 Avg Mbps:        5.962
> >         2007         839664        6.697  100.00%
> > Conn:   1 Mbps:        6.697 Peak Mbps:        6.697 Avg Mbps:        6.697
> >         3010         818244        6.533  100.00%
> > Conn:   1 Mbps:        6.533 Peak Mbps:        6.697 Avg Mbps:        6.533
> >         4013         909636        7.255  100.00%
> > Conn:   1 Mbps:        7.255 Peak Mbps:        7.255 Avg Mbps:        7.255
> >         5014         856800        6.848  100.00%
> > Conn:   1 Mbps:        6.848 Peak Mbps:        7.255 Avg Mbps:        6.848
> >         6015         868224        6.946  100.00%
> > Conn:   1 Mbps:        6.946 Peak Mbps:        7.255 Avg Mbps:        6.946
> >         7021         872508        6.945  100.00%
> > Conn:   1 Mbps:        6.945 Peak Mbps:        7.255 Avg Mbps:        6.945
> >         8023         835380        6.670  100.00%
> > Conn:   1 Mbps:        6.670 Peak Mbps:        7.255 Avg Mbps:        6.670
> >         9025         848232        6.779  100.00%
> > Conn:   1 Mbps:        6.779 Peak Mbps:        7.255 Avg Mbps:        6.779
> >        10028         843948        6.731  100.00%
> > Conn:   1 Mbps:        6.731 Peak Mbps:        7.255 Avg Mbps:        6.731
> >        11036         831096        6.596  100.00%
> > Conn:   1 Mbps:        6.596 Peak Mbps:        7.255 Avg Mbps:        6.596
> >
> > I'm now ready to test furhter.
> >
>
> I tested yesterday with my Android phone (Galaxy S7) and got only ~4 MBit.

Thank you for providing these numbers.

I would like to note though that there are many factors determining the
effective throughput of wifi, ranging from wifi hardware, across OS and
driver code, to specific AP/client behaviour and environmental RF conditions.

So when you report a number, you help with establishing a picture of the
overall range of throughput people are seeing. But a number does not tell
anybody anything about why throughput is lower than expected in your case.
So this number cannot be used to actually improve the driver.
It is just a data point.

What would help a small bit is a direct comparison with Linux running on the
same access point hardware in the exact same environment. That would indicate
which performance levels could be reached in your environment if OpenBSD was
optimally tuned. I assume Linux has reached optimal performance levels on
this several years old hardware by now.

In my testing I have noticed that Intel clients send data much faster than
athn APs/clients do. The AP is able to receive higher data rates than it
is sending. I don't know why that is happening and under which conditions
this is to be expected. But it points to a problem with the athn driver.
Perhaps the hardware is not tuned towards the specific way in which our
driver makes use of it.

For now, I am happy if your AP works without crashing.
As mentioned in the driver's man page, our 11n support is still incomplete
and a whole lot remains to be done.

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Uwe Werler
On 18. Jan 11:02:01, Stefan Sperling wrote:

> On Wed, Jan 18, 2017 at 09:19:28AM +0100, Uwe Werler wrote:
> > On 16. Jan 17:46:48, Uwe Werler wrote:
> > >
> > > Unfortunately the throughput is very low, only ~7 MBit. With mode 11g I get ~16 MBit.
> > >
> > >
> > > zarathustra:~# tcpbench apu01
> > >   elapsed_ms          bytes         mbps   bwidth
> > >         1004         748272        5.962  100.00%
> > > Conn:   1 Mbps:        5.962 Peak Mbps:        5.962 Avg Mbps:        5.962
> > >         2007         839664        6.697  100.00%
> > > Conn:   1 Mbps:        6.697 Peak Mbps:        6.697 Avg Mbps:        6.697
> > >         3010         818244        6.533  100.00%
> > > Conn:   1 Mbps:        6.533 Peak Mbps:        6.697 Avg Mbps:        6.533
> > >         4013         909636        7.255  100.00%
> > > Conn:   1 Mbps:        7.255 Peak Mbps:        7.255 Avg Mbps:        7.255
> > >         5014         856800        6.848  100.00%
> > > Conn:   1 Mbps:        6.848 Peak Mbps:        7.255 Avg Mbps:        6.848
> > >         6015         868224        6.946  100.00%
> > > Conn:   1 Mbps:        6.946 Peak Mbps:        7.255 Avg Mbps:        6.946
> > >         7021         872508        6.945  100.00%
> > > Conn:   1 Mbps:        6.945 Peak Mbps:        7.255 Avg Mbps:        6.945
> > >         8023         835380        6.670  100.00%
> > > Conn:   1 Mbps:        6.670 Peak Mbps:        7.255 Avg Mbps:        6.670
> > >         9025         848232        6.779  100.00%
> > > Conn:   1 Mbps:        6.779 Peak Mbps:        7.255 Avg Mbps:        6.779
> > >        10028         843948        6.731  100.00%
> > > Conn:   1 Mbps:        6.731 Peak Mbps:        7.255 Avg Mbps:        6.731
> > >        11036         831096        6.596  100.00%
> > > Conn:   1 Mbps:        6.596 Peak Mbps:        7.255 Avg Mbps:        6.596
> > >
> > > I'm now ready to test furhter.
> > >
> >
> > I tested yesterday with my Android phone (Galaxy S7) and got only ~4 MBit.
>
> Thank you for providing these numbers.
>
> I would like to note though that there are many factors determining the
> effective throughput of wifi, ranging from wifi hardware, across OS and
> driver code, to specific AP/client behaviour and environmental RF conditions.
>
> So when you report a number, you help with establishing a picture of the
> overall range of throughput people are seeing. But a number does not tell
> anybody anything about why throughput is lower than expected in your case.
> So this number cannot be used to actually improve the driver.
> It is just a data point.
>
> What would help a small bit is a direct comparison with Linux running on the
> same access point hardware in the exact same environment. That would indicate
> which performance levels could be reached in your environment if OpenBSD was
> optimally tuned. I assume Linux has reached optimal performance levels on
> this several years old hardware by now.
>
> In my testing I have noticed that Intel clients send data much faster than
> athn APs/clients do. The AP is able to receive higher data rates than it
> is sending. I don't know why that is happening and under which conditions
> this is to be expected. But it points to a problem with the athn driver.
> Perhaps the hardware is not tuned towards the specific way in which our
> driver makes use of it.
>
> For now, I am happy if your AP works without crashing.
> As mentioned in the driver's man page, our 11n support is still incomplete
> and a whole lot remains to be done.
>

Dear Stefan,

thanks for Your effort and explanation.

Ok, then I try to boot a Linux within the next days at this box - it's my
apu1d4 used as my nas and home server running current.

If I can help otherwise I'm ready!

Thanks again for Your time, patience and work!

Uwe

PS: The AP runs now since two days without any issues.
--

Reply | Threaded
Open this post in threaded view
|

Re: 11n support for athn(4)

Peter Kay-5
In reply to this post by Stefan Sperling-5
On 17 January 2017 at 12:25, Stefan Sperling <[hidden email]> wrote:

> On Tue, Jan 17, 2017 at 11:56:09AM +0100, Stefan Sperling wrote:
>> Without more details, all I can do is guess.
>> I made one guess already (antennas) and sadly I guessed wrong.
>
> Another thing where your setup differs from mine is that you are
> using a device with 3 antennas, whereas my devices only have 2.
>
> I have already ordered a 3 antenna device two days ago so I should
> have one to test with soon. Perhaps I will see a problem then.
>
> Is anyone else reading this list using a 3 antenna device?
> Please let us know whether it works.
I'd actually recompiled the kernel using January 16th sources and it
was working fine, until tonight. Brought up the glass console to see a
panic

The following was photographed, then OCRd. I've given it a quick look
to check it seems ok, but not a fine toothcomb.

sfer overflow

ddb> trace Debugger(d09e973d,13734d68,d09cf94e,f3734db8,b2000000) at
Debugger+0x7 panic(d09cf9de,f3734d8c,d03c88c9,d1605008,13734df8) at
panic.0x71
ieee80211_mira_update_stats(d169ab58,d1364030,4169a000,d03b9634,d0c6c980)
at ieee80211 mira_update_siats+0x3bf
 ieee80211_mira_choose(d169ab58,d1364030,d169a000,0,d13be040) at
ieee80.2.11_mira_choose+0x4e
ar5008_tx_process (d1364009 ,0 , f3734edc,760f4a ,8354c175) at
arS008_tx_process+0x1f2
 ar5008_tx intr (d1364000,c0,f3734f0c, d03ba33f ,f3734ef4) at ar5008tx_intr+0x7c
ar5008_intr (d1364000 , d135d380) at ar5008_intr+021b
 Xintrlegacy3() at Xintr_legacy3+0x81
--- interrupt ---
 cpu_idle_cycle(d0c6c960) at cpu_idlecycle+0xf

I also have the ps lists, but I ran out of time to OCR them. Let me
know if needed and I can forward the photos

Reply | Threaded
Open this post in threaded view
|

mira sfer overflow panic (was: Re: 11n support for athn(4))

Stefan Sperling-5
On Thu, Jan 26, 2017 at 06:36:06AM +0000, Peter Kay wrote:
> sfer overflow

Interesting. This is the first time I've ever seen this panic trigger.

Can you apply this patch and try to trigger it again?

Index: ieee80211_mira.c
===================================================================
RCS file: /cvs/src/sys/net80211/ieee80211_mira.c,v
retrieving revision 1.8
diff -u -p -r1.8 ieee80211_mira.c
--- ieee80211_mira.c 12 Jan 2017 18:06:57 -0000 1.8
+++ ieee80211_mira.c 26 Jan 2017 09:37:27 -0000
@@ -427,8 +427,15 @@ ieee80211_mira_update_stats(struct ieee8
 
  /* Compute Sub-Frame Error Rate (see section 2.2 in MiRA paper). */
  sfer = (mn->frames * mn->retries + mn->txfail);
- if ((sfer >> MIRA_FP_SHIFT) != 0)
+ if ((sfer >> MIRA_FP_SHIFT) != 0) {
+ printf("%s: driver stats:\n", __func__);
+ printf("mn->frames = %u\n", mn->frames);
+ printf("mn->retries = %u\n", mn->retries);
+ printf("mn->txfail = %u\n", mn->txfail);
+ printf("mn->ampdu_size = %u\n", mn->ampdu_size);
+ printf("mn->agglen = %u\n", mn->agglen);
  panic("sfer overflow"); /* bug in wifi driver */
+ }
  sfer <<= MIRA_FP_SHIFT; /* convert to fixed-point */
  sfer /= ((mn->retries + 1) * mn->frames);
  if (sfer > MIRA_FP_1)

123