Re: iwm0: could not initiate 2 GHz scan

2016-01-21 Thread Stefan Sperling
On Thu, Jan 14, 2016 at 07:41:59PM -0700, Chris Wojo wrote:
> Here is a one liner from the beacons at home: 

It seems this AP does not support 802.11n and is using WEP.
Is this correct?

> Here are a few beacons from work: 

There's nothing unusual in these beacons as far as I can tell.

> This would be a selection of dmesg output for the work AP's:

It looks as if your connection failures at work could be related
to authentication failures. The OpenBSD client won't move from ASSOC
to RUN state. This usually means WPA authentication is failing.
Let's try to confirm this theory.

Which authentication mechanism is used on this network?
It's using some form of WPA but I'm not sure which exactly.
Can you show the lines 'ifconfig iwm0 scan' displays for these APs?
These lines should indicate the authentication method used.
If the lines contain '802.1x' you'll need to install wpa_supplicant
from packages and configure it before connecting.
See http://undeadly.org/cgi?action=article=20130128142215 for details.

Can you run 'ifconfig iwm0 debug' before trying to connect, and show
the WPA 'handshake' messages which should now end up in dmesg?
Upon success, 4 handshake messages are exchanged and the 'status:'
line displayed by 'ifconfig iwm0' becomes 'active'. Note that dhclient
cannot do anything before the link becomes active, so if you've only
been checking dhclient output that's not the right place to look.

Can you show what 'ifconfig iwm0' (as non-root user so passwords remain
hidden) looks like while you're trying to connect at work?
Perhaps you have a WEP key and a WPA set at the same time after moving
from home to the office while the laptop is suspended?
Switching from a WEP network to a WPA network requires clearing the
WEP key with 'ifconfig iwm0 -nwkey' in addition to the commands which
set up WPA. I've fallen into this trap myself many many times.

If none of the above help, did you ever manage to use any OpenBSD client
in this environment? Can you connect to this network with an OpenBSD
client using a wifi device supported by a driver other than iwm(4)?



Re: iwm0: could not initiate 2 GHz scan

2016-01-14 Thread Chris Wojo
1d09000) at 1d090
loading ring 10 descriptors (0xff0001d26000) at 1d260
loading ring 11 descriptors (0xff0001d2e000) at 1d2e0
loading ring 12 descriptors (0xff0001d36000) at 1d360
loading ring 13 descriptors (0xff0001d3e000) at 1d3e0
loading ring 14 descriptors (0xff0001d46000) at 1d460
loading ring 15 descriptors (0xff0001d4e000) at 1d4e0
loading ring 16 descriptors (0xff0001d56000) at 1d560
loading ring 17 descriptors (0xff0001d5e000) at 1d5e0
loading ring 18 descriptors (0xff0001d66000) at 1d660
loading ring 19 descriptors (0xff0001d6e000) at 1d6e0
shadow registers enabled
LOAD FIRMWARE type 0 offset 8388608 len 81920
LOAD FIRMWARE type 0 offset 0 len 101588
LOAD FIRMWARE type 0 offset 4294954188 len 32
enabled txq 9 FIFO 7
sending command 0x98 qid 9, idx 0
sending command 0x6a qid 9, idx 1
iwm apm stop
iwm apm start
iwm apm start
Radio type=0x0-0x2-0x1
loading ring 0 descriptors (0xff0001c04000) at 1c040
loading ring 1 descriptors (0xff0001c21000) at 1c210
loading ring 2 descriptors (0xff0001c3e000) at 1c3e0
loading ring 3 descriptors (0xff0001c5b000) at 1c5b0
loading ring 4 descriptors (0xff0001c78000) at 1c780
loading ring 5 descriptors (0xff0001c95000) at 1c950
loading ring 6 descriptors (0xff0001cb2000) at 1cb20
loading ring 7 descriptors (0xff0001ccf000) at 1ccf0
loading ring 8 descriptors (0xff0001cec000) at 1cec0
loading ring 9 descriptors (0xff0001d09000) at 1d090
loading ring 10 descriptors (0xff0001d26000) at 1d260
loading ring 11 descriptors (0xff0001d2e000) at 1d2e0
loading ring 12 descriptors (0xff0001d36000) at 1d360
loading ring 13 descriptors (0xff0001d3e000) at 1d3e0
loading ring 14 descriptors (0xff0001d46000) at 1d460
loading ring 15 descriptors (0xff0001d4e000) at 1d4e0
loading ring 16 descriptors (0xff0001d56000) at 1d560
loading ring 17 descriptors (0xff0001d5e000) at 1d5e0
loading ring 18 descriptors (0xff0001d66000) at 1d660
loading ring 19 descriptors (0xff0001d6e000) at 1d6e0
shadow registers enabled
LOAD FIRMWARE type 1 offset 8388608 len 81920
LOAD FIRMWARE type 1 offset 0 len 183268
LOAD FIRMWARE type 1 offset 4294954188 len 32
enabled txq 9 FIFO 7
sending command 0x98 qid 9, idx 0
Sending phy db data and configuration to runtime image
sending command 0x6c qid 9, idx 1
sending command 0x6c qid 9, idx 2
sending command 0x6c qid 9, idx 3
sending command 0x6c qid 9, idx 4
sending command 0x6c qid 9, idx 5
sending command 0x6c qid 9, idx 6
sending command 0x6c qid 9, idx 7
sending command 0x6c qid 9, idx 8
sending command 0x6c qid 9, idx 9
sending command 0x6c qid 9, idx 10
sending command 0x6c qid 9, idx 11
sending command 0x6c qid 9, idx 12
sending command 0x6c qid 9, idx 13
sending command 0x6c qid 9, idx 14
sending command 0x6c qid 9, idx 15
Finished sending phy db non channel data
sending command 0x6a qid 9, idx 16
iwm0: could not initiate 2 GHz scan
sending command 0x18 qid 9, idx 17
Internal station added.
sending command 0x8 qid 9, idx 18
sending command 0x8 qid 9, idx 19
sending command 0x8 qid 9, idx 20
Sending device power command with flags = 0x2001
sending command 0x77 qid 9, idx 21
enabled txq 0 FIFO 0
enabled txq 1 FIFO 1
enabled txq 2 FIFO 2
enabled txq 3 FIFO 3
iwm_mvm_mac_ctxt_cmd_common: htprot = 0
dtim 1 0
sending command 0x28 qid 9, idx 22
switching state INIT->SCAN
Handling ieee80211 scan request
sending command 0x80 qid 9, idx 23
iwm apm stop
iwm apm start
iwm apm start
Radio type=0x0-0x2-0x1
loading ring 0 descriptors (0xff0001c04000) at 1c040
loading ring 1 descriptors (0xff0001c21000) at 1c210
loading ring 2 descriptors (0xff0001c3e000) at 1c3e0
loading ring 3 descriptors (0xff0001c5b000) at 1c5b0
loading ring 4 descriptors (0xff0001c78000) at 1c780
loading ring 5 descriptors (0xff0001c95000) at 1c950
loading ring 6 descriptors (0xff0001cb2000) at 1cb20
loading ring 7 descriptors (0xff0001ccf000) at 1ccf0
loading ring 8 descriptors (0xff0001cec000) at 1cec0
loading ring 9 descriptors (0xff0001d09000) at 1d090
loading ring 10 descriptors (0xff0001d26000) at 1d260
loading ring 11 descriptors (0xff0001d2e000) at 1d2e0
loading ring 12 descriptors (0xff0001d36000) at 1d360
loading ring 13 descriptors (0xff0001d3e000) at 1d3e0
loading ring 14 descriptors (0xff0001d46000) at 1d460
loading ring 15 descriptors (0xff0001d4e000) at 1d4e0
loading ring 16 descriptors (0xff0001d56000) at 1d560
loading ring 17 descriptors (0xff0001d5e000) at 1d5e0
loading ring 18 descriptors (0xff0001d66000) at 1d660
loading ring 19 descriptors (0xff0001d6e000) at 1d6e0
shadow registers enabled
LOAD FIRMWARE type 0 offset 8388608 len 81920
LOAD FIRMWARE type 0 offset 0 len 101588
LOAD FIRMWARE type 0 offset 4294954188 len 32
enabled txq 9 FIFO 7
sending command 0x98 qid 9, idx 0
sending command 0x6a qid 9, idx 1
iwm apm stop
iwm apm start
iwm apm start
Radio type=0x0-0x2-0x1
loading

Re: iwm0: could not initiate 2 GHz scan

2016-01-13 Thread Stefan Sperling
On Tue, Jan 12, 2016 at 07:11:55PM -0700, Chris Wojo wrote:
> So it appears that iwm0 does work on snapshot #1800 on my home wireless AP. 
> The errors previously reported still occur on the office network where 
> several AP's are using the same NWID. 
> I would be more than happy to troubleshoot this so others won't run into the 
> same problem.
> Thank you.

So it's clear we still have an issue here. This could be a problem
with frame protection settings, which if wrongly configured would
cause Tx failures and frames damaged while in flight. Protection
settings for the network are advertised by the AP and we must apply
them correctly or many things won't work.
(cf. 
http://www.testequipmentdepot.com/flukenetworks/pdf/802.11n-compatibility.pdf)

One issue I'm already aware of is that we currently don't update
protection settings in case the AP decides to change them while
we're associated. But your problem indicates that perhaps we're
not configuring frame protection correctly in the first place.

Can you please send one line showing a beacon for your AP at home,
and a few lines showing beacons from the various APs at your office?

You can print beacons as a line of text like this:

  tcpdump -n -i iwm0 -s 1500 -vvv -y IEEE802_11_RADIO subtype beacon
 
Note that if you run this command while associated to an AP (i.e. while
ifconfig iwm0 shows status: active) it will only show beacons for that AP.

Could you also compile and run a kernel with the follwing diff applied,
and show me what this prints while you're tyring to associate and DHCP
to the APs?

Thanks.

Index: if_iwm.c
===
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.75
diff -u -p -r1.75 if_iwm.c
--- if_iwm.c7 Jan 2016 23:08:38 -   1.75
+++ if_iwm.c13 Jan 2016 08:55:33 -
@@ -145,6 +145,7 @@
 #define le16_to_cpup(_a_) (le16toh(*(const uint16_t *)(_a_)))
 #define le32_to_cpup(_a_) (le32toh(*(const uint32_t *)(_a_)))
 
+#define IWM_DEBUG
 #ifdef IWM_DEBUG
 #define DPRINTF(x) do { if (iwm_debug > 0) printf x; } while (0)
 #define DPRINTFN(n, x) do { if (iwm_debug >= (n)) printf x; } while (0)
@@ -4948,6 +4949,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_s
if (ni->ni_flags & IEEE80211_NODE_HT) {
enum ieee80211_htprot htprot =
(ni->ni_htop1 & IEEE80211_HTOP1_PROT_MASK);
+   DPRINTF(("%s: htprot = %d\n", __func__, htprot));
switch (htprot) {
case IEEE80211_HTPROT_NONE:
break;



Re: iwm0: could not initiate 2 GHz scan

2016-01-12 Thread Laurence Tratt
On Mon, Jan 11, 2016 at 11:13:03AM -0700, Chris Wojo wrote:

Hello Chris,

> Currently, I'm running a snapshot 5.9-beta # 1800.
>
> I'm trying to connect to a wireless access point but receive "iwm0: could
> not initiate 2 GHz scan" from dmesg.
>
> dhclient comes back with no link.

I saw this yesterday on a recent snapshot, although in an odd way. Despite
the "could not initiate 2GHz scan" message, I could connect to a 2GHz
network, but not a 5GHz one (with the same symptoms you saw: dhclient saying
there was no link).


Laurie
-- 
Personal http://tratt.net/laurie/
Software Development Teamhttp://soft-dev.org/
   https://github.com/ltratt  http://twitter.com/laurencetratt



Re: iwm0: could not initiate 2 GHz scan

2016-01-12 Thread Chris Wojo
 On Mon, 11 Jan 2016 13:16:53 -0700 Stefan Sperling <s...@stsp.name>wrote 
 

 > On Mon, Jan 11, 2016 at 11:13:03AM -0700, Chris Wojo wrote:
 > > I'm trying to connect to a wireless access point but receive "iwm0: could 
 > > not initiate 2 GHz scan" from dmesg.
 > 
 > I'm seeing these message sometimes but they are transient
 > and scanning usually works fine after another attempt.
 > So I haven't investigated this problem yet.
 > 
 > > Wondering if this is due to being in a work environment with multiple 
 > > access points with same nwid; although I doubt that because of seeing 
 > > different mac address.
 > 
 > That shouldn't be a problem.
 > 
 > Do you see this issue only in that specific environment?
 > Does it also occur with OpenBD 5.8 release?
 > 
 > > iwm0: device timeout
 > 
 > That's bad. It means the device failed to transmit.
 > This is probably the reason you can't connect to the AP.
 > 

So it appears that iwm0 does work on snapshot #1800 on my home wireless AP. 
The errors previously reported still occur on the office network where several 
AP's are using the same NWID. 
I would be more than happy to troubleshoot this so others won't run into the 
same problem.
Thank you.



Re: iwm0: could not initiate 2 GHz scan

2016-01-11 Thread Stefan Sperling
On Mon, Jan 11, 2016 at 11:13:03AM -0700, Chris Wojo wrote:
> I'm trying to connect to a wireless access point but receive "iwm0: could not 
> initiate 2 GHz scan" from dmesg.

I'm seeing these message sometimes but they are transient
and scanning usually works fine after another attempt.
So I haven't investigated this problem yet.

> Wondering if this is due to being in a work environment with multiple access 
> points with same nwid; although I doubt that because of seeing different mac 
> address.

That shouldn't be a problem.

Do you see this issue only in that specific environment?
Does it also occur with OpenBD 5.8 release?

> iwm0: device timeout

That's bad. It means the device failed to transmit.
This is probably the reason you can't connect to the AP.



iwm0: could not initiate 2 GHz scan

2016-01-11 Thread Chris Wojo
Currently, I'm running a snapshot 5.9-beta # 1800.



I'm trying to connect to a wireless access point but receive "iwm0: could not 
initiate 2 GHz scan" from dmesg.

dhclient comes back with no link.

I have tried changing media from "autoselect mode 11n" to autoselect mode 
11g/b, but I receive the same error.

In all modes, I am able to run ifconfig iwm0 scan, and get results.  

Wondering if this is due to being in a work environment with multiple access 
points with same nwid; although I doubt that because of seeing different mac 
address.



Thanks in advance.



Below is dmesg output.



OpenBSD 5.9-beta (GENERIC.MP) #1800: Fri Jan  8 10:40:52 MST 2016

dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP

real mem = 21331415040 (20343MB)

avail mem = 20680794112 (19722MB)

mpath0 at root

scsibus0 at mpath0: 256 targets

mainbus0 at root

bios0 at mainbus0: SMBIOS rev. 2.7 @ 0x9cbfd000 (65 entries)

bios0: vendor LENOVO version "JBET54WW (1.19 )" date 11/06/2015

bios0: LENOVO 20BXCTO1WW

acpi0 at bios0: rev 2

acpi0: sleep states S0 S3 S4 S5

acpi0: tables DSDT FACP ASF! HPET ECDT APIC MCFG SSDT SSDT SSDT SSDT SSDT SSDT 
SSDT SSDT SSDT PCCT SSDT UEFI MSDM BATB FPDT UEFI DMAR

acpi0: wakeup devices LID_(S4) SLPB(S3) IGBE(S4) EXP2(S4) XHCI(S3) EHC1(S3)

acpitimer0 at acpi0: 3579545 Hz, 24 bits

acpihpet0 at acpi0: 14318179 Hz

acpiec0 at acpi0

acpimadt0 at acpi0 addr 0xfee0: PC-AT compat

cpu0 at mainbus0: apid 0 (boot processor)

cpu0: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.55 MHz

cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,RDSEED,ADX,SMAP,PT,SENSOR,ARAT

cpu0: 256KB 64b/line 8-way L2 cache

cpu0: smt 0, core 0, package 0

mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges

cpu0: apic clock running at 99MHz

cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE

cpu1 at mainbus0: apid 1 (application processor)

cpu1: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.22 MHz

cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,RDSEED,ADX,SMAP,PT,SENSOR,ARAT

cpu1: 256KB 64b/line 8-way L2 cache

cpu1: smt 1, core 0, package 0

cpu2 at mainbus0: apid 2 (application processor)

cpu2: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.22 MHz

cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,RDSEED,ADX,SMAP,PT,SENSOR,ARAT

cpu2: 256KB 64b/line 8-way L2 cache

cpu2: smt 0, core 1, package 0

cpu3 at mainbus0: apid 3 (application processor)

cpu3: Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz, 2494.22 MHz

cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,BMI1,HLE,AVX2,SMEP,BMI2,ERMS,INVPCID,RTM,RDSEED,ADX,SMAP,PT,SENSOR,ARAT

cpu3: 256KB 64b/line 8-way L2 cache

cpu3: smt 1, core 1, package 0

ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 40 pins

acpimcfg0 at acpi0 addr 0xf800, bus 0-63

bus 0

extent `pcimem' (0x0 - 0x), flags=0

 0x0 - 0x9

 0xc - 0x9fff

 0xfec0 - 0xfed3

 0xfed4c000 - 0x

acpiprt0 at acpi0: bus 0 (PCI0)

acpiprt1 at acpi0: bus -1 (PEG_)

acpiprt2 at acpi0: bus 2 (EXP1)

acpiprt3 at acpi0: bus 3 (EXP2)

acpiprt4 at acpi0: bus -1 (EXP3)

acpicpu0 at acpi0: C3(200@233 mwait.1@0x40), C2(200@148 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS

acpicpu1 at acpi0: C3(200@233 mwait.1@0x40), C2(200@148 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS

acpicpu2 at acpi0: C3(200@233 mwait.1@0x40), C2(200@148 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS

acpicpu3 at acpi0: C3(200@233 mwait.1@0x40), C2(200@148 mwait.1@0x33), 
C1(1000@1 mwait.1), PSS

acpipwrres0 at acpi0: PUBS, resource for XHCI, EHC1

acpipwrres1 at acpi0: NVP3, resource for PEG_

acpipwrres2 at acpi0: NVP2, resource for PEG_

acpitz0 at acpi0: critical temperature is 128 degC

acpibtn0 at