@@ -4438,6 +4438,7 @@ struct ieee80211_prep_tx_info {
* if the requested TID-To-Link mapping can be accepted or not.
* If it's not accepted the driver may suggest a preferred mapping and
* modify @ttlm parameter with the suggested TID-to-Link mapping.
+ * @iface_usage: notify about intended usage of added interfaces.
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -4822,6 +4823,9 @@ struct ieee80211_ops {
enum ieee80211_neg_ttlm_res
(*can_neg_ttlm)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_neg_ttlm *ttlm);
+
+ void (*iface_usage)(struct ieee80211_hw *hw,
+ struct cfg80211_iface_usage *iface_usage);
};
/**
@@ -5104,6 +5104,17 @@ ieee80211_set_ttlm(struct wiphy *wiphy, struct net_device *dev,
return ieee80211_req_neg_ttlm(sdata, params);
}
+static void
+ieee80211_iface_usage(struct wiphy *wiphy, struct net_device *dev,
+ struct cfg80211_iface_usage *iface_usage)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ lockdep_assert_wiphy(wiphy);
+
+ drv_iface_usage(local, iface_usage);
+}
+
const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -5217,4 +5228,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.del_link_station = ieee80211_del_link_station,
.set_hw_timestamp = ieee80211_set_hw_timestamp,
.set_ttlm = ieee80211_set_ttlm,
+ .iface_usage = ieee80211_iface_usage,
};
@@ -1728,4 +1728,18 @@ drv_can_neg_ttlm(struct ieee80211_local *local,
return res;
}
+
+static inline void drv_iface_usage(struct ieee80211_local *local,
+ struct cfg80211_iface_usage *iface_usage)
+{
+ might_sleep();
+
+ lockdep_assert_wiphy(local->hw.wiphy);
+
+ trace_drv_iface_usage(local, iface_usage);
+ if (local->ops->iface_usage)
+ local->ops->iface_usage(&local->hw, iface_usage);
+
+ trace_drv_return_void(local);
+}
#endif /* __MAC80211_DRIVER_OPS */
@@ -3145,6 +3145,29 @@ TRACE_EVENT(drv_neg_ttlm_res,
LOCAL_PR_ARG, VIF_PR_ARG, __entry->res
)
);
+
+TRACE_EVENT(drv_iface_usage,
+ TP_PROTO(struct ieee80211_local *local,
+ struct cfg80211_iface_usage *iface_usage),
+
+ TP_ARGS(local, iface_usage),
+
+ TP_STRUCT__entry(
+ LOCAL_ENTRY
+ __field(u32, types_mask)
+ ),
+
+ TP_fast_assign(
+ LOCAL_ASSIGN;
+ __entry->types_mask = iface_usage->types_mask;
+ ),
+
+ TP_printk(
+ LOCAL_PR_FMT " types_mask=0x%x",
+ LOCAL_PR_ARG, __entry->types_mask
+ )
+);
+
#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH