• Raj Kumar Bhagat's avatar
    wifi: cfg80211: allow reg update by driver even if wiphy->regd is set · 13ba6794
    Raj Kumar Bhagat authored
    Currently regulatory update by driver is not allowed when the
    wiphy->regd is already set and drivers_request->intersect is false.
    
    During wiphy registration, some drivers (ath10k does this currently)
    first register the world regulatory to cfg80211 using
    wiphy_apply_custom_regulatory(). The driver then obtain the current
    operating country and tries to update the correct regulatory to
    cfg80211 using regulatory_hint().
    
    But at this point, wiphy->regd is already set to world regulatory.
    Also, since this is the first request from driver after the world
    regulatory is set this will result in drivers_request->intersect
    set to false. In this condition the driver request regulatory is not
    allowed to update to cfg80211 in reg_set_rd_driver(). This restricts
    the device operation to the world regulatory.
    
    This driver request to update the regulatory with current operating
    country is valid and should be updated to cfg80211. Hence allow
    regulatory update by driver even if the wiphy->regd is already set
    and driver_request->intersect is false.
    Signed-off-by: default avatarRaj Kumar Bhagat <quic_rajkbhag@quicinc.com>
    Reviewed-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
    Link: https://lore.kernel.org/r/20230421061312.13722-1-quic_rajkbhag@quicinc.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    13ba6794
reg.c 113 KB