Friday, January 21 2005 @ 09:00 PM EST Contributed by: glosser
Linux.com takes a look at what is required to get wireless connectivity via a USB device in Linux.
I needed to connect my new desktop PC wirelessly from my second floor office to my first floor network. As I started researching the options for wireless USB adapters, I realized I might have some work ahead of me. Wireless USB in Linux is still in the early stages of development. But a little searching and some trial and error led to a successful connection.
While I did not expect the configuration to be easy, I did not expect it to be especially difficult either. To be fair, a lot of the complexities have nothing to do with the USB drivers, but are more related to the device naming and mapping changes that occurred in the upgrade from the 2.4 to the 2.6 kernel.
To better handle dynamic, hotplug devices on USB and FireWire, changes were made in the 2.6 kernel to provide persistent device names. The kernel now handles device management via two subsystems called sysfs and udev. If you run a 2.6 kernel, you may notice a new virtual directory called /sys in the root of your system. The /sys directory works like /proc in that it maps directly to part of system memory. While /proc tracks kernel parameters and state, /sys tracks device names known to the system. The device names in /sys are persistent because they are based on unique hardware and bus identifiers. This allows the kernel to always assign the same name to a dynamic device, something that was not possible in the 2.4 kernel.
In the 2.4 kernel the order you plug in USB devices can affect the name that gets assigned to it. The name of a device is neither unique nor guaranteed. The sysfs subsystem in the 2.6 kernel tries to solve that problem by naming devices using a unique identifier. The result is something not very useful to humans, as the device name for my wireless USB adapter turned out to be /sys/devices/pci0000:00/0000:00:02.1/usb3/3-1/3-1:1.0. That name is not very handy to deal with, so the udev subsystem provides a mapping between the /sys device name and the more familiar device names like /dev/wlan0.