LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Why does a wifi card need udev when an ethernet card doesn't? (https://www.linuxquestions.org/questions/linux-networking-3/why-does-a-wifi-card-need-udev-when-an-ethernet-card-doesnt-4175644140/)

hazel 12-12-2018 05:23 AM

Why does a wifi card need udev when an ethernet card doesn't?
 
I've recently had a lot of trouble on my laptop because of the failure of udev to start up properly. There's a thread on it in the AntiX/MX forum for anyone who's interested. My wifi didn't come up either. But strangely enough ethernet did. That is to say, there was an eth0 device. It just wasn't functioning because I have no ethernet connection upstairs.

But wlan0 didn't appear at all. There was no such interface. It didn't show up in /sys/class/net and wasn't found by ip link show. I would like to know why not. Why can the kernel not recognise a wifi interface without help from udev?

Shadow_7 12-12-2018 07:29 AM

implying that at some point udev worked and wifi did too.

My guess is that ethernet is more hardware based and just works in the presence of a driver. Where wifi needs more things like firmware, which might not be installed by default. If there's no firmware then it doesn't matter if there is a driver as it will not work. So no device found and no interface assigned. Or udev loads the kernel module for the hardware, where without it the module does not get loaded.

# lspci -nnk
# lsusb

If the device doesn't show up there, then you have bigger issues.

hazel 12-12-2018 09:29 AM

No firmware load is needed for this wifi chip. It's not one of those Broadcom ones. I think it's Atheros.

That udev is needed to load the kernel driver sounds like a reasonable explanation, but it just raises the same question over again. The Linux kernel is normally very good at identifying the hardware it is running on and loading the drivers required. It can do so for almost any ethernet card without needing any help from user space. What is so different about wifi?

btw I have everything working on that machine now. Once udevd is running, the interface is brought up without any problems.

Shadow_7 12-22-2018 10:40 AM

Even atheros cards have firmware.

$ sudo apt-get install firmware-atheros

$ sudo dmesg | grep -i firmware

Although more likely that udev loads usb to load the wifi driver which loads the firmware. Where ethernet tends to be on the PCI(e) bus. But I haven't exactly run without udev to find out if that breaks things. Although I remember a time before udev. Where using mknod / MAKEDEV was not uncommon if you had uncommon hardware or special needs.

While linux is good at auto-loading modules as needed, you might find that much of that is scripted and part of a distro. And if you look at some of those scripts you might find that it basically bounces off enough walls until it kind of works in most cases. Locations for which vary on some distros, but basically /etc/modprobe.d/ /lib/udev/ /etc/X11/*.d/ and various other efforts.

hazel 12-22-2018 10:55 AM

Quote:

Originally Posted by Shadow_7 (Post 5940361)
Although more likely that udev loads usb to load the wifi driver which loads the firmware. Where ethernet tends to be on the PCI(e) bus.

istr that wifi dongles work like that. The dongle is first recognised as a usb storage device and firmware is loaded from it, then it switches mode and becomes a network device.

But this is an internal wifi card. I'll have to check what bus it's on next time I have the laptop switched on.

rokytnji 12-22-2018 02:56 PM

Do you have udevil installed along with udev hazel? I do.
Code:

udev/oldstable,now 215-17+deb8u8 i386 [installed]
  /dev/ and hotplug management daemon

udevil/jessie,now 0.4.4-1.0nosystemd1 i386 [installed]
  Alternative storage media interface

No problemos with my wireless router 200 feet away.

I know udevil is for mountable media. Just mentioning how mine is set up on AntiX 15 32 bit.

The why part? I don't know. All I know is when you experiment with AntiX.
You are left to pick up the pieces.

https://www.linuxquestions.org/quest...rs-4175643946/

I think but am not sure Anti covered this glitch already.

Code:

Permissions /etc/udev folder

Submitted by anticapitalista on Sat, 11/25/2017 - 08:53

Permissions of /etc/udev folder is wrong (777) which means user cannot even read contents

    Read more about Permissions /etc/udev folder

over here

If I am off base. Sorry.


All times are GMT -5. The time now is 05:53 PM.