Index: ChangeLog
===================================================================
--- ChangeLog	(revision 72324)
+++ ChangeLog	(working copy)
@@ -1,3 +1,40 @@
+NOTE:  Intel Corporation code changes are identified by the INTELCE_CHANGES 
+       preprocessor define and were derived from GPL license code.
+
+2009-5-11  Intel Corporation
+
+    Files:  Makefile
+
+    Modified to allow for proper building on kernel 2.6.28
+
+2009-04-20  Intel Corporation
+
+    Files:  linux/drivers/char/fusion/Makefile-2.6
+            linux/drivers/char/fusion/fusiondev.c
+            tests/calls.c
+            tests/latency.c
+            tests/throughput.c
+            tests/Makefile
+            Makefile
+
+    Modified makefiles to not depend on the host's kernel because the
+    target's kernel is often different than the host's kernel and was
+    modifiying how the compile occured.
+
+    Modified makefile to include IntelCE_Version.o and use DFB_FUSION_NAME
+    environment variable in KERNEL_INCLUDE path.
+
+    Modified device registration to use a dynamically allocated major number.
+
+    Added INTELCE_CHANGES define to the Makefile.
+
+    Modified tests to use /dev/fusion0 instead of /dev/fusion/0.
+
+    Modified the 'calls' test to not use the FCEF_ONEWAY flag, which caused
+    failures on the FUSION_CALL_RETURN ioctl.
+
+-------------------------------------------------------------------------------
+
 commit 383d2e6325ab9f00259f54a84c50f0956c7bee3d
 Author: Niels Roest <niels@directfb.org>
 Date:   Tue Mar 31 12:22:39 2009 +0200
Index: linux/drivers/char/fusion/fusiondev.c
===================================================================
--- linux/drivers/char/fusion/fusiondev.c	(revision 72324)
+++ linux/drivers/char/fusion/fusiondev.c	(working copy)
@@ -1,6 +1,7 @@
 /*
  *	Fusion Kernel Module
  *
+ *  (c) Copyright 2009  Intel Corporation.
  *	(c) Copyright 2002-2003  Convergence GmbH
  *
  *      Written by Denis Oliver Kropp <dok@directfb.org>
@@ -56,9 +57,16 @@
 #define DEBUG(x...)  do {} while (0)
 #endif
 
-#ifndef FUSION_MAJOR
-#define FUSION_MAJOR 250
+#if defined(INTELCE_CHANGES)
+    // Holds the dynamically allocated Major Device number 
+    // assigned by the kernel. Reusing FUSION_MAJOR as the
+    // variable name to minimize the number of places to change.
+    int FUSION_MAJOR = 0;
+#else
+    #ifndef FUSION_MAJOR
+    #define FUSION_MAJOR 250
 #endif
+#endif
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Denis Oliver Kropp <dok@directfb.org>");
@@ -1117,11 +1125,21 @@
 {
 	int i;
 
+    #if defined(INTELCE_CHANGES)
+	// Modifying the register to get a dynamically generated device number
+	FUSION_MAJOR = register_chrdev (0, "fusion", &fusion_fops);
+	if(FUSION_MAJOR <= 0) {
+		printk (KERN_ERR "fusion: unable to get dynamic major\n");
+		return -EIO;
+	}
+    #else
 	if (register_chrdev(FUSION_MAJOR, "fusion", &fusion_fops)) {
 		printk(KERN_ERR "fusion: unable to get major %d\n",
 		       FUSION_MAJOR);
 		return -EIO;
 	}
+    #endif
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 2)
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
 	fusion_class = class_create(THIS_MODULE, "fusion");
Index: linux/drivers/char/fusion/Makefile-2.6
===================================================================
--- linux/drivers/char/fusion/Makefile-2.6	(revision 72324)
+++ linux/drivers/char/fusion/Makefile-2.6	(working copy)
@@ -1,3 +1,43 @@
+# INTELCE_CHANGES: Add Makefile.include and misc definitions
+
+ifndef DFB_SRC_ROOT
+	export DFB_SRC_ROOT=$(shell cd ../../../../../../ && pwd)
+endif
+
+include $(DFB_SRC_ROOT)/Makefile.include
+
+DESTDIR           = $(BUILD_DEST)
+KERNEL_VERSION    = $(KERNEL_VER)
+KERNEL_MODLIB     = $(DESTDIR)/lib/modules/
+KERNEL_SOURCE     = $(DESTDIR)/kernel/$(KERNEL_VER)/
+KERNEL_BUILD	  = $(KERNEL_SOURCE)
+KERNEL_INCLUDE	  = $(KERNEL_SOURCE)/include/
+KERNEL_INCLUDE	  += -I$(DFB_SRC_ROOT)/src/$(DFB_FUSION_PKG_NAME)/linux/include/
+KERNEL_PATCHLEVEL = $(shell echo $(KERNEL_VERSION) | cut -d . -f 2)
+
+# end INTELCE_CHANGES
+
 obj-$(CONFIG_FUSION_DEVICE) += fusion.o
 
-fusion-y := call.o entries.o fifo.o fusiondev.o fusionee.o list.o property.o reactor.o ref.o skirmish.o shmpool.o
+# INTELCE_CHANGES: Add IntelCE_Version.o
+fusion-y := call.o entries.o fifo.o fusiondev.o fusionee.o list.o property.o reactor.o ref.o skirmish.o shmpool.o IntelCE_Version.o
+
+# INTELCE_CHANGES: Add 'all' and 'modules' targets and misc definitions
+ifeq ($(shell test -f $(KERNEL_INCLUDE)/linux/autoconf.h),1)
+	AUTOCONF_H = -include $(KERNEL_INCLUDE)/linux/autoconf.h
+endif
+
+ifeq ($(shell test -f $(KERNEL_INCLUDE)/linux/config.h),1)
+	CPPFLAGS += -DHAVE_LINUX_CONFIG_H
+endif
+
+.PHONY: all modules
+
+CPPFLAGS += -DINTELCE_CHANGES -DMODULE -DMODVERSIONS
+
+all modules:
+	$(MAKE) -C $(KERNEL_BUILD) CC=$(CC) OBJDUMP=$(OBJDUMP) LD=$(LD)\
+		MODFLAGS="$(CFLAGS) $(CPPFLAGS) -D__KERNEL__ -I../../../include -I$(KERNEL_INCLUDE) $(AUTOCONF_H)" \
+		SUBDIRS=$(shell pwd) M=$(shell pwd) modules
+
+# end INTELCE_CHANGES
Index: Makefile
===================================================================
--- Makefile	(revision 72324)
+++ Makefile	(working copy)
@@ -1,8 +1,22 @@
-KERNEL_VERSION  ?= $(shell uname -r)
-KERNEL_MODLIB   ?= /lib/modules/$(KERNEL_VERSION)
-KERNEL_BUILD    ?= $(SYSROOT)$(KERNEL_MODLIB)/build
-KERNEL_SOURCE   ?= $(SYSROOT)$(KERNEL_MODLIB)/source
+# INTELCE_CHANGES: Add Makefile.include and replace KERNEL_* definitions
+#KERNEL_VERSION  ?= $(shell uname -r)
+#KERNEL_MODLIB   ?= /lib/modules/$(KERNEL_VERSION)
+#KERNEL_BUILD    ?= $(SYSROOT)$(KERNEL_MODLIB)/build
+#KERNEL_SOURCE   ?= $(SYSROOT)$(KERNEL_MODLIB)/source
 
+ifndef DFB_SRC_ROOT
+	export DFB_SRC_ROOT=$(shell cd ../../ && pwd)
+endif
+
+include $(DFB_SRC_ROOT)/Makefile.include
+
+KERNEL_VERSION    = $(KERNEL_VER)
+KERNEL_MODLIB     = $(DESTDIR)/lib/modules/
+KERNEL_SOURCE     = $(DESTDIR)/kernel/$(KERNEL_VER)/
+KERNEL_BUILD	  = $(KERNEL_SOURCE)
+
+# end INTELCE_CHANGES
+
 ifeq ($(shell test -L $(KERNEL_BUILD) && echo yes),yes)
   KERNEL_BUILD := $(SYSROOT)$(shell readlink $(KERNEL_BUILD))
 endif
@@ -16,13 +30,17 @@
 K_SUBLEVEL   := $(shell echo $(KERNEL_VERSION) | cut -d . -f 3 | cut -d '-' -f 1)
 
 
-DESTDIR ?= $(SYSROOT)
+# INTELCE_CHANGES: Replace DESTDIR definition
+#DESTDIR ?= $(SYSROOT)
+DESTDIR = $(BUILD_DEST)
 
 
 SUB = linux/drivers/char/fusion
 
 export CONFIG_FUSION_DEVICE=m
 
+# INTELCE_CHANGES: Add INTELCE_CHANGES definition to CPPFLAGS
+CPPFLAGS += -DINTELCE_CHANGES
 
 ifeq ($(DEBUG),yes)
   CPPFLAGS += -DFUSION_DEBUG_SKIRMISH_DEADLOCK
@@ -47,6 +65,12 @@
 	$(MAKE) -C $(KERNEL_BUILD) \
 		KCPPFLAGS="$(CPPFLAGS) -I`pwd`/linux/include" \
 		SUBDIRS=`pwd`/$(SUB) modules
+endif
+
+ifeq ($(K_SUBLEVEL),28)
+	$(MAKE) -C $(KERNEL_BUILD) \
+		EXTRA_CFLAGS="$(CPPFLAGS) -D__KERNEL__ -I`pwd`/linux/include -I$(KERNEL_BUILD)/include -I$(KERNEL_SOURCE)/include $(AUTOCONF_H)" \
+		SUBDIRS=`pwd`/$(SUB) modules
 else
 	$(MAKE) -C $(KERNEL_BUILD) \
 		CPPFLAGS="$(CPPFLAGS) -D__KERNEL__ -I`pwd`/linux/include -I$(KERNEL_BUILD)/include -I$(KERNEL_SOURCE)/include $(AUTOCONF_H)" \
@@ -56,24 +80,27 @@
 install: all
 	install -d $(DESTDIR)/usr/include/linux
 	install -m 644 linux/include/linux/fusion.h $(DESTDIR)/usr/include/linux
+	install -m 644 $(SUB)/fusion.ko $(DESTDIR)/lib/modules
+	
+# INTELCE_CHANGES: Removed the following and added the previous install line:
+#	install -d $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+#
+#ifeq ($(K_PATCHLEVEL),4)
+#	install -m 644 $(SUB)/fusion.o $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+#	rm -f $(DESTDIR)$(KERNEL_MODLIB)/fusion.o
+#else
+#	install -m 644 $(SUB)/fusion.ko $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+#	rm -f $(DESTDIR)$(KERNEL_MODLIB)/fusion.ko
+#endif
+#ifneq ($(strip $(DESTDIR)),)
+#	/sbin/depmod -ae -b $(DESTDIR) $(KERNEL_VERSION)
+#else
+#	/sbin/depmod -ae $(KERNEL_VERSION)
+#endif
 
-	install -d $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
+# end INTELCE_CHANGES
 
-ifeq ($(K_PATCHLEVEL),4)
-	install -m 644 $(SUB)/fusion.o $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
-	rm -f $(DESTDIR)$(KERNEL_MODLIB)/fusion.o
-else
-	install -m 644 $(SUB)/fusion.ko $(DESTDIR)$(KERNEL_MODLIB)/drivers/char/fusion
-	rm -f $(DESTDIR)$(KERNEL_MODLIB)/fusion.ko
-endif
-ifneq ($(strip $(DESTDIR)),)
-	/sbin/depmod -ae -b $(DESTDIR) $(KERNEL_VERSION)
-else
-	/sbin/depmod -ae $(KERNEL_VERSION)
-endif
 
-
-
 clean:
 	find $(SUB) -name *.o -o -name *.ko -o -name .*.o.cmd -o \
 		-name fusion.mod.* -o -name .fusion.* | xargs rm -f
Index: tests/calls.c
===================================================================
--- tests/calls.c	(revision 72324)
+++ tests/calls.c	(working copy)
@@ -1,6 +1,7 @@
 /*
  *      Fusion Kernel Module
  *
+ *      (c) Copyright 2009  Intel Corporation.
  *      (c) Copyright 2002  Convergence GmbH
  *
  *      Written by Denis Oliver Kropp <dok@directfb.org>
@@ -200,7 +201,9 @@
 
   /* Specify call id to execute. */
   call_exec.call_id = call_new.call_id;
+#ifndef INTELCE_CHANGES
   call_exec.flags   = FCEF_ONEWAY;
+#endif
 
   /* Stop time before call loop. */
   gettimeofday (&t1, NULL);
Index: tests/latency.c
===================================================================
--- tests/latency.c	(revision 72324)
+++ tests/latency.c	(working copy)
@@ -1,6 +1,7 @@
 /*
  *      Fusion Kernel Module
  *
+ *      (c) Copyright 2009  Intel Corporation.
  *      (c) Copyright 2002  Convergence GmbH
  *
  *      Written by Denis Oliver Kropp <dok@directfb.org>
@@ -27,6 +28,10 @@
 
 #include <pthread.h>
 
+#ifndef INTELCE_CHANGES
+#define INTELCE_CHANGES
+#endif
+
 typedef struct {
   int            nr;
   struct timeval stamp;
@@ -123,7 +128,11 @@
   FusionEnter enter = {{ FUSION_API_MAJOR, FUSION_API_MINOR }};
 
   /* Open the Fusion Kernel Device. */
+#ifdef INTELCE_CHANGES
+  fd = open ("/dev/fusion0", O_RDWR);
+#else
   fd = open ("/dev/fusion/0", O_RDWR);
+#endif
   if (fd < 0)
     {
       perror ("opening /dev/fusion failed");
Index: tests/Makefile
===================================================================
--- tests/Makefile	(revision 72324)
+++ tests/Makefile	(working copy)
@@ -1,3 +1,20 @@
+# INTELCE_CHANGES: Add Makefile.include and some extra CFLAGS setup
+ifndef DFB_ROOT
+	export DFB_ROOT=$(shell cd ../../../ && pwd)
+endif
+
+include $(DFB_ROOT)/Makefile.include
+
+# We need to find the pkg-config files for the direct library, which
+# should be in DFB_LIB.
+export PKG_CONFIG_PATH := $(DFB_LIB)/pkgconfig/:$(PKG_CONFIG_PATH)
+
+# We need BUILD_DEST/include on the include path for files included by
+# directfb.h for the DirectFBIntelCE interface.
+CFLAGS += -I$(BUILD_DEST)/include
+
+# end INTELCE_CHANGES
+
 CFLAGS  += `pkg-config --cflags direct`
 LDFLAGS += `pkg-config --libs direct`
 
Index: tests/throughput.c
===================================================================
--- tests/throughput.c	(revision 72324)
+++ tests/throughput.c	(working copy)
@@ -1,6 +1,7 @@
 /*
  *      Fusion Kernel Module
  *
+ *      (c) Copyright 2009  Intel Corporation.
  *      (c) Copyright 2002  Convergence GmbH
  *
  *      Written by Denis Oliver Kropp <dok@directfb.org>
@@ -29,6 +30,10 @@
 
 #include <pthread.h>
 
+#ifndef INTELCE_CHANGES
+#define INTELCE_CHANGES
+#endif
+
 typedef struct {
   int nr;
 } TestMessage;
@@ -128,7 +133,11 @@
   FusionEnter enter = {{ FUSION_API_MAJOR, FUSION_API_MINOR }};
 
   /* Open the Fusion Kernel Device. */
+#ifdef INTELCE_CHANGES
+  fd = open ("/dev/fusion0", O_RDWR);
+#else
   fd = open ("/dev/fusion/0", O_RDWR);
+#endif
   if (fd < 0)
     {
       perror ("opening /dev/fusion failed");
