NOTE: this page is for archival only, see the note at the end of the page.

mac80211 driver-level interface semantics

One of the huge advantages of mac80211 is that we can improve consistency between drivers. However there is still work needed to define some semantics in order to make all drivers behave similarly.

This document is under development and might not be 100% correct. It is mostly modelled on the current behaviour of the bcm43xx driver.

MAC addresses

Typically, drivers read a MAC address from EEPROM and write it into a device register. You should read the EEPROM during initial probe and store it in wiphy->perm_addr (use SET_IEEE80211_PERM_ADDR), however you should not initially program it into the active device to avoid it acking frames.

When an interface is added, look at conf->mac_addr. Program this into your hardware.

Remember to apply remove_interface considerations to MAC address too, i.e. remove the MAC address on the device on remove_interface.

Firmware

Firmware should not be loaded during the probe operation, it should be deferred until the first time an interface is added. However, your driver should read the device MAC address during probe and store it in wiphy (the mac address should be available before the interface comes up, much of userspace relies on this).FootNote(This assumes that you have a mechanism for reading the MAC address before firmware is loaded. This is true for all existing drivers, and will hopefully remain that way for future drivers too)

During add_interface, if firmware is not found, return -ENOENT. This will get passed up to userspace which will interpret in terms of "firmware not found".



This is a static dump of the wiki, taken after locking it in January 2015. The new wiki is at https://wireless.wiki.kernel.org/.
versions of this page: last, v8, v7, v6, v5, v4, v3, v2, v1