You are not logged in.

#1 2021-05-13 17:23:25

860lacov
Member
Registered: 2020-05-02
Posts: 497

How to unload wifi module?

I bought USB wifi adapter and I wanted to test it. Currently, on laptop (lenovo t410) I use Arch with xfce and NetworkManager.
I wanted to test this USB device.
I can do set built in wifi down with ip command
USB wifi is working ok but I would like to completely disable laptop wifi card.

I  think that I should unload specific module.
With lspci I've found that there is:

lspci -s 03:00.0 -vv
03:00.0 Network controller: Intel Corporation Centrino Ultimate-N 6300 (rev 35)
	Subsystem: Intel Corporation Centrino Ultimate-N 6300 3x3 AGN
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx+
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 31
	Region 0: Memory at f2400000 (64-bit, non-prefetchable) [size=8K]
	Capabilities: <access denied>
	Kernel driver in use: iwlwifi
	Kernel modules: iwlwifi

I believe that this is my wifi device, and because of the last line I think that I should unload the module iwlwifi

I have read Kernel module
But I'm not sure If I understand everything correctly and I would not like to mess to much inside part of the system I don't fully understand.

1. I'm not sure if modproble -r or rmmod is permanent. Will the module be loaded after reboot?
2. If modprobe is not permanent the am I correct that I should do:
create

/etc/modprobe.d/noiwlwifi.conf
# Do not load the 'iwlwifi' module on boot.
blacklist iwlwifi

If I want to get rid of it?
3. I decided to give it a shot and I did modprobe -r iwlwifi but I have a message:

modprobe: FATAL: Module iwlwifi is in use.

I understand the message but I don't know what to do next

Last edited by 860lacov (2021-05-13 17:33:56)

Offline

#2 2021-05-13 17:38:51

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,503
Website

Re: How to unload wifi module?

860lacov wrote:

USB wifi is working ok but I would like to completely disable laptop wifi card.

Why?

Are you sure the USB wifi doesn't also use iwlwifi?  The error message you posted indicates that it is still being used.

860lacov wrote:

I would not like to mess to much inside part of the system I don't fully understand.

The worst thing that could happen is that your USB wifi stops working - and reverting any change you made (e.g., modprobe.d/*.conf) would get you back where you started.

You are correct that modprobe -r / rmmod are not permanent.  But the modprobe.d/*.conf file would be "permanent" in the sense that it would prevent the module from loading on subsequent boots, as long as the file exists.

So feel free to try a modprobe.d/*.conf file, but if your USB wifi doesn't work when you reboot, you'll have to remove the .conf file again and live with iwlwifi (which does absolutely no harm ... so again, why did you want to remove it?)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2021-05-13 17:51:31

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: How to unload wifi module?

Trilby wrote:
860lacov wrote:

USB wifi is working ok but I would like to completely disable laptop wifi card.

Why?

Are you sure the USB wifi doesn't also use iwlwifi?  The error message you posted indicates that it is still being used.

This is quite new territory for me. I never had to do that but i would like to learn about it.

I don't want to unload this module permanently.
That's why even asked about modproble -r
I mentioned blacklisting just for learning purposes smile

I don't know if USB wifi is using iwlwifi
How can I check it?

I can say that after connecting USB to the laptop new modules showed anter lsusb

mt76x2u                24576  0
mt76x2_common          24576  1 mt76x2u
mt76x02_usb            20480  1 mt76x2u
mt76_usb               40960  2 mt76x02_usb,mt76x2u
mt76x02_lib            86016  3 mt76x02_usb,mt76x2u,mt76x2_common
mt76                   81920  5 mt76_usb,mt76x02_lib,mt76x02_usb,mt76x2u,mt76x2_common

USB wifi is Netgear A6210 which is build on mediatek mt7612u chip so it seems that new modules are correct but as I said. I don't know if iwlwifi is need.
I assume that after unloading iwlwifi Bluetooth can top working but I don't want to make it permanent. Just for a single boot or when needed.

Offline

#4 2021-05-13 18:09:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,503
Website

Re: How to unload wifi module?

860lacov wrote:

I assume that after unloading iwlwifi Bluetooth can top working but I don't want to make it permanent. Just for a single boot or when needed.

The use a modprobe.d/*.conf file and just move/rename the file as needed.  But you still haven't addressed why you'd want to do this at all.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2021-05-13 18:15:12

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: How to unload wifi module?

I tried smile

This is quite new territory for me. I never had to do that but i would like to learn about it.

I don't need to do this. But probably someday I will. I want to know what to do then.

Last edited by 860lacov (2021-05-13 18:16:03)

Offline

#6 2021-05-13 19:07:16

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,503
Website

Re: How to unload wifi module?

You tried what?  How?  What were the results?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2021-05-13 20:10:30

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: How to unload wifi module?

You asked why I want to disable wifi in laptop.
I Tried to tell you why big_smile

I don't need to do this.
But I started to look after possible ways and unloading modules seemed the right way.

I have never done this before. So I wanted to learn this now.

Offline

#8 2021-05-13 20:11:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,490

Re: How to unload wifi module?

USB wifi is working ok but I would like to completely disable laptop wifi card.

https://man.archlinux.org/man/core/util … fkill.8.en

Online

#9 2021-05-13 22:03:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,503
Website

Re: How to unload wifi module?

Please be more complete in your responses.  I assumed the "I tried" was directed at the proposed solution.  As it was not, have you yet tried the proposed solution?  If it works, mark the thread as SOLVED; if it doesn't, clarify what is not yet the way you want it.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2021-05-18 05:57:10

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: How to unload wifi module?

It didn't work
After rfkill one device second didn't work either.
Thank you for help. I don't want to be pain in the a.. so I would like to abandon this "problem" since it's not a real problem but my weird thinking.

Offline

#11 2021-05-18 06:03:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,490

Re: How to unload wifi module?

After rfkill one device second didn't work either.

Wut?

Output of "rfkill" and how exactly did you rfkill which device?
And what's the output of "rfkill" afterwards and how did it "not work"?

Online

#12 2021-05-18 06:18:54

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: How to unload wifi module?

seth wrote:

After rfkill one device second didn't work either.

Wut?

Output of "rfkill" and how exactly did you rfkill which device?
And what's the output of "rfkill" afterwards and how did it "not work"?

I probably did something wrong but after rfkill one device the soft lock was on thin device, but I lost connection on both.
I'm not in front of my main PC. I'll check it.

Last edited by 860lacov (2021-05-18 06:19:33)

Offline

Board footer

Powered by FluxBB