Bug 211519

Summary: iwm WiFi driver can't connect to hidden SSID
Product: Base System Reporter: Vito Van <awesomevito>
Component: wirelessAssignee: Andriy Voskoboinyk <avos>
Status: Closed FIXED    
Severity: Affects Only Me CC: avos, dbkirk
Priority: --- Keywords: patch
Version: 11.0-BETA2   
Hardware: amd64   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=204228
Attachments:
Description Flags
Setup SSIDs in scan command
none
Setup SSIDs in scan command (2) none

Description Vito Van 2016-08-02 03:01:48 UTC
the iwm WIFI driver works fine with normal WIFI (SSID visible), but "no suitable network found" when it comes to hidden SSID.

here is the wpa config:

--------------/etc/wpa_supplicant.conf------------------

ctrl_interface=/var/run/wpa_supplicant
passive_scan=1
ap_scan=1
update_config=1

network={
  mode=0
  scan_ssid=1
  bssid=xx:xx:xx:xx:xx:xx
  proto=WPA2
  key_mgmt=WPA-PSK
  pairwise=CCMP
  group=CCMP
  ssid="myssid"
  psk="mypwd"
}

-----------------/etc/rc.conf---------------------------

hostname="MY-HOST"

wlans_iwm0="wlan0"
ifconfig_wlan0="WPA DHCP"
ifconfig_wlan0_ipv6="inet6 accept_rtadv"
wpa_supplicant_enable="YES"

sshd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"

dbus_enable="YES"
autofs_enable="YES"

----------------------uname -a------------------

FreeBSD VITO-NUC 11.0-BETA2 FreeBSD 11.0-BETA2 #0 r303168: Fri Jul 22 02:23:56 UTC 2016     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64

-------------------ifconfig | grep -B3 -i wireless------------------

inet6 fe80::3613:e8ff:fe39:9d42%wlan0 prefixlen 64 scopeid 0x3 
inet 192.168.200.154 netmask 0xffffff00 broadcast 192.168.200.255 
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet OFDM/48Mbps mode 11g


Tell me if I should provide more information.
Comment 1 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-08-02 08:07:19 UTC
Created attachment 173185 [details]
Setup SSIDs in scan command

Hi!

Try to apply attached patch and recompile / reinstall the kernel.
Comment 2 Vito Van 2016-08-02 09:01:22 UTC
(In reply to Andriy Voskoboinyk from comment #1)
Learning how to apply patch and recompile / reinstall,
now in step 0: svn checkout the src.
Comment 3 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-08-02 09:05:43 UTC
Created attachment 173186 [details]
Setup SSIDs in scan command (2)

- Improve bitmask calculation.
- Set 'active' flag when needed.
Comment 4 Vito Van 2016-08-03 21:50:42 UTC
(In reply to Andriy Voskoboinyk from comment #3)
Sorry, Andriy.

I have switched back to Linux, because of the graphics driver and this iwm WiFi driver, I am very new to FreeBSD world, and don't have too much time to spend on this when there is a lot of work to be done.

Sorry, can't help to test for a while.
Comment 5 Doug Kirk 2016-09-05 22:18:49 UTC
This also occurs for me on 12-CURRENT with an attached Intel 8260 card. Perhaps I can test this.
Comment 6 Doug Kirk 2016-09-06 01:39:36 UTC
I installed an updated if_iwm.kld using the attached patch on 12-CURRENT and was able to successfully connect to my hidden WPA2 network. It was able to connect in both 11a and 11g modes.

Thanks very much!
Comment 7 Doug Kirk 2016-09-06 01:46:44 UTC
Of course I meant I installed a new if_iwm.ko, not if_iwm.kld.
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-09-06 10:08:57 UTC
A commit references this bug:

Author: avos
Date: Tue Sep  6 10:08:33 UTC 2016
New revision: 305470
URL: https://svnweb.freebsd.org/changeset/base/305470

Log:
  iwm: fix scanning for hidden SSIDs.

  Setup SSIDs in scan command so firmware will send direct probe request(s)
  while scanning.

  Tested by:	dbkirk@gmail.com

  PR:		211519
  MFC after:	1 week

Changes:
  head/sys/dev/iwm/if_iwm_scan.c
  head/sys/dev/iwm/if_iwmreg.h
Comment 9 commit-hook freebsd_committer freebsd_triage 2016-09-13 05:48:51 UTC
A commit references this bug:

Author: avos
Date: Tue Sep 13 05:47:59 UTC 2016
New revision: 305762
URL: https://svnweb.freebsd.org/changeset/base/305762

Log:
  MFC r305470:

  iwm: fix scanning for hidden SSIDs.

  Setup SSIDs in scan command so firmware will send direct probe request(s)
  while scanning.

  Tested by:	dbkirk@gmail.com

  PR:		211519

Changes:
_U  stable/11/
  stable/11/sys/dev/iwm/if_iwm_scan.c
  stable/11/sys/dev/iwm/if_iwmreg.h