]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/mac80211/driver-ops.h
Merge remote-tracking branch 'net-next/master' into mac80211-next
[linux.git] / net / mac80211 / driver-ops.h
index fe35a1c0dc862027ee289fe079146743f9145d4e..09f77e4a8a79d78f5722a85470bfa0862671e43e 100644 (file)
@@ -162,6 +162,7 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local,
                return;
 
        if (WARN_ON_ONCE(sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE ||
+                        sdata->vif.type == NL80211_IFTYPE_NAN ||
                         (sdata->vif.type == NL80211_IFTYPE_MONITOR &&
                          !sdata->vif.mu_mimo_owner)))
                return;
@@ -568,6 +569,9 @@ u64 drv_get_tsf(struct ieee80211_local *local,
 void drv_set_tsf(struct ieee80211_local *local,
                 struct ieee80211_sub_if_data *sdata,
                 u64 tsf);
+void drv_offset_tsf(struct ieee80211_local *local,
+                   struct ieee80211_sub_if_data *sdata,
+                   s64 offset);
 void drv_reset_tsf(struct ieee80211_local *local,
                   struct ieee80211_sub_if_data *sdata);
 
@@ -1165,4 +1169,83 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
        local->ops->wake_tx_queue(&local->hw, &txq->txq);
 }
 
+static inline int drv_start_nan(struct ieee80211_local *local,
+                               struct ieee80211_sub_if_data *sdata,
+                               struct cfg80211_nan_conf *conf)
+{
+       int ret;
+
+       might_sleep();
+       check_sdata_in_driver(sdata);
+
+       trace_drv_start_nan(local, sdata, conf);
+       ret = local->ops->start_nan(&local->hw, &sdata->vif, conf);
+       trace_drv_return_int(local, ret);
+       return ret;
+}
+
+static inline void drv_stop_nan(struct ieee80211_local *local,
+                               struct ieee80211_sub_if_data *sdata)
+{
+       might_sleep();
+       check_sdata_in_driver(sdata);
+
+       trace_drv_stop_nan(local, sdata);
+       local->ops->stop_nan(&local->hw, &sdata->vif);
+       trace_drv_return_void(local);
+}
+
+static inline int drv_nan_change_conf(struct ieee80211_local *local,
+                                      struct ieee80211_sub_if_data *sdata,
+                                      struct cfg80211_nan_conf *conf,
+                                      u32 changes)
+{
+       int ret;
+
+       might_sleep();
+       check_sdata_in_driver(sdata);
+
+       if (!local->ops->nan_change_conf)
+               return -EOPNOTSUPP;
+
+       trace_drv_nan_change_conf(local, sdata, conf, changes);
+       ret = local->ops->nan_change_conf(&local->hw, &sdata->vif, conf,
+                                         changes);
+       trace_drv_return_int(local, ret);
+
+       return ret;
+}
+
+static inline int drv_add_nan_func(struct ieee80211_local *local,
+                                  struct ieee80211_sub_if_data *sdata,
+                                  const struct cfg80211_nan_func *nan_func)
+{
+       int ret;
+
+       might_sleep();
+       check_sdata_in_driver(sdata);
+
+       if (!local->ops->add_nan_func)
+               return -EOPNOTSUPP;
+
+       trace_drv_add_nan_func(local, sdata, nan_func);
+       ret = local->ops->add_nan_func(&local->hw, &sdata->vif, nan_func);
+       trace_drv_return_int(local, ret);
+
+       return ret;
+}
+
+static inline void drv_del_nan_func(struct ieee80211_local *local,
+                                  struct ieee80211_sub_if_data *sdata,
+                                  u8 instance_id)
+{
+       might_sleep();
+       check_sdata_in_driver(sdata);
+
+       trace_drv_del_nan_func(local, sdata, instance_id);
+       if (local->ops->del_nan_func)
+               local->ops->del_nan_func(&local->hw, &sdata->vif, instance_id);
+       trace_drv_return_void(local);
+}
+
 #endif /* __MAC80211_DRIVER_OPS */