Commit eeb126e9 authored by Johannes Berg's avatar Johannes Berg

cfg80211: add tracing for P2P Device start/stop

These were missed due to the tracing work having
started on a kernel that didn't have P2P Device
yet, implement them now.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 5d0d04e4
...@@ -241,7 +241,7 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked) ...@@ -241,7 +241,7 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
case NL80211_IFTYPE_P2P_DEVICE: case NL80211_IFTYPE_P2P_DEVICE:
if (!wdev->p2p_started) if (!wdev->p2p_started)
break; break;
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); rdev_stop_p2p_device(rdev, wdev);
wdev->p2p_started = false; wdev->p2p_started = false;
rdev->opencount--; rdev->opencount--;
break; break;
...@@ -774,7 +774,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev) ...@@ -774,7 +774,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev)
case NL80211_IFTYPE_P2P_DEVICE: case NL80211_IFTYPE_P2P_DEVICE:
if (!wdev->p2p_started) if (!wdev->p2p_started)
break; break;
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); rdev_stop_p2p_device(rdev, wdev);
wdev->p2p_started = false; wdev->p2p_started = false;
rdev->opencount--; rdev->opencount--;
break; break;
......
...@@ -6932,7 +6932,7 @@ static int nl80211_start_p2p_device(struct sk_buff *skb, struct genl_info *info) ...@@ -6932,7 +6932,7 @@ static int nl80211_start_p2p_device(struct sk_buff *skb, struct genl_info *info)
if (err) if (err)
return err; return err;
err = rdev->ops->start_p2p_device(&rdev->wiphy, wdev); err = rdev_start_p2p_device(rdev, wdev);
if (err) if (err)
return err; return err;
...@@ -6958,7 +6958,7 @@ static int nl80211_stop_p2p_device(struct sk_buff *skb, struct genl_info *info) ...@@ -6958,7 +6958,7 @@ static int nl80211_stop_p2p_device(struct sk_buff *skb, struct genl_info *info)
if (!wdev->p2p_started) if (!wdev->p2p_started)
return 0; return 0;
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); rdev_stop_p2p_device(rdev, wdev);
wdev->p2p_started = false; wdev->p2p_started = false;
mutex_lock(&rdev->devlist_mtx); mutex_lock(&rdev->devlist_mtx);
......
...@@ -858,4 +858,22 @@ static inline struct ieee80211_channel ...@@ -858,4 +858,22 @@ static inline struct ieee80211_channel
return ret; return ret;
} }
static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
int ret;
trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
trace_rdev_return_int(&rdev->wiphy, ret);
return ret;
}
static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev)
{
trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
trace_rdev_return_void(&rdev->wiphy);
}
#endif /* __CFG80211_RDEV_OPS */ #endif /* __CFG80211_RDEV_OPS */
...@@ -1741,6 +1741,16 @@ TRACE_EVENT(rdev_return_channel, ...@@ -1741,6 +1741,16 @@ TRACE_EVENT(rdev_return_channel,
WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type) WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type)
); );
DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
TP_ARGS(wiphy, wdev)
);
DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
TP_ARGS(wiphy, wdev)
);
/************************************************************* /*************************************************************
* cfg80211 exported functions traces * * cfg80211 exported functions traces *
*************************************************************/ *************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment