aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-10-23 09:16:50 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-23 13:52:53 -0400
commiteeb126e9ee5d3b14913863fdd7d88fdbf158318f (patch)
tree1d6a4770ddd370866dfda11d5c17cb5d21d6b346 /net/wireless
parent5d0d04e477c44993f995f35b728ce9dd57a4615e (diff)
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: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/core.c4
-rw-r--r--net/wireless/nl80211.c4
-rw-r--r--net/wireless/rdev-ops.h18
-rw-r--r--net/wireless/trace.h10
4 files changed, 32 insertions, 4 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c
index f280f48fbd43..ce1ad776dfb5 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -241,7 +241,7 @@ static int cfg80211_rfkill_set_block(void *data, bool blocked)
241 case NL80211_IFTYPE_P2P_DEVICE: 241 case NL80211_IFTYPE_P2P_DEVICE:
242 if (!wdev->p2p_started) 242 if (!wdev->p2p_started)
243 break; 243 break;
244 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); 244 rdev_stop_p2p_device(rdev, wdev);
245 wdev->p2p_started = false; 245 wdev->p2p_started = false;
246 rdev->opencount--; 246 rdev->opencount--;
247 break; 247 break;
@@ -774,7 +774,7 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev)
774 case NL80211_IFTYPE_P2P_DEVICE: 774 case NL80211_IFTYPE_P2P_DEVICE:
775 if (!wdev->p2p_started) 775 if (!wdev->p2p_started)
776 break; 776 break;
777 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); 777 rdev_stop_p2p_device(rdev, wdev);
778 wdev->p2p_started = false; 778 wdev->p2p_started = false;
779 rdev->opencount--; 779 rdev->opencount--;
780 break; 780 break;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 5d3167d71b5f..8c0857815a90 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -6932,7 +6932,7 @@ static int nl80211_start_p2p_device(struct sk_buff *skb, struct genl_info *info)
6932 if (err) 6932 if (err)
6933 return err; 6933 return err;
6934 6934
6935 err = rdev->ops->start_p2p_device(&rdev->wiphy, wdev); 6935 err = rdev_start_p2p_device(rdev, wdev);
6936 if (err) 6936 if (err)
6937 return err; 6937 return err;
6938 6938
@@ -6958,7 +6958,7 @@ static int nl80211_stop_p2p_device(struct sk_buff *skb, struct genl_info *info)
6958 if (!wdev->p2p_started) 6958 if (!wdev->p2p_started)
6959 return 0; 6959 return 0;
6960 6960
6961 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev); 6961 rdev_stop_p2p_device(rdev, wdev);
6962 wdev->p2p_started = false; 6962 wdev->p2p_started = false;
6963 6963
6964 mutex_lock(&rdev->devlist_mtx); 6964 mutex_lock(&rdev->devlist_mtx);
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index 4a88a39b1319..eb5f8974e148 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -858,4 +858,22 @@ static inline struct ieee80211_channel
858 return ret; 858 return ret;
859} 859}
860 860
861static inline int rdev_start_p2p_device(struct cfg80211_registered_device *rdev,
862 struct wireless_dev *wdev)
863{
864 int ret;
865
866 trace_rdev_start_p2p_device(&rdev->wiphy, wdev);
867 ret = rdev->ops->start_p2p_device(&rdev->wiphy, wdev);
868 trace_rdev_return_int(&rdev->wiphy, ret);
869 return ret;
870}
871
872static inline void rdev_stop_p2p_device(struct cfg80211_registered_device *rdev,
873 struct wireless_dev *wdev)
874{
875 trace_rdev_stop_p2p_device(&rdev->wiphy, wdev);
876 rdev->ops->stop_p2p_device(&rdev->wiphy, wdev);
877 trace_rdev_return_void(&rdev->wiphy);
878}
861#endif /* __CFG80211_RDEV_OPS */ 879#endif /* __CFG80211_RDEV_OPS */
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 857734c4b357..0ca71caf85fb 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -1741,6 +1741,16 @@ TRACE_EVENT(rdev_return_channel,
1741 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type) 1741 WIPHY_PR_ARG, CHAN_PR_ARG, __entry->type)
1742); 1742);
1743 1743
1744DEFINE_EVENT(wiphy_wdev_evt, rdev_start_p2p_device,
1745 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1746 TP_ARGS(wiphy, wdev)
1747);
1748
1749DEFINE_EVENT(wiphy_wdev_evt, rdev_stop_p2p_device,
1750 TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev),
1751 TP_ARGS(wiphy, wdev)
1752);
1753
1744/************************************************************* 1754/*************************************************************
1745 * cfg80211 exported functions traces * 1755 * cfg80211 exported functions traces *
1746 *************************************************************/ 1756 *************************************************************/