Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux
[cascardo/linux.git] / net / mac80211 / main.c
index d00ea9b..1075ac2 100644 (file)
@@ -660,6 +660,9 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
 
        ieee80211_roc_setup(local);
 
+       local->hw.radiotap_timestamp.units_pos = -1;
+       local->hw.radiotap_timestamp.accuracy = -1;
+
        return &local->hw;
  err_free:
        wiphy_free(wiphy);
@@ -818,6 +821,11 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
             !local->ops->tdls_recv_channel_switch))
                return -EOPNOTSUPP;
 
+       if (WARN_ON(local->hw.wiphy->interface_modes &
+                       BIT(NL80211_IFTYPE_NAN) &&
+                   (!local->ops->start_nan || !local->ops->stop_nan)))
+               return -EINVAL;
+
 #ifdef CONFIG_PM
        if (hw->wiphy->wowlan && (!local->ops->suspend || !local->ops->resume))
                return -EINVAL;
@@ -1055,6 +1063,9 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        local->dynamic_ps_forced_timeout = -1;
 
+       if (!local->hw.max_nan_de_entries)
+               local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID;
+
        result = ieee80211_wep_init(local);
        if (result < 0)
                wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",