• James Prestwood's avatar
    wifi: mac80211: Support POWERED_ADDR_CHANGE feature · 3c06e91b
    James Prestwood authored
    Adds support in mac80211 for NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE.
    The motivation behind this functionality is to fix limitations of
    address randomization on frequencies which are disallowed in world
    roaming.
    
    The way things work now, if a client wants to randomize their address
    per-connection it must power down the device, change the MAC, and
    power back up. Here lies a problem since powering down the device
    may result in frequencies being disabled (until the regdom is set).
    If the desired BSS is on one such frequency the client is unable to
    connect once the phy is powered again.
    
    For mac80211 based devices changing the MAC while powered is possible
    but currently disallowed (-EBUSY). This patch adds some logic to
    allow a MAC change while powered by removing the interface, changing
    the MAC, and adding it again. mac80211 will advertise support for
    this feature so userspace can determine the best course of action e.g.
    disallow address randomization on certain frequencies if not
    supported.
    
    There are certain limitations put on this which simplify the logic:
     - No active connection
     - No offchannel work, including scanning.
    Signed-off-by: default avatarJames Prestwood <prestwoj@gmail.com>
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    3c06e91b
iface.c 68.7 KB