diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
index b6fad29..4a88a39 100644
--- a/net/wireless/rdev-ops.h
+++ b/net/wireless/rdev-ops.h
@@ -4,21 +4,32 @@
 #include <linux/rtnetlink.h>
 #include <net/cfg80211.h>
 #include "core.h"
+#include "trace.h"
 
 static inline int rdev_suspend(struct cfg80211_registered_device *rdev)
 {
-	return rdev->ops->suspend(&rdev->wiphy, rdev->wowlan);
+	int ret;
+	trace_rdev_suspend(&rdev->wiphy, rdev->wowlan);
+	ret = rdev->ops->suspend(&rdev->wiphy, rdev->wowlan);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_resume(struct cfg80211_registered_device *rdev)
 {
-	return rdev->ops->resume(&rdev->wiphy);
+	int ret;
+	trace_rdev_resume(&rdev->wiphy);
+	ret = rdev->ops->resume(&rdev->wiphy);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline void rdev_set_wakeup(struct cfg80211_registered_device *rdev,
 				   bool enabled)
 {
+	trace_rdev_set_wakeup(&rdev->wiphy, enabled);
 	rdev->ops->set_wakeup(&rdev->wiphy, enabled);
+	trace_rdev_return_void(&rdev->wiphy);
 }
 
 static inline struct wireless_dev
@@ -26,15 +37,23 @@
 		       enum nl80211_iftype type, u32 *flags,
 		       struct vif_params *params)
 {
-	return rdev->ops->add_virtual_intf(&rdev->wiphy, name, type, flags,
-					   params);
+	struct wireless_dev *ret;
+	trace_rdev_add_virtual_intf(&rdev->wiphy, name, type);
+	ret = rdev->ops->add_virtual_intf(&rdev->wiphy, name, type, flags,
+					  params);
+	trace_rdev_return_wdev(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
 rdev_del_virtual_intf(struct cfg80211_registered_device *rdev,
 		      struct wireless_dev *wdev)
 {
-	return rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
+	int ret;
+	trace_rdev_del_virtual_intf(&rdev->wiphy, wdev);
+	ret = rdev->ops->del_virtual_intf(&rdev->wiphy, wdev);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
@@ -42,8 +61,12 @@
 			 struct net_device *dev, enum nl80211_iftype type,
 			 u32 *flags, struct vif_params *params)
 {
-	return rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags,
-					      params);
+	int ret;
+	trace_rdev_change_virtual_intf(&rdev->wiphy, dev, type);
+	ret = rdev->ops->change_virtual_intf(&rdev->wiphy, dev, type, flags,
+					     params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_add_key(struct cfg80211_registered_device *rdev,
@@ -51,8 +74,12 @@
 			       bool pairwise, const u8 *mac_addr,
 			       struct key_params *params)
 {
-	return rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise,
+	int ret;
+	trace_rdev_add_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
+	ret = rdev->ops->add_key(&rdev->wiphy, netdev, key_index, pairwise,
 				  mac_addr, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
@@ -60,16 +87,24 @@
 	     u8 key_index, bool pairwise, const u8 *mac_addr, void *cookie,
 	     void (*callback)(void *cookie, struct key_params*))
 {
-	return rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise,
+	int ret;
+	trace_rdev_get_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
+	ret = rdev->ops->get_key(&rdev->wiphy, netdev, key_index, pairwise,
 				  mac_addr, cookie, callback);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_del_key(struct cfg80211_registered_device *rdev,
 			       struct net_device *netdev, u8 key_index,
 			       bool pairwise, const u8 *mac_addr)
 {
-	return rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise,
+	int ret;
+	trace_rdev_del_key(&rdev->wiphy, netdev, key_index, pairwise, mac_addr);
+	ret = rdev->ops->del_key(&rdev->wiphy, netdev, key_index, pairwise,
 				  mac_addr);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
@@ -77,96 +112,154 @@
 		     struct net_device *netdev, u8 key_index, bool unicast,
 		     bool multicast)
 {
-	return rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index,
+	int ret;
+	trace_rdev_set_default_key(&rdev->wiphy, netdev, key_index,
+				   unicast, multicast);
+	ret = rdev->ops->set_default_key(&rdev->wiphy, netdev, key_index,
 					  unicast, multicast);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
 rdev_set_default_mgmt_key(struct cfg80211_registered_device *rdev,
 			  struct net_device *netdev, u8 key_index)
 {
-	return rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev,
+	int ret;
+	trace_rdev_set_default_mgmt_key(&rdev->wiphy, netdev, key_index);
+	ret = rdev->ops->set_default_mgmt_key(&rdev->wiphy, netdev,
 					       key_index);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
 				struct net_device *dev,
 				struct cfg80211_ap_settings *settings)
 {
-	return rdev->ops->start_ap(&rdev->wiphy, dev, settings);
+	int ret;
+	trace_rdev_start_ap(&rdev->wiphy, dev, settings);
+	ret = rdev->ops->start_ap(&rdev->wiphy, dev, settings);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
 				     struct net_device *dev,
 				     struct cfg80211_beacon_data *info)
 {
-	return rdev->ops->change_beacon(&rdev->wiphy, dev, info);
+	int ret;
+	trace_rdev_change_beacon(&rdev->wiphy, dev, info);
+	ret = rdev->ops->change_beacon(&rdev->wiphy, dev, info);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_stop_ap(struct cfg80211_registered_device *rdev,
 			       struct net_device *dev)
 {
-	return rdev->ops->stop_ap(&rdev->wiphy, dev);
+	int ret;
+	trace_rdev_stop_ap(&rdev->wiphy, dev);
+	ret = rdev->ops->stop_ap(&rdev->wiphy, dev);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_add_station(struct cfg80211_registered_device *rdev,
 				   struct net_device *dev, u8 *mac,
 				   struct station_parameters *params)
 {
-	return rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
+	int ret;
+	trace_rdev_add_station(&rdev->wiphy, dev, mac, params);
+	ret = rdev->ops->add_station(&rdev->wiphy, dev, mac, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_del_station(struct cfg80211_registered_device *rdev,
 				   struct net_device *dev, u8 *mac)
 {
-	return rdev->ops->del_station(&rdev->wiphy, dev, mac);
+	int ret;
+	trace_rdev_del_station(&rdev->wiphy, dev, mac);
+	ret = rdev->ops->del_station(&rdev->wiphy, dev, mac);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_change_station(struct cfg80211_registered_device *rdev,
 				      struct net_device *dev, u8 *mac,
 				      struct station_parameters *params)
 {
-	return rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
+	int ret;
+	trace_rdev_change_station(&rdev->wiphy, dev, mac, params);
+	ret = rdev->ops->change_station(&rdev->wiphy, dev, mac, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_get_station(struct cfg80211_registered_device *rdev,
 				   struct net_device *dev, u8 *mac,
 				   struct station_info *sinfo)
 {
-	return rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
+	int ret;
+	trace_rdev_get_station(&rdev->wiphy, dev, mac);
+	ret = rdev->ops->get_station(&rdev->wiphy, dev, mac, sinfo);
+	trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
+	return ret;
 }
 
 static inline int rdev_dump_station(struct cfg80211_registered_device *rdev,
 				    struct net_device *dev, int idx, u8 *mac,
 				    struct station_info *sinfo)
 {
-	return rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
+	int ret;
+	trace_rdev_dump_station(&rdev->wiphy, dev, idx, mac);
+	ret = rdev->ops->dump_station(&rdev->wiphy, dev, idx, mac, sinfo);
+	trace_rdev_return_int_station_info(&rdev->wiphy, ret, sinfo);
+	return ret;
 }
 
 static inline int rdev_add_mpath(struct cfg80211_registered_device *rdev,
 				 struct net_device *dev, u8 *dst, u8 *next_hop)
 {
-	return rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
+	int ret;
+	trace_rdev_add_mpath(&rdev->wiphy, dev, dst, next_hop);
+	ret = rdev->ops->add_mpath(&rdev->wiphy, dev, dst, next_hop);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_del_mpath(struct cfg80211_registered_device *rdev,
 				 struct net_device *dev, u8 *dst)
 {
-	return rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
+	int ret;
+	trace_rdev_del_mpath(&rdev->wiphy, dev, dst);
+	ret = rdev->ops->del_mpath(&rdev->wiphy, dev, dst);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_change_mpath(struct cfg80211_registered_device *rdev,
 				    struct net_device *dev, u8 *dst,
 				    u8 *next_hop)
 {
-	return rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
+	int ret;
+	trace_rdev_change_mpath(&rdev->wiphy, dev, dst, next_hop);
+	ret = rdev->ops->change_mpath(&rdev->wiphy, dev, dst, next_hop);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_get_mpath(struct cfg80211_registered_device *rdev,
 				 struct net_device *dev, u8 *dst, u8 *next_hop,
 				 struct mpath_info *pinfo)
 {
-	return rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
+	int ret;
+	trace_rdev_get_mpath(&rdev->wiphy, dev, dst, next_hop);
+	ret = rdev->ops->get_mpath(&rdev->wiphy, dev, dst, next_hop, pinfo);
+	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
+	return ret;
+
 }
 
 static inline int rdev_dump_mpath(struct cfg80211_registered_device *rdev,
@@ -174,15 +267,23 @@
 				  u8 *next_hop, struct mpath_info *pinfo)
 
 {
-	return rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
+	int ret;
+	trace_rdev_dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop);
+	ret = rdev->ops->dump_mpath(&rdev->wiphy, dev, idx, dst, next_hop,
 				     pinfo);
+	trace_rdev_return_int_mpath_info(&rdev->wiphy, ret, pinfo);
+	return ret;
 }
 
 static inline int
 rdev_get_mesh_config(struct cfg80211_registered_device *rdev,
 		     struct net_device *dev, struct mesh_config *conf)
 {
-	return rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
+	int ret;
+	trace_rdev_get_mesh_config(&rdev->wiphy, dev);
+	ret = rdev->ops->get_mesh_config(&rdev->wiphy, dev, conf);
+	trace_rdev_return_int_mesh_config(&rdev->wiphy, ret, conf);
+	return ret;
 }
 
 static inline int
@@ -190,7 +291,11 @@
 			struct net_device *dev, u32 mask,
 			const struct mesh_config *nconf)
 {
-	return rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
+	int ret;
+	trace_rdev_update_mesh_config(&rdev->wiphy, dev, mask, nconf);
+	ret = rdev->ops->update_mesh_config(&rdev->wiphy, dev, mask, nconf);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_join_mesh(struct cfg80211_registered_device *rdev,
@@ -198,14 +303,22 @@
 				 const struct mesh_config *conf,
 				 const struct mesh_setup *setup)
 {
-	return rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
+	int ret;
+	trace_rdev_join_mesh(&rdev->wiphy, dev, conf, setup);
+	ret = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 
 static inline int rdev_leave_mesh(struct cfg80211_registered_device *rdev,
 				  struct net_device *dev)
 {
-	return rdev->ops->leave_mesh(&rdev->wiphy, dev);
+	int ret;
+	trace_rdev_leave_mesh(&rdev->wiphy, dev);
+	ret = rdev->ops->leave_mesh(&rdev->wiphy, dev);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_change_bss(struct cfg80211_registered_device *rdev,
@@ -213,7 +326,11 @@
 				  struct bss_parameters *params)
 
 {
-	return rdev->ops->change_bss(&rdev->wiphy, dev, params);
+	int ret;
+	trace_rdev_change_bss(&rdev->wiphy, dev, params);
+	ret = rdev->ops->change_bss(&rdev->wiphy, dev, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_set_txq_params(struct cfg80211_registered_device *rdev,
@@ -221,7 +338,11 @@
 				      struct ieee80211_txq_params *params)
 
 {
-	return rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
+	int ret;
+	trace_rdev_set_txq_params(&rdev->wiphy, dev, params);
+	ret = rdev->ops->set_txq_params(&rdev->wiphy, dev, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
@@ -229,7 +350,11 @@
 			       struct net_device *dev,
 			       struct ieee80211_channel *chan)
 {
-	return rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
+	int ret;
+	trace_rdev_libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
+	ret = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, dev, chan);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
@@ -237,97 +362,154 @@
 			 struct ieee80211_channel *chan,
 			 enum nl80211_channel_type channel_type)
 {
-	return rdev->ops->set_monitor_channel(&rdev->wiphy, chan,
-					      channel_type);
+	int ret;
+	trace_rdev_set_monitor_channel(&rdev->wiphy, chan, channel_type);
+	ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chan, channel_type);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_scan(struct cfg80211_registered_device *rdev,
 			    struct cfg80211_scan_request *request)
 {
-	return rdev->ops->scan(&rdev->wiphy, request);
+	int ret;
+	trace_rdev_scan(&rdev->wiphy, request);
+	ret = rdev->ops->scan(&rdev->wiphy, request);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_auth(struct cfg80211_registered_device *rdev,
 			    struct net_device *dev,
 			    struct cfg80211_auth_request *req)
 {
-	return rdev->ops->auth(&rdev->wiphy, dev, req);
+	int ret;
+	trace_rdev_auth(&rdev->wiphy, dev, req);
+	ret = rdev->ops->auth(&rdev->wiphy, dev, req);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_assoc(struct cfg80211_registered_device *rdev,
 			     struct net_device *dev,
 			     struct cfg80211_assoc_request *req)
 {
-	return rdev->ops->assoc(&rdev->wiphy, dev, req);
+	int ret;
+	trace_rdev_assoc(&rdev->wiphy, dev, req);
+	ret = rdev->ops->assoc(&rdev->wiphy, dev, req);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_deauth(struct cfg80211_registered_device *rdev,
 			      struct net_device *dev,
 			      struct cfg80211_deauth_request *req)
 {
-	return rdev->ops->deauth(&rdev->wiphy, dev, req);
+	int ret;
+	trace_rdev_deauth(&rdev->wiphy, dev, req);
+	ret = rdev->ops->deauth(&rdev->wiphy, dev, req);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_disassoc(struct cfg80211_registered_device *rdev,
 				struct net_device *dev,
 				struct cfg80211_disassoc_request *req)
 {
-	return rdev->ops->disassoc(&rdev->wiphy, dev, req);
+	int ret;
+	trace_rdev_disassoc(&rdev->wiphy, dev, req);
+	ret = rdev->ops->disassoc(&rdev->wiphy, dev, req);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_connect(struct cfg80211_registered_device *rdev,
 			       struct net_device *dev,
 			       struct cfg80211_connect_params *sme)
 {
-	return rdev->ops->connect(&rdev->wiphy, dev, sme);
+	int ret;
+	trace_rdev_connect(&rdev->wiphy, dev, sme);
+	ret = rdev->ops->connect(&rdev->wiphy, dev, sme);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_disconnect(struct cfg80211_registered_device *rdev,
 				  struct net_device *dev, u16 reason_code)
 {
-	return rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
+	int ret;
+	trace_rdev_disconnect(&rdev->wiphy, dev, reason_code);
+	ret = rdev->ops->disconnect(&rdev->wiphy, dev, reason_code);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_join_ibss(struct cfg80211_registered_device *rdev,
 				 struct net_device *dev,
 				 struct cfg80211_ibss_params *params)
 {
-	return rdev->ops->join_ibss(&rdev->wiphy, dev, params);
+	int ret;
+	trace_rdev_join_ibss(&rdev->wiphy, dev, params);
+	ret = rdev->ops->join_ibss(&rdev->wiphy, dev, params);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_leave_ibss(struct cfg80211_registered_device *rdev,
 				  struct net_device *dev)
 {
-	return rdev->ops->leave_ibss(&rdev->wiphy, dev);
+	int ret;
+	trace_rdev_leave_ibss(&rdev->wiphy, dev);
+	ret = rdev->ops->leave_ibss(&rdev->wiphy, dev);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
 {
-	return rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
+	int ret;
+	trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
+	ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_set_tx_power(struct cfg80211_registered_device *rdev,
 				    enum nl80211_tx_power_setting type, int mbm)
 {
-	return rdev->ops->set_tx_power(&rdev->wiphy, type, mbm);
+	int ret;
+	trace_rdev_set_tx_power(&rdev->wiphy, type, mbm);
+	ret = rdev->ops->set_tx_power(&rdev->wiphy, type, mbm);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_get_tx_power(struct cfg80211_registered_device *rdev,
 				    int *dbm)
 {
-	return rdev->ops->get_tx_power(&rdev->wiphy, dbm);
+	int ret;
+	trace_rdev_get_tx_power(&rdev->wiphy);
+	ret = rdev->ops->get_tx_power(&rdev->wiphy, dbm);
+	trace_rdev_return_int_int(&rdev->wiphy, ret, *dbm);
+	return ret;
 }
 
 static inline int rdev_set_wds_peer(struct cfg80211_registered_device *rdev,
 				    struct net_device *dev, const u8 *addr)
 {
-	return rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
+	int ret;
+	trace_rdev_set_wds_peer(&rdev->wiphy, dev, addr);
+	ret = rdev->ops->set_wds_peer(&rdev->wiphy, dev, addr);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline void rdev_rfkill_poll(struct cfg80211_registered_device *rdev)
 {
+	trace_rdev_rfkill_poll(&rdev->wiphy);
 	rdev->ops->rfkill_poll(&rdev->wiphy);
+	trace_rdev_return_void(&rdev->wiphy);
 }
 
 
@@ -335,7 +517,11 @@
 static inline int rdev_testmode_cmd(struct cfg80211_registered_device *rdev,
 				    void *data, int len)
 {
-	return rdev->ops->testmode_cmd(&rdev->wiphy, data, len);
+	int ret;
+	trace_rdev_testmode_cmd(&rdev->wiphy);
+	ret = rdev->ops->testmode_cmd(&rdev->wiphy, data, len);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_testmode_dump(struct cfg80211_registered_device *rdev,
@@ -343,8 +529,11 @@
 				     struct netlink_callback *cb, void *data,
 				     int len)
 {
-	return rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data,
-					len);
+	int ret;
+	trace_rdev_testmode_dump(&rdev->wiphy);
+	ret = rdev->ops->testmode_dump(&rdev->wiphy, skb, cb, data, len);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 #endif
 
@@ -353,34 +542,57 @@
 		      struct net_device *dev, const u8 *peer,
 		      const struct cfg80211_bitrate_mask *mask)
 {
-	return rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
+	int ret;
+	trace_rdev_set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
+	ret = rdev->ops->set_bitrate_mask(&rdev->wiphy, dev, peer, mask);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_dump_survey(struct cfg80211_registered_device *rdev,
 				   struct net_device *netdev, int idx,
 				   struct survey_info *info)
 {
-	return rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
+	int ret;
+	trace_rdev_dump_survey(&rdev->wiphy, netdev, idx);
+	ret = rdev->ops->dump_survey(&rdev->wiphy, netdev, idx, info);
+	if (ret < 0)
+		trace_rdev_return_int(&rdev->wiphy, ret);
+	else
+		trace_rdev_return_int_survey_info(&rdev->wiphy, ret, info);
+	return ret;
 }
 
 static inline int rdev_set_pmksa(struct cfg80211_registered_device *rdev,
 				 struct net_device *netdev,
 				 struct cfg80211_pmksa *pmksa)
 {
-	return rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
+	int ret;
+	trace_rdev_set_pmksa(&rdev->wiphy, netdev, pmksa);
+	ret = rdev->ops->set_pmksa(&rdev->wiphy, netdev, pmksa);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_del_pmksa(struct cfg80211_registered_device *rdev,
 				 struct net_device *netdev,
 				 struct cfg80211_pmksa *pmksa)
 {
-	return rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
+	int ret;
+	trace_rdev_del_pmksa(&rdev->wiphy, netdev, pmksa);
+	ret = rdev->ops->del_pmksa(&rdev->wiphy, netdev, pmksa);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_flush_pmksa(struct cfg80211_registered_device *rdev,
 				   struct net_device *netdev)
 {
-	return rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
+	int ret;
+	trace_rdev_flush_pmksa(&rdev->wiphy, netdev);
+	ret = rdev->ops->flush_pmksa(&rdev->wiphy, netdev);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
@@ -390,15 +602,24 @@
 		       enum nl80211_channel_type channel_type,
 		       unsigned int duration, u64 *cookie)
 {
-	return rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
+	int ret;
+	trace_rdev_remain_on_channel(&rdev->wiphy, wdev, chan, channel_type,
+				     duration);
+	ret = rdev->ops->remain_on_channel(&rdev->wiphy, wdev, chan,
 					    channel_type, duration, cookie);
+	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
+	return ret;
 }
 
 static inline int
 rdev_cancel_remain_on_channel(struct cfg80211_registered_device *rdev,
 			      struct wireless_dev *wdev, u64 cookie)
 {
-	return rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
+	int ret;
+	trace_rdev_cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
+	ret = rdev->ops->cancel_remain_on_channel(&rdev->wiphy, wdev, cookie);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_mgmt_tx(struct cfg80211_registered_device *rdev,
@@ -409,72 +630,113 @@
 			       const u8 *buf, size_t len, bool no_cck,
 			       bool dont_wait_for_ack, u64 *cookie)
 {
-	return rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
+	int ret;
+	trace_rdev_mgmt_tx(&rdev->wiphy, wdev, chan, offchan, channel_type,
+			   channel_type_valid, wait, no_cck, dont_wait_for_ack);
+	ret = rdev->ops->mgmt_tx(&rdev->wiphy, wdev, chan, offchan,
 				  channel_type, channel_type_valid, wait, buf,
 				  len, no_cck, dont_wait_for_ack, cookie);
+	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
+	return ret;
 }
 
 static inline int
 rdev_mgmt_tx_cancel_wait(struct cfg80211_registered_device *rdev,
 			 struct wireless_dev *wdev, u64 cookie)
 {
-	return rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
+	int ret;
+	trace_rdev_mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
+	ret = rdev->ops->mgmt_tx_cancel_wait(&rdev->wiphy, wdev, cookie);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_set_power_mgmt(struct cfg80211_registered_device *rdev,
 				      struct net_device *dev, bool enabled,
 				      int timeout)
 {
-	return rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
+	int ret;
+	trace_rdev_set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
+	ret = rdev->ops->set_power_mgmt(&rdev->wiphy, dev, enabled, timeout);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
 rdev_set_cqm_rssi_config(struct cfg80211_registered_device *rdev,
 			 struct net_device *dev, s32 rssi_thold, u32 rssi_hyst)
 {
-	return rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
-					      rssi_hyst);
+	int ret;
+	trace_rdev_set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
+				       rssi_hyst);
+	ret = rdev->ops->set_cqm_rssi_config(&rdev->wiphy, dev, rssi_thold,
+				       rssi_hyst);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
 rdev_set_cqm_txe_config(struct cfg80211_registered_device *rdev,
 			struct net_device *dev, u32 rate, u32 pkts, u32 intvl)
 {
-	return rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
+	int ret;
+	trace_rdev_set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts, intvl);
+	ret = rdev->ops->set_cqm_txe_config(&rdev->wiphy, dev, rate, pkts,
 					     intvl);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline void
 rdev_mgmt_frame_register(struct cfg80211_registered_device *rdev,
 			 struct wireless_dev *wdev, u16 frame_type, bool reg)
 {
-	rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type,
-					      reg);
+	trace_rdev_mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
+	rdev->ops->mgmt_frame_register(&rdev->wiphy, wdev , frame_type, reg);
+	trace_rdev_return_void(&rdev->wiphy);
 }
 
 static inline int rdev_set_antenna(struct cfg80211_registered_device *rdev,
 				   u32 tx_ant, u32 rx_ant)
 {
-	return rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
+	int ret;
+	trace_rdev_set_antenna(&rdev->wiphy, tx_ant, rx_ant);
+	ret = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_get_antenna(struct cfg80211_registered_device *rdev,
 				   u32 *tx_ant, u32 *rx_ant)
 {
-	return rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
+	int ret;
+	trace_rdev_get_antenna(&rdev->wiphy);
+	ret = rdev->ops->get_antenna(&rdev->wiphy, tx_ant, rx_ant);
+	if (ret)
+		trace_rdev_return_int(&rdev->wiphy, ret);
+	else
+		trace_rdev_return_int_tx_rx(&rdev->wiphy, ret, *tx_ant,
+					    *rx_ant);
+	return ret;
 }
 
 static inline int rdev_set_ringparam(struct cfg80211_registered_device *rdev,
 				     u32 tx, u32 rx)
 {
-	return rdev->ops->set_ringparam(&rdev->wiphy, tx, rx);
+	int ret;
+	trace_rdev_set_ringparam(&rdev->wiphy, tx, rx);
+	ret = rdev->ops->set_ringparam(&rdev->wiphy, tx, rx);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline void rdev_get_ringparam(struct cfg80211_registered_device *rdev,
 				      u32 *tx, u32 *tx_max, u32 *rx,
 				      u32 *rx_max)
 {
+	trace_rdev_get_ringparam(&rdev->wiphy);
 	rdev->ops->get_ringparam(&rdev->wiphy, tx, tx_max, rx, rx_max);
+	trace_rdev_return_void_tx_rx(&rdev->wiphy, *tx, *tx_max, *rx, *rx_max);
 }
 
 static inline int
@@ -482,20 +744,32 @@
 		      struct net_device *dev,
 		      struct cfg80211_sched_scan_request *request)
 {
-	return rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
+	int ret;
+	trace_rdev_sched_scan_start(&rdev->wiphy, dev, request);
+	ret = rdev->ops->sched_scan_start(&rdev->wiphy, dev, request);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_sched_scan_stop(struct cfg80211_registered_device *rdev,
 				       struct net_device *dev)
 {
-	return rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
+	int ret;
+	trace_rdev_sched_scan_stop(&rdev->wiphy, dev);
+	ret = rdev->ops->sched_scan_stop(&rdev->wiphy, dev);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_set_rekey_data(struct cfg80211_registered_device *rdev,
 				      struct net_device *dev,
 				      struct cfg80211_gtk_rekey_data *data)
 {
-	return rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
+	int ret;
+	trace_rdev_set_rekey_data(&rdev->wiphy, dev);
+	ret = rdev->ops->set_rekey_data(&rdev->wiphy, dev, data);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_tdls_mgmt(struct cfg80211_registered_device *rdev,
@@ -503,56 +777,85 @@
 				 u8 action_code, u8 dialog_token,
 				 u16 status_code, const u8 *buf, size_t len)
 {
-	return rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
-				    dialog_token, status_code, buf, len);
+	int ret;
+	trace_rdev_tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
+			     dialog_token, status_code, buf, len);
+	ret = rdev->ops->tdls_mgmt(&rdev->wiphy, dev, peer, action_code,
+				   dialog_token, status_code, buf, len);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_tdls_oper(struct cfg80211_registered_device *rdev,
 				 struct net_device *dev, u8 *peer,
 				 enum nl80211_tdls_operation oper)
 {
-	return rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
+	int ret;
+	trace_rdev_tdls_oper(&rdev->wiphy, dev, peer, oper);
+	ret = rdev->ops->tdls_oper(&rdev->wiphy, dev, peer, oper);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int rdev_probe_client(struct cfg80211_registered_device *rdev,
 				    struct net_device *dev, const u8 *peer,
 				    u64 *cookie)
 {
-	return rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
+	int ret;
+	trace_rdev_probe_client(&rdev->wiphy, dev, peer);
+	ret = rdev->ops->probe_client(&rdev->wiphy, dev, peer, cookie);
+	trace_rdev_return_int_cookie(&rdev->wiphy, ret, *cookie);
+	return ret;
 }
 
 static inline int rdev_set_noack_map(struct cfg80211_registered_device *rdev,
 				     struct net_device *dev, u16 noack_map)
 {
-	return rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
+	int ret;
+	trace_rdev_set_noack_map(&rdev->wiphy, dev, noack_map);
+	ret = rdev->ops->set_noack_map(&rdev->wiphy, dev, noack_map);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline int
 rdev_get_et_sset_count(struct cfg80211_registered_device *rdev,
 		       struct net_device *dev, int sset)
 {
-	return rdev->ops->get_et_sset_count(&rdev->wiphy, dev, sset);
+	int ret;
+	trace_rdev_get_et_sset_count(&rdev->wiphy, dev, sset);
+	ret = rdev->ops->get_et_sset_count(&rdev->wiphy, dev, sset);
+	trace_rdev_return_int(&rdev->wiphy, ret);
+	return ret;
 }
 
 static inline void rdev_get_et_stats(struct cfg80211_registered_device *rdev,
 				     struct net_device *dev,
 				     struct ethtool_stats *stats, u64 *data)
 {
+	trace_rdev_get_et_stats(&rdev->wiphy, dev);
 	rdev->ops->get_et_stats(&rdev->wiphy, dev, stats, data);
+	trace_rdev_return_void(&rdev->wiphy);
 }
 
 static inline void rdev_get_et_strings(struct cfg80211_registered_device *rdev,
 				       struct net_device *dev, u32 sset,
 				       u8 *data)
 {
+	trace_rdev_get_et_strings(&rdev->wiphy, dev, sset);
 	rdev->ops->get_et_strings(&rdev->wiphy, dev, sset, data);
+	trace_rdev_return_void(&rdev->wiphy);
 }
 
 static inline struct ieee80211_channel
 *rdev_get_channel(struct cfg80211_registered_device *rdev,
 		  struct wireless_dev *wdev, enum nl80211_channel_type *type)
 {
-	return rdev->ops->get_channel(&rdev->wiphy, wdev, type);
+	struct ieee80211_channel *ret;
+	trace_rdev_get_channel(&rdev->wiphy, wdev);
+	ret = rdev->ops->get_channel(&rdev->wiphy, wdev, type);
+	trace_rdev_return_channel(&rdev->wiphy, ret, *type);
+	return ret;
 }
 
 #endif /* __CFG80211_RDEV_OPS */
