summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Borg <martin.borg@enea.com>2016-02-22 14:09:57 +0100
committerNora Björklund <nora.bjorklund@enea.com>2016-02-29 13:50:52 +0100
commit7c0ab0937532741b31985ae908bcf6b0602bd8aa (patch)
tree788e6d48d95eaec978f8e86b964788e024cc5586
parent3f36f9ea3dc013cc3306017becccca70d4f5a314 (diff)
downloadmeta-el-common-7c0ab0937532741b31985ae908bcf6b0602bd8aa.tar.gz
linx: update to v.2.6.7
linx and linx-mod recipes updated to version 2.6.7. The patches we applied have been included in this release. Signed-off-by: Martin Borg <martin.borg@enea.com> Signed-off-by: Nora Björklund <nora.bjorklund@enea.com>
-rw-r--r--recipes-enea/linx/linx-2.6.6/liblinx_free_buf.patch22
-rw-r--r--recipes-enea/linx/linx-2.6.6/liblinx_nobase.patch29
-rw-r--r--recipes-enea/linx/linx-2.6.6/linxcfg_nobase.patch38
-rw-r--r--recipes-enea/linx/linx-mod-2.6.6/linx-kernel-modules.patch288
-rw-r--r--recipes-enea/linx/linx-mod-2.6.6/support-for-3.11-kernel-versions.patch206
-rw-r--r--recipes-enea/linx/linx-mod-2.6.6/support-for-3.12-kernels.patch24
-rw-r--r--recipes-enea/linx/linx-mod-2.6.6/support-for-3.15-kernels.patch60
-rw-r--r--recipes-enea/linx/linx-mod_2.6.7.bb (renamed from recipes-enea/linx/linx-mod_2.6.6.bb)8
-rw-r--r--recipes-enea/linx/linx.inc7
-rw-r--r--recipes-enea/linx/linx_2.6.7.bb (renamed from recipes-enea/linx/linx_2.6.6.bb)0
10 files changed, 6 insertions, 676 deletions
diff --git a/recipes-enea/linx/linx-2.6.6/liblinx_free_buf.patch b/recipes-enea/linx/linx-2.6.6/liblinx_free_buf.patch
deleted file mode 100644
index 42f3e99..0000000
--- a/recipes-enea/linx/linx-2.6.6/liblinx_free_buf.patch
+++ /dev/null
@@ -1,22 +0,0 @@
1Fixed buffer free problem when sending between threads in the same process.
2
3Upstream-Status: Not Applicable
4
5Signed-off-by: Huimin She <huimin.she@enea.com>
6
7---
8diff -rup a/liblinx/linx.c b/liblinx/linx.c
9--- a/liblinx/linx.c 2014-04-17 13:40:30.000000000 +0200
10+++ b/liblinx/linx.c 2014-07-24 14:22:30.264648751 +0200
11@@ -711,7 +711,10 @@ int linx_send(LINX * linx, union LINX_SI
12 if (ret == 0) {
13 sig_adm->sndrcv = sndrcv;
14 }
15- adm_free_buf(linx, sig_adm);
16+ if (ret != 1) {
17+ /* Don't free signals sent back to itself, they are needed later! */
18+ adm_free_buf(linx, sig_adm);
19+ }
20 out:
21 /* Take signal pointer from user. */
22 *sig = LINX_NIL;
diff --git a/recipes-enea/linx/linx-2.6.6/liblinx_nobase.patch b/recipes-enea/linx/linx-2.6.6/liblinx_nobase.patch
deleted file mode 100644
index 05a4b7e..0000000
--- a/recipes-enea/linx/linx-2.6.6/liblinx_nobase.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 5ea9763286eb43e01c4ef2f3db59e13367a77138 Mon Sep 17 00:00:00 2001
2From: jack zhang <jack.zhang@enea.com>
3Date: Mon, 17 Dec 2012 03:52:11 +0100
4Subject: [PATCH] LXCR-995 As an Enea sales person, I want LINX added to Enea
5 Linux
6Signed-off-by: jack zhang <jack.zhang@enea.com>
7
8 Upstream-Status: Pending
9 For details, see LINXCR-1518
10---
11 liblinx/Makefile.am | 2 +-
12 1 files changed, 1 insertions(+), 1 deletions(-)
13
14diff --git a/liblinx/Makefile.am b/liblinx/Makefile.am
15index 8559e43..3ce47d6 100644
16--- a/liblinx/Makefile.am
17+++ b/liblinx/Makefile.am
18@@ -47,7 +47,7 @@ dist_man7_MANS = $(LINXROOT)/doc/man7/linx.7
19
20 include $(LINXROOT)/flags.am
21
22-include_HEADERS = \
23+nobase_include_HEADERS = \
24 $(LINXROOT)/include/linx.h \
25 $(LINXROOT)/include/linx_ioctl.h \
26 $(LINXROOT)/include/linx_socket.h \
27--
281.7.5.4
29
diff --git a/recipes-enea/linx/linx-2.6.6/linxcfg_nobase.patch b/recipes-enea/linx/linx-2.6.6/linxcfg_nobase.patch
deleted file mode 100644
index af4b477..0000000
--- a/recipes-enea/linx/linx-2.6.6/linxcfg_nobase.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From a3b3dc8117490ddfcc2081fca5ff663e4157a106 Mon Sep 17 00:00:00 2001
2From: jack zhang <jack.zhang@enea.com>
3Date: Mon, 17 Dec 2012 03:57:15 +0100
4Subject: [PATCH] LXCR-995 As an Enea sales person, I want LINX added to Enea
5 Linux
6Signed-off-by: jack zhang <jack.zhang@enea.com>
7
8 Upstream-Status: Pending
9 For details, see LINXCR-1518
10---
11 linxcfg/Makefile.am | 4 +---
12 1 files changed, 1 insertions(+), 3 deletions(-)
13
14diff --git a/linxcfg/Makefile.am b/linxcfg/Makefile.am
15index 9fc8e84..287c71b 100644
16--- a/linxcfg/Makefile.am
17+++ b/linxcfg/Makefile.am
18@@ -24,16 +24,14 @@ dist_man1_MANS = \
19 $(LINXROOT)/doc/man1/mkcmclcon.1 \
20 $(LINXROOT)/doc/man1/rmcmclcon.1
21
22-include_HEADERS = \
23+nobase_include_HEADERS = \
24 $(LINXROOT)/include/linxcfg.h \
25 $(LINXROOT)/include/linux/ethcm_db_ioctl.h \
26 $(LINXROOT)/include/linux/rlnh_db_ioctl.h \
27 $(LINXROOT)/include/linux/tcpcm_db_ioctl.h \
28 $(LINXROOT)/include/linux/shmcm_db_ioctl.h \
29- $(LINXROOT)/include/linux/riocm_db_ioctl.h \
30 $(LINXROOT)/include/linux/cmcl_db_ioctl.h \
31 $(LINXROOT)/include/linux/riocm_db_ioctl.h \
32- $(LINXROOT)/include/linux/cmcl_db_ioctl.h \
33 $(LINXROOT)/include/db_ioctl.h \
34 $(LINXROOT)/include/ethcm_db_ioctl.h \
35 $(LINXROOT)/include/rlnh_db_ioctl.h \
36--
371.7.5.4
38
diff --git a/recipes-enea/linx/linx-mod-2.6.6/linx-kernel-modules.patch b/recipes-enea/linx/linx-mod-2.6.6/linx-kernel-modules.patch
deleted file mode 100644
index f29019b..0000000
--- a/recipes-enea/linx/linx-mod-2.6.6/linx-kernel-modules.patch
+++ /dev/null
@@ -1,288 +0,0 @@
1Use KERNEL_SRC and modules_install to get use of pokys build kernel modules.
2fix version.h problem.
3
4Signed-off-by: Anders Roxell <anders.roxell@enea.com>
5
6Upstream-status: Pending
7---
8diff -uNr a/cmcl/Makefile b/cmcl/Makefile
9--- a/cmcl/Makefile 2013-02-25 15:46:59.777325274 +0100
10+++ b/cmcl/Makefile 2013-02-25 15:57:22.038398316 +0100
11@@ -3,8 +3,8 @@
12 LINX ?= $(CURDIR)/../../..
13 include $(LINX)/net/linx/config.mk
14
15-KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL)/include/linux/version.h)
16-VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL)/include/linux/version.h)
17+KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
18+VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
19
20 ifneq ($(VENDOR_VERSION), "")
21 EXTRA_CFLAGS += -DGFP_IS_INT
22@@ -38,15 +38,17 @@
23
24 linx_cmcl-y += cmcl.o
25
26+SRC := $(shell pwd)
27+
28 modules:
29- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules
30+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules
31 $(CP) linx_cmcl.ko ..
32
33 clean:
34- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` clean
35+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) clean
36 $(LINXRM) Module.symvers Module.markers modules.order ../linx_cmcl.ko
37
38-install: modules
39- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules_install
40+modules_install: modules
41+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules_install
42 depmod
43
44diff -uNr a/config.mk b/config.mk
45--- a/config.mk 2013-02-25 15:46:59.781325113 +0100
46+++ b/config.mk 2013-02-25 16:13:30.672459997 +0100
47@@ -3,7 +3,7 @@
48 # CROSS_COMPILE is cross compiler prefix (including full path)
49 CROSS_COMPILE ?=
50 # KERNEL is the path to your kernel sources
51-KERNEL ?=
52+KERNEL_SRC ?=
53
54 # Host architecture
55 HOST_ARCH ?= $(patsubst i%86,i386,$(shell uname -m))
56@@ -26,13 +26,13 @@
57 endif
58
59 ifeq ($(ARCH),$(HOST_ARCH))
60-ifndef KERNEL
61-KERNEL := $(HOST_KERNEL)
62+ifndef KERNEL_SRC
63+KERNEL_SRC := $(HOST_KERNEL)
64 endif
65 else
66-ifndef KERNEL
67+ifndef KERNEL_SRC
68 ifdef NEED_KERNEL
69-$(error Please define KERNEL.)
70+$(error Please define KERNEL_SRC.)
71 endif
72 endif
73 endif
74@@ -53,8 +53,8 @@
75 ifdef CROSS_COMPILE
76 $(ECHO) "# CROSS_COMPILE=$(CROSS_COMPILE)"
77 endif
78-ifdef KERNEL
79- $(ECHO) "# KERNEL=$(KERNEL)"
80+ifdef KERNEL_SRC
81+ $(ECHO) "# KERNEL_SRC=$(KERNEL_SRC)"
82 endif
83 ifdef VERBOSE
84 $(ECHO) "# VERBOSE=$(VERBOSE)"
85@@ -62,7 +62,7 @@
86 $(ECHO) "# VERBOSE=no"
87 endif
88
89-export ARCH CROSS_COMPILE KERNEL LINX
90+export ARCH CROSS_COMPILE KERNEL_SRC LINX
91
92 .PHONY: echo_config
93
94@@ -117,5 +117,5 @@
95 # in the mercury linux distribution.
96 EXTRA_CFLAGS += -I$(KDIR)/arch/ppc -DRLNH_ALIGN_ANY
97 else # x86
98-KDIR := /lib/modules/$(shell uname -r)/build
99+KDIR := /lib/modules/$(KERNEL_VERSION)/build
100 endif
101diff -uNr a/ecm/Makefile b/ecm/Makefile
102--- a/ecm/Makefile 2013-02-25 15:46:59.781325113 +0100
103+++ b/ecm/Makefile 2013-02-25 16:11:13.754388313 +0100
104@@ -5,8 +5,8 @@
105 LINX ?= $(CURDIR)/../../..
106 include $(LINX)/net/linx/config.mk
107
108-KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL)/include/linux/version.h)
109-VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL)/include/linux/version.h)
110+KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
111+VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
112
113 ifneq ($(VENDOR_VERSION), "")
114 EXTRA_CFLAGS += -DGFP_IS_INT
115@@ -43,14 +43,16 @@
116 linx_eth_cm-y += ecm_rx.o
117 linx_eth_cm-y += ecm_kutils.o
118
119+SRC := $(shell pwd)
120+
121 modules:
122- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules
123+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules
124 $(CP) linx_eth_cm.ko ..
125
126 clean:
127- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` clean
128+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) clean
129 $(LINXRM) Module.symvers Module.markers modules.order ../linx_eth_cm.ko
130
131-install: modules
132- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules_install
133+modules_install: modules
134+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules_install
135 depmod
136diff -uNr a/Makefile b/Makefile
137--- a/Makefile 2013-02-25 15:46:59.781325113 +0100
138+++ b/Makefile 2013-02-25 15:53:22.752757899 +0100
139@@ -63,9 +63,9 @@
140 2_6_11 := 132619
141
142 # Vendors version of kernel, needed to catch certain back patches
143-VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL)/include/linux/version.h)
144+VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
145 # Main line kernel version
146-KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL)/include/linux/version.h)
147+KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
148
149 #
150 # 'gt_or_eq'
151@@ -140,14 +140,16 @@
152 obj-y += riocm/
153 obj-y += cmcl/
154
155+SRC := $(shell pwd)
156+
157 modules:
158- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules
159+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules
160 $(CP) */*.ko .
161 clean:
162- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` clean
163+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) clean
164 $(LINXRM) Module.symvers Module.markers modules.order
165
166-install: modules
167- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules_install
168+modules_install: modules
169+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules_install
170 depmod
171
172diff -uNr a/riocm/Makefile b/riocm/Makefile
173--- a/riocm/Makefile 2013-02-25 15:46:59.781325113 +0100
174+++ b/riocm/Makefile 2013-02-25 16:05:33.381125565 +0100
175@@ -5,8 +5,8 @@
176 LINX ?= $(CURDIR)/../../..
177 include $(LINX)/net/linx/config.mk
178
179-KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL)/include/linux/version.h)
180-VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL)/include/linux/version.h)
181+KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
182+VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
183
184 ifneq ($(VENDOR_VERSION), "")
185 EXTRA_CFLAGS += -DGFP_IS_INT
186@@ -43,15 +43,17 @@
187 linx_rio_cm-y += rio_rx.o
188 linx_rio_cm-y += rio_kutils.o
189
190+SRC := $(shell pwd)
191+
192 modules:
193- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules
194+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules
195 $(CP) linx_rio_cm.ko ..
196
197 clean:
198- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` clean
199+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) clean
200 $(LINXRM) Module.symvers Module.markers modules.order ../linx_rio_cm.ko
201
202-install: modules
203- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules_install
204+modules_install: modules
205+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules_install
206 depmod
207
208diff -uNr a/shmcm/Makefile b/shmcm/Makefile
209--- a/shmcm/Makefile 2013-02-25 15:46:59.781325113 +0100
210+++ b/shmcm/Makefile 2013-02-25 16:03:58.113250295 +0100
211@@ -5,8 +5,8 @@
212 LINX ?= $(CURDIR)/../../..
213 include $(LINX)/net/linx/config.mk
214
215-KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL)/include/linux/version.h)
216-VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL)/include/linux/version.h)
217+KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
218+VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
219
220 ifneq ($(VENDOR_VERSION), "")
221 EXTRA_CFLAGS += -DGFP_IS_INT
222@@ -60,7 +60,7 @@
223 -I$(LINX)/net/linx/include \
224 -I$(LINX)/net/linx/shmcm
225
226-INSTALLDIR = /lib/modules/`uname -r`/kernel/net/linx
227+INSTALLDIR = /lib/modules/$(KERNEL_VERSION)/kernel/net/linx
228 MODULES = linx_shm_cm.ko
229
230 obj-m := linx_shm_cm.o
231@@ -70,15 +70,17 @@
232 linx_shm_cm-y += shmcm_tx.o
233 linx_shm_cm-y += shmcm_kutils.o
234
235+SRC := $(shell pwd)
236+
237 modules:
238- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules
239+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules
240 $(CP) linx_shm_cm.ko ..
241
242 clean:
243- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` clean
244+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) clean
245 $(LINXRM) Module.symvers Module.markers modules.order ../linx_shm_cm.ko
246
247-install: modules
248- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules_install
249+modules_install: modules
250+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules_install
251 depmod
252
253diff -uNr a/tcp_cm/Makefile b/tcp_cm/Makefile
254--- a/tcp_cm/Makefile 2013-02-25 15:46:59.781325113 +0100
255+++ b/tcp_cm/Makefile 2013-02-25 16:10:09.097187839 +0100
256@@ -3,8 +3,8 @@
257 LINX ?= $(CURDIR)/../../..
258 include $(LINX)/net/linx/config.mk
259
260-KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL)/include/linux/version.h)
261-VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL)/include/linux/version.h)
262+KERNEL_CODE := $(shell awk '/LINUX_VERSION_CODE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
263+VENDOR_VERSION := $(shell awk '/UTS_RELEASE/ {print $$3}' $(KERNEL_SRC)/include/generated/utsrelease.h)
264
265 ifneq ($(VENDOR_VERSION), "")
266 EXTRA_CFLAGS += -DGFP_IS_INT
267@@ -38,15 +38,17 @@
268
269 linx_tcp_cm-y += tcp_cm.o
270
271+SRC := $(shell pwd)
272+
273 modules:
274- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules
275+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules
276 $(CP) linx_tcp_cm.ko ..
277
278 clean:
279- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` clean
280+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) clean
281 $(LINXRM) Module.symvers Module.markers modules.order ../linx_tcp_cm.ko
282
283-install: modules
284- $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL) M=`pwd` modules_install
285+modules_install: modules
286+ $(XMAKE) ARCH=$(ARCH) V=$(V) -C $(KERNEL_SRC) M=$(SRC) modules_install
287 depmod
288
diff --git a/recipes-enea/linx/linx-mod-2.6.6/support-for-3.11-kernel-versions.patch b/recipes-enea/linx/linx-mod-2.6.6/support-for-3.11-kernel-versions.patch
deleted file mode 100644
index d6f9106..0000000
--- a/recipes-enea/linx/linx-mod-2.6.6/support-for-3.11-kernel-versions.patch
+++ /dev/null
@@ -1,206 +0,0 @@
1From 20294330f08283d28b6092b568156e29b1792328 Mon Sep 17 00:00:00 2001
2From: Adrian Dudau <adrian.dudau@enea.com>
3Date: Thu, 12 Dec 2013 11:23:24 +0100
4Subject: [PATCH] support for 3.11 kernel versions
5
6Fixed NULL pointer dereference in ecm_conn.c
7
8Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
9---
10 cfg/db_proc.c | 23 ++++++++++++++++++-----
11 ecm/ecm_conn.c | 11 ++++++++---
12 ipc/hunt.c | 24 ++++++++++++++++++++++++
13 3 files changed, 50 insertions(+), 8 deletions(-)
14
15diff --git a/cfg/db_proc.c b/cfg/db_proc.c
16index c062a3d..bad0353 100644
17--- a/cfg/db_proc.c
18+++ b/cfg/db_proc.c
19@@ -41,6 +41,12 @@
20 #include "db_format.h"
21 #include <asm/uaccess.h>
22
23+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0))
24+#define PDE_INODE_NAME(inode) PDE_DATA(inode)
25+#else
26+#define PDE_INODE_NAME(inode) PDE(inode)->name
27+#endif
28+
29 struct db_seq {
30 const struct db_template *template;
31 struct list_head *list;
32@@ -148,11 +154,11 @@ static int db_proc_open(struct inode *inode, struct file *file)
33 if (status != 0)
34 goto out_20;
35
36- status = db_template_get(PDE(inode)->name, &p->template);
37+ status = db_template_get(PDE_INODE_NAME(inode), &p->template);
38 if (status != 0)
39 goto out_20;
40
41- status = db_list_get(PDE(inode)->name, &p->list);
42+ status = db_list_get(PDE_INODE_NAME(inode), &p->list);
43 if (status != 0)
44 goto out_10;
45
46@@ -161,7 +167,7 @@ static int db_proc_open(struct inode *inode, struct file *file)
47 return 0;
48
49 out_10:
50- db_template_put(PDE(inode)->name, &p->template);
51+ db_template_put(PDE_INODE_NAME(inode), &p->template);
52 out_20:
53 kfree(p);
54 return status;
55@@ -217,11 +223,11 @@ static int db_proc_release(struct inode *inode, struct file *file)
56 s = file->private_data;
57 p = s->private;
58
59- status = db_list_put(PDE(inode)->name, &p->list);
60+ status = db_list_put(PDE_INODE_NAME(inode), &p->list);
61 if (status != 0)
62 return status;
63
64- status = db_template_put(PDE(inode)->name, &p->template);
65+ status = db_template_put(PDE_INODE_NAME(inode), &p->template);
66 if (status != 0)
67 return status;
68
69@@ -258,14 +264,21 @@ int db_proc_add(const char *name)
70 {
71 struct proc_dir_entry *pde;
72
73+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
74+ pde = proc_create_data(name, 0777, db_proc_root,
75+ &db_proc_file_ops, (void *)name);
76+#else
77 pde = create_proc_entry(name, 0777, db_proc_root);
78+#endif
79 if (pde == NULL)
80 return -EINVAL;
81
82 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
83 pde->owner = THIS_MODULE;
84 #endif
85+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
86 pde->proc_fops = &db_proc_file_ops;
87+#endif
88 return 0;
89 }
90 EXPORT_SYMBOL(db_proc_add);
91diff --git a/ecm/ecm_conn.c b/ecm/ecm_conn.c
92index aaf5161..b81abd1 100644
93--- a/ecm/ecm_conn.c
94+++ b/ecm/ecm_conn.c
95@@ -905,8 +905,9 @@ static void free_ecm_connection(struct RlnhLinkObj *co)
96 {
97 /* Undo alloc_ecm_connection(). */
98 if (co != NULL) {
99- if (list_empty(&co->ecm_dev->conn_list))
100- dev_remove_pack(&co->ecm_dev->pt);
101+ if (co->ecm_dev != NULL)
102+ if (list_empty(&co->ecm_dev->conn_list))
103+ dev_remove_pack(&co->ecm_dev->pt);
104 if (co->con_name != NULL)
105 kfree(co->con_name);
106 if (co->dev_name != NULL)
107@@ -1315,7 +1316,11 @@ static int net_event(struct notifier_block *nb, unsigned long event, void *data)
108 struct ecm_work_net_event *p;
109
110 (void)nb;
111- dev = data;
112+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
113+ dev = netdev_notifier_info_to_dev(data);
114+#else
115+ dev = data;
116+#endif
117
118 w = alloc_ecm_work(sizeof(*p), ECM_WORK_NET_EVENT, GFP_KERNEL);
119 if (w == NULL)
120diff --git a/ipc/hunt.c b/ipc/hunt.c
121index 843a893..f4564eb 100644
122--- a/ipc/hunt.c
123+++ b/ipc/hunt.c
124@@ -743,7 +743,9 @@ static inline struct sock *__locate_name(const char *name,
125 unsigned hash, uint32_t hunter_spid)
126 {
127 struct sock *s, *s_found = NULL;
128+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
129 struct hlist_node *node;
130+#endif
131
132 linx_trace_enter(LINX_TRACEGROUP_IPC,
133 "%s, %d, 0x%x, 0x%x", name, len, hash, hunter_spid);
134@@ -753,7 +755,11 @@ static inline struct sock *__locate_name(const char *name,
135
136 /* Traverse the list of sockets in the specified hash slot to find a
137 match. */
138+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
139+ sk_for_each(s, &linx_sockets_bound[hash]) {
140+#else
141 sk_for_each(s, node, &linx_sockets_bound[hash]) {
142+#endif
143 linx_check_sock(s);
144
145 /* If the length of the aname are the same, potential match was found. */
146@@ -1122,7 +1128,9 @@ int linx_info_sockets(struct linx_info_sockets *isockets,
147 LINX_SPID __user * spids)
148 {
149 struct sock *sk;
150+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0))
151 const struct hlist_node *node;
152+#endif
153 int i, tot_sockets = 0, tot_sockets_tmp = 0, max_sockets;
154
155 LINX_ASSERT(isockets != NULL);
156@@ -1131,7 +1139,11 @@ int linx_info_sockets(struct linx_info_sockets *isockets,
157
158 read_lock_bh(&linx_socket_bound_unbound_lock);
159 /* Count the number of sockets the needs to be returned. */
160+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
161+ sk_for_each(sk, &linx_sockets_unbound) {
162+#else
163 sk_for_each(sk, node, &linx_sockets_unbound) {
164+#endif
165 if (linx_sk(sk)->type == LINX_TYPE_REMOTE && isockets->remote) {
166 tot_sockets_tmp++;
167 } else if (linx_sk(sk)->type == LINX_TYPE_LOCAL &&
168@@ -1156,7 +1168,11 @@ int linx_info_sockets(struct linx_info_sockets *isockets,
169
170 tot_sockets_tmp = 0;
171
172+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
173+ sk_for_each(sk, &linx_sockets_unbound) {
174+#else
175 sk_for_each(sk, node, &linx_sockets_unbound) {
176+#endif
177 LINX_SPID spid = linx_sock_to_spid(sk);
178 if (linx_sk(sk)->type == LINX_TYPE_REMOTE &&
179 isockets->remote) {
180@@ -1197,7 +1213,11 @@ int linx_info_sockets(struct linx_info_sockets *isockets,
181 for (i = 0; i < LINX_HASH_SIZE; i++) {
182 tot_sockets_tmp = 0;
183 read_lock_bh(&linx_socket_bound_unbound_lock);
184+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
185+ sk_for_each(sk, &linx_sockets_bound[i]) {
186+#else
187 sk_for_each(sk, node, &linx_sockets_bound[i]) {
188+#endif
189 if (linx_sk(sk)->type == LINX_TYPE_REMOTE &&
190 isockets->remote) {
191 tot_sockets_tmp++;
192@@ -1222,7 +1242,11 @@ int linx_info_sockets(struct linx_info_sockets *isockets,
193 }
194
195 tot_sockets_tmp = 0;
196+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
197+ sk_for_each(sk, &linx_sockets_bound[i]) {
198+#else
199 sk_for_each(sk, node, &linx_sockets_bound[i]) {
200+#endif
201 LINX_SPID spid = linx_sock_to_spid(sk);
202 if (linx_sk(sk)->type == LINX_TYPE_REMOTE &&
203 isockets->remote) {
204--
2051.8.3.2
206
diff --git a/recipes-enea/linx/linx-mod-2.6.6/support-for-3.12-kernels.patch b/recipes-enea/linx/linx-mod-2.6.6/support-for-3.12-kernels.patch
deleted file mode 100644
index 60c69a8..0000000
--- a/recipes-enea/linx/linx-mod-2.6.6/support-for-3.12-kernels.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1Fixed build errors for linx_mod with kernel 3.12.X.
2
3For details, see [LXCR-3427].
4
5Upstream-Status: Not Applicable
6
7Signed-off-by: Liviu Gheorghisan <liviu.gheorghisan@enea.com>
8
9---
10--- a/af_linx.c 2014-04-02 10:19:44.000000000 +0300
11+++ b/af_linx.c 2014-07-23 17:40:01.629687646 +0300
12@@ -1034,8 +1034,11 @@
13 failure:
14 *errcode = err;
15 return NULL;
16-#else
17+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)
18 return sock_alloc_send_pskb(sk, 0, data_len, 0, errcode);
19+#else
20+ /* max_page_order == 0 => no paged allocations */
21+ return sock_alloc_send_pskb(sk, 0, data_len, 0, errcode, 0);
22 #endif
23 }
24
diff --git a/recipes-enea/linx/linx-mod-2.6.6/support-for-3.15-kernels.patch b/recipes-enea/linx/linx-mod-2.6.6/support-for-3.15-kernels.patch
deleted file mode 100644
index 80118a4..0000000
--- a/recipes-enea/linx/linx-mod-2.6.6/support-for-3.15-kernels.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1Fixed build errors for linx-mod with kernel >= 3.15.0
2
3Upstream-Status: Not Applicable
4
5Signed-off-by: Huimin She <huimin.she@enea.com>
6
7---
8diff -rup a/af_linx.c b/af_linx.c
9--- a/af_linx.c 2014-07-25 16:22:23.295570583 +0200
10+++ b/af_linx.c 2014-07-25 16:22:23.299570583 +0200
11@@ -743,7 +743,11 @@ setup_receive_filter(struct sock *sk, st
12 /* This function is called to wake up a receiving socket when it is sleeping
13 * waiting for a new message in poll or select.
14 */
15+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
16 static void linx_data_ready(struct sock *sk, int len)
17+#else
18+static void linx_data_ready(struct sock *sk)
19+#endif
20 {
21 linx_check_sock(sk);
22
23@@ -1401,7 +1405,11 @@ linx_do_legacy_sendmsg(struct sock *sk,
24 LINX_SOCK_STAT_QUEUE_SIGNAL(to, payload_size);
25 #endif
26 /* Wake up the receiver, if it sleeps and wait for the signal. */
27+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
28 to->sk_data_ready(to, payload_size);
29+#else
30+ to->sk_data_ready(to);
31+#endif
32
33 return 0;
34 out:
35@@ -1577,7 +1585,11 @@ linx_do_sendmsg(struct sock *sk,
36 LINX_SOCK_STAT_QUEUE_SIGNAL(to, payload_size);
37 #endif
38 /* Wake up the receiver, if it sleeps and wait for the signal. */
39- to->sk_data_ready(to, payload_size);
40+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
41+ to->sk_data_ready(to, payload_size);
42+#else
43+ to->sk_data_ready(to);
44+#endif
45
46 return 0;
47 out:
48@@ -1636,7 +1648,11 @@ int __linx_do_sendmsg_skb_to_local_sk(st
49 LINX_SOCK_STAT_QUEUE_SIGNAL(to, payload_size);
50 #endif
51 /* Wake up the receiver, if it sleeps and waits for the signal. */
52- to->sk_data_ready(to, payload_size);
53+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0))
54+ to->sk_data_ready(to, payload_size);
55+#else
56+ to->sk_data_ready(to);
57+#endif
58
59 return 0;
60 }
diff --git a/recipes-enea/linx/linx-mod_2.6.6.bb b/recipes-enea/linx/linx-mod_2.6.7.bb
index 837fc3a..9bcf459 100644
--- a/recipes-enea/linx/linx-mod_2.6.6.bb
+++ b/recipes-enea/linx/linx-mod_2.6.7.bb
@@ -10,12 +10,10 @@ LIC_FILES_CHKSUM = "file://../../COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
10DEPENDS = "linux-libc-headers linx" 10DEPENDS = "linux-libc-headers linx"
11RRECOMMENDS_${PN} = "linx kmod" 11RRECOMMENDS_${PN} = "linx kmod"
12 12
13SRC_URI = "http://linux.enea.com/linx/linx-${PV}.tar.gz \ 13SRC_URI = "http://linux.enea.com/linx/linx-${PV}.tar.gz"
14 file://support-for-3.12-kernels.patch \
15 file://support-for-3.15-kernels.patch"
16 14
17SRC_URI[md5sum] = "f6d7e103eee0807cacf73aa20cf95571" 15SRC_URI[md5sum] = "f9d7634faa2d7338e51418e2dca82875"
18SRC_URI[sha256sum] = "a8fa3fe221e883ecb6afaa001652c96080a474b95e8d37c3bcf3e0c2ae618799" 16SRC_URI[sha256sum] = "d047eb8d4b63ae385bf89dc3cc09854a0fe27f3f51c19dc332da7d40f9c0c28c"
19 17
20S = "${WORKDIR}/linx-${PV}/net/linx" 18S = "${WORKDIR}/linx-${PV}/net/linx"
21 19
diff --git a/recipes-enea/linx/linx.inc b/recipes-enea/linx/linx.inc
index 3160cfb..3388964 100644
--- a/recipes-enea/linx/linx.inc
+++ b/recipes-enea/linx/linx.inc
@@ -6,11 +6,10 @@ SECTION = "system/library"
6DEPENDS = "linux-libc-headers virtual/libc" 6DEPENDS = "linux-libc-headers virtual/libc"
7RRECOMMENDS_${PN} = "linx-mod" 7RRECOMMENDS_${PN} = "linx-mod"
8 8
9SRC_URI = "http://linux.enea.com/linx/linx-${PV}.tar.gz \ 9SRC_URI = "http://linux.enea.com/linx/linx-${PV}.tar.gz"
10 file://liblinx_free_buf.patch"
11 10
12SRC_URI[md5sum] = "f6d7e103eee0807cacf73aa20cf95571" 11SRC_URI[md5sum] = "f9d7634faa2d7338e51418e2dca82875"
13SRC_URI[sha256sum] = "a8fa3fe221e883ecb6afaa001652c96080a474b95e8d37c3bcf3e0c2ae618799" 12SRC_URI[sha256sum] = "d047eb8d4b63ae385bf89dc3cc09854a0fe27f3f51c19dc332da7d40f9c0c28c"
14 13
15S = "${WORKDIR}/linx-${PV}" 14S = "${WORKDIR}/linx-${PV}"
16 15
diff --git a/recipes-enea/linx/linx_2.6.6.bb b/recipes-enea/linx/linx_2.6.7.bb
index 79f7ed7..79f7ed7 100644
--- a/recipes-enea/linx/linx_2.6.6.bb
+++ b/recipes-enea/linx/linx_2.6.7.bb