split kernel and OpenWRT/LEDE patches

The OpenWRT patches are for the mac80211 package. They are functional
indentical to the kernel patches but need two modifications.

1. CONFIG_ needs to be replaced with CPTCFG_
2. any new configuration option, need to be patched into .local-symbols

This change move the kernel patches to a seperate directory, add a helper
script to rebuild the OpenWRT/LEDE patches and updates those patches.
This commit is contained in:
Andreas Schultz
2016-11-09 11:07:55 +01:00
parent 2f2a287928
commit bf57c7a336
7 changed files with 1460 additions and 11 deletions

View File

@ -21,7 +21,7 @@ index 760bc4d..e80b1af 100644
*/
void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+
+extern struct static_key_false mac80211_capwap_wtp;
+
@ -78,7 +78,7 @@ index 6837a46..e96cbff 100644
#define RX_DROP_UNUSABLE ((__force ieee80211_rx_result) 1u)
#define RX_DROP_MONITOR ((__force ieee80211_rx_result) 2u)
#define RX_QUEUED ((__force ieee80211_rx_result) 3u)
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+#define RX_IGNORE_MONITOR ((__force ieee80211_rx_result) 4u)
+#endif
@ -88,7 +88,7 @@ index 6837a46..e96cbff 100644
char name[IFNAMSIZ];
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+ /* Packet tunnel handlers */
+ struct ieee80211_pcktunnel __rcu *pcktunnel_handlers;
+#endif
@ -100,7 +100,7 @@ index 6837a46..e96cbff 100644
void __ieee80211_subif_start_xmit(struct sk_buff *skb,
struct net_device *dev,
u32 info_flags);
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+netdev_tx_t ieee80211_capwap_subif_start_xmit(struct sk_buff *skb,
+ struct net_device *dev);
+#endif
@ -116,7 +116,7 @@ index bcb0a1b..cb08ec2 100644
unregister_netdevice_notifier(&mac80211_netdev_notifier);
}
+
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+
+DEFINE_STATIC_KEY_FALSE(mac80211_capwap_wtp);
+
@ -186,7 +186,7 @@ index a3bb8f7..07b2ff6 100644
return RX_QUEUED;
}
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+
+static ieee80211_rx_result debug_noinline
+ieee80211_rx_h_pcktunnel(struct ieee80211_rx_data *rx, struct ieee80211_rate *rate)
@ -243,7 +243,7 @@ index a3bb8f7..07b2ff6 100644
if (rx->sta)
rx->sta->rx_stats.dropped++;
/* fall through */
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+ case RX_IGNORE_MONITOR:
+#endif
case RX_CONTINUE: {
@ -264,7 +264,7 @@ index a3bb8f7..07b2ff6 100644
if (ieee80211_vif_is_mesh(&rx->sdata->vif))
CALL_RXH(ieee80211_rx_h_mesh_fwding);
#endif
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+ if (static_branch_unlikely(&mac80211_capwap_wtp)) {
+ /* special treatment */
+ res = ieee80211_rx_h_pcktunnel(rx, rate);
@ -387,7 +387,7 @@ index bdc224d..ee4e7c7 100644
return NETDEV_TX_OK;
}
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+
+/*
+ * inject raw 802.11 frame, processing is mostly identical
@ -504,7 +504,7 @@ index bdc224d..ee4e7c7 100644
local_bh_enable();
}
+
+#ifdef CONFIG_MAC80211_CAPWAP_WTP
+#ifdef CPTCFG_MAC80211_CAPWAP_WTP
+
+netdev_tx_t ieee80211_inject_xmit(struct sk_buff* skb, struct net_device* dev) {
+ int multicast;
@ -683,3 +683,13 @@ index bdc224d..ee4e7c7 100644
--
2.9.3
--- a/.local-symbols
+++ b/.local-symbols
@@ -42,6 +42,7 @@ LIB80211_CRYPT_CCMP=
LIB80211_CRYPT_TKIP=
LIB80211_DEBUG=
MAC80211=
+MAC80211_CAPWAP_WTP=
MAC80211_HAS_RC=
MAC80211_RC_MINSTREL=
MAC80211_RC_MINSTREL_HT=

View File

@ -701,3 +701,13 @@ index 2030443..bca96a4 100644
--
2.9.3
--- a/.local-symbols
+++ b/.local-symbols
@@ -42,6 +42,7 @@ LIB80211_CRYPT_CCMP=
LIB80211_CRYPT_TKIP=
LIB80211_DEBUG=
MAC80211=
+MAC80211_CAPWAP_WTP=
MAC80211_HAS_RC=
MAC80211_RC_MINSTREL=
MAC80211_RC_MINSTREL_HT=

View File

@ -0,0 +1,32 @@
#!/bin/sh
#
# The OpenWRT patches are for the mac80211 package. They are functional
# indentical to the kernel patches but need two modifications.
#
# 1. CONFIG_ needs to be replaced with CPTCFG_
# 2. any new configuration option, need to be patched into .local-symbols
#
# This script takes the pure kernel patches and make the above modifications.
#
DIR=$(dirname $0)
rebuild() {
sed -e"s|CONFIG_|CPTCFG_|g" $DIR/../../kernel-patches/$1 > $DIR/922-$1
cat >> $DIR/922-$1 <<EOF
--- a/.local-symbols
+++ b/.local-symbols
@@ -42,6 +42,7 @@ LIB80211_CRYPT_CCMP=
LIB80211_CRYPT_TKIP=
LIB80211_DEBUG=
MAC80211=
+MAC80211_CAPWAP_WTP=
MAC80211_HAS_RC=
MAC80211_RC_MINSTREL=
MAC80211_RC_MINSTREL_HT=
EOF
}
for F in $DIR/../../kernel-patches/mac80211_packet_tunnel*patch; do \
rebuild $(basename $F); \
done