summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-11-21 20:51:23 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2013-11-21 23:34:44 +0100
commitd7a42dd40dfb09fa980c7492f469f8a525f7df8c (patch)
tree40971930b58aeabf64af01ad2a9c10de48fab82b /patches
parentc38da7cf931df4f26692b6fe1d93131d8898aab7 (diff)
backports: support new generic netlink APIs
I recently changed the generic netlink registration and multicast group APIs to be safer. Backport these changes by implementing all the new APIs in terms of what was in the kernel before. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/collateral-evolutions/network/81-genl-const/INFO3
-rw-r--r--patches/collateral-evolutions/network/81-genl-const/hwsim.patch11
-rw-r--r--patches/collateral-evolutions/network/81-genl-const/ieee802154.patch20
-rw-r--r--patches/collateral-evolutions/network/81-genl-const/nfc.patch20
-rw-r--r--patches/collateral-evolutions/network/81-genl-const/nl80211.patch50
5 files changed, 104 insertions, 0 deletions
diff --git a/patches/collateral-evolutions/network/81-genl-const/INFO b/patches/collateral-evolutions/network/81-genl-const/INFO
new file mode 100644
index 00000000..242f9f8e
--- /dev/null
+++ b/patches/collateral-evolutions/network/81-genl-const/INFO
@@ -0,0 +1,3 @@
+Newer kernels make generic netlink ops and multicast groups
+const, but older can't have that. We therefore introduce
+__genl_const, which can be defined depending on the kernel.
diff --git a/patches/collateral-evolutions/network/81-genl-const/hwsim.patch b/patches/collateral-evolutions/network/81-genl-const/hwsim.patch
new file mode 100644
index 00000000..d720dda4
--- /dev/null
+++ b/patches/collateral-evolutions/network/81-genl-const/hwsim.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/wireless/mac80211_hwsim.c
++++ b/drivers/net/wireless/mac80211_hwsim.c
+@@ -2097,7 +2097,7 @@ out:
+ }
+
+ /* Generic Netlink operations array */
+-static const struct genl_ops hwsim_ops[] = {
++static __genl_const struct genl_ops hwsim_ops[] = {
+ {
+ .cmd = HWSIM_CMD_REGISTER,
+ .policy = hwsim_genl_policy,
diff --git a/patches/collateral-evolutions/network/81-genl-const/ieee802154.patch b/patches/collateral-evolutions/network/81-genl-const/ieee802154.patch
new file mode 100644
index 00000000..8e9b226a
--- /dev/null
+++ b/patches/collateral-evolutions/network/81-genl-const/ieee802154.patch
@@ -0,0 +1,20 @@
+--- a/net/ieee802154/netlink.c
++++ b/net/ieee802154/netlink.c
+@@ -109,7 +109,7 @@ out:
+ return -ENOBUFS;
+ }
+
+-static const struct genl_ops ieee8021154_ops[] = {
++static __genl_const struct genl_ops ieee8021154_ops[] = {
+ /* see nl-phy.c */
+ IEEE802154_DUMP(IEEE802154_LIST_PHY, ieee802154_list_phy,
+ ieee802154_dump_phy),
+@@ -125,7 +125,7 @@ static const struct genl_ops ieee8021154
+ ieee802154_dump_iface),
+ };
+
+-static const struct genl_multicast_group ieee802154_mcgrps[] = {
++static __genl_const struct genl_multicast_group ieee802154_mcgrps[] = {
+ [IEEE802154_COORD_MCGRP] = { .name = IEEE802154_MCAST_COORD_NAME, },
+ [IEEE802154_BEACON_MCGRP] = { .name = IEEE802154_MCAST_BEACON_NAME, },
+ };
diff --git a/patches/collateral-evolutions/network/81-genl-const/nfc.patch b/patches/collateral-evolutions/network/81-genl-const/nfc.patch
new file mode 100644
index 00000000..3a34016d
--- /dev/null
+++ b/patches/collateral-evolutions/network/81-genl-const/nfc.patch
@@ -0,0 +1,20 @@
+--- a/net/nfc/netlink.c
++++ b/net/nfc/netlink.c
+@@ -30,7 +30,7 @@
+ #include "nfc.h"
+ #include "llcp.h"
+
+-static const struct genl_multicast_group nfc_genl_mcgrps[] = {
++static __genl_const struct genl_multicast_group nfc_genl_mcgrps[] = {
+ { .name = NFC_GENL_MCAST_EVENT_NAME, },
+ };
+
+@@ -1364,7 +1364,7 @@ static int nfc_genl_se_io(struct sk_buff
+ return dev->ops->se_io(dev, se_idx, apdu, apdu_len, se_io_cb, ctx);
+ }
+
+-static const struct genl_ops nfc_genl_ops[] = {
++static __genl_const struct genl_ops nfc_genl_ops[] = {
+ {
+ .cmd = NFC_CMD_GET_DEVICE,
+ .doit = nfc_genl_get_device,
diff --git a/patches/collateral-evolutions/network/81-genl-const/nl80211.patch b/patches/collateral-evolutions/network/81-genl-const/nl80211.patch
new file mode 100644
index 00000000..676c9df1
--- /dev/null
+++ b/patches/collateral-evolutions/network/81-genl-const/nl80211.patch
@@ -0,0 +1,50 @@
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -30,9 +30,9 @@ static int nl80211_crypto_settings(struc
+ struct cfg80211_crypto_settings *settings,
+ int cipher_limit);
+
+-static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
++static int nl80211_pre_doit(__genl_const struct genl_ops *ops, struct sk_buff *skb,
+ struct genl_info *info);
+-static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
++static void nl80211_post_doit(__genl_const struct genl_ops *ops, struct sk_buff *skb,
+ struct genl_info *info);
+
+ /* the netlink family */
+@@ -56,7 +56,7 @@ enum nl80211_multicast_groups {
+ NL80211_MCGRP_TESTMODE /* keep last - ifdef! */
+ };
+
+-static const struct genl_multicast_group nl80211_mcgrps[] = {
++static __genl_const struct genl_multicast_group nl80211_mcgrps[] = {
+ [NL80211_MCGRP_CONFIG] = { .name = "config", },
+ [NL80211_MCGRP_SCAN] = { .name = "scan", },
+ [NL80211_MCGRP_REGULATORY] = { .name = "regulatory", },
+@@ -8870,7 +8870,7 @@ static int nl80211_crit_protocol_stop(st
+ #define NL80211_FLAG_NEED_WDEV_UP (NL80211_FLAG_NEED_WDEV |\
+ NL80211_FLAG_CHECK_NETDEV_UP)
+
+-static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
++static int nl80211_pre_doit(__genl_const struct genl_ops *ops, struct sk_buff *skb,
+ struct genl_info *info)
+ {
+ struct cfg80211_registered_device *rdev;
+@@ -8939,7 +8939,7 @@ static int nl80211_pre_doit(const struct
+ return 0;
+ }
+
+-static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
++static void nl80211_post_doit(__genl_const struct genl_ops *ops, struct sk_buff *skb,
+ struct genl_info *info)
+ {
+ if (info->user_ptr[1]) {
+@@ -8956,7 +8956,7 @@ static void nl80211_post_doit(const stru
+ rtnl_unlock();
+ }
+
+-static const struct genl_ops nl80211_ops[] = {
++static __genl_const struct genl_ops nl80211_ops[] = {
+ {
+ .cmd = NL80211_CMD_GET_WIPHY,
+ .doit = nl80211_get_wiphy,