Re: athn PCI card (AR9281) AP not found by scan on some devices

2016-03-07 Thread Stefan Sperling
On Mon, Mar 07, 2016 at 03:12:33PM +0200, cho...@jtan.com wrote:
> Note that I got the order of configuration lines directly from athn(4)
> and some other wireless driver manpages also have examples with inet
> lines prior to media settings.

I"ve fixed this in CVS, thanks.



Re: athn PCI card (AR9281) AP not found by scan on some devices

2016-03-07 Thread chohag
Stefan Sperling writes:
> On Sun, Mar 06, 2016 at 10:22:17PM +0200, cho...@jtan.com wrote:
> > >Description:
> > /etc/hostname.athn0 contains:
> > inet 192.168.42.1 255.255.255.0
> > mediaopt hostap chan 56
> > nwid Testies
> > wpakey insecure
> 
> Note that setting an address puts the interface UP implicitly.
> So you'll want to configure all the wireless bits first, and set the
> address afterwards! Otherwise, your wireless settings will race the
> automatic mode/channel selection I described in my other reply from
> a few minutes ago.
> 
> So try this something like this instead:
> 
> media autoselect mediaopt hostap mode 11g
> chan 1
> inet 192.168.42.1 255.255.255.0
> 
> or:
> 
> media autoselect mediaopt hostap mode 11a
> chan 36
> inet 192.168.42.1 255.255.255.0

That, and the process for switching mode at runtime in your other mail,
clears things up a lot and the AP seems to be working as it should
now. More testing will ensue.

Note that I got the order of configuration lines directly from athn(4)
and some other wireless driver manpages also have examples with inet
lines prior to media settings.

It does seem that the control tools will try and do things which are
impossible but it looks like documentation can clear most of that up and
at least they're easier to fix than mysterious driver bugs happening 2
continents away, which thankfully doesn't seem to be the case.

Thanks,

Matthew



Re: athn PCI card (AR9281) AP not found by scan on some devices

2016-03-07 Thread Stefan Sperling
On Sun, Mar 06, 2016 at 10:22:17PM +0200, cho...@jtan.com wrote:
> >Description:
>   /etc/hostname.athn0 contains:
> inet 192.168.42.1 255.255.255.0
> mediaopt hostap chan 56
> nwid Testies
> wpakey insecure

Note that setting an address puts the interface UP implicitly.
So you'll want to configure all the wireless bits first, and set the
address afterwards! Otherwise, your wireless settings will race the
automatic mode/channel selection I described in my other reply from
a few minutes ago.

So try this something like this instead:

media autoselect mediaopt hostap mode 11g
chan 1
inet 192.168.42.1 255.255.255.0

or:

media autoselect mediaopt hostap mode 11a
chan 36
inet 192.168.42.1 255.255.255.0



Re: athn PCI card (AR9281) AP not found by scan on some devices

2016-03-07 Thread Stefan Sperling
On Mon, Mar 07, 2016 at 09:06:12AM +0200, cho...@jtan.com wrote:
> I've been poking at it (and little more than poking in ignorance) and a
> few more symptoms have cropped up:
> 
> * If I include any chan setting in hostname.athn0 and reboot, I can't
>   set the chan at runtime to anything between 1 and 11 though can to
>   (some) values >11: ifconfig: SIOCS80211CHANNEL: Invalid argument
> 
>   Some values result in my 'good' laptop being able to find the AP and
>   some don't. Booting with anything <= 11 can't be seen; 36, 56 and 44
>   can.
> 
> * If I remove the chan option from hostname.athn0 ifconfig shows that
>   chan 1 was selected but nothing (not even my 'good' laptop) finds the
>   network. However I can now change the chan at runtime, and doing so
>   allows (all) the other devices to find the AP, even after switching
>   back to chan 1.
> 
> I don't know what either of these things means, but they're odd.

Apart from hardware support, available channels depend on the current
"mode" of the interface.

11a mode allows 5GHz channels (36 and up), and

11g mode allows channels 1 to 11, or perhaps up to 14 depending on the
regulatory domain that your athn card was set to during manufacturing.
(OpenBSD doesn't support run-time switching of regulatory domains at present
and will just use whatever the hardware has been set up for.)

Since you're running the card in hostap mode you should specify a mode first
and then a channel. If you don't specify either, the wireless stack will
automatically select a channel and a mode when the athn0 interface is put up.
If you try to set a channel that's not valid for the curret mode, you'll see
the 'Invalid argument' error.

You can change the mode to 11a or 11g with:

  ifconfig athn0 media autoselect mode 11a
  ifconfig athn0 media autoselect mode 11g

(Yes, you need to type all of that. This has been fixed in 5.9, where
just 'ifconfig athn0 mode 11a' and 'ifconfig athn0 mode 11g' will work).

You can put either of these lines in /etc/hostname.athn0 to force a
particular mode at boot time:

media autoselect mode 11a
media autoselect mode 11g

I hope this helps. I realize this interface, and perhaps the documentation,
may lack some general friendliness towards those who aren't aware of all
the quirks.



Re: athn PCI card (AR9281) AP not found by scan on some devices

2016-03-06 Thread chohag
Stefan Sperling writes:
> On Sun, Mar 06, 2016 at 10:22:17PM +0200, cho...@jtan.com wrote:
> > >Synopsis:  athn PCI card (AR9281) AP not found by scan on some devices
> > >Category:  wifi driver?
> > >Environment:
> > System  : OpenBSD 5.8
> > Details : OpenBSD 5.8 (GENERIC) #1170: Sun Aug 16 02:26:00 MDT 2015
> >  dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/comp
> ile/GENERIC
> > 
> > Architecture: OpenBSD.amd64
> > Machine : amd64
> > >Description:
> > /etc/hostname.athn0 contains:
> > inet 192.168.42.1 255.255.255.0
> > mediaopt hostap chan 56
> 
> I'd recommend sticking to 11a "indoor channels" 36, 38, 40, 42, 44,
> and 48, unless you have a good reason to do otherwise.
>
> In most countries, channel 50 and above ("outdoor channels") require DFS
> support for proper operation, which OpenBSD doesn't provide.
> Many client devices won't support any of the "outdoor" channels.

I didn't even choose one until I found out that it didn't work. I'm
right in the middle of nowhere so I've not paid attention to the
regulatory settings yet. Choosing the right settings would have happened
right after I'd verified basic functionality on.

> > The hardware seems to not be a problem - it's brand new and The
> > Other OS running hostapd could be found by all 4 devices.
> 
> Which channel does the other os use?

I ripped off a hostapd.conf that I found somewhere online. It sets the
country code to US and channel to 2.

I've been poking at it (and little more than poking in ignorance) and a
few more symptoms have cropped up:

* If I include any chan setting in hostname.athn0 and reboot, I can't
  set the chan at runtime to anything between 1 and 11 though can to
  (some) values >11: ifconfig: SIOCS80211CHANNEL: Invalid argument

  Some values result in my 'good' laptop being able to find the AP and
  some don't. Booting with anything <= 11 can't be seen; 36, 56 and 44
  can.

* If I remove the chan option from hostname.athn0 ifconfig shows that
  chan 1 was selected but nothing (not even my 'good' laptop) finds the
  network. However I can now change the chan at runtime, and doing so
  allows (all) the other devices to find the AP, even after switching
  back to chan 1.

I don't know what either of these things means, but they're odd.

I would rather perform more rigorous tests but I don't know which tests
would be meaningful and which would be a massive waste of time so all
I'm doing now is playing with it.

Matthew



Re: athn PCI card (AR9281) AP not found by scan on some devices

2016-03-06 Thread Stefan Sperling
On Sun, Mar 06, 2016 at 10:22:17PM +0200, cho...@jtan.com wrote:
> >Synopsis:athn PCI card (AR9281) AP not found by scan on some devices
> >Category:wifi driver?
> >Environment:
>   System  : OpenBSD 5.8
>   Details : OpenBSD 5.8 (GENERIC) #1170: Sun Aug 16 02:26:00 MDT 2015
>
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
> 
>   Architecture: OpenBSD.amd64
>   Machine : amd64
> >Description:
>   /etc/hostname.athn0 contains:
> inet 192.168.42.1 255.255.255.0
> mediaopt hostap chan 56

I'd recommend sticking to 11a "indoor channels" 36, 38, 40, 42, 44,
and 48, unless you have a good reason to do otherwise.

In most countries, channel 50 and above ("outdoor channels") require DFS
support for proper operation, which OpenBSD doesn't provide.
Many client devices won't support any of the "outdoor" channels.

>   The hardware seems to not be a problem - it's brand new and The
>   Other OS running hostapd could be found by all 4 devices.

Which channel does the other os use?