summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@kernel.crashing.org>2004-07-28 18:17:53 -0700
committerTom Rini <trini@kernel.crashing.org>2004-07-28 18:17:53 -0700
commit4f449b971af367c8f5f19302a7464fbe734d7926 (patch)
tree4d10df5e1f8a4cbc7e786c4b6cc6d1a7cf389045 /include
parent1992179f54d7e9ef74515eb4260ec2693129ccb6 (diff)
parent14f010997ce934ca34acff0410fff5895a16b300 (diff)
[PPC32] Merge MPC52xx changes with recent CPM changes.
Diffstat (limited to 'include')
-rw-r--r--include/asm-alpha/uaccess.h4
-rw-r--r--include/asm-generic/pgtable.h4
-rw-r--r--include/asm-i386/elf.h8
-rw-r--r--include/asm-i386/page.h6
-rw-r--r--include/asm-i386/string.h8
-rw-r--r--include/asm-i386/uaccess.h2
-rw-r--r--include/asm-ia64/elf.h6
-rw-r--r--include/asm-ia64/page.h2
-rw-r--r--include/asm-ia64/pgtable.h6
-rw-r--r--include/asm-ia64/processor.h3
-rw-r--r--include/asm-ia64/sn/sn2/io.h5
-rw-r--r--include/asm-ia64/sn/sn_sal.h4
-rw-r--r--include/asm-m68k/bitops.h8
-rw-r--r--include/asm-m68k/hardirq.h1
-rw-r--r--include/asm-m68k/math-emu.h2
-rw-r--r--include/asm-m68k/motorola_pgalloc.h1
-rw-r--r--include/asm-m68k/semaphore.h12
-rw-r--r--include/asm-m68k/sun3_pgalloc.h5
-rw-r--r--include/asm-ppc/highmem.h4
-rw-r--r--include/asm-ppc/io.h2
-rw-r--r--include/asm-ppc/mpc52xx.h380
-rw-r--r--include/asm-ppc/mpc52xx_psc.h191
-rw-r--r--include/asm-ppc/ocp_ids.h1
-rw-r--r--include/asm-ppc/open_pic.h2
-rw-r--r--include/asm-ppc/ppcboot.h7
-rw-r--r--include/asm-ppc/reg.h8
-rw-r--r--include/asm-ppc/signal.h12
-rw-r--r--include/asm-ppc/uaccess.h12
-rw-r--r--include/asm-ppc/ucontext.h4
-rw-r--r--include/asm-ppc64/hvcserver.h44
-rw-r--r--include/asm-ppc64/processor.h2
-rw-r--r--include/asm-ppc64/prom.h1
-rw-r--r--include/asm-ppc64/uaccess.h2
-rw-r--r--include/asm-ppc64/xics.h3
-rw-r--r--include/asm-sparc/pci.h7
-rw-r--r--include/asm-sparc64/openpromio.h4
-rw-r--r--include/asm-sparc64/siginfo.h8
-rw-r--r--include/asm-sparc64/signal.h11
-rw-r--r--include/asm-sparc64/ttable.h4
-rw-r--r--include/asm-v850/bitops.h6
-rw-r--r--include/asm-x86_64/mpspec.h2
-rw-r--r--include/asm-x86_64/topology.h6
-rw-r--r--include/asm-x86_64/uaccess.h2
-rw-r--r--include/linux/ata.h4
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/atmlec.h2
-rw-r--r--include/linux/elf.h7
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/genhd.h3
-rw-r--r--include/linux/ipmi.h18
-rw-r--r--include/linux/list.h3
-rw-r--r--include/linux/mmzone.h13
-rw-r--r--include/linux/net.h7
-rw-r--r--include/linux/nfsd/cache.h2
-rw-r--r--include/linux/nfsd/nfsd.h4
-rw-r--r--include/linux/nfsd/xdr.h4
-rw-r--r--include/linux/nfsd/xdr3.h4
-rw-r--r--include/linux/nfsd/xdr4.h4
-rw-r--r--include/linux/personality.h7
-rw-r--r--include/linux/reiserfs_fs.h8
-rw-r--r--include/linux/sched.h8
-rw-r--r--include/linux/serial_core.h3
-rw-r--r--include/linux/snmp.h266
-rw-r--r--include/linux/sunrpc/svc.h10
-rw-r--r--include/linux/sunrpc/xdr.h14
-rw-r--r--include/net/bluetooth/hci.h2
-rw-r--r--include/net/icmp.h12
-rw-r--r--include/net/inet_ecn.h41
-rw-r--r--include/net/ip.h11
-rw-r--r--include/net/ip6_route.h2
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/pkt_sched.h85
-rw-r--r--include/net/sctp/command.h3
-rw-r--r--include/net/sctp/constants.h4
-rw-r--r--include/net/sctp/sm.h3
-rw-r--r--include/net/snmp.h363
-rw-r--r--include/net/tcp.h16
-rw-r--r--include/net/udp.h2
-rw-r--r--include/sound/asound.h6
-rw-r--r--include/video/vga.h9
80 files changed, 1290 insertions, 478 deletions
diff --git a/include/asm-alpha/uaccess.h b/include/asm-alpha/uaccess.h
index afdb02a94aa6..c9bb9f103ca6 100644
--- a/include/asm-alpha/uaccess.h
+++ b/include/asm-alpha/uaccess.h
@@ -107,7 +107,7 @@ extern void __get_user_unknown(void);
#define __get_user_check(x,ptr,size,segment) \
({ \
long __gu_err = -EFAULT, __gu_val = 0; \
- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
+ const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
__chk_user_ptr(ptr); \
if (__access_ok((unsigned long)__gu_addr,size,segment)) { \
__gu_err = 0; \
@@ -222,7 +222,7 @@ extern void __put_user_unknown(void);
#define __put_user_check(x,ptr,size,segment) \
({ \
long __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
__chk_user_ptr(ptr); \
if (__access_ok((unsigned long)__pu_addr,size,segment)) { \
__pu_err = 0; \
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index ee74be68c19e..29573197c3ee 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -122,4 +122,8 @@ static inline void ptep_mkdirty(pte_t *ptep)
#define page_test_and_clear_young(page) (0)
#endif
+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
+#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
+#endif
+
#endif /* _ASM_GENERIC_PGTABLE_H */
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index cda7f174b694..a53f1fc65e19 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -117,7 +117,13 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
#define AT_SYSINFO_EHDR 33
#ifdef __KERNEL__
-#define SET_PERSONALITY(ex, ibcs2) set_personality((ibcs2)?PER_SVR4:PER_LINUX)
+#define SET_PERSONALITY(ex, ibcs2) do { } while (0)
+
+/*
+ * An executable for which elf_read_implies_exec() returns TRUE will
+ * have the READ_IMPLIES_EXEC personality flag set automatically.
+ */
+#define elf_read_implies_exec_binary(ex, have_pt_gnu_stack) (!(have_pt_gnu_stack))
extern int dump_task_regs (struct task_struct *, elf_gregset_t *);
extern int dump_task_fpu (struct task_struct *, elf_fpregset_t *);
diff --git a/include/asm-i386/page.h b/include/asm-i386/page.h
index f544cc131b28..eb0e11f10683 100644
--- a/include/asm-i386/page.h
+++ b/include/asm-i386/page.h
@@ -140,8 +140,10 @@ static __inline__ int get_order(unsigned long size)
#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
-#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
- VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
+#define VM_DATA_DEFAULT_FLAGS \
+ (VM_READ | VM_WRITE | \
+ ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0 ) | \
+ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
#endif /* __KERNEL__ */
diff --git a/include/asm-i386/string.h b/include/asm-i386/string.h
index 9ae50d2d96c8..fc66609bb761 100644
--- a/include/asm-i386/string.h
+++ b/include/asm-i386/string.h
@@ -27,6 +27,7 @@
*/
#if !defined(IN_STRING_C)
+#define __HAVE_ARCH_STRCPY
static inline char * strcpy(char * dest,const char *src)
{
int d0, d1, d2;
@@ -40,6 +41,7 @@ __asm__ __volatile__(
return dest;
}
+#define __HAVE_ARCH_STRNCPY
static inline char * strncpy(char * dest,const char *src,size_t count)
{
int d0, d1, d2, d3;
@@ -58,6 +60,7 @@ __asm__ __volatile__(
return dest;
}
+#define __HAVE_ARCH_STRCAT
static inline char * strcat(char * dest,const char * src)
{
int d0, d1, d2, d3;
@@ -74,6 +77,7 @@ __asm__ __volatile__(
return dest;
}
+#define __HAVE_ARCH_STRNCAT
static inline char * strncat(char * dest,const char * src,size_t count)
{
int d0, d1, d2, d3;
@@ -96,6 +100,7 @@ __asm__ __volatile__(
return dest;
}
+#define __HAVE_ARCH_STRCMP
static inline int strcmp(const char * cs,const char * ct)
{
int d0, d1;
@@ -116,6 +121,7 @@ __asm__ __volatile__(
return __res;
}
+#define __HAVE_ARCH_STRNCMP
static inline int strncmp(const char * cs,const char * ct,size_t count)
{
register int __res;
@@ -138,6 +144,7 @@ __asm__ __volatile__(
return __res;
}
+#define __HAVE_ARCH_STRCHR
static inline char * strchr(const char * s, int c)
{
int d0;
@@ -156,6 +163,7 @@ __asm__ __volatile__(
return __res;
}
+#define __HAVE_ARCH_STRRCHR
static inline char * strrchr(const char * s, int c)
{
int d0, d1;
diff --git a/include/asm-i386/uaccess.h b/include/asm-i386/uaccess.h
index 656be13d0abd..bb202d21268f 100644
--- a/include/asm-i386/uaccess.h
+++ b/include/asm-i386/uaccess.h
@@ -261,7 +261,7 @@ extern void __put_user_bad(void);
#define __put_user_check(x,ptr,size) \
({ \
long __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
might_sleep(); \
if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
__put_user_size((x),__pu_addr,(size),__pu_err,-EFAULT); \
diff --git a/include/asm-ia64/elf.h b/include/asm-ia64/elf.h
index 9364bb2ee060..9557b49983df 100644
--- a/include/asm-ia64/elf.h
+++ b/include/asm-ia64/elf.h
@@ -185,9 +185,9 @@ extern void ia64_elf_core_copy_regs (struct pt_regs *src, elf_gregset_t dst);
#define AT_SYSINFO_EHDR 33
#ifdef __KERNEL__
-struct elf64_hdr;
-extern void ia64_set_personality (struct elf64_hdr *elf_ex, int ibcs2_interpreter);
-#define SET_PERSONALITY(ex, ibcs2) ia64_set_personality(&(ex), ibcs2)
+#define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
+#define elf_read_implies_exec(ex, have_pt_gnu_stack) \
+ (!(have_pt_gnu_stack) && ((ex).e_flags & EF_IA_64_LINUX_EXECUTABLE_STACK) != 0)
struct task_struct;
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
index 58cc7448242e..315a8631068f 100644
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -184,7 +184,7 @@ get_order (unsigned long size)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC | \
- (((current->thread.flags & IA64_THREAD_XSTACK) != 0) \
+ (((current->personality & READ_IMPLIES_EXEC) != 0) \
? VM_EXEC : 0))
#endif /* _ASM_IA64_PAGE_H */
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index c30329a308b4..8433966536e6 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -321,6 +321,11 @@ pgd_offset (struct mm_struct *mm, unsigned long address)
#define pgd_offset_k(addr) \
(init_mm.pgd + (((addr) >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)))
+/* Look up a pgd entry in the gate area. On IA-64, the gate-area
+ resides in the kernel-mapped segment, hence we use pgd_offset_k()
+ here. */
+#define pgd_offset_gate(mm, addr) pgd_offset_k(addr)
+
/* Find an entry in the second-level page table.. */
#define pmd_offset(dir,addr) \
((pmd_t *) pgd_page(*(dir)) + (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1)))
@@ -552,6 +557,7 @@ do { \
#define __HAVE_ARCH_PTEP_SET_WRPROTECT
#define __HAVE_ARCH_PTEP_MKDIRTY
#define __HAVE_ARCH_PTE_SAME
+#define __HAVE_ARCH_PGD_OFFSET_GATE
#include <asm-generic/pgtable.h>
#endif /* _ASM_IA64_PGTABLE_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index dec7d3fb1ba7..f62f93c296a4 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -2,7 +2,7 @@
#define _ASM_IA64_PROCESSOR_H
/*
- * Copyright (C) 1998-2003 Hewlett-Packard Co
+ * Copyright (C) 1998-2004 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
* Stephane Eranian <eranian@hpl.hp.com>
* Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com>
@@ -61,7 +61,6 @@
/* bit 5 is currently unused */
#define IA64_THREAD_FPEMU_NOPRINT (__IA64_UL(1) << 6) /* don't log any fpswa faults */
#define IA64_THREAD_FPEMU_SIGFPE (__IA64_UL(1) << 7) /* send a SIGFPE for fpswa faults */
-#define IA64_THREAD_XSTACK (__IA64_UL(1) << 8) /* stack executable by default? */
#define IA64_THREAD_UAC_SHIFT 3
#define IA64_THREAD_UAC_MASK (IA64_THREAD_UAC_NOPRINT | IA64_THREAD_UAC_SIGBUS)
diff --git a/include/asm-ia64/sn/sn2/io.h b/include/asm-ia64/sn/sn2/io.h
index 1ed535abd010..4cc94e9ad4eb 100644
--- a/include/asm-ia64/sn/sn2/io.h
+++ b/include/asm-ia64/sn/sn2/io.h
@@ -8,10 +8,11 @@
#ifndef _ASM_SN_SN2_IO_H
#define _ASM_SN_SN2_IO_H
+#include <linux/compiler.h>
+#include <asm/intrinsics.h>
-extern void * sn_io_addr(unsigned long port); /* Forward definition */
+extern void * sn_io_addr(unsigned long port) __attribute_const__; /* Forward definition */
extern void sn_mmiob(void); /* Forward definition */
-#include <asm/intrinsics.h>
#define __sn_mf_a() ia64_mfa()
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
index cc063429344f..5bd9b3335975 100644
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -141,8 +141,8 @@ sn_sal_rev_minor(void)
* Specify the minimum PROM revsion required for this kernel.
* Note that they're stored in hex format...
*/
-#define SN_SAL_MIN_MAJOR 0x1 /* SN2 kernels need at least PROM 1.0 */
-#define SN_SAL_MIN_MINOR 0x0
+#define SN_SAL_MIN_MAJOR 0x3 /* SN2 kernels need at least PROM 3.40 */
+#define SN_SAL_MIN_MINOR 0x40
u64 ia64_sn_probe_io_slot(long paddr, long size, void *data_ptr);
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index 05ccc865d77b..b1bcf7c66516 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -52,14 +52,14 @@ static inline int __generic_test_and_set_bit(int nr, unsigned long *vaddr)
#define __set_bit(nr,vaddr) set_bit(nr,vaddr)
-static inline void __constant_set_bit(int nr, unsigned long *vaddr)
+static inline void __constant_set_bit(int nr, volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
__asm__ __volatile__ ("bset %1,%0"
: "+m" (*p) : "di" (nr & 7));
}
-static inline void __generic_set_bit(int nr, unsigned long *vaddr)
+static inline void __generic_set_bit(int nr, volatile unsigned long *vaddr)
{
__asm__ __volatile__ ("bfset %1{%0:#1}"
: : "d" (nr^31), "o" (*vaddr) : "memory");
@@ -106,14 +106,14 @@ static inline int __generic_test_and_clear_bit(int nr, unsigned long *vaddr)
__generic_clear_bit(nr, vaddr))
#define __clear_bit(nr,vaddr) clear_bit(nr,vaddr)
-static inline void __constant_clear_bit(int nr, unsigned long *vaddr)
+static inline void __constant_clear_bit(int nr, volatile unsigned long *vaddr)
{
char *p = (char *)vaddr + (nr ^ 31) / 8;
__asm__ __volatile__ ("bclr %1,%0"
: "+m" (*p) : "di" (nr & 7));
}
-static inline void __generic_clear_bit(int nr, unsigned long *vaddr)
+static inline void __generic_clear_bit(int nr, volatile unsigned long *vaddr)
{
__asm__ __volatile__ ("bfclr %1{%0:#1}"
: : "d" (nr^31), "o" (*vaddr) : "memory");
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
index 22dc9cf91365..80c86ec3ba74 100644
--- a/include/asm-m68k/hardirq.h
+++ b/include/asm-m68k/hardirq.h
@@ -1,6 +1,7 @@
#ifndef __M68K_HARDIRQ_H
#define __M68K_HARDIRQ_H
+#include <linux/config.h>
#include <linux/threads.h>
#include <linux/cache.h>
diff --git a/include/asm-m68k/math-emu.h b/include/asm-m68k/math-emu.h
index a09dc54f2ecc..7ac6259b68df 100644
--- a/include/asm-m68k/math-emu.h
+++ b/include/asm-m68k/math-emu.h
@@ -102,7 +102,7 @@ struct fp_data {
struct fp_ext temp[2];
};
-#if FPU_EMU_DEBUG
+#ifdef FPU_EMU_DEBUG
extern unsigned int fp_debugprint;
#define dprint(bit, fmt, args...) ({ \
diff --git a/include/asm-m68k/motorola_pgalloc.h b/include/asm-m68k/motorola_pgalloc.h
index f315615e488a..dda9618adc07 100644
--- a/include/asm-m68k/motorola_pgalloc.h
+++ b/include/asm-m68k/motorola_pgalloc.h
@@ -2,6 +2,7 @@
#define _MOTOROLA_PGALLOC_H
#include <asm/tlb.h>
+#include <asm/tlbflush.h>
extern pmd_t *get_pointer_table(void);
extern int free_pointer_table(pmd_t *);
diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h
index 964aff90fd1c..213d4f79672d 100644
--- a/include/asm-m68k/semaphore.h
+++ b/include/asm-m68k/semaphore.h
@@ -27,12 +27,12 @@ struct semaphore {
atomic_t count;
atomic_t waking;
wait_queue_head_t wait;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
long __magic;
#endif
};
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
# define __SEM_DEBUG_INIT(name) \
, (long)&(name).__magic
#else
@@ -86,7 +86,7 @@ static inline void down(struct semaphore *sem)
{
register struct semaphore *sem1 __asm__ ("%a1") = sem;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
might_sleep();
@@ -109,7 +109,7 @@ static inline int down_interruptible(struct semaphore *sem)
register struct semaphore *sem1 __asm__ ("%a1") = sem;
register int result __asm__ ("%d0");
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
might_sleep();
@@ -134,7 +134,7 @@ static inline int down_trylock(struct semaphore *sem)
register struct semaphore *sem1 __asm__ ("%a1") = sem;
register int result __asm__ ("%d0");
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
@@ -164,7 +164,7 @@ static inline void up(struct semaphore *sem)
{
register struct semaphore *sem1 __asm__ ("%a1") = sem;
-#if WAITQUEUE_DEBUG
+#ifdef WAITQUEUE_DEBUG
CHECK_MAGIC(sem->__magic);
#endif
diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h
index d00e10ff6e80..fd8241117649 100644
--- a/include/asm-m68k/sun3_pgalloc.h
+++ b/include/asm-m68k/sun3_pgalloc.h
@@ -31,10 +31,7 @@ static inline void pte_free(struct page *page)
__free_page(page);
}
-static inline void __pte_free_tlb(struct mmu_gather *tlb, struct page *page)
-{
- tlb_remove_page(tlb, page);
-}
+#define __pte_free_tlb(tlb,pte) tlb_remove_page((tlb),(pte))
static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
unsigned long address)
diff --git a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h
index aa3e74516808..928f8447ae7f 100644
--- a/include/asm-ppc/highmem.h
+++ b/include/asm-ppc/highmem.h
@@ -91,7 +91,7 @@ static inline void *kmap_atomic(struct page *page, enum km_type type)
BUG_ON(!pte_none(*(kmap_pte+idx)));
#endif
set_pte(kmap_pte+idx, mk_pte(page, kmap_prot));
- flush_tlb_page(0, vaddr);
+ flush_tlb_page(NULL, vaddr);
return (void*) vaddr;
}
@@ -115,7 +115,7 @@ static inline void kunmap_atomic(void *kvaddr, enum km_type type)
* this pte without first remap it
*/
pte_clear(kmap_pte+idx);
- flush_tlb_page(0, vaddr);
+ flush_tlb_page(NULL, vaddr);
#endif
dec_preempt_count();
preempt_check_resched();
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 2717a607de27..a893418be84c 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -237,7 +237,7 @@ extern inline void * bus_to_virt(unsigned long address)
{
#ifndef CONFIG_APUS
if (address == 0)
- return 0;
+ return NULL;
return (void *)(address - PCI_DRAM_OFFSET + KERNELBASE);
#else
return (void*) mm_ptov (address);
diff --git a/include/asm-ppc/mpc52xx.h b/include/asm-ppc/mpc52xx.h
new file mode 100644
index 000000000000..4fb6e572b841
--- /dev/null
+++ b/include/asm-ppc/mpc52xx.h
@@ -0,0 +1,380 @@
+/*
+ * include/asm-ppc/mpc52xx.h
+ *
+ * Prototypes, etc. for the Freescale MPC52xx embedded cpu chips
+ * May need to be cleaned as the port goes on ...
+ *
+ *
+ * Maintainer : Sylvain Munaut <tnt@246tNt.com>
+ *
+ * Originally written by Dale Farnsworth <dfarnsworth@mvista.com>
+ * for the 2.4 kernel.
+ *
+ * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
+ * Copyright (C) 2003 MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef __ASM_MPC52xx_H__
+#define __ASM_MPC52xx_H__
+
+#ifndef __ASSEMBLY__
+#include <asm/ppcboot.h>
+#include <asm/types.h>
+
+struct pt_regs;
+struct ocp_def;
+#endif /* __ASSEMBLY__ */
+
+
+/* ======================================================================== */
+/* Main registers/struct addresses */
+/* ======================================================================== */
+/* Theses are PHYSICAL addresses ! */
+/* TODO : There should be no static mapping, but it's not yet the case, so */
+/* we require a 1:1 mapping */
+
+#define MPC52xx_MBAR 0xf0000000 /* Phys address */
+#define MPC52xx_MBAR_SIZE 0x00010000
+#define MPC52xx_MBAR_VIRT 0xf0000000 /* Virt address */
+
+#define MPC52xx_MMAP_CTL (MPC52xx_MBAR + 0x0000)
+#define MPC52xx_CDM (MPC52xx_MBAR + 0x0200)
+#define MPC52xx_SFTRST (MPC52xx_MBAR + 0x0220)
+#define MPC52xx_SFTRST_BIT 0x01000000
+#define MPC52xx_INTR (MPC52xx_MBAR + 0x0500)
+#define MPC52xx_GPTx(x) (MPC52xx_MBAR + 0x0600 + ((x)<<4))
+#define MPC52xx_RTC (MPC52xx_MBAR + 0x0800)
+#define MPC52xx_MSCAN1 (MPC52xx_MBAR + 0x0900)
+#define MPC52xx_MSCAN2 (MPC52xx_MBAR + 0x0980)
+#define MPC52xx_GPIO (MPC52xx_MBAR + 0x0b00)
+#define MPC52xx_PCI (MPC52xx_MBAR + 0x0d00)
+#define MPC52xx_USB_OHCI (MPC52xx_MBAR + 0x1000)
+#define MPC52xx_SDMA (MPC52xx_MBAR + 0x1200)
+#define MPC52xx_XLB (MPC52xx_MBAR + 0x1f00)
+#define MPC52xx_PSCx(x) (MPC52xx_MBAR + 0x2000 + ((x)<<9))
+#define MPC52xx_PSC1 (MPC52xx_MBAR + 0x2000)
+#define MPC52xx_PSC2 (MPC52xx_MBAR + 0x2200)
+#define MPC52xx_PSC3 (MPC52xx_MBAR + 0x2400)
+#define MPC52xx_PSC4 (MPC52xx_MBAR + 0x2600)
+#define MPC52xx_PSC5 (MPC52xx_MBAR + 0x2800)
+#define MPC52xx_PSC6 (MPC52xx_MBAR + 0x2C00)
+#define MPC52xx_FEC (MPC52xx_MBAR + 0x3000)
+#define MPC52xx_ATA (MPC52xx_MBAR + 0x3a00)
+#define MPC52xx_I2C1 (MPC52xx_MBAR + 0x3d00)
+#define MPC52xx_I2C_MICR (MPC52xx_MBAR + 0x3d20)
+#define MPC52xx_I2C2 (MPC52xx_MBAR + 0x3d40)
+
+/* SRAM used for SDMA */
+#define MPC52xx_SRAM (MPC52xx_MBAR + 0x8000)
+#define MPC52xx_SRAM_SIZE (16*1024)
+#define MPC52xx_SDMA_MAX_TASKS 16
+
+ /* Memory allocation block size */
+#define MPC52xx_SDRAM_UNIT 0x8000 /* 32K byte */
+
+
+/* ======================================================================== */
+/* IRQ mapping */
+/* ======================================================================== */
+/* Be sure to look at mpc52xx_pic.h if you wish for whatever reason to change
+ * this
+ */
+
+#define MPC52xx_CRIT_IRQ_NUM 4
+#define MPC52xx_MAIN_IRQ_NUM 17
+#define MPC52xx_SDMA_IRQ_NUM 17
+#define MPC52xx_PERP_IRQ_NUM 23
+
+#define MPC52xx_CRIT_IRQ_BASE 0
+#define MPC52xx_MAIN_IRQ_BASE (MPC52xx_CRIT_IRQ_BASE + MPC52xx_CRIT_IRQ_NUM)
+#define MPC52xx_SDMA_IRQ_BASE (MPC52xx_MAIN_IRQ_BASE + MPC52xx_MAIN_IRQ_NUM)
+#define MPC52xx_PERP_IRQ_BASE (MPC52xx_SDMA_IRQ_BASE + MPC52xx_SDMA_IRQ_NUM)
+
+#define MPC52xx_IRQ0 (MPC52xx_CRIT_IRQ_BASE + 0)
+#define MPC52xx_SLICE_TIMER_0_IRQ (MPC52xx_CRIT_IRQ_BASE + 1)
+#define MPC52xx_HI_INT_IRQ (MPC52xx_CRIT_IRQ_BASE + 2)
+#define MPC52xx_CCS_IRQ (MPC52xx_CRIT_IRQ_BASE + 3)
+
+#define MPC52xx_IRQ1 (MPC52xx_MAIN_IRQ_BASE + 1)
+#define MPC52xx_IRQ2 (MPC52xx_MAIN_IRQ_BASE + 2)
+#define MPC52xx_IRQ3 (MPC52xx_MAIN_IRQ_BASE + 3)
+
+#define MPC52xx_SDMA_IRQ (MPC52xx_PERP_IRQ_BASE + 0)
+#define MPC52xx_PSC1_IRQ (MPC52xx_PERP_IRQ_BASE + 1)
+#define MPC52xx_PSC2_IRQ (MPC52xx_PERP_IRQ_BASE + 2)
+#define MPC52xx_PSC3_IRQ (MPC52xx_PERP_IRQ_BASE + 3)
+#define MPC52xx_PSC6_IRQ (MPC52xx_PERP_IRQ_BASE + 4)
+#define MPC52xx_IRDA_IRQ (MPC52xx_PERP_IRQ_BASE + 4)
+#define MPC52xx_FEC_IRQ (MPC52xx_PERP_IRQ_BASE + 5)
+#define MPC52xx_USB_IRQ (MPC52xx_PERP_IRQ_BASE + 6)
+#define MPC52xx_ATA_IRQ (MPC52xx_PERP_IRQ_BASE + 7)
+#define MPC52xx_PCI_CNTRL_IRQ (MPC52xx_PERP_IRQ_BASE + 8)
+#define MPC52xx_PCI_SCIRX_IRQ (MPC52xx_PERP_IRQ_BASE + 9)
+#define MPC52xx_PCI_SCITX_IRQ (MPC52xx_PERP_IRQ_BASE + 10)
+#define MPC52xx_PSC4_IRQ (MPC52xx_PERP_IRQ_BASE + 11)
+#define MPC52xx_PSC5_IRQ (MPC52xx_PERP_IRQ_BASE + 12)
+#define MPC52xx_SPI_MODF_IRQ (MPC52xx_PERP_IRQ_BASE + 13)
+#define MPC52xx_SPI_SPIF_IRQ (MPC52xx_PERP_IRQ_BASE + 14)
+#define MPC52xx_I2C1_IRQ (MPC52xx_PERP_IRQ_BASE + 15)
+#define MPC52xx_I2C2_IRQ (MPC52xx_PERP_IRQ_BASE + 16)
+#define MPC52xx_CAN1_IRQ (MPC52xx_PERP_IRQ_BASE + 17)
+#define MPC52xx_CAN2_IRQ (MPC52xx_PERP_IRQ_BASE + 18)
+#define MPC52xx_IR_RX_IRQ (MPC52xx_PERP_IRQ_BASE + 19)
+#define MPC52xx_IR_TX_IRQ (MPC52xx_PERP_IRQ_BASE + 20)
+#define MPC52xx_XLB_ARB_IRQ (MPC52xx_PERP_IRQ_BASE + 21)
+
+
+
+/* ======================================================================== */
+/* Structures mapping of some unit register set */
+/* ======================================================================== */
+
+#ifndef __ASSEMBLY__
+
+/* Memory Mapping Control */
+struct mpc52xx_mmap_ctl {
+ volatile u32 mbar; /* MMAP_CTRL + 0x00 */
+
+ volatile u32 cs0_start; /* MMAP_CTRL + 0x04 */
+ volatile u32 cs0_stop; /* MMAP_CTRL + 0x08 */
+ volatile u32 cs1_start; /* MMAP_CTRL + 0x0c */
+ volatile u32 cs1_stop; /* MMAP_CTRL + 0x10 */
+ volatile u32 cs2_start; /* MMAP_CTRL + 0x14 */
+ volatile u32 cs2_stop; /* MMAP_CTRL + 0x18 */
+ volatile u32 cs3_start; /* MMAP_CTRL + 0x1c */
+ volatile u32 cs3_stop; /* MMAP_CTRL + 0x20 */
+ volatile u32 cs4_start; /* MMAP_CTRL + 0x24 */
+ volatile u32 cs4_stop; /* MMAP_CTRL + 0x28 */
+ volatile u32 cs5_start; /* MMAP_CTRL + 0x2c */
+ volatile u32 cs5_stop; /* MMAP_CTRL + 0x30 */
+
+ volatile u32 sdram0; /* MMAP_CTRL + 0x34 */
+ volatile u32 sdram1; /* MMAP_CTRL + 0X38 */
+
+ volatile u32 reserved[4]; /* MMAP_CTRL + 0x3c .. 0x48 */
+
+ volatile u32 boot_start; /* MMAP_CTRL + 0x4c */
+ volatile u32 boot_stop; /* MMAP_CTRL + 0x50 */
+
+ volatile u32 ipbi_ws_ctrl; /* MMAP_CTRL + 0x54 */
+
+ volatile u32 cs6_start; /* MMAP_CTRL + 0x58 */
+ volatile u32 cs6_stop; /* MMAP_CTRL + 0x5c */
+ volatile u32 cs7_start; /* MMAP_CTRL + 0x60 */
+ volatile u32 cs7_stop; /* MMAP_CTRL + 0x60 */
+};
+
+/* Interrupt controller */
+struct mpc52xx_intr {
+ volatile u32 per_mask; /* INTR + 0x00 */
+ volatile u32 per_pri1; /* INTR + 0x04 */
+ volatile u32 per_pri2; /* INTR + 0x08 */
+ volatile u32 per_pri3; /* INTR + 0x0c */
+ volatile u32 ctrl; /* INTR + 0x10 */
+ volatile u32 main_mask; /* INTR + 0x14 */
+ volatile u32 main_pri1; /* INTR + 0x18 */
+ volatile u32 main_pri2; /* INTR + 0x1c */
+ volatile u32 reserved1; /* INTR + 0x20 */
+ volatile u32 enc_status; /* INTR + 0x24 */
+ volatile u32 crit_status; /* INTR + 0x28 */
+ volatile u32 main_status; /* INTR + 0x2c */
+ volatile u32 per_status; /* INTR + 0x30 */
+ volatile u32 reserved2; /* INTR + 0x34 */
+ volatile u32 per_error; /* INTR + 0x38 */
+};
+
+/* SDMA */
+struct mpc52xx_sdma {
+ volatile u32 taskBar; /* SDMA + 0x00 */
+ volatile u32 currentPointer; /* SDMA + 0x04 */
+ volatile u32 endPointer; /* SDMA + 0x08 */
+ volatile u32 variablePointer;/* SDMA + 0x0c */
+
+ volatile u8 IntVect1; /* SDMA + 0x10 */
+ volatile u8 IntVect2; /* SDMA + 0x11 */
+ volatile u16 PtdCntrl; /* SDMA + 0x12 */
+
+ volatile u32 IntPend; /* SDMA + 0x14 */
+ volatile u32 IntMask; /* SDMA + 0x18 */
+
+ volatile u16 tcr[16]; /* SDMA + 0x1c .. 0x3a */
+
+ volatile u8 ipr[31]; /* SDMA + 0x3c .. 5b */
+
+ volatile u32 res1; /* SDMA + 0x5c */
+ volatile u32 task_size0; /* SDMA + 0x60 */
+ volatile u32 task_size1; /* SDMA + 0x64 */
+ volatile u32 MDEDebug; /* SDMA + 0x68 */
+ volatile u32 ADSDebug; /* SDMA + 0x6c */
+ volatile u32 Value1; /* SDMA + 0x70 */
+ volatile u32 Value2; /* SDMA + 0x74 */
+ volatile u32 Control; /* SDMA + 0x78 */
+ volatile u32 Status; /* SDMA + 0x7c */
+};
+
+/* GPT */
+struct mpc52xx_gpt {
+ volatile u32 mode; /* GPTx + 0x00 */
+ volatile u32 count; /* GPTx + 0x04 */
+ volatile u32 pwm; /* GPTx + 0x08 */
+ volatile u32 status; /* GPTx + 0X0c */
+};
+
+/* RTC */
+struct mpc52xx_rtc {
+ volatile u32 time_set; /* RTC + 0x00 */
+ volatile u32 date_set; /* RTC + 0x04 */
+ volatile u32 stopwatch; /* RTC + 0x08 */
+ volatile u32 int_enable; /* RTC + 0x0c */
+ volatile u32 time; /* RTC + 0x10 */
+ volatile u32 date; /* RTC + 0x14 */
+ volatile u32 stopwatch_intr; /* RTC + 0x18 */
+ volatile u32 bus_error; /* RTC + 0x1c */
+ volatile u32 dividers; /* RTC + 0x20 */
+};
+
+/* GPIO */
+struct mpc52xx_gpio {
+ volatile u32 port_config; /* GPIO + 0x00 */
+ volatile u32 simple_gpioe; /* GPIO + 0x04 */
+ volatile u32 simple_ode; /* GPIO + 0x08 */
+ volatile u32 simple_ddr; /* GPIO + 0x0c */
+ volatile u32 simple_dvo; /* GPIO + 0x10 */
+ volatile u32 simple_ival; /* GPIO + 0x14 */
+ volatile u8 outo_gpioe; /* GPIO + 0x18 */
+ volatile u8 reserved1[3]; /* GPIO + 0x19 */
+ volatile u8 outo_dvo; /* GPIO + 0x1c */
+ volatile u8 reserved2[3]; /* GPIO + 0x1d */
+ volatile u8 sint_gpioe; /* GPIO + 0x20 */
+ volatile u8 reserved3[3]; /* GPIO + 0x21 */
+ volatile u8 sint_ode; /* GPIO + 0x24 */
+ volatile u8 reserved4[3]; /* GPIO + 0x25 */
+ volatile u8 sint_ddr; /* GPIO + 0x28 */
+ volatile u8 reserved5[3]; /* GPIO + 0x29 */
+ volatile u8 sint_dvo; /* GPIO + 0x2c */
+ volatile u8 reserved6[3]; /* GPIO + 0x2d */
+ volatile u8 sint_inten; /* GPIO + 0x30 */
+ volatile u8 reserved7[3]; /* GPIO + 0x31 */
+ volatile u16 sint_itype; /* GPIO + 0x34 */
+ volatile u16 reserved8; /* GPIO + 0x36 */
+ volatile u8 gpio_control; /* GPIO + 0x38 */
+ volatile u8 reserved9[3]; /* GPIO + 0x39 */
+ volatile u8 sint_istat; /* GPIO + 0x3c */
+ volatile u8 sint_ival; /* GPIO + 0x3d */
+ volatile u8 bus_errs; /* GPIO + 0x3e */
+ volatile u8 reserved10; /* GPIO + 0x3f */
+};
+
+#define MPC52xx_GPIO_PSC_CONFIG_UART_WITHOUT_CD 4
+#define MPC52xx_GPIO_PSC_CONFIG_UART_WITH_CD 5
+#define MPC52xx_GPIO_PCI_DIS (1<<15)
+
+/* XLB Bus control */
+struct mpc52xx_xlb {
+ volatile u8 reserved[0x40];
+ volatile u32 config; /* XLB + 0x40 */
+ volatile u32 version; /* XLB + 0x44 */
+ volatile u32 status; /* XLB + 0x48 */
+ volatile u32 int_enable; /* XLB + 0x4c */
+ volatile u32 addr_capture; /* XLB + 0x50 */
+ volatile u32 bus_sig_capture; /* XLB + 0x54 */
+ volatile u32 addr_timeout; /* XLB + 0x58 */
+ volatile u32 data_timeout; /* XLB + 0x5c */
+ volatile u32 bus_act_timeout; /* XLB + 0x60 */
+ volatile u32 master_pri_enable; /* XLB + 0x64 */
+ volatile u32 master_priority; /* XLB + 0x68 */
+ volatile u32 base_address; /* XLB + 0x6c */
+ volatile u32 snoop_window; /* XLB + 0x70 */
+};
+
+
+/* Clock Distribution control */
+struct mpc52xx_cdm {
+ volatile u32 jtag_id; /* MBAR_CDM + 0x00 reg0 read only */
+ volatile u32 rstcfg; /* MBAR_CDM + 0x04 reg1 read only */
+ volatile u32 breadcrumb; /* MBAR_CDM + 0x08 reg2 */
+
+ volatile u8 mem_clk_sel; /* MBAR_CDM + 0x0c reg3 byte0 */
+ volatile u8 xlb_clk_sel; /* MBAR_CDM + 0x0d reg3 byte1 read only */
+ volatile u8 ipb_clk_sel; /* MBAR_CDM + 0x0e reg3 byte2 */
+ volatile u8 pci_clk_sel; /* MBAR_CDM + 0x0f reg3 byte3 */
+
+ volatile u8 ext_48mhz_en; /* MBAR_CDM + 0x10 reg4 byte0 */
+ volatile u8 fd_enable; /* MBAR_CDM + 0x11 reg4 byte1 */
+ volatile u16 fd_counters; /* MBAR_CDM + 0x12 reg4 byte2,3 */
+
+ volatile u32 clk_enables; /* MBAR_CDM + 0x14 reg5 */
+
+ volatile u8 osc_disable; /* MBAR_CDM + 0x18 reg6 byte0 */
+ volatile u8 reserved0[3]; /* MBAR_CDM + 0x19 reg6 byte1,2,3 */
+
+ volatile u8 ccs_sleep_enable;/* MBAR_CDM + 0x1c reg7 byte0 */
+ volatile u8 osc_sleep_enable;/* MBAR_CDM + 0x1d reg7 byte1 */
+ volatile u8 reserved1; /* MBAR_CDM + 0x1e reg7 byte2 */
+ volatile u8 ccs_qreq_test; /* MBAR_CDM + 0x1f reg7 byte3 */
+
+ volatile u8 soft_reset; /* MBAR_CDM + 0x20 u8 byte0 */
+ volatile u8 no_ckstp; /* MBAR_CDM + 0x21 u8 byte0 */
+ volatile u8 reserved2[2]; /* MBAR_CDM + 0x22 u8 byte1,2,3 */
+
+ volatile u8 pll_lock; /* MBAR_CDM + 0x24 reg9 byte0 */
+ volatile u8 pll_looselock; /* MBAR_CDM + 0x25 reg9 byte1 */
+ volatile u8 pll_sm_lockwin; /* MBAR_CDM + 0x26 reg9 byte2 */
+ volatile u8 reserved3; /* MBAR_CDM + 0x27 reg9 byte3 */
+
+ volatile u16 reserved4; /* MBAR_CDM + 0x28 reg10 byte0,1 */
+ volatile u16 mclken_div_psc1;/* MBAR_CDM + 0x2a reg10 byte2,3 */
+
+ volatile u16 reserved5; /* MBAR_CDM + 0x2c reg11 byte0,1 */
+ volatile u16 mclken_div_psc2;/* MBAR_CDM + 0x2e reg11 byte2,3 */
+
+ volatile u16 reserved6; /* MBAR_CDM + 0x30 reg12 byte0,1 */
+ volatile u16 mclken_div_psc3;/* MBAR_CDM + 0x32 reg12 byte2,3 */
+
+ volatile u16 reserved7; /* MBAR_CDM + 0x34 reg13 byte0,1 */
+ volatile u16 mclken_div_psc6;/* MBAR_CDM + 0x36 reg13 byte2,3 */
+};
+
+#endif /* __ASSEMBLY__ */
+
+
+/* ========================================================================= */
+/* Prototypes for MPC52xx syslib */
+/* ========================================================================= */
+
+#ifndef __ASSEMBLY__
+
+extern void mpc52xx_init_irq(void);
+extern int mpc52xx_get_irq(struct pt_regs *regs);
+
+extern unsigned long mpc52xx_find_end_of_memory(void);
+extern void mpc52xx_set_bat(void);
+extern void mpc52xx_map_io(void);
+extern void mpc52xx_restart(char *cmd);
+extern void mpc52xx_halt(void);
+extern void mpc52xx_power_off(void);
+extern void mpc52xx_progress(char *s, unsigned short hex);
+extern void mpc52xx_calibrate_decr(void);
+extern void mpc52xx_add_board_devices(struct ocp_def board_ocp[]);
+
+#endif /* __ASSEMBLY__ */
+
+
+/* ========================================================================= */
+/* Platform configuration */
+/* ========================================================================= */
+
+/* The U-Boot platform information struct */
+extern bd_t __res;
+
+/* Platform options */
+#if defined(CONFIG_LITE5200)
+#include <platforms/lite5200.h>
+#endif
+
+
+#endif /* __ASM_MPC52xx_H__ */
diff --git a/include/asm-ppc/mpc52xx_psc.h b/include/asm-ppc/mpc52xx_psc.h
new file mode 100644
index 000000000000..483102ea6aae
--- /dev/null
+++ b/include/asm-ppc/mpc52xx_psc.h
@@ -0,0 +1,191 @@
+/*
+ * include/asm-ppc/mpc52xx_psc.h
+ *
+ * Definitions of consts/structs to drive the Freescale MPC52xx OnChip
+ * PSCs. Theses are shared between multiple drivers since a PSC can be
+ * UART, AC97, IR, I2S, ... So this header is in asm-ppc.
+ *
+ *
+ * Maintainer : Sylvain Munaut <tnt@246tNt.com>
+ *
+ * Based/Extracted from some header of the 2.4 originally written by
+ * Dale Farnsworth <dfarnsworth@mvista.com>
+ *
+ * Copyright (C) 2004 Sylvain Munaut <tnt@246tNt.com>
+ * Copyright (C) 2003 MontaVista, Software, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#ifndef __MPC52xx_PSC_H__
+#define __MPC52xx_PSC_H__
+
+#include <asm/types.h>
+
+/* Max number of PSCs */
+#define MPC52xx_PSC_MAXNUM 6
+
+/* Programmable Serial Controller (PSC) status register bits */
+#define MPC52xx_PSC_SR_CDE 0x0080
+#define MPC52xx_PSC_SR_RXRDY 0x0100
+#define MPC52xx_PSC_SR_RXFULL 0x0200
+#define MPC52xx_PSC_SR_TXRDY 0x0400
+#define MPC52xx_PSC_SR_TXEMP 0x0800
+#define MPC52xx_PSC_SR_OE 0x1000
+#define MPC52xx_PSC_SR_PE 0x2000
+#define MPC52xx_PSC_SR_FE 0x4000
+#define MPC52xx_PSC_SR_RB 0x8000
+
+/* PSC Command values */
+#define MPC52xx_PSC_RX_ENABLE 0x0001
+#define MPC52xx_PSC_RX_DISABLE 0x0002
+#define MPC52xx_PSC_TX_ENABLE 0x0004
+#define MPC52xx_PSC_TX_DISABLE 0x0008
+#define MPC52xx_PSC_SEL_MODE_REG_1 0x0010
+#define MPC52xx_PSC_RST_RX 0x0020
+#define MPC52xx_PSC_RST_TX 0x0030
+#define MPC52xx_PSC_RST_ERR_STAT 0x0040
+#define MPC52xx_PSC_RST_BRK_CHG_INT 0x0050
+#define MPC52xx_PSC_START_BRK 0x0060
+#define MPC52xx_PSC_STOP_BRK 0x0070
+
+/* PSC TxRx FIFO status bits */
+#define MPC52xx_PSC_RXTX_FIFO_ERR 0x0040
+#define MPC52xx_PSC_RXTX_FIFO_UF 0x0020
+#define MPC52xx_PSC_RXTX_FIFO_OF 0x0010
+#define MPC52xx_PSC_RXTX_FIFO_FR 0x0008
+#define MPC52xx_PSC_RXTX_FIFO_FULL 0x0004
+#define MPC52xx_PSC_RXTX_FIFO_ALARM 0x0002
+#define MPC52xx_PSC_RXTX_FIFO_EMPTY 0x0001
+
+/* PSC interrupt mask bits */
+#define MPC52xx_PSC_IMR_TXRDY 0x0100
+#define MPC52xx_PSC_IMR_RXRDY 0x0200
+#define MPC52xx_PSC_IMR_DB 0x0400
+#define MPC52xx_PSC_IMR_IPC 0x8000
+
+/* PSC input port change bit */
+#define MPC52xx_PSC_CTS 0x01
+#define MPC52xx_PSC_DCD 0x02
+#define MPC52xx_PSC_D_CTS 0x10
+#define MPC52xx_PSC_D_DCD 0x20
+
+/* PSC mode fields */
+#define MPC52xx_PSC_MODE_5_BITS 0x00
+#define MPC52xx_PSC_MODE_6_BITS 0x01
+#define MPC52xx_PSC_MODE_7_BITS 0x02
+#define MPC52xx_PSC_MODE_8_BITS 0x03
+#define MPC52xx_PSC_MODE_BITS_MASK 0x03
+#define MPC52xx_PSC_MODE_PAREVEN 0x00
+#define MPC52xx_PSC_MODE_PARODD 0x04
+#define MPC52xx_PSC_MODE_PARFORCE 0x08
+#define MPC52xx_PSC_MODE_PARNONE 0x10
+#define MPC52xx_PSC_MODE_ERR 0x20
+#define MPC52xx_PSC_MODE_FFULL 0x40
+#define MPC52xx_PSC_MODE_RXRTS 0x80
+
+#define MPC52xx_PSC_MODE_ONE_STOP_5_BITS 0x00
+#define MPC52xx_PSC_MODE_ONE_STOP 0x07
+#define MPC52xx_PSC_MODE_TWO_STOP 0x0f
+
+#define MPC52xx_PSC_RFNUM_MASK 0x01ff
+
+
+/* Structure of the hardware registers */
+struct mpc52xx_psc {
+ volatile u8 mode; /* PSC + 0x00 */
+ volatile u8 reserved0[3];
+ union { /* PSC + 0x04 */
+ volatile u16 status;
+ volatile u16 clock_select;
+ } sr_csr;
+#define mpc52xx_psc_status sr_csr.status
+#define mpc52xx_psc_clock_select sr_csr.clock_select
+ volatile u16 reserved1;
+ volatile u8 command; /* PSC + 0x08 */
+volatile u8 reserved2[3];
+ union { /* PSC + 0x0c */
+ volatile u8 buffer_8;
+ volatile u16 buffer_16;
+ volatile u32 buffer_32;
+ } buffer;
+#define mpc52xx_psc_buffer_8 buffer.buffer_8
+#define mpc52xx_psc_buffer_16 buffer.buffer_16
+#define mpc52xx_psc_buffer_32 buffer.buffer_32
+ union { /* PSC + 0x10 */
+ volatile u8 ipcr;
+ volatile u8 acr;
+ } ipcr_acr;
+#define mpc52xx_psc_ipcr ipcr_acr.ipcr
+#define mpc52xx_psc_acr ipcr_acr.acr
+ volatile u8 reserved3[3];
+ union { /* PSC + 0x14 */
+ volatile u16 isr;
+ volatile u16 imr;
+ } isr_imr;
+#define mpc52xx_psc_isr isr_imr.isr
+#define mpc52xx_psc_imr isr_imr.imr
+ volatile u16 reserved4;
+ volatile u8 ctur; /* PSC + 0x18 */
+ volatile u8 reserved5[3];
+ volatile u8 ctlr; /* PSC + 0x1c */
+ volatile u8 reserved6[3];
+ volatile u16 ccr; /* PSC + 0x20 */
+ volatile u8 reserved7[14];
+ volatile u8 ivr; /* PSC + 0x30 */
+ volatile u8 reserved8[3];
+ volatile u8 ip; /* PSC + 0x34 */
+ volatile u8 reserved9[3];
+ volatile u8 op1; /* PSC + 0x38 */
+ volatile u8 reserved10[3];
+ volatile u8 op0; /* PSC + 0x3c */
+ volatile u8 reserved11[3];
+ volatile u32 sicr; /* PSC + 0x40 */
+ volatile u8 ircr1; /* PSC + 0x44 */
+ volatile u8 reserved13[3];
+ volatile u8 ircr2; /* PSC + 0x44 */
+ volatile u8 reserved14[3];
+ volatile u8 irsdr; /* PSC + 0x4c */
+ volatile u8 reserved15[3];
+ volatile u8 irmdr; /* PSC + 0x50 */
+ volatile u8 reserved16[3];
+ volatile u8 irfdr; /* PSC + 0x54 */
+ volatile u8 reserved17[3];
+ volatile u16 rfnum; /* PSC + 0x58 */
+ volatile u16 reserved18;
+ volatile u16 tfnum; /* PSC + 0x5c */
+ volatile u16 reserved19;
+ volatile u32 rfdata; /* PSC + 0x60 */
+ volatile u16 rfstat; /* PSC + 0x64 */
+ volatile u16 reserved20;
+ volatile u8 rfcntl; /* PSC + 0x68 */
+ volatile u8 reserved21[5];
+ volatile u16 rfalarm; /* PSC + 0x6e */
+ volatile u16 reserved22;
+ volatile u16 rfrptr; /* PSC + 0x72 */
+ volatile u16 reserved23;
+ volatile u16 rfwptr; /* PSC + 0x76 */
+ volatile u16 reserved24;
+ volatile u16 rflrfptr; /* PSC + 0x7a */
+ volatile u16 reserved25;
+ volatile u16 rflwfptr; /* PSC + 0x7e */
+ volatile u32 tfdata; /* PSC + 0x80 */
+ volatile u16 tfstat; /* PSC + 0x84 */
+ volatile u16 reserved26;
+ volatile u8 tfcntl; /* PSC + 0x88 */
+ volatile u8 reserved27[5];
+ volatile u16 tfalarm; /* PSC + 0x8e */
+ volatile u16 reserved28;
+ volatile u16 tfrptr; /* PSC + 0x92 */
+ volatile u16 reserved29;
+ volatile u16 tfwptr; /* PSC + 0x96 */
+ volatile u16 reserved30;
+ volatile u16 tflrfptr; /* PSC + 0x9a */
+ volatile u16 reserved31;
+ volatile u16 tflwfptr; /* PSC + 0x9e */
+};
+
+
+#endif /* __MPC52xx_PSC_H__ */
diff --git a/include/asm-ppc/ocp_ids.h b/include/asm-ppc/ocp_ids.h
index 5d4ad8a22906..91be19d2df7e 100644
--- a/include/asm-ppc/ocp_ids.h
+++ b/include/asm-ppc/ocp_ids.h
@@ -42,6 +42,7 @@
#define OCP_FUNC_16550 0x0031
#define OCP_FUNC_IIC 0x0032
#define OCP_FUNC_USB 0x0033
+#define OCP_FUNC_PSC_UART 0x0034
/* Memory devices 0x0090 - 0x009F */
#define OCP_FUNC_MAL 0x0090
diff --git a/include/asm-ppc/open_pic.h b/include/asm-ppc/open_pic.h
index df14f8650ab0..38d8edb1ba70 100644
--- a/include/asm-ppc/open_pic.h
+++ b/include/asm-ppc/open_pic.h
@@ -50,7 +50,7 @@ extern void do_openpic_setup_cpu(void);
extern int openpic_get_irq(struct pt_regs *regs);
extern void openpic_reset_processor_phys(u_int cpumask);
extern void openpic_setup_ISU(int isu_num, unsigned long addr);
-extern void openpic_cause_IPI(u_int ipi, u_int cpumask);
+extern void openpic_cause_IPI(u_int ipi, cpumask_t cpumask);
extern void smp_openpic_message_pass(int target, int msg, unsigned long data,
int wait);
extern void openpic_set_k2_cascade(int irq);
diff --git a/include/asm-ppc/ppcboot.h b/include/asm-ppc/ppcboot.h
index b60773a78385..ca2c16b8c347 100644
--- a/include/asm-ppc/ppcboot.h
+++ b/include/asm-ppc/ppcboot.h
@@ -55,6 +55,9 @@ typedef struct bd_info {
#if defined(CONFIG_8xx) || defined(CONFIG_CPM2) || defined(CONFIG_85xx)
unsigned long bi_immr_base; /* base of IMMR register */
#endif
+#if defined(CONFIG_PPC_MPC52xx)
+ unsigned long bi_mbar_base; /* base of internal registers */
+#endif
unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */
unsigned long bi_ip_addr; /* IP Address */
unsigned char bi_enetaddr[6]; /* Ethernet address */
@@ -67,6 +70,10 @@ typedef struct bd_info {
unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */
unsigned long bi_vco; /* VCO Out from PLL, in MHz */
#endif
+#if defined(CONFIG_PPC_MPC52xx)
+ unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */
+ unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */
+#endif
unsigned long bi_baudrate; /* Console Baudrate */
#if defined(CONFIG_405GP)
unsigned char bi_s_version[4]; /* Version of this structure */
diff --git a/include/asm-ppc/reg.h b/include/asm-ppc/reg.h
index 15c93af4079a..73eab4528eb9 100644
--- a/include/asm-ppc/reg.h
+++ b/include/asm-ppc/reg.h
@@ -350,7 +350,7 @@
#define DBAT6U SPRN_DBAT6U /* Data BAT 6 Upper Register */
#define DBAT7L SPRN_DBAT7L /* Data BAT 7 Lower Register */
#define DBAT7U SPRN_DBAT7U /* Data BAT 7 Upper Register */
-#define DEC SPRN_DEC /* Decrement Register */
+//#define DEC SPRN_DEC /* Decrement Register */
#define DMISS SPRN_DMISS /* Data TLB Miss Register */
#define DSISR SPRN_DSISR /* Data Storage Interrupt Status Register */
#define EAR SPRN_EAR /* External Address Register */
@@ -380,9 +380,9 @@
#define IMMR SPRN_IMMR /* PPC 860/821 Internal Memory Map Register */
#define L2CR SPRN_L2CR /* Classic PPC L2 cache control register */
#define L3CR SPRN_L3CR /* PPC 745x L3 cache control register */
-#define LR SPRN_LR
+//#define LR SPRN_LR
#define PVR SPRN_PVR /* Processor Version */
-#define RPA SPRN_RPA /* Required Physical Address Register */
+//#define RPA SPRN_RPA /* Required Physical Address Register */
#define SDR1 SPRN_SDR1 /* MMU hash base register */
#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */
#define SPR1 SPRN_SPRG1
@@ -489,6 +489,7 @@
#define SVR_8555E 0x80790000
#define SVR_8560 0x80700000
+#if 0
/* Segment Registers */
#define SR0 0
#define SR1 1
@@ -506,6 +507,7 @@
#define SR13 13
#define SR14 14
#define SR15 15
+#endif
/* Macros for setting and retrieving special purpose registers */
#ifndef __ASSEMBLY__
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index 108bec27db9b..580fcc148259 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -118,7 +118,11 @@ typedef struct {
#define SIG_SETMASK 2 /* for setting the signal mask */
/* Type of a signal handler. */
-typedef void (*__sighandler_t)(int);
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
@@ -128,13 +132,13 @@ struct old_sigaction {
__sighandler_t sa_handler;
old_sigset_t sa_mask;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestore_t sa_restorer;
};
struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
- void (*sa_restorer)(void);
+ __sigrestore_t sa_restorer;
sigset_t sa_mask; /* mask last for extensibility */
};
@@ -143,7 +147,7 @@ struct k_sigaction {
};
typedef struct sigaltstack {
- void *ss_sp;
+ void __user *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h
index 0a1a1a86a1de..b9d763e0d886 100644
--- a/include/asm-ppc/uaccess.h
+++ b/include/asm-ppc/uaccess.h
@@ -34,7 +34,8 @@
((addr) <= current->thread.fs.seg \
&& ((size) == 0 || (size) - 1 <= current->thread.fs.seg - (addr)))
-#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))
+#define access_ok(type, addr, size) \
+ (__chk_user_ptr(addr),__access_ok((unsigned long)(addr),(size)))
extern inline int verify_area(int type, const void __user * addr, unsigned long size)
{
@@ -105,6 +106,7 @@ extern long __put_user_bad(void);
#define __put_user_nocheck(x,ptr,size) \
({ \
long __pu_err; \
+ __chk_user_ptr(ptr); \
__put_user_size((x),(ptr),(size),__pu_err); \
__pu_err; \
})
@@ -112,7 +114,7 @@ extern long __put_user_bad(void);
#define __put_user_check(x,ptr,size) \
({ \
long __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
__put_user_size((x),__pu_addr,(size),__pu_err); \
__pu_err; \
@@ -179,6 +181,7 @@ do { \
#define __get_user_nocheck(x, ptr, size) \
({ \
long __gu_err, __gu_val; \
+ __chk_user_ptr(ptr); \
__get_user_size(__gu_val, (ptr), (size), __gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
@@ -188,6 +191,7 @@ do { \
({ \
long __gu_err; \
long long __gu_val; \
+ __chk_user_ptr(ptr); \
__get_user_size64(__gu_val, (ptr), (size), __gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
__gu_err; \
@@ -196,7 +200,7 @@ do { \
#define __get_user_check(x, ptr, size) \
({ \
long __gu_err = -EFAULT, __gu_val = 0; \
- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
+ const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ, __gu_addr, (size))) \
__get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
@@ -207,7 +211,7 @@ do { \
({ \
long __gu_err = -EFAULT; \
long long __gu_val = 0; \
- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
+ const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ, __gu_addr, (size))) \
__get_user_size64(__gu_val, __gu_addr, (size), __gu_err); \
(x) = (__typeof__(*(ptr)))__gu_val; \
diff --git a/include/asm-ppc/ucontext.h b/include/asm-ppc/ucontext.h
index 53da26040a0e..664bc984d51f 100644
--- a/include/asm-ppc/ucontext.h
+++ b/include/asm-ppc/ucontext.h
@@ -13,10 +13,10 @@ struct mcontext {
struct ucontext {
unsigned long uc_flags;
- struct ucontext *uc_link;
+ struct ucontext __user *uc_link;
stack_t uc_stack;
int uc_pad[7];
- struct mcontext *uc_regs; /* points to uc_mcontext field */
+ struct mcontext __user *uc_regs;/* points to uc_mcontext field */
sigset_t uc_sigmask;
/* glibc has 1024-bit signal masks, ours are 64-bit */
int uc_maskext[30];
diff --git a/include/asm-ppc64/hvcserver.h b/include/asm-ppc64/hvcserver.h
new file mode 100644
index 000000000000..cee9a14a2954
--- /dev/null
+++ b/include/asm-ppc64/hvcserver.h
@@ -0,0 +1,44 @@
+/*
+ * hvcserver.h
+ * Copyright (C) 2004 Ryan S Arnold, IBM Corporation
+ *
+ * PPC64 virtual I/O console server support.
+ *
+ * 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef _PPC64_HVCSERVER_H
+#define _PPC64_HVCSERVER_H
+
+#include <linux/list.h>
+
+/* Converged Location Code length */
+#define HVCS_CLC_LENGTH 79
+
+struct hvcs_partner_info {
+ struct list_head node;
+ unsigned int unit_address;
+ unsigned int partition_ID;
+ char location_code[HVCS_CLC_LENGTH + 1]; /* CLC + 1 null-term char */
+};
+
+extern int hvcs_free_partner_info(struct list_head *head);
+extern int hvcs_get_partner_info(unsigned int unit_address,
+ struct list_head *head, unsigned long *pi_buff);
+extern int hvcs_register_connection(unsigned int unit_address,
+ unsigned int p_partition_ID, unsigned int p_unit_address);
+extern int hvcs_free_connection(unsigned int unit_address);
+
+#endif /* _PPC64_HVCSERVER_H */
diff --git a/include/asm-ppc64/processor.h b/include/asm-ppc64/processor.h
index 341c9513a67c..d5e383732c5c 100644
--- a/include/asm-ppc64/processor.h
+++ b/include/asm-ppc64/processor.h
@@ -348,7 +348,7 @@
#define PVR SPRN_PVR /* Processor Version */
#define PIR SPRN_PIR /* Processor ID */
#define PURR SPRN_PURR /* Processor Utilization of Resource Register */
-#define RPA SPRN_RPA /* Required Physical Address Register */
+//#define RPA SPRN_RPA /* Required Physical Address Register */
#define SDR1 SPRN_SDR1 /* MMU hash base register */
#define SPR0 SPRN_SPRG0 /* Supervisor Private Registers */
#define SPR1 SPRN_SPRG1
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index fdc158a0c658..87db2ece007f 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -269,6 +269,7 @@ extern unsigned char *get_property(struct device_node *node, const char *name,
extern void print_properties(struct device_node *node);
extern int prom_n_addr_cells(struct device_node* np);
extern int prom_n_size_cells(struct device_node* np);
+extern int prom_n_intr_cells(struct device_node* np);
extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
extern void prom_add_property(struct device_node* np, struct property* prop);
diff --git a/include/asm-ppc64/uaccess.h b/include/asm-ppc64/uaccess.h
index 4d2d6097802b..77906c9354dd 100644
--- a/include/asm-ppc64/uaccess.h
+++ b/include/asm-ppc64/uaccess.h
@@ -175,7 +175,7 @@ do { \
#define __get_user_check(x,ptr,size) \
({ \
long __gu_err = -EFAULT, __gu_val = 0; \
- const __typeof__(*(ptr)) *__gu_addr = (ptr); \
+ const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \
if (access_ok(VERIFY_READ,__gu_addr,size)) \
__get_user_size(__gu_val,__gu_addr,(size),__gu_err,-EFAULT);\
(x) = (__typeof__(*(ptr)))__gu_val; \
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h
index fc103cedbcde..560f4fd99e21 100644
--- a/include/asm-ppc64/xics.h
+++ b/include/asm-ppc64/xics.h
@@ -19,6 +19,9 @@ int xics_get_irq(struct pt_regs *);
void xics_setup_cpu(void);
void xics_cause_IPI(int cpu);
+/* first argument is ignored for now*/
+void pSeriesLP_cppr_info(int n_cpu, u8 value);
+
struct xics_ipi_struct {
volatile unsigned long value;
} ____cacheline_aligned;
diff --git a/include/asm-sparc/pci.h b/include/asm-sparc/pci.h
index 623c068659ee..1c2204c9a120 100644
--- a/include/asm-sparc/pci.h
+++ b/include/asm-sparc/pci.h
@@ -154,6 +154,13 @@ static inline void pcibios_add_platform_entries(struct pci_dev *dev)
{
}
+#define PCI_DMA_ERROR_CODE (~(dma_addr_t)0x0)
+
+static inline int pci_dma_mapping_error(dma_addr_t dma_addr)
+{
+ return (dma_addr == PCI_DMA_ERROR_CODE);
+}
+
#endif /* __KERNEL__ */
/* generic pci stuff */
diff --git a/include/asm-sparc64/openpromio.h b/include/asm-sparc64/openpromio.h
index 555b3b5b115f..a5b88e9d9987 100644
--- a/include/asm-sparc64/openpromio.h
+++ b/include/asm-sparc64/openpromio.h
@@ -52,9 +52,9 @@ struct opiocdesc
{
int op_nodeid; /* PROM Node ID (value-result) */
int op_namelen; /* Length of op_name. */
- char *op_name; /* Pointer to the property name. */
+ char __user *op_name; /* Pointer to the property name. */
int op_buflen; /* Length of op_buf (value-result) */
- char *op_buf; /* Pointer to buffer. */
+ char __user *op_buf; /* Pointer to buffer. */
};
#define OPIOCGET _IOWR('O', 1, struct opiocdesc)
diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h
index 7e5459fa45ff..fde85211a008 100644
--- a/include/asm-sparc64/siginfo.h
+++ b/include/asm-sparc64/siginfo.h
@@ -14,8 +14,11 @@
#ifdef __KERNEL__
+#include <linux/config.h>
#include <linux/compat.h>
+#ifdef CONFIG_COMPAT
+
typedef union sigval32 {
int sival_int;
u32 sival_ptr;
@@ -72,6 +75,7 @@ typedef struct siginfo32 {
} _sigpoll;
} _sifields;
} siginfo_t32;
+#endif /* CONFIG_COMPAT */
#endif /* __KERNEL__ */
@@ -85,6 +89,8 @@ typedef struct siginfo32 {
#ifdef __KERNEL__
+#ifdef CONFIG_COMPAT
+
typedef struct sigevent32 {
sigval_t32 sigev_value;
int sigev_signo;
@@ -101,6 +107,8 @@ typedef struct sigevent32 {
extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from);
+#endif /* CONFIG_COMPAT */
+
#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-sparc64/signal.h b/include/asm-sparc64/signal.h
index de2bb39b8b59..6428e366c38c 100644
--- a/include/asm-sparc64/signal.h
+++ b/include/asm-sparc64/signal.h
@@ -6,6 +6,7 @@
#ifdef __KERNEL__
#ifndef __ASSEMBLY__
+#include <linux/config.h>
#include <linux/personality.h>
#include <linux/types.h>
#include <linux/compat.h>
@@ -208,12 +209,15 @@ struct __new_sigaction {
};
#ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
struct __new_sigaction32 {
unsigned sa_handler;
unsigned int sa_flags;
unsigned sa_restorer; /* not used by Linux/SPARC yet */
compat_sigset_t sa_mask;
};
+#endif
struct k_sigaction {
struct __new_sigaction sa;
@@ -229,6 +233,8 @@ struct __old_sigaction {
};
#ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
struct __old_sigaction32 {
unsigned sa_handler;
compat_old_sigset_t sa_mask;
@@ -237,6 +243,8 @@ struct __old_sigaction32 {
};
#endif
+#endif
+
typedef struct sigaltstack {
void __user *ss_sp;
int ss_flags;
@@ -244,11 +252,14 @@ typedef struct sigaltstack {
} stack_t;
#ifdef __KERNEL__
+
+#ifdef CONFIG_COMPAT
typedef struct sigaltstack32 {
u32 ss_sp;
int ss_flags;
compat_size_t ss_size;
} stack_t32;
+#endif
struct signal_deliver_cookie {
int restart_syscall;
diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h
index 677134344233..2b454ef67782 100644
--- a/include/asm-sparc64/ttable.h
+++ b/include/asm-sparc64/ttable.h
@@ -123,7 +123,11 @@
#else
#define SUNOS_SYSCALL_TRAP TRAP(sunos_syscall)
#endif
+#ifdef CONFIG_COMPAT
#define LINUX_32BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall32, sys_call_table32)
+#else
+#define LINUX_32BIT_SYSCALL_TRAP BTRAP(0x110)
+#endif
#define LINUX_64BIT_SYSCALL_TRAP SYSCALL_TRAP(linux_sparc_syscall, sys_call_table64)
#define GETCC_TRAP TRAP(getcc)
#define SETCC_TRAP TRAP(setcc)
diff --git a/include/asm-v850/bitops.h b/include/asm-v850/bitops.h
index b60bd23981ca..7c4ecaf5151c 100644
--- a/include/asm-v850/bitops.h
+++ b/include/asm-v850/bitops.h
@@ -267,6 +267,12 @@ found_middle:
return result + generic_ffs_for_find_next_bit(tmp);
}
+/*
+ * find_first_bit - find the first set bit in a memory region
+ */
+#define find_first_bit(addr, size) \
+ find_next_bit((addr), (size), 0)
+
#define ffs(x) generic_ffs (x)
#define fls(x) generic_fls (x)
diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86_64/mpspec.h
index 219d40acd489..2768b7c83ef6 100644
--- a/include/asm-x86_64/mpspec.h
+++ b/include/asm-x86_64/mpspec.h
@@ -166,7 +166,7 @@ enum mp_bustype {
};
extern unsigned char mp_bus_id_to_type [MAX_MP_BUSSES];
extern int mp_bus_id_to_pci_bus [MAX_MP_BUSSES];
-extern cpumask_t mp_bus_to_cpumask [MAX_MP_BUSSES];
+extern cpumask_t pci_bus_to_cpumask [256];
extern unsigned int boot_cpu_physical_apicid;
extern int smp_found_config;
diff --git a/include/asm-x86_64/topology.h b/include/asm-x86_64/topology.h
index 9310f9a1c1c5..dbc3f15792bd 100644
--- a/include/asm-x86_64/topology.h
+++ b/include/asm-x86_64/topology.h
@@ -22,9 +22,9 @@ extern cpumask_t node_to_cpumask[];
static inline cpumask_t pcibus_to_cpumask(int bus)
{
- cpumask_t tmp;
- cpus_and(tmp, mp_bus_to_cpumask[bus], cpu_online_map);
- return tmp;
+ cpumask_t res;
+ cpus_and(res, pci_bus_to_cpumask[bus], cpu_online_map);
+ return res;
}
#define NODE_BALANCE_RATE 30 /* CHECKME */
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h
index ed4dc1cca10a..ba3d49d8a888 100644
--- a/include/asm-x86_64/uaccess.h
+++ b/include/asm-x86_64/uaccess.h
@@ -148,7 +148,7 @@ extern void __put_user_bad(void);
#define __put_user_check(x,ptr,size) \
({ \
int __pu_err = -EFAULT; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \
if (likely(access_ok(VERIFY_WRITE,__pu_addr,size))) \
__put_user_size((x),__pu_addr,(size),__pu_err); \
__pu_err; \
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 7a99d7ee2f89..4b6d0e417c4e 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -209,8 +209,8 @@ struct ata_taskfile {
#define ata_id_has_lba48(dev) ((dev)->id[83] & (1 << 10))
#define ata_id_has_wcache(dev) ((dev)->id[82] & (1 << 5))
#define ata_id_has_pm(dev) ((dev)->id[82] & (1 << 3))
-#define ata_id_has_lba(dev) ((dev)->id[49] & (1 << 8))
-#define ata_id_has_dma(dev) ((dev)->id[49] & (1 << 9))
+#define ata_id_has_lba(dev) ((dev)->id[49] & (1 << 9))
+#define ata_id_has_dma(dev) ((dev)->id[49] & (1 << 8))
#define ata_id_removeable(dev) ((dev)->id[0] & (1 << 7))
#define ata_id_u32(dev,n) \
(((u32) (dev)->id[(n) + 1] << 16) | ((u32) (dev)->id[(n)]))
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index b19303d3fa6b..ad454dadd221 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -147,7 +147,7 @@ struct atm_dev_stats {
struct atm_iobuf {
int length;
- void *buffer;
+ void __user *buffer;
};
/* for ATM_GETCIRANGE / ATM_SETCIRANGE */
diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h
index dd6b349a040a..f267f2442766 100644
--- a/include/linux/atmlec.h
+++ b/include/linux/atmlec.h
@@ -2,7 +2,7 @@
*
* ATM Lan Emulation Daemon vs. driver interface
*
- * carnil@cs.tut.fi
+ * mkiiskila@yahoo.com
*
*/
diff --git a/include/linux/elf.h b/include/linux/elf.h
index f8115ac02b51..8d0dd82cc392 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -4,6 +4,13 @@
#include <linux/types.h>
#include <asm/elf.h>
+#ifndef elf_read_implies_exec
+ /* Executables for which elf_read_implies_exec() returns TRUE will
+ have the READ_IMPLIES_EXEC personality flag set automatically.
+ Override in asm/elf.h as needed. */
+# define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
+#endif
+
/* 32-bit ELF base types. */
typedef __u32 Elf32_Addr;
typedef __u16 Elf32_Half;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 819e67e3a95b..7f64f2b2cada 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -356,6 +356,7 @@ struct block_device {
struct block_device * bd_contains;
unsigned bd_block_size;
struct hd_struct * bd_part;
+ /* number of times partitions within this device have been opened. */
unsigned bd_part_count;
int bd_invalidated;
struct gendisk * bd_disk;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 91443522b9d8..884d18df6716 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -82,7 +82,8 @@ struct disk_stats {
struct gendisk {
int major; /* major number of driver */
int first_minor;
- int minors;
+ int minors; /* maximum number of minors, =1 for
+ * disks that can't be partitioned. */
char disk_name[32]; /* name of major driver */
struct hd_struct **part; /* [indexed by minor] */
struct block_device_operations *fops;
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h
index 91e49f83268c..4a448922be5b 100644
--- a/include/linux/ipmi.h
+++ b/include/linux/ipmi.h
@@ -159,6 +159,14 @@ struct ipmi_msg
unsigned char netfn;
unsigned char cmd;
unsigned short data_len;
+ unsigned char __user *data;
+};
+
+struct kernel_ipmi_msg
+{
+ unsigned char netfn;
+ unsigned char cmd;
+ unsigned short data_len;
unsigned char *data;
};
@@ -223,7 +231,7 @@ struct ipmi_recv_msg
ipmi_user_t user;
struct ipmi_addr addr;
long msgid;
- struct ipmi_msg msg;
+ struct kernel_ipmi_msg msg;
/* The user_msg_data is the data supplied when a message was
sent, if this is a response to a sent message. If this is
@@ -316,7 +324,7 @@ unsigned char ipmi_get_my_LUN(ipmi_user_t user);
int ipmi_request(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
- struct ipmi_msg *msg,
+ struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority);
@@ -336,7 +344,7 @@ int ipmi_request(ipmi_user_t user,
int ipmi_request_settime(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
- struct ipmi_msg *msg,
+ struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority,
int max_retries,
@@ -348,7 +356,7 @@ int ipmi_request_settime(ipmi_user_t user,
int ipmi_request_with_source(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
- struct ipmi_msg *msg,
+ struct kernel_ipmi_msg *msg,
void *user_msg_data,
int priority,
unsigned char source_address,
@@ -366,7 +374,7 @@ int ipmi_request_with_source(ipmi_user_t user,
int ipmi_request_supply_msgs(ipmi_user_t user,
struct ipmi_addr *addr,
long msgid,
- struct ipmi_msg *msg,
+ struct kernel_ipmi_msg *msg,
void *user_msg_data,
void *supplied_smi,
struct ipmi_recv_msg *supplied_recv,
diff --git a/include/linux/list.h b/include/linux/list.h
index 9e0c971ded6f..92127ae0e995 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -620,13 +620,12 @@ static inline void hlist_add_after(struct hlist_node *n,
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
-/* Cannot easily do prefetch unfortunately */
#define hlist_for_each(pos, head) \
for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
pos = pos->next)
#define hlist_for_each_safe(pos, n, head) \
- for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
+ for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
pos = n)
/**
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 2cbfea5dd5e5..8958b0e6af06 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -345,6 +345,15 @@ static inline struct zone *next_zone(struct zone *zone)
#define for_each_zone(zone) \
for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone))
+static inline int is_highmem_idx(int idx)
+{
+ return (idx == ZONE_HIGHMEM);
+}
+
+static inline int is_normal_idx(int idx)
+{
+ return (idx == ZONE_NORMAL);
+}
/**
* is_highmem - helper function to quickly check if a struct zone is a
* highmem zone or not. This is an attempt to keep references
@@ -353,12 +362,12 @@ static inline struct zone *next_zone(struct zone *zone)
*/
static inline int is_highmem(struct zone *zone)
{
- return (zone - zone->zone_pgdat->node_zones == ZONE_HIGHMEM);
+ return (is_highmem_idx(zone - zone->zone_pgdat->node_zones));
}
static inline int is_normal(struct zone *zone)
{
- return (zone - zone->zone_pgdat->node_zones == ZONE_NORMAL);
+ return (is_normal_idx(zone - zone->zone_pgdat->node_zones));
}
/* These two functions are used to setup the per zone pages min values */
diff --git a/include/linux/net.h b/include/linux/net.h
index a4684166dc0c..cec1482f28e2 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -142,6 +142,7 @@ struct net_proto_family {
};
struct iovec;
+struct kvec;
extern int sock_wake_async(struct socket *sk, int how, int band);
extern int sock_register(struct net_proto_family *fam);
@@ -169,6 +170,12 @@ extern int net_ratelimit(void);
extern unsigned long net_random(void);
extern void net_srandom(unsigned long);
+extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
+ struct kvec *vec, size_t num, size_t len);
+extern int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
+ struct kvec *vec, size_t num,
+ size_t len, int flags);
+
#ifndef CONFIG_SMP
#define SOCKOPS_WRAPPED(name) name
#define SOCKOPS_WRAP(name, fam)
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index 25d2c099e51e..cfffc76fc1e1 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -33,7 +33,7 @@ struct svc_cacherep {
u32 c_vers;
unsigned long c_timestamp;
union {
- struct iovec u_vec;
+ struct kvec u_vec;
u32 u_status;
} c_u;
};
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 520f00b1e8c3..5757370b0a23 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -92,9 +92,9 @@ int nfsd_open(struct svc_rqst *, struct svc_fh *, int,
int, struct file *);
void nfsd_close(struct file *);
int nfsd_read(struct svc_rqst *, struct svc_fh *,
- loff_t, struct iovec *,int, unsigned long *);
+ loff_t, struct kvec *,int, unsigned long *);
int nfsd_write(struct svc_rqst *, struct svc_fh *,
- loff_t, struct iovec *,int, unsigned long, int *);
+ loff_t, struct kvec *,int, unsigned long, int *);
int nfsd_readlink(struct svc_rqst *, struct svc_fh *,
char *, int *);
int nfsd_symlink(struct svc_rqst *, struct svc_fh *,
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index 0164bd1fc109..ecccef777dae 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -30,7 +30,7 @@ struct nfsd_readargs {
struct svc_fh fh;
__u32 offset;
__u32 count;
- struct iovec vec[RPCSVC_MAXPAGES];
+ struct kvec vec[RPCSVC_MAXPAGES];
int vlen;
};
@@ -38,7 +38,7 @@ struct nfsd_writeargs {
svc_fh fh;
__u32 offset;
int len;
- struct iovec vec[RPCSVC_MAXPAGES];
+ struct kvec vec[RPCSVC_MAXPAGES];
int vlen;
};
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 13afff34607f..0ae9e0ef5f68 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -33,7 +33,7 @@ struct nfsd3_readargs {
struct svc_fh fh;
__u64 offset;
__u32 count;
- struct iovec vec[RPCSVC_MAXPAGES];
+ struct kvec vec[RPCSVC_MAXPAGES];
int vlen;
};
@@ -43,7 +43,7 @@ struct nfsd3_writeargs {
__u32 count;
int stable;
int len;
- struct iovec vec[RPCSVC_MAXPAGES];
+ struct kvec vec[RPCSVC_MAXPAGES];
int vlen;
};
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 9201a4763d17..ff18ed764958 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -241,7 +241,7 @@ struct nfsd4_read {
stateid_t rd_stateid; /* request */
u64 rd_offset; /* request */
u32 rd_length; /* request */
- struct iovec rd_iov[RPCSVC_MAXPAGES];
+ struct kvec rd_iov[RPCSVC_MAXPAGES];
int rd_vlen;
struct svc_rqst *rd_rqstp; /* response */
@@ -324,7 +324,7 @@ struct nfsd4_write {
u64 wr_offset; /* request */
u32 wr_stable_how; /* request */
u32 wr_buflen; /* request */
- struct iovec wr_vec[RPCSVC_MAXPAGES]; /* request */
+ struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */
int wr_vlen;
u32 wr_bytes_written; /* response */
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 14b91221d3e8..9b009b6754f6 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -30,6 +30,7 @@ extern int abi_fake_utsname;
*/
enum {
MMAP_PAGE_ZERO = 0x0100000,
+ READ_IMPLIES_EXEC = 0x0400000,
ADDR_LIMIT_32BIT = 0x0800000,
SHORT_INODE = 0x1000000,
WHOLE_SECONDS = 0x2000000,
@@ -38,6 +39,12 @@ enum {
};
/*
+ * Security-relevant compatibility flags that must be
+ * cleared upon setuid or setgid exec:
+ */
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC)
+
+/*
* Personality types.
*
* These go in the low byte. Avoid using the top bit, it will
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index ad6b8bd97822..1784fb0a9369 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -630,8 +630,8 @@ static inline loff_t le_ih_k_type (const struct item_head * ih)
static inline void set_le_key_k_offset (int version, struct key * key, loff_t offset)
{
(version == KEY_FORMAT_3_5) ?
- (key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
- (set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
+ (void)(key->u.k_offset_v1.k_offset = cpu_to_le32 (offset)) : /* jdm check */
+ (void)(set_offset_v2_k_offset( &(key->u.k_offset_v2), offset ));
}
@@ -644,8 +644,8 @@ static inline void set_le_ih_k_offset (struct item_head * ih, loff_t offset)
static inline void set_le_key_k_type (int version, struct key * key, int type)
{
(version == KEY_FORMAT_3_5) ?
- (key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
- (set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
+ (void)(key->u.k_offset_v1.k_uniqueness = cpu_to_le32(type2uniqueness(type))):
+ (void)(set_offset_v2_k_type( &(key->u.k_offset_v2), type ));
}
static inline void set_le_ih_k_type (struct item_head * ih, int type)
{
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4dcbe972d5b5..e752fed52204 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -410,6 +410,10 @@ struct task_struct {
unsigned int time_slice, first_time_slice;
struct list_head tasks;
+ /*
+ * ptrace_list/ptrace_children forms the list of my children
+ * that were stolen by a ptracer.
+ */
struct list_head ptrace_children;
struct list_head ptrace_list;
@@ -431,6 +435,10 @@ struct task_struct {
*/
struct task_struct *real_parent; /* real parent process (when being debugged) */
struct task_struct *parent; /* parent process */
+ /*
+ * children/sibling forms the list of my children plus the
+ * tasks I'm ptracing.
+ */
struct list_head children; /* list of my children */
struct list_head sibling; /* linkage in my parent's children list */
struct task_struct *group_leader; /* threadgroup leader */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 1ad37531b7ad..e7e8bb92aa32 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -86,6 +86,9 @@
/* PPC CPM type number */
#define PORT_CPM 58
+/* MPC52xx type numbers */
+#define PORT_MPC52xx 59
+
#ifdef __KERNEL__
#include <linux/config.h>
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
new file mode 100644
index 000000000000..4db25d5c7cd1
--- /dev/null
+++ b/include/linux/snmp.h
@@ -0,0 +1,266 @@
+/*
+ * Definitions for MIBs
+ *
+ * Author: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
+ */
+
+#ifndef _LINUX_SNMP_H
+#define _LINUX_SNMP_H
+
+/* ipstats mib definitions */
+/*
+ * RFC 1213: MIB-II
+ * RFC 2011 (updates 1213): SNMPv2-MIB-IP
+ * RFC 2863: Interfaces Group MIB
+ * RFC 2465: IPv6 MIB: General Group
+ * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ */
+enum
+{
+ IPSTATS_MIB_NUM = 0,
+ IPSTATS_MIB_INRECEIVES, /* InReceives */
+ IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */
+ IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */
+ IPSTATS_MIB_INNOROUTES, /* InNoRoutes */
+ IPSTATS_MIB_INADDRERRORS, /* InAddrErrors */
+ IPSTATS_MIB_INUNKNOWNPROTOS, /* InUnknownProtos */
+ IPSTATS_MIB_INTRUNCATEDPKTS, /* InTruncatedPkts */
+ IPSTATS_MIB_INDISCARDS, /* InDiscards */
+ IPSTATS_MIB_INDELIVERS, /* InDelivers */
+ IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */
+ IPSTATS_MIB_OUTREQUESTS, /* OutRequests */
+ IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */
+ IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */
+ IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */
+ IPSTATS_MIB_REASMREQDS, /* ReasmReqds */
+ IPSTATS_MIB_REASMOKS, /* ReasmOKs */
+ IPSTATS_MIB_REASMFAILS, /* ReasmFails */
+ IPSTATS_MIB_FRAGOKS, /* FragOKs */
+ IPSTATS_MIB_FRAGFAILS, /* FragFails */
+ IPSTATS_MIB_FRAGCREATES, /* FragCreates */
+ IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */
+ IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */
+ __IPSTATS_MIB_MAX
+};
+
+/* icmp mib definitions */
+/*
+ * RFC 1213: MIB-II ICMP Group
+ * RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
+ */
+enum
+{
+ ICMP_MIB_NUM = 0,
+ ICMP_MIB_INMSGS, /* InMsgs */
+ ICMP_MIB_INERRORS, /* InErrors */
+ ICMP_MIB_INDESTUNREACHS, /* InDestUnreachs */
+ ICMP_MIB_INTIMEEXCDS, /* InTimeExcds */
+ ICMP_MIB_INPARMPROBS, /* InParmProbs */
+ ICMP_MIB_INSRCQUENCHS, /* InSrcQuenchs */
+ ICMP_MIB_INREDIRECTS, /* InRedirects */
+ ICMP_MIB_INECHOS, /* InEchos */
+ ICMP_MIB_INECHOREPS, /* InEchoReps */
+ ICMP_MIB_INTIMESTAMPS, /* InTimestamps */
+ ICMP_MIB_INTIMESTAMPREPS, /* InTimestampReps */
+ ICMP_MIB_INADDRMASKS, /* InAddrMasks */
+ ICMP_MIB_INADDRMASKREPS, /* InAddrMaskReps */
+ ICMP_MIB_OUTMSGS, /* OutMsgs */
+ ICMP_MIB_OUTERRORS, /* OutErrors */
+ ICMP_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
+ ICMP_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
+ ICMP_MIB_OUTPARMPROBS, /* OutParmProbs */
+ ICMP_MIB_OUTSRCQUENCHS, /* OutSrcQuenchs */
+ ICMP_MIB_OUTREDIRECTS, /* OutRedirects */
+ ICMP_MIB_OUTECHOS, /* OutEchos */
+ ICMP_MIB_OUTECHOREPS, /* OutEchoReps */
+ ICMP_MIB_OUTTIMESTAMPS, /* OutTimestamps */
+ ICMP_MIB_OUTTIMESTAMPREPS, /* OutTimestampReps */
+ ICMP_MIB_OUTADDRMASKS, /* OutAddrMasks */
+ ICMP_MIB_OUTADDRMASKREPS, /* OutAddrMaskReps */
+ __ICMP_MIB_MAX
+};
+
+/* icmp6 mib definitions */
+/*
+ * RFC 2466: ICMPv6-MIB
+ */
+enum
+{
+ ICMP6_MIB_NUM = 0,
+ ICMP6_MIB_INMSGS, /* InMsgs */
+ ICMP6_MIB_INERRORS, /* InErrors */
+ ICMP6_MIB_INDESTUNREACHS, /* InDestUnreachs */
+ ICMP6_MIB_INPKTTOOBIGS, /* InPktTooBigs */
+ ICMP6_MIB_INTIMEEXCDS, /* InTimeExcds */
+ ICMP6_MIB_INPARMPROBLEMS, /* InParmProblems */
+ ICMP6_MIB_INECHOS, /* InEchos */
+ ICMP6_MIB_INECHOREPLIES, /* InEchoReplies */
+ ICMP6_MIB_INGROUPMEMBQUERIES, /* InGroupMembQueries */
+ ICMP6_MIB_INGROUPMEMBRESPONSES, /* InGroupMembResponses */
+ ICMP6_MIB_INGROUPMEMBREDUCTIONS, /* InGroupMembReductions */
+ ICMP6_MIB_INROUTERSOLICITS, /* InRouterSolicits */
+ ICMP6_MIB_INROUTERADVERTISEMENTS, /* InRouterAdvertisements */
+ ICMP6_MIB_INNEIGHBORSOLICITS, /* InNeighborSolicits */
+ ICMP6_MIB_INNEIGHBORADVERTISEMENTS, /* InNeighborAdvertisements */
+ ICMP6_MIB_INREDIRECTS, /* InRedirects */
+ ICMP6_MIB_OUTMSGS, /* OutMsgs */
+ ICMP6_MIB_OUTDESTUNREACHS, /* OutDestUnreachs */
+ ICMP6_MIB_OUTPKTTOOBIGS, /* OutPktTooBigs */
+ ICMP6_MIB_OUTTIMEEXCDS, /* OutTimeExcds */
+ ICMP6_MIB_OUTPARMPROBLEMS, /* OutParmProblems */
+ ICMP6_MIB_OUTECHOREPLIES, /* OutEchoReplies */
+ ICMP6_MIB_OUTROUTERSOLICITS, /* OutRouterSolicits */
+ ICMP6_MIB_OUTNEIGHBORSOLICITS, /* OutNeighborSolicits */
+ ICMP6_MIB_OUTNEIGHBORADVERTISEMENTS, /* OutNeighborAdvertisements */
+ ICMP6_MIB_OUTREDIRECTS, /* OutRedirects */
+ ICMP6_MIB_OUTGROUPMEMBRESPONSES, /* OutGroupMembResponses */
+ ICMP6_MIB_OUTGROUPMEMBREDUCTIONS, /* OutGroupMembReductions */
+ __ICMP6_MIB_MAX
+};
+
+/* tcp mib definitions */
+/*
+ * RFC 1213: MIB-II TCP group
+ * RFC 2012 (updates 1213): SNMPv2-MIB-TCP
+ */
+enum
+{
+ TCP_MIB_NUM = 0,
+ TCP_MIB_RTOALGORITHM, /* RtoAlgorithm */
+ TCP_MIB_RTOMIN, /* RtoMin */
+ TCP_MIB_RTOMAX, /* RtoMax */
+ TCP_MIB_MAXCONN, /* MaxConn */
+ TCP_MIB_ACTIVEOPENS, /* ActiveOpens */
+ TCP_MIB_PASSIVEOPENS, /* PassiveOpens */
+ TCP_MIB_ATTEMPTFAILS, /* AttemptFails */
+ TCP_MIB_ESTABRESETS, /* EstabResets */
+ TCP_MIB_CURRESTAB, /* CurrEstab */
+ TCP_MIB_INSEGS, /* InSegs */
+ TCP_MIB_OUTSEGS, /* OutSegs */
+ TCP_MIB_RETRANSSEGS, /* RetransSegs */
+ TCP_MIB_INERRS, /* InErrs */
+ TCP_MIB_OUTRSTS, /* OutRsts */
+ __TCP_MIB_MAX
+};
+
+/* udp mib definitions */
+/*
+ * RFC 1213: MIB-II UDP group
+ * RFC 2013 (updates 1213): SNMPv2-MIB-UDP
+ */
+enum
+{
+ UDP_MIB_NUM = 0,
+ UDP_MIB_INDATAGRAMS, /* InDatagrams */
+ UDP_MIB_NOPORTS, /* NoPorts */
+ UDP_MIB_INERRORS, /* InErrors */
+ UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
+ __UDP_MIB_MAX
+};
+
+/* sctp mib definitions */
+/*
+ * draft-ietf-sigtran-sctp-mib-07.txt
+ */
+enum
+{
+ SCTP_MIB_NUM = 0,
+ SCTP_MIB_CURRESTAB, /* CurrEstab */
+ SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */
+ SCTP_MIB_PASSIVEESTABS, /* PassiveEstabs */
+ SCTP_MIB_ABORTEDS, /* Aborteds */
+ SCTP_MIB_SHUTDOWNS, /* Shutdowns */
+ SCTP_MIB_OUTOFBLUES, /* OutOfBlues */
+ SCTP_MIB_CHECKSUMERRORS, /* ChecksumErrors */
+ SCTP_MIB_OUTCTRLCHUNKS, /* OutCtrlChunks */
+ SCTP_MIB_OUTORDERCHUNKS, /* OutOrderChunks */
+ SCTP_MIB_OUTUNORDERCHUNKS, /* OutUnorderChunks */
+ SCTP_MIB_INCTRLCHUNKS, /* InCtrlChunks */
+ SCTP_MIB_INORDERCHUNKS, /* InOrderChunks */
+ SCTP_MIB_INUNORDERCHUNKS, /* InUnorderChunks */
+ SCTP_MIB_FRAGUSRMSGS, /* FragUsrMsgs */
+ SCTP_MIB_REASMUSRMSGS, /* ReasmUsrMsgs */
+ SCTP_MIB_OUTSCTPPACKS, /* OutSCTPPacks */
+ SCTP_MIB_INSCTPPACKS, /* InSCTPPacks */
+ SCTP_MIB_RTOALGORITHM, /* RtoAlgorithm */
+ SCTP_MIB_RTOMIN, /* RtoMin */
+ SCTP_MIB_RTOMAX, /* RtoMax */
+ SCTP_MIB_RTOINITIAL, /* RtoInitial */
+ SCTP_MIB_VALCOOKIELIFE, /* ValCookieLife */
+ SCTP_MIB_MAXINITRETR, /* MaxInitRetr */
+ __SCTP_MIB_MAX
+};
+
+/* linux mib definitions */
+enum
+{
+ LINUX_MIB_NUM = 0,
+ LINUX_MIB_SYNCOOKIESSENT, /* SyncookiesSent */
+ LINUX_MIB_SYNCOOKIESRECV, /* SyncookiesRecv */
+ LINUX_MIB_SYNCOOKIESFAILED, /* SyncookiesFailed */
+ LINUX_MIB_EMBRYONICRSTS, /* EmbryonicRsts */
+ LINUX_MIB_PRUNECALLED, /* PruneCalled */
+ LINUX_MIB_RCVPRUNED, /* RcvPruned */
+ LINUX_MIB_OFOPRUNED, /* OfoPruned */
+ LINUX_MIB_OUTOFWINDOWICMPS, /* OutOfWindowIcmps */
+ LINUX_MIB_LOCKDROPPEDICMPS, /* LockDroppedIcmps */
+ LINUX_MIB_ARPFILTER, /* ArpFilter */
+ LINUX_MIB_TIMEWAITED, /* TimeWaited */
+ LINUX_MIB_TIMEWAITRECYCLED, /* TimeWaitRecycled */
+ LINUX_MIB_TIMEWAITKILLED, /* TimeWaitKilled */
+ LINUX_MIB_PAWSPASSIVEREJECTED, /* PAWSPassiveRejected */
+ LINUX_MIB_PAWSACTIVEREJECTED, /* PAWSActiveRejected */
+ LINUX_MIB_PAWSESTABREJECTED, /* PAWSEstabRejected */
+ LINUX_MIB_DELAYEDACKS, /* DelayedACKs */
+ LINUX_MIB_DELAYEDACKLOCKED, /* DelayedACKLocked */
+ LINUX_MIB_DELAYEDACKLOST, /* DelayedACKLost */
+ LINUX_MIB_LISTENOVERFLOWS, /* ListenOverflows */
+ LINUX_MIB_LISTENDROPS, /* ListenDrops */
+ LINUX_MIB_TCPPREQUEUED, /* TCPPrequeued */
+ LINUX_MIB_TCPDIRECTCOPYFROMBACKLOG, /* TCPDirectCopyFromBacklog */
+ LINUX_MIB_TCPDIRECTCOPYFROMPREQUEUE, /* TCPDirectCopyFromPrequeue */
+ LINUX_MIB_TCPPREQUEUEDROPPED, /* TCPPrequeueDropped */
+ LINUX_MIB_TCPHPHITS, /* TCPHPHits */
+ LINUX_MIB_TCPHPHITSTOUSER, /* TCPHPHitsToUser */
+ LINUX_MIB_TCPPUREACKS, /* TCPPureAcks */
+ LINUX_MIB_TCPHPACKS, /* TCPHPAcks */
+ LINUX_MIB_TCPRENORECOVERY, /* TCPRenoRecovery */
+ LINUX_MIB_TCPSACKRECOVERY, /* TCPSackRecovery */
+ LINUX_MIB_TCPSACKRENEGING, /* TCPSACKReneging */
+ LINUX_MIB_TCPFACKREORDER, /* TCPFACKReorder */
+ LINUX_MIB_TCPSACKREORDER, /* TCPSACKReorder */
+ LINUX_MIB_TCPRENOREORDER, /* TCPRenoReorder */
+ LINUX_MIB_TCPTSREORDER, /* TCPTSReorder */
+ LINUX_MIB_TCPFULLUNDO, /* TCPFullUndo */
+ LINUX_MIB_TCPPARTIALUNDO, /* TCPPartialUndo */
+ LINUX_MIB_TCPDSACKUNDO, /* TCPDSACKUndo */
+ LINUX_MIB_TCPLOSSUNDO, /* TCPLossUndo */
+ LINUX_MIB_TCPLOSS, /* TCPLoss */
+ LINUX_MIB_TCPLOSTRETRANSMIT, /* TCPLostRetransmit */
+ LINUX_MIB_TCPRENOFAILURES, /* TCPRenoFailures */
+ LINUX_MIB_TCPSACKFAILURES, /* TCPSackFailures */
+ LINUX_MIB_TCPLOSSFAILURES, /* TCPLossFailures */
+ LINUX_MIB_TCPFASTRETRANS, /* TCPFastRetrans */
+ LINUX_MIB_TCPFORWARDRETRANS, /* TCPForwardRetrans */
+ LINUX_MIB_TCPSLOWSTARTRETRANS, /* TCPSlowStartRetrans */
+ LINUX_MIB_TCPTIMEOUTS, /* TCPTimeouts */
+ LINUX_MIB_TCPRENORECOVERYFAIL, /* TCPRenoRecoveryFail */
+ LINUX_MIB_TCPSACKRECOVERYFAIL, /* TCPSackRecoveryFail */
+ LINUX_MIB_TCPSCHEDULERFAILED, /* TCPSchedulerFailed */
+ LINUX_MIB_TCPRCVCOLLAPSED, /* TCPRcvCollapsed */
+ LINUX_MIB_TCPDSACKOLDSENT, /* TCPDSACKOldSent */
+ LINUX_MIB_TCPDSACKOFOSENT, /* TCPDSACKOfoSent */
+ LINUX_MIB_TCPDSACKRECV, /* TCPDSACKRecv */
+ LINUX_MIB_TCPDSACKOFORECV, /* TCPDSACKOfoRecv */
+ LINUX_MIB_TCPABORTONSYN, /* TCPAbortOnSyn */
+ LINUX_MIB_TCPABORTONDATA, /* TCPAbortOnData */
+ LINUX_MIB_TCPABORTONCLOSE, /* TCPAbortOnClose */
+ LINUX_MIB_TCPABORTONMEMORY, /* TCPAbortOnMemory */
+ LINUX_MIB_TCPABORTONTIMEOUT, /* TCPAbortOnTimeout */
+ LINUX_MIB_TCPABORTONLINGER, /* TCPAbortOnLinger */
+ LINUX_MIB_TCPABORTFAILED, /* TCPAbortFailed */
+ LINUX_MIB_TCPMEMORYPRESSURES, /* TCPMemoryPressures */
+ __LINUX_MIB_MAX
+};
+
+#endif /* _LINUX_SNMP_H */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 980f2a4e4899..7abde582f9db 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -67,7 +67,7 @@ struct svc_serv {
* read responses (that have a header, and some data pages, and possibly
* a tail) and means we can share some client side routines.
*
- * The xdr_buf.head iovec always points to the first page in the rq_*pages
+ * The xdr_buf.head kvec always points to the first page in the rq_*pages
* list. The xdr_buf.pages pointer points to the second page on that
* list. xdr_buf.tail points to the end of the first page.
* This assumes that the non-page part of an rpc reply will fit
@@ -78,7 +78,7 @@ struct svc_serv {
*/
#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
-static inline u32 svc_getu32(struct iovec *iov)
+static inline u32 svc_getu32(struct kvec *iov)
{
u32 val, *vp;
vp = iov->iov_base;
@@ -87,7 +87,7 @@ static inline u32 svc_getu32(struct iovec *iov)
iov->iov_len -= sizeof(u32);
return val;
}
-static inline void svc_putu32(struct iovec *iov, u32 val)
+static inline void svc_putu32(struct kvec *iov, u32 val)
{
u32 *vp = iov->iov_base + iov->iov_len;
*vp = val;
@@ -162,14 +162,14 @@ static inline int
xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
{
char *cp = (char *)p;
- struct iovec *vec = &rqstp->rq_arg.head[0];
+ struct kvec *vec = &rqstp->rq_arg.head[0];
return cp - (char*)vec->iov_base <= vec->iov_len;
}
static inline int
xdr_ressize_check(struct svc_rqst *rqstp, u32 *p)
{
- struct iovec *vec = &rqstp->rq_res.head[0];
+ struct kvec *vec = &rqstp->rq_res.head[0];
char *cp = (char*)p;
vec->iov_len = cp - (char*)vec->iov_base;
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 0b9aecd9b8c3..112738cca4e1 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -48,7 +48,7 @@ typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj);
* operations and/or has a need for scatter/gather involving pages.
*/
struct xdr_buf {
- struct iovec head[1], /* RPC header + non-page data */
+ struct kvec head[1], /* RPC header + non-page data */
tail[1]; /* Appended after page data */
struct page ** pages; /* Array of contiguous pages */
@@ -127,15 +127,15 @@ xdr_decode_hyper(u32 *p, __u64 *valp)
}
/*
- * Adjust iovec to reflect end of xdr'ed data (RPC client XDR)
+ * Adjust kvec to reflect end of xdr'ed data (RPC client XDR)
*/
static inline int
-xdr_adjust_iovec(struct iovec *iov, u32 *p)
+xdr_adjust_iovec(struct kvec *iov, u32 *p)
{
return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base);
}
-void xdr_shift_iovec(struct iovec *, int, size_t);
+void xdr_shift_iovec(struct kvec *, int, size_t);
/*
* Maximum number of iov's we use.
@@ -145,11 +145,11 @@ void xdr_shift_iovec(struct iovec *, int, size_t);
/*
* XDR buffer helper functions
*/
-extern int xdr_kmap(struct iovec *, struct xdr_buf *, size_t);
+extern int xdr_kmap(struct kvec *, struct xdr_buf *, size_t);
extern void xdr_kunmap(struct xdr_buf *, size_t);
extern void xdr_shift_buf(struct xdr_buf *, size_t);
extern void _copy_from_pages(char *, struct page **, size_t, size_t);
-extern void xdr_buf_from_iov(struct iovec *, struct xdr_buf *);
+extern void xdr_buf_from_iov(struct kvec *, struct xdr_buf *);
extern int xdr_buf_subsegment(struct xdr_buf *, struct xdr_buf *, int, int);
extern int xdr_buf_read_netobj(struct xdr_buf *, struct xdr_netobj *, int);
extern int read_bytes_from_xdr_buf(struct xdr_buf *buf, int base, void *obj, int len);
@@ -182,7 +182,7 @@ struct xdr_stream {
struct xdr_buf *buf; /* XDR buffer to read/write */
uint32_t *end; /* end of available buffer space */
- struct iovec *iov; /* pointer to the current iovec */
+ struct kvec *iov; /* pointer to the current kvec */
};
extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 8bdea57738b0..06e19d370efd 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -432,7 +432,7 @@ struct inquiry_info_with_rssi {
__u8 pscan_period_mode;
__u8 dev_class[3];
__u16 clock_offset;
- __u8 rssi;
+ __s8 rssi;
} __attribute__ ((packed));
#define HCI_EV_CONN_COMPLETE 0x03
diff --git a/include/net/icmp.h b/include/net/icmp.h
index edefb1387c95..aa260fcad767 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -37,18 +37,6 @@ DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
#define ICMP_INC_STATS(field) SNMP_INC_STATS(icmp_statistics, field)
#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field)
#define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field)
-#define ICMP_INC_STATS_FIELD(offt) \
- (*((unsigned long *) ((void *) \
- per_cpu_ptr(icmp_statistics[!in_softirq()],\
- smp_processor_id()) + offt)))++
-#define ICMP_INC_STATS_BH_FIELD(offt) \
- (*((unsigned long *) ((void *) \
- per_cpu_ptr(icmp_statistics[0], \
- smp_processor_id()) + offt)))++
-#define ICMP_INC_STATS_USER_FIELD(offt) \
- (*((unsigned long *) ((void *) \
- per_cpu_ptr(icmp_statistics[1], \
- smp_processor_id()) + offt)))++
extern void icmp_send(struct sk_buff *skb_in, int type, int code, u32 info);
extern int icmp_rcv(struct sk_buff *skb);
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 55dc2b3be699..4b9c7556273a 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -3,39 +3,48 @@
#include <linux/ip.h>
+enum {
+ INET_ECN_NOT_ECT = 0,
+ INET_ECN_ECT_1 = 1,
+ INET_ECN_ECT_0 = 2,
+ INET_ECN_CE = 3,
+ INET_ECN_MASK = 3,
+};
+
static inline int INET_ECN_is_ce(__u8 dsfield)
{
- return (dsfield&3) == 3;
+ return (dsfield & INET_ECN_MASK) == INET_ECN_CE;
}
static inline int INET_ECN_is_not_ce(__u8 dsfield)
{
- return (dsfield&3) == 2;
+ return (dsfield & INET_ECN_MASK) == INET_ECN_ECT_0;
}
static inline int INET_ECN_is_capable(__u8 dsfield)
{
- return (dsfield&2);
+ return (dsfield & INET_ECN_ECT_0);
}
static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
{
- outer &= ~3;
+ outer &= ~INET_ECN_MASK;
if (INET_ECN_is_capable(inner))
- outer |= (inner & 3);
+ outer |= (inner & INET_ECN_MASK);
return outer;
}
-#define INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= 2; } while (0)
-#define INET_ECN_dontxmit(sk) do { inet_sk(sk)->tos &= ~3; } while (0)
+#define INET_ECN_xmit(sk) do { inet_sk(sk)->tos |= INET_ECN_ECT_0; } while (0)
+#define INET_ECN_dontxmit(sk) \
+ do { inet_sk(sk)->tos &= ~INET_ECN_MASK; } while (0)
-#define IP6_ECN_flow_init(label) do { \
- (label) &= ~htonl(3<<20); \
+#define IP6_ECN_flow_init(label) do { \
+ (label) &= ~htonl(INET_ECN_MASK << 20); \
} while (0)
-#define IP6_ECN_flow_xmit(sk, label) do { \
- if (INET_ECN_is_capable(inet_sk(sk)->tos)) \
- (label) |= __constant_htons(2 << 4); \
+#define IP6_ECN_flow_xmit(sk, label) do { \
+ if (INET_ECN_is_capable(inet_sk(sk)->tos)) \
+ (label) |= __constant_htons(INET_ECN_ECT_0 << 4); \
} while (0)
static inline void IP_ECN_set_ce(struct iphdr *iph)
@@ -43,24 +52,24 @@ static inline void IP_ECN_set_ce(struct iphdr *iph)
u32 check = iph->check;
check += __constant_htons(0xFFFE);
iph->check = check + (check>=0xFFFF);
- iph->tos |= 1;
+ iph->tos |= INET_ECN_CE;
}
static inline void IP_ECN_clear(struct iphdr *iph)
{
- iph->tos &= ~3;
+ iph->tos &= ~INET_ECN_MASK;
}
struct ipv6hdr;
static inline void IP6_ECN_set_ce(struct ipv6hdr *iph)
{
- *(u32*)iph |= htonl(1<<20);
+ *(u32*)iph |= htonl(INET_ECN_CE << 20);
}
static inline void IP6_ECN_clear(struct ipv6hdr *iph)
{
- *(u32*)iph &= ~htonl(3<<20);
+ *(u32*)iph &= ~htonl(INET_ECN_MASK << 20);
}
#define ip6_get_dsfield(iph) ((ntohs(*(u16*)(iph)) >> 4) & 0xFF)
diff --git a/include/net/ip.h b/include/net/ip.h
index 7b6ea4334bf1..70bb6f887988 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -109,6 +109,9 @@ extern ssize_t ip_append_page(struct sock *sk, struct page *page,
extern int ip_push_pending_frames(struct sock *sk);
extern void ip_flush_pending_frames(struct sock *sk);
+/* datagram.c */
+extern int ip4_datagram_connect(struct sock *sk,
+ struct sockaddr *uaddr, int addr_len);
/*
* Map a multicast IP onto multicast MAC for type Token Ring.
@@ -128,10 +131,10 @@ static inline void ip_tr_mc_map(u32 addr, char *buf)
}
struct ip_reply_arg {
- struct iovec iov[1];
- u32 csum;
- int csumoffset; /* u16 offset of csum in iov[0].iov_base */
- /* -1 if not needed */
+ struct kvec iov[1];
+ u32 csum;
+ int csumoffset; /* u16 offset of csum in iov[0].iov_base */
+ /* -1 if not needed */
};
void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg,
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 291149080a04..75d503dc1b5e 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -104,9 +104,7 @@ extern rwlock_t rt6_lock;
/*
* Store a destination cache entry in a socket
- * For UDP/RAW sockets this is done on udp_connect.
*/
-
static inline void ip6_dst_store(struct sock *sk, struct dst_entry *dst,
struct in6_addr *daddr)
{
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 8f647ae8e732..034cf3084a77 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -406,6 +406,9 @@ extern void ipv6_packet_init(void);
extern void ipv6_packet_cleanup(void);
+extern int ip6_datagram_connect(struct sock *sk,
+ struct sockaddr *addr, int addr_len);
+
extern int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len);
extern void ipv6_icmp_error(struct sock *sk, struct sk_buff *skb, int err, u16 port,
u32 info, u8 *payload);
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 825e11014edb..073bd077c29d 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -1,12 +1,6 @@
#ifndef __NET_PKT_SCHED_H
#define __NET_PKT_SCHED_H
-#define PSCHED_GETTIMEOFDAY 1
-#define PSCHED_JIFFIES 2
-#define PSCHED_CPU 3
-
-#define PSCHED_CLOCK_SOURCE PSCHED_JIFFIES
-
#include <linux/config.h>
#include <linux/netdevice.h>
#include <linux/types.h>
@@ -16,11 +10,6 @@
#include <linux/module.h>
#include <linux/rtnetlink.h>
-#ifdef CONFIG_X86_TSC
-#include <asm/msr.h>
-#endif
-
-
struct rtattr;
struct Qdisc;
@@ -184,25 +173,19 @@ __cls_set_class(unsigned long *clp, unsigned long cl)
The reason is that, when it is not the same thing as
gettimeofday, it returns invalid timestamp, which is
not updated, when net_bh is active.
-
- So, use PSCHED_CLOCK_SOURCE = PSCHED_CPU on alpha and pentiums
- with rtdsc. And PSCHED_JIFFIES on all other architectures, including [34]86
- and pentiums without rtdsc.
- You can use PSCHED_GETTIMEOFDAY on another architectures,
- which have fast and precise clock source, but it is too expensive.
*/
/* General note about internal clock.
Any clock source returns time intervals, measured in units
- close to 1usec. With source PSCHED_GETTIMEOFDAY it is precisely
+ close to 1usec. With source CONFIG_NET_SCH_CLK_GETTIMEOFDAY it is precisely
microseconds, otherwise something close but different chosen to minimize
arithmetic cost. Ratio usec/internal untis in form nominator/denominator
may be read from /proc/net/psched.
*/
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
typedef struct timeval psched_time_t;
typedef long psched_tdiff_t;
@@ -211,14 +194,12 @@ typedef long psched_tdiff_t;
#define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ))
#define PSCHED_JIFFIE2US(delay) ((delay)*(1000000/HZ))
-#else /* PSCHED_CLOCK_SOURCE != PSCHED_GETTIMEOFDAY */
+#else /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
typedef u64 psched_time_t;
typedef long psched_tdiff_t;
-extern psched_time_t psched_time_base;
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES
+#ifdef CONFIG_NET_SCH_CLK_JIFFIES
#if HZ < 96
#define PSCHED_JSCALE 14
@@ -236,47 +217,35 @@ extern psched_time_t psched_time_base;
#define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE)
#define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE)
-#elif PSCHED_CLOCK_SOURCE == PSCHED_CPU
+#endif /* CONFIG_NET_SCH_CLK_JIFFIES */
+#ifdef CONFIG_NET_SCH_CLK_CPU
+#include <asm/timex.h>
extern psched_tdiff_t psched_clock_per_hz;
extern int psched_clock_scale;
-
+extern psched_time_t psched_time_base;
+extern cycles_t psched_time_mark;
+
+#define PSCHED_GET_TIME(stamp) \
+do { \
+ cycles_t cur = get_cycles(); \
+ if (sizeof(cycles_t) == sizeof(u32)) { \
+ if (cur <= psched_time_mark) \
+ psched_time_base += 0x100000000ULL; \
+ psched_time_mark = cur; \
+ (stamp) = (psched_time_base + cur)>>psched_clock_scale; \
+ } else { \
+ (stamp) = cur>>psched_clock_scale; \
+ } \
+} while (0)
#define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
#define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
-#ifdef CONFIG_X86_TSC
-
-#define PSCHED_GET_TIME(stamp) \
-({ u64 __cur; \
- rdtscll(__cur); \
- (stamp) = __cur>>psched_clock_scale; \
-})
-
-#elif defined (__alpha__)
+#endif /* CONFIG_NET_SCH_CLK_CPU */
-#define PSCHED_WATCHER u32
+#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
-extern PSCHED_WATCHER psched_time_mark;
-
-#define PSCHED_GET_TIME(stamp) \
-({ u32 __res; \
- __asm__ __volatile__ ("rpcc %0" : "r="(__res)); \
- if (__res <= psched_time_mark) psched_time_base += 0x100000000UL; \
- psched_time_mark = __res; \
- (stamp) = (psched_time_base + __res)>>psched_clock_scale; \
-})
-
-#else
-
-#error PSCHED_CLOCK_SOURCE=PSCHED_CPU is not supported on this arch.
-
-#endif /* ARCH */
-
-#endif /* PSCHED_CLOCK_SOURCE == PSCHED_JIFFIES */
-
-#endif /* PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY */
-
-#if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY
+#ifdef CONFIG_NET_SCH_CLK_GETTIMEOFDAY
#define PSCHED_TDIFF(tv1, tv2) \
({ \
int __delta_sec = (tv1).tv_sec - (tv2).tv_sec; \
@@ -340,7 +309,7 @@ extern int psched_tod_diff(int delta_sec, int bound);
#define PSCHED_AUDIT_TDIFF(t) ({ if ((t) > 2000000) (t) = 2000000; })
-#else
+#else /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
#define PSCHED_TDIFF(tv1, tv2) (long)((tv1) - (tv2))
#define PSCHED_TDIFF_SAFE(tv1, tv2, bound) \
@@ -354,7 +323,7 @@ extern int psched_tod_diff(int delta_sec, int bound);
#define PSCHED_IS_PASTPERFECT(t) ((t) == 0)
#define PSCHED_AUDIT_TDIFF(t)
-#endif
+#endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */
struct tcf_police
{
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index c3088c127933..4e0e2246da93 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -94,6 +94,9 @@ typedef enum {
SCTP_CMD_REPORT_FWDTSN, /* Report new cumulative TSN Ack. */
SCTP_CMD_PROCESS_FWDTSN, /* Skips were reported, so process further. */
SCTP_CMD_CLEAR_INIT_TAG, /* Clears association peer's inittag. */
+ SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */
+ SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */
+ SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */
SCTP_CMD_LAST
} sctp_verb_t;
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index c611176fbd44..bc1d9a63dd02 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -175,6 +175,10 @@ typedef enum {
SCTP_IERROR_BAD_TAG,
SCTP_IERROR_BIG_GAP,
SCTP_IERROR_DUP_TSN,
+ SCTP_IERROR_HIGH_TSN,
+ SCTP_IERROR_IGNORE_TSN,
+ SCTP_IERROR_NO_DATA,
+ SCTP_IERROR_BAD_STREAM,
} sctp_ierror_t;
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index a73cea97098e..fc617506482a 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -322,6 +322,9 @@ void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
const struct sctp_chunk *chunk,
sctp_cmd_seq_t *commands,
struct sctp_chunk *err_chunk);
+int sctp_eat_data(const struct sctp_association *asoc,
+ struct sctp_chunk *chunk,
+ sctp_cmd_seq_t *commands);
/* 3rd level prototypes */
__u32 sctp_generate_tag(const struct sctp_endpoint *);
diff --git a/include/net/snmp.h b/include/net/snmp.h
index c702dda23a4b..b7068876e0eb 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -22,291 +22,102 @@
#define _SNMP_H
#include <linux/cache.h>
-
-/*
- * We use all unsigned longs. Linux will soon be so reliable that even these
- * will rapidly get too small 8-). Seriously consider the IpInReceives count
- * on the 20Gb/s + networks people expect in a few years time!
- */
-
-/*
- * The rule for padding:
- * Best is power of two because then the right structure can be found by a simple
- * shift. The structure should be always cache line aligned.
- * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add instructions
- * to emulate multiply in case it is not power-of-two. Currently n is always <=3 for
- * all sizes so simple cache line alignment is enough.
- *
- * The best solution would be a global CPU local area , especially on 64 and 128byte
- * cacheline machine it makes a *lot* of sense -AK
- */
-
-struct snmp_item {
- char *name;
- int offset;
-};
-
-#define SNMP_ITEM(mib,entry,procname) { \
- .name = procname, \
- .offset = offsetof(mib, entry), \
-}
-
-#define SNMP_ITEM_SENTINEL { \
- .name = NULL, \
- .offset = 0, \
-}
+#include <linux/snmp.h>
/*
- * RFC 1213: MIB-II
- * RFC 2011 (updates 1213): SNMPv2-MIB-IP
- * RFC 2863: Interfaces Group MIB
- * RFC 2465: IPv6 MIB: General Group
- * draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
+ * Mibs are stored in array of unsigned long.
*/
-struct ipstats_mib
-{
- unsigned long InReceives;
- unsigned long InHdrErrors;
- unsigned long InTooBigErrors;
- unsigned long InNoRoutes;
- unsigned long InAddrErrors;
- unsigned long InUnknownProtos;
- unsigned long InTruncatedPkts;
- unsigned long InDiscards;
- unsigned long InDelivers;
- unsigned long OutForwDatagrams;
- unsigned long OutRequests;
- unsigned long OutDiscards;
- unsigned long OutNoRoutes;
- unsigned long ReasmTimeout;
- unsigned long ReasmReqds;
- unsigned long ReasmOKs;
- unsigned long ReasmFails;
- unsigned long FragOKs;
- unsigned long FragFails;
- unsigned long FragCreates;
- unsigned long InMcastPkts;
- unsigned long OutMcastPkts;
- unsigned long __pad[0];
-};
-
/*
- * RFC 1213: MIB-II ICMP Group
- * RFC 2011 (updates 1213): SNMPv2 MIB for IP: ICMP group
+ * struct snmp_mib{}
+ * - list of entries for particular API (such as /proc/net/snmp)
+ * - name of entries.
*/
-struct icmp_mib
-{
- unsigned long IcmpInMsgs;
- unsigned long IcmpInErrors;
- unsigned long IcmpInDestUnreachs;
- unsigned long IcmpInTimeExcds;
- unsigned long IcmpInParmProbs;
- unsigned long IcmpInSrcQuenchs;
- unsigned long IcmpInRedirects;
- unsigned long IcmpInEchos;
- unsigned long IcmpInEchoReps;
- unsigned long IcmpInTimestamps;
- unsigned long IcmpInTimestampReps;
- unsigned long IcmpInAddrMasks;
- unsigned long IcmpInAddrMaskReps;
- unsigned long IcmpOutMsgs;
- unsigned long IcmpOutErrors;
- unsigned long IcmpOutDestUnreachs;
- unsigned long IcmpOutTimeExcds;
- unsigned long IcmpOutParmProbs;
- unsigned long IcmpOutSrcQuenchs;
- unsigned long IcmpOutRedirects;
- unsigned long IcmpOutEchos;
- unsigned long IcmpOutEchoReps;
- unsigned long IcmpOutTimestamps;
- unsigned long IcmpOutTimestampReps;
- unsigned long IcmpOutAddrMasks;
- unsigned long IcmpOutAddrMaskReps;
- unsigned long dummy;
- unsigned long __pad[0];
+struct snmp_mib {
+ char *name;
+ int entry;
};
-/*
- * RFC 2466: ICMPv6-MIB
- */
-struct icmpv6_mib
-{
- unsigned long Icmp6InMsgs;
- unsigned long Icmp6InErrors;
-
- unsigned long Icmp6InDestUnreachs;
- unsigned long Icmp6InPktTooBigs;
- unsigned long Icmp6InTimeExcds;
- unsigned long Icmp6InParmProblems;
-
- unsigned long Icmp6InEchos;
- unsigned long Icmp6InEchoReplies;
- unsigned long Icmp6InGroupMembQueries;
- unsigned long Icmp6InGroupMembResponses;
- unsigned long Icmp6InGroupMembReductions;
- unsigned long Icmp6InRouterSolicits;
- unsigned long Icmp6InRouterAdvertisements;
- unsigned long Icmp6InNeighborSolicits;
- unsigned long Icmp6InNeighborAdvertisements;
- unsigned long Icmp6InRedirects;
-
- unsigned long Icmp6OutMsgs;
+#define SNMP_MIB_ITEM(_name,_entry) { \
+ .name = _name, \
+ .entry = _entry, \
+}
- unsigned long Icmp6OutDestUnreachs;
- unsigned long Icmp6OutPktTooBigs;
- unsigned long Icmp6OutTimeExcds;
- unsigned long Icmp6OutParmProblems;
+#define SNMP_MIB_SENTINEL { \
+ .name = NULL, \
+ .entry = 0, \
+}
- unsigned long Icmp6OutEchoReplies;
- unsigned long Icmp6OutRouterSolicits;
- unsigned long Icmp6OutNeighborSolicits;
- unsigned long Icmp6OutNeighborAdvertisements;
- unsigned long Icmp6OutRedirects;
- unsigned long Icmp6OutGroupMembResponses;
- unsigned long Icmp6OutGroupMembReductions;
- unsigned long __pad[0];
-};
-
-/*
- * RFC 1213: MIB-II TCP group
- * RFC 2012 (updates 1213): SNMPv2-MIB-TCP
- */
-struct tcp_mib
-{
- unsigned long TcpRtoAlgorithm;
- unsigned long TcpRtoMin;
- unsigned long TcpRtoMax;
- unsigned long TcpMaxConn;
- unsigned long TcpActiveOpens;
- unsigned long TcpPassiveOpens;
- unsigned long TcpAttemptFails;
- unsigned long TcpEstabResets;
- unsigned long TcpCurrEstab;
- unsigned long TcpInSegs;
- unsigned long TcpOutSegs;
- unsigned long TcpRetransSegs;
- unsigned long TcpInErrs;
- unsigned long TcpOutRsts;
- unsigned long __pad[0];
-};
-
/*
- * RFC 1213: MIB-II UDP group
- * RFC 2013 (updates 1213): SNMPv2-MIB-UDP
+ * We use all unsigned longs. Linux will soon be so reliable that even
+ * these will rapidly get too small 8-). Seriously consider the IpInReceives
+ * count on the 20Gb/s + networks people expect in a few years time!
*/
-struct udp_mib
-{
- unsigned long UdpInDatagrams;
- unsigned long UdpNoPorts;
- unsigned long UdpInErrors;
- unsigned long UdpOutDatagrams;
- unsigned long __pad[0];
-};
-/* draft-ietf-sigtran-sctp-mib-07.txt */
-struct sctp_mib
-{
- unsigned long SctpCurrEstab;
- unsigned long SctpActiveEstabs;
- unsigned long SctpPassiveEstabs;
- unsigned long SctpAborteds;
- unsigned long SctpShutdowns;
- unsigned long SctpOutOfBlues;
- unsigned long SctpChecksumErrors;
- unsigned long SctpOutCtrlChunks;
- unsigned long SctpOutOrderChunks;
- unsigned long SctpOutUnorderChunks;
- unsigned long SctpInCtrlChunks;
- unsigned long SctpInOrderChunks;
- unsigned long SctpInUnorderChunks;
- unsigned long SctpFragUsrMsgs;
- unsigned long SctpReasmUsrMsgs;
- unsigned long SctpOutSCTPPacks;
- unsigned long SctpInSCTPPacks;
- unsigned long SctpRtoAlgorithm;
- unsigned long SctpRtoMin;
- unsigned long SctpRtoMax;
- unsigned long SctpRtoInitial;
- unsigned long SctpValCookieLife;
- unsigned long SctpMaxInitRetr;
- unsigned long __pad[0];
-};
+/*
+ * The rule for padding:
+ * Best is power of two because then the right structure can be found by a
+ * simple shift. The structure should be always cache line aligned.
+ * gcc needs n=alignto(cachelinesize, popcnt(sizeof(bla_mib))) shift/add
+ * instructions to emulate multiply in case it is not power-of-two.
+ * Currently n is always <=3 for all sizes so simple cache line alignment
+ * is enough.
+ *
+ * The best solution would be a global CPU local area , especially on 64
+ * and 128byte cacheline machine it makes a *lot* of sense -AK
+ */
-struct linux_mib
-{
- unsigned long SyncookiesSent;
- unsigned long SyncookiesRecv;
- unsigned long SyncookiesFailed;
- unsigned long EmbryonicRsts;
- unsigned long PruneCalled;
- unsigned long RcvPruned;
- unsigned long OfoPruned;
- unsigned long OutOfWindowIcmps;
- unsigned long LockDroppedIcmps;
- unsigned long ArpFilter;
- unsigned long TimeWaited;
- unsigned long TimeWaitRecycled;
- unsigned long TimeWaitKilled;
- unsigned long PAWSPassiveRejected;
- unsigned long PAWSActiveRejected;
- unsigned long PAWSEstabRejected;
- unsigned long DelayedACKs;
- unsigned long DelayedACKLocked;
- unsigned long DelayedACKLost;
- unsigned long ListenOverflows;
- unsigned long ListenDrops;
- unsigned long TCPPrequeued;
- unsigned long TCPDirectCopyFromBacklog;
- unsigned long TCPDirectCopyFromPrequeue;
- unsigned long TCPPrequeueDropped;
- unsigned long TCPHPHits;
- unsigned long TCPHPHitsToUser;
- unsigned long TCPPureAcks;
- unsigned long TCPHPAcks;
- unsigned long TCPRenoRecovery;
- unsigned long TCPSackRecovery;
- unsigned long TCPSACKReneging;
- unsigned long TCPFACKReorder;
- unsigned long TCPSACKReorder;
- unsigned long TCPRenoReorder;
- unsigned long TCPTSReorder;
- unsigned long TCPFullUndo;
- unsigned long TCPPartialUndo;
- unsigned long TCPDSACKUndo;
- unsigned long TCPLossUndo;
- unsigned long TCPLoss;
- unsigned long TCPLostRetransmit;
- unsigned long TCPRenoFailures;
- unsigned long TCPSackFailures;
- unsigned long TCPLossFailures;
- unsigned long TCPFastRetrans;
- unsigned long TCPForwardRetrans;
- unsigned long TCPSlowStartRetrans;
- unsigned long TCPTimeouts;
- unsigned long TCPRenoRecoveryFail;
- unsigned long TCPSackRecoveryFail;
- unsigned long TCPSchedulerFailed;
- unsigned long TCPRcvCollapsed;
- unsigned long TCPDSACKOldSent;
- unsigned long TCPDSACKOfoSent;
- unsigned long TCPDSACKRecv;
- unsigned long TCPDSACKOfoRecv;
- unsigned long TCPAbortOnSyn;
- unsigned long TCPAbortOnData;
- unsigned long TCPAbortOnClose;
- unsigned long TCPAbortOnMemory;
- unsigned long TCPAbortOnTimeout;
- unsigned long TCPAbortOnLinger;
- unsigned long TCPAbortFailed;
- unsigned long TCPMemoryPressures;
- unsigned long __pad[0];
+#define __SNMP_MIB_ALIGN__ ____cacheline_aligned
+
+/* IPstats */
+#define IPSTATS_MIB_MAX __IPSTATS_MIB_MAX
+struct ipstats_mib {
+ unsigned long mibs[IPSTATS_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* ICMP */
+#define ICMP_MIB_DUMMY __ICMP_MIB_MAX
+#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
+
+struct icmp_mib {
+ unsigned long mibs[ICMP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* ICMP6 (IPv6-ICMP) */
+#define ICMP6_MIB_MAX __ICMP6_MIB_MAX
+struct icmpv6_mib {
+ unsigned long mibs[ICMP6_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* TCP */
+#define TCP_MIB_MAX __TCP_MIB_MAX
+struct tcp_mib {
+ unsigned long mibs[TCP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* UDP */
+#define UDP_MIB_MAX __UDP_MIB_MAX
+struct udp_mib {
+ unsigned long mibs[UDP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* SCTP */
+#define SCTP_MIB_MAX __SCTP_MIB_MAX
+struct sctp_mib {
+ unsigned long mibs[SCTP_MIB_MAX];
+} __SNMP_MIB_ALIGN__;
+
+/* Linux */
+#define LINUX_MIB_MAX __LINUX_MIB_MAX
+struct linux_mib {
+ unsigned long mibs[LINUX_MIB_MAX];
};
/*
- * FIXME: On x86 and some other CPUs the split into user and softirq parts is not needed because
- * addl $1,memory is atomic against interrupts (but atomic_inc would be overkill because of the lock
- * cycles). Wants new nonlocked_atomic_inc() primitives -AK
+ * FIXME: On x86 and some other CPUs the split into user and softirq parts
+ * is not needed because addl $1,memory is atomic against interrupts (but
+ * atomic_inc would be overkill because of the lock cycles). Wants new
+ * nonlocked_atomic_inc() primitives -AK
*/
#define DEFINE_SNMP_STAT(type, name) \
__typeof__(type) *name[2]
@@ -317,18 +128,18 @@ struct linux_mib
#define SNMP_STAT_USRPTR(name) (name[1])
#define SNMP_INC_STATS_BH(mib, field) \
- (per_cpu_ptr(mib[0], smp_processor_id())->field++)
+ (per_cpu_ptr(mib[0], smp_processor_id())->mibs[field]++)
#define SNMP_INC_STATS_OFFSET_BH(mib, field, offset) \
- ((*((&per_cpu_ptr(mib[0], smp_processor_id())->field) + (offset)))++)
+ (per_cpu_ptr(mib[0], smp_processor_id())->mibs[field + (offset)]++)
#define SNMP_INC_STATS_USER(mib, field) \
- (per_cpu_ptr(mib[1], smp_processor_id())->field++)
+ (per_cpu_ptr(mib[1], smp_processor_id())->mibs[field]++)
#define SNMP_INC_STATS(mib, field) \
- (per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field++)
+ (per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->mibs[field]++)
#define SNMP_DEC_STATS(mib, field) \
- (per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->field--)
+ (per_cpu_ptr(mib[!in_softirq()], smp_processor_id())->mibs[field]--)
#define SNMP_ADD_STATS_BH(mib, field, addend) \
- (per_cpu_ptr(mib[0], smp_processor_id())->field += addend)
+ (per_cpu_ptr(mib[0], smp_processor_id())->mibs[field] += addend)
#define SNMP_ADD_STATS_USER(mib, field, addend) \
- (per_cpu_ptr(mib[1], smp_processor_id())->field += addend)
-
+ (per_cpu_ptr(mib[1], smp_processor_id())->mibs[field] += addend)
+
#endif
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6c033d3db177..c7d711f5e645 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1543,7 +1543,7 @@ static __inline__ int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
sk->sk_backlog_rcv(sk, skb1);
- NET_INC_STATS_BH(TCPPrequeueDropped);
+ NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED);
}
tp->ucopy.memory = 0;
@@ -1575,12 +1575,12 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
switch (state) {
case TCP_ESTABLISHED:
if (oldstate != TCP_ESTABLISHED)
- TCP_INC_STATS(TcpCurrEstab);
+ TCP_INC_STATS(TCP_MIB_CURRESTAB);
break;
case TCP_CLOSE:
if (oldstate == TCP_CLOSE_WAIT || oldstate == TCP_ESTABLISHED)
- TCP_INC_STATS(TcpEstabResets);
+ TCP_INC_STATS(TCP_MIB_ESTABRESETS);
sk->sk_prot->unhash(sk);
if (tcp_sk(sk)->bind_hash &&
@@ -1589,7 +1589,7 @@ static __inline__ void tcp_set_state(struct sock *sk, int state)
/* fall through */
default:
if (oldstate==TCP_ESTABLISHED)
- TCP_DEC_STATS(TcpCurrEstab);
+ TCP_DEC_STATS(TCP_MIB_CURRESTAB);
}
/* Change state AFTER socket is unhashed to avoid closed
@@ -1961,10 +1961,10 @@ static inline int tcp_use_frto(const struct sock *sk)
static inline void tcp_mib_init(void)
{
/* See RFC 2012 */
- TCP_ADD_STATS_USER(TcpRtoAlgorithm, 1);
- TCP_ADD_STATS_USER(TcpRtoMin, TCP_RTO_MIN*1000/HZ);
- TCP_ADD_STATS_USER(TcpRtoMax, TCP_RTO_MAX*1000/HZ);
- TCP_ADD_STATS_USER(TcpMaxConn, -1);
+ TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1);
+ TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ);
+ TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ);
+ TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1);
}
/* /proc */
diff --git a/include/net/udp.h b/include/net/udp.h
index 12d5d7ef62e8..2ef99a71bc30 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -64,8 +64,6 @@ extern struct proto udp_prot;
extern void udp_err(struct sk_buff *, u32);
-extern int udp_connect(struct sock *sk,
- struct sockaddr *usin, int addr_len);
extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct msghdr *msg, size_t len);
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 69dc1829eba9..23b27b73ab39 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -33,13 +33,15 @@
#include <linux/time.h>
#include <asm/byteorder.h>
-#if __LITTLE_ENDIAN == 1234
+#ifdef __LITTLE_ENDIAN
#define SNDRV_LITTLE_ENDIAN
-#elif __BIG_ENDIAN == 4321
+#else
+#ifdef __BIG_ENDIAN
#define SNDRV_BIG_ENDIAN
#else
#error "Unsupported endian..."
#endif
+#endif
#else /* !__KERNEL__ */
diff --git a/include/video/vga.h b/include/video/vga.h
index 480c58417beb..e44593d3cd93 100644
--- a/include/video/vga.h
+++ b/include/video/vga.h
@@ -26,8 +26,15 @@
/*
* FIXME
* Ugh, we don't have PCI space, so map readb() and friends to use Zorro space
- * for MMIO accesses. This should make clgenfb work again on Amiga
+ * for MMIO accesses. This should make cirrusfb work again on Amiga
*/
+#undef inb_p
+#undef inw_p
+#undef outb_p
+#undef outw
+#undef readb
+#undef writeb
+#undef writew
#define inb_p(port) 0
#define inw_p(port) 0
#define outb_p(port, val) do { } while (0)