mac80211框架基础

Overview

To be able to control wireless drivers from userspace, some IPC communication processes between kernel and userspace are used.

The Wireless Extension (WE) is a generic API allowing a driver to expose to the user space configuration and statistics specific to common Wireless LANs.

+-------------+
|             |
|  Userspace  |
|             |
+-------------+
      ^
- - - | - - - - 
      | nl80211
      v
+-------------+
|             |
|  cfg80211   |
|             |
+-------------+
+-------------+
|             |
|  mac80211   |
|   driver    |
|             |
+-------------+

An important point is that nl80211/cfg80211/mac80211 no longer use ioctl, they use netlinkarrow-up-right.

So, tools like iwarrow-up-right, hostapdarrow-up-right or the wpa_supplicantarrow-up-right use some netlink libraries (like libnlarrow-up-right or libnl-tinyarrow-up-right) and the netlink interface public header which is of course nl80211.harrow-up-right.

There is not so much documentations, but I advice you to read the libnl documentationarrow-up-right and then the iw source codearrow-up-right (because iw use libnl).

Mac80211 Framework

  • nl80211 is the interface between user space software (iw, wpa_supplicant, etc.) and the kernel (cfg80211 and mac80211 kernel modules, and specific drivers).

  • The WiFi drivers and hardware could be Full-MAC or Soft-MAC (see Wireless_network_interface_controller).

  • cfg80211_ops is a set of operations that Full-MAC drivers and mac80211 module register to cfg80211 module.

  • ieee80211_ops is a set of operations that Soft-MAC drivers register to mac80211 module.

References

How nl80211 library & cfg80211 work?arrow-up-right

Last updated