|
|
|
@@ -30,9 +30,9 @@ static int nl80211_crypto_settings(struct cfg80211_registered_device *rdev,
|
|
|
|
|
struct cfg80211_crypto_settings *settings,
|
|
|
|
|
int cipher_limit);
|
|
|
|
|
|
|
|
|
|
static int nl80211_pre_doit(struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
struct genl_info *info);
|
|
|
|
|
static void nl80211_post_doit(struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
struct genl_info *info);
|
|
|
|
|
|
|
|
|
|
/* the netlink family */
|
|
|
|
@@ -47,6 +47,25 @@ static struct genl_family nl80211_fam = {
|
|
|
|
|
.post_doit = nl80211_post_doit,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* multicast groups */
|
|
|
|
|
enum nl80211_multicast_groups {
|
|
|
|
|
NL80211_MCGRP_CONFIG,
|
|
|
|
|
NL80211_MCGRP_SCAN,
|
|
|
|
|
NL80211_MCGRP_REGULATORY,
|
|
|
|
|
NL80211_MCGRP_MLME,
|
|
|
|
|
NL80211_MCGRP_TESTMODE /* keep last - ifdef! */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct genl_multicast_group nl80211_mcgrps[] = {
|
|
|
|
|
[NL80211_MCGRP_CONFIG] = { .name = "config", },
|
|
|
|
|
[NL80211_MCGRP_SCAN] = { .name = "scan", },
|
|
|
|
|
[NL80211_MCGRP_REGULATORY] = { .name = "regulatory", },
|
|
|
|
|
[NL80211_MCGRP_MLME] = { .name = "mlme", },
|
|
|
|
|
#ifdef CONFIG_NL80211_TESTMODE
|
|
|
|
|
[NL80211_MCGRP_TESTMODE] = { .name = "testmode", }
|
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* returns ERR_PTR values */
|
|
|
|
|
static struct wireless_dev *
|
|
|
|
|
__cfg80211_wdev_from_attrs(struct net *netns, struct nlattr **attrs)
|
|
|
|
@@ -2687,7 +2706,7 @@ static int nl80211_get_key(struct sk_buff *skb, struct genl_info *info)
|
|
|
|
|
hdr = nl80211hdr_put(msg, info->snd_portid, info->snd_seq, 0,
|
|
|
|
|
NL80211_CMD_NEW_KEY);
|
|
|
|
|
if (!hdr)
|
|
|
|
|
return -ENOBUFS;
|
|
|
|
|
goto nla_put_failure;
|
|
|
|
|
|
|
|
|
|
cookie.msg = msg;
|
|
|
|
|
cookie.idx = key_idx;
|
|
|
|
@@ -5370,6 +5389,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
|
|
|
|
|
err = -EINVAL;
|
|
|
|
|
goto out_free;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!wiphy->bands[band])
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
err = ieee80211_get_ratemask(wiphy->bands[band],
|
|
|
|
|
nla_data(attr),
|
|
|
|
|
nla_len(attr),
|
|
|
|
@@ -6735,10 +6758,6 @@ __cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_NL80211_TESTMODE
|
|
|
|
|
static struct genl_multicast_group nl80211_testmode_mcgrp = {
|
|
|
|
|
.name = "testmode",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int nl80211_testmode_do(struct sk_buff *skb, struct genl_info *info)
|
|
|
|
|
{
|
|
|
|
|
struct cfg80211_registered_device *rdev = info->user_ptr[0];
|
|
|
|
@@ -6884,8 +6903,8 @@ void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
|
|
|
|
|
|
|
|
|
|
nla_nest_end(skb, data);
|
|
|
|
|
genlmsg_end(skb, hdr);
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), skb, 0,
|
|
|
|
|
nl80211_testmode_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), skb, 0,
|
|
|
|
|
NL80211_MCGRP_TESTMODE, gfp);
|
|
|
|
|
}
|
|
|
|
|
EXPORT_SYMBOL(cfg80211_testmode_event);
|
|
|
|
|
#endif
|
|
|
|
@@ -8973,7 +8992,7 @@ EXPORT_SYMBOL_GPL(cfg80211_vendor_cmd_reply);
|
|
|
|
|
#define NL80211_FLAG_NEED_WDEV_UP (NL80211_FLAG_NEED_WDEV |\
|
|
|
|
|
NL80211_FLAG_CHECK_NETDEV_UP)
|
|
|
|
|
|
|
|
|
|
static int nl80211_pre_doit(struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
struct genl_info *info)
|
|
|
|
|
{
|
|
|
|
|
struct cfg80211_registered_device *rdev;
|
|
|
|
@@ -9042,7 +9061,7 @@ static int nl80211_pre_doit(struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void nl80211_post_doit(struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
struct genl_info *info)
|
|
|
|
|
{
|
|
|
|
|
if (info->user_ptr[1]) {
|
|
|
|
@@ -9059,7 +9078,7 @@ static void nl80211_post_doit(struct genl_ops *ops, struct sk_buff *skb,
|
|
|
|
|
rtnl_unlock();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static struct genl_ops nl80211_ops[] = {
|
|
|
|
|
static const struct genl_ops nl80211_ops[] = {
|
|
|
|
|
{
|
|
|
|
|
.cmd = NL80211_CMD_GET_WIPHY,
|
|
|
|
|
.doit = nl80211_get_wiphy,
|
|
|
|
@@ -9696,21 +9715,6 @@ static struct genl_ops nl80211_ops[] = {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct genl_multicast_group nl80211_mlme_mcgrp = {
|
|
|
|
|
.name = "mlme",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* multicast groups */
|
|
|
|
|
static struct genl_multicast_group nl80211_config_mcgrp = {
|
|
|
|
|
.name = "config",
|
|
|
|
|
};
|
|
|
|
|
static struct genl_multicast_group nl80211_scan_mcgrp = {
|
|
|
|
|
.name = "scan",
|
|
|
|
|
};
|
|
|
|
|
static struct genl_multicast_group nl80211_regulatory_mcgrp = {
|
|
|
|
|
.name = "regulatory",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* notification functions */
|
|
|
|
|
|
|
|
|
|
void nl80211_notify_dev_rename(struct cfg80211_registered_device *rdev)
|
|
|
|
@@ -9727,8 +9731,8 @@ void nl80211_notify_dev_rename(struct cfg80211_registered_device *rdev)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_config_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_CONFIG, GFP_KERNEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int nl80211_add_scan_req(struct sk_buff *msg,
|
|
|
|
@@ -9763,8 +9767,9 @@ static int nl80211_add_scan_req(struct sk_buff *msg,
|
|
|
|
|
nla_put(msg, NL80211_ATTR_IE, req->ie_len, req->ie))
|
|
|
|
|
goto nla_put_failure;
|
|
|
|
|
|
|
|
|
|
if (req->flags)
|
|
|
|
|
nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags);
|
|
|
|
|
if (req->flags &&
|
|
|
|
|
nla_put_u32(msg, NL80211_ATTR_SCAN_FLAGS, req->flags))
|
|
|
|
|
goto nla_put_failure;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -9837,8 +9842,8 @@ void nl80211_send_scan_start(struct cfg80211_registered_device *rdev,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_scan_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_SCAN, GFP_KERNEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nl80211_send_scan_done(struct cfg80211_registered_device *rdev,
|
|
|
|
@@ -9856,8 +9861,8 @@ void nl80211_send_scan_done(struct cfg80211_registered_device *rdev,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_scan_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_SCAN, GFP_KERNEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev,
|
|
|
|
@@ -9875,8 +9880,8 @@ void nl80211_send_scan_aborted(struct cfg80211_registered_device *rdev,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_scan_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_SCAN, GFP_KERNEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nl80211_send_sched_scan_results(struct cfg80211_registered_device *rdev,
|
|
|
|
@@ -9894,8 +9899,8 @@ void nl80211_send_sched_scan_results(struct cfg80211_registered_device *rdev,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_scan_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_SCAN, GFP_KERNEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev,
|
|
|
|
@@ -9912,8 +9917,8 @@ void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_scan_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_SCAN, GFP_KERNEL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@@ -9967,8 +9972,8 @@ void nl80211_send_reg_change_event(struct regulatory_request *request)
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
rcu_read_lock();
|
|
|
|
|
genlmsg_multicast_allns(msg, 0, nl80211_regulatory_mcgrp.id,
|
|
|
|
|
GFP_ATOMIC);
|
|
|
|
|
genlmsg_multicast_allns(&nl80211_fam, msg, 0,
|
|
|
|
|
NL80211_MCGRP_REGULATORY, GFP_ATOMIC);
|
|
|
|
|
rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
@@ -10003,8 +10008,8 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10091,8 +10096,8 @@ static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10147,8 +10152,8 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10186,8 +10191,8 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10224,8 +10229,8 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, GFP_KERNEL);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10258,8 +10263,8 @@ void nl80211_send_ibss_bssid(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10299,8 +10304,8 @@ void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10338,8 +10343,8 @@ void nl80211_michael_mic_failure(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10391,8 +10396,8 @@ void nl80211_send_beacon_hint_event(struct wiphy *wiphy,
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
rcu_read_lock();
|
|
|
|
|
genlmsg_multicast_allns(msg, 0, nl80211_regulatory_mcgrp.id,
|
|
|
|
|
GFP_ATOMIC);
|
|
|
|
|
genlmsg_multicast_allns(&nl80211_fam, msg, 0,
|
|
|
|
|
NL80211_MCGRP_REGULATORY, GFP_ATOMIC);
|
|
|
|
|
rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
@@ -10437,8 +10442,8 @@ static void nl80211_send_remain_on_chan_event(
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10492,8 +10497,8 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
}
|
|
|
|
|
EXPORT_SYMBOL(cfg80211_new_sta);
|
|
|
|
|
|
|
|
|
@@ -10522,8 +10527,8 @@ void cfg80211_del_sta(struct net_device *dev, const u8 *mac_addr, gfp_t gfp)
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10558,8 +10563,8 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10720,8 +10725,8 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10769,8 +10774,8 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10814,8 +10819,8 @@ static void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10872,8 +10877,8 @@ nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10919,8 +10924,8 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -10993,8 +10998,8 @@ void cfg80211_cqm_txe_notify(struct net_device *dev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -11042,8 +11047,8 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -11089,8 +11094,8 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -11129,8 +11134,8 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -11220,6 +11225,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
|
|
|
|
|
struct nlattr *reasons;
|
|
|
|
|
|
|
|
|
|
reasons = nla_nest_start(msg, NL80211_ATTR_WOWLAN_TRIGGERS);
|
|
|
|
|
if (!reasons)
|
|
|
|
|
goto free_msg;
|
|
|
|
|
|
|
|
|
|
if (wakeup->disconnect &&
|
|
|
|
|
nla_put_flag(msg, NL80211_WOWLAN_TRIG_DISCONNECT))
|
|
|
|
@@ -11245,16 +11252,18 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
|
|
|
|
|
wakeup->pattern_idx))
|
|
|
|
|
goto free_msg;
|
|
|
|
|
|
|
|
|
|
if (wakeup->tcp_match)
|
|
|
|
|
nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH);
|
|
|
|
|
if (wakeup->tcp_match &&
|
|
|
|
|
nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH))
|
|
|
|
|
goto free_msg;
|
|
|
|
|
|
|
|
|
|
if (wakeup->tcp_connlost)
|
|
|
|
|
nla_put_flag(msg,
|
|
|
|
|
NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST);
|
|
|
|
|
if (wakeup->tcp_connlost &&
|
|
|
|
|
nla_put_flag(msg, NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST))
|
|
|
|
|
goto free_msg;
|
|
|
|
|
|
|
|
|
|
if (wakeup->tcp_nomoretokens)
|
|
|
|
|
nla_put_flag(msg,
|
|
|
|
|
NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS);
|
|
|
|
|
if (wakeup->tcp_nomoretokens &&
|
|
|
|
|
nla_put_flag(msg,
|
|
|
|
|
NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS))
|
|
|
|
|
goto free_msg;
|
|
|
|
|
|
|
|
|
|
if (wakeup->packet) {
|
|
|
|
|
u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211;
|
|
|
|
@@ -11281,8 +11290,8 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
free_msg:
|
|
|
|
@@ -11323,8 +11332,8 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, gfp);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, gfp);
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
nla_put_failure:
|
|
|
|
@@ -11390,24 +11399,29 @@ void cfg80211_ft_event(struct net_device *netdev,
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
hdr = nl80211hdr_put(msg, 0, 0, 0, NL80211_CMD_FT_EVENT);
|
|
|
|
|
if (!hdr) {
|
|
|
|
|
nlmsg_free(msg);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!hdr)
|
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
|
|
|
|
|
nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex);
|
|
|
|
|
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap);
|
|
|
|
|
if (ft_event->ies)
|
|
|
|
|
nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies);
|
|
|
|
|
if (ft_event->ric_ies)
|
|
|
|
|
nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len,
|
|
|
|
|
ft_event->ric_ies);
|
|
|
|
|
if (nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) ||
|
|
|
|
|
nla_put_u32(msg, NL80211_ATTR_IFINDEX, netdev->ifindex) ||
|
|
|
|
|
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, ft_event->target_ap))
|
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
if (ft_event->ies &&
|
|
|
|
|
nla_put(msg, NL80211_ATTR_IE, ft_event->ies_len, ft_event->ies))
|
|
|
|
|
goto out;
|
|
|
|
|
if (ft_event->ric_ies &&
|
|
|
|
|
nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len,
|
|
|
|
|
ft_event->ric_ies))
|
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
|
|
genlmsg_end(msg, hdr);
|
|
|
|
|
|
|
|
|
|
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
nl80211_mlme_mcgrp.id, GFP_KERNEL);
|
|
|
|
|
genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0,
|
|
|
|
|
NL80211_MCGRP_MLME, GFP_KERNEL);
|
|
|
|
|
return;
|
|
|
|
|
out:
|
|
|
|
|
nlmsg_free(msg);
|
|
|
|
|
}
|
|
|
|
|
EXPORT_SYMBOL(cfg80211_ft_event);
|
|
|
|
|
|
|
|
|
@@ -11456,33 +11470,11 @@ int nl80211_init(void)
|
|
|
|
|
{
|
|
|
|
|
int err;
|
|
|
|
|
|
|
|
|
|
err = genl_register_family_with_ops(&nl80211_fam,
|
|
|
|
|
nl80211_ops, ARRAY_SIZE(nl80211_ops));
|
|
|
|
|
err = genl_register_family_with_ops_groups(&nl80211_fam, nl80211_ops,
|
|
|
|
|
nl80211_mcgrps);
|
|
|
|
|
if (err)
|
|
|
|
|
return err;
|
|
|
|
|
|
|
|
|
|
err = genl_register_mc_group(&nl80211_fam, &nl80211_config_mcgrp);
|
|
|
|
|
if (err)
|
|
|
|
|
goto err_out;
|
|
|
|
|
|
|
|
|
|
err = genl_register_mc_group(&nl80211_fam, &nl80211_scan_mcgrp);
|
|
|
|
|
if (err)
|
|
|
|
|
goto err_out;
|
|
|
|
|
|
|
|
|
|
err = genl_register_mc_group(&nl80211_fam, &nl80211_regulatory_mcgrp);
|
|
|
|
|
if (err)
|
|
|
|
|
goto err_out;
|
|
|
|
|
|
|
|
|
|
err = genl_register_mc_group(&nl80211_fam, &nl80211_mlme_mcgrp);
|
|
|
|
|
if (err)
|
|
|
|
|
goto err_out;
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_NL80211_TESTMODE
|
|
|
|
|
err = genl_register_mc_group(&nl80211_fam, &nl80211_testmode_mcgrp);
|
|
|
|
|
if (err)
|
|
|
|
|
goto err_out;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
err = netlink_register_notifier(&nl80211_netlink_notifier);
|
|
|
|
|
if (err)
|
|
|
|
|
goto err_out;
|
|
|
|
|