Tutorials

Linux Kernel - cfg80211

Linux Kernel : cfg80211

cfg80211 subsystem

cfg80211

Introduction

  • cfg80211 is the configuration API for 802.11 devices in Linux. It bridges userspace and drivers, and offers some utility functionality associated with 802.11. cfg80211 must, directly or indirectly via mac80211, be used by all modern wireless drivers in Linux, so that they offer a consistent API through nl80211. For backward compatibility, cfg80211 also offers wireless extensions to userspace, but hides them from drivers completely. Additionally, cfg80211 contains code to help enforce regulatory spectrum use restrictions.

  • cfg80211 is the Linux 802.11 configuration . cfg80211 replaces Wireless-Extensions. nl80211 is used to configure a cfg80211 device and is used for kernel ←→ userspace communication. Wireless extensions is now in maintenance mode, no new features will be added to it, we will only fix bugs for it. cfg80211 is now feature-par complete with wireless-extensions, it actually has a lot more features that are simply not available and will never be available through wireless extensions. When implementing a cfg80211 driver wireless extensions support is still provided automatically for you through cfg80211 through CONFIG_CFG80211_WEXT. Distributions no longer needing wireless extensions can remove this and are encouraged to do so. cfg80211 also provides full regulatory support, this is done through wireless-regdb and the usage of CRDA. All new Linux wireless drivers should be written targeting either cfg80211 for fullmac devices or mac80211 for softmac devices.
  • Device registration

    Details

    In order for a driver to use cfg80211, it must register the hardware device with cfg80211. This happens through a number of hardware capability structs described below. The fundamental structure for each device is the ‘wiphy’, of which each instance describes a physical wireless device connected to the system. Each such wiphy can have zero, one, or many virtual interfaces associated with it, which need to be identified as such by pointing the network interface’s ieee80211_ptr pointer to a struct wireless_dev which further describes the wireless part of the interface, normally this struct is embedded in the network interface’s private data area. Drivers can optionally allow creating or destroying virtual interfaces on the fly, but without at least one or the ability to create some the wireless device isn’t useful. Each wiphy structure contains device capability information, and also has a pointer to the various operations the driver offers. The definitions and structures here describe these capabilities in detail.

    If you have any queries please email us at info@sateeshkg.com