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 | |
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>
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/cfg80211.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/wil6210/cfg80211.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/mwifiex/cfg80211.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 4 | ||||
-rw-r--r-- | include/net/cfg80211.h | 15 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 6 | ||||
-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 |
10 files changed, 64 insertions, 27 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index ba60e37213eb..7a5337877a0c 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c | |||
@@ -2976,11 +2976,11 @@ static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev) | |||
2976 | static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | 2976 | static const u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
2977 | 2977 | ||
2978 | static int ath6kl_del_station(struct wiphy *wiphy, struct net_device *dev, | 2978 | static int ath6kl_del_station(struct wiphy *wiphy, struct net_device *dev, |
2979 | const u8 *mac) | 2979 | struct station_del_parameters *params) |
2980 | { | 2980 | { |
2981 | struct ath6kl *ar = ath6kl_priv(dev); | 2981 | struct ath6kl *ar = ath6kl_priv(dev); |
2982 | struct ath6kl_vif *vif = netdev_priv(dev); | 2982 | struct ath6kl_vif *vif = netdev_priv(dev); |
2983 | const u8 *addr = mac ? mac : bcast_addr; | 2983 | const u8 *addr = params->mac ? params->mac : bcast_addr; |
2984 | 2984 | ||
2985 | return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, WMI_AP_DEAUTH, | 2985 | return ath6kl_wmi_ap_set_mlme(ar->wmi, vif->fw_vif_idx, WMI_AP_DEAUTH, |
2986 | addr, WLAN_REASON_PREV_AUTH_NOT_VALID); | 2986 | addr, WLAN_REASON_PREV_AUTH_NOT_VALID); |
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index d9f4b30dd343..8fdfa3222a6e 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c | |||
@@ -792,12 +792,13 @@ static int wil_cfg80211_stop_ap(struct wiphy *wiphy, | |||
792 | } | 792 | } |
793 | 793 | ||
794 | static int wil_cfg80211_del_station(struct wiphy *wiphy, | 794 | static int wil_cfg80211_del_station(struct wiphy *wiphy, |
795 | struct net_device *dev, const u8 *mac) | 795 | struct net_device *dev, |
796 | struct station_del_parameters *params) | ||
796 | { | 797 | { |
797 | struct wil6210_priv *wil = wiphy_to_wil(wiphy); | 798 | struct wil6210_priv *wil = wiphy_to_wil(wiphy); |
798 | 799 | ||
799 | mutex_lock(&wil->mutex); | 800 | mutex_lock(&wil->mutex); |
800 | wil6210_disconnect(wil, mac); | 801 | wil6210_disconnect(wil, params->mac); |
801 | mutex_unlock(&wil->mutex); | 802 | mutex_unlock(&wil->mutex); |
802 | 803 | ||
803 | return 0; | 804 | return 0; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 28fa25b509db..1a2e062d3bfd 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -3998,24 +3998,24 @@ brcmf_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *ndev, | |||
3998 | 3998 | ||
3999 | static int | 3999 | static int |
4000 | brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, | 4000 | brcmf_cfg80211_del_station(struct wiphy *wiphy, struct net_device *ndev, |
4001 | const u8 *mac) | 4001 | struct station_del_parameters *params) |
4002 | { | 4002 | { |
4003 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | 4003 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); |
4004 | struct brcmf_scb_val_le scbval; | 4004 | struct brcmf_scb_val_le scbval; |
4005 | struct brcmf_if *ifp = netdev_priv(ndev); | 4005 | struct brcmf_if *ifp = netdev_priv(ndev); |
4006 | s32 err; | 4006 | s32 err; |
4007 | 4007 | ||
4008 | if (!mac) | 4008 | if (!params->mac) |
4009 | return -EFAULT; | 4009 | return -EFAULT; |
4010 | 4010 | ||
4011 | brcmf_dbg(TRACE, "Enter %pM\n", mac); | 4011 | brcmf_dbg(TRACE, "Enter %pM\n", params->mac); |
4012 | 4012 | ||
4013 | if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif) | 4013 | if (ifp->vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif) |
4014 | ifp = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; | 4014 | ifp = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; |
4015 | if (!check_vif_up(ifp->vif)) | 4015 | if (!check_vif_up(ifp->vif)) |
4016 | return -EIO; | 4016 | return -EIO; |
4017 | 4017 | ||
4018 | memcpy(&scbval.ea, mac, ETH_ALEN); | 4018 | memcpy(&scbval.ea, params->mac, ETH_ALEN); |
4019 | scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING); | 4019 | scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING); |
4020 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, | 4020 | err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON, |
4021 | &scbval, sizeof(scbval)); | 4021 | &scbval, sizeof(scbval)); |
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 0dd672954ad1..71e29c7055de 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c | |||
@@ -1239,7 +1239,7 @@ static int mwifiex_cfg80211_change_beacon(struct wiphy *wiphy, | |||
1239 | */ | 1239 | */ |
1240 | static int | 1240 | static int |
1241 | mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, | 1241 | mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, |
1242 | const u8 *mac) | 1242 | struct station_del_parameters *params) |
1243 | { | 1243 | { |
1244 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); | 1244 | struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); |
1245 | struct mwifiex_sta_node *sta_node; | 1245 | struct mwifiex_sta_node *sta_node; |
@@ -1248,7 +1248,7 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, | |||
1248 | if (list_empty(&priv->sta_list) || !priv->bss_started) | 1248 | if (list_empty(&priv->sta_list) || !priv->bss_started) |
1249 | return 0; | 1249 | return 0; |
1250 | 1250 | ||
1251 | if (!mac || is_broadcast_ether_addr(mac)) { | 1251 | if (!params->mac || is_broadcast_ether_addr(params->mac)) { |
1252 | wiphy_dbg(wiphy, "%s: NULL/broadcast mac address\n", __func__); | 1252 | wiphy_dbg(wiphy, "%s: NULL/broadcast mac address\n", __func__); |
1253 | list_for_each_entry(sta_node, &priv->sta_list, list) { | 1253 | list_for_each_entry(sta_node, &priv->sta_list, list) { |
1254 | if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH, | 1254 | if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH, |
@@ -1258,9 +1258,10 @@ mwifiex_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev, | |||
1258 | mwifiex_uap_del_sta_data(priv, sta_node); | 1258 | mwifiex_uap_del_sta_data(priv, sta_node); |
1259 | } | 1259 | } |
1260 | } else { | 1260 | } else { |
1261 | wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__, mac); | 1261 | wiphy_dbg(wiphy, "%s: mac address %pM\n", __func__, |
1262 | params->mac); | ||
1262 | spin_lock_irqsave(&priv->sta_list_spinlock, flags); | 1263 | spin_lock_irqsave(&priv->sta_list_spinlock, flags); |
1263 | sta_node = mwifiex_get_sta_entry(priv, mac); | 1264 | sta_node = mwifiex_get_sta_entry(priv, params->mac); |
1264 | spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); | 1265 | spin_unlock_irqrestore(&priv->sta_list_spinlock, flags); |
1265 | if (sta_node) { | 1266 | if (sta_node) { |
1266 | if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH, | 1267 | if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_STA_DEAUTH, |
diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index bd6953af0a03..3d26955da724 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | |||
@@ -2856,8 +2856,10 @@ static int cfg80211_rtw_add_station(struct wiphy *wiphy, | |||
2856 | } | 2856 | } |
2857 | 2857 | ||
2858 | static int cfg80211_rtw_del_station(struct wiphy *wiphy, | 2858 | static int cfg80211_rtw_del_station(struct wiphy *wiphy, |
2859 | struct net_device *ndev, const u8 *mac) | 2859 | struct net_device *ndev, |
2860 | struct station_del_parameters *params) | ||
2860 | { | 2861 | { |
2862 | const u8 *mac = params->mac; | ||
2861 | int ret = 0; | 2863 | int ret = 0; |
2862 | struct list_head *phead, *plist, *ptmp; | 2864 | struct list_head *phead, *plist, *ptmp; |
2863 | u8 updated = 0; | 2865 | u8 updated = 0; |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3f3aaa06adb5..ebb69f671979 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -799,6 +799,17 @@ struct station_parameters { | |||
799 | }; | 799 | }; |
800 | 800 | ||
801 | /** | 801 | /** |
802 | * struct station_del_parameters - station deletion parameters | ||
803 | * | ||
804 | * Used to delete a station entry (or all stations). | ||
805 | * | ||
806 | * @mac: MAC address of the station to remove or NULL to remove all stations | ||
807 | */ | ||
808 | struct station_del_parameters { | ||
809 | const u8 *mac; | ||
810 | }; | ||
811 | |||
812 | /** | ||
802 | * enum cfg80211_station_type - the type of station being modified | 813 | * enum cfg80211_station_type - the type of station being modified |
803 | * @CFG80211_STA_AP_CLIENT: client of an AP interface | 814 | * @CFG80211_STA_AP_CLIENT: client of an AP interface |
804 | * @CFG80211_STA_AP_MLME_CLIENT: client of an AP interface that has | 815 | * @CFG80211_STA_AP_MLME_CLIENT: client of an AP interface that has |
@@ -2132,7 +2143,7 @@ struct cfg80211_qos_map { | |||
2132 | * @stop_ap: Stop being an AP, including stopping beaconing. | 2143 | * @stop_ap: Stop being an AP, including stopping beaconing. |
2133 | * | 2144 | * |
2134 | * @add_station: Add a new station. | 2145 | * @add_station: Add a new station. |
2135 | * @del_station: Remove a station; @mac may be NULL to remove all stations. | 2146 | * @del_station: Remove a station |
2136 | * @change_station: Modify a given station. Note that flags changes are not much | 2147 | * @change_station: Modify a given station. Note that flags changes are not much |
2137 | * validated in cfg80211, in particular the auth/assoc/authorized flags | 2148 | * validated in cfg80211, in particular the auth/assoc/authorized flags |
2138 | * might come to the driver in invalid combinations -- make sure to check | 2149 | * might come to the driver in invalid combinations -- make sure to check |
@@ -2378,7 +2389,7 @@ struct cfg80211_ops { | |||
2378 | const u8 *mac, | 2389 | const u8 *mac, |
2379 | struct station_parameters *params); | 2390 | struct station_parameters *params); |
2380 | int (*del_station)(struct wiphy *wiphy, struct net_device *dev, | 2391 | int (*del_station)(struct wiphy *wiphy, struct net_device *dev, |
2381 | const u8 *mac); | 2392 | struct station_del_parameters *params); |
2382 | int (*change_station)(struct wiphy *wiphy, struct net_device *dev, | 2393 | int (*change_station)(struct wiphy *wiphy, struct net_device *dev, |
2383 | const u8 *mac, | 2394 | const u8 *mac, |
2384 | struct station_parameters *params); | 2395 | struct station_parameters *params); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 4bb2d34b2dd7..a1498416ad55 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1225,14 +1225,14 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
1225 | } | 1225 | } |
1226 | 1226 | ||
1227 | static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev, | 1227 | static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev, |
1228 | const u8 *mac) | 1228 | struct station_del_parameters *params) |
1229 | { | 1229 | { |
1230 | struct ieee80211_sub_if_data *sdata; | 1230 | struct ieee80211_sub_if_data *sdata; |
1231 | 1231 | ||
1232 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1232 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1233 | 1233 | ||
1234 | if (mac) | 1234 | if (params->mac) |
1235 | return sta_info_destroy_addr_bss(sdata, mac); | 1235 | return sta_info_destroy_addr_bss(sdata, params->mac); |
1236 | 1236 | ||
1237 | sta_info_flush(sdata); | 1237 | sta_info_flush(sdata); |
1238 | return 0; | 1238 | return 0; |
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, |