Introduction to Linux Wext and nl80211 interfaces

Source: Internet
Author: User

Inux Wireless Driver Interface Introduction

Before analyzing the wireless drive event and wireless driver configuration code under the Wpa_supplicant software Linux version, the implementation technology and development of the Linux wireless driver interface are introduced briefly.

The Linux wireless driver interface has two standard interfaces, Wext (Wireless Extensions Wireless expansion interface) and nl80211 interface.

Prior to the linux-2.6.18 version, the Linux kernel code did not provide a wireless driver interface and a wireless driver protocol stack. Wext is an interface defined by the developer Jean Tourrilhes (HP Lab software engineer) for user-level software access to the wireless driver and the driver event notification user layer. At that time, wireless-driven protocol stack software is more, such as open Source Project hostap,madwifi,mac80211,ieee80211 protocol stack and wireless chip manufacturers own implementation of the protocol stack, the basic use of Wext interface. The Wext interface is also gradually becoming a standard set of interfaces. In the linux-2.6.18 version, the Wext and mac80211 stacks are incorporated into the kernel to become part of the Linux kernel. Wext interface with the development of the 802.11 protocol from 802.11,802.11B,802.11A/G, its API is also increasing, along with its wext version number is constantly changing.

Wext interface Implementation, the application layer uses the IOCTL to access the driver, set the wireless parameters or get wireless parameters, configure the wireless drive for networking operations. The NetLink socket technology, a netlink route messaging technology, is used to transmit wireless-driven events to the application layer. This is also a way to implement many other types of drive standards. But after linux-2.6.25 (remember not very clearly, too lazy to determine), Wext API interface version stopped in V22 no longer updated. Instead, it is the nl80211 interface.

The nl80211 interface was actually provided when the linux-2.6.18 was incorporated into the Wext and mac80211 stacks, but the functionality was not complete at the time, and the application layer software was using the Wext interface. The driver is not implemented using the NL80211 interface (except for drivers based on the MAC80211 protocol stack). The nl80211 interface is implemented by the developer Johannes Berg, who is also the cfg80211 (Wireless protocol stack configuration interface, the interface between the wireless driver interface and the mac80211) and the mac80211 maintainer. Whether it is a user-level access driver or a driver event notification application layer, the nl80211 interface uses the NetLink technology.

nl80211 interface to replace the Wext interface is the main reason is the use of NetLink technology in the application layer and the core layer of data exchange compared to the IOCTL advantage, the specific comparison see Click to open the link (reprinted an article, written very clearly), And many other drivers that used the IOCTL have gradually adopted the netlink approach. Another reason is the development of the 802.11 protocol, with the addition of the 802.11N protocol and the P2p,wps Wireless specification, many of the functions of the Protocol can be implemented in the application layer, adding many API interfaces and events between the application layer and the driving layer. The Wext interface is inconvenient for feature extension, nl80211 can fully support all functions of wext, and can add command words and events without modifying the kernel. The wireless drive interface from Wext to nl80211 is a logical development.

The current implementation of the wireless drive in the Linux kernel is mostly based on the MAC80211 protocol stack, and the wireless driver interface is optional and can be used either or simultaneously. Wpa_supplicant compile, you determine which configuration interface to use, depending on the usage of the wireless-driven interface.

nl80211 In addition to determining the interaction criteria between the application layer and the driving layer, the implementation function partition of the 802.11 protocol is affected. The current 802.11 SME feature (the Wireless service management entity, the protocol stack feature) is implemented in the driver or chip firmware, and the nl802.11 author wants to implement more protocol functions at the application layer. Wpa_supplicant (including HOSTAPD), in addition to the WPA certification, most of the functions of p2p,wps, it also implements the SME function, in this mode of function, wireless driver basically only need to implement the configuration hardware and data transceiver function.

Linux system wpa_supplicant driver event module and Driver i/f module (both implementations are in a file, initialized in a function, divided into two modules are only more clearly designed to understand) the analysis also divides the wext part and the nl80211 part.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.