How to disable Wi-Fi and Bluetooth device

D

Deleted member 65953

Guest
My desktop computer has an "Intel Wi-Fi 6 AX201 Wi-Fi and Bluetooth M.2 combo card", which I have no use for (I have a wired connection). I would like to completely disable the Wi-Fi and Bluetooth card. How do I configure that in FreeBSD 13.2? Would I be able to reduce energy consumption disabling the Wi-Fi and Bluetooth card?

Code:
# kldstat
Id Refs Address                Size Name
 1   52 0xffffffff80200000  1f3e2d0 kernel
 2    1 0xffffffff82140000    1b128 geom_eli.ko
 3    1 0xffffffff8215c000    20c48 geom_mirror.ko
 4    1 0xffffffff8217d000   59dfa8 zfs.ko
 5    1 0xffffffff8271b000     a4a0 cryptodev.ko
 6    1 0xffffffff832f9000     3378 acpi_wmi.ko
 7    1 0xffffffff832fd000     3250 ichsmb.ko
 8    1 0xffffffff83301000     2180 smbus.ko
 9    1 0xffffffff83304000    880c8 if_iwlwifi.ko
10    1 0xffffffff8338d000     2110 pchtherm.ko
11    1 0xffffffff83390000     4d00 ng_ubt.ko
12    3 0xffffffff83395000     aac8 netgraph.ko
13    2 0xffffffff833a0000     a238 ng_hci.ko
14    2 0xffffffff833ab000     25a8 ng_bluetooth.ko
15    1 0xffffffff833ae000    27190 ipfw.ko
16    1 0xffffffff833d6000     2a08 mac_ntpd.ko
17    1 0xffffffff833d9000     23c0 ulpt.ko

I notice that if_iwlwifi.ko and ng_bluetooth.ko are somehow automatically loaded at boot. How should I disable them?
 
If they are indeed automatically loaded (and not integrated in your running kernel), then use the "NO" value for the variable that refers to the relevant module, loader.conf(5):
Code:
	     variable="value"
[...]
       autoboot_delay
		     Delay in seconds before automatically  booting.   A  user
		     with  console  access  will  be  able  to	interrupt  the
		     autoboot process and escape into the interactive mode  by
		     pressing a	key on the console during this delay.

		     If	 set  to  "NO",	no autoboot is automatically attempted
		     after   processing	  /boot/loader.rc,   though   explicit
		     autoboot's	 are processed normally, using a 10 second de-
		     lay.

Don't expect too much in energy savings (it's a desktop, not a laptop).

If they happen to be explicitly loaded, just remove the relevant setting that loads the module in either /boot/loader.conf or /etc/rc.conf

Edit: a beter option to save energy would be to disable them in your BIOS settings, if that's possible.
 
after disabling the unused drivers you can add this line to /etc/sysctl.conf and reload the sysctl service.
hw.pci.do_power_nodriver=3
 
If they are indeed automatically loaded (and not integrated in your running kernel), then use the "NO" value for the variable that refers to the relevant module ...

iwlwifi(4) says:

The driver will auto-load without any user interaction using devmatch(8) if enabled in rc.conf(5).

There is devmatch_enable="YES" in /etc/defaults/rc.conf, so I assume that the iwlwifi driver is automatically loaded.

What is the /boot/loader.conf variable name for disabling the iwlwifi module?
 
OP does have a nice card, but why not just pull it out? If you pull the card out, it won't be detected on startup, and it follows that the drivers for that card won't be loaded.

FWIW, FreeBSD does play well with Intel-branded wifi cards, so that's useful in laptops. One drawback is that FreeBSD only supports up to G-level speeds - there's work to support N-level speeds for FreeBSD 14.

Another line of thinking I can suggest is to just not bother with the card - for several reasons:
  • That particular card uses Bluetooth 5, which is famously low-energy. Older versions of Bluetooth were an awful drain on my phone's battery, and THAT is when I had to turn Bluetooth on and off as needed. On a desktop machine, Bluetooth consumption of energy just doesn't matter - it's not a GPU! And, as Erichans points out, energy savings will be negligible. You're welcome to do the math - I bet in your area you're charged per kWatt-hour - and most Bluetooth cards are rated at less than 4 watt...
  • Do those kernel-level modules (if_iwlwifi.ko and ng_bluetooth.ko) interfere with the rest of the computer's functioning on your machine? If they do, then that's an interesting issue, let's talk. If not - then those modules can be safely left alone.
  • What if you get a nice Bluetooth mouse? It would be interesting to see if it can work with FreeBSD, y'know... ;)
 
you can disable devmatch by adding this line to /etc/rc.conf:
devmatch_enable="NO"

Isn't that a bit heavy-handed? There might be useful modules that would not be automatically loaded when devmatch is disabled.
 
FWIW, FreeBSD does play well with Intel-branded wifi cards, so that's useful in laptops. One drawback is that FreeBSD only supports up to G-level speeds - there's work to support N-level speeds for FreeBSD 14.
The poor Wi-Fi speed using my "Intel Wi-Fi 6 AX201" card on FreeBSD 13 was what made me switch to using a wired network connection instead. G-level speed is not suitable for my use case.

iwlwifi(4):

The driver uses the linuxkpi_wlan and linuxkpi compat framework to bridge
between the Linux and native FreeBSD driver code as well as to the native
net80211(4) wireless stack.

While iwlwifi supports all 802.11 a/b/g/n/ac/ax the compatibility code
currently only supports 802.11 a/b/g modes. Support for 802.11 n/ac is
to come. 802.11ax and 6Ghz support are planned.

Is there good progress in implementing N-level speeds for iwlwifi in FreeBSD 14? Is it likely to make it to the first release of FreeBSD 14?
 
I can't deduce from your messages if you tried if_iwlwifi_load="NO" in loader.conf. If that doesn't work and you are concerned with disabling devmatch altogether (rightly so I think), then I suggest use rc.conf(5) settings and try devmatch_blocklist="if_iwlwifi"

There's even this dedicated WiFi/Iwlwifi - Intel Wireless wiki page where iwlwifi and its development progress are explained in more detail.*

___
* You can even detach an unwanted iwlwifi driver that has dared to attach itself to your hardware—all not withstanding astyle's suggestion to physically remove the card.
 
I can't deduce from your messages if you tried if_iwlwifi_load="NO" in loader.conf. If that doesn't work and you are concerned with disabling devmatch altogether (rightly so I think), then I suggest use rc.conf(5) settings and try devmatch_blocklist="if_iwlwifi"

I have not tried if_iwlwifi_load="NO" in /boot/loader.conf.
I have not tried devmatch_blocklist="if_iwlwifi" in /etc/rc.conf either.
I have not tried them because I was not sure about the name of the settings and where to write them.

Thank you for now giving me something concrete to try out. I shall report the results here when I have tried them.
 
I can't deduce from your messages if you tried if_iwlwifi_load="NO" in loader.conf. If that doesn't work and you are concerned with disabling devmatch altogether (rightly so I think), then I suggest use rc.conf(5) settings and try devmatch_blocklist="if_iwlwifi"

if_iwlwifi_load="NO" in /boot/loader.conf had not effect. The output of dmesg showed that the iwlwifi driver was still autoloaded during boot.

devmatch_blocklist="if_iwlwifi" in /etc/rc.d did work after rebooting:

Code:
# kldstat
Id Refs Address                Size Name
 1   45 0xffffffff80200000  1f3e2d0 kernel
 2    1 0xffffffff82140000   59dfa8 zfs.ko
 3    1 0xffffffff826de000     a4a0 cryptodev.ko
 4    1 0xffffffff826e9000    1b128 geom_eli.ko
 5    1 0xffffffff82705000    20c48 geom_mirror.ko
 6    1 0xffffffff832f9000     3378 acpi_wmi.ko
 7    1 0xffffffff832fd000     3250 ichsmb.ko
 8    1 0xffffffff83301000     2180 smbus.ko
 9    1 0xffffffff83304000     2110 pchtherm.ko
10    1 0xffffffff83307000     4d00 ng_ubt.ko
11    3 0xffffffff8330c000     aac8 netgraph.ko
12    2 0xffffffff83317000     a238 ng_hci.ko
13    2 0xffffffff83322000     25a8 ng_bluetooth.ko
14    1 0xffffffff83325000    27190 ipfw.ko
15    1 0xffffffff8334d000     2a08 mac_ntpd.ko

I have also tried the BIOS method suggested by Erichans. However, my BIOS only has the option to enable or disable the embedded LAN controller. Setting it to "disable" disables both Wi-Fi and the wired network connection.

After this, I shall try the following methods:

  • devmatch_blocklist="if_iwlwifi ng_ubt" in /etc/rc.d to disable both Wi-Fi and Bluetooth.
  • Physically remove the Wi-Fi + Bluetooth card.
 
Last edited by a moderator:
I have now physically removed the Wi-Fi card.

Code:
# kldstat
Id Refs Address                Size Name
 1   34 0xffffffff80200000  1f3e2d0 kernel
 2    1 0xffffffff8213f000    20c48 geom_mirror.ko
 3    1 0xffffffff82160000     a4a0 cryptodev.ko
 4    1 0xffffffff8216b000   59dfa8 zfs.ko
 5    1 0xffffffff82709000    1b128 geom_eli.ko
 6    1 0xffffffff832f9000     3378 acpi_wmi.ko
 7    1 0xffffffff832fd000     3250 ichsmb.ko
 8    1 0xffffffff83301000     2180 smbus.ko
 9    1 0xffffffff83304000     2110 pchtherm.ko
10    1 0xffffffff83307000    27190 ipfw.ko
11    1 0xffffffff8332f000     2a08 mac_ntpd.ko
 
The poor Wi-Fi speed using my "Intel Wi-Fi 6 AX201" card on FreeBSD 13 was what made me switch to using a wired network connection instead. G-level speed is not suitable for my use case.
I know you removed the wifi card... but here's some food for thought: As per this nice explainer:

  • Maximum theoretical throughput for 802.11g is 54 MB/sec. But - G-level speeds typically get to be around 25 MB/s in real-world measurements.
  • Maximum theoretical throughput for 802.11n is 600 MB/sec. But - N-level speeds can be as low as 26 MB/s in real-world measurements.
My personal experience frankly is in line with that.

Wi-Fi speeds you can realistically get at home - they are limited by the speeds provided by your ISP. If your Internet plan only allows for 15-20 MB/s, that's what you'll get, even if your card theoretically (or practically) can support higher speeds.
 
I know you removed the wifi card... but here's some food for thought: As per this nice explainer:

  • Maximum theoretical throughput for 802.11g is 54 MB/sec. But - G-level speeds typically get to be around 25 MB/s in real-world measurements.
  • Maximum theoretical throughput for 802.11n is 600 MB/sec. But - N-level speeds can be as low as 26 MB/s in real-world measurements.
My personal experience frankly is in line with that.

Wi-Fi speeds you can realistically get at home - they are limited by the speeds provided by your ISP. If your Internet plan only allows for 15-20 MB/s, that's what you'll get, even if your card theoretically (or practically) can support higher speeds.
Thank you for the reference information.

In my use case, the main purpose of the network connection is not for connecting to the internet, but for file transfers between hosts on the same LAN. For file transfers between hosts on the same network, the speed of 802.11g is truly intolerable when I know that much higher real-world speeds are possible with 802.11n or a wired connection.
 
Thank you for the reference information.

In my use case, the main purpose of the network connection is not for connecting to the internet, but for file transfers between hosts on the same LAN. For file transfers between hosts on the same network, the speed of 802.11g is truly intolerable when I know that much higher real-world speeds are possible with 802.11n or a wired connection.
on a LAN at home, I do get the card's supported theoretical speed... That's because I have an AC router at home, so it's not a bottleneck. :p When you transfer files at home, the bottleneck is origin machine's HDD drive.
 
Back
Top