# How can I solve the issue with driver support?



## Sukbeom Kim (Jun 13, 2015)

Hi, all. I'm totally newbie in bsdFreeBSD and I want to ask about driver support.
(I've used Gentoo linux and Arch linux...But I decided to move onto bsdFreeBSD.)

I tried to install bsdFreeBSD on my laptop few months ago, but I faced to driver issue with Intel 7260 wireless support at that time. I'm not sure that the issue is solved now.

The result of `lspci` is like this:

```
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
00:04.0 Signal processing controller: Intel Corporation Device 0a03 (rev 09)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)
00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b)
```
I want to know whether I can enjoy freebsdFreeBSD on my laptop. If not, is there any alternative BSD? or do I have to wait until the driver is supported?


----------



## woodsb02 (Jun 15, 2015)

Sukbeom Kim said:


> I faced to driver issue with Intel 7260 wireless support


This driver is under active development by Rui Paolo and Adrian Chadd, but is not yet included in FreeBSD.

If you want to try the early development driver, you could do the following (note you will need a different network connection to download packages):

Ensure you have the FreeBSD source code for your release available in /usr/src. You can select the source code to be installed during the FreeBSD installation.
Install the git package: `# pkg install git`
Check out the latest driver code into your home directory: `$ cd ~/ && git clone [URL]https://github.com/rpaulo/iwm[/URL].git`
Build the driver: `cd ~/iwm/ && make`
Install the driver and firmware: `# cp driver/if_iwm.ko driver/if_iwm.ko.symbols iwmfw/iwm7260fw.ko /boot/kernel/`
Load the driver: `# kldload iwm7260fw` and `# kldload if_iwm` (consider adding entries to /boot/loader.conf to load the driver at boot time)
Configure your new iwm0 interface by following the normal FreeBSD handbook chapter: https://www.freebsd.org/doc/handbook/network-wireless.html

Good luck!


----------



## Terry_Kennedy (Jun 17, 2015)

Sukbeom Kim said:


> or do I have to wait until the driver is supported?


If there is a Windows NDIS driver available, you can convert it with ndisgen(8) until a native driver is available.


----------



## Juanitou (Sep 6, 2015)

iwm(4) is working nicely for me in FreeBSD-CURRENT since r286441.


----------



## forquare (Sep 30, 2015)

Juanitou said:


> iwm(4) is working nicely for me in FreeBSD-CURRENT since r286441.



I’ve seen that there could be a regression in current—could someone suggest a branch for me to test the new iwm driver, possibly before this regression set in?


----------



## woodsb02 (Sep 30, 2015)

forquare said:


> I’ve seen that there could be a regression in current



I am not convinced that is actually a regression in CURRENT. I believe it could be the result of a recent change in current to make it such that wireless "parent interfaces" are no longer listed in the output of ifconfig(8), but instead they are listed in the output of `# sysctl net.wlan.devices`. Other than that there is no change to the configuration required to bring up wireless devices. We are waiting on the bug reporter to confirm this is the case, and that there is no regression.

The change that brought this difference in behaviour was committed to current on 20150827 in r287197:
https://svnweb.freebsd.org/base?view=revision&revision=287197

This update was described in the following UPDATING entry:

```
20150827:
The wireless drivers had undergone changes that remove the 'parent
interface' from the ifconfig -l output. The rc.d network scripts
used to check presence of a parent interface in the list, so old
scripts would fail to start wireless networking. Thus, etcupdate(3)
or mergemaster(8) run is required after kernel update, to update your
rc.d scripts in /etc.
```


----------



## Zipferlake (Oct 30, 2015)

Juanitou said:


> iwm(4) is working nicely for me in FreeBSD-CURRENT since r286441.


Hello, sorry to butt in, but there is only scarce information about the iwm(4) driver under FreeBSD.
I have problems getting iwm(4) working with an Intel Dual Band Wireless AC 3160 (I have a Zotac ZBox RI323). The console message states 
	
	



```
fatal firmware error
...
could not move to auth state: 35
```
.
Now, this could be MB/FW related, but as a BIOS Update is only possible under DOS/Windows, I would like to confirm that there are no known problems with the iwm(4) driver as such (I have build CURRENT at r290151).
I am thinking about starting a new thread here under System Hardware, but it would be nice if you could tell me a bit more about your experience with this particular driver beforehand.


----------



## Juanitou (Oct 31, 2015)

Hello Zipferlake.

You should open a PR. As the manual page says, fatal firmware errors should not happen. On the other hand, the iwm(4) commits state that the driver is not very stable yet. I’ve had some crashes with it, seemingly when rebooting just after some heavy network usage, but I have not had the time to investigate. Besides that, it is working well out of the box for my humble needs: no roaming, moving from a room to another at home.

Could you explain the steps leading to the error?


----------



## Zipferlake (Oct 31, 2015)

Hi Juanitou, thxthanks for taking an interest.

The error occurs when I try to connect to an AP after the following steps: loading kernel module+firmware, creating wlan0 interface and starting wpa_supplicant(8) (see messages below - posting here as file upload does not work ...).

```
kldload if_iwm
ifconfig wlan0 create wlandev iwm0 wlanmode sta ssid NET.HAYAT_WLAN_01 channel 7
/etc/rc.d/wpa_supplicant start wlan0
```

I have an old VIA Epia ML Board with an PCI Atheros 5212 WLAN Card working under FreeBSD 8 just fine connecting to the same AP (I copied the wpa_supplicant.conf, so I know it is not a configuration problem)


```
Oct 31 21:42:05 kartal kernel: iwm0: <Intel Dual Band Wireless AC 3160> mem 0xf7c00000-0xf7c01fff irq 18 at device 0.0 on pci1
Oct 31 21:42:05 kartal kernel: iwm0: revision: 0x160, firmware 25.228 (API ver. 9)
Oct 31 21:42:05 kartal kernel: wlan0: Ethernet address: 34:e6:ad:50:55:87
Oct 31 21:51:52 kartal kernel: ieee80211_load_module: load the wlan_xauth module by hand for now.
Oct 31 21:53:27 kartal wpa_supplicant[1316]: Successfully initialized wpa_supplicant
Oct 31 21:53:32 kartal wpa_supplicant[1317]: wlan0: Trying to associate with 00:15:0c:4e:9f:52 (SSID='NET.HAYAT_WLAN_01' freq=2442 MHz)
Oct 31 21:53:32 kartal kernel: iwm0: iwm_update_edca: called
Oct 31 21:53:42 kartal wpa_supplicant[1317]: wlan0: Authentication with 00:15:0c:4e:9f:52 timed out.
Oct 31 21:53:42 kartal wpa_supplicant[1317]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:15:0c:4e:9f:52 reason=3 locally_generated=1
Oct 31 21:53:47 kartal wpa_supplicant[1317]: wlan0: Trying to associate with 00:15:0c:4e:9f:52 (SSID='NET.HAYAT_WLAN_01' freq=2442 MHz)
Oct 31 21:53:47 kartal kernel: iwm0: iwm_update_edca: called
Oct 31 21:53:47 kartal kernel: iwm0: dumping device error log
Oct 31 21:53:47 kartal kernel: iwm0: Start IWL Error Log Dump:
Oct 31 21:53:47 kartal kernel: iwm0: Status: 0x3, count: 6
Oct 31 21:53:47 kartal kernel: iwm0: 0x00003001 | ADVANCED_SYSASSERT 
Oct 31 21:53:47 kartal kernel: iwm0: 000002F0 | uPc
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | branchlink1
Oct 31 21:53:47 kartal kernel: iwm0: 00000BA4 | branchlink2
Oct 31 21:53:47 kartal kernel: iwm0: 00014B7C | interruptlink1
Oct 31 21:53:47 kartal kernel: iwm0: 003E946A | interruptlink2
Oct 31 21:53:47 kartal kernel: iwm0: 00000001 | data1
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | data2
Oct 31 21:53:47 kartal kernel: iwm0: DEADBEEF | data3
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | beacon time
Oct 31 21:53:47 kartal kernel: iwm0: 01253FB2 | tsf low
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | tsf hi
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | time gp1
Oct 31 21:53:47 kartal kernel: iwm0: 01253FB2 | time gp2
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | time gp3
Oct 31 21:53:47 kartal kernel: iwm0: 000419E4 | uCode version
Oct 31 21:53:47 kartal kernel: iwm0: 00000164 | hw version
Oct 31 21:53:47 kartal kernel: iwm0: 00809004 | board version
Oct 31 21:53:47 kartal kernel: iwm0: 0923002B | hcmd
Oct 31 21:53:47 kartal kernel: iwm0: 00022080 | isr0
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | isr1
Oct 31 21:53:47 kartal kernel: iwm0: 00000002 | isr2
Oct 31 21:53:47 kartal kernel: iwm0: 0041C0C0 | isr3
Oct 31 21:53:47 kartal kernel: iwm0: 00000001 | isr4
Oct 31 21:53:47 kartal kernel: iwm0: 01000112 | isr_pref
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | wait_event
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | l2p_control
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | l2p_duration
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | l2p_mhvalid
Oct 31 21:53:47 kartal kernel: iwm0: 00000000 | l2p_addr_match
Oct 31 21:53:47 kartal kernel: iwm0: 00000005 | lmpm_pmg_sel
Oct 31 21:53:47 kartal kernel: iwm0: 20111734 | timestamp
Oct 31 21:53:47 kartal kernel: iwm0: 00003840 | flow_handler
Oct 31 21:53:47 kartal kernel: iwm0: driver status:
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  0: qid=0  cur=1  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  1: qid=1  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  2: qid=2  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  3: qid=3  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  4: qid=4  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  5: qid=5  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  6: qid=6  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  7: qid=7  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  8: qid=8  cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring  9: qid=9  cur=36  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 10: qid=10 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 11: qid=11 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 12: qid=12 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 13: qid=13 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 14: qid=14 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 15: qid=15 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 16: qid=16 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 17: qid=17 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 18: qid=18 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  tx ring 19: qid=19 cur=0  queued=0
Oct 31 21:53:47 kartal kernel: iwm0:  rx ring: cur=59
Oct 31 21:53:47 kartal kernel: iwm0:  802.11 state 1
Oct 31 21:53:47 kartal kernel: iwm0: fatal firmware error
Oct 31 21:53:48 kartal kernel: iwm0: iwm_auth: binding cmd
Oct 31 21:53:48 kartal kernel: iwm0: iwm_newstate: could not move to auth state: 35
Oct 31 21:53:57 kartal wpa_supplicant[1317]: wlan0: Authentication with 00:15:0c:4e:9f:52 timed out.
Oct 31 21:53:57 kartal wpa_supplicant[1317]: wlan0: CTRL-EVENT-DISCONNECTED bssid=00:15:0c:4e:9f:52 reason=3 locally_generated=1
Oct 31 21:53:57 kartal wpa_supplicant[1317]: wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="NET.HAYAT_WLAN_01" auth_failures=1 duration=10 reason=CONN_FAILED
Oct 31 21:53:57 kartal kernel: iwm0: could not initiate scan
```

Regards, Stefan


----------



## Juanitou (Nov 1, 2015)

Sorry, I cannot help. In my case, I had to add WPA to the ifconfig(8) configuration for the authentication to work and there is no wlanmode sta, but I don’t think this is relevant, neither I remember having firmware errors before I discovered the correct parameters. I reckon you have all the information needed by developers to discover where the problem lies. Please open a PR.


----------



## Zipferlake (Nov 1, 2015)

Hi Juanitou,

thanks for Your input!  - By the way, what chipset do you have  AC 3160 or 7260?

In the meanwhile I have installed CentOS7 on a second disk and I have run into similar errors; the WLan interface can be created, I can even scan and find my AP but I cannot connect (though the error message is somewhat obscure).

Therefore and with your insurance, that apart from minor problems the iwm driver should work, I suppose I have to try and update the Firmware on my MB (even if I have to find a means to get a DOS Boot Stick or a DOS PXE Bootimage). If the error continue I will certainly open a PR.

Regards, Stefan


----------



## Juanitou (Nov 1, 2015)

Zipferlake said:


> By the way, what chipset do you have AC 3160 or 7260?


7260.


----------



## tingo (Dec 8, 2015)

Quick question: has anyone tried the iwm(4) driver (from -current) in FreeBSD 10.2-stable? AFAICT it is not MFC'ed yet.
I've just got myself a new laptop, and it has a Wireless 3160 inside. The laptop is so new that I haven't installed FreeBSD on it yet.


----------



## woodsb02 (Dec 8, 2015)

tingo said:


> Quick question: has anyone tried the iwm(4) driver (from -current) in FreeBSD 10.2-stable? AFAICT it is not MFC'ed yet.
> I've just got myself a new laptop, and it has a Wireless 3160 inside. The laptop is so new that I haven't installed FreeBSD on it yet.


As you say, it has not been merged from current to FreeBSD 10-STABLE yet.

There are a few bugs in the iwm(4) driver (wifi tends to report a number of errors and require regular resetting of the wifi NIC). Unless these are sorted out, I doubt this driver will be MFC'd.


----------



## tingo (Dec 12, 2015)

After installing latest FreeBSD 10.2-STABLE on my new laptop, I decided to see if the iwm(4) driver would build on -STABLE, so I checked out the source from -CURRENT and had a go.
firmware

```
root@kg-z30b# make
===> iwm3160fw (all)
Warning: Object directory not changed from original /usr/src/sys/modules/iwmfw/iwm3160fw
uudecode -p /usr/src/sys/modules/iwmfw/iwm3160fw/../../../contrib/dev/iwm/iwm-3160-9.fw.uu > iwm-3160-9.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
iwm-3160-9.fw iwm-3160-9.fw
awk -f @/tools/fw_stub.awk iwm-3160-9.fw:iwm3160fw -miwm3160fw -ciwm3160fw.c 
cc -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I@ -I@/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments  -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -c iwm3160fw.c -o iwm3160fw.o
ld  -d -warn-common -r -d -o iwm3160fw.ko iwm-3160-9.fw.fwo iwm3160fw.o
:> export_syms
awk -f /usr/src/sys/modules/iwmfw/iwm3160fw/../../../conf/kmod_syms.awk iwm3160fw.ko  export_syms | xargs -J% objcopy % iwm3160fw.ko
objcopy --strip-debug iwm3160fw.ko
===> iwm7260fw (all)
Warning: Object directory not changed from original /usr/src/sys/modules/iwmfw/iwm7260fw
uudecode -p /usr/src/sys/modules/iwmfw/iwm7260fw/../../../contrib/dev/iwm/iwm-7260-9.fw.uu > iwm-7260-9.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
iwm-7260-9.fw iwm-7260-9.fw
awk -f @/tools/fw_stub.awk iwm-7260-9.fw:iwm7260fw -miwm7260fw -ciwm7260fw.c 
cc -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I@ -I@/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments  -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -c iwm7260fw.c -o iwm7260fw.o
ld  -d -warn-common -r -d -o iwm7260fw.ko iwm-7260-9.fw.fwo iwm7260fw.o
:> export_syms
awk -f /usr/src/sys/modules/iwmfw/iwm7260fw/../../../conf/kmod_syms.awk iwm7260fw.ko  export_syms | xargs -J% objcopy % iwm7260fw.ko
objcopy --strip-debug iwm7260fw.ko
===> iwm7265fw (all)
Warning: Object directory not changed from original /usr/src/sys/modules/iwmfw/iwm7265fw
uudecode -p /usr/src/sys/modules/iwmfw/iwm7265fw/../../../contrib/dev/iwm/iwm-7265-9.fw.uu > iwm-7265-9.fw
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
iwm-7265-9.fw iwm-7265-9.fw
awk -f @/tools/fw_stub.awk iwm-7265-9.fw:iwm7265fw -miwm7265fw -ciwm7265fw.c 
cc -O2 -pipe  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I@ -I@/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments  -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -c iwm7265fw.c -o iwm7265fw.o
ld  -d -warn-common -r -d -o iwm7265fw.ko iwm-7265-9.fw.fwo iwm7265fw.o
:> export_syms
awk -f /usr/src/sys/modules/iwmfw/iwm7265fw/../../../conf/kmod_syms.awk iwm7265fw.ko  export_syms | xargs -J% objcopy % iwm7265fw.ko
objcopy --strip-debug iwm7265fw.ko
```
so that worked ok.
Next, the module itself:

```
root@kg-z30b# make
Warning: Object directory not changed from original /usr/src/sys/modules/iwm
@ -> /usr/src/sys
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f @/tools/makeobjops.awk @/kern/device_if.m -h
awk -f @/tools/makeobjops.awk @/kern/bus_if.m -h
awk -f @/tools/makeobjops.awk @/dev/pci/pci_if.m -h
:> opt_wlan.h
cc -O2 -pipe  -DIWM_DEBUG -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I@ -I@/contrib/altq -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments  -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions  -Wmissing-include-dirs -fdiagnostics-show-option  -Wno-error-tautological-compare -Wno-error-empty-body  -Wno-error-parentheses-equality -Wno-error-unused-function  -c /usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c -o if_iwm.o
In file included from /usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:152:
@/dev/iwm/if_iwmvar.h:385:16: error: field has incomplete type 'struct mbufq'
  struct mbufq  sc_snd;
  ^
@/dev/iwm/if_iwmvar.h:385:9: note: forward declaration of 'struct mbufq'
  struct mbufq  sc_snd;
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2084:33: error: no member named 'ic_macaddr' in 'struct ieee80211com'
  IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->sc_nvm.hw_addr);
  ~~~~~~~~~ ^
@/net80211/ieee80211_var.h:511:45: note: expanded from macro 'IEEE80211_ADDR_COPY'
#define IEEE80211_ADDR_COPY(dst,src)  memcpy(dst,src,IEEE80211_ADDR_LEN)
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2348:17: error: use of undeclared identifier 'IEEE80211_R_IEEE'
  rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2348:36: error: use of undeclared identifier 'IEEE80211_R_FREQ'
  rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2350:6: error: no member named 'c_ieee' in
  'struct ieee80211_rx_stats'
  rxs.c_ieee = le16toh(phy_info->channel);
  ~~~ ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2352:7: error: no member named 'c_freq' in
  'struct ieee80211_rx_stats'
  rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ);
  ~~~ ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2352:39: error: no member named 'c_ieee' in
  'struct ieee80211_rx_stats'
  rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ);
  ~~~ ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2354:7: error: no member named 'c_freq' in
  'struct ieee80211_rx_stats'
  rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ);
  ~~~ ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2354:39: error: no member named 'c_ieee' in
  'struct ieee80211_rx_stats'
  rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ);
  ~~~ ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2365:35: error: no member named 'c_freq' in
  'struct ieee80211_rx_stats'
  tap->wr_chan_freq = htole16(rxs.c_freq);
  ~~~ ^
@/sys/endian.h:71:32: note: expanded from macro 'htole16'
#define htole16(x)  ((uint16_t)(x))
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:2871:29: error: no member named 'ic_softc' in 'struct ieee80211com'
  struct iwm_softc *sc = ic->ic_softc;
  ~~  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3482:29: error: no member named 'ic_softc' in 'struct ieee80211com'
  struct iwm_softc *sc = ic->ic_softc;
  ~~  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3504:29: error: no member named 'ic_softc' in 'struct ieee80211com'
  struct iwm_softc *sc = ic->ic_softc;
  ~~  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3778:11: error: no member named 'ic_softc' in 'struct ieee80211com'
  sc = ic->ic_softc;
  ~~  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3785:10: error: implicit declaration of function 'mbufq_enqueue' is
  invalid in C99 [-Werror,-Wimplicit-function-declaration]
  error = mbufq_enqueue(&sc->sc_snd, m);
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3807:8: error: implicit declaration of function 'mbufq_dequeue' is
  invalid in C99 [-Werror,-Wimplicit-function-declaration]
  (m = mbufq_dequeue(&sc->sc_snd)) != NULL) {
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3807:8: note: did you mean 'mbufq_enqueue'?
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3785:10: note: 'mbufq_enqueue' declared here
  error = mbufq_enqueue(&sc->sc_snd, m);
  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3845:30: error: no member named 'ic_oerrors' in 'struct ieee80211com'
  counter_u64_add(sc->sc_ic.ic_oerrors, 1);
  ~~~~~~~~~ ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:3855:29: error: no member named 'ic_softc' in 'struct ieee80211com'
  struct iwm_softc *sc = ic->ic_softc;
  ~~  ^
/usr/src/sys/modules/iwm/../../dev/iwm/if_iwm.c:4600:2: error: implicit declaration of function 'mbufq_init' is
  invalid in C99 [-Werror,-Wimplicit-function-declaration]
  mbufq_init(&sc->sc_snd, ifqmaxlen);
  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error code 1

Stop.
make: stopped in /usr/src/sys/modules/iwm
```
all this on

```
root@kg-z30b# uname -a
FreeBSD kg-z30b.kg4.no 10.2-STABLE FreeBSD 10.2-STABLE #0 r292123: Sat Dec 12 00:58:41 CET 2015
  root@kg-z30b.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
I haven't tried doing anything more with it.


----------



## Terry_Kennedy (Dec 14, 2015)

tingo said:


> I haven't tried doing anything more with it.


You may have better luck taking the diff that added the feature you want and trying to patch the driver with that diff, rather than trying to import the whole driver. Sometimes the change you want has few or no dependencies on changes to driver style that may exist between any -STABLE branch and HEAD.


----------



## tingo (Dec 14, 2015)

Yes. Unfortunately, this driver was built/created in -CURRENT; it didn't exist in any other branch, AFAIK. So there really isn't any diff or anything to patch.


----------



## Terry_Kennedy (Dec 15, 2015)

tingo said:


> Yes. Unfortunately, this driver was built/created in -CURRENT; it didn't exist in any other branch, AFAIK. So there really isn't any diff or anything to patch.


Oh well - it was worth a try. Two other ideas:

1 - You could contact that developer and ask if they have a version for your FreeBSD release, and offer to test it thoroughly and report back. In some other cases I've done that and it has resulted in either the driver getting MFC'd or at least definitively knowing that it won't work on an older release.

2 - You could do a diff on a similar driver that exists in both your FreeBSD release and CURRENT, to get an idea what sort of changes were made to the driver structure, then try to edit the driver you're interested in to reflect those same changes. I've also done this in the past.


----------



## Deleted member 48269 (Jan 2, 2016)

I just installed FreeBSD-CURRENT (r292858) on my Thinkpad X240, activating the if_iwm(4) module gives the following output:

```
iwm0: <Intel Dual Band Wireless AC 7260> mem 0xf0400000-0xf0401fff at device 0.0 on pci2
iwm0: revision: 0x140, firmware 25.228 (API ver. 9)
```
However the interface is not present in the output from `ifconfig`. Any ideas on how to debug/solve this issue would be much appreciated.


----------



## tingo (Jan 2, 2016)

It is already described in this thread. Check message #6.


----------



## Deleted member 48269 (Jan 2, 2016)

tingo said:


> It is already described in this thread. Check message #6.


My bad, thanks for pointing out.

I also found this guide helpful:
https://forums.pcbsd.org/thread-20252-post-112175.html#pid112175


----------



## rayit (Jan 11, 2016)

I managed to get iwm working on FreeBSD 11 CURRENT,
`ifconfig wlan0 create wlandev iwm0`, and everything works good.

But I can not get it created during boot.
/etc/rc.conf

```
...
hostname="raya1.rayit.com"
wlans_iwm0="wlan0"
ifconfig_wlan0="WPA DHCP"
#ifconfig_wlan0="-ht WPA DHCP powersave country NL"
...
```
/boot/loader.conf

```
...
if_iwm_load="YES"
iwm7265fw_load="YES"
#iwm7260fw_load="YES"
legal.intel_iwm.license_ack=1
...
```

Somebody any idea?


----------



## sluggo (Jan 11, 2016)

rayit said:


> I managed to get iwm working on FreeBSD 11 CURRENT,
> `ifconfig wlan0 create wlandev iwm0`, and everything works good.
> 
> But I can not get it created during boot.
> ...



What revision are you running? And do you get the fatal firmware error when trying to create it at boot?
I'm also on CURRENT (r293687), iwm and associates compiled into the kernel and getting the error (on boot and after). Can't seem to get the ac7260 up and running..


----------



## rayit (Jan 12, 2016)

I updated from 10.2 to 11-CURRENT, and after adding 3 lines to the boot loader I could run:
`ifconfig wlan0 create wlandev iwm0`
I do not see fatal firmware errors.

So the iwm(4) code is already in 11-CURRENT.
I will look this evening what version and laptop I have.


----------



## rayit (Jan 21, 2016)

Asus UX305F is the laptop


----------



## mcastelobr (Apr 8, 2016)

I got FreeBSD 11 CURRENT too and have the same problem.
Configuring the loader.conf and rc.conf files I get errors and can't get iwn(4) to work.
And the commands on the console just work when I remove the commands from the files.
I just write a script and exec the script after the boot.
That's my temporary solution.
With this solution the driver is very stable. I don't have problems.
Unfortunately I don't have time to explore another solution.


----------



## SirDice (Apr 8, 2016)

Just so you know: Topics about unsupported FreeBSD versions


----------



## sluggo (Apr 8, 2016)

mcastelobr said:


> I got FreeBSD 11 CURRENT too and have the same problem.
> Configuring the loader.conf and rc.conf files I get errors and can't get iwn(4) to work.
> And the commands on the console just work when I remove the commands from the files.
> I just write a script and exec the script after the boot.
> ...


There seems to still be some trouble with the iwm(4) driver, at least in combination with the 7260-firmware (iwmfw(4)). I still get the firmware error if either or both are added as `device`s in my KERNCONF, or if the `wlandevice` is created during boot (i.e. `wlans_iwm0="wlan0"`, or similar, in /etc/rc.conf). However, as rayit described earlier, loading the driver and firmware at boot like so:
/boot/loader.conf

```
...
if_iwm_load="YES"
iwm7260fw_load="YES"
legal.intel_iwm.license_ack=1
...
```
 and the creating the `wlandevice` after login works well for me to, running 11.0-CURRENT (r297558).


----------



## mcastelobr (Apr 9, 2016)

Thanks everybody !

Reading sluggo post and gaussjordan's link the configuration works on my note (Dell and Intel 7265 wifi)

I don't know exactly how because the others configurations I've tested are technically correct.

Well, this solution works for me and I don't need to type anything else on terminal:

/boot/loader.conf

```
#Load WiFi

if_iwm_load="YES"
iwm7265fw_load="YES"

wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"

legal.intel_ipm.license_ack=1
legal.intel_iwm.license_ack=1
legal.intel_iwi.license_ack=1
```
/etc/rc.conf

```
wlans_iwm0="wlan0"
ifconfig_wlan0="-ht WPA SYNCDHCP"
```
/etc/wpa_supplicant.conf

```
network={
ssid="RouterName"
key_mgmt=WPA-PSK
psk="yourpassword"
}
```


----------



## sluggo (Apr 9, 2016)

After updating to r297752 adding the driver to my KERNCONF does work!
/usr/src/sys/amd64/conf/X220KERNCONF

```
...
device   iwm
device   iwm7260fw
...
```
/etc/rc.conf

```
...
wlans_iwm0="wlan0"
...
```
 I've only tested it 2.4GHz/n thus far  and unfortunately won't be able to test 5GHz/ac or n for at least another week. Another improvement is that toggling the physical switch for the wifi-card also works (after `ifconfig wlan0 destroy`ing and re`create`ing it), which used to cause panics.


----------

