[SOLVED] Wireless passthrough to a VM

I run OpenWrt in a VM. I have added and passed through a wireless network adapter
HP Intel 9260 802.11ac PCIe x1- 3TK89AA

IT does not show up in the kernel log though and I do not have lspci yet.

How can I install lspci to see if OpenWrt does see the adapter and how can I install the proper drivers for it in OpenWrt so that I can see a wireless menu item in the luci interface?

Provide the standard NAT connectivity and install the following packages:

Then you can proceed with PCI passthrough.

Be aware that Intel wireless cards are predominantly used for client mode (STA), AP mode is basically unsupported (only in the 2.4 GHz band, no AP mode for 5 GHz).

2 Likes

Quite normally via opkg, as "pciutils".

root@router4:~# opkg update
Downloading https://downloads.openwrt.org/snapshots/targets/mediatek...

root@router4:~# opkg install pciutils
Installing pciutils (3.7.0-2) to root...
...
Configuring libpci.
Configuring pciids.
Configuring libkmod.
Configuring pciutils.

root@router4:~# lspci
00:00.0 PCI bridge: MEDIATEK Corp. Device 3258
01:00.0 Unclassified device [0002]: MEDIATEK Corp. MT7915E 802.11ax PCI Express Wireless Network Adapter
1 Like

Thanks all for your valuable input. This was super easy and luci now shows the wireless menu item.

Can one recommend another pci card that does do AP mode on 5Ghz aswell?

Yes sir, I forgot to do an update first so that is why at first it could not find pciutils.

ugg, not solved yet ;( I do not have encryption options yet while creating the wireless interface.

I am running OpenWrt 21.02.1 r16325-88151b8303
was not WPA3 supported by default? let alone the older versions of wireless encryption?

lol, WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP and ad-hoc mode) to be installed.
I must stop being dislectic

Things seem a bit more involved that expected

[   48.688921] WARNING: CPU: 0 PID: 1862 at 0xffffffffa01c693c [cfg80211@0000000065656494+0x44000]
[   48.689983] Modules linked in: pppoe ppp_async iwlmvm iwldvm iptable_nat xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mac80211 iwlwifi ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc r8169 nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables forcedeth e1000e crc_ccitt compat bnx2 i2c_dev nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ixgbe igb e1000 mdio nls_utf8 nls_iso8859_1 nls_cp437 vfat fat button_hotplug ptp realtek pps_core mii libphy
[   48.696538] CPU: 0 PID: 1862 Comm: rpcd Tainted: G        W         5.4.154 #0
[   48.697430] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
[   48.699040] RIP: 0010:0xffffffffa01c693c [cfg80211@0000000065656494+0x44000]
[   48.699977] Code: 9a 00 00 00 48 89 df c7 45 d4 01 00 00 00 e8 9b 50 19 e1 85 c0 0f 84 35 ff ff ff 48 89 df e8 ab 90 57 e1 b8 a6 ff ff ff eb 81 <0f> 0b 48 89 df e8 9a 90 57 e1 b8 ea ff ff ff e9 6d ff ff ff eb db
[   48.702209] RSP: 0018:ffffc900001c3a50 EFLAGS: 00010202
[   48.703004] RAX: 0000000000000000 RBX: ffff88801d7dce00 RCX: 0000000000000000
[   48.703937] RDX: ffff88801dcb0008 RSI: 0000000000000000 RDI: ffff88801dcb0300
[   48.704881] RBP: ffffc900001c3a88 R08: 0000000000000004 R09: ffff88801cd81014
[   48.705842] R10: ffffffffa01e9000 R11: 0000000000000004 R12: ffffc900001c3ab8
[   48.706800] R13: 0000000000000000 R14: ffff88801cd81014 R15: ffff88801dcb0300
[   48.707763] FS:  00007efe88bd1d48(0000) GS:ffff88801f400000(0000) knlGS:0000000000000000
[   48.708795] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   48.709659] CR2: 00007fcbcd959005 CR3: 000000001d956000 CR4: 00000000000006f0
[   48.710633] Call Trace:
[   48.711295]  0xffffffff817ad41a
[   48.711994]  0xffffffff817ad673
[   48.712704]  ? 0xffffffff817ad630
[   48.713414]  0xffffffff817abf7a
[   48.714122]  0xffffffff817ac553
[   48.714831]  0xffffffff817ab866
[   48.715529]  0xffffffff817abac3
[   48.716249]  ? 0xffffffff817ab8e0
[   48.716967]  0xffffffff81734ae6
[   48.717672]  ? 0xffffffff81733ecd
[   48.718384]  0xffffffff81734b8a
[   48.719087]  ? 0xffffffff811022bb
[   48.719797]  ? 0xffffffff811ef2b0
[   48.720525]  ? 0xffffffff811ef8b4
[   48.721257]  ? 0xffffffff818f9ad4
[   48.721966]  ? 0xffffffff811eb69f
[   48.722646]  0xffffffff81735bd0
[   48.723305]  0xffffffff81735c1a
[   48.723961]  0xffffffff81002e94
[   48.724615]  ? 0xffffffff81054099
[   48.725269]  0xffffffff81a0008c
[   48.725912] RIP: 0033:0x7efe88bb3315
[   48.726584] Code: c3 8b 07 85 c0 75 24 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> e9 19 d3 ff ff 41 54 b8 02 00 00 00 49 89 f4 be 00 08 08 00 55
[   48.728779] RSP: 002b:00007fffd7639938 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[   48.729747] RAX: ffffffffffffffda RBX: 00007efe88bd1d48 RCX: 00007efe88bb3315
[   48.730670] RDX: 0000000000000000 RSI: 00007fffd7639988 RDI: 0000000000000007
[   48.731610] RBP: 000000000000002e R08: 0000000000000000 R09: 0000000000000000
[   48.732570] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[   48.733504] R13: 00007fffd763ff14 R14: 0000000000000001 R15: 00005618d1779208
[   48.734442] ---[ end trace adcdb844a1c8a33e ]---
[   49.285499] ------------[ cut here ]------------
[   49.286274] WARNING: CPU: 0 PID: 1862 at 0xffffffffa01c693c [cfg80211@0000000065656494+0x44000]
[   49.287267] Modules linked in: pppoe ppp_async iwlmvm iwldvm iptable_nat xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mac80211 iwlwifi ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc r8169 nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables forcedeth e1000e crc_ccitt compat bnx2 i2c_dev nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ixgbe igb e1000 mdio nls_utf8 nls_iso8859_1 nls_cp437 vfat fat button_hotplug ptp realtek pps_core mii libphy
[   49.293889] CPU: 0 PID: 1862 Comm: rpcd Tainted: G        W         5.4.154 #0
[   49.294791] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
[   49.296407] RIP: 0010:0xffffffffa01c693c [cfg80211@0000000065656494+0x44000]
[   49.297314] Code: 9a 00 00 00 48 89 df c7 45 d4 01 00 00 00 e8 9b 50 19 e1 85 c0 0f 84 35 ff ff ff 48 89 df e8 ab 90 57 e1 b8 a6 ff ff ff eb 81 <0f> 0b 48 89 df e8 9a 90 57 e1 b8 ea ff ff ff e9 6d ff ff ff eb db
[   49.299455] RSP: 0018:ffffc900001c3a50 EFLAGS: 00010202
[   49.300253] RAX: 0000000000000000 RBX: ffff88801d7de200 RCX: 0000000000000000
[   49.301182] RDX: ffff88801dcb0008 RSI: 0000000000000000 RDI: ffff88801dcb0300
[   49.302120] RBP: ffffc900001c3a88 R08: 0000000000000004 R09: ffff88801cd81014
[   49.303048] R10: ffffffffa01e9000 R11: 0000000000000004 R12: ffffc900001c3ab8
[   49.303989] R13: 0000000000000000 R14: ffff88801cd81014 R15: ffff88801dcb0300
[   49.304979] FS:  00007efe88bd1d48(0000) GS:ffff88801f400000(0000) knlGS:0000000000000000
[   49.306032] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   49.306972] CR2: 00007f84d679a005 CR3: 000000001d956000 CR4: 00000000000006f0
[   49.307983] Call Trace:
[   49.308658]  0xffffffff817ad41a
[   49.309360]  0xffffffff817ad673
[   49.310055]  ? 0xffffffff817ad630
[   49.310787]  0xffffffff817abf7a
[   49.311495]  0xffffffff817ac553
[   49.312204]  0xffffffff817ab866
[   49.312912]  0xffffffff817abac3
[   49.313612]  ? 0xffffffff817ab8e0
[   49.314324]  0xffffffff81734ae6
[   49.315020]  ? 0xffffffff81733ecd
[   49.315741]  0xffffffff81734b8a
[   49.316452]  ? 0xffffffff811022bb
[   49.317167]  ? 0xffffffff811ef2b0
[   49.317885]  ? 0xffffffff811ef8b4
[   49.318597]  ? 0xffffffff818f9ad4
[   49.319294]  ? 0xffffffff811eb69f
[   49.319988]  0xffffffff81735bd0
[   49.320659]  0xffffffff81735c1a
[   49.321312]  0xffffffff81002e94
[   49.321965]  ? 0xffffffff81054099
[   49.322621]  0xffffffff81a0008c
[   49.323265] RIP: 0033:0x7efe88bb3315
[   49.323943] Code: c3 8b 07 85 c0 75 24 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> e9 19 d3 ff ff 41 54 b8 02 00 00 00 49 89 f4 be 00 08 08 00 55
[   49.326121] RSP: 002b:00007fffd7639938 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[   49.327097] RAX: ffffffffffffffda RBX: 00007efe88bd1d48 RCX: 00007efe88bb3315
[   49.328033] RDX: 0000000000000000 RSI: 00007fffd7639988 RDI: 0000000000000007
[   49.328971] RBP: 000000000000002e R08: 0000000000000000 R09: 0000000000000000
[   49.329886] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[   49.330774] R13: 00007fffd763ff14 R14: 0000000000000001 R15: 00005618d1779208
[   49.331650] ---[ end trace adcdb844a1c8a33f ]---

THe wireless interface shows up in a weird state in luci. disabled yet the UI control elements do not seem to agree.

@slh, @hnyman, @vgaetera May I please bother you once more? things seem to not in order and a search did not yield useful results.

I think something low level is going on

[  188.692118] WARNING: CPU: 0 PID: 1862 at 0xffffffffa01c693c [cfg80211@0000000065656494+0x44000]
[  188.693084] Modules linked in: pppoe ppp_async iwlmvm iwldvm iptable_nat xt_state xt_nat xt_conntrack xt_REDIRECT xt_MASQUERADE xt_FLOWOFFLOAD xt_CT pppox ppp_generic nf_nat nf_flow_table_hw nf_flow_table nf_conntrack mac80211 iwlwifi ipt_REJECT cfg80211 xt_time xt_tcpudp xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TCPMSS xt_LOG slhc r8169 nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables forcedeth e1000e crc_ccitt compat bnx2 i2c_dev nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 ixgbe igb e1000 mdio nls_utf8 nls_iso8859_1 nls_cp437 vfat fat button_hotplug ptp realtek pps_core mii libphy
[  188.699701] CPU: 0 PID: 1862 Comm: rpcd Tainted: G        W         5.4.154 #0
[  188.700615] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
[  188.702238] RIP: 0010:0xffffffffa01c693c [cfg80211@0000000065656494+0x44000]
[  188.703140] Code: 9a 00 00 00 48 89 df c7 45 d4 01 00 00 00 e8 9b 50 19 e1 85 c0 0f 84 35 ff ff ff 48 89 df e8 ab 90 57 e1 b8 a6 ff ff ff eb 81 <0f> 0b 48 89 df e8 9a 90 57 e1 b8 ea ff ff ff e9 6d ff ff ff eb db
[  188.705300] RSP: 0018:ffffc900001c3a50 EFLAGS: 00010202
[  188.706104] RAX: 0000000000000000 RBX: ffff88801d7dcc00 RCX: 0000000000000000
[  188.707063] RDX: ffff88801dcb0008 RSI: 0000000000000000 RDI: ffff88801dcb0300
[  188.708016] RBP: ffffc900001c3a88 R08: 0000000000000004 R09: ffff88801cd82014
[  188.708975] R10: ffffffffa01e9000 R11: 0000000000000004 R12: ffffc900001c3ab8
[  188.709925] R13: 0000000000000000 R14: ffff88801cd82014 R15: ffff88801dcb0300
[  188.710910] FS:  00007efe88bd1d48(0000) GS:ffff88801f400000(0000) knlGS:0000000000000000
[  188.711946] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  188.712835] CR2: 00007f12e12a2005 CR3: 000000001d956000 CR4: 00000000000006f0
[  188.713836] Call Trace:
[  188.714509]  0xffffffff817ad41a
[  188.715223]  0xffffffff817ad673
[  188.715948]  ? 0xffffffff817ad630
[  188.716660]  0xffffffff817abf7a
[  188.717359]  0xffffffff817ac553
[  188.718063]  0xffffffff817ab866
[  188.718777]  0xffffffff817abac3
[  188.719472]  ? 0xffffffff817ab8e0
[  188.720184]  0xffffffff81734ae6
[  188.720889]  ? 0xffffffff81733ecd
[  188.721602]  0xffffffff81734b8a
[  188.722319]  ? 0xffffffff811022bb
[  188.723042]  ? 0xffffffff811ef2b0
[  188.723759]  ? 0xffffffff811ef8b4
[  188.724466]  ? 0xffffffff818f9ad4
[  188.725161]  ? 0xffffffff811eb69f
[  188.725839]  0xffffffff81735bd0
[  188.726501]  0xffffffff81735c1a
[  188.727145]  0xffffffff81002e94
[  188.727783]  ? 0xffffffff818f987e
[  188.728431]  ? 0xffffffff81002c28
[  188.729104]  0xffffffff81a0008c
[  188.729750] RIP: 0033:0x7efe88bb3315
[  188.730431] Code: c3 8b 07 85 c0 75 24 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> e9 19 d3 ff ff 41 54 b8 02 00 00 00 49 89 f4 be 00 08 08 00 55
[  188.732627] RSP: 002b:00007fffd7639938 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
[  188.733594] RAX: ffffffffffffffda RBX: 00007efe88bd1d48 RCX: 00007efe88bb3315
[  188.734536] RDX: 0000000000000000 RSI: 00007fffd7639988 RDI: 0000000000000007
[  188.735453] RBP: 000000000000002e R08: 0000000000000000 R09: 0000000000000000
[  188.736350] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[  188.737221] R13: 00007fffd763ff14 R14: 0000000000000001 R15: 00005618d17a7218
[  188.738086] ---[ end trace adcdb844a1c8a35b ]---
[  193.792033] br-lan: port 2(wlan0) entered blocking state
[  193.792852] br-lan: port 2(wlan0) entered disabled state
[  193.793641] device wlan0 entered promiscuous mode
[  193.889625] device wlan0 left promiscuous mode
[  193.890384] br-lan: port 2(wlan0) entered disabled state
[  228.853768] br-lan: port 2(wlan0) entered blocking state
[  228.854563] br-lan: port 2(wlan0) entered disabled state
[  228.855336] device wlan0 entered promiscuous mode
[  228.947377] device wlan0 left promiscuous mode
[  228.948115] br-lan: port 2(wlan0) entered disabled state
[  258.193700] br-lan: port 2(wlan0) entered blocking state
[  258.194529] br-lan: port 2(wlan0) entered disabled state
[  258.195306] device wlan0 entered promiscuous mode
[  266.380649] device wlan0 left promiscuous mode
[  266.381448] br-lan: port 2(wlan0) entered disabled state
[34751.260508] br-lan: port 2(wlan0) entered blocking state
[34751.261247] br-lan: port 2(wlan0) entered disabled state
[34751.261930] device wlan0 entered promiscuous mode
[34759.447279] device wlan0 left promiscuous mode
[34759.447958] br-lan: port 2(wlan0) entered disabled state

Sorry, no experience with OpenWrt at x86 & qemu

What is the final goal of this setup and what is the role of OpenWrt?

OpenWrt is the router, DHCP server and firewall for now. I'd like to add Wireguard (outside the scope of this thread) and it being an Access Point that I will range extend. My current linksys AP, which also runs OpenWrt, started misbehaving after a power outage. I can't be sure if this is really what happened but I promised my self to reduce the amount of components in my network.

1 Like

Now the wifi is working. I can do a channel analysis, which is a new feature in luci, and setup a 2.4Ghz network and join it.

Would anyone have an idea how I can determine what component caused the RIP in the kernel log?

It's not stable at all ;( I will try another card since only having 2.4Ghz is not ideal anyway

1 Like

Yep, unfortunately hardware can become a dealbreaker.
Fixing stability related issues takes months if not years, even if you can contact upstream developers, debug problems, submit bug reports, patch the source code and build it.
So, replacing the incompatible hardware or reorganizing the infrastructure is often the only viable solution.

I was able to avoid the kernel RIP by changing the CPU type from QEMU to Host (AMD Ryzen 5 2600 6 core 12 thread)

[    0.096936] smpboot: CPU0: AMD Ryzen 5 2600 Six-Core Processor (family: 0x17, model: 0x8, stepping: 0x2)
[    0.097934] Performance Events: Fam17h+ core perfctr, AMD PMU driver.
[    0.098585] ... version:                0
[    0.098598] ... bit width:              48
[    0.098598] ... generic registers:      6
[    0.098598] ... value mask:             0000ffffffffffff
[    0.098598] ... max period:             00007fffffffffff
[    0.098602] ... fixed-purpose events:   0
[    0.099049] ... event mask:             000000000000003f
[    0.099652] rcu: Hierarchical SRCU implementation.
[    0.100199] smp: Bringing up secondary CPUs ...
[    0.100690] smp: Brought up 1 node, 1 CPU

The drivers for the wireless card now seem to load neatly

[    9.595709] Intel(R) Wireless WiFi driver for Linux
[    9.722959] PPP generic driver version 2.4.2
[    9.815104] NET: Registered protocol family 24
[    9.816417] iwlwifi 0000:00:11.0: WRT: Overriding region id 0
[    9.817366] iwlwifi 0000:00:11.0: WRT: Overriding region id 1
[    9.818260] iwlwifi 0000:00:11.0: WRT: Overriding region id 2
[    9.819171] iwlwifi 0000:00:11.0: WRT: Overriding region id 3
[    9.820090] iwlwifi 0000:00:11.0: WRT: Overriding region id 4
[    9.820936] iwlwifi 0000:00:11.0: WRT: Overriding region id 6
[    9.821781] iwlwifi 0000:00:11.0: WRT: Overriding region id 8
[    9.822614] iwlwifi 0000:00:11.0: WRT: Overriding region id 9
[    9.823429] iwlwifi 0000:00:11.0: WRT: Overriding region id 10
[    9.824211] iwlwifi 0000:00:11.0: WRT: Overriding region id 11
[    9.824986] iwlwifi 0000:00:11.0: WRT: Overriding region id 15
[    9.825762] iwlwifi 0000:00:11.0: WRT: Overriding region id 16
[    9.826547] iwlwifi 0000:00:11.0: WRT: Overriding region id 18
[    9.827336] iwlwifi 0000:00:11.0: WRT: Overriding region id 19
[    9.828081] iwlwifi 0000:00:11.0: WRT: Overriding region id 20
[    9.828808] iwlwifi 0000:00:11.0: WRT: Overriding region id 21
[    9.829539] iwlwifi 0000:00:11.0: WRT: Overriding region id 28
[    9.832130] iwlwifi 0000:00:11.0: loaded firmware version 46.4d093a30.0 9260-th-b0-jf-b0-46.ucode op_mode iwlmvm
[    9.835044] iwlwifi 0000:00:11.0: Detected Intel(R) Wireless-AC 9260 160MHz, REV=0x324
[    9.968636] iwlwifi 0000:00:11.0: base HW address: 28:df:eb:94:67:f4

But it's still not stable so the current solution, to change the hardware, still stands. I just wanted to update you guys as the CPU type aspect seemed interesting for not only this specific scenario

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.