cfg80211: add tracing for P2P Device start/stop
authorJohannes Berg <johannes.berg@intel.com>
Tue, 23 Oct 2012 13:16:50 +0000 (15:16 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 23 Oct 2012 17:52:53 +0000 (19:52 +0200)
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: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.c
net/wireless/nl80211.c
net/wireless/rdev-ops.h
net/wireless/trace.h

index f280f48fbd4313fe8e47a1e87e9a83c229569e49..ce1ad776dfb5887425aa572b72e03f259fa97e63 100644 (file)
@@ -241,7 +241,7 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
                case NL80211_IFTYPE_P2P_DEVICE:
                        if (!wdev->p2p_started)
                                break;
-                       rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
+                       rdev_stop_p2p_device(rdev, wdev);
                        wdev->p2p_started = false;
                        rdev->opencount--;
                        break;
@@ -774,7 +774,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev)
        case NL80211_IFTYPE_P2P_DEVICE:
                if (!wdev->p2p_started)
                        break;
-               rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
+               rdev_stop_p2p_device(rdev, wdev);
                wdev->p2p_started = false;
                rdev->opencount--;
                break;
index 5d3167d71b5fb2a3f44fb676959b11343b17079b..8c0857815a900ab8aeb56791585739bb37650233 100644 (file)
@@ -6932,7 +6932,7 @@ static int nl80211_start_p2p_device(struct sk_buff *skb, struct genl_info *info)
        if (err)
                return err;
 
-       err = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
+       err = rdev_start_p2p_device(rdev, wdev);
        if (err)
                return err;
 
@@ -6958,7 +6958,7 @@ static int nl80211_stop_p2p_device(struct sk_buff *skb, struct genl_info *info)
        if (!wdev->p2p_started)
                return 0;
 
-       rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
+       rdev_stop_p2p_device(rdev, wdev);
        wdev->p2p_started = false;
 
        mutex_lock(&rdev->devlist_mtx);
index 4a88a39b131923fd961111cb783eec1dd94ec906..eb5f8974e1481c92f064f320de77569917a21bd0 100644 (file)
@@ -858,4 +858,22 @@ static inline struct ieee80211_channel
        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 */
index 857734c4b3575a39b04e65d468a666b2c515915b..0ca71caf85fbbaedd1e7d2e28225aa2798dd8c38 100644 (file)
@@ -1741,6 +1741,16 @@ TRACE_EVENT(rdev_return_channel,
                  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              *
  *************************************************************/