How to Find and reload specific driver from kernel?
Solution 1
way to find the specific driver name
lspci | grep -i network
I am not sure whether that device is on the PCI or USB bus but you can try the following.
- Use
lsusb
orlspci
to find information about the device - Lookup that device for the corresponding module ("driver")
- Make sure that module is loaded and available with
lsmod
andmodprobe
Another Idea would be to use lsmod
and diff
to find out which modules are going missing when your laptop uses sleep mode. It could be more than one module that has a problem.
- restart machine
- make sure that the wifi adapter is working
-
use
lsmod
to get all loaded moduleslsmod > loaded-modules-before-sleep.txt
put computer to sleep mode
- wake machine up
- make sure that the wifi adapter ISN'T working
-
use
lsmod
to get all loaded moduleslsmod > loaded-modules-after-sleep.txt
-
use diff to see what has changed!
diff loaded-modules-before-sleep.txt loaded-modules-after-sleep.txt
reload driver without resetting system
Once you know the module to load, simply use modprobe
as root
modprobe wifi_module_name
find current kernel version via terminal
uname
to the rescue! uname
should tell you what you want to know.
uname -a
Solution 2
Adding a shorter and more specific answer for my own convenience :)
To find out the kernel module, issue lspci -vvnn | grep -A 9 Network
(from ubuntu WifiDocs):
~$ lspci -vvnn | grep -A 9 Network
03:00.0 Network controller [0280]: Broadcom Corporation BCM4331 802.11a/b/g/n [14e4:4331] (rev 02)
Subsystem: Apple Inc. AirPort Extreme [106b:010f]
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: 256 bytes
Interrupt: pin A routed to IRQ 17
Region 0: Memory at a0500000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Kernel driver in use: wl
Kernel modules: bcma, wl
From this you can see that wl
is in use.
To reload on demand, do
sudo rmmod wl && sudo modprobe wl
To reload on sleep/hibernate, install pm-utils and add a file with any name in /etc/pm/config.d/
, for instance /etc/pm/config.d/suspend
with the following contents:
SUSPEND_MODULES="wl"
This is explained at Arch pm-utils wiki and pm-action man page
Related videos on Youtube
Joseph
Updated on September 18, 2022Comments
-
Joseph over 1 year
I am using Crunchbang 64 bit O.S. with a ASUS N150 wireless adapter. Every time I close my laptop and it enters sleep mode, when I "wake it up" I am unable to connect back using the wireless adapter; I have to restart.
My questions are:
Is there a way to find the specific driver name? I know it's an ASUS N150 adapter with a Realtek chipset.
How can I reload the driver for the adapter without resetting the system?
How can I find my current kernel version via terminal (sidenote)?
-
Joseph about 10 yearsWorked! But I now a new question arises. What is 'cfg80211' and it's purpose?
-
Nathan McCoy about 10 yearsA quick search for this module seems to show it is related to WiFi communication between user <-> kernel space. I would suggest reloading this module and seeing if WiFi works or not. you can also run
dmesg
to get some debugging info about any errors that may arise. -
Andrew Falanga over 6 yearsAlternatively, you could use
readlink
and resolve the target of /sys/class/net/<intf>/device/driver. For example, on my system (I still use the ethN moniker)readlink /sys/class/net/eth0/device/driver
resolves to../../../bus/pci/drivers/e1000e
. Thus, the driver is e1000e.ko. You would load viamodprobe e1000e
. You would need to know the interface name for your WiFi device.