old version maemo18
authortanner <tanner@mach.kyb.local>
Thu, 15 Apr 2010 09:51:32 +0000 (11:51 +0200)
committertanner <tanner@mach.kyb.local>
Thu, 15 Apr 2010 09:51:32 +0000 (11:51 +0200)
kernel-maemo-2.6.28/debian/JoikuSpot_Bouncer.c [new file with mode: 0644]
kernel-maemo-2.6.28/debian/changelog
kernel-maemo-2.6.28/debian/control
kernel-maemo-2.6.28/debian/patches/kexec.diff [new file with mode: 0644]
kernel-maemo-2.6.28/debian/patches/series

diff --git a/kernel-maemo-2.6.28/debian/JoikuSpot_Bouncer.c b/kernel-maemo-2.6.28/debian/JoikuSpot_Bouncer.c
new file mode 100644 (file)
index 0000000..8ff74a8
--- /dev/null
@@ -0,0 +1,196 @@
+/* 
+ * Implementation of JoikuSpotBouncer module
+ * JoikuSpot_Bouncer.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the license, or ( at your option ) any later version
+ */
+
+#include <linux/module.h>         /* needed by all kernel modules          */
+#include <linux/init.h>           /* needed for custom init/exit functions */
+#include <linux/kernel.h>         /* needed for KERN_ALERT macro           */
+#include <linux/netfilter.h>      /* Hook register/unregister              */
+#include <linux/netfilter_ipv4.h> /* nf_hook_priorities                    */
+#include <linux/ip.h>             /* Ip header                             */
+#include <linux/tcp.h>            /* Tcp Header                            */
+#include <linux/udp.h>            /* Udp Header                            */
+#include <net/inet_hashtables.h>  /* __inet_lookup()                       */
+#include <net/inet_sock.h>        /* struct inet_sock                      */
+
+
+/* Special macro to indicate license (to avoid tainting the kernel) */
+
+MODULE_LICENSE( "Dual MIT/GPL" );
+MODULE_AUTHOR ( "JoikuSoft Oy Ltd <info@joikusoft.com>" );
+
+extern struct inet_hashinfo tcp_hashinfo;
+extern struct proto udp_prot;
+extern struct rwlock_t udp_hash_lock;
+
+static struct sock *__udp4_lib_lookup( struct net *net ,
+    unsigned long int saddr ,
+    unsigned short int sport ,
+    unsigned long int daddr ,
+    unsigned short int dport ,
+    int dif ,
+    struct hlist_head udptable[] )
+    {
+    struct sock *sk , *result = NULL;
+    struct hlist_node *node;
+    unsigned short int hnum = ntohs( dport );
+    int badness = -1;
+
+    read_lock( &udp_hash_lock );
+
+    sk_for_each ( sk , node , &udptable[ udp_hashfn ( net , hnum ) ] )
+        {
+        struct inet_sock *inet = inet_sk( sk );
+
+        if ( net_eq ( sock_net( sk ) , net ) && sk->sk_hash == hnum &&
+            !ipv6_only_sock( sk ) )
+            {
+
+            int score = ( sk->sk_family == PF_INET ? 1 : 0 );
+
+            if ( inet->rcv_saddr )
+                {
+                if ( inet->rcv_saddr != daddr )
+                    {
+                    continue;
+                    }
+                score += 2;
+                }
+            if ( inet->daddr )
+                {
+                if ( inet->daddr != saddr )
+                    {
+                    continue;
+                    }
+                score += 2;
+                }
+            if ( inet->dport )
+                {
+                if ( inet->dport != sport )
+                    {
+                    continue;
+                    }
+                score += 2;
+                }
+            if ( sk->sk_bound_dev_if )
+                {
+                if ( sk->sk_bound_dev_if != dif )
+                    {
+                    continue;
+                    }
+                score += 2;
+                }
+            if ( score == 9 )
+                {
+                result = sk;
+                break;
+                }
+                else if ( score > badness )
+                {
+                result  = sk;
+                badness = score;
+                }
+            }
+        }
+    if ( result )
+        {
+        sock_hold ( result );
+        }
+    read_unlock ( &udp_hash_lock );
+    return result;
+    }
+
+
+static unsigned int joikuspot_nf_hook ( unsigned int hook ,
+    struct sk_buff *pskb ,
+    const struct net_device *in ,
+    const struct net_device *out ,
+    int ( *okfn ) ( struct sk_buff * ) )
+    {
+    struct sock *sk;
+    struct iphdr *iph = ipip_hdr ( pskb );
+
+    if ( iph->protocol == 6 )
+        {
+        struct tcphdr *th, tcph;
+
+        th = skb_header_pointer (
+            pskb , iph->ihl << 2 , sizeof( tcph ) , &tcph );
+
+        sk = __inet_lookup( dev_net ( pskb->dst->dev ) , &tcp_hashinfo , 
+            iph->saddr , th->source , iph->daddr , th->dest , inet_iif ( pskb ) );
+
+        if( !sk )
+            {
+            return NF_DROP;
+            }
+        else
+            {
+            return NF_ACCEPT;
+            }
+        }
+
+    if ( iph->protocol == 17 )
+        {
+        struct udphdr *uh, udph;
+
+        uh = skb_header_pointer (
+            pskb , iph->ihl << 2 , sizeof( udph ) , &udph );
+
+        sk = __udp4_lib_lookup( dev_net ( pskb->dst->dev ) , iph->saddr , uh->source ,
+            iph->daddr , uh->dest , inet_iif ( pskb ) , udp_prot.h.udp_hash );
+
+        if ( sk != NULL )
+            {
+            return NF_ACCEPT;
+            }
+        else
+            {
+            return NF_DROP;
+            }
+        }
+
+    return NF_ACCEPT;
+    }
+
+
+static struct nf_hook_ops joikuspot_ops =
+    {
+    .hook     = joikuspot_nf_hook,
+    .owner    = THIS_MODULE,
+    .pf       = PF_INET,
+    .hooknum  = NF_INET_LOCAL_IN,
+    .priority = NF_IP_PRI_FIRST
+    };
+
+static int joikuspot_init( void )
+    {
+    int retval = 0;
+
+    printk( KERN_DEBUG "JoikuSpot Bouncer Kernel Module init\n" );
+
+    retval = nf_register_hook( &joikuspot_ops );
+
+    if ( retval < 0 )
+        {
+        return retval;
+        }
+
+    return retval;
+    }
+
+static void joikuspot_exit( void ) 
+    {
+    nf_unregister_hook ( &joikuspot_ops );
+    printk( KERN_DEBUG "JoikuSpot Bouncer Kernel Module exit\n" );
+    }
+
+module_init( joikuspot_init ); 
+module_exit( joikuspot_exit );
+
index 5fe45e3..9d4dd75 100644 (file)
@@ -1,3 +1,10 @@
+kernel-maemo (2.6.28-maemo18) fremantle; urgency=low
+
+  * add kexec patches to enable kexec support on N900
+  * control: TMO thread as bugtracker. mention new features
+
+ -- Thomas Tanner <maemo@tannerlab.com>  Wed, 31 Mar 2010 00:00:00 +0100
+
 kernel-maemo (2.6.28-maemo17) fremantle; urgency=low
 
   * set architecture for all packages to armel
index b492c99..811e59e 100644 (file)
@@ -2,7 +2,7 @@ Source: kernel-maemo
 Section: utils
 Priority: optional
 Maintainer: Thomas Tanner <maemo@tannerlab.com>
-XSBC-Bugtracker: mailto:maemo-bugs@tannerlab.com
+XSBC-Bugtracker: http://talk.maemo.org/showthread.php?t=43420
 XSBC-Original-Maintainer:  Yauheni Kaliuta <yauheni.kaliuta@nokia.com>
 Build-Depends: debhelper (>= 4.0.0), quilt, sdk-fiasco-gen, libncurses5-dev
 Build-Depends-Indep: bzip2
@@ -11,17 +11,19 @@ Standards-Version: 3.8.0
 Package: kernel-maemo
 Architecture: armel
 Description: Flashable Linux kernel
- This package provides a flashable kernel image
+ This package provides a flashable kernel image.
+ Use the kernel-flasher-maemo package to automatically flash it.
 
 Package: kernel-flasher-maemo
 Section: user/system
 Architecture: armel
 Pre-Depends: kernel-maemo (= ${binary:Version}), kernel-modules-maemo (= ${binary:Version}), softupd (>= 0.4.0)
-Recommends: usbip, iptables, mtd-utils
+Recommends: usbip, iptables, mtd-utils, kexec-tools
 Description: Linux kernel updater for an enhanced Maemo 5 kernel 2.6.28.10
  This package will flash the kernel image upon installation
  and eat kernel's files from /boot. If you want to revert to the stock
- kernel, run "apt-get install --reinstall kernel kernel-flasher" as root.
+ kernel, run "apt-get install --reinstall kernel kernel-flasher" as root
+ or use the flasher to flash the extracted zImage from the firmware image.
  .
  This custom kernel contains additional modules for IPv6, packet filtering,
  QoS,  NAT, tunneling, kernel configuration, Wifi mesh networking,
@@ -29,9 +31,10 @@ Description: Linux kernel updater for an enhanced Maemo 5 kernel 2.6.28.10
  NTFS read support, ISO9660, UDF, CIFS, automounter,
  UNIONFS, device mapper and dm-loop, cryptography, cryptoloop,
  EFI partitions, UTF8 codepages, mouse+joystick input, PPP,
- serial support, USB/IP and generic USB device drivers.
+ serial support, USB/IP and generic USB device drivers
+ and kexec support.
  .
- Know bugs: Touchscreen calibration (osso-applet-screencalibration) is incompatible
+ Known bugs: Touchscreen calibration (osso-applet-screencalibration) is incompatible
  with the enabled evdev modules. You need to use the stock Nokia kernel for calibration.
 XB-Maemo-Icon-26:
  iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QAAAAA
diff --git a/kernel-maemo-2.6.28/debian/patches/kexec.diff b/kernel-maemo-2.6.28/debian/patches/kexec.diff
new file mode 100644 (file)
index 0000000..5f3aecf
--- /dev/null
@@ -0,0 +1,156 @@
+--- kernel-maemo-2.6.28.orig/arch/arm/boot/compressed/head.S
++++ kernel-maemo-2.6.28/arch/arm/boot/compressed/head.S
+@@ -27,6 +27,14 @@
+               .macro  writeb, ch, rb
+               mcr     p14, 0, \ch, c0, c5, 0
+               .endm
++elif defined(CONFIG_CPU_V7)
++              .macro  loadsp, rb
++              .endm
++              .macro  writeb, ch, rb
++wait:         mrc     p14, 0, pc, c0, c1, 0
++              bcs     wait
++              mcr     p14, 0, \ch, c0, c5, 0
++              .endm
+ #else
+               .macro  loadsp, rb
+               .endm
+--- kernel-maemo-2.6.28.orig/arch/arm/boot/compressed/misc.c
++++ kernel-maemo-2.6.28/arch/arm/boot/compressed/misc.c
+@@ -47,6 +47,17 @@
+       asm("mcr p14, 0, %0, c0, c5, 0" : : "r" (ch));
+ }
++#elif defined(CONFIG_CPU_V7)
++
++static void icedcc_putc(int ch)
++{
++      asm(
++      "wait:  mrc     p14, 0, pc, c0, c1, 0                   \n\
++              bcs     wait                                    \n\
++              mcr     p14, 0, %0, c0, c5, 0                   "
++      : : "r" (ch));
++}
++
+ #else
+ static void icedcc_putc(int ch)
+--- kernel-maemo-2.6.28.orig/arch/arm/include/asm/cacheflush.h
++++ kernel-maemo-2.6.28/arch/arm/include/asm/cacheflush.h
+@@ -138,16 +138,16 @@
+  *    Please note that the implementation of these, and the required
+  *    effects are cache-type (VIVT/VIPT/PIPT) specific.
+  *
+- *    flush_cache_kern_all()
++ *    flush_kern_all()
+  *
+  *            Unconditionally clean and invalidate the entire cache.
+  *
+- *    flush_cache_user_mm(mm)
++ *    flush_user_all()
+  *
+  *            Clean and invalidate all user space cache entries
+  *            before a change of page tables.
+  *
+- *    flush_cache_user_range(start, end, flags)
++ *    flush_user_range(start, end, flags)
+  *
+  *            Clean and invalidate a range of cache entries in the
+  *            specified address space before a change of page tables.
+@@ -163,6 +163,20 @@
+  *            - start  - virtual start address
+  *            - end    - virtual end address
+  *
++ *    coherent_user_range(start, end)
++ *
++ *            Ensure coherency between the Icache and the Dcache in the
++ *            region described by start, end.  If you have non-snooping
++ *            Harvard caches, you need to implement this function.
++ *            - start  - virtual start address
++ *            - end    - virtual end address
++ *
++ *    flush_kern_dcache_area(kaddr, size)
++ *
++ *            Ensure that the data held in page is written back.
++ *            - kaddr  - page address
++ *            - size   - region size
++ *
+  *    DMA Cache Coherency
+  *    ===================
+  *
+--- kernel-maemo-2.6.28.orig/arch/arm/kernel/debug.S
++++ kernel-maemo-2.6.28/arch/arm/kernel/debug.S
+@@ -49,6 +49,26 @@
+ 1002:
+               .endm
++#elif defined(CONFIG_CPU_V7)
++
++              .macro  addruart, rx
++              .endm
++
++              .macro  senduart, rd, rx
++              mcr     p14, 0, \rd, c0, c5, 0
++              .endm
++
++              .macro  busyuart, rd, rx
++busy:         mrc     p14, 0, pc, c0, c1, 0
++              bcs     busy
++              .endm
++
++              .macro  waituart, rd, rx
++wait:         mrc     p14, 0, pc, c0, c1, 0
++              bcs     wait
++
++              .endm
++
+ #else
+               .macro  addruart, rx
+--- kernel-maemo-2.6.28.orig/arch/arm/mm/mmu.c
++++ kernel-maemo-2.6.28/arch/arm/mm/mmu.c
+@@ -953,4 +953,6 @@
+               pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)));
+               flush_pmd_entry(pmd);
+       }
++
++      local_flush_tlb_all();
+ }
+--- kernel-maemo-2.6.28.orig/arch/arm/mm/proc-v6.S
++++ kernel-maemo-2.6.28/arch/arm/mm/proc-v6.S
+@@ -56,8 +56,6 @@
+  *    to what would be the reset vector.
+  *
+  *    - loc   - location to jump to for soft reset
+- *
+- *    It is assumed that:
+  */
+       .align  5
+ ENTRY(cpu_v6_reset)
+--- kernel-maemo-2.6.28.orig/arch/arm/mm/proc-v7.S
++++ kernel-maemo-2.6.28/arch/arm/mm/proc-v7.S
+@@ -28,7 +28,14 @@
+ ENDPROC(cpu_v7_proc_init)
+ ENTRY(cpu_v7_proc_fin)
+-      mov     pc, lr
++      stmfd   sp!, {lr}
++      cpsid   if                              @ disable interrupts
++      bl      v7_flush_kern_cache_all
++      mrc     p15, 0, r0, c1, c0, 0           @ ctrl register
++      bic     r0, r0, #0x1000                 @ ...i............
++      bic     r0, r0, #0x0006                 @ .............ca.
++      mcr     p15, 0, r0, c1, c0, 0           @ disable caches
++      ldmfd   sp!, {pc}
+ ENDPROC(cpu_v7_proc_fin)
+ /*
+@@ -39,8 +46,6 @@
+  *    to what would be the reset vector.
+  *
+  *    - loc   - location to jump to for soft reset
+- *
+- *    It is assumed that:
+  */
+       .align  5
+ ENTRY(cpu_v7_reset)
index dd548e2..65229c6 100644 (file)
@@ -11,3 +11,4 @@ ppp_async_matan.diff
 2.6.28.10.diff
 block2mtd-yoush.diff
 gentoo-fsfixes.diff
+kexec.diff