diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2014-10-10 13:52:40 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-10-20 10:24:21 -0400 |
commit | 89c771e5a62b856f4705f189892c489190edaec1 (patch) | |
tree | 79c6ced4c94b55bec6b6ec21808e42cc3b21f748 /net/wireless | |
parent | 2a84ee8625953fbce38b541aed77344044688a3e (diff) |
cfg80211: Convert del_station() callback to use a param struct
This makes it easier to add new parameters for the del_station calls
without having to modify all drivers that use this.
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 8 | ||||
-rw-r--r-- | net/wireless/rdev-ops.h | 7 | ||||
-rw-r--r-- | net/wireless/trace.h | 25 |
3 files changed, 31 insertions, 9 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d527aa0706c1..40cf7b937926 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -4398,10 +4398,12 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) | |||
4398 | { | 4398 | { |
4399 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; | 4399 | struct cfg80211_registered_device *rdev = info->user_ptr[0]; |
4400 | struct net_device *dev = info->user_ptr[1]; | 4400 | struct net_device *dev = info->user_ptr[1]; |
4401 | u8 *mac_addr = NULL; | 4401 | struct station_del_parameters params; |
4402 | |||
4403 | memset(¶ms, 0, sizeof(params)); | ||
4402 | 4404 | ||
4403 | if (info->attrs[NL80211_ATTR_MAC]) | 4405 | if (info->attrs[NL80211_ATTR_MAC]) |
4404 | mac_addr = nla_data(info->attrs[NL80211_ATTR_MAC]); | 4406 | params.mac = nla_data(info->attrs[NL80211_ATTR_MAC]); |
4405 | 4407 | ||
4406 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && | 4408 | if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP && |
4407 | dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && | 4409 | dev->ieee80211_ptr->iftype != NL80211_IFTYPE_AP_VLAN && |
@@ -4412,7 +4414,7 @@ static int nl80211_del_station(struct sk_buff *skb, struct genl_info *info) | |||
4412 | if (!rdev->ops->del_station) | 4414 | if (!rdev->ops->del_station) |
4413 | return -EOPNOTSUPP; | 4415 | return -EOPNOTSUPP; |
4414 | 4416 | ||
4415 | return rdev_del_station(rdev, dev, mac_addr); | 4417 | return rdev_del_station(rdev, dev, ¶ms); |
4416 | } | 4418 | } |
4417 | 4419 | ||
4418 | static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, | 4420 | static int nl80211_send_mpath(struct sk_buff *msg, u32 portid, u32 seq, |
diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h index c09e697bcb15..71b1db3cc645 100644 --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h | |||
@@ -178,11 +178,12 @@ static inline int rdev_add_station(struct cfg80211_registered_device *rdev, | |||
178 | } | 178 | } |
179 | 179 | ||
180 | static inline int rdev_del_station(struct cfg80211_registered_device *rdev, | 180 | static inline int rdev_del_station(struct cfg80211_registered_device *rdev, |
181 | struct net_device *dev, u8 *mac) | 181 | struct net_device *dev, |
182 | struct station_del_parameters *params) | ||
182 | { | 183 | { |
183 | int ret; | 184 | int ret; |
184 | trace_rdev_del_station(&rdev->wiphy, dev, mac); | 185 | trace_rdev_del_station(&rdev->wiphy, dev, params); |
185 | ret = rdev->ops->del_station(&rdev->wiphy, dev, mac); | 186 | ret = rdev->ops->del_station(&rdev->wiphy, dev, params); |
186 | trace_rdev_return_int(&rdev->wiphy, ret); | 187 | trace_rdev_return_int(&rdev->wiphy, ret); |
187 | return ret; | 188 | return ret; |
188 | } | 189 | } |
diff --git a/net/wireless/trace.h b/net/wireless/trace.h index 8e4f8f04332d..b1339400631d 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h | |||
@@ -680,9 +680,28 @@ DECLARE_EVENT_CLASS(wiphy_netdev_mac_evt, | |||
680 | WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac)) | 680 | WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac)) |
681 | ); | 681 | ); |
682 | 682 | ||
683 | DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_del_station, | 683 | DECLARE_EVENT_CLASS(station_del, |
684 | TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, const u8 *mac), | 684 | TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, |
685 | TP_ARGS(wiphy, netdev, mac) | 685 | struct station_del_parameters *params), |
686 | TP_ARGS(wiphy, netdev, params), | ||
687 | TP_STRUCT__entry( | ||
688 | WIPHY_ENTRY | ||
689 | NETDEV_ENTRY | ||
690 | MAC_ENTRY(sta_mac) | ||
691 | ), | ||
692 | TP_fast_assign( | ||
693 | WIPHY_ASSIGN; | ||
694 | NETDEV_ASSIGN; | ||
695 | MAC_ASSIGN(sta_mac, params->mac); | ||
696 | ), | ||
697 | TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", station mac: " MAC_PR_FMT, | ||
698 | WIPHY_PR_ARG, NETDEV_PR_ARG, MAC_PR_ARG(sta_mac)) | ||
699 | ); | ||
700 | |||
701 | DEFINE_EVENT(station_del, rdev_del_station, | ||
702 | TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, | ||
703 | struct station_del_parameters *params), | ||
704 | TP_ARGS(wiphy, netdev, params) | ||
686 | ); | 705 | ); |
687 | 706 | ||
688 | DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station, | 707 | DEFINE_EVENT(wiphy_netdev_mac_evt, rdev_get_station, |