From: Johannes Berg Date: Mon, 16 Dec 2013 10:23:45 +0000 (+0100) Subject: Merge remote-tracking branch 'wireless-next/master' into mac80211-next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4de673b775e4db48cd2db6277e0c6714332ca0c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge remote-tracking branch 'wireless-next/master' into mac80211-next --- c4de673b775e4db48cd2db6277e0c6714332ca0c diff --cc net/wireless/nl80211.c index 801e57da88b4,a693f86e5970..2d0c19c6133b --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@@ -6699,46 -6693,8 +6722,42 @@@ static int nl80211_set_mcast_rate(struc return err; } +static struct sk_buff * +__cfg80211_alloc_vendor_skb(struct cfg80211_registered_device *rdev, + int approxlen, u32 portid, u32 seq, + enum nl80211_commands cmd, + enum nl80211_attrs attr, gfp_t gfp) +{ + struct sk_buff *skb; + void *hdr; + struct nlattr *data; + + skb = nlmsg_new(approxlen + 100, gfp); + if (!skb) + return NULL; + + hdr = nl80211hdr_put(skb, portid, seq, 0, cmd); + if (!hdr) { + kfree_skb(skb); + return NULL; + } + + if (nla_put_u32(skb, NL80211_ATTR_WIPHY, rdev->wiphy_idx)) + goto nla_put_failure; + data = nla_nest_start(skb, attr); + + ((void **)skb->cb)[0] = rdev; + ((void **)skb->cb)[1] = hdr; + ((void **)skb->cb)[2] = data; + + return skb; + + nla_put_failure: + kfree_skb(skb); + return NULL; +} #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]; @@@ -9686,31 -9599,8 +9705,16 @@@ static const struct genl_ops nl80211_op .internal_flags = NL80211_FLAG_NEED_NETDEV_UP | NL80211_FLAG_NEED_RTNL, }, + { + .cmd = NL80211_CMD_VENDOR, + .doit = nl80211_vendor_cmd, + .policy = nl80211_policy, + .flags = GENL_ADMIN_PERM, + .internal_flags = NL80211_FLAG_NEED_WIPHY | + NL80211_FLAG_NEED_RTNL, + }, }; - 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)