aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-20 08:59:45 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-20 08:59:45 -0400
commitd59bf96cdde5b874a57bfd1425faa45da915d0b7 (patch)
tree351a40b72514d620e5bebea2de38c26f23277ffc /include
parent28df955a2ad484d602314b30183ea8496a9aa34a (diff)
parent25f42b6af09e34c3f92107b36b5aa6edc2fdba2f (diff)
Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-pxa/ohci.h2
-rw-r--r--include/asm-mips/addrspace.h35
-rw-r--r--include/asm-mips/apm.h65
-rw-r--r--include/asm-mips/asmmacro-32.h4
-rw-r--r--include/asm-mips/asmmacro-64.h19
-rw-r--r--include/asm-mips/bootinfo.h13
-rw-r--r--include/asm-mips/ddb5074.h11
-rw-r--r--include/asm-mips/ddb5xxx/ddb5074.h38
-rw-r--r--include/asm-mips/ddb5xxx/ddb5476.h157
-rw-r--r--include/asm-mips/ddb5xxx/ddb5xxx.h11
-rw-r--r--include/asm-mips/emma2rh/emma2rh.h330
-rw-r--r--include/asm-mips/emma2rh/markeins.h76
-rw-r--r--include/asm-mips/fpu.h3
-rw-r--r--include/asm-mips/fpu_emulator.h4
-rw-r--r--include/asm-mips/futex.h32
-rw-r--r--include/asm-mips/mach-ddb5074/mc146818rtc.h31
-rw-r--r--include/asm-mips/mach-dec/param.h18
-rw-r--r--include/asm-mips/mach-emma2rh/irq.h (renamed from include/asm-mips/mach-mips/param.h)8
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h40
-rw-r--r--include/asm-mips/mach-excite/excite.h155
-rw-r--r--include/asm-mips/mach-excite/excite_nandflash.h7
-rw-r--r--include/asm-mips/mach-excite/rm9k_eth.h23
-rw-r--r--include/asm-mips/mach-excite/rm9k_wdt.h12
-rw-r--r--include/asm-mips/mach-excite/rm9k_xicap.h16
-rw-r--r--include/asm-mips/mach-generic/param.h13
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h2
-rw-r--r--include/asm-mips/mach-jazz/param.h16
-rw-r--r--include/asm-mips/mach-mips/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-qemu/param.h13
-rw-r--r--include/asm-mips/mach-rm200/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-sim/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-wrppmc/mach-gt64120.h84
-rw-r--r--include/asm-mips/mipsregs.h4
-rw-r--r--include/asm-mips/mmzone.h11
-rw-r--r--include/asm-mips/page.h19
-rw-r--r--include/asm-mips/param.h2
-rw-r--r--include/asm-mips/pci/bridge.h3
-rw-r--r--include/asm-mips/pgtable.h2
-rw-r--r--include/asm-mips/processor.h16
-rw-r--r--include/asm-mips/qemu.h6
-rw-r--r--include/asm-mips/rm9k-ocd.h56
-rw-r--r--include/asm-mips/sn/addrs.h27
-rw-r--r--include/asm-mips/sn/fru.h (renamed from include/asm-mips/sn/sn0/sn0_fru.h)8
-rw-r--r--include/asm-mips/sn/klconfig.h89
-rw-r--r--include/asm-mips/sn/kldir.h34
-rw-r--r--include/asm-mips/sn/sn0/addrs.h87
-rw-r--r--include/asm-mips/sn/sn0/arch.h17
-rw-r--r--include/asm-mips/sn/sn0/hub.h4
-rw-r--r--include/asm-mips/sn/sn0/hubio.h16
-rw-r--r--include/asm-mips/sn/sn0/hubmd.h2
-rw-r--r--include/asm-mips/sn/sn0/hubpi.h18
-rw-r--r--include/asm-mips/sn/sn0/ip27.h9
-rw-r--r--include/asm-mips/sni.h7
-rw-r--r--include/asm-mips/war.h5
-rw-r--r--include/asm-powerpc/cputable.h2
-rw-r--r--include/linux/console.h4
-rw-r--r--include/linux/dmaengine.h359
-rw-r--r--include/linux/i2o.h5
-rw-r--r--include/linux/igmp.h2
-rw-r--r--include/linux/netdevice.h45
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h4
-rw-r--r--include/linux/netfilter/xt_CONNSECMARK.h13
-rw-r--r--include/linux/netfilter/xt_SECMARK.h26
-rw-r--r--include/linux/netfilter/xt_quota.h16
-rw-r--r--include/linux/netfilter/xt_statistic.h32
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h7
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sip.h44
-rw-r--r--include/linux/pci-acpi.h2
-rw-r--r--include/linux/pci.h2
-rw-r--r--include/linux/pci_ids.h12
-rw-r--r--include/linux/pfkeyv2.h2
-rw-r--r--include/linux/security.h40
-rw-r--r--include/linux/selinux.h32
-rw-r--r--include/linux/skbuff.h74
-rw-r--r--include/linux/sysctl.h4
-rw-r--r--include/linux/tcp.h8
-rw-r--r--include/linux/xfrm.h4
-rw-r--r--include/net/ieee80211.h9
-rw-r--r--include/net/ieee80211softmac.h40
-rw-r--r--include/net/ieee80211softmac_wx.h5
-rw-r--r--include/net/ip.h1
-rw-r--r--include/net/llc_if.h17
-rw-r--r--include/net/netdma.h44
-rw-r--r--include/net/netfilter/nf_conntrack.h5
-rw-r--r--include/net/netfilter/nf_conntrack_compat.h26
-rw-r--r--include/net/raw.h2
-rw-r--r--include/net/sctp/sctp.h2
-rw-r--r--include/net/sctp/structs.h3
-rw-r--r--include/net/sock.h20
-rw-r--r--include/net/tcp.h15
-rw-r--r--include/net/xfrm.h26
-rw-r--r--include/rdma/ib_addr.h114
-rw-r--r--include/rdma/ib_cache.h13
-rw-r--r--include/rdma/ib_cm.h26
-rw-r--r--include/rdma/ib_marshall.h50
-rw-r--r--include/rdma/ib_sa.h7
-rw-r--r--include/rdma/ib_smi.h36
-rw-r--r--include/rdma/ib_user_cm.h86
-rw-r--r--include/rdma/ib_user_sa.h60
-rw-r--r--include/rdma/ib_user_verbs.h80
-rw-r--r--include/rdma/ib_verbs.h22
-rw-r--r--include/rdma/rdma_cm.h256
-rw-r--r--include/rdma/rdma_cm_ib.h47
-rw-r--r--include/scsi/srp.h5
109 files changed, 2577 insertions, 889 deletions
diff --git a/include/asm-arm/arch-pxa/ohci.h b/include/asm-arm/arch-pxa/ohci.h
index 7da89569061e..e848a47128cd 100644
--- a/include/asm-arm/arch-pxa/ohci.h
+++ b/include/asm-arm/arch-pxa/ohci.h
@@ -11,6 +11,8 @@ struct pxaohci_platform_data {
11#define PMM_NPS_MODE 1 11#define PMM_NPS_MODE 1
12#define PMM_GLOBAL_MODE 2 12#define PMM_GLOBAL_MODE 2
13#define PMM_PERPORT_MODE 3 13#define PMM_PERPORT_MODE 3
14
15 int power_budget;
14}; 16};
15 17
16extern void pxa_set_ohci_info(struct pxaohci_platform_data *info); 18extern void pxa_set_ohci_info(struct pxaohci_platform_data *info);
diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h
index 1386af1cb7d9..0cc6c7060f3c 100644
--- a/include/asm-mips/addrspace.h
+++ b/include/asm-mips/addrspace.h
@@ -133,57 +133,22 @@
133 || defined (CONFIG_CPU_NEVADA) \ 133 || defined (CONFIG_CPU_NEVADA) \
134 || defined (CONFIG_CPU_TX49XX) \ 134 || defined (CONFIG_CPU_TX49XX) \
135 || defined (CONFIG_CPU_MIPS64) 135 || defined (CONFIG_CPU_MIPS64)
136#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
137#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
138#define K0SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
139#define K1SIZE _LLCONST_(0x0000001000000000) /* 2^^36 */
140#define K2SIZE _LLCONST_(0x000000ff80000000)
141#define KSEGSIZE _LLCONST_(0x000000ff80000000) /* max syssegsz */
142#define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */ 136#define TO_PHYS_MASK _LLCONST_(0x0000000fffffffff) /* 2^^36 - 1 */
143#endif 137#endif
144 138
145#if defined (CONFIG_CPU_R8000) 139#if defined (CONFIG_CPU_R8000)
146/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */ 140/* We keep KUSIZE consistent with R4000 for now (2^^40) instead of (2^^48) */
147#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
148#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
149#define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
150#define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
151#define K2SIZE _LLCONST_(0x0001000000000000)
152#define KSEGSIZE _LLCONST_(0x0000010000000000) /* max syssegsz */
153#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ 141#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
154#endif 142#endif
155 143
156#if defined (CONFIG_CPU_R10000) 144#if defined (CONFIG_CPU_R10000)
157#define KUSIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
158#define KUSIZE_64 _LLCONST_(0x0000010000000000) /* 2^^40 */
159#define K0SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
160#define K1SIZE _LLCONST_(0x0000010000000000) /* 2^^40 */
161#define K2SIZE _LLCONST_(0x00000fff80000000)
162#define KSEGSIZE _LLCONST_(0x00000fff80000000) /* max syssegsz */
163#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */ 145#define TO_PHYS_MASK _LLCONST_(0x000000ffffffffff) /* 2^^40 - 1 */
164#endif 146#endif
165 147
166#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A) 148#if defined(CONFIG_CPU_SB1) || defined(CONFIG_CPU_SB1A)
167#define KUSIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
168#define KUSIZE_64 _LLCONST_(0x0000100000000000) /* 2^^44 */
169#define K0SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
170#define K1SIZE _LLCONST_(0x0000100000000000) /* 2^^44 */
171#define K2SIZE _LLCONST_(0x0000ffff80000000)
172#define KSEGSIZE _LLCONST_(0x0000ffff80000000) /* max syssegsz */
173#define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */ 149#define TO_PHYS_MASK _LLCONST_(0x00000fffffffffff) /* 2^^44 - 1 */
174#endif 150#endif
175 151
176/*
177 * Further names for SGI source compatibility. These are stolen from
178 * IRIX's <sys/mips_addrspace.h>.
179 */
180#define KUBASE _LLCONST_(0)
181#define KUSIZE_32 _LLCONST_(0x0000000080000000) /* KUSIZE
182 for a 32 bit proc */
183#define K0BASE_EXL_WR _LLCONST_(0xa800000000000000) /* exclusive on write */
184#define K0BASE_NONCOH _LLCONST_(0x9800000000000000) /* noncoherent */
185#define K0BASE_EXL _LLCONST_(0xa000000000000000) /* exclusive */
186
187#ifndef CONFIG_CPU_R8000 152#ifndef CONFIG_CPU_R8000
188 153
189/* 154/*
diff --git a/include/asm-mips/apm.h b/include/asm-mips/apm.h
new file mode 100644
index 000000000000..e8c69208f63a
--- /dev/null
+++ b/include/asm-mips/apm.h
@@ -0,0 +1,65 @@
1/* -*- linux-c -*-
2 *
3 * (C) 2003 zecke@handhelds.org
4 *
5 * GPL version 2
6 *
7 * based on arch/arm/kernel/apm.c
8 * factor out the information needed by architectures to provide
9 * apm status
10 *
11 *
12 */
13#ifndef MIPS_ASM_SA1100_APM_H
14#define MIPS_ASM_SA1100_APM_H
15
16#include <linux/config.h>
17#include <linux/apm_bios.h>
18
19/*
20 * This structure gets filled in by the machine specific 'get_power_status'
21 * implementation. Any fields which are not set default to a safe value.
22 */
23struct apm_power_info {
24 unsigned char ac_line_status;
25#define APM_AC_OFFLINE 0
26#define APM_AC_ONLINE 1
27#define APM_AC_BACKUP 2
28#define APM_AC_UNKNOWN 0xff
29
30 unsigned char battery_status;
31#define APM_BATTERY_STATUS_HIGH 0
32#define APM_BATTERY_STATUS_LOW 1
33#define APM_BATTERY_STATUS_CRITICAL 2
34#define APM_BATTERY_STATUS_CHARGING 3
35#define APM_BATTERY_STATUS_NOT_PRESENT 4
36#define APM_BATTERY_STATUS_UNKNOWN 0xff
37
38 unsigned char battery_flag;
39#define APM_BATTERY_FLAG_HIGH (1 << 0)
40#define APM_BATTERY_FLAG_LOW (1 << 1)
41#define APM_BATTERY_FLAG_CRITICAL (1 << 2)
42#define APM_BATTERY_FLAG_CHARGING (1 << 3)
43#define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
44#define APM_BATTERY_FLAG_UNKNOWN 0xff
45
46 int battery_life;
47 int time;
48 int units;
49#define APM_UNITS_MINS 0
50#define APM_UNITS_SECS 1
51#define APM_UNITS_UNKNOWN -1
52
53};
54
55/*
56 * This allows machines to provide their own "apm get power status" function.
57 */
58extern void (*apm_get_power_status)(struct apm_power_info *);
59
60/*
61 * Queue an event (APM_SYS_SUSPEND or APM_CRITICAL_SUSPEND)
62 */
63void apm_queue_event(apm_event_t event);
64
65#endif
diff --git a/include/asm-mips/asmmacro-32.h b/include/asm-mips/asmmacro-32.h
index 11daf5ceb7b4..5de3963f511e 100644
--- a/include/asm-mips/asmmacro-32.h
+++ b/include/asm-mips/asmmacro-32.h
@@ -12,7 +12,7 @@
12#include <asm/fpregdef.h> 12#include <asm/fpregdef.h>
13#include <asm/mipsregs.h> 13#include <asm/mipsregs.h>
14 14
15 .macro fpu_save_double thread status tmp1=t0 tmp2 15 .macro fpu_save_double thread status tmp1=t0
16 cfc1 \tmp1, fcr31 16 cfc1 \tmp1, fcr31
17 sdc1 $f0, THREAD_FPR0(\thread) 17 sdc1 $f0, THREAD_FPR0(\thread)
18 sdc1 $f2, THREAD_FPR2(\thread) 18 sdc1 $f2, THREAD_FPR2(\thread)
@@ -70,7 +70,7 @@
70 sw \tmp, THREAD_FCR31(\thread) 70 sw \tmp, THREAD_FCR31(\thread)
71 .endm 71 .endm
72 72
73 .macro fpu_restore_double thread tmp=t0 73 .macro fpu_restore_double thread status tmp=t0
74 lw \tmp, THREAD_FCR31(\thread) 74 lw \tmp, THREAD_FCR31(\thread)
75 ldc1 $f0, THREAD_FPR0(\thread) 75 ldc1 $f0, THREAD_FPR0(\thread)
76 ldc1 $f2, THREAD_FPR2(\thread) 76 ldc1 $f2, THREAD_FPR2(\thread)
diff --git a/include/asm-mips/asmmacro-64.h b/include/asm-mips/asmmacro-64.h
index 559c355b9b86..225feefcb25d 100644
--- a/include/asm-mips/asmmacro-64.h
+++ b/include/asm-mips/asmmacro-64.h
@@ -53,12 +53,12 @@
53 sdc1 $f31, THREAD_FPR31(\thread) 53 sdc1 $f31, THREAD_FPR31(\thread)
54 .endm 54 .endm
55 55
56 .macro fpu_save_double thread status tmp1 tmp2 56 .macro fpu_save_double thread status tmp
57 sll \tmp2, \tmp1, 5 57 sll \tmp, \status, 5
58 bgez \tmp2, 2f 58 bgez \tmp, 2f
59 fpu_save_16odd \thread 59 fpu_save_16odd \thread
602: 602:
61 fpu_save_16even \thread \tmp1 # clobbers t1 61 fpu_save_16even \thread \tmp
62 .endm 62 .endm
63 63
64 .macro fpu_restore_16even thread tmp=t0 64 .macro fpu_restore_16even thread tmp=t0
@@ -101,13 +101,12 @@
101 ldc1 $f31, THREAD_FPR31(\thread) 101 ldc1 $f31, THREAD_FPR31(\thread)
102 .endm 102 .endm
103 103
104 .macro fpu_restore_double thread tmp 104 .macro fpu_restore_double thread status tmp
105 mfc0 t0, CP0_STATUS 105 sll \tmp, \status, 5
106 sll t1, t0, 5 106 bgez \tmp, 1f # 16 register mode?
107 bgez t1, 1f # 16 register mode?
108 107
109 fpu_restore_16odd a0 108 fpu_restore_16odd \thread
1101: fpu_restore_16even a0, t0 # clobbers t0 1091: fpu_restore_16even \thread \tmp
111 .endm 110 .endm
112 111
113 .macro cpu_save_nonscratch thread 112 .macro cpu_save_nonscratch thread
diff --git a/include/asm-mips/bootinfo.h b/include/asm-mips/bootinfo.h
index 14fc88f27226..3b745e76f429 100644
--- a/include/asm-mips/bootinfo.h
+++ b/include/asm-mips/bootinfo.h
@@ -217,6 +217,13 @@
217 */ 217 */
218#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */ 218#define MACH_GROUP_TITAN 22 /* PMC-Sierra Titan */
219#define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */ 219#define MACH_TITAN_YOSEMITE 1 /* PMC-Sierra Yosemite */
220#define MACH_TITAN_EXCITE 2 /* Basler eXcite */
221
222/*
223 * Valid machtype for group NEC EMMA2RH
224 */
225#define MACH_GROUP_NEC_EMMA2RH 25 /* NEC EMMA2RH (was 23) */
226#define MACH_NEC_MARKEINS 0 /* NEC EMMA2RH Mark-eins */
220 227
221#define CL_SIZE COMMAND_LINE_SIZE 228#define CL_SIZE COMMAND_LINE_SIZE
222 229
@@ -258,4 +265,10 @@ extern char arcs_cmdline[CL_SIZE];
258 * Registers a0, a1, a3 and a4 as passed to the kenrel entry by firmware 265 * Registers a0, a1, a3 and a4 as passed to the kenrel entry by firmware
259 */ 266 */
260extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; 267extern unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3;
268
269/*
270 * Platform memory detection hook called by setup_arch
271 */
272extern void plat_mem_setup(void);
273
261#endif /* _ASM_BOOTINFO_H */ 274#endif /* _ASM_BOOTINFO_H */
diff --git a/include/asm-mips/ddb5074.h b/include/asm-mips/ddb5074.h
deleted file mode 100644
index 0d09ac27f9a5..000000000000
--- a/include/asm-mips/ddb5074.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions
3 *
4 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
5 * Sony Software Development Center Europe (SDCE), Brussels
6 */
7
8extern void ddb5074_led_hex(int hex);
9extern void ddb5074_led_d2(int on);
10extern void ddb5074_led_d3(int on);
11
diff --git a/include/asm-mips/ddb5xxx/ddb5074.h b/include/asm-mips/ddb5xxx/ddb5074.h
deleted file mode 100644
index 58d88306af65..000000000000
--- a/include/asm-mips/ddb5xxx/ddb5074.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * include/asm-mips/ddb5074.h -- NEC DDB Vrc-5074 definitions
3 *
4 * Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
5 * Sony Software Development Center Europe (SDCE), Brussels
6 */
7
8#ifndef _ASM_DDB5XXX_DDB5074_H
9#define _ASM_DDB5XXX_DDB5074_H
10
11#include <asm/nile4.h>
12
13#define DDB_SDRAM_SIZE 0x04000000 /* 64MB */
14
15#define DDB_PCI_IO_BASE 0x06000000
16#define DDB_PCI_IO_SIZE 0x02000000 /* 32 MB */
17
18#define DDB_PCI_MEM_BASE 0x08000000
19#define DDB_PCI_MEM_SIZE 0x08000000 /* 128 MB */
20
21#define DDB_PCI_CONFIG_BASE DDB_PCI_MEM_BASE
22#define DDB_PCI_CONFIG_SIZE DDB_PCI_MEM_SIZE
23
24#define NILE4_PCI_IO_BASE 0xa6000000
25#define NILE4_PCI_MEM_BASE 0xa8000000
26#define NILE4_PCI_CFG_BASE NILE4_PCI_MEM_BASE
27#define DDB_PCI_IACK_BASE NILE4_PCI_IO_BASE
28
29#define NILE4_IRQ_BASE NUM_I8259_INTERRUPTS
30#define CPU_IRQ_BASE (NUM_NILE4_INTERRUPTS + NILE4_IRQ_BASE)
31#define CPU_NILE4_CASCADE 2
32
33extern void ddb5074_led_hex(int hex);
34extern void ddb5074_led_d2(int on);
35extern void ddb5074_led_d3(int on);
36
37extern void nile4_irq_setup(u32 base);
38#endif
diff --git a/include/asm-mips/ddb5xxx/ddb5476.h b/include/asm-mips/ddb5xxx/ddb5476.h
deleted file mode 100644
index 4c23390d9354..000000000000
--- a/include/asm-mips/ddb5xxx/ddb5476.h
+++ /dev/null
@@ -1,157 +0,0 @@
1/*
2 * header file specific for ddb5476
3 *
4 * Copyright (C) 2001 MontaVista Software Inc.
5 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 */
13
14/*
15 * Memory map (physical address)
16 *
17 * Note most of the following address must be properly aligned by the
18 * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
19 * PCI_IO_BASE must be aligned along 16MB boundary.
20 */
21#define DDB_SDRAM_BASE 0x00000000
22#define DDB_SDRAM_SIZE 0x04000000 /* 64MB */
23
24#define DDB_DCS3_BASE 0x04000000 /* flash 1 */
25#define DDB_DCS3_SIZE 0x01000000 /* 16MB */
26
27#define DDB_DCS2_BASE 0x05000000 /* flash 2 */
28#define DDB_DCS2_SIZE 0x01000000 /* 16MB */
29
30#define DDB_PCI_IO_BASE 0x06000000
31#define DDB_PCI_IO_SIZE 0x02000000 /* 32 MB */
32
33#define DDB_PCI_MEM_BASE 0x08000000
34#define DDB_PCI_MEM_SIZE 0x08000000 /* 128 MB */
35
36#define DDB_DCS5_BASE 0x13000000 /* DDB status regs */
37#define DDB_DCS5_SIZE 0x00200000 /* 2MB, 8-bit */
38
39#define DDB_DCS4_BASE 0x14000000 /* DDB control regs */
40#define DDB_DCS4_SIZE 0x00200000 /* 2MB, 8-bit */
41
42#define DDB_INTCS_BASE 0x1fa00000 /* VRC5476 control regs */
43#define DDB_INTCS_SIZE 0x00200000 /* 2MB */
44
45#define DDB_BOOTCS_BASE 0x1fc00000 /* Boot ROM / EPROM /Flash */
46#define DDB_BOOTCS_SIZE 0x00200000 /* 2 MB - doc says 4MB */
47
48
49/* aliases */
50#define DDB_PCI_CONFIG_BASE DDB_PCI_MEM_BASE
51#define DDB_PCI_CONFIG_SIZE DDB_PCI_MEM_SIZE
52
53/* PCI intr ack share PCIW0 with PCI IO */
54#define DDB_PCI_IACK_BASE DDB_PCI_IO_BASE
55
56/*
57 * Interrupt mapping
58 *
59 * We have three interrupt controllers:
60 *
61 * . CPU itself - 8 sources
62 * . i8259 - 16 sources
63 * . vrc5476 - 16 sources
64 *
65 * They connected as follows:
66 * all vrc5476 interrupts are routed to cpu IP2 (by software setting)
67 * all i2869 are routed to INTC in vrc5476 (by hardware connection)
68 *
69 * All VRC5476 PCI interrupts are level-triggered (no ack needed).
70 * All PCI irq but INTC are active low.
71 */
72
73/*
74 * irq number block assignment
75 */
76
77#define NUM_CPU_IRQ 8
78#define NUM_I8259_IRQ 16
79#define NUM_VRC5476_IRQ 16
80
81#define DDB_IRQ_BASE 0
82
83#define I8259_IRQ_BASE DDB_IRQ_BASE
84#define VRC5476_IRQ_BASE (I8259_IRQ_BASE + NUM_I8259_IRQ)
85#define CPU_IRQ_BASE (VRC5476_IRQ_BASE + NUM_VRC5476_IRQ)
86
87/*
88 * vrc5476 irq defs, see page 52-64 of Vrc5074 system controller manual
89 */
90
91#define VRC5476_IRQ_CPCE 0 /* cpu parity error */
92#define VRC5476_IRQ_CNTD 1 /* cpu no target */
93#define VRC5476_IRQ_MCE 2 /* memory check error */
94#define VRC5476_IRQ_DMA 3 /* DMA */
95#define VRC5476_IRQ_UART 4 /* vrc5476 builtin UART, not used */
96#define VRC5476_IRQ_WDOG 5 /* watchdog timer */
97#define VRC5476_IRQ_GPT 6 /* general purpose timer */
98#define VRC5476_IRQ_LBRT 7 /* local bus read timeout */
99#define VRC5476_IRQ_INTA 8 /* PCI INT #A */
100#define VRC5476_IRQ_INTB 9 /* PCI INT #B */
101#define VRC5476_IRQ_INTC 10 /* PCI INT #C */
102#define VRC5476_IRQ_INTD 11 /* PCI INT #D */
103#define VRC5476_IRQ_INTE 12 /* PCI INT #E */
104#define VRC5476_IRQ_RESERVED_13 13 /* reserved */
105#define VRC5476_IRQ_PCIS 14 /* PCI SERR # */
106#define VRC5476_IRQ_PCI 15 /* PCI internal error */
107
108/*
109 * i2859 irq assignment
110 */
111#define I8259_IRQ_RESERVED_0 0
112#define I8259_IRQ_KEYBOARD 1 /* M1543 default */
113#define I8259_IRQ_CASCADE 2
114#define I8259_IRQ_UART_B 3 /* M1543 default, may conflict with RTC according to schematic diagram */
115#define I8259_IRQ_UART_A 4 /* M1543 default */
116#define I8259_IRQ_PARALLEL 5 /* M1543 default */
117#define I8259_IRQ_RESERVED_6 6
118#define I8259_IRQ_RESERVED_7 7
119#define I8259_IRQ_RTC 8 /* who set this? */
120#define I8259_IRQ_USB 9 /* ddb_setup */
121#define I8259_IRQ_PMU 10 /* ddb_setup */
122#define I8259_IRQ_RESERVED_11 11
123#define I8259_IRQ_RESERVED_12 12 /* m1543_irq_setup */
124#define I8259_IRQ_RESERVED_13 13
125#define I8259_IRQ_HDC1 14 /* default and ddb_setup */
126#define I8259_IRQ_HDC2 15 /* default */
127
128
129/*
130 * misc
131 */
132#define VRC5476_I8259_CASCADE VRC5476_IRQ_INTC
133#define CPU_VRC5476_CASCADE 2
134
135#define is_i8259_irq(irq) ((irq) < NUM_I8259_IRQ)
136#define nile4_to_irq(n) ((n)+NUM_I8259_IRQ)
137#define irq_to_nile4(n) ((n)-NUM_I8259_IRQ)
138
139/*
140 * low-level irq functions
141 */
142#ifndef __ASSEMBLY__
143extern void nile4_map_irq(int nile4_irq, int cpu_irq);
144extern void nile4_map_irq_all(int cpu_irq);
145extern void nile4_enable_irq(int nile4_irq);
146extern void nile4_disable_irq(int nile4_irq);
147extern void nile4_disable_irq_all(void);
148extern u16 nile4_get_irq_stat(int cpu_irq);
149extern void nile4_enable_irq_output(int cpu_irq);
150extern void nile4_disable_irq_output(int cpu_irq);
151extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
152extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
153extern void nile4_clear_irq(int nile4_irq);
154extern void nile4_clear_irq_mask(u32 mask);
155extern u8 nile4_i8259_iack(void);
156extern void nile4_dump_irq_status(void); /* Debug */
157#endif /* !__ASSEMBLY__ */
diff --git a/include/asm-mips/ddb5xxx/ddb5xxx.h b/include/asm-mips/ddb5xxx/ddb5xxx.h
index 873c03f2c5fe..2f1b191c6fff 100644
--- a/include/asm-mips/ddb5xxx/ddb5xxx.h
+++ b/include/asm-mips/ddb5xxx/ddb5xxx.h
@@ -174,13 +174,8 @@
174 174
175static inline void ddb_sync(void) 175static inline void ddb_sync(void)
176{ 176{
177/* The DDB5074 doesn't seem to like these accesses. They kill the board on
178 * interrupt load
179 */
180#ifndef CONFIG_DDB5074
181 volatile u32 *p = (volatile u32 *)0xbfc00000; 177 volatile u32 *p = (volatile u32 *)0xbfc00000;
182 (void)(*p); 178 (void)(*p);
183#endif
184} 179}
185 180
186static inline void ddb_out32(u32 offset, u32 val) 181static inline void ddb_out32(u32 offset, u32 val)
@@ -260,11 +255,7 @@ extern void ddb_pci_reset_bus(void);
260/* 255/*
261 * include the board dependent part 256 * include the board dependent part
262 */ 257 */
263#if defined(CONFIG_DDB5074) 258#if defined(CONFIG_DDB5477)
264#include <asm/ddb5xxx/ddb5074.h>
265#elif defined(CONFIG_DDB5476)
266#include <asm/ddb5xxx/ddb5476.h>
267#elif defined(CONFIG_DDB5477)
268#include <asm/ddb5xxx/ddb5477.h> 259#include <asm/ddb5xxx/ddb5477.h>
269#else 260#else
270#error "Unknown DDB board!" 261#error "Unknown DDB board!"
diff --git a/include/asm-mips/emma2rh/emma2rh.h b/include/asm-mips/emma2rh/emma2rh.h
new file mode 100644
index 000000000000..4fb8df71caa9
--- /dev/null
+++ b/include/asm-mips/emma2rh/emma2rh.h
@@ -0,0 +1,330 @@
1/*
2 * include/asm-mips/emma2rh/emma2rh.h
3 * This file is EMMA2RH common header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006
6 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
8 * Copyright 2001 MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24#ifndef __ASM_EMMA2RH_EMMA2RH_H
25#define __ASM_EMMA2RH_EMMA2RH_H
26
27/*
28 * EMMA2RH registers
29 */
30#define REGBASE 0x10000000
31
32#define EMMA2RH_BHIF_STRAP_0 (0x000010+REGBASE)
33#define EMMA2RH_BHIF_INT_ST_0 (0x000030+REGBASE)
34#define EMMA2RH_BHIF_INT_ST_1 (0x000034+REGBASE)
35#define EMMA2RH_BHIF_INT_ST_2 (0x000038+REGBASE)
36#define EMMA2RH_BHIF_INT_EN_0 (0x000040+REGBASE)
37#define EMMA2RH_BHIF_INT_EN_1 (0x000044+REGBASE)
38#define EMMA2RH_BHIF_INT_EN_2 (0x000048+REGBASE)
39#define EMMA2RH_BHIF_INT1_EN_0 (0x000050+REGBASE)
40#define EMMA2RH_BHIF_INT1_EN_1 (0x000054+REGBASE)
41#define EMMA2RH_BHIF_INT1_EN_2 (0x000058+REGBASE)
42#define EMMA2RH_BHIF_SW_INT (0x000070+REGBASE)
43#define EMMA2RH_BHIF_SW_INT_EN (0x000080+REGBASE)
44#define EMMA2RH_BHIF_SW_INT_CLR (0x000090+REGBASE)
45#define EMMA2RH_BHIF_MAIN_CTRL (0x0000b4+REGBASE)
46#define EMMA2RH_BHIF_EXCEPT_VECT_BASE_ADDRESS (0x0000c0+REGBASE)
47#define EMMA2RH_GPIO_DIR (0x110d20+REGBASE)
48#define EMMA2RH_GPIO_INT_ST (0x110d30+REGBASE)
49#define EMMA2RH_GPIO_INT_MASK (0x110d3c+REGBASE)
50#define EMMA2RH_GPIO_INT_MODE (0x110d48+REGBASE)
51#define EMMA2RH_GPIO_INT_CND_A (0x110d54+REGBASE)
52#define EMMA2RH_GPIO_INT_CND_B (0x110d60+REGBASE)
53#define EMMA2RH_PBRD_INT_EN (0x100010+REGBASE)
54#define EMMA2RH_PBRD_CLKSEL (0x100028+REGBASE)
55#define EMMA2RH_PFUR0_BASE (0x101000+REGBASE)
56#define EMMA2RH_PFUR1_BASE (0x102000+REGBASE)
57#define EMMA2RH_PFUR2_BASE (0x103000+REGBASE)
58#define EMMA2RH_PIIC0_BASE (0x107000+REGBASE)
59#define EMMA2RH_PIIC1_BASE (0x108000+REGBASE)
60#define EMMA2RH_PIIC2_BASE (0x109000+REGBASE)
61#define EMMA2RH_PCI_CONTROL (0x200000+REGBASE)
62#define EMMA2RH_PCI_ARBIT_CTR (0x200004+REGBASE)
63#define EMMA2RH_PCI_IWIN0_CTR (0x200010+REGBASE)
64#define EMMA2RH_PCI_IWIN1_CTR (0x200014+REGBASE)
65#define EMMA2RH_PCI_INIT_ESWP (0x200018+REGBASE)
66#define EMMA2RH_PCI_INT (0x200020+REGBASE)
67#define EMMA2RH_PCI_INT_EN (0x200024+REGBASE)
68#define EMMA2RH_PCI_TWIN_CTR (0x200030+REGBASE)
69#define EMMA2RH_PCI_TWIN_BADR (0x200034+REGBASE)
70#define EMMA2RH_PCI_TWIN0_DADR (0x200038+REGBASE)
71#define EMMA2RH_PCI_TWIN1_DADR (0x20003c+REGBASE)
72
73/*
74 * Memory map (physical address)
75 *
76 * Note most of the following address must be properly aligned by the
77 * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
78 * PCI_IO_BASE must be aligned along 16MB boundary.
79 */
80
81/* the actual ram size is detected at run-time */
82#define EMMA2RH_RAM_BASE 0x00000000
83#define EMMA2RH_RAM_SIZE 0x10000000 /* less than 256MB */
84
85#define EMMA2RH_IO_BASE 0x10000000
86#define EMMA2RH_IO_SIZE 0x01000000 /* 16 MB */
87
88#define EMMA2RH_GENERALIO_BASE 0x11000000
89#define EMMA2RH_GENERALIO_SIZE 0x01000000 /* 16 MB */
90
91#define EMMA2RH_PCI_IO_BASE 0x12000000
92#define EMMA2RH_PCI_IO_SIZE 0x02000000 /* 32 MB */
93
94#define EMMA2RH_PCI_MEM_BASE 0x14000000
95#define EMMA2RH_PCI_MEM_SIZE 0x08000000 /* 128 MB */
96
97#define EMMA2RH_ROM_BASE 0x1c000000
98#define EMMA2RH_ROM_SIZE 0x04000000 /* 64 MB */
99
100#define EMMA2RH_PCI_CONFIG_BASE EMMA2RH_PCI_IO_BASE
101#define EMMA2RH_PCI_CONFIG_SIZE EMMA2RH_PCI_IO_SIZE
102
103#define NUM_CPU_IRQ 8
104#define NUM_EMMA2RH_IRQ 96
105
106#define CPU_EMMA2RH_CASCADE 2
107#define EMMA2RH_IRQ_BASE 0
108
109/*
110 * emma2rh irq defs
111 */
112
113#define EMMA2RH_IRQ_INT0 (0 + EMMA2RH_IRQ_BASE)
114#define EMMA2RH_IRQ_INT1 (1 + EMMA2RH_IRQ_BASE)
115#define EMMA2RH_IRQ_INT2 (2 + EMMA2RH_IRQ_BASE)
116#define EMMA2RH_IRQ_INT3 (3 + EMMA2RH_IRQ_BASE)
117#define EMMA2RH_IRQ_INT4 (4 + EMMA2RH_IRQ_BASE)
118#define EMMA2RH_IRQ_INT5 (5 + EMMA2RH_IRQ_BASE)
119#define EMMA2RH_IRQ_INT6 (6 + EMMA2RH_IRQ_BASE)
120#define EMMA2RH_IRQ_INT7 (7 + EMMA2RH_IRQ_BASE)
121#define EMMA2RH_IRQ_INT8 (8 + EMMA2RH_IRQ_BASE)
122#define EMMA2RH_IRQ_INT9 (9 + EMMA2RH_IRQ_BASE)
123#define EMMA2RH_IRQ_INT10 (10 + EMMA2RH_IRQ_BASE)
124#define EMMA2RH_IRQ_INT11 (11 + EMMA2RH_IRQ_BASE)
125#define EMMA2RH_IRQ_INT12 (12 + EMMA2RH_IRQ_BASE)
126#define EMMA2RH_IRQ_INT13 (13 + EMMA2RH_IRQ_BASE)
127#define EMMA2RH_IRQ_INT14 (14 + EMMA2RH_IRQ_BASE)
128#define EMMA2RH_IRQ_INT15 (15 + EMMA2RH_IRQ_BASE)
129#define EMMA2RH_IRQ_INT16 (16 + EMMA2RH_IRQ_BASE)
130#define EMMA2RH_IRQ_INT17 (17 + EMMA2RH_IRQ_BASE)
131#define EMMA2RH_IRQ_INT18 (18 + EMMA2RH_IRQ_BASE)
132#define EMMA2RH_IRQ_INT19 (19 + EMMA2RH_IRQ_BASE)
133#define EMMA2RH_IRQ_INT20 (20 + EMMA2RH_IRQ_BASE)
134#define EMMA2RH_IRQ_INT21 (21 + EMMA2RH_IRQ_BASE)
135#define EMMA2RH_IRQ_INT22 (22 + EMMA2RH_IRQ_BASE)
136#define EMMA2RH_IRQ_INT23 (23 + EMMA2RH_IRQ_BASE)
137#define EMMA2RH_IRQ_INT24 (24 + EMMA2RH_IRQ_BASE)
138#define EMMA2RH_IRQ_INT25 (25 + EMMA2RH_IRQ_BASE)
139#define EMMA2RH_IRQ_INT26 (26 + EMMA2RH_IRQ_BASE)
140#define EMMA2RH_IRQ_INT27 (27 + EMMA2RH_IRQ_BASE)
141#define EMMA2RH_IRQ_INT28 (28 + EMMA2RH_IRQ_BASE)
142#define EMMA2RH_IRQ_INT29 (29 + EMMA2RH_IRQ_BASE)
143#define EMMA2RH_IRQ_INT30 (30 + EMMA2RH_IRQ_BASE)
144#define EMMA2RH_IRQ_INT31 (31 + EMMA2RH_IRQ_BASE)
145#define EMMA2RH_IRQ_INT32 (32 + EMMA2RH_IRQ_BASE)
146#define EMMA2RH_IRQ_INT33 (33 + EMMA2RH_IRQ_BASE)
147#define EMMA2RH_IRQ_INT34 (34 + EMMA2RH_IRQ_BASE)
148#define EMMA2RH_IRQ_INT35 (35 + EMMA2RH_IRQ_BASE)
149#define EMMA2RH_IRQ_INT36 (36 + EMMA2RH_IRQ_BASE)
150#define EMMA2RH_IRQ_INT37 (37 + EMMA2RH_IRQ_BASE)
151#define EMMA2RH_IRQ_INT38 (38 + EMMA2RH_IRQ_BASE)
152#define EMMA2RH_IRQ_INT39 (39 + EMMA2RH_IRQ_BASE)
153#define EMMA2RH_IRQ_INT40 (40 + EMMA2RH_IRQ_BASE)
154#define EMMA2RH_IRQ_INT41 (41 + EMMA2RH_IRQ_BASE)
155#define EMMA2RH_IRQ_INT42 (42 + EMMA2RH_IRQ_BASE)
156#define EMMA2RH_IRQ_INT43 (43 + EMMA2RH_IRQ_BASE)
157#define EMMA2RH_IRQ_INT44 (44 + EMMA2RH_IRQ_BASE)
158#define EMMA2RH_IRQ_INT45 (45 + EMMA2RH_IRQ_BASE)
159#define EMMA2RH_IRQ_INT46 (46 + EMMA2RH_IRQ_BASE)
160#define EMMA2RH_IRQ_INT47 (47 + EMMA2RH_IRQ_BASE)
161#define EMMA2RH_IRQ_INT48 (48 + EMMA2RH_IRQ_BASE)
162#define EMMA2RH_IRQ_INT49 (49 + EMMA2RH_IRQ_BASE)
163#define EMMA2RH_IRQ_INT50 (50 + EMMA2RH_IRQ_BASE)
164#define EMMA2RH_IRQ_INT51 (51 + EMMA2RH_IRQ_BASE)
165#define EMMA2RH_IRQ_INT52 (52 + EMMA2RH_IRQ_BASE)
166#define EMMA2RH_IRQ_INT53 (53 + EMMA2RH_IRQ_BASE)
167#define EMMA2RH_IRQ_INT54 (54 + EMMA2RH_IRQ_BASE)
168#define EMMA2RH_IRQ_INT55 (55 + EMMA2RH_IRQ_BASE)
169#define EMMA2RH_IRQ_INT56 (56 + EMMA2RH_IRQ_BASE)
170#define EMMA2RH_IRQ_INT57 (57 + EMMA2RH_IRQ_BASE)
171#define EMMA2RH_IRQ_INT58 (58 + EMMA2RH_IRQ_BASE)
172#define EMMA2RH_IRQ_INT59 (59 + EMMA2RH_IRQ_BASE)
173#define EMMA2RH_IRQ_INT60 (60 + EMMA2RH_IRQ_BASE)
174#define EMMA2RH_IRQ_INT61 (61 + EMMA2RH_IRQ_BASE)
175#define EMMA2RH_IRQ_INT62 (62 + EMMA2RH_IRQ_BASE)
176#define EMMA2RH_IRQ_INT63 (63 + EMMA2RH_IRQ_BASE)
177
178#define EMMA2RH_IRQ_PFUR0 EMMA2RH_IRQ_INT49
179#define EMMA2RH_IRQ_PFUR1 EMMA2RH_IRQ_INT50
180#define EMMA2RH_IRQ_PFUR2 EMMA2RH_IRQ_INT51
181#define EMMA2RH_IRQ_PIIC0 EMMA2RH_IRQ_INT56
182#define EMMA2RH_IRQ_PIIC1 EMMA2RH_IRQ_INT57
183#define EMMA2RH_IRQ_PIIC2 EMMA2RH_IRQ_INT58
184
185/*
186 * EMMA2RH Register Access
187 */
188
189#define EMMA2RH_BASE (0xa0000000)
190
191static inline void emma2rh_sync(void)
192{
193 volatile u32 *p = (volatile u32 *)0xbfc00000;
194 (void)(*p);
195}
196
197static inline void emma2rh_out32(u32 offset, u32 val)
198{
199 *(volatile u32 *)(EMMA2RH_BASE | offset) = val;
200 emma2rh_sync();
201}
202
203static inline u32 emma2rh_in32(u32 offset)
204{
205 u32 val = *(volatile u32 *)(EMMA2RH_BASE | offset);
206 emma2rh_sync();
207 return val;
208}
209
210static inline void emma2rh_out16(u32 offset, u16 val)
211{
212 *(volatile u16 *)(EMMA2RH_BASE | offset) = val;
213 emma2rh_sync();
214}
215
216static inline u16 emma2rh_in16(u32 offset)
217{
218 u16 val = *(volatile u16 *)(EMMA2RH_BASE | offset);
219 emma2rh_sync();
220 return val;
221}
222
223static inline void emma2rh_out8(u32 offset, u8 val)
224{
225 *(volatile u8 *)(EMMA2RH_BASE | offset) = val;
226 emma2rh_sync();
227}
228
229static inline u8 emma2rh_in8(u32 offset)
230{
231 u8 val = *(volatile u8 *)(EMMA2RH_BASE | offset);
232 emma2rh_sync();
233 return val;
234}
235
236/**
237 * IIC registers map
238 **/
239
240/*---------------------------------------------------------------------------*/
241/* CNT - Control register (00H R/W) */
242/*---------------------------------------------------------------------------*/
243#define SPT 0x00000001
244#define STT 0x00000002
245#define ACKE 0x00000004
246#define WTIM 0x00000008
247#define SPIE 0x00000010
248#define WREL 0x00000020
249#define LREL 0x00000040
250#define IICE 0x00000080
251#define CNT_RESERVED 0x000000ff /* reserved bit 0 */
252
253#define I2C_EMMA_START (IICE | STT)
254#define I2C_EMMA_STOP (IICE | SPT)
255#define I2C_EMMA_REPSTART I2C_EMMA_START
256
257/*---------------------------------------------------------------------------*/
258/* STA - Status register (10H Read) */
259/*---------------------------------------------------------------------------*/
260#define MSTS 0x00000080
261#define ALD 0x00000040
262#define EXC 0x00000020
263#define COI 0x00000010
264#define TRC 0x00000008
265#define ACKD 0x00000004
266#define STD 0x00000002
267#define SPD 0x00000001
268
269/*---------------------------------------------------------------------------*/
270/* CSEL - Clock select register (20H R/W) */
271/*---------------------------------------------------------------------------*/
272#define FCL 0x00000080
273#define ND50 0x00000040
274#define CLD 0x00000020
275#define DAD 0x00000010
276#define SMC 0x00000008
277#define DFC 0x00000004
278#define CL 0x00000003
279#define CSEL_RESERVED 0x000000ff /* reserved bit 0 */
280
281#define FAST397 0x0000008b
282#define FAST297 0x0000008a
283#define FAST347 0x0000000b
284#define FAST260 0x0000000a
285#define FAST130 0x00000008
286#define STANDARD108 0x00000083
287#define STANDARD83 0x00000082
288#define STANDARD95 0x00000003
289#define STANDARD73 0x00000002
290#define STANDARD36 0x00000001
291#define STANDARD71 0x00000000
292
293/*---------------------------------------------------------------------------*/
294/* SVA - Slave address register (30H R/W) */
295/*---------------------------------------------------------------------------*/
296#define SVA 0x000000fe
297
298/*---------------------------------------------------------------------------*/
299/* SHR - Shift register (40H R/W) */
300/*---------------------------------------------------------------------------*/
301#define SR 0x000000ff
302
303/*---------------------------------------------------------------------------*/
304/* INT - Interrupt register (50H R/W) */
305/* INTM - Interrupt mask register (60H R/W) */
306/*---------------------------------------------------------------------------*/
307#define INTE0 0x00000001
308
309/***********************************************************************
310 * I2C registers
311 ***********************************************************************
312 */
313#define I2C_EMMA_CNT 0x00
314#define I2C_EMMA_STA 0x10
315#define I2C_EMMA_CSEL 0x20
316#define I2C_EMMA_SVA 0x30
317#define I2C_EMMA_SHR 0x40
318#define I2C_EMMA_INT 0x50
319#define I2C_EMMA_INTM 0x60
320
321/*
322 * include the board dependent part
323 */
324#if defined(CONFIG_MARKEINS)
325#include <asm/emma2rh/markeins.h>
326#else
327#error "Unknown EMMA2RH board!"
328#endif
329
330#endif /* __ASM_EMMA2RH_EMMA2RH_H */
diff --git a/include/asm-mips/emma2rh/markeins.h b/include/asm-mips/emma2rh/markeins.h
new file mode 100644
index 000000000000..8fa766795078
--- /dev/null
+++ b/include/asm-mips/emma2rh/markeins.h
@@ -0,0 +1,76 @@
1/*
2 * include/asm-mips/emma2rh/markeins.h
3 * This file is EMMA2RH board depended header.
4 *
5 * Copyright (C) NEC Electronics Corporation 2005-2006
6 *
7 * This file based on include/asm-mips/ddb5xxx/ddb5xxx.h
8 * Copyright 2001 MontaVista Software Inc.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#ifndef MARKEINS_H
26#define MARKEINS_H
27
28#define NUM_EMMA2RH_IRQ_SW 32
29#define NUM_EMMA2RH_IRQ_GPIO 32
30
31#define EMMA2RH_SW_CASCADE (EMMA2RH_IRQ_INT7 - EMMA2RH_IRQ_INT0)
32#define EMMA2RH_GPIO_CASCADE (EMMA2RH_IRQ_INT46 - EMMA2RH_IRQ_INT0)
33
34#define EMMA2RH_SW_IRQ_BASE (EMMA2RH_IRQ_BASE + NUM_EMMA2RH_IRQ)
35#define EMMA2RH_GPIO_IRQ_BASE (EMMA2RH_SW_IRQ_BASE + NUM_EMMA2RH_IRQ_SW)
36#define CPU_IRQ_BASE (EMMA2RH_GPIO_IRQ_BASE + NUM_EMMA2RH_IRQ_GPIO)
37
38#define EMMA2RH_SW_IRQ_INT0 (0+EMMA2RH_SW_IRQ_BASE)
39#define EMMA2RH_SW_IRQ_INT1 (1+EMMA2RH_SW_IRQ_BASE)
40#define EMMA2RH_SW_IRQ_INT2 (2+EMMA2RH_SW_IRQ_BASE)
41#define EMMA2RH_SW_IRQ_INT3 (3+EMMA2RH_SW_IRQ_BASE)
42#define EMMA2RH_SW_IRQ_INT4 (4+EMMA2RH_SW_IRQ_BASE)
43#define EMMA2RH_SW_IRQ_INT5 (5+EMMA2RH_SW_IRQ_BASE)
44#define EMMA2RH_SW_IRQ_INT6 (6+EMMA2RH_SW_IRQ_BASE)
45#define EMMA2RH_SW_IRQ_INT7 (7+EMMA2RH_SW_IRQ_BASE)
46#define EMMA2RH_SW_IRQ_INT8 (8+EMMA2RH_SW_IRQ_BASE)
47#define EMMA2RH_SW_IRQ_INT9 (9+EMMA2RH_SW_IRQ_BASE)
48#define EMMA2RH_SW_IRQ_INT10 (10+EMMA2RH_SW_IRQ_BASE)
49#define EMMA2RH_SW_IRQ_INT11 (11+EMMA2RH_SW_IRQ_BASE)
50#define EMMA2RH_SW_IRQ_INT12 (12+EMMA2RH_SW_IRQ_BASE)
51#define EMMA2RH_SW_IRQ_INT13 (13+EMMA2RH_SW_IRQ_BASE)
52#define EMMA2RH_SW_IRQ_INT14 (14+EMMA2RH_SW_IRQ_BASE)
53#define EMMA2RH_SW_IRQ_INT15 (15+EMMA2RH_SW_IRQ_BASE)
54#define EMMA2RH_SW_IRQ_INT16 (16+EMMA2RH_SW_IRQ_BASE)
55#define EMMA2RH_SW_IRQ_INT17 (17+EMMA2RH_SW_IRQ_BASE)
56#define EMMA2RH_SW_IRQ_INT18 (18+EMMA2RH_SW_IRQ_BASE)
57#define EMMA2RH_SW_IRQ_INT19 (19+EMMA2RH_SW_IRQ_BASE)
58#define EMMA2RH_SW_IRQ_INT20 (20+EMMA2RH_SW_IRQ_BASE)
59#define EMMA2RH_SW_IRQ_INT21 (21+EMMA2RH_SW_IRQ_BASE)
60#define EMMA2RH_SW_IRQ_INT22 (22+EMMA2RH_SW_IRQ_BASE)
61#define EMMA2RH_SW_IRQ_INT23 (23+EMMA2RH_SW_IRQ_BASE)
62#define EMMA2RH_SW_IRQ_INT24 (24+EMMA2RH_SW_IRQ_BASE)
63#define EMMA2RH_SW_IRQ_INT25 (25+EMMA2RH_SW_IRQ_BASE)
64#define EMMA2RH_SW_IRQ_INT26 (26+EMMA2RH_SW_IRQ_BASE)
65#define EMMA2RH_SW_IRQ_INT27 (27+EMMA2RH_SW_IRQ_BASE)
66#define EMMA2RH_SW_IRQ_INT28 (28+EMMA2RH_SW_IRQ_BASE)
67#define EMMA2RH_SW_IRQ_INT29 (29+EMMA2RH_SW_IRQ_BASE)
68#define EMMA2RH_SW_IRQ_INT30 (30+EMMA2RH_SW_IRQ_BASE)
69#define EMMA2RH_SW_IRQ_INT31 (31+EMMA2RH_SW_IRQ_BASE)
70
71#define MARKEINS_PCI_IRQ_INTA EMMA2RH_GPIO_IRQ_BASE+15
72#define MARKEINS_PCI_IRQ_INTB EMMA2RH_GPIO_IRQ_BASE+16
73#define MARKEINS_PCI_IRQ_INTC EMMA2RH_GPIO_IRQ_BASE+17
74#define MARKEINS_PCI_IRQ_INTD EMMA2RH_GPIO_IRQ_BASE+18
75
76#endif /* CONFIG_MARKEINS */
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h
index b0f50015e252..8bf510a27c64 100644
--- a/include/asm-mips/fpu.h
+++ b/include/asm-mips/fpu.h
@@ -138,10 +138,9 @@ static inline fpureg_t *get_fpu_regs(struct task_struct *tsk)
138 if (cpu_has_fpu) { 138 if (cpu_has_fpu) {
139 if ((tsk == current) && __is_fpu_owner()) 139 if ((tsk == current) && __is_fpu_owner())
140 _save_fp(current); 140 _save_fp(current);
141 return tsk->thread.fpu.hard.fpr;
142 } 141 }
143 142
144 return tsk->thread.fpu.soft.fpr; 143 return tsk->thread.fpu.fpr;
145} 144}
146 145
147#endif /* _ASM_FPU_H */ 146#endif /* _ASM_FPU_H */
diff --git a/include/asm-mips/fpu_emulator.h b/include/asm-mips/fpu_emulator.h
index 16cb4d11dd0b..2731c38bd7ae 100644
--- a/include/asm-mips/fpu_emulator.h
+++ b/include/asm-mips/fpu_emulator.h
@@ -12,8 +12,8 @@
12 * with this program; if not, write to the Free Software Foundation, Inc., 12 * with this program; if not, write to the Free Software Foundation, Inc.,
13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 13 * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
14 * 14 *
15 * Further private data for which no space exists in mips_fpu_soft_struct. 15 * Further private data for which no space exists in mips_fpu_struct.
16 * This should be subsumed into the mips_fpu_soft_struct structure as 16 * This should be subsumed into the mips_fpu_struct structure as
17 * defined in processor.h as soon as the absurd wired absolute assembler 17 * defined in processor.h as soon as the absurd wired absolute assembler
18 * offsets become dynamic at compile time. 18 * offsets become dynamic at compile time.
19 * 19 *
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 12d118f1bc9c..1f94640becc4 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -22,51 +22,53 @@
22 " .set push \n" \ 22 " .set push \n" \
23 " .set noat \n" \ 23 " .set noat \n" \
24 " .set mips3 \n" \ 24 " .set mips3 \n" \
25 "1: ll %1, (%3) # __futex_atomic_op \n" \ 25 "1: ll %1, %4 # __futex_atomic_op \n" \
26 " .set mips0 \n" \ 26 " .set mips0 \n" \
27 " " insn " \n" \ 27 " " insn " \n" \
28 " .set mips3 \n" \ 28 " .set mips3 \n" \
29 "2: sc $1, (%3) \n" \ 29 "2: sc $1, %2 \n" \
30 " beqzl $1, 1b \n" \ 30 " beqzl $1, 1b \n" \
31 __FUTEX_SMP_SYNC \ 31 __FUTEX_SMP_SYNC \
32 "3: \n" \ 32 "3: \n" \
33 " .set pop \n" \ 33 " .set pop \n" \
34 " .set mips0 \n" \ 34 " .set mips0 \n" \
35 " .section .fixup,\"ax\" \n" \ 35 " .section .fixup,\"ax\" \n" \
36 "4: li %0, %5 \n" \ 36 "4: li %0, %6 \n" \
37 " j 2b \n" \ 37 " j 2b \n" \
38 " .previous \n" \ 38 " .previous \n" \
39 " .section __ex_table,\"a\" \n" \ 39 " .section __ex_table,\"a\" \n" \
40 " "__UA_ADDR "\t1b, 4b \n" \ 40 " "__UA_ADDR "\t1b, 4b \n" \
41 " "__UA_ADDR "\t2b, 4b \n" \ 41 " "__UA_ADDR "\t2b, 4b \n" \
42 " .previous \n" \ 42 " .previous \n" \
43 : "=r" (ret), "=r" (oldval) \ 43 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
44 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 44 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
45 : "memory"); \
45 } else if (cpu_has_llsc) { \ 46 } else if (cpu_has_llsc) { \
46 __asm__ __volatile__( \ 47 __asm__ __volatile__( \
47 " .set push \n" \ 48 " .set push \n" \
48 " .set noat \n" \ 49 " .set noat \n" \
49 " .set mips3 \n" \ 50 " .set mips3 \n" \
50 "1: ll %1, (%3) # __futex_atomic_op \n" \ 51 "1: ll %1, %4 # __futex_atomic_op \n" \
51 " .set mips0 \n" \ 52 " .set mips0 \n" \
52 " " insn " \n" \ 53 " " insn " \n" \
53 " .set mips3 \n" \ 54 " .set mips3 \n" \
54 "2: sc $1, (%3) \n" \ 55 "2: sc $1, %2 \n" \
55 " beqz $1, 1b \n" \ 56 " beqz $1, 1b \n" \
56 __FUTEX_SMP_SYNC \ 57 __FUTEX_SMP_SYNC \
57 "3: \n" \ 58 "3: \n" \
58 " .set pop \n" \ 59 " .set pop \n" \
59 " .set mips0 \n" \ 60 " .set mips0 \n" \
60 " .section .fixup,\"ax\" \n" \ 61 " .section .fixup,\"ax\" \n" \
61 "4: li %0, %5 \n" \ 62 "4: li %0, %6 \n" \
62 " j 2b \n" \ 63 " j 2b \n" \
63 " .previous \n" \ 64 " .previous \n" \
64 " .section __ex_table,\"a\" \n" \ 65 " .section __ex_table,\"a\" \n" \
65 " "__UA_ADDR "\t1b, 4b \n" \ 66 " "__UA_ADDR "\t1b, 4b \n" \
66 " "__UA_ADDR "\t2b, 4b \n" \ 67 " "__UA_ADDR "\t2b, 4b \n" \
67 " .previous \n" \ 68 " .previous \n" \
68 : "=r" (ret), "=r" (oldval) \ 69 : "=r" (ret), "=&r" (oldval), "=R" (*uaddr) \
69 : "0" (0), "r" (uaddr), "Jr" (oparg), "i" (-EFAULT)); \ 70 : "0" (0), "R" (*uaddr), "Jr" (oparg), "i" (-EFAULT) \
71 : "memory"); \
70 } else \ 72 } else \
71 ret = -ENOSYS; \ 73 ret = -ENOSYS; \
72} 74}
@@ -89,23 +91,23 @@ futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
89 91
90 switch (op) { 92 switch (op) {
91 case FUTEX_OP_SET: 93 case FUTEX_OP_SET:
92 __futex_atomic_op("move $1, %z4", ret, oldval, uaddr, oparg); 94 __futex_atomic_op("move $1, %z5", ret, oldval, uaddr, oparg);
93 break; 95 break;
94 96
95 case FUTEX_OP_ADD: 97 case FUTEX_OP_ADD:
96 __futex_atomic_op("addu $1, %1, %z4", 98 __futex_atomic_op("addu $1, %1, %z5",
97 ret, oldval, uaddr, oparg); 99 ret, oldval, uaddr, oparg);
98 break; 100 break;
99 case FUTEX_OP_OR: 101 case FUTEX_OP_OR:
100 __futex_atomic_op("or $1, %1, %z4", 102 __futex_atomic_op("or $1, %1, %z5",
101 ret, oldval, uaddr, oparg); 103 ret, oldval, uaddr, oparg);
102 break; 104 break;
103 case FUTEX_OP_ANDN: 105 case FUTEX_OP_ANDN:
104 __futex_atomic_op("and $1, %1, %z4", 106 __futex_atomic_op("and $1, %1, %z5",
105 ret, oldval, uaddr, ~oparg); 107 ret, oldval, uaddr, ~oparg);
106 break; 108 break;
107 case FUTEX_OP_XOR: 109 case FUTEX_OP_XOR:
108 __futex_atomic_op("xor $1, %1, %z4", 110 __futex_atomic_op("xor $1, %1, %z5",
109 ret, oldval, uaddr, oparg); 111 ret, oldval, uaddr, oparg);
110 break; 112 break;
111 default: 113 default:
diff --git a/include/asm-mips/mach-ddb5074/mc146818rtc.h b/include/asm-mips/mach-ddb5074/mc146818rtc.h
deleted file mode 100644
index 2eb9acb10a5a..000000000000
--- a/include/asm-mips/mach-ddb5074/mc146818rtc.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1998, 2001, 03 by Ralf Baechle
7 *
8 * RTC routines for PC style attached Dallas chip.
9 */
10#ifndef __ASM_MACH_DDB5074_MC146818RTC_H
11#define __ASM_MACH_DDB5074_MC146818RTC_H
12
13#include <asm/ddb5xxx/ddb5074.h>
14#include <asm/ddb5xxx/ddb5xxx.h>
15
16#define RTC_PORT(x) (0x70 + (x))
17#define RTC_IRQ 8
18
19static inline unsigned char CMOS_READ(unsigned long addr)
20{
21 return *(volatile unsigned char *)(KSEG1ADDR(DDB_PCI_MEM_BASE)+addr);
22}
23
24static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
25{
26 *(volatile unsigned char *)(KSEG1ADDR(DDB_PCI_MEM_BASE)+addr) = data;
27}
28
29#define RTC_ALWAYS_BCD 1
30
31#endif /* __ASM_MACH_DDB5074_MC146818RTC_H */
diff --git a/include/asm-mips/mach-dec/param.h b/include/asm-mips/mach-dec/param.h
deleted file mode 100644
index 3e4f0e390847..000000000000
--- a/include/asm-mips/mach-dec/param.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_DEC_PARAM_H
9#define __ASM_MACH_DEC_PARAM_H
10
11/*
12 * log2(HZ), change this here if you want another HZ value. This is also
13 * used in dec_time_init. Minimum is 1, Maximum is 15.
14 */
15#define LOG_2_HZ 7
16#define HZ (1 << LOG_2_HZ)
17
18#endif /* __ASM_MACH_DEC_PARAM_H */
diff --git a/include/asm-mips/mach-mips/param.h b/include/asm-mips/mach-emma2rh/irq.h
index 805ef6d27d3c..bce64244b800 100644
--- a/include/asm-mips/mach-mips/param.h
+++ b/include/asm-mips/mach-emma2rh/irq.h
@@ -5,9 +5,9 @@
5 * 5 *
6 * Copyright (C) 2003 by Ralf Baechle 6 * Copyright (C) 2003 by Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_MIPS_PARAM_H 8#ifndef __ASM_MACH_EMMA2RH_IRQ_H
9#define __ASM_MACH_MIPS_PARAM_H 9#define __ASM_MACH_EMMA2RH_IRQ_H
10 10
11#define HZ 100 /* Internal kernel timer frequency */ 11#define NR_IRQS 256
12 12
13#endif /* __ASM_MACH_MIPS_PARAM_H */ 13#endif /* __ASM_MACH_EMMA2RH_IRQ_H */
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
new file mode 100644
index 000000000000..abb76b2fd865
--- /dev/null
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -0,0 +1,40 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com>
7 */
8#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
10
11/*
12 * Basler eXcite has an RM9122 processor.
13 */
14#define cpu_has_watch 1
15#define cpu_has_mips16 0
16#define cpu_has_divec 0
17#define cpu_has_vce 0
18#define cpu_has_cache_cdex_p 0
19#define cpu_has_cache_cdex_s 0
20#define cpu_has_prefetch 1
21#define cpu_has_mcheck 0
22#define cpu_has_ejtag 0
23
24#define cpu_has_llsc 1
25#define cpu_has_vtag_icache 0
26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 0
30
31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1
33
34#define cpu_has_subset_pcaches 0
35
36#define cpu_dcache_line_size() 32
37#define cpu_icache_line_size() 32
38#define cpu_scache_line_size() 32
39
40#endif /* __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H */
diff --git a/include/asm-mips/mach-excite/excite.h b/include/asm-mips/mach-excite/excite.h
new file mode 100644
index 000000000000..c52610de2b3a
--- /dev/null
+++ b/include/asm-mips/mach-excite/excite.h
@@ -0,0 +1,155 @@
1#ifndef __EXCITE_H__
2#define __EXCITE_H__
3
4#include <linux/config.h>
5#include <linux/init.h>
6#include <asm/addrspace.h>
7#include <asm/types.h>
8
9#define EXCITE_CPU_EXT_CLOCK 100000000
10
11#if !defined(__ASSEMBLER__)
12void __init excite_kgdb_init(void);
13void excite_procfs_init(void);
14extern unsigned long memsize;
15extern char modetty[];
16extern u32 unit_id;
17#endif
18
19/* Base name for XICAP devices */
20#define XICAP_NAME "xicap_gpi"
21
22/* OCD register offsets */
23#define LKB0 0x0038
24#define LKB5 0x0128
25#define LKM5 0x012C
26#define LKB7 0x0138
27#define LKM7 0x013c
28#define LKB8 0x0140
29#define LKM8 0x0144
30#define LKB9 0x0148
31#define LKM9 0x014c
32#define LKB10 0x0150
33#define LKM10 0x0154
34#define LKB11 0x0158
35#define LKM11 0x015c
36#define LKB12 0x0160
37#define LKM12 0x0164
38#define LKB13 0x0168
39#define LKM13 0x016c
40#define LDP0 0x0200
41#define LDP1 0x0210
42#define LDP2 0x0220
43#define LDP3 0x0230
44#define INTPIN0 0x0A40
45#define INTPIN1 0x0A44
46#define INTPIN2 0x0A48
47#define INTPIN3 0x0A4C
48#define INTPIN4 0x0A50
49#define INTPIN5 0x0A54
50#define INTPIN6 0x0A58
51#define INTPIN7 0x0A5C
52
53
54
55
56/* TITAN register offsets */
57#define CPRR 0x0004
58#define CPDSR 0x0008
59#define CPTC0R 0x000c
60#define CPTC1R 0x0010
61#define CPCFG0 0x0020
62#define CPCFG1 0x0024
63#define CPDST0A 0x0028
64#define CPDST0B 0x002c
65#define CPDST1A 0x0030
66#define CPDST1B 0x0034
67#define CPXDSTA 0x0038
68#define CPXDSTB 0x003c
69#define CPXCISRA 0x0048
70#define CPXCISRB 0x004c
71#define CPGIG0ER 0x0050
72#define CPGIG1ER 0x0054
73#define CPGRWL 0x0068
74#define CPURSLMT 0x00f8
75#define UACFG 0x0200
76#define UAINTS 0x0204
77#define SDRXFCIE 0x4828
78#define SDTXFCIE 0x4928
79#define INTP0Status0 0x1B00
80#define INTP0Mask0 0x1B04
81#define INTP0Set0 0x1B08
82#define INTP0Clear0 0x1B0C
83#define GXCFG 0x5000
84#define GXDMADRPFX 0x5018
85#define GXDMA_DESCADR 0x501c
86#define GXCH0TDESSTRT 0x5054
87
88/* IRQ definitions */
89#define NMICONFIG 0xac0
90#define TITAN_MSGINT 0xc4
91#define TITAN_IRQ ((TITAN_MSGINT / 0x20) + 2)
92#define FPGA0_MSGINT 0x5a
93#define FPGA0_IRQ ((FPGA0_MSGINT / 0x20) + 2)
94#define FPGA1_MSGINT 0x7b
95#define FPGA1_IRQ ((FPGA1_MSGINT / 0x20) + 2)
96#define PHY_MSGINT 0x9c
97#define PHY_IRQ ((PHY_MSGINT / 0x20) + 2)
98
99#if defined(CONFIG_BASLER_EXCITE_PROTOTYPE)
100/* Pre-release units used interrupt pin #9 */
101#define USB_IRQ 11
102#else
103/* Re-designed units use interrupt pin #1 */
104#define USB_MSGINT 0x39
105#define USB_IRQ ((USB_MSGINT / 0x20) + 2)
106#endif
107#define TIMER_IRQ 12
108
109
110/* Device address ranges */
111#define EXCITE_OFFS_OCD 0x1fffc000
112#define EXCITE_SIZE_OCD (16 * 1024)
113#define EXCITE_PHYS_OCD CPHYSADDR(EXCITE_OFFS_OCD)
114#define EXCITE_ADDR_OCD CKSEG1ADDR(EXCITE_OFFS_OCD)
115
116#define EXCITE_OFFS_SCRAM 0x1fffa000
117#define EXCITE_SIZE_SCRAM (8 << 10)
118#define EXCITE_PHYS_SCRAM CPHYSADDR(EXCITE_OFFS_SCRAM)
119#define EXCITE_ADDR_SCRAM CKSEG1ADDR(EXCITE_OFFS_SCRAM)
120
121#define EXCITE_OFFS_PCI_IO 0x1fff8000
122#define EXCITE_SIZE_PCI_IO (8 << 10)
123#define EXCITE_PHYS_PCI_IO CPHYSADDR(EXCITE_OFFS_PCI_IO)
124#define EXCITE_ADDR_PCI_IO CKSEG1ADDR(EXCITE_OFFS_PCI_IO)
125
126#define EXCITE_OFFS_TITAN 0x1fff0000
127#define EXCITE_SIZE_TITAN (32 << 10)
128#define EXCITE_PHYS_TITAN CPHYSADDR(EXCITE_OFFS_TITAN)
129#define EXCITE_ADDR_TITAN CKSEG1ADDR(EXCITE_OFFS_TITAN)
130
131#define EXCITE_OFFS_PCI_MEM 0x1ffe0000
132#define EXCITE_SIZE_PCI_MEM (64 << 10)
133#define EXCITE_PHYS_PCI_MEM CPHYSADDR(EXCITE_OFFS_PCI_MEM)
134#define EXCITE_ADDR_PCI_MEM CKSEG1ADDR(EXCITE_OFFS_PCI_MEM)
135
136#define EXCITE_OFFS_FPGA 0x1ffdc000
137#define EXCITE_SIZE_FPGA (16 << 10)
138#define EXCITE_PHYS_FPGA CPHYSADDR(EXCITE_OFFS_FPGA)
139#define EXCITE_ADDR_FPGA CKSEG1ADDR(EXCITE_OFFS_FPGA)
140
141#define EXCITE_OFFS_NAND 0x1ffd8000
142#define EXCITE_SIZE_NAND (16 << 10)
143#define EXCITE_PHYS_NAND CPHYSADDR(EXCITE_OFFS_NAND)
144#define EXCITE_ADDR_NAND CKSEG1ADDR(EXCITE_OFFS_NAND)
145
146#define EXCITE_OFFS_BOOTROM 0x1f000000
147#define EXCITE_SIZE_BOOTROM (8 << 20)
148#define EXCITE_PHYS_BOOTROM CPHYSADDR(EXCITE_OFFS_BOOTROM)
149#define EXCITE_ADDR_BOOTROM CKSEG1ADDR(EXCITE_OFFS_BOOTROM)
150
151/* FPGA address offsets */
152#define EXCITE_FPGA_DPR 0x0104 /* dual-ported ram */
153#define EXCITE_FPGA_SYSCTL 0x0200 /* system control register block */
154
155#endif /* __EXCITE_H__ */
diff --git a/include/asm-mips/mach-excite/excite_nandflash.h b/include/asm-mips/mach-excite/excite_nandflash.h
new file mode 100644
index 000000000000..c4cf6140622e
--- /dev/null
+++ b/include/asm-mips/mach-excite/excite_nandflash.h
@@ -0,0 +1,7 @@
1#ifndef __EXCITE_NANDFLASH_H__
2#define __EXCITE_NANDFLASH_H__
3
4/* Resource names */
5#define EXCITE_NANDFLASH_RESOURCE_REGS "excite_nandflash_regs"
6
7#endif /* __EXCITE_NANDFLASH_H__ */
diff --git a/include/asm-mips/mach-excite/rm9k_eth.h b/include/asm-mips/mach-excite/rm9k_eth.h
new file mode 100644
index 000000000000..94705a46f72e
--- /dev/null
+++ b/include/asm-mips/mach-excite/rm9k_eth.h
@@ -0,0 +1,23 @@
1#if !defined(__RM9K_ETH_H__)
2#define __RM9K_ETH_H__
3
4#define RM9K_GE_NAME "rm9k_ge"
5
6/* Resource names */
7#define RM9K_GE_RESOURCE_MAC "rm9k_ge_mac"
8#define RM9K_GE_RESOURCE_MSTAT "rm9k_ge_mstat"
9#define RM9K_GE_RESOURCE_PKTPROC "rm9k_ge_pktproc"
10#define RM9K_GE_RESOURCE_XDMA "rm9k_ge_xdma"
11#define RM9K_GE_RESOURCE_FIFO_RX "rm9k_ge_fifo_rx"
12#define RM9K_GE_RESOURCE_FIFO_TX "rm9k_ge_fifo_tx"
13#define RM9K_GE_RESOURCE_FIFOMEM_RX "rm9k_ge_fifo_memory_rx"
14#define RM9K_GE_RESOURCE_FIFOMEM_TX "rm9k_ge_fifo_memory_tx"
15#define RM9K_GE_RESOURCE_PHY "rm9k_ge_phy"
16#define RM9K_GE_RESOURCE_DMADESC_RX "rm9k_ge_dmadesc_rx"
17#define RM9K_GE_RESOURCE_DMADESC_TX "rm9k_ge_dmadesc_tx"
18#define RM9K_GE_RESOURCE_IRQ_MAIN "rm9k_ge_irq_main"
19#define RM9K_GE_RESOURCE_IRQ_PHY "rm9k_ge_irq_phy"
20#define RM9K_GE_RESOURCE_GPI_SLICE "rm9k_ge_gpi_slice"
21#define RM9K_GE_RESOURCE_MDIO_CHANNEL "rm9k_ge_mdio_channel"
22
23#endif /* !defined(__RM9K_ETH_H__) */
diff --git a/include/asm-mips/mach-excite/rm9k_wdt.h b/include/asm-mips/mach-excite/rm9k_wdt.h
new file mode 100644
index 000000000000..3fa3c08d2da7
--- /dev/null
+++ b/include/asm-mips/mach-excite/rm9k_wdt.h
@@ -0,0 +1,12 @@
1#ifndef __RM9K_WDT_H__
2#define __RM9K_WDT_H__
3
4/* Device name */
5#define WDT_NAME "wdt_gpi"
6
7/* Resource names */
8#define WDT_RESOURCE_REGS "excite_watchdog_regs"
9#define WDT_RESOURCE_IRQ "excite_watchdog_irq"
10#define WDT_RESOURCE_COUNTER "excite_watchdog_counter"
11
12#endif /* __RM9K_WDT_H__ */
diff --git a/include/asm-mips/mach-excite/rm9k_xicap.h b/include/asm-mips/mach-excite/rm9k_xicap.h
new file mode 100644
index 000000000000..009577734a8d
--- /dev/null
+++ b/include/asm-mips/mach-excite/rm9k_xicap.h
@@ -0,0 +1,16 @@
1#ifndef __EXCITE_XICAP_H__
2#define __EXCITE_XICAP_H__
3
4
5/* Resource names */
6#define XICAP_RESOURCE_FIFO_RX "xicap_fifo_rx"
7#define XICAP_RESOURCE_FIFO_TX "xicap_fifo_tx"
8#define XICAP_RESOURCE_XDMA "xicap_xdma"
9#define XICAP_RESOURCE_DMADESC "xicap_dmadesc"
10#define XICAP_RESOURCE_PKTPROC "xicap_pktproc"
11#define XICAP_RESOURCE_IRQ "xicap_irq"
12#define XICAP_RESOURCE_GPI_SLICE "xicap_gpi_slice"
13#define XICAP_RESOURCE_FIFO_BLK "xicap_fifo_blocks"
14#define XICAP_RESOURCE_PKT_STREAM "xicap_pkt_stream"
15
16#endif /* __EXCITE_XICAP_H__ */
diff --git a/include/asm-mips/mach-generic/param.h b/include/asm-mips/mach-generic/param.h
deleted file mode 100644
index a0d12f964e4f..000000000000
--- a/include/asm-mips/mach-generic/param.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_GENERIC_PARAM_H
9#define __ASM_MACH_GENERIC_PARAM_H
10
11#define HZ 1000 /* Internal kernel timer frequency */
12
13#endif /* __ASM_MACH_GENERIC_PARAM_H */
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
index 2a37bedb4053..f7c5dc8a5336 100644
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
@@ -13,7 +13,7 @@
13 */ 13 */
14#define cpu_has_tlb 1 14#define cpu_has_tlb 1
15#define cpu_has_4kex 1 15#define cpu_has_4kex 1
16#define cpu_has_4kcache 1 16#define cpu_has_4k_cache 1
17#define cpu_has_fpu 1 17#define cpu_has_fpu 1
18#define cpu_has_32fpr 1 18#define cpu_has_32fpr 1
19#define cpu_has_counter 1 19#define cpu_has_counter 1
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index 2d2f5b91e47f..19c2d135985b 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -31,6 +31,9 @@
31#define cpu_has_nofpuex 0 31#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 32#define cpu_has_64bits 1
33 33
34#define cpu_has_4kex 1
35#define cpu_has_4k_cache 1
36
34#define cpu_has_subset_pcaches 1 37#define cpu_has_subset_pcaches 1
35 38
36#define cpu_dcache_line_size() 32 39#define cpu_dcache_line_size() 32
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index 36070b5654ab..f0ef1ac9ecd7 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -38,6 +38,8 @@
38#define cpu_has_vtag_icache 0 38#define cpu_has_vtag_icache 0
39#define cpu_has_ic_fills_f_dc 0 39#define cpu_has_ic_fills_f_dc 0
40#define cpu_has_dsp 0 40#define cpu_has_dsp 0
41#define cpu_has_4k_cache 1
42
41 43
42#define cpu_has_mips32r1 0 44#define cpu_has_mips32r1 0
43#define cpu_has_mips32r2 0 45#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-jazz/param.h b/include/asm-mips/mach-jazz/param.h
deleted file mode 100644
index 639763a517bc..000000000000
--- a/include/asm-mips/mach-jazz/param.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_JAZZ_PARAM_H
9#define __ASM_MACH_JAZZ_PARAM_H
10
11/*
12 * Jazz is currently using the internal 100Hz timer of the R4030
13 */
14#define HZ 100 /* Internal kernel timer frequency */
15
16#endif /* __ASM_MACH_JAZZ_PARAM_H */
diff --git a/include/asm-mips/mach-mips/cpu-feature-overrides.h b/include/asm-mips/mach-mips/cpu-feature-overrides.h
index e06af6c86f86..12c937283bb4 100644
--- a/include/asm-mips/mach-mips/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-mips/cpu-feature-overrides.h
@@ -17,7 +17,7 @@
17#ifdef CONFIG_CPU_MIPS32 17#ifdef CONFIG_CPU_MIPS32
18#define cpu_has_tlb 1 18#define cpu_has_tlb 1
19#define cpu_has_4kex 1 19#define cpu_has_4kex 1
20#define cpu_has_4kcache 1 20#define cpu_has_4k_cache 1
21/* #define cpu_has_fpu ? */ 21/* #define cpu_has_fpu ? */
22/* #define cpu_has_32fpr ? */ 22/* #define cpu_has_32fpr ? */
23#define cpu_has_counter 1 23#define cpu_has_counter 1
@@ -47,7 +47,7 @@
47#ifdef CONFIG_CPU_MIPS64 47#ifdef CONFIG_CPU_MIPS64
48#define cpu_has_tlb 1 48#define cpu_has_tlb 1
49#define cpu_has_4kex 1 49#define cpu_has_4kex 1
50#define cpu_has_4kcache 1 50#define cpu_has_4k_cache 1
51/* #define cpu_has_fpu ? */ 51/* #define cpu_has_fpu ? */
52/* #define cpu_has_32fpr ? */ 52/* #define cpu_has_32fpr ? */
53#define cpu_has_counter 1 53#define cpu_has_counter 1
diff --git a/include/asm-mips/mach-qemu/param.h b/include/asm-mips/mach-qemu/param.h
deleted file mode 100644
index cb30ee490ae6..000000000000
--- a/include/asm-mips/mach-qemu/param.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 by Ralf Baechle
7 */
8#ifndef __ASM_MACH_QEMU_PARAM_H
9#define __ASM_MACH_QEMU_PARAM_H
10
11#define HZ 100 /* Internal kernel timer frequency */
12
13#endif /* __ASM_MACH_QEMU_PARAM_H */
diff --git a/include/asm-mips/mach-rm200/cpu-feature-overrides.h b/include/asm-mips/mach-rm200/cpu-feature-overrides.h
index 91e7cf5f2bfe..11410ae10d36 100644
--- a/include/asm-mips/mach-rm200/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm200/cpu-feature-overrides.h
@@ -14,7 +14,7 @@
14 14
15#define cpu_has_tlb 1 15#define cpu_has_tlb 1
16#define cpu_has_4kex 1 16#define cpu_has_4kex 1
17#define cpu_has_4kcache 1 17#define cpu_has_4k_cache 1
18#define cpu_has_fpu 1 18#define cpu_has_fpu 1
19#define cpu_has_32fpr 1 19#define cpu_has_32fpr 1
20#define cpu_has_counter 1 20#define cpu_has_counter 1
@@ -35,10 +35,8 @@
35#define cpu_has_nofpuex 0 35#define cpu_has_nofpuex 0
36#define cpu_has_64bits 1 36#define cpu_has_64bits 1
37 37
38#define cpu_has_subset_pcaches 0 /* No S-cache on R5000 I think ... */
39#define cpu_dcache_line_size() 32 38#define cpu_dcache_line_size() 32
40#define cpu_icache_line_size() 32 39#define cpu_icache_line_size() 32
41#define cpu_scache_line_size() 0 /* No S-cache on R5000 I think ... */
42 40
43#define cpu_has_mips32r1 0 41#define cpu_has_mips32r1 0
44#define cpu_has_mips32r2 0 42#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-sim/cpu-feature-overrides.h b/include/asm-mips/mach-sim/cpu-feature-overrides.h
index cadbe8eda79c..d9653e47d5fc 100644
--- a/include/asm-mips/mach-sim/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sim/cpu-feature-overrides.h
@@ -16,7 +16,7 @@
16#ifdef CONFIG_CPU_MIPS32 16#ifdef CONFIG_CPU_MIPS32
17#define cpu_has_tlb 1 17#define cpu_has_tlb 1
18#define cpu_has_4kex 1 18#define cpu_has_4kex 1
19#define cpu_has_4kcache 1 19#define cpu_has_4k_cache 1
20#define cpu_has_fpu 0 20#define cpu_has_fpu 0
21/* #define cpu_has_32fpr ? */ 21/* #define cpu_has_32fpr ? */
22#define cpu_has_counter 1 22#define cpu_has_counter 1
@@ -41,7 +41,7 @@
41#ifdef CONFIG_CPU_MIPS64 41#ifdef CONFIG_CPU_MIPS64
42#define cpu_has_tlb 1 42#define cpu_has_tlb 1
43#define cpu_has_4kex 1 43#define cpu_has_4kex 1
44#define cpu_has_4kcache 1 44#define cpu_has_4k_cache 1
45/* #define cpu_has_fpu ? */ 45/* #define cpu_has_fpu ? */
46/* #define cpu_has_32fpr ? */ 46/* #define cpu_has_32fpr ? */
47#define cpu_has_counter 1 47#define cpu_has_counter 1
diff --git a/include/asm-mips/mach-wrppmc/mach-gt64120.h b/include/asm-mips/mach-wrppmc/mach-gt64120.h
new file mode 100644
index 000000000000..ba9205a04582
--- /dev/null
+++ b/include/asm-mips/mach-wrppmc/mach-gt64120.h
@@ -0,0 +1,84 @@
1/*
2 * This is a direct copy of the ev96100.h file, with a global
3 * search and replace. The numbers are the same.
4 *
5 * The reason I'm duplicating this is so that the 64120/96100
6 * defines won't be confusing in the source code.
7 */
8#ifndef __ASM_MIPS_GT64120_H
9#define __ASM_MIPS_GT64120_H
10
11/*
12 * This is the CPU physical memory map of PPMC Board:
13 *
14 * 0x00000000-0x03FFFFFF - 64MB SDRAM (SCS[0]#)
15 * 0x1C000000-0x1C000000 - LED (CS0)
16 * 0x1C800000-0x1C800007 - UART 16550 port (CS1)
17 * 0x1F000000-0x1F000000 - MailBox (CS3)
18 * 0x1FC00000-0x20000000 - 4MB Flash (BOOT CS)
19 */
20
21#define WRPPMC_SDRAM_SCS0_BASE 0x00000000
22#define WRPPMC_SDRAM_SCS0_SIZE 0x04000000
23
24#define WRPPMC_UART16550_BASE 0x1C800000
25#define WRPPMC_UART16550_CLOCK 3686400 /* 3.68MHZ */
26
27#define WRPPMC_LED_BASE 0x1C000000
28#define WRPPMC_MBOX_BASE 0x1F000000
29
30#define WRPPMC_BOOTROM_BASE 0x1FC00000
31#define WRPPMC_BOOTROM_SIZE 0x00400000 /* 4M Flash */
32
33#define WRPPMC_MIPS_TIMER_IRQ 7 /* MIPS compare/count timer interrupt */
34#define WRPPMC_UART16550_IRQ 6
35#define WRPPMC_PCI_INTA_IRQ 3
36
37/*
38 * PCI Bus I/O and Memory resources allocation
39 *
40 * NOTE: We only have PCI_0 hose interface
41 */
42#define GT_PCI_MEM_BASE 0x13000000UL
43#define GT_PCI_MEM_SIZE 0x02000000UL
44#define GT_PCI_IO_BASE 0x11000000UL
45#define GT_PCI_IO_SIZE 0x02000000UL
46#define GT_ISA_IO_BASE PCI_IO_BASE
47
48/*
49 * PCI interrupts will come in on either the INTA or INTD interrups lines,
50 * which are mapped to the #2 and #5 interrupt pins of the MIPS. On our
51 * boards, they all either come in on IntD or they all come in on IntA, they
52 * aren't mixed. There can be numerous PCI interrupts, so we keep a list of the
53 * "requested" interrupt numbers and go through the list whenever we get an
54 * IntA/D.
55 *
56 * Interrupts < 8 are directly wired to the processor; PCI INTA is 8 and
57 * INTD is 11.
58 */
59#define GT_TIMER 4
60#define GT_INTA 2
61#define GT_INTD 5
62
63#ifndef __ASSEMBLY__
64
65/*
66 * GT64120 internal register space base address
67 */
68extern unsigned long gt64120_base;
69
70#define GT64120_BASE (gt64120_base)
71
72/* define WRPPMC_EARLY_DEBUG to enable early output something to UART */
73#undef WRPPMC_EARLY_DEBUG
74
75#ifdef WRPPMC_EARLY_DEBUG
76extern void wrppmc_led_on(int mask);
77extern void wrppmc_led_off(int mask);
78extern void wrppmc_early_printk(const char *fmt, ...);
79#else
80#define wrppmc_early_printk(fmt, ...) do {} while (0)
81#endif /* WRPPMC_EARLY_DEBUG */
82
83#endif /* __ASSEMBLY__ */
84#endif /* __ASM_MIPS_GT64120_H */
diff --git a/include/asm-mips/mipsregs.h b/include/asm-mips/mipsregs.h
index 5af7517fce8a..98b68089aa53 100644
--- a/include/asm-mips/mipsregs.h
+++ b/include/asm-mips/mipsregs.h
@@ -1451,12 +1451,10 @@ static inline void __emt(unsigned int previous)
1451{ 1451{
1452 if ((previous & __EMT_ENABLE)) 1452 if ((previous & __EMT_ENABLE))
1453 __asm__ __volatile__( 1453 __asm__ __volatile__(
1454 " .set noreorder \n"
1455 " .set mips32r2 \n" 1454 " .set mips32r2 \n"
1456 " .word 0x41600be1 # emt \n" 1455 " .word 0x41600be1 # emt \n"
1457 " ehb \n" 1456 " ehb \n"
1458 " .set mips0 \n" 1457 " .set mips0 \n");
1459 " .set reorder \n");
1460} 1458}
1461 1459
1462static inline void __ehb(void) 1460static inline void __ehb(void)
diff --git a/include/asm-mips/mmzone.h b/include/asm-mips/mmzone.h
index 7bde4432092b..f6bd2e0c45a1 100644
--- a/include/asm-mips/mmzone.h
+++ b/include/asm-mips/mmzone.h
@@ -14,17 +14,6 @@
14#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr)) 14#define kvaddr_to_nid(kvaddr) pa_to_nid(__pa(kvaddr))
15#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT) 15#define pfn_to_nid(pfn) pa_to_nid((pfn) << PAGE_SHIFT)
16 16
17#define pfn_valid(pfn) \
18({ \
19 unsigned long __pfn = (pfn); \
20 int __n = pfn_to_nid(__pfn); \
21 ((__n >= 0) ? (__pfn < NODE_DATA(__n)->node_start_pfn + \
22 NODE_DATA(__n)->node_spanned_pages) : 0);\
23})
24
25/* XXX: FIXME -- wli */
26#define kern_addr_valid(addr) (0)
27
28#endif /* CONFIG_DISCONTIGMEM */ 17#endif /* CONFIG_DISCONTIGMEM */
29 18
30#endif /* _ASM_MMZONE_H_ */ 19#endif /* _ASM_MMZONE_H_ */
diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 4035ec79ecd4..3d262c01521c 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -145,6 +145,25 @@ typedef struct { unsigned long pgprot; } pgprot_t;
145#endif 145#endif
146#endif 146#endif
147 147
148#ifdef CONFIG_FLATMEM
149
150#define pfn_valid(pfn) ((pfn) < max_mapnr)
151
152#elif defined(CONFIG_NEED_MULTIPLE_NODES)
153
154#define pfn_valid(pfn) \
155({ \
156 unsigned long __pfn = (pfn); \
157 int __n = pfn_to_nid(__pfn); \
158 ((__n >= 0) ? (__pfn < NODE_DATA(__n)->node_start_pfn + \
159 NODE_DATA(__n)->node_spanned_pages) \
160 : 0); \
161})
162
163#else
164#error Provide a definition of pfn_valid
165#endif
166
148#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) 167#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
149#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) 168#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
150 169
diff --git a/include/asm-mips/param.h b/include/asm-mips/param.h
index 2bead8273ced..1d9bb8c5ab24 100644
--- a/include/asm-mips/param.h
+++ b/include/asm-mips/param.h
@@ -11,7 +11,7 @@
11 11
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13 13
14# include <param.h> /* Internal kernel timer frequency */ 14# define HZ CONFIG_HZ /* Internal kernel timer frequency */
15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 15# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 16# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
17#endif 17#endif
diff --git a/include/asm-mips/pci/bridge.h b/include/asm-mips/pci/bridge.h
index b4ee995c56e6..0c45e7598f3f 100644
--- a/include/asm-mips/pci/bridge.h
+++ b/include/asm-mips/pci/bridge.h
@@ -15,6 +15,7 @@
15#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/pci.h> 16#include <linux/pci.h>
17#include <asm/xtalk/xwidget.h> /* generic widget header */ 17#include <asm/xtalk/xwidget.h> /* generic widget header */
18#include <asm/sn/types.h>
18 19
19/* I/O page size */ 20/* I/O page size */
20 21
@@ -848,4 +849,6 @@ struct bridge_controller {
848extern void register_bridge_irq(unsigned int irq); 849extern void register_bridge_irq(unsigned int irq);
849extern int request_bridge_irq(struct bridge_controller *bc); 850extern int request_bridge_irq(struct bridge_controller *bc);
850 851
852extern struct pci_ops bridge_pci_ops;
853
851#endif /* _ASM_PCI_BRIDGE_H */ 854#endif /* _ASM_PCI_BRIDGE_H */
diff --git a/include/asm-mips/pgtable.h b/include/asm-mips/pgtable.h
index d0af2a3b0152..be75cca20e8d 100644
--- a/include/asm-mips/pgtable.h
+++ b/include/asm-mips/pgtable.h
@@ -379,9 +379,7 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
379 __update_cache(vma, address, pte); 379 __update_cache(vma, address, pte);
380} 380}
381 381
382#ifndef CONFIG_NEED_MULTIPLE_NODES
383#define kern_addr_valid(addr) (1) 382#define kern_addr_valid(addr) (1)
384#endif
385 383
386#ifdef CONFIG_64BIT_PHYS_ADDR 384#ifdef CONFIG_64BIT_PHYS_ADDR
387extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot); 385extern int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t prot);
diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h
index 0fb75f0762e0..83936469fe87 100644
--- a/include/asm-mips/processor.h
+++ b/include/asm-mips/processor.h
@@ -71,11 +71,6 @@ extern unsigned int vced_count, vcei_count;
71 71
72typedef __u64 fpureg_t; 72typedef __u64 fpureg_t;
73 73
74struct mips_fpu_hard_struct {
75 fpureg_t fpr[NUM_FPU_REGS];
76 unsigned int fcr31;
77};
78
79/* 74/*
80 * It would be nice to add some more fields for emulator statistics, but there 75 * It would be nice to add some more fields for emulator statistics, but there
81 * are a number of fixed offsets in offset.h and elsewhere that would have to 76 * are a number of fixed offsets in offset.h and elsewhere that would have to
@@ -83,18 +78,13 @@ struct mips_fpu_hard_struct {
83 * the FPU emulator for now. See asm-mips/fpu_emulator.h. 78 * the FPU emulator for now. See asm-mips/fpu_emulator.h.
84 */ 79 */
85 80
86struct mips_fpu_soft_struct { 81struct mips_fpu_struct {
87 fpureg_t fpr[NUM_FPU_REGS]; 82 fpureg_t fpr[NUM_FPU_REGS];
88 unsigned int fcr31; 83 unsigned int fcr31;
89}; 84};
90 85
91union mips_fpu_union {
92 struct mips_fpu_hard_struct hard;
93 struct mips_fpu_soft_struct soft;
94};
95
96#define INIT_FPU { \ 86#define INIT_FPU { \
97 {{0,},} \ 87 {0,} \
98} 88}
99 89
100#define NUM_DSP_REGS 6 90#define NUM_DSP_REGS 6
@@ -133,7 +123,7 @@ struct thread_struct {
133 unsigned long cp0_status; 123 unsigned long cp0_status;
134 124
135 /* Saved fpu/fpu emulator stuff. */ 125 /* Saved fpu/fpu emulator stuff. */
136 union mips_fpu_union fpu; 126 struct mips_fpu_struct fpu;
137#ifdef CONFIG_MIPS_MT_FPAFF 127#ifdef CONFIG_MIPS_MT_FPAFF
138 /* Emulated instruction count */ 128 /* Emulated instruction count */
139 unsigned long emulated_fp; 129 unsigned long emulated_fp;
diff --git a/include/asm-mips/qemu.h b/include/asm-mips/qemu.h
index 905c39585903..531caf44560c 100644
--- a/include/asm-mips/qemu.h
+++ b/include/asm-mips/qemu.h
@@ -21,4 +21,10 @@
21 */ 21 */
22#define QEMU_C0_COUNTER_CLOCK 100000000 22#define QEMU_C0_COUNTER_CLOCK 100000000
23 23
24/*
25 * Magic qemu system control location.
26 */
27#define QEMU_RESTART_REG 0xBFBF0000
28#define QEMU_HALT_REG 0xBFBF0004
29
24#endif /* __ASM_QEMU_H */ 30#endif /* __ASM_QEMU_H */
diff --git a/include/asm-mips/rm9k-ocd.h b/include/asm-mips/rm9k-ocd.h
new file mode 100644
index 000000000000..b0b80d9ecf96
--- /dev/null
+++ b/include/asm-mips/rm9k-ocd.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2004 by Basler Vision Technologies AG
3 * Author: Thomas Koeller <thomas.koeller@baslerweb.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#if !defined(_ASM_RM9K_OCD_H)
21#define _ASM_RM9K_OCD_H
22
23#include <linux/types.h>
24#include <linux/spinlock.h>
25#include <asm/io.h>
26
27extern volatile void __iomem * const ocd_base;
28extern volatile void __iomem * const titan_base;
29
30#define ocd_addr(__x__) (ocd_base + (__x__))
31#define titan_addr(__x__) (titan_base + (__x__))
32#define scram_addr(__x__) (scram_base + (__x__))
33
34/* OCD register access */
35#define ocd_readl(__offs__) __raw_readl(ocd_addr(__offs__))
36#define ocd_readw(__offs__) __raw_readw(ocd_addr(__offs__))
37#define ocd_readb(__offs__) __raw_readb(ocd_addr(__offs__))
38#define ocd_writel(__val__, __offs__) \
39 __raw_writel((__val__), ocd_addr(__offs__))
40#define ocd_writew(__val__, __offs__) \
41 __raw_writew((__val__), ocd_addr(__offs__))
42#define ocd_writeb(__val__, __offs__) \
43 __raw_writeb((__val__), ocd_addr(__offs__))
44
45/* TITAN register access - 32 bit-wide only */
46#define titan_readl(__offs__) __raw_readl(titan_addr(__offs__))
47#define titan_writel(__val__, __offs__) \
48 __raw_writel((__val__), titan_addr(__offs__))
49
50/* Protect access to shared TITAN registers */
51extern spinlock_t titan_lock;
52extern int titan_irqflags;
53#define lock_titan_regs() spin_lock_irqsave(&titan_lock, titan_irqflags)
54#define unlock_titan_regs() spin_unlock_irqrestore(&titan_lock, titan_irqflags)
55
56#endif /* !defined(_ASM_RM9K_OCD_H) */
diff --git a/include/asm-mips/sn/addrs.h b/include/asm-mips/sn/addrs.h
index 2b5cef1ba37f..6c8a5577ddf1 100644
--- a/include/asm-mips/sn/addrs.h
+++ b/include/asm-mips/sn/addrs.h
@@ -27,13 +27,8 @@
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29 29
30#if defined(CONFIG_SGI_IO) /* FIXME */
31#define PS_UINT_CAST (__psunsigned_t)
32#define UINT64_CAST (__uint64_t)
33#else /* CONFIG_SGI_IO */
34#define PS_UINT_CAST (unsigned long) 30#define PS_UINT_CAST (unsigned long)
35#define UINT64_CAST (unsigned long) 31#define UINT64_CAST (unsigned long)
36#endif /* CONFIG_SGI_IO */
37 32
38#define HUBREG_CAST (volatile hubreg_t *) 33#define HUBREG_CAST (volatile hubreg_t *)
39 34
@@ -253,14 +248,6 @@
253 * for _x. 248 * for _x.
254 */ 249 */
255 250
256#ifdef _STANDALONE
257
258/* DO NOT USE THESE DIRECTLY IN THE KERNEL. SEE BELOW. */
259#define LOCAL_HUB(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
260#define REMOTE_HUB(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
261 0x800000 + (_x)))
262#endif /* _STANDALONE */
263
264/* 251/*
265 * WARNING: 252 * WARNING:
266 * When certain Hub chip workaround are defined, it's not sufficient 253 * When certain Hub chip workaround are defined, it's not sufficient
@@ -327,20 +314,6 @@
327 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET) 314 PHYS_TO_K0(NODE_OFFSET(nasid) | ARCS_SPB_OFFSET)
328#define ARCS_SPB_SIZE 0x0400 315#define ARCS_SPB_SIZE 0x0400
329 316
330#ifdef _STANDALONE
331
332#define ARCS_TVECTOR_OFFSET 0x2800
333#define ARCS_PVECTOR_OFFSET 0x2c00
334
335/*
336 * These addresses are used by the master CPU to install the transfer
337 * and private vectors. All others use the SPB to find them.
338 */
339#define TVADDR (NODE_CAC_BASE(get_nasid()) + ARCS_TVECTOR_OFFSET)
340#define PVADDR (NODE_CAC_BASE(get_nasid()) + ARCS_PVECTOR_OFFSET)
341
342#endif /* _STANDALONE */
343
344#define KLDIR_OFFSET 0x2000 317#define KLDIR_OFFSET 0x2000
345#define KLDIR_ADDR(nasid) \ 318#define KLDIR_ADDR(nasid) \
346 TO_NODE_UNCAC((nasid), KLDIR_OFFSET) 319 TO_NODE_UNCAC((nasid), KLDIR_OFFSET)
diff --git a/include/asm-mips/sn/sn0/sn0_fru.h b/include/asm-mips/sn/fru.h
index 82c6377c275a..b3e3606723b7 100644
--- a/include/asm-mips/sn/sn0/sn0_fru.h
+++ b/include/asm-mips/sn/fru.h
@@ -6,10 +6,10 @@
6 * Derived from IRIX <sys/SN/SN0/sn0_fru.h> 6 * Derived from IRIX <sys/SN/SN0/sn0_fru.h>
7 * 7 *
8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc. 8 * Copyright (C) 1992 - 1997, 1999 Silcon Graphics, Inc.
9 * Copyright (C) 1999 Ralf Baechle (ralf@gnu.org) 9 * Copyright (C) 1999, 2006 Ralf Baechle (ralf@linux-mips)
10 */ 10 */
11#ifndef _ASM_SN_SN0_SN0_FRU_H 11#ifndef __ASM_SN_FRU_H
12#define _ASM_SN_SN0_SN0_FRU_H 12#define __ASM_SN_FRU_H
13 13
14#define MAX_DIMMS 8 /* max # of dimm banks */ 14#define MAX_DIMMS 8 /* max # of dimm banks */
15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */ 15#define MAX_PCIDEV 8 /* max # of pci devices on a pci bus */
@@ -41,4 +41,4 @@ typedef struct kf_pci_bus_s {
41 /* confidence level that the pci dev is bad */ 41 /* confidence level that the pci dev is bad */
42} kf_pci_bus_t; 42} kf_pci_bus_t;
43 43
44#endif /* _ASM_SN_SN0_SN0_FRU_H */ 44#endif /* __ASM_SN_FRU_H */
diff --git a/include/asm-mips/sn/klconfig.h b/include/asm-mips/sn/klconfig.h
index 9709ff701d9b..dc706268d2cf 100644
--- a/include/asm-mips/sn/klconfig.h
+++ b/include/asm-mips/sn/klconfig.h
@@ -37,7 +37,7 @@
37//#include <sys/SN/router.h> 37//#include <sys/SN/router.h>
38// XXX Stolen from <sys/SN/router.h>: 38// XXX Stolen from <sys/SN/router.h>:
39#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */ 39#define MAX_ROUTER_PORTS (6) /* Max. number of ports on a router */
40#include <asm/sn/sn0/sn0_fru.h> 40#include <asm/sn/fru.h>
41//#include <sys/graph.h> 41//#include <sys/graph.h>
42//#include <sys/xtalk/xbow.h> 42//#include <sys/xtalk/xbow.h>
43 43
@@ -54,32 +54,21 @@
54#include <asm/sn/agent.h> 54#include <asm/sn/agent.h>
55#include <asm/arc/types.h> 55#include <asm/arc/types.h>
56#include <asm/arc/hinv.h> 56#include <asm/arc/hinv.h>
57#if defined(CONFIG_SGI_IO) || defined(CONFIG_SGI_IP35) 57#if defined(CONFIG_SGI_IP35)
58// The hack file has to be before vector and after sn0_fru.... 58// The hack file has to be before vector and after sn0_fru....
59#include <asm/hack.h> 59#include <asm/hack.h>
60#include <asm/sn/vector.h> 60#include <asm/sn/vector.h>
61#include <asm/xtalk/xtalk.h> 61#include <asm/xtalk/xtalk.h>
62#endif /* CONFIG_SGI_IO || CONFIG_SGI_IP35 */ 62#endif /* CONFIG_SGI_IP35 */
63#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */ 63#endif /* CONFIG_SGI_IP27 || CONFIG_SGI_IP35 */
64 64
65#define KLCFGINFO_MAGIC 0xbeedbabe 65#define KLCFGINFO_MAGIC 0xbeedbabe
66 66
67#ifdef FRUTEST
68typedef u64 klconf_off_t;
69#else
70typedef s32 klconf_off_t; 67typedef s32 klconf_off_t;
71#endif
72 68
73/* 69/*
74 * Some IMPORTANT OFFSETS. These are the offsets on all NODES. 70 * Some IMPORTANT OFFSETS. These are the offsets on all NODES.
75 */ 71 */
76#if 0
77#define RAMBASE 0
78#define ARCSSPB_OFF 0x1000 /* shift it to sys/arcs/spb.h */
79
80#define OFF_HWGRAPH 0
81#endif
82
83#define MAX_MODULE_ID 255 72#define MAX_MODULE_ID 255
84#define SIZE_PAD 4096 /* 4k padding for structures */ 73#define SIZE_PAD 4096 /* 4k padding for structures */
85/* 74/*
@@ -134,15 +123,9 @@ typedef s32 klconf_off_t;
134 123
135 124
136typedef struct console_s { 125typedef struct console_s {
137#if defined(CONFIG_SGI_IO) /* FIXME */
138 __psunsigned_t uart_base;
139 __psunsigned_t config_base;
140 __psunsigned_t memory_base;
141#else
142 unsigned long uart_base; 126 unsigned long uart_base;
143 unsigned long config_base; 127 unsigned long config_base;
144 unsigned long memory_base; 128 unsigned long memory_base;
145#endif
146 short baud; 129 short baud;
147 short flag; 130 short flag;
148 int type; 131 int type;
@@ -174,10 +157,6 @@ typedef struct kl_config_hdr {
174 157
175 158
176#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid))) 159#define KL_CONFIG_HDR(_nasid) ((kl_config_hdr_t *)(KLCONFIG_ADDR(_nasid)))
177#if 0
178#define KL_CONFIG_MALLOC_HDR(_nasid) \
179 (KL_CONFIG_HDR(_nasid)->ch_malloc_hdr)
180#endif
181#define KL_CONFIG_INFO_OFFSET(_nasid) \ 160#define KL_CONFIG_INFO_OFFSET(_nasid) \
182 (KL_CONFIG_HDR(_nasid)->ch_board_info) 161 (KL_CONFIG_HDR(_nasid)->ch_board_info)
183#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \ 162#define KL_CONFIG_INFO_SET_OFFSET(_nasid, _off) \
@@ -197,23 +176,13 @@ typedef struct kl_config_hdr {
197 176
198/* --- New Macros for the changed kl_config_hdr_t structure --- */ 177/* --- New Macros for the changed kl_config_hdr_t structure --- */
199 178
200#if defined(CONFIG_SGI_IO)
201#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
202 ((__psunsigned_t)_k + (_k->ch_malloc_hdr_off)))
203#else
204#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\ 179#define PTR_CH_MALLOC_HDR(_k) ((klc_malloc_hdr_t *)\
205 (unsigned long)_k + (_k->ch_malloc_hdr_off))) 180 (unsigned long)_k + (_k->ch_malloc_hdr_off)))
206#endif
207 181
208#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n)) 182#define KL_CONFIG_CH_MALLOC_HDR(_n) PTR_CH_MALLOC_HDR(KL_CONFIG_HDR(_n))
209 183
210#if defined(CONFIG_SGI_IO)
211#define PTR_CH_CONS_INFO(_k) ((console_t *)\
212 ((__psunsigned_t)_k + (_k->ch_cons_off)))
213#else
214#define PTR_CH_CONS_INFO(_k) ((console_t *)\ 184#define PTR_CH_CONS_INFO(_k) ((console_t *)\
215 ((unsigned long)_k + (_k->ch_cons_off))) 185 ((unsigned long)_k + (_k->ch_cons_off)))
216#endif
217 186
218#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n)) 187#define KL_CONFIG_CH_CONS_INFO(_n) PTR_CH_CONS_INFO(KL_CONFIG_HDR(_n))
219 188
@@ -490,14 +459,6 @@ typedef struct lboard_s {
490#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts) 459#define KLCF_NUM_COMPS(_brd) ((_brd)->brd_numcompts)
491#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module) 460#define KLCF_MODULE_ID(_brd) ((_brd)->brd_module)
492 461
493#ifdef FRUTEST
494
495#define KLCF_NEXT(_brd) ((_brd)->brd_next ? (lboard_t *)((_brd)->brd_next): NULL)
496#define KLCF_COMP(_brd, _ndx) (klinfo_t *)((_brd)->brd_compts[(_ndx)])
497#define KLCF_COMP_ERROR(_brd, _comp) (_brd = _brd , (_comp)->errinfo)
498
499#else
500
501#define KLCF_NEXT(_brd) \ 462#define KLCF_NEXT(_brd) \
502 ((_brd)->brd_next ? \ 463 ((_brd)->brd_next ? \
503 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\ 464 (lboard_t *)(NODE_OFFSET_TO_K1(NASID_GET(_brd), (_brd)->brd_next)):\
@@ -509,8 +470,6 @@ typedef struct lboard_s {
509#define KLCF_COMP_ERROR(_brd, _comp) \ 470#define KLCF_COMP_ERROR(_brd, _comp) \
510 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo)) 471 (NODE_OFFSET_TO_K1(NASID_GET(_brd), (_comp)->errinfo))
511 472
512#endif
513
514#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type) 473#define KLCF_COMP_TYPE(_comp) ((_comp)->struct_type)
515#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */ 474#define KLCF_BRIDGE_W_ID(_comp) ((_comp)->physid) /* Widget ID */
516 475
@@ -631,18 +590,6 @@ typedef struct klport_s {
631 klconf_off_t port_offset; 590 klconf_off_t port_offset;
632} klport_t; 591} klport_t;
633 592
634#if 0
635/*
636 * This is very similar to the klport_s but instead of having a componant
637 * offset it has a board offset.
638 */
639typedef struct klxbow_port_s {
640 nasid_t port_nasid;
641 unsigned char port_flag;
642 klconf_off_t board_offset;
643} klxbow_port_t;
644#endif
645
646typedef struct klcpu_s { /* CPU */ 593typedef struct klcpu_s { /* CPU */
647 klinfo_t cpu_info; 594 klinfo_t cpu_info;
648 unsigned short cpu_prid; /* Processor PRID value */ 595 unsigned short cpu_prid; /* Processor PRID value */
@@ -945,36 +892,6 @@ extern klcpu_t *nasid_slice_to_cpuinfo(nasid_t, int);
945extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class); 892extern lboard_t *find_lboard_class(lboard_t *start, unsigned char brd_class);
946 893
947 894
948#if defined(CONFIG_SGI_IO)
949extern xwidgetnum_t nodevertex_widgetnum_get(vertex_hdl_t node_vtx);
950extern vertex_hdl_t nodevertex_xbow_peer_get(vertex_hdl_t node_vtx);
951extern lboard_t *find_gfxpipe(int pipenum);
952extern void setup_gfxpipe_link(vertex_hdl_t vhdl,int pipenum);
953extern lboard_t *find_lboard_module_class(lboard_t *start, moduleid_t mod,
954 unsigned char brd_class);
955extern lboard_t *find_nic_lboard(lboard_t *, nic_t);
956extern lboard_t *find_nic_type_lboard(nasid_t, unsigned char, nic_t);
957extern lboard_t *find_lboard_modslot(lboard_t *start, moduleid_t mod, slotid_t slot);
958extern lboard_t *find_lboard_module(lboard_t *start, moduleid_t mod);
959extern lboard_t *get_board_name(nasid_t nasid, moduleid_t mod, slotid_t slot, char *name);
960extern int config_find_nic_router(nasid_t, nic_t, lboard_t **, klrou_t**);
961extern int config_find_nic_hub(nasid_t, nic_t, lboard_t **, klhub_t**);
962extern int config_find_xbow(nasid_t, lboard_t **, klxbow_t**);
963extern klcpu_t *get_cpuinfo(cpuid_t cpu);
964extern int update_klcfg_cpuinfo(nasid_t, int);
965extern void board_to_path(lboard_t *brd, char *path);
966extern moduleid_t get_module_id(nasid_t nasid);
967extern void nic_name_convert(char *old_name, char *new_name);
968extern int module_brds(nasid_t nasid, lboard_t **module_brds, int n);
969extern lboard_t *brd_from_key(ulong_t key);
970extern void device_component_canonical_name_get(lboard_t *,klinfo_t *,
971 char *);
972extern int board_serial_number_get(lboard_t *,char *);
973extern int is_master_baseio(nasid_t,moduleid_t,slotid_t);
974extern nasid_t get_actual_nasid(lboard_t *brd) ;
975extern net_vec_t klcfg_discover_route(lboard_t *, lboard_t *, int);
976#else /* CONFIG_SGI_IO */
977extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu); 895extern klcpu_t *sn_get_cpuinfo(cpuid_t cpu);
978#endif /* CONFIG_SGI_IO */
979 896
980#endif /* _ASM_SN_KLCONFIG_H */ 897#endif /* _ASM_SN_KLCONFIG_H */
diff --git a/include/asm-mips/sn/kldir.h b/include/asm-mips/sn/kldir.h
index f0efab1672ec..97ad52e3cbc7 100644
--- a/include/asm-mips/sn/kldir.h
+++ b/include/asm-mips/sn/kldir.h
@@ -13,10 +13,6 @@
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15 15
16#if defined(CONFIG_SGI_IO)
17#include <asm/hack.h>
18#endif
19
20/* 16/*
21 * The kldir memory area resides at a fixed place in each node's memory and 17 * The kldir memory area resides at a fixed place in each node's memory and
22 * provides pointers to most other IP27 memory areas. This allows us to 18 * provides pointers to most other IP27 memory areas. This allows us to
@@ -136,8 +132,6 @@
136#define KLDIR_OFF_STRIDE 0x28 132#define KLDIR_OFF_STRIDE 0x28
137#endif /* __ASSEMBLY__ */ 133#endif /* __ASSEMBLY__ */
138 134
139#if !defined(CONFIG_SGI_IO)
140
141/* 135/*
142 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what 136 * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
143 * we define here. Since it's set up in the prom. We can't redefine it later 137 * we define here. Since it's set up in the prom. We can't redefine it later
@@ -147,7 +141,7 @@
147 */ 141 */
148#define SYMMON_STACK_SIZE 0x8000 142#define SYMMON_STACK_SIZE 0x8000
149 143
150#if defined (PROM) || defined (SABLE) 144#if defined (PROM)
151 145
152/* 146/*
153 * These defines are prom version dependent. No code other than the IP27 147 * These defines are prom version dependent. No code other than the IP27
@@ -184,7 +178,7 @@
184#define IP27_FREEMEM_COUNT 1 178#define IP27_FREEMEM_COUNT 1
185#define IP27_FREEMEM_STRIDE 0 179#define IP27_FREEMEM_STRIDE 0
186 180
187#endif /* PROM || SABLE*/ 181#endif /* PROM */
188/* 182/*
189 * There will be only one of these in a partition so the IO6 must set it up. 183 * There will be only one of these in a partition so the IO6 must set it up.
190 */ 184 */
@@ -207,17 +201,11 @@
207#define KLDIR_ENT_SIZE 0x40 201#define KLDIR_ENT_SIZE 0x40
208#define KLDIR_MAX_ENTRIES (0x400 / 0x40) 202#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
209 203
210#endif /* !CONFIG_SGI_IO */
211
212#ifndef __ASSEMBLY__ 204#ifndef __ASSEMBLY__
213typedef struct kldir_ent_s { 205typedef struct kldir_ent_s {
214 u64 magic; /* Indicates validity of entry */ 206 u64 magic; /* Indicates validity of entry */
215 off_t offset; /* Offset from start of node space */ 207 off_t offset; /* Offset from start of node space */
216#if defined(CONFIG_SGI_IO) /* FIXME */
217 __psunsigned_t pointer; /* Pointer to area in some cases */
218#else
219 unsigned long pointer; /* Pointer to area in some cases */ 208 unsigned long pointer; /* Pointer to area in some cases */
220#endif
221 size_t size; /* Size in bytes */ 209 size_t size; /* Size in bytes */
222 u64 count; /* Repeat count if array, 1 if not */ 210 u64 count; /* Repeat count if array, 1 if not */
223 size_t stride; /* Stride if array, 0 if not */ 211 size_t stride; /* Stride if array, 0 if not */
@@ -227,22 +215,4 @@ typedef struct kldir_ent_s {
227} kldir_ent_t; 215} kldir_ent_t;
228#endif /* !__ASSEMBLY__ */ 216#endif /* !__ASSEMBLY__ */
229 217
230#if defined(CONFIG_SGI_IO)
231
232#define KLDIR_ENT_SIZE 0x40
233#define KLDIR_MAX_ENTRIES (0x400 / 0x40)
234
235/*
236 * The actual offsets of each memory area are machine-dependent
237 */
238#ifdef CONFIG_SGI_IP27
239// Not yet #include <asm/sn/sn0/kldir.h>
240#elif defined(CONFIG_SGI_IP35)
241#include <asm/sn/sn1/kldir.h>
242#else
243#error "kldir.h is currently defined for IP27 and IP35 platforms only"
244#endif
245
246#endif /* CONFIG_SGI_IO */
247
248#endif /* _ASM_SN_KLDIR_H */ 218#endif /* _ASM_SN_KLDIR_H */
diff --git a/include/asm-mips/sn/sn0/addrs.h b/include/asm-mips/sn/sn0/addrs.h
index 398815639fb8..2c4b758f6736 100644
--- a/include/asm-mips/sn/sn0/addrs.h
+++ b/include/asm-mips/sn/sn0/addrs.h
@@ -49,7 +49,7 @@
49 * so for now we just use defines bracketed by an ifdef. 49 * so for now we just use defines bracketed by an ifdef.
50 */ 50 */
51 51
52#ifdef CONFIG_SGI_SN0_N_MODE 52#ifdef CONFIG_SGI_SN_N_MODE
53 53
54#define NODE_SIZE_BITS 31 54#define NODE_SIZE_BITS 31
55#define BWIN_SIZE_BITS 28 55#define BWIN_SIZE_BITS 28
@@ -63,7 +63,7 @@
63#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10) 63#define BDDIR_UPPER_MASK (UINT64_CAST 0x7ffff << 10)
64#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3) 64#define BDECC_UPPER_MASK (UINT64_CAST 0x3ffffff << 3)
65 65
66#else /* !defined(CONFIG_SGI_SN0_N_MODE), assume that M-mode is desired */ 66#else /* !defined(CONFIG_SGI_SN_N_MODE), assume that M-mode is desired */
67 67
68#define NODE_SIZE_BITS 32 68#define NODE_SIZE_BITS 32
69#define BWIN_SIZE_BITS 29 69#define BWIN_SIZE_BITS 29
@@ -77,7 +77,7 @@
77#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10) 77#define BDDIR_UPPER_MASK (UINT64_CAST 0xfffff << 10)
78#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3) 78#define BDECC_UPPER_MASK (UINT64_CAST 0x7ffffff << 3)
79 79
80#endif /* !defined(CONFIG_SGI_SN0_N_MODE) */ 80#endif /* !defined(CONFIG_SGI_SN_N_MODE) */
81 81
82#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS) 82#define NODE_ADDRSPACE_SIZE (UINT64_CAST 1 << NODE_SIZE_BITS)
83 83
@@ -85,15 +85,15 @@
85#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \ 85#define NASID_GET(_pa) (int) ((UINT64_CAST (_pa) >> \
86 NASID_SHFT) & NASID_BITMASK) 86 NASID_SHFT) & NASID_BITMASK)
87 87
88#if !defined(__ASSEMBLY__) && !defined(_STANDALONE) 88#if !defined(__ASSEMBLY__)
89 89
90#define NODE_SWIN_BASE(nasid, widget) \ 90#define NODE_SWIN_BASE(nasid, widget) \
91 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \ 91 ((widget == 0) ? NODE_BWIN_BASE((nasid), SWIN0_BIGWIN) \
92 : RAW_NODE_SWIN_BASE(nasid, widget)) 92 : RAW_NODE_SWIN_BASE(nasid, widget))
93#else /* __ASSEMBLY__ || _STANDALONE */ 93#else /* __ASSEMBLY__ */
94#define NODE_SWIN_BASE(nasid, widget) \ 94#define NODE_SWIN_BASE(nasid, widget) \
95 (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS)) 95 (NODE_IO_BASE(nasid) + (UINT64_CAST (widget) << SWIN_SIZE_BITS))
96#endif /* __ASSEMBLY__ || _STANDALONE */ 96#endif /* __ASSEMBLY__ */
97 97
98/* 98/*
99 * The following definitions pertain to the IO special address 99 * The following definitions pertain to the IO special address
@@ -143,12 +143,7 @@
143#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid))) 143#define SN0_WIDGET_BASE(_nasid, _wid) (NODE_SWIN_BASE((_nasid), (_wid)))
144 144
145/* Turn on sable logging for the processors whose bits are set. */ 145/* Turn on sable logging for the processors whose bits are set. */
146#ifdef SABLE
147#define SABLE_LOG_TRIGGER(_map) \
148 *((volatile hubreg_t *)(IO_BASE + 0x17ffff0)) = (_map)
149#else
150#define SABLE_LOG_TRIGGER(_map) 146#define SABLE_LOG_TRIGGER(_map)
151#endif /* SABLE */
152 147
153#ifndef __ASSEMBLY__ 148#ifndef __ASSEMBLY__
154#define KERN_NMI_ADDR(nasid, slice) \ 149#define KERN_NMI_ADDR(nasid, slice) \
@@ -281,76 +276,6 @@
281 276
282#define _ARCSPROM 277#define _ARCSPROM
283 278
284#ifdef _STANDALONE
285
286/*
287 * The PROM needs to pass the device base address and the
288 * device pci cfg space address to the device drivers during
289 * install. The COMPONENT->Key field is used for this purpose.
290 * Macros needed by SN0 device drivers to convert the
291 * COMPONENT->Key field to the respective base address.
292 * Key field looks as follows:
293 *
294 * +----------------------------------------------------+
295 * |devnasid | widget |pciid |hubwidid|hstnasid | adap |
296 * | 2 | 1 | 1 | 1 | 2 | 1 |
297 * +----------------------------------------------------+
298 * | | | | | | |
299 * 64 48 40 32 24 8 0
300 *
301 * These are used by standalone drivers till the io infrastructure
302 * is in place.
303 */
304
305#ifndef __ASSEMBLY__
306
307#define uchar unsigned char
308
309#define KEY_DEVNASID_SHFT 48
310#define KEY_WIDID_SHFT 40
311#define KEY_PCIID_SHFT 32
312#define KEY_HUBWID_SHFT 24
313#define KEY_HSTNASID_SHFT 8
314
315#define MK_SN0_KEY(nasid, widid, pciid) \
316 ((((__psunsigned_t)nasid)<< KEY_DEVNASID_SHFT |\
317 ((__psunsigned_t)widid) << KEY_WIDID_SHFT) |\
318 ((__psunsigned_t)pciid) << KEY_PCIID_SHFT)
319
320#define ADD_HUBWID_KEY(key,hubwid)\
321 (key|=((__psunsigned_t)hubwid << KEY_HUBWID_SHFT))
322
323#define ADD_HSTNASID_KEY(key,hstnasid)\
324 (key|=((__psunsigned_t)hstnasid << KEY_HSTNASID_SHFT))
325
326#define GET_DEVNASID_FROM_KEY(key) ((short)(key >> KEY_DEVNASID_SHFT))
327#define GET_WIDID_FROM_KEY(key) ((uchar)(key >> KEY_WIDID_SHFT))
328#define GET_PCIID_FROM_KEY(key) ((uchar)(key >> KEY_PCIID_SHFT))
329#define GET_HUBWID_FROM_KEY(key) ((uchar)(key >> KEY_HUBWID_SHFT))
330#define GET_HSTNASID_FROM_KEY(key) ((short)(key >> KEY_HSTNASID_SHFT))
331
332#define PCI_64_TARGID_SHFT 60
333
334#define GET_PCIBASE_FROM_KEY(key) (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
335 GET_WIDID_FROM_KEY(key))\
336 | BRIDGE_DEVIO(GET_PCIID_FROM_KEY(key)))
337
338#define GET_PCICFGBASE_FROM_KEY(key) \
339 (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
340 GET_WIDID_FROM_KEY(key))\
341 | BRIDGE_TYPE0_CFG_DEV(GET_PCIID_FROM_KEY(key)))
342
343#define GET_WIDBASE_FROM_KEY(key) \
344 (NODE_SWIN_BASE(GET_DEVNASID_FROM_KEY(key),\
345 GET_WIDID_FROM_KEY(key)))
346
347#define PUT_INSTALL_STATUS(c,s) c->Revision = s
348#define GET_INSTALL_STATUS(c) c->Revision
349
350#endif /* !__ASSEMBLY__ */
351
352#endif /* _STANDALONE */
353
354#if defined (HUB_ERR_STS_WAR) 279#if defined (HUB_ERR_STS_WAR)
355 280
356#define ERR_STS_WAR_REGISTER IIO_IIBUSERR 281#define ERR_STS_WAR_REGISTER IIO_IIBUSERR
diff --git a/include/asm-mips/sn/sn0/arch.h b/include/asm-mips/sn/sn0/arch.h
index fb78773a5efe..f7c43fa24aa8 100644
--- a/include/asm-mips/sn/sn0/arch.h
+++ b/include/asm-mips/sn/sn0/arch.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/config.h> 14#include <linux/config.h>
15 15
16#ifndef SABLE
17
18#ifndef SN0XXL /* 128 cpu SMP max */ 16#ifndef SN0XXL /* 128 cpu SMP max */
19/* 17/*
20 * This is the maximum number of nodes that can be part of a kernel. 18 * This is the maximum number of nodes that can be part of a kernel.
@@ -54,25 +52,16 @@
54 */ 52 */
55#define MAX_PARTITIONS MAX_REGIONS 53#define MAX_PARTITIONS MAX_REGIONS
56 54
57
58#else
59
60#define MAX_COMPACT_NODES 4
61#define MAX_NASIDS 4
62#define MAXCPUS 8
63
64#endif
65
66#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8) 55#define NASID_MASK_BYTES ((MAX_NASIDS + 7) / 8)
67 56
68/* 57/*
69 * Slot constants for SN0 58 * Slot constants for SN0
70 */ 59 */
71#ifdef CONFIG_SGI_SN0_N_MODE 60#ifdef CONFIG_SGI_SN_N_MODE
72#define MAX_MEM_SLOTS 16 /* max slots per node */ 61#define MAX_MEM_SLOTS 16 /* max slots per node */
73#else /* !CONFIG_SGI_SN0_N_MODE, assume M_MODE */ 62#else /* !CONFIG_SGI_SN_N_MODE, assume CONFIG_SGI_SN_M_MODE */
74#define MAX_MEM_SLOTS 32 /* max slots per node */ 63#define MAX_MEM_SLOTS 32 /* max slots per node */
75#endif /* defined(N_MODE) */ 64#endif /* CONFIG_SGI_SN_M_MODE */
76 65
77#define SLOT_SHIFT (27) 66#define SLOT_SHIFT (27)
78#define SLOT_MIN_MEM_SIZE (32*1024*1024) 67#define SLOT_MIN_MEM_SIZE (32*1024*1024)
diff --git a/include/asm-mips/sn/sn0/hub.h b/include/asm-mips/sn/sn0/hub.h
index f5dbba6f4610..3e228f8e7969 100644
--- a/include/asm-mips/sn/sn0/hub.h
+++ b/include/asm-mips/sn/sn0/hub.h
@@ -31,10 +31,6 @@
31#include <asm/sn/sn0/hubni.h> 31#include <asm/sn/sn0/hubni.h>
32//#include <asm/sn/sn0/hubcore.h> 32//#include <asm/sn/sn0/hubcore.h>
33 33
34#ifdef SABLE
35#define IP27_NO_HUBUART_INT 1
36#endif
37
38/* Translation of uncached attributes */ 34/* Translation of uncached attributes */
39#define UATTR_HSPEC 0 35#define UATTR_HSPEC 0
40#define UATTR_IO 1 36#define UATTR_IO 1
diff --git a/include/asm-mips/sn/sn0/hubio.h b/include/asm-mips/sn/sn0/hubio.h
index f314da21b970..ef91b3363554 100644
--- a/include/asm-mips/sn/sn0/hubio.h
+++ b/include/asm-mips/sn/sn0/hubio.h
@@ -486,22 +486,6 @@ typedef union h1_icrba_u {
486#define ICRBN_A_CERR_SHFT 54 486#define ICRBN_A_CERR_SHFT 54
487#define ICRBN_A_ERR_MASK 0x3ff 487#define ICRBN_A_ERR_MASK 0x3ff
488 488
489#if 0 /* Disabled, this causes namespace polution and break allmodconfig */
490/*
491 * Easy access macros.
492 */
493#define a_error icrba_fields_s.error
494#define a_ecode icrba_fields_s.ecode
495#define a_lnetuce icrba_fields_s.lnetuce
496#define a_mark icrba_fields_s.mark
497#define a_xerr icrba_fields_s.xerr
498#define a_sidn icrba_fields_s.sidn
499#define a_tnum icrba_fields_s.tnum
500#define a_addr icrba_fields_s.addr
501#define a_valid icrba_fields_s.valid
502#define a_iow icrba_fields_s.iow
503#endif
504
505#endif /* !__ASSEMBLY__ */ 489#endif /* !__ASSEMBLY__ */
506 490
507#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */ 491#define IIO_ICRB_ADDR_SHFT 2 /* Shift to get proper address */
diff --git a/include/asm-mips/sn/sn0/hubmd.h b/include/asm-mips/sn/sn0/hubmd.h
index a66def4e0ba0..1006aa26d771 100644
--- a/include/asm-mips/sn/sn0/hubmd.h
+++ b/include/asm-mips/sn/sn0/hubmd.h
@@ -92,7 +92,7 @@
92#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */ 92#define MD_UREG1_14 0x2200f0 /* uController/UART 1 register */
93#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */ 93#define MD_UREG1_15 0x2200f8 /* uController/UART 1 register */
94 94
95#ifdef CONFIG_SGI_SN0_N_MODE 95#ifdef CONFIG_SGI_SN_N_MODE
96#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */ 96#define MD_MEM_BANKS 4 /* 4 banks of memory max in N mode */
97#else 97#else
98#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */ 98#define MD_MEM_BANKS 8 /* 8 banks of memory max in M mode */
diff --git a/include/asm-mips/sn/sn0/hubpi.h b/include/asm-mips/sn/sn0/hubpi.h
index 355bba8552e3..e39f5f9da040 100644
--- a/include/asm-mips/sn/sn0/hubpi.h
+++ b/include/asm-mips/sn/sn0/hubpi.h
@@ -398,24 +398,6 @@ typedef u64 rtc_time_t;
398 398
399/* PI_RT_FILTER_CTRL mask and shift definitions */ 399/* PI_RT_FILTER_CTRL mask and shift definitions */
400 400
401#if 0
402/*
403 * XXX - This register's definition has changed, but it's only implemented
404 * in Hub 2.
405 */
406#define PRFC_DROP_COUNT_SHFT 27
407#define PRFC_DROP_COUNT_MASK (UINT64_CAST 0x3ff << 27)
408#define PRFC_DROP_CTR_SHFT 18
409#define PRFC_DROP_CTR_MASK (UINT64_CAST 0x1ff << 18)
410#define PRFC_MASK_ENABLE_SHFT 10
411#define PRFC_MASK_ENABLE_MASK (UINT64_CAST 0x7f << 10)
412#define PRFC_MASK_CTR_SHFT 2
413#define PRFC_MASK_CTR_MASK (UINT64_CAST 0xff << 2)
414#define PRFC_OFFSET_SHFT 0
415#define PRFC_OFFSET_MASK (UINT64_CAST 3)
416#endif /* 0 */
417
418
419/* 401/*
420 * Bits for NACK_CNT_A/B and NACK_CMP 402 * Bits for NACK_CNT_A/B and NACK_CMP
421 */ 403 */
diff --git a/include/asm-mips/sn/sn0/ip27.h b/include/asm-mips/sn/sn0/ip27.h
index ade0e974dd78..3c97e0855c8d 100644
--- a/include/asm-mips/sn/sn0/ip27.h
+++ b/include/asm-mips/sn/sn0/ip27.h
@@ -6,7 +6,7 @@
6 * Derived from IRIX <sys/SN/SN0/IP27.h>. 6 * Derived from IRIX <sys/SN/SN0/IP27.h>.
7 * 7 *
8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc. 8 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
9 * Copyright (C) 1999 by Ralf Baechle 9 * Copyright (C) 1999, 2006 by Ralf Baechle
10 */ 10 */
11#ifndef _ASM_SN_SN0_IP27_H 11#ifndef _ASM_SN_SN0_IP27_H
12#define _ASM_SN_SN0_IP27_H 12#define _ASM_SN_SN0_IP27_H
@@ -82,11 +82,4 @@
82#define SEND_NMI(_nasid, _slice) \ 82#define SEND_NMI(_nasid, _slice) \
83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1) 83 REMOTE_HUB_S((_nasid), (PI_NMI_A + ((_slice) * PI_NMI_OFFSET)), 1)
84 84
85/* Sanity hazzard ... Below all the Origin hacks are following. */
86
87#define SN00_BRIDGE 0x9200000008000000
88#define SN00I_BRIDGE0 0x920000000b000000
89#define SN00I_BRIDGE1 0x920000000e000000
90#define SN00I_BRIDGE2 0x920000000f000000
91
92#endif /* _ASM_SN_SN0_IP27_H */ 85#endif /* _ASM_SN_SN0_IP27_H */
diff --git a/include/asm-mips/sni.h b/include/asm-mips/sni.h
index b3bc698dfdee..b9ba54d0dd35 100644
--- a/include/asm-mips/sni.h
+++ b/include/asm-mips/sni.h
@@ -15,9 +15,6 @@
15/* 15/*
16 * ASIC PCI registers for little endian configuration. 16 * ASIC PCI registers for little endian configuration.
17 */ 17 */
18#ifndef __MIPSEL__
19#error "Fix me for big endian"
20#endif
21#define PCIMT_UCONF 0xbfff0000 18#define PCIMT_UCONF 0xbfff0000
22#define PCIMT_IOADTIMEOUT2 0xbfff0008 19#define PCIMT_IOADTIMEOUT2 0xbfff0008
23#define PCIMT_IOMEMCONF 0xbfff0010 20#define PCIMT_IOMEMCONF 0xbfff0010
@@ -51,9 +48,9 @@
51#define PCIMT_PCI_CONF 0xbfff0100 48#define PCIMT_PCI_CONF 0xbfff0100
52 49
53/* 50/*
54 * Data port for the PCI bus. 51 * Data port for the PCI bus in IO space
55 */ 52 */
56#define PCIMT_CONFIG_DATA 0xb4000cfc 53#define PCIMT_CONFIG_DATA 0x0cfc
57 54
58/* 55/*
59 * Board specific registers 56 * Board specific registers
diff --git a/include/asm-mips/war.h b/include/asm-mips/war.h
index ad374bd3f130..70636b41832c 100644
--- a/include/asm-mips/war.h
+++ b/include/asm-mips/war.h
@@ -172,7 +172,8 @@
172 * On the RM9000 there is a problem which makes the CreateDirtyExclusive 172 * On the RM9000 there is a problem which makes the CreateDirtyExclusive
173 * cache operation unusable on SMP systems. 173 * cache operation unusable on SMP systems.
174 */ 174 */
175#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) 175#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) || \
176 defined(CONFIG_BASLER_EXCITE)
176#define RM9000_CDEX_SMP_WAR 1 177#define RM9000_CDEX_SMP_WAR 1
177#endif 178#endif
178 179
@@ -182,7 +183,7 @@
182 * being fetched may case spurious exceptions. 183 * being fetched may case spurious exceptions.
183 */ 184 */
184#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \ 185#if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \
185 defined(CONFIG_PMC_YOSEMITE) 186 defined(CONFIG_PMC_YOSEMITE) || defined(CONFIG_BASLER_EXCITE)
186#define ICACHE_REFILLS_WORKAROUND_WAR 1 187#define ICACHE_REFILLS_WORKAROUND_WAR 1
187#endif 188#endif
188 189
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 9fcf0162d859..f6265c2a0dd2 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -329,7 +329,7 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
329#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 329#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
330 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \ 330 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
331 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ 331 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
332 CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO) 332 CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO | CPU_FTR_CI_LARGE_PAGE)
333#define CPU_FTRS_COMPATIBLE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \ 333#define CPU_FTRS_COMPATIBLE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
334 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2) 334 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2)
335#endif 335#endif
diff --git a/include/linux/console.h b/include/linux/console.h
index 721371382ae5..08734e660d41 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -117,6 +117,10 @@ extern void console_stop(struct console *);
117extern void console_start(struct console *); 117extern void console_start(struct console *);
118extern int is_console_locked(void); 118extern int is_console_locked(void);
119 119
120/* Suspend and resume console messages over PM events */
121extern void suspend_console(void);
122extern void resume_console(void);
123
120/* Some debug stub to catch some of the obvious races in the VT code */ 124/* Some debug stub to catch some of the obvious races in the VT code */
121#if 1 125#if 1
122#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) 126#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
new file mode 100644
index 000000000000..78b236ca04f8
--- /dev/null
+++ b/include/linux/dmaengine.h
@@ -0,0 +1,359 @@
1/*
2 * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59
16 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called COPYING.
20 */
21#ifndef DMAENGINE_H
22#define DMAENGINE_H
23#include <linux/config.h>
24#ifdef CONFIG_DMA_ENGINE
25
26#include <linux/device.h>
27#include <linux/uio.h>
28#include <linux/kref.h>
29#include <linux/completion.h>
30#include <linux/rcupdate.h>
31
32/**
33 * enum dma_event - resource PNP/power managment events
34 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
35 * @DMA_RESOURCE_RESUME: DMA device returning to full power
36 * @DMA_RESOURCE_ADDED: DMA device added to the system
37 * @DMA_RESOURCE_REMOVED: DMA device removed from the system
38 */
39enum dma_event {
40 DMA_RESOURCE_SUSPEND,
41 DMA_RESOURCE_RESUME,
42 DMA_RESOURCE_ADDED,
43 DMA_RESOURCE_REMOVED,
44};
45
46/**
47 * typedef dma_cookie_t
48 *
49 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
50 */
51typedef s32 dma_cookie_t;
52
53#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0)
54
55/**
56 * enum dma_status - DMA transaction status
57 * @DMA_SUCCESS: transaction completed successfully
58 * @DMA_IN_PROGRESS: transaction not yet processed
59 * @DMA_ERROR: transaction failed
60 */
61enum dma_status {
62 DMA_SUCCESS,
63 DMA_IN_PROGRESS,
64 DMA_ERROR,
65};
66
67/**
68 * struct dma_chan_percpu - the per-CPU part of struct dma_chan
69 * @refcount: local_t used for open-coded "bigref" counting
70 * @memcpy_count: transaction counter
71 * @bytes_transferred: byte counter
72 */
73
74struct dma_chan_percpu {
75 local_t refcount;
76 /* stats */
77 unsigned long memcpy_count;
78 unsigned long bytes_transferred;
79};
80
81/**
82 * struct dma_chan - devices supply DMA channels, clients use them
83 * @client: ptr to the client user of this chan, will be NULL when unused
84 * @device: ptr to the dma device who supplies this channel, always !NULL
85 * @cookie: last cookie value returned to client
86 * @chan_id:
87 * @class_dev:
88 * @refcount: kref, used in "bigref" slow-mode
89 * @slow_ref:
90 * @rcu:
91 * @client_node: used to add this to the client chan list
92 * @device_node: used to add this to the device chan list
93 * @local: per-cpu pointer to a struct dma_chan_percpu
94 */
95struct dma_chan {
96 struct dma_client *client;
97 struct dma_device *device;
98 dma_cookie_t cookie;
99
100 /* sysfs */
101 int chan_id;
102 struct class_device class_dev;
103
104 struct kref refcount;
105 int slow_ref;
106 struct rcu_head rcu;
107
108 struct list_head client_node;
109 struct list_head device_node;
110 struct dma_chan_percpu *local;
111};
112
113void dma_chan_cleanup(struct kref *kref);
114
115static inline void dma_chan_get(struct dma_chan *chan)
116{
117 if (unlikely(chan->slow_ref))
118 kref_get(&chan->refcount);
119 else {
120 local_inc(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
121 put_cpu();
122 }
123}
124
125static inline void dma_chan_put(struct dma_chan *chan)
126{
127 if (unlikely(chan->slow_ref))
128 kref_put(&chan->refcount, dma_chan_cleanup);
129 else {
130 local_dec(&(per_cpu_ptr(chan->local, get_cpu())->refcount));
131 put_cpu();
132 }
133}
134
135/*
136 * typedef dma_event_callback - function pointer to a DMA event callback
137 */
138typedef void (*dma_event_callback) (struct dma_client *client,
139 struct dma_chan *chan, enum dma_event event);
140
141/**
142 * struct dma_client - info on the entity making use of DMA services
143 * @event_callback: func ptr to call when something happens
144 * @chan_count: number of chans allocated
145 * @chans_desired: number of chans requested. Can be +/- chan_count
146 * @lock: protects access to the channels list
147 * @channels: the list of DMA channels allocated
148 * @global_node: list_head for global dma_client_list
149 */
150struct dma_client {
151 dma_event_callback event_callback;
152 unsigned int chan_count;
153 unsigned int chans_desired;
154
155 spinlock_t lock;
156 struct list_head channels;
157 struct list_head global_node;
158};
159
160/**
161 * struct dma_device - info on the entity supplying DMA services
162 * @chancnt: how many DMA channels are supported
163 * @channels: the list of struct dma_chan
164 * @global_node: list_head for global dma_device_list
165 * @refcount:
166 * @done:
167 * @dev_id:
168 * Other func ptrs: used to make use of this device's capabilities
169 */
170struct dma_device {
171
172 unsigned int chancnt;
173 struct list_head channels;
174 struct list_head global_node;
175
176 struct kref refcount;
177 struct completion done;
178
179 int dev_id;
180
181 int (*device_alloc_chan_resources)(struct dma_chan *chan);
182 void (*device_free_chan_resources)(struct dma_chan *chan);
183 dma_cookie_t (*device_memcpy_buf_to_buf)(struct dma_chan *chan,
184 void *dest, void *src, size_t len);
185 dma_cookie_t (*device_memcpy_buf_to_pg)(struct dma_chan *chan,
186 struct page *page, unsigned int offset, void *kdata,
187 size_t len);
188 dma_cookie_t (*device_memcpy_pg_to_pg)(struct dma_chan *chan,
189 struct page *dest_pg, unsigned int dest_off,
190 struct page *src_pg, unsigned int src_off, size_t len);
191 enum dma_status (*device_memcpy_complete)(struct dma_chan *chan,
192 dma_cookie_t cookie, dma_cookie_t *last,
193 dma_cookie_t *used);
194 void (*device_memcpy_issue_pending)(struct dma_chan *chan);
195};
196
197/* --- public DMA engine API --- */
198
199struct dma_client *dma_async_client_register(dma_event_callback event_callback);
200void dma_async_client_unregister(struct dma_client *client);
201void dma_async_client_chan_request(struct dma_client *client,
202 unsigned int number);
203
204/**
205 * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses
206 * @chan: DMA channel to offload copy to
207 * @dest: destination address (virtual)
208 * @src: source address (virtual)
209 * @len: length
210 *
211 * Both @dest and @src must be mappable to a bus address according to the
212 * DMA mapping API rules for streaming mappings.
213 * Both @dest and @src must stay memory resident (kernel memory or locked
214 * user space pages)
215 */
216static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
217 void *dest, void *src, size_t len)
218{
219 int cpu = get_cpu();
220 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
221 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
222 put_cpu();
223
224 return chan->device->device_memcpy_buf_to_buf(chan, dest, src, len);
225}
226
227/**
228 * dma_async_memcpy_buf_to_pg - offloaded copy
229 * @chan: DMA channel to offload copy to
230 * @page: destination page
231 * @offset: offset in page to copy to
232 * @kdata: source address (virtual)
233 * @len: length
234 *
235 * Both @page/@offset and @kdata must be mappable to a bus address according
236 * to the DMA mapping API rules for streaming mappings.
237 * Both @page/@offset and @kdata must stay memory resident (kernel memory or
238 * locked user space pages)
239 */
240static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
241 struct page *page, unsigned int offset, void *kdata, size_t len)
242{
243 int cpu = get_cpu();
244 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
245 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
246 put_cpu();
247
248 return chan->device->device_memcpy_buf_to_pg(chan, page, offset,
249 kdata, len);
250}
251
252/**
253 * dma_async_memcpy_buf_to_pg - offloaded copy
254 * @chan: DMA channel to offload copy to
255 * @dest_page: destination page
256 * @dest_off: offset in page to copy to
257 * @src_page: source page
258 * @src_off: offset in page to copy from
259 * @len: length
260 *
261 * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
262 * address according to the DMA mapping API rules for streaming mappings.
263 * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
264 * (kernel memory or locked user space pages)
265 */
266static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
267 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
268 unsigned int src_off, size_t len)
269{
270 int cpu = get_cpu();
271 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
272 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
273 put_cpu();
274
275 return chan->device->device_memcpy_pg_to_pg(chan, dest_pg, dest_off,
276 src_pg, src_off, len);
277}
278
279/**
280 * dma_async_memcpy_issue_pending - flush pending copies to HW
281 * @chan:
282 *
283 * This allows drivers to push copies to HW in batches,
284 * reducing MMIO writes where possible.
285 */
286static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan)
287{
288 return chan->device->device_memcpy_issue_pending(chan);
289}
290
291/**
292 * dma_async_memcpy_complete - poll for transaction completion
293 * @chan: DMA channel
294 * @cookie: transaction identifier to check status of
295 * @last: returns last completed cookie, can be NULL
296 * @used: returns last issued cookie, can be NULL
297 *
298 * If @last and @used are passed in, upon return they reflect the driver
299 * internal state and can be used with dma_async_is_complete() to check
300 * the status of multiple cookies without re-checking hardware state.
301 */
302static inline enum dma_status dma_async_memcpy_complete(struct dma_chan *chan,
303 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
304{
305 return chan->device->device_memcpy_complete(chan, cookie, last, used);
306}
307
308/**
309 * dma_async_is_complete - test a cookie against chan state
310 * @cookie: transaction identifier to test status of
311 * @last_complete: last know completed transaction
312 * @last_used: last cookie value handed out
313 *
314 * dma_async_is_complete() is used in dma_async_memcpy_complete()
315 * the test logic is seperated for lightweight testing of multiple cookies
316 */
317static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
318 dma_cookie_t last_complete, dma_cookie_t last_used)
319{
320 if (last_complete <= last_used) {
321 if ((cookie <= last_complete) || (cookie > last_used))
322 return DMA_SUCCESS;
323 } else {
324 if ((cookie <= last_complete) && (cookie > last_used))
325 return DMA_SUCCESS;
326 }
327 return DMA_IN_PROGRESS;
328}
329
330
331/* --- DMA device --- */
332
333int dma_async_device_register(struct dma_device *device);
334void dma_async_device_unregister(struct dma_device *device);
335
336/* --- Helper iov-locking functions --- */
337
338struct dma_page_list {
339 char *base_address;
340 int nr_pages;
341 struct page **pages;
342};
343
344struct dma_pinned_list {
345 int nr_iovecs;
346 struct dma_page_list page_list[0];
347};
348
349struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len);
350void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list);
351
352dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
353 struct dma_pinned_list *pinned_list, unsigned char *kdata, size_t len);
354dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
355 struct dma_pinned_list *pinned_list, struct page *page,
356 unsigned int offset, size_t len);
357
358#endif /* CONFIG_DMA_ENGINE */
359#endif /* DMAENGINE_H */
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index dd7d627bf66f..c115e9e840b4 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -1114,8 +1114,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c)
1114 1114
1115 mmsg->mfa = readl(c->in_port); 1115 mmsg->mfa = readl(c->in_port);
1116 if (unlikely(mmsg->mfa >= c->in_queue.len)) { 1116 if (unlikely(mmsg->mfa >= c->in_queue.len)) {
1117 u32 mfa = mmsg->mfa;
1118
1117 mempool_free(mmsg, c->in_msg.mempool); 1119 mempool_free(mmsg, c->in_msg.mempool);
1118 if(mmsg->mfa == I2O_QUEUE_EMPTY) 1120
1121 if (mfa == I2O_QUEUE_EMPTY)
1119 return ERR_PTR(-EBUSY); 1122 return ERR_PTR(-EBUSY);
1120 return ERR_PTR(-EFAULT); 1123 return ERR_PTR(-EFAULT);
1121 } 1124 }
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 28f4f3b36950..899c3d4776f3 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -169,7 +169,7 @@ struct ip_sf_list
169struct ip_mc_list 169struct ip_mc_list
170{ 170{
171 struct in_device *interface; 171 struct in_device *interface;
172 unsigned long multiaddr; 172 __be32 multiaddr;
173 struct ip_sf_list *sources; 173 struct ip_sf_list *sources;
174 struct ip_sf_list *tomb; 174 struct ip_sf_list *tomb;
175 unsigned int sfmode; 175 unsigned int sfmode;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f4169bbb60eb..e432b743dda2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -37,6 +37,7 @@
37#include <linux/config.h> 37#include <linux/config.h>
38#include <linux/device.h> 38#include <linux/device.h>
39#include <linux/percpu.h> 39#include <linux/percpu.h>
40#include <linux/dmaengine.h>
40 41
41struct divert_blk; 42struct divert_blk;
42struct vlan_group; 43struct vlan_group;
@@ -311,6 +312,9 @@ struct net_device
311#define NETIF_F_LLTX 4096 /* LockLess TX */ 312#define NETIF_F_LLTX 4096 /* LockLess TX */
312#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ 313#define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/
313 314
315#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
316#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM)
317
314 struct net_device *next_sched; 318 struct net_device *next_sched;
315 319
316 /* Interface index. Unique device identifier */ 320 /* Interface index. Unique device identifier */
@@ -406,7 +410,7 @@ struct net_device
406 * One part is mostly used on xmit path (device) 410 * One part is mostly used on xmit path (device)
407 */ 411 */
408 /* hard_start_xmit synchronizer */ 412 /* hard_start_xmit synchronizer */
409 spinlock_t xmit_lock ____cacheline_aligned_in_smp; 413 spinlock_t _xmit_lock ____cacheline_aligned_in_smp;
410 /* cpu id of processor entered to hard_start_xmit or -1, 414 /* cpu id of processor entered to hard_start_xmit or -1,
411 if nobody entered there. 415 if nobody entered there.
412 */ 416 */
@@ -593,6 +597,9 @@ struct softnet_data
593 struct sk_buff *completion_queue; 597 struct sk_buff *completion_queue;
594 598
595 struct net_device backlog_dev; /* Sorry. 8) */ 599 struct net_device backlog_dev; /* Sorry. 8) */
600#ifdef CONFIG_NET_DMA
601 struct dma_chan *net_dma;
602#endif
596}; 603};
597 604
598DECLARE_PER_CPU(struct softnet_data,softnet_data); 605DECLARE_PER_CPU(struct softnet_data,softnet_data);
@@ -889,11 +896,43 @@ static inline void __netif_rx_complete(struct net_device *dev)
889 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 896 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
890} 897}
891 898
899static inline void netif_tx_lock(struct net_device *dev)
900{
901 spin_lock(&dev->_xmit_lock);
902 dev->xmit_lock_owner = smp_processor_id();
903}
904
905static inline void netif_tx_lock_bh(struct net_device *dev)
906{
907 spin_lock_bh(&dev->_xmit_lock);
908 dev->xmit_lock_owner = smp_processor_id();
909}
910
911static inline int netif_tx_trylock(struct net_device *dev)
912{
913 int err = spin_trylock(&dev->_xmit_lock);
914 if (!err)
915 dev->xmit_lock_owner = smp_processor_id();
916 return err;
917}
918
919static inline void netif_tx_unlock(struct net_device *dev)
920{
921 dev->xmit_lock_owner = -1;
922 spin_unlock(&dev->_xmit_lock);
923}
924
925static inline void netif_tx_unlock_bh(struct net_device *dev)
926{
927 dev->xmit_lock_owner = -1;
928 spin_unlock_bh(&dev->_xmit_lock);
929}
930
892static inline void netif_tx_disable(struct net_device *dev) 931static inline void netif_tx_disable(struct net_device *dev)
893{ 932{
894 spin_lock_bh(&dev->xmit_lock); 933 netif_tx_lock_bh(dev);
895 netif_stop_queue(dev); 934 netif_stop_queue(dev);
896 spin_unlock_bh(&dev->xmit_lock); 935 netif_tx_unlock_bh(dev);
897} 936}
898 937
899/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 938/* These functions live elsewhere (drivers/net/net_init.c, but related) */
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 3ff88c878308..d2e4bd7a7a14 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -69,6 +69,10 @@ enum ip_conntrack_status {
69 /* Connection is dying (removed from lists), can not be unset. */ 69 /* Connection is dying (removed from lists), can not be unset. */
70 IPS_DYING_BIT = 9, 70 IPS_DYING_BIT = 9,
71 IPS_DYING = (1 << IPS_DYING_BIT), 71 IPS_DYING = (1 << IPS_DYING_BIT),
72
73 /* Connection has fixed timeout. */
74 IPS_FIXED_TIMEOUT_BIT = 10,
75 IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
72}; 76};
73 77
74/* Connection tracking event bits */ 78/* Connection tracking event bits */
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 668ec946c8e2..b5883ccee295 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -27,13 +27,15 @@ enum ctattr_type {
27 CTA_STATUS, 27 CTA_STATUS,
28 CTA_PROTOINFO, 28 CTA_PROTOINFO,
29 CTA_HELP, 29 CTA_HELP,
30 CTA_NAT, 30 CTA_NAT_SRC,
31#define CTA_NAT CTA_NAT_SRC /* backwards compatibility */
31 CTA_TIMEOUT, 32 CTA_TIMEOUT,
32 CTA_MARK, 33 CTA_MARK,
33 CTA_COUNTERS_ORIG, 34 CTA_COUNTERS_ORIG,
34 CTA_COUNTERS_REPLY, 35 CTA_COUNTERS_REPLY,
35 CTA_USE, 36 CTA_USE,
36 CTA_ID, 37 CTA_ID,
38 CTA_NAT_DST,
37 __CTA_MAX 39 __CTA_MAX
38}; 40};
39#define CTA_MAX (__CTA_MAX - 1) 41#define CTA_MAX (__CTA_MAX - 1)
diff --git a/include/linux/netfilter/xt_CONNSECMARK.h b/include/linux/netfilter/xt_CONNSECMARK.h
new file mode 100644
index 000000000000..c6bd75469ba2
--- /dev/null
+++ b/include/linux/netfilter/xt_CONNSECMARK.h
@@ -0,0 +1,13 @@
1#ifndef _XT_CONNSECMARK_H_target
2#define _XT_CONNSECMARK_H_target
3
4enum {
5 CONNSECMARK_SAVE = 1,
6 CONNSECMARK_RESTORE,
7};
8
9struct xt_connsecmark_target_info {
10 u_int8_t mode;
11};
12
13#endif /*_XT_CONNSECMARK_H_target */
diff --git a/include/linux/netfilter/xt_SECMARK.h b/include/linux/netfilter/xt_SECMARK.h
new file mode 100644
index 000000000000..c53fbffa997d
--- /dev/null
+++ b/include/linux/netfilter/xt_SECMARK.h
@@ -0,0 +1,26 @@
1#ifndef _XT_SECMARK_H_target
2#define _XT_SECMARK_H_target
3
4/*
5 * This is intended for use by various security subsystems (but not
6 * at the same time).
7 *
8 * 'mode' refers to the specific security subsystem which the
9 * packets are being marked for.
10 */
11#define SECMARK_MODE_SEL 0x01 /* SELinux */
12#define SECMARK_SELCTX_MAX 256
13
14struct xt_secmark_target_selinux_info {
15 u_int32_t selsid;
16 char selctx[SECMARK_SELCTX_MAX];
17};
18
19struct xt_secmark_target_info {
20 u_int8_t mode;
21 union {
22 struct xt_secmark_target_selinux_info sel;
23 } u;
24};
25
26#endif /*_XT_SECMARK_H_target */
diff --git a/include/linux/netfilter/xt_quota.h b/include/linux/netfilter/xt_quota.h
new file mode 100644
index 000000000000..acd7fd77bbee
--- /dev/null
+++ b/include/linux/netfilter/xt_quota.h
@@ -0,0 +1,16 @@
1#ifndef _XT_QUOTA_H
2#define _XT_QUOTA_H
3
4enum xt_quota_flags {
5 XT_QUOTA_INVERT = 0x1,
6};
7#define XT_QUOTA_MASK 0x1
8
9struct xt_quota_info {
10 u_int32_t flags;
11 u_int32_t pad;
12 aligned_u64 quota;
13 struct xt_quota_info *master;
14};
15
16#endif /* _XT_QUOTA_H */
diff --git a/include/linux/netfilter/xt_statistic.h b/include/linux/netfilter/xt_statistic.h
new file mode 100644
index 000000000000..c344e9916e23
--- /dev/null
+++ b/include/linux/netfilter/xt_statistic.h
@@ -0,0 +1,32 @@
1#ifndef _XT_STATISTIC_H
2#define _XT_STATISTIC_H
3
4enum xt_statistic_mode {
5 XT_STATISTIC_MODE_RANDOM,
6 XT_STATISTIC_MODE_NTH,
7 __XT_STATISTIC_MODE_MAX
8};
9#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)
10
11enum xt_statistic_flags {
12 XT_STATISTIC_INVERT = 0x1,
13};
14#define XT_STATISTIC_MASK 0x1
15
16struct xt_statistic_info {
17 u_int16_t mode;
18 u_int16_t flags;
19 union {
20 struct {
21 u_int32_t probability;
22 } random;
23 struct {
24 u_int32_t every;
25 u_int32_t packet;
26 u_int32_t count;
27 } nth;
28 } u;
29 struct xt_statistic_info *master __attribute__((aligned(8)));
30};
31
32#endif /* _XT_STATISTIC_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index d54d7b278e96..e0e9951eb8c3 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -121,6 +121,10 @@ struct ip_conntrack
121 u_int32_t mark; 121 u_int32_t mark;
122#endif 122#endif
123 123
124#ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
125 u_int32_t secmark;
126#endif
127
124 /* Traversed often, so hopefully in different cacheline to top */ 128 /* Traversed often, so hopefully in different cacheline to top */
125 /* These are my tuples; original and reply */ 129 /* These are my tuples; original and reply */
126 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; 130 struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX];
@@ -154,6 +158,7 @@ struct ip_conntrack_expect
154 unsigned int flags; 158 unsigned int flags;
155 159
156#ifdef CONFIG_IP_NF_NAT_NEEDED 160#ifdef CONFIG_IP_NF_NAT_NEEDED
161 u_int32_t saved_ip;
157 /* This is the original per-proto part, used to map the 162 /* This is the original per-proto part, used to map the
158 * expected connection the way the recipient expects. */ 163 * expected connection the way the recipient expects. */
159 union ip_conntrack_manip_proto saved_proto; 164 union ip_conntrack_manip_proto saved_proto;
@@ -293,6 +298,7 @@ static inline int is_dying(struct ip_conntrack *ct)
293} 298}
294 299
295extern unsigned int ip_conntrack_htable_size; 300extern unsigned int ip_conntrack_htable_size;
301extern int ip_conntrack_checksum;
296 302
297#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) 303#define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++)
298 304
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
index eace86bd2adb..3cbff7379002 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -71,6 +71,13 @@ extern int (*nat_h245_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct,
71 unsigned char **data, int dataoff, 71 unsigned char **data, int dataoff,
72 TransportAddress * addr, u_int16_t port, 72 TransportAddress * addr, u_int16_t port,
73 struct ip_conntrack_expect * exp); 73 struct ip_conntrack_expect * exp);
74extern int (*nat_callforwarding_hook) (struct sk_buff ** pskb,
75 struct ip_conntrack * ct,
76 enum ip_conntrack_info ctinfo,
77 unsigned char **data, int dataoff,
78 TransportAddress * addr,
79 u_int16_t port,
80 struct ip_conntrack_expect * exp);
74extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, 81extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct,
75 enum ip_conntrack_info ctinfo, 82 enum ip_conntrack_info ctinfo,
76 unsigned char **data, TransportAddress * addr, 83 unsigned char **data, TransportAddress * addr,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
index cc98f7aa5abe..3d4a773799fc 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
@@ -1,4 +1,4 @@
1/* Generated by Jing Min Zhao's ASN.1 parser, Mar 15 2006 1/* Generated by Jing Min Zhao's ASN.1 parser, Apr 20 2006
2 * 2 *
3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net> 3 * Copyright (c) 2006 Jing Min Zhao <zhaojingmin@users.sourceforge.net>
4 * 4 *
@@ -412,6 +412,7 @@ typedef struct Facility_UUIE { /* SEQUENCE */
412 eFacility_UUIE_destinationInfo = (1 << 14), 412 eFacility_UUIE_destinationInfo = (1 << 14),
413 eFacility_UUIE_h245SecurityMode = (1 << 13), 413 eFacility_UUIE_h245SecurityMode = (1 << 13),
414 } options; 414 } options;
415 TransportAddress alternativeAddress;
415 FacilityReason reason; 416 FacilityReason reason;
416 TransportAddress h245Address; 417 TransportAddress h245Address;
417 Facility_UUIE_fastStart fastStart; 418 Facility_UUIE_fastStart fastStart;
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
new file mode 100644
index 000000000000..913dad66c0fb
--- /dev/null
+++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
@@ -0,0 +1,44 @@
1#ifndef __IP_CONNTRACK_SIP_H__
2#define __IP_CONNTRACK_SIP_H__
3#ifdef __KERNEL__
4
5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600
7
8#define POS_VIA 0
9#define POS_CONTACT 1
10#define POS_CONTENT 2
11#define POS_MEDIA 3
12#define POS_OWNER 4
13#define POS_CONNECTION 5
14#define POS_REQ_HEADER 6
15#define POS_SDP_HEADER 7
16
17struct sip_header_nfo {
18 const char *lname;
19 const char *sname;
20 const char *ln_str;
21 size_t lnlen;
22 size_t snlen;
23 size_t ln_strlen;
24 int (*match_len)(const char *, const char *, int *);
25};
26
27extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
28 enum ip_conntrack_info ctinfo,
29 struct ip_conntrack *ct,
30 const char **dptr);
31extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
32 enum ip_conntrack_info ctinfo,
33 struct ip_conntrack_expect *exp,
34 const char *dptr);
35
36extern int ct_sip_get_info(const char *dptr, size_t dlen,
37 unsigned int *matchoff,
38 unsigned int *matchlen,
39 struct sip_header_nfo *hnfo);
40extern int ct_sip_lnlen(const char *line, const char *limit);
41extern const char *ct_sip_search(const char *needle, const char *haystack,
42 size_t needle_len, size_t haystack_len);
43#endif /* __KERNEL__ */
44#endif /* __IP_CONNTRACK_SIP_H__ */
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 4877e35ae202..936ef82ed76a 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -50,7 +50,7 @@
50extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags); 50extern acpi_status pci_osc_control_set(acpi_handle handle, u32 flags);
51extern acpi_status pci_osc_support_set(u32 flags); 51extern acpi_status pci_osc_support_set(u32 flags);
52#else 52#else
53#if !defined(acpi_status) 53#if !defined(AE_ERROR)
54typedef u32 acpi_status; 54typedef u32 acpi_status;
55#define AE_ERROR (acpi_status) (0x0001) 55#define AE_ERROR (acpi_status) (0x0001)
56#endif 56#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3a6a4e37a482..6fd36cb09160 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -442,6 +442,7 @@ struct pci_dev *pci_find_device_reverse (unsigned int vendor, unsigned int devic
442struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 442struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
443int pci_find_capability (struct pci_dev *dev, int cap); 443int pci_find_capability (struct pci_dev *dev, int cap);
444int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 444int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
445int pci_find_ext_capability (struct pci_dev *dev, int cap);
445struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 446struct pci_bus * pci_find_next_bus(const struct pci_bus *from);
446 447
447struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from); 448struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
@@ -662,6 +663,7 @@ static inline int pci_register_driver(struct pci_driver *drv) { return 0;}
662static inline void pci_unregister_driver(struct pci_driver *drv) { } 663static inline void pci_unregister_driver(struct pci_driver *drv) { }
663static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; } 664static inline int pci_find_capability (struct pci_dev *dev, int cap) {return 0; }
664static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; } 665static inline int pci_find_next_capability (struct pci_dev *dev, u8 post, int cap) { return 0; }
666static inline int pci_find_ext_capability (struct pci_dev *dev, int cap) {return 0; }
665static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; } 667static inline const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev) { return NULL; }
666 668
667/* Power management related routines */ 669/* Power management related routines */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 590dc6dca315..bcfe9d4f56ae 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -935,6 +935,7 @@
935#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151 935#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
936#define PCI_DEVICE_ID_PLX_R753 0x1152 936#define PCI_DEVICE_ID_PLX_R753 0x1152
937#define PCI_DEVICE_ID_PLX_OLITEC 0x1187 937#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
938#define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196
938#define PCI_DEVICE_ID_PLX_9050 0x9050 939#define PCI_DEVICE_ID_PLX_9050 0x9050
939#define PCI_DEVICE_ID_PLX_9080 0x9080 940#define PCI_DEVICE_ID_PLX_9080 0x9080
940#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 941#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
@@ -1182,6 +1183,14 @@
1182#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E 1183#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
1183#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372 1184#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
1184#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 1185#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
1186#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5
1187#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6
1188#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE
1189#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
1190#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
1191#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1192#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
1193#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
1185 1194
1186#define PCI_VENDOR_ID_IMS 0x10e0 1195#define PCI_VENDOR_ID_IMS 0x10e0
1187#define PCI_DEVICE_ID_IMS_TT128 0x9128 1196#define PCI_DEVICE_ID_IMS_TT128 0x9128
@@ -1827,6 +1836,7 @@
1827 1836
1828#define PCI_VENDOR_ID_SAMSUNG 0x144d 1837#define PCI_VENDOR_ID_SAMSUNG 0x144d
1829 1838
1839#define PCI_VENDOR_ID_MYRICOM 0x14c1
1830 1840
1831#define PCI_VENDOR_ID_TITAN 0x14D2 1841#define PCI_VENDOR_ID_TITAN 0x14D2
1832#define PCI_DEVICE_ID_TITAN_010L 0x8001 1842#define PCI_DEVICE_ID_TITAN_010L 0x8001
@@ -1887,6 +1897,7 @@
1887#define PCI_DEVICE_ID_TIGON3_5751F 0x167e 1897#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
1888#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1898#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1889#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1899#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1900#define PCI_DEVICE_ID_TIGON3_5786 0x169a
1890#define PCI_DEVICE_ID_TIGON3_5787 0x169b 1901#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1891#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1902#define PCI_DEVICE_ID_TIGON3_5788 0x169c
1892#define PCI_DEVICE_ID_TIGON3_5789 0x169d 1903#define PCI_DEVICE_ID_TIGON3_5789 0x169d
@@ -2043,6 +2054,7 @@
2043#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960 2054#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960
2044#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 2055#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
2045#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2056#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2057#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2046#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2058#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2047#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2059#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2048#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2060#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index bac0fb389cf1..d5dd471da225 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -159,7 +159,7 @@ struct sadb_spirange {
159struct sadb_x_kmprivate { 159struct sadb_x_kmprivate {
160 uint16_t sadb_x_kmprivate_len; 160 uint16_t sadb_x_kmprivate_len;
161 uint16_t sadb_x_kmprivate_exttype; 161 uint16_t sadb_x_kmprivate_exttype;
162 u_int32_t sadb_x_kmprivate_reserved; 162 uint32_t sadb_x_kmprivate_reserved;
163} __attribute__((packed)); 163} __attribute__((packed));
164/* sizeof(struct sadb_x_kmprivate) == 8 */ 164/* sizeof(struct sadb_x_kmprivate) == 8 */
165 165
diff --git a/include/linux/security.h b/include/linux/security.h
index 1bab48f6aeac..4dfb1b84a9b3 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -805,31 +805,37 @@ struct swap_info_struct;
805 * used by the XFRM system. 805 * used by the XFRM system.
806 * @sec_ctx contains the security context information being provided by 806 * @sec_ctx contains the security context information being provided by
807 * the user-level policy update program (e.g., setkey). 807 * the user-level policy update program (e.g., setkey).
808 * Allocate a security structure to the xp->selector.security field. 808 * Allocate a security structure to the xp->security field.
809 * The security field is initialized to NULL when the xfrm_policy is 809 * The security field is initialized to NULL when the xfrm_policy is
810 * allocated. 810 * allocated.
811 * Return 0 if operation was successful (memory to allocate, legal context) 811 * Return 0 if operation was successful (memory to allocate, legal context)
812 * @xfrm_policy_clone_security: 812 * @xfrm_policy_clone_security:
813 * @old contains an existing xfrm_policy in the SPD. 813 * @old contains an existing xfrm_policy in the SPD.
814 * @new contains a new xfrm_policy being cloned from old. 814 * @new contains a new xfrm_policy being cloned from old.
815 * Allocate a security structure to the new->selector.security field 815 * Allocate a security structure to the new->security field
816 * that contains the information from the old->selector.security field. 816 * that contains the information from the old->security field.
817 * Return 0 if operation was successful (memory to allocate). 817 * Return 0 if operation was successful (memory to allocate).
818 * @xfrm_policy_free_security: 818 * @xfrm_policy_free_security:
819 * @xp contains the xfrm_policy 819 * @xp contains the xfrm_policy
820 * Deallocate xp->selector.security. 820 * Deallocate xp->security.
821 * @xfrm_policy_delete_security:
822 * @xp contains the xfrm_policy.
823 * Authorize deletion of xp->security.
821 * @xfrm_state_alloc_security: 824 * @xfrm_state_alloc_security:
822 * @x contains the xfrm_state being added to the Security Association 825 * @x contains the xfrm_state being added to the Security Association
823 * Database by the XFRM system. 826 * Database by the XFRM system.
824 * @sec_ctx contains the security context information being provided by 827 * @sec_ctx contains the security context information being provided by
825 * the user-level SA generation program (e.g., setkey or racoon). 828 * the user-level SA generation program (e.g., setkey or racoon).
826 * Allocate a security structure to the x->sel.security field. The 829 * Allocate a security structure to the x->security field. The
827 * security field is initialized to NULL when the xfrm_state is 830 * security field is initialized to NULL when the xfrm_state is
828 * allocated. 831 * allocated.
829 * Return 0 if operation was successful (memory to allocate, legal context). 832 * Return 0 if operation was successful (memory to allocate, legal context).
830 * @xfrm_state_free_security: 833 * @xfrm_state_free_security:
831 * @x contains the xfrm_state. 834 * @x contains the xfrm_state.
832 * Deallocate x>sel.security. 835 * Deallocate x->security.
836 * @xfrm_state_delete_security:
837 * @x contains the xfrm_state.
838 * Authorize deletion of x->security.
833 * @xfrm_policy_lookup: 839 * @xfrm_policy_lookup:
834 * @xp contains the xfrm_policy for which the access control is being 840 * @xp contains the xfrm_policy for which the access control is being
835 * checked. 841 * checked.
@@ -1298,8 +1304,10 @@ struct security_operations {
1298 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); 1304 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
1299 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1305 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1300 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1306 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1307 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
1301 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); 1308 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
1302 void (*xfrm_state_free_security) (struct xfrm_state *x); 1309 void (*xfrm_state_free_security) (struct xfrm_state *x);
1310 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1303 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir); 1311 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir);
1304#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1312#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1305 1313
@@ -2934,11 +2942,21 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2934 security_ops->xfrm_policy_free_security(xp); 2942 security_ops->xfrm_policy_free_security(xp);
2935} 2943}
2936 2944
2945static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2946{
2947 return security_ops->xfrm_policy_delete_security(xp);
2948}
2949
2937static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 2950static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2938{ 2951{
2939 return security_ops->xfrm_state_alloc_security(x, sec_ctx); 2952 return security_ops->xfrm_state_alloc_security(x, sec_ctx);
2940} 2953}
2941 2954
2955static inline int security_xfrm_state_delete(struct xfrm_state *x)
2956{
2957 return security_ops->xfrm_state_delete_security(x);
2958}
2959
2942static inline void security_xfrm_state_free(struct xfrm_state *x) 2960static inline void security_xfrm_state_free(struct xfrm_state *x)
2943{ 2961{
2944 security_ops->xfrm_state_free_security(x); 2962 security_ops->xfrm_state_free_security(x);
@@ -2963,6 +2981,11 @@ static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2963{ 2981{
2964} 2982}
2965 2983
2984static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
2985{
2986 return 0;
2987}
2988
2966static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 2989static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2967{ 2990{
2968 return 0; 2991 return 0;
@@ -2972,6 +2995,11 @@ static inline void security_xfrm_state_free(struct xfrm_state *x)
2972{ 2995{
2973} 2996}
2974 2997
2998static inline int security_xfrm_state_delete(struct xfrm_state *x)
2999{
3000 return 0;
3001}
3002
2975static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) 3003static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
2976{ 3004{
2977 return 0; 3005 return 0;
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
index 4047bcde4484..aad4e390d6a5 100644
--- a/include/linux/selinux.h
+++ b/include/linux/selinux.h
@@ -118,6 +118,27 @@ void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
118 */ 118 */
119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid); 119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
120 120
121/**
122 * selinux_string_to_sid - map a security context string to a security ID
123 * @str: the security context string to be mapped
124 * @sid: ID value returned via this.
125 *
126 * Returns 0 if successful, with the SID stored in sid. A value
127 * of zero for sid indicates no SID could be determined (but no error
128 * occurred).
129 */
130int selinux_string_to_sid(char *str, u32 *sid);
131
132/**
133 * selinux_relabel_packet_permission - check permission to relabel a packet
134 * @sid: ID value to be applied to network packet (via SECMARK, most likely)
135 *
136 * Returns 0 if the current task is allowed to label packets with the
137 * supplied security ID. Note that it is implicit that the packet is always
138 * being relabeled from the default unlabled value, and that the access
139 * control decision is made in the AVC.
140 */
141int selinux_relabel_packet_permission(u32 sid);
121 142
122#else 143#else
123 144
@@ -172,6 +193,17 @@ static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
172 *sid = 0; 193 *sid = 0;
173} 194}
174 195
196static inline int selinux_string_to_sid(const char *str, u32 *sid)
197{
198 *sid = 0;
199 return 0;
200}
201
202static inline int selinux_relabel_packet_permission(u32 sid)
203{
204 return 0;
205}
206
175#endif /* CONFIG_SECURITY_SELINUX */ 207#endif /* CONFIG_SECURITY_SELINUX */
176 208
177#endif /* _LINUX_SELINUX_H */ 209#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f8f234708b98..93e4db221585 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,6 +29,7 @@
29#include <linux/net.h> 29#include <linux/net.h>
30#include <linux/textsearch.h> 30#include <linux/textsearch.h>
31#include <net/checksum.h> 31#include <net/checksum.h>
32#include <linux/dmaengine.h>
32 33
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 34#define HAVE_ALLOC_SKB /* For the drivers to know */
34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 35#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
@@ -209,6 +210,7 @@ enum {
209 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 210 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
210 * @tc_index: Traffic control index 211 * @tc_index: Traffic control index
211 * @tc_verd: traffic control verdict 212 * @tc_verd: traffic control verdict
213 * @secmark: security marking
212 */ 214 */
213 215
214struct sk_buff { 216struct sk_buff {
@@ -285,6 +287,12 @@ struct sk_buff {
285 __u16 tc_verd; /* traffic control verdict */ 287 __u16 tc_verd; /* traffic control verdict */
286#endif 288#endif
287#endif 289#endif
290#ifdef CONFIG_NET_DMA
291 dma_cookie_t dma_cookie;
292#endif
293#ifdef CONFIG_NETWORK_SECMARK
294 __u32 secmark;
295#endif
288 296
289 297
290 /* These elements must be at the end, see alloc_skb() for details. */ 298 /* These elements must be at the end, see alloc_skb() for details. */
@@ -967,15 +975,16 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
967#define NET_SKB_PAD 16 975#define NET_SKB_PAD 16
968#endif 976#endif
969 977
970extern int ___pskb_trim(struct sk_buff *skb, unsigned int len, int realloc); 978extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
971 979
972static inline void __skb_trim(struct sk_buff *skb, unsigned int len) 980static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
973{ 981{
974 if (!skb->data_len) { 982 if (unlikely(skb->data_len)) {
975 skb->len = len; 983 WARN_ON(1);
976 skb->tail = skb->data + len; 984 return;
977 } else 985 }
978 ___pskb_trim(skb, len, 0); 986 skb->len = len;
987 skb->tail = skb->data + len;
979} 988}
980 989
981/** 990/**
@@ -985,6 +994,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
985 * 994 *
986 * Cut the length of a buffer down by removing data from the tail. If 995 * Cut the length of a buffer down by removing data from the tail. If
987 * the buffer is already under the length specified it is not modified. 996 * the buffer is already under the length specified it is not modified.
997 * The skb must be linear.
988 */ 998 */
989static inline void skb_trim(struct sk_buff *skb, unsigned int len) 999static inline void skb_trim(struct sk_buff *skb, unsigned int len)
990{ 1000{
@@ -995,12 +1005,10 @@ static inline void skb_trim(struct sk_buff *skb, unsigned int len)
995 1005
996static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) 1006static inline int __pskb_trim(struct sk_buff *skb, unsigned int len)
997{ 1007{
998 if (!skb->data_len) { 1008 if (skb->data_len)
999 skb->len = len; 1009 return ___pskb_trim(skb, len);
1000 skb->tail = skb->data+len; 1010 __skb_trim(skb, len);
1001 return 0; 1011 return 0;
1002 }
1003 return ___pskb_trim(skb, len, 1);
1004} 1012}
1005 1013
1006static inline int pskb_trim(struct sk_buff *skb, unsigned int len) 1014static inline int pskb_trim(struct sk_buff *skb, unsigned int len)
@@ -1161,18 +1169,34 @@ static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1161 return 0; 1169 return 0;
1162} 1170}
1163 1171
1172static inline int __skb_linearize(struct sk_buff *skb)
1173{
1174 return __pskb_pull_tail(skb, skb->data_len) ? 0 : -ENOMEM;
1175}
1176
1164/** 1177/**
1165 * skb_linearize - convert paged skb to linear one 1178 * skb_linearize - convert paged skb to linear one
1166 * @skb: buffer to linarize 1179 * @skb: buffer to linarize
1167 * @gfp: allocation mode
1168 * 1180 *
1169 * If there is no free memory -ENOMEM is returned, otherwise zero 1181 * If there is no free memory -ENOMEM is returned, otherwise zero
1170 * is returned and the old skb data released. 1182 * is returned and the old skb data released.
1171 */ 1183 */
1172extern int __skb_linearize(struct sk_buff *skb, gfp_t gfp); 1184static inline int skb_linearize(struct sk_buff *skb)
1173static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) 1185{
1186 return skb_is_nonlinear(skb) ? __skb_linearize(skb) : 0;
1187}
1188
1189/**
1190 * skb_linearize_cow - make sure skb is linear and writable
1191 * @skb: buffer to process
1192 *
1193 * If there is no free memory -ENOMEM is returned, otherwise zero
1194 * is returned and the old skb data released.
1195 */
1196static inline int skb_linearize_cow(struct sk_buff *skb)
1174{ 1197{
1175 return __skb_linearize(skb, gfp); 1198 return skb_is_nonlinear(skb) || skb_cloned(skb) ?
1199 __skb_linearize(skb) : 0;
1176} 1200}
1177 1201
1178/** 1202/**
@@ -1396,5 +1420,23 @@ static inline void nf_reset(struct sk_buff *skb)
1396static inline void nf_reset(struct sk_buff *skb) {} 1420static inline void nf_reset(struct sk_buff *skb) {}
1397#endif /* CONFIG_NETFILTER */ 1421#endif /* CONFIG_NETFILTER */
1398 1422
1423#ifdef CONFIG_NETWORK_SECMARK
1424static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1425{
1426 to->secmark = from->secmark;
1427}
1428
1429static inline void skb_init_secmark(struct sk_buff *skb)
1430{
1431 skb->secmark = 0;
1432}
1433#else
1434static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from)
1435{ }
1436
1437static inline void skb_init_secmark(struct sk_buff *skb)
1438{ }
1439#endif
1440
1399#endif /* __KERNEL__ */ 1441#endif /* __KERNEL__ */
1400#endif /* _LINUX_SKBUFF_H */ 1442#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 76eaeff76f82..cee944dbdcd4 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -313,6 +313,7 @@ enum
313 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29, 313 NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
314 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30, 314 NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
315 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31, 315 NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
316 NET_NF_CONNTRACK_CHECKSUM=32,
316}; 317};
317 318
318/* /proc/sys/net/ipv4 */ 319/* /proc/sys/net/ipv4 */
@@ -403,6 +404,8 @@ enum
403 NET_TCP_MTU_PROBING=113, 404 NET_TCP_MTU_PROBING=113,
404 NET_TCP_BASE_MSS=114, 405 NET_TCP_BASE_MSS=114,
405 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, 406 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
407 NET_TCP_DMA_COPYBREAK=116,
408 NET_TCP_SLOW_START_AFTER_IDLE=117,
406}; 409};
407 410
408enum { 411enum {
@@ -491,6 +494,7 @@ enum
491 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25, 494 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
492 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26, 495 NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
493 NET_IPV4_NF_CONNTRACK_COUNT=27, 496 NET_IPV4_NF_CONNTRACK_COUNT=27,
497 NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
494}; 498};
495 499
496/* /proc/sys/net/ipv6 */ 500/* /proc/sys/net/ipv6 */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 542d39596bd8..c90daa5da6c3 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -18,6 +18,7 @@
18#define _LINUX_TCP_H 18#define _LINUX_TCP_H
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/dmaengine.h>
21#include <asm/byteorder.h> 22#include <asm/byteorder.h>
22 23
23struct tcphdr { 24struct tcphdr {
@@ -233,6 +234,13 @@ struct tcp_sock {
233 struct iovec *iov; 234 struct iovec *iov;
234 int memory; 235 int memory;
235 int len; 236 int len;
237#ifdef CONFIG_NET_DMA
238 /* members for async copy */
239 struct dma_chan *dma_chan;
240 int wakeup;
241 struct dma_pinned_list *pinned_list;
242 dma_cookie_t dma_cookie;
243#endif
236 } ucopy; 244 } ucopy;
237 245
238 __u32 snd_wl1; /* Sequence for window update */ 246 __u32 snd_wl1; /* Sequence for window update */
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 6b42cc474c01..46a15c7a1a13 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -118,6 +118,10 @@ enum
118 XFRM_SHARE_UNIQUE /* Use once */ 118 XFRM_SHARE_UNIQUE /* Use once */
119}; 119};
120 120
121#define XFRM_MODE_TRANSPORT 0
122#define XFRM_MODE_TUNNEL 1
123#define XFRM_MODE_MAX 2
124
121/* Netlink configuration messages. */ 125/* Netlink configuration messages. */
122enum { 126enum {
123 XFRM_MSG_BASE = 0x10, 127 XFRM_MSG_BASE = 0x10,
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index d5926bfb1fc9..d5147770ad47 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -29,7 +29,7 @@
29#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
30#include <linux/wireless.h> 30#include <linux/wireless.h>
31 31
32#define IEEE80211_VERSION "git-1.1.7" 32#define IEEE80211_VERSION "git-1.1.13"
33 33
34#define IEEE80211_DATA_LEN 2304 34#define IEEE80211_DATA_LEN 2304
35/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 35/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
@@ -104,6 +104,9 @@
104#define IEEE80211_SCTL_FRAG 0x000F 104#define IEEE80211_SCTL_FRAG 0x000F
105#define IEEE80211_SCTL_SEQ 0xFFF0 105#define IEEE80211_SCTL_SEQ 0xFFF0
106 106
107/* QOS control */
108#define IEEE80211_QCTL_TID 0x000F
109
107/* debug macros */ 110/* debug macros */
108 111
109#ifdef CONFIG_IEEE80211_DEBUG 112#ifdef CONFIG_IEEE80211_DEBUG
@@ -1075,6 +1078,7 @@ struct ieee80211_device {
1075 1078
1076 int (*handle_management) (struct net_device * dev, 1079 int (*handle_management) (struct net_device * dev,
1077 struct ieee80211_network * network, u16 type); 1080 struct ieee80211_network * network, u16 type);
1081 int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb);
1078 1082
1079 /* Typical STA methods */ 1083 /* Typical STA methods */
1080 int (*handle_auth) (struct net_device * dev, 1084 int (*handle_auth) (struct net_device * dev,
@@ -1243,7 +1247,8 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
1243extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); 1247extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
1244extern void ieee80211_txb_free(struct ieee80211_txb *); 1248extern void ieee80211_txb_free(struct ieee80211_txb *);
1245extern int ieee80211_tx_frame(struct ieee80211_device *ieee, 1249extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
1246 struct ieee80211_hdr *frame, int len); 1250 struct ieee80211_hdr *frame, int hdr_len,
1251 int total_len, int encrypt_mpdu);
1247 1252
1248/* ieee80211_rx.c */ 1253/* ieee80211_rx.c */
1249extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, 1254extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
index 052ed596a4e4..7a483ab4022f 100644
--- a/include/net/ieee80211softmac.h
+++ b/include/net/ieee80211softmac.h
@@ -86,6 +86,9 @@ struct ieee80211softmac_assoc_info {
86 86
87 /* BSSID we're trying to associate to */ 87 /* BSSID we're trying to associate to */
88 char bssid[ETH_ALEN]; 88 char bssid[ETH_ALEN];
89
90 /* Rates supported by the network */
91 struct ieee80211softmac_ratesinfo supported_rates;
89 92
90 /* some flags. 93 /* some flags.
91 * static_essid is valid if the essid is constant, 94 * static_essid is valid if the essid is constant,
@@ -132,23 +135,26 @@ enum {
132struct ieee80211softmac_txrates { 135struct ieee80211softmac_txrates {
133 /* The Bit-Rate to be used for multicast frames. */ 136 /* The Bit-Rate to be used for multicast frames. */
134 u8 mcast_rate; 137 u8 mcast_rate;
135 /* The Bit-Rate to be used for multicast fallback 138
136 * (If the device supports fallback and hardware-retry) 139 /* The Bit-Rate to be used for multicast management frames. */
137 */ 140 u8 mgt_mcast_rate;
138 u8 mcast_fallback; 141
139 /* The Bit-Rate to be used for any other (normal) data packet. */ 142 /* The Bit-Rate to be used for any other (normal) data packet. */
140 u8 default_rate; 143 u8 default_rate;
141 /* The Bit-Rate to be used for default fallback 144 /* The Bit-Rate to be used for default fallback
142 * (If the device supports fallback and hardware-retry) 145 * (If the device supports fallback and hardware-retry)
143 */ 146 */
144 u8 default_fallback; 147 u8 default_fallback;
148
149 /* This is the rate that the user asked for */
150 u8 user_rate;
145}; 151};
146 152
147/* Bits for txrates_change callback. */ 153/* Bits for txrates_change callback. */
148#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */ 154#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */
149#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */ 155#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */
150#define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ 156#define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */
151#define IEEE80211SOFTMAC_TXRATECHG_MCAST_FBACK (1 << 3) /* mcast_fallback */ 157#define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */
152 158
153struct ieee80211softmac_device { 159struct ieee80211softmac_device {
154 /* 802.11 structure for data stuff */ 160 /* 802.11 structure for data stuff */
@@ -250,6 +256,28 @@ extern void ieee80211softmac_fragment_lost(struct net_device *dev,
250 * Note that the rates need to be sorted. */ 256 * Note that the rates need to be sorted. */
251extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); 257extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates);
252 258
259/* Helper function which advises you the rate at which a frame should be
260 * transmitted at. */
261static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac,
262 int is_multicast,
263 int is_mgt)
264{
265 struct ieee80211softmac_txrates *txrates = &mac->txrates;
266
267 if (!mac->associated)
268 return txrates->mgt_mcast_rate;
269
270 /* We are associated, sending unicast frame */
271 if (!is_multicast)
272 return txrates->default_rate;
273
274 /* We are associated, sending multicast frame */
275 if (is_mgt)
276 return txrates->mgt_mcast_rate;
277 else
278 return txrates->mcast_rate;
279}
280
253/* Start the SoftMAC. Call this after you initialized the device 281/* Start the SoftMAC. Call this after you initialized the device
254 * and it is ready to run. 282 * and it is ready to run.
255 */ 283 */
@@ -282,7 +310,7 @@ extern void ieee80211softmac_stop(struct net_device *dev);
282 * - context set to the context data you want passed 310 * - context set to the context data you want passed
283 * The return value is 0, or an error. 311 * The return value is 0, or an error.
284 */ 312 */
285typedef void (*notify_function_ptr)(struct net_device *dev, void *context); 313typedef void (*notify_function_ptr)(struct net_device *dev, int event_type, void *context);
286 314
287#define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL); 315#define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL);
288#define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC); 316#define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC);
diff --git a/include/net/ieee80211softmac_wx.h b/include/net/ieee80211softmac_wx.h
index 3e0be453ecea..4ee3ad57283f 100644
--- a/include/net/ieee80211softmac_wx.h
+++ b/include/net/ieee80211softmac_wx.h
@@ -91,4 +91,9 @@ ieee80211softmac_wx_get_genie(struct net_device *dev,
91 struct iw_request_info *info, 91 struct iw_request_info *info,
92 union iwreq_data *wrqu, 92 union iwreq_data *wrqu,
93 char *extra); 93 char *extra);
94extern int
95ieee80211softmac_wx_set_mlme(struct net_device *dev,
96 struct iw_request_info *info,
97 union iwreq_data *wrqu,
98 char *extra);
94#endif /* _IEEE80211SOFTMAC_WX */ 99#endif /* _IEEE80211SOFTMAC_WX */
diff --git a/include/net/ip.h b/include/net/ip.h
index 3d2e5ca62a5a..ead233c9540d 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -147,7 +147,6 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar
147struct ipv4_config 147struct ipv4_config
148{ 148{
149 int log_martians; 149 int log_martians;
150 int autoconfig;
151 int no_pmtu_disc; 150 int no_pmtu_disc;
152}; 151};
153 152
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index 090eaa0d71f9..c608812a8e89 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -16,6 +16,7 @@
16#include <linux/if.h> 16#include <linux/if.h>
17#include <linux/if_arp.h> 17#include <linux/if_arp.h>
18#include <linux/llc.h> 18#include <linux/llc.h>
19#include <linux/etherdevice.h>
19#include <net/llc.h> 20#include <net/llc.h>
20 21
21#define LLC_DATAUNIT_PRIM 1 22#define LLC_DATAUNIT_PRIM 1
@@ -61,8 +62,6 @@
61#define LLC_STATUS_CONFLICT 7 /* disconnect conn */ 62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */
62#define LLC_STATUS_RESET_DONE 8 /* */ 63#define LLC_STATUS_RESET_DONE 8 /* */
63 64
64extern u8 llc_mac_null_var[IFHWADDRLEN];
65
66/** 65/**
67 * llc_mac_null - determines if a address is a null mac address 66 * llc_mac_null - determines if a address is a null mac address
68 * @mac: Mac address to test if null. 67 * @mac: Mac address to test if null.
@@ -70,16 +69,20 @@ extern u8 llc_mac_null_var[IFHWADDRLEN];
70 * Determines if a given address is a null mac address. Returns 0 if the 69 * Determines if a given address is a null mac address. Returns 0 if the
71 * address is not a null mac, 1 if the address is a null mac. 70 * address is not a null mac, 1 if the address is a null mac.
72 */ 71 */
73static __inline__ int llc_mac_null(u8 *mac) 72static inline int llc_mac_null(const u8 *mac)
74{ 73{
75 return !memcmp(mac, llc_mac_null_var, IFHWADDRLEN); 74 return is_zero_ether_addr(mac);
76} 75}
77 76
78static __inline__ int llc_addrany(struct llc_addr *addr) 77static inline int llc_addrany(const struct llc_addr *addr)
79{ 78{
80 return llc_mac_null(addr->mac) && !addr->lsap; 79 return llc_mac_null(addr->mac) && !addr->lsap;
81} 80}
82 81
82static inline int llc_mac_multicast(const u8 *mac)
83{
84 return is_multicast_ether_addr(mac);
85}
83/** 86/**
84 * llc_mac_match - determines if two mac addresses are the same 87 * llc_mac_match - determines if two mac addresses are the same
85 * @mac1: First mac address to compare. 88 * @mac1: First mac address to compare.
@@ -89,9 +92,9 @@ static __inline__ int llc_addrany(struct llc_addr *addr)
89 * is not a complete match up to len, 1 if a complete match up to len is 92 * is not a complete match up to len, 1 if a complete match up to len is
90 * found. 93 * found.
91 */ 94 */
92static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2) 95static inline int llc_mac_match(const u8 *mac1, const u8 *mac2)
93{ 96{
94 return !memcmp(mac1, mac2, IFHWADDRLEN); 97 return !compare_ether_addr(mac1, mac2);
95} 98}
96 99
97extern int llc_establish_connection(struct sock *sk, u8 *lmac, 100extern int llc_establish_connection(struct sock *sk, u8 *lmac,
diff --git a/include/net/netdma.h b/include/net/netdma.h
new file mode 100644
index 000000000000..19760eb131aa
--- /dev/null
+++ b/include/net/netdma.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation; either version 2 of the License, or (at your option)
7 * any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59
16 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * The full GNU General Public License is included in this distribution in the
19 * file called COPYING.
20 */
21#ifndef NETDMA_H
22#define NETDMA_H
23#include <linux/config.h>
24#ifdef CONFIG_NET_DMA
25#include <linux/dmaengine.h>
26#include <linux/skbuff.h>
27
28static inline struct dma_chan *get_softnet_dma(void)
29{
30 struct dma_chan *chan;
31 rcu_read_lock();
32 chan = rcu_dereference(__get_cpu_var(softnet_data.net_dma));
33 if (chan)
34 dma_chan_get(chan);
35 rcu_read_unlock();
36 return chan;
37}
38
39int dma_skb_copy_datagram_iovec(struct dma_chan* chan,
40 const struct sk_buff *skb, int offset, struct iovec *to,
41 size_t len, struct dma_pinned_list *pinned_list);
42
43#endif /* CONFIG_NET_DMA */
44#endif /* NETDMA_H */
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 916013ca4a5c..411117815807 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -114,6 +114,10 @@ struct nf_conn
114 u_int32_t mark; 114 u_int32_t mark;
115#endif 115#endif
116 116
117#ifdef CONFIG_NF_CONNTRACK_SECMARK
118 u_int32_t secmark;
119#endif
120
117 /* Storage reserved for other modules: */ 121 /* Storage reserved for other modules: */
118 union nf_conntrack_proto proto; 122 union nf_conntrack_proto proto;
119 123
@@ -285,6 +289,7 @@ static inline int nf_ct_is_dying(struct nf_conn *ct)
285} 289}
286 290
287extern unsigned int nf_conntrack_htable_size; 291extern unsigned int nf_conntrack_htable_size;
292extern int nf_conntrack_checksum;
288 293
289#define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) 294#define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++)
290 295
diff --git a/include/net/netfilter/nf_conntrack_compat.h b/include/net/netfilter/nf_conntrack_compat.h
index 3cac19fb3648..f1b1482d7200 100644
--- a/include/net/netfilter/nf_conntrack_compat.h
+++ b/include/net/netfilter/nf_conntrack_compat.h
@@ -20,6 +20,19 @@ static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
20} 20}
21#endif /* CONFIG_IP_NF_CONNTRACK_MARK */ 21#endif /* CONFIG_IP_NF_CONNTRACK_MARK */
22 22
23#ifdef CONFIG_IP_NF_CONNTRACK_SECMARK
24static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
25 u_int32_t *ctinfo)
26{
27 struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo);
28
29 if (ct)
30 return &ct->secmark;
31 else
32 return NULL;
33}
34#endif /* CONFIG_IP_NF_CONNTRACK_SECMARK */
35
23#ifdef CONFIG_IP_NF_CT_ACCT 36#ifdef CONFIG_IP_NF_CT_ACCT
24static inline struct ip_conntrack_counter * 37static inline struct ip_conntrack_counter *
25nf_ct_get_counters(const struct sk_buff *skb) 38nf_ct_get_counters(const struct sk_buff *skb)
@@ -70,6 +83,19 @@ static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb,
70} 83}
71#endif /* CONFIG_NF_CONNTRACK_MARK */ 84#endif /* CONFIG_NF_CONNTRACK_MARK */
72 85
86#ifdef CONFIG_NF_CONNTRACK_SECMARK
87static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb,
88 u_int32_t *ctinfo)
89{
90 struct nf_conn *ct = nf_ct_get(skb, ctinfo);
91
92 if (ct)
93 return &ct->secmark;
94 else
95 return NULL;
96}
97#endif /* CONFIG_NF_CONNTRACK_MARK */
98
73#ifdef CONFIG_NF_CT_ACCT 99#ifdef CONFIG_NF_CT_ACCT
74static inline struct ip_conntrack_counter * 100static inline struct ip_conntrack_counter *
75nf_ct_get_counters(const struct sk_buff *skb) 101nf_ct_get_counters(const struct sk_buff *skb)
diff --git a/include/net/raw.h b/include/net/raw.h
index e67b28a0248c..d83571fe4c69 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -36,7 +36,7 @@ extern rwlock_t raw_v4_lock;
36 36
37 37
38extern struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num, 38extern struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num,
39 unsigned long raddr, unsigned long laddr, 39 __be32 raddr, __be32 laddr,
40 int dif); 40 int dif);
41 41
42extern int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash); 42extern int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash);
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index aa6033ca7cd8..b2b40f951ae6 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -255,7 +255,7 @@ extern int sctp_debug_flag;
255#define SCTP_DEBUG_PRINTK_IPADDR(whatever...) 255#define SCTP_DEBUG_PRINTK_IPADDR(whatever...)
256#define SCTP_ENABLE_DEBUG 256#define SCTP_ENABLE_DEBUG
257#define SCTP_DISABLE_DEBUG 257#define SCTP_DISABLE_DEBUG
258#define SCTP_ASSERT(expr, str, func) 258#define SCTP_ASSERT(expr, str, func) BUG_ON(!(expr))
259 259
260#endif /* SCTP_DEBUG */ 260#endif /* SCTP_DEBUG */
261 261
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7f4fea173fb1..5f69158c1006 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -555,7 +555,8 @@ struct sctp_af {
555 int (*to_addr_param) (const union sctp_addr *, 555 int (*to_addr_param) (const union sctp_addr *,
556 union sctp_addr_param *); 556 union sctp_addr_param *);
557 int (*addr_valid) (union sctp_addr *, 557 int (*addr_valid) (union sctp_addr *,
558 struct sctp_sock *); 558 struct sctp_sock *,
559 const struct sk_buff *);
559 sctp_scope_t (*scope) (union sctp_addr *); 560 sctp_scope_t (*scope) (union sctp_addr *);
560 void (*inaddr_any) (union sctp_addr *, unsigned short); 561 void (*inaddr_any) (union sctp_addr *, unsigned short);
561 int (*is_any) (const union sctp_addr *); 562 int (*is_any) (const union sctp_addr *);
diff --git a/include/net/sock.h b/include/net/sock.h
index c9fad6fb629b..96565ff0de6a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -132,6 +132,7 @@ struct sock_common {
132 * @sk_receive_queue: incoming packets 132 * @sk_receive_queue: incoming packets
133 * @sk_wmem_alloc: transmit queue bytes committed 133 * @sk_wmem_alloc: transmit queue bytes committed
134 * @sk_write_queue: Packet sending queue 134 * @sk_write_queue: Packet sending queue
135 * @sk_async_wait_queue: DMA copied packets
135 * @sk_omem_alloc: "o" is "option" or "other" 136 * @sk_omem_alloc: "o" is "option" or "other"
136 * @sk_wmem_queued: persistent queue size 137 * @sk_wmem_queued: persistent queue size
137 * @sk_forward_alloc: space allocated forward 138 * @sk_forward_alloc: space allocated forward
@@ -205,6 +206,7 @@ struct sock {
205 atomic_t sk_omem_alloc; 206 atomic_t sk_omem_alloc;
206 struct sk_buff_head sk_receive_queue; 207 struct sk_buff_head sk_receive_queue;
207 struct sk_buff_head sk_write_queue; 208 struct sk_buff_head sk_write_queue;
209 struct sk_buff_head sk_async_wait_queue;
208 int sk_wmem_queued; 210 int sk_wmem_queued;
209 int sk_forward_alloc; 211 int sk_forward_alloc;
210 gfp_t sk_allocation; 212 gfp_t sk_allocation;
@@ -871,10 +873,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock)
871 if (filter) { 873 if (filter) {
872 unsigned int pkt_len = sk_run_filter(skb, filter->insns, 874 unsigned int pkt_len = sk_run_filter(skb, filter->insns,
873 filter->len); 875 filter->len);
874 if (!pkt_len) 876 err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM;
875 err = -EPERM;
876 else
877 skb_trim(skb, pkt_len);
878 } 877 }
879 878
880 if (needlock) 879 if (needlock)
@@ -1271,11 +1270,22 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
1271 * This routine must be called with interrupts disabled or with the socket 1270 * This routine must be called with interrupts disabled or with the socket
1272 * locked so that the sk_buff queue operation is ok. 1271 * locked so that the sk_buff queue operation is ok.
1273*/ 1272*/
1274static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) 1273#ifdef CONFIG_NET_DMA
1274static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early)
1275{
1276 __skb_unlink(skb, &sk->sk_receive_queue);
1277 if (!copied_early)
1278 __kfree_skb(skb);
1279 else
1280 __skb_queue_tail(&sk->sk_async_wait_queue, skb);
1281}
1282#else
1283static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early)
1275{ 1284{
1276 __skb_unlink(skb, &sk->sk_receive_queue); 1285 __skb_unlink(skb, &sk->sk_receive_queue);
1277 __kfree_skb(skb); 1286 __kfree_skb(skb);
1278} 1287}
1288#endif
1279 1289
1280extern void sock_enable_timestamp(struct sock *sk); 1290extern void sock_enable_timestamp(struct sock *sk);
1281extern int sock_get_timestamp(struct sock *, struct timeval __user *); 1291extern int sock_get_timestamp(struct sock *, struct timeval __user *);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3c989db8a7aa..bfc71f954bbe 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -28,6 +28,7 @@
28#include <linux/cache.h> 28#include <linux/cache.h>
29#include <linux/percpu.h> 29#include <linux/percpu.h>
30#include <linux/skbuff.h> 30#include <linux/skbuff.h>
31#include <linux/dmaengine.h>
31 32
32#include <net/inet_connection_sock.h> 33#include <net/inet_connection_sock.h>
33#include <net/inet_timewait_sock.h> 34#include <net/inet_timewait_sock.h>
@@ -218,6 +219,7 @@ extern int sysctl_tcp_adv_win_scale;
218extern int sysctl_tcp_tw_reuse; 219extern int sysctl_tcp_tw_reuse;
219extern int sysctl_tcp_frto; 220extern int sysctl_tcp_frto;
220extern int sysctl_tcp_low_latency; 221extern int sysctl_tcp_low_latency;
222extern int sysctl_tcp_dma_copybreak;
221extern int sysctl_tcp_nometrics_save; 223extern int sysctl_tcp_nometrics_save;
222extern int sysctl_tcp_moderate_rcvbuf; 224extern int sysctl_tcp_moderate_rcvbuf;
223extern int sysctl_tcp_tso_win_divisor; 225extern int sysctl_tcp_tso_win_divisor;
@@ -225,6 +227,7 @@ extern int sysctl_tcp_abc;
225extern int sysctl_tcp_mtu_probing; 227extern int sysctl_tcp_mtu_probing;
226extern int sysctl_tcp_base_mss; 228extern int sysctl_tcp_base_mss;
227extern int sysctl_tcp_workaround_signed_windows; 229extern int sysctl_tcp_workaround_signed_windows;
230extern int sysctl_tcp_slow_start_after_idle;
228 231
229extern atomic_t tcp_memory_allocated; 232extern atomic_t tcp_memory_allocated;
230extern atomic_t tcp_sockets_allocated; 233extern atomic_t tcp_sockets_allocated;
@@ -293,6 +296,8 @@ extern int tcp_rcv_established(struct sock *sk,
293 296
294extern void tcp_rcv_space_adjust(struct sock *sk); 297extern void tcp_rcv_space_adjust(struct sock *sk);
295 298
299extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
300
296extern int tcp_twsk_unique(struct sock *sk, 301extern int tcp_twsk_unique(struct sock *sk,
297 struct sock *sktw, void *twp); 302 struct sock *sktw, void *twp);
298 303
@@ -628,7 +633,7 @@ struct tcp_congestion_ops {
628 /* return slow start threshold (required) */ 633 /* return slow start threshold (required) */
629 u32 (*ssthresh)(struct sock *sk); 634 u32 (*ssthresh)(struct sock *sk);
630 /* lower bound for congestion window (optional) */ 635 /* lower bound for congestion window (optional) */
631 u32 (*min_cwnd)(struct sock *sk); 636 u32 (*min_cwnd)(const struct sock *sk);
632 /* do new cwnd calculation (required) */ 637 /* do new cwnd calculation (required) */
633 void (*cong_avoid)(struct sock *sk, u32 ack, 638 void (*cong_avoid)(struct sock *sk, u32 ack,
634 u32 rtt, u32 in_flight, int good_ack); 639 u32 rtt, u32 in_flight, int good_ack);
@@ -663,7 +668,7 @@ extern struct tcp_congestion_ops tcp_init_congestion_ops;
663extern u32 tcp_reno_ssthresh(struct sock *sk); 668extern u32 tcp_reno_ssthresh(struct sock *sk);
664extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, 669extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack,
665 u32 rtt, u32 in_flight, int flag); 670 u32 rtt, u32 in_flight, int flag);
666extern u32 tcp_reno_min_cwnd(struct sock *sk); 671extern u32 tcp_reno_min_cwnd(const struct sock *sk);
667extern struct tcp_congestion_ops tcp_reno; 672extern struct tcp_congestion_ops tcp_reno;
668 673
669static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) 674static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state)
@@ -817,6 +822,12 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp)
817 tp->ucopy.len = 0; 822 tp->ucopy.len = 0;
818 tp->ucopy.memory = 0; 823 tp->ucopy.memory = 0;
819 skb_queue_head_init(&tp->ucopy.prequeue); 824 skb_queue_head_init(&tp->ucopy.prequeue);
825#ifdef CONFIG_NET_DMA
826 tp->ucopy.dma_chan = NULL;
827 tp->ucopy.wakeup = 0;
828 tp->ucopy.pinned_list = NULL;
829 tp->ucopy.dma_cookie = 0;
830#endif
820} 831}
821 832
822/* Packet is added to VJ-style prequeue for processing in process 833/* Packet is added to VJ-style prequeue for processing in process
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index afa508d92c93..9c5ee9f20b65 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -20,6 +20,8 @@
20#include <net/ip6_fib.h> 20#include <net/ip6_fib.h>
21 21
22#define XFRM_ALIGN8(len) (((len) + 7) & ~7) 22#define XFRM_ALIGN8(len) (((len) + 7) & ~7)
23#define MODULE_ALIAS_XFRM_MODE(family, encap) \
24 MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap))
23 25
24extern struct sock *xfrm_nl; 26extern struct sock *xfrm_nl;
25extern u32 sysctl_xfrm_aevent_etime; 27extern u32 sysctl_xfrm_aevent_etime;
@@ -164,6 +166,7 @@ struct xfrm_state
164 /* Reference to data common to all the instances of this 166 /* Reference to data common to all the instances of this
165 * transformer. */ 167 * transformer. */
166 struct xfrm_type *type; 168 struct xfrm_type *type;
169 struct xfrm_mode *mode;
167 170
168 /* Security context */ 171 /* Security context */
169 struct xfrm_sec_ctx *security; 172 struct xfrm_sec_ctx *security;
@@ -204,8 +207,8 @@ struct xfrm_type;
204struct xfrm_dst; 207struct xfrm_dst;
205struct xfrm_policy_afinfo { 208struct xfrm_policy_afinfo {
206 unsigned short family; 209 unsigned short family;
207 rwlock_t lock; 210 struct xfrm_type *type_map[IPPROTO_MAX];
208 struct xfrm_type_map *type_map; 211 struct xfrm_mode *mode_map[XFRM_MODE_MAX];
209 struct dst_ops *dst_ops; 212 struct dst_ops *dst_ops;
210 void (*garbage_collect)(void); 213 void (*garbage_collect)(void);
211 int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); 214 int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl);
@@ -232,7 +235,6 @@ extern int __xfrm_state_delete(struct xfrm_state *x);
232 235
233struct xfrm_state_afinfo { 236struct xfrm_state_afinfo {
234 unsigned short family; 237 unsigned short family;
235 rwlock_t lock;
236 struct list_head *state_bydst; 238 struct list_head *state_bydst;
237 struct list_head *state_byspi; 239 struct list_head *state_byspi;
238 int (*init_flags)(struct xfrm_state *x); 240 int (*init_flags)(struct xfrm_state *x);
@@ -264,16 +266,24 @@ struct xfrm_type
264 u32 (*get_max_size)(struct xfrm_state *, int size); 266 u32 (*get_max_size)(struct xfrm_state *, int size);
265}; 267};
266 268
267struct xfrm_type_map {
268 rwlock_t lock;
269 struct xfrm_type *map[256];
270};
271
272extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); 269extern int xfrm_register_type(struct xfrm_type *type, unsigned short family);
273extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); 270extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family);
274extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family); 271extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family);
275extern void xfrm_put_type(struct xfrm_type *type); 272extern void xfrm_put_type(struct xfrm_type *type);
276 273
274struct xfrm_mode {
275 int (*input)(struct xfrm_state *x, struct sk_buff *skb);
276 int (*output)(struct sk_buff *skb);
277
278 struct module *owner;
279 unsigned int encap;
280};
281
282extern int xfrm_register_mode(struct xfrm_mode *mode, int family);
283extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family);
284extern struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family);
285extern void xfrm_put_mode(struct xfrm_mode *mode);
286
277struct xfrm_tmpl 287struct xfrm_tmpl
278{ 288{
279/* id in template is interpreted as: 289/* id in template is interpreted as:
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
new file mode 100644
index 000000000000..fcb5ba87dcc5
--- /dev/null
+++ b/include/rdma/ib_addr.h
@@ -0,0 +1,114 @@
1/*
2 * Copyright (c) 2005 Voltaire Inc. All rights reserved.
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 *
5 * This Software is licensed under one of the following licenses:
6 *
7 * 1) under the terms of the "Common Public License 1.0" a copy of which is
8 * available from the Open Source Initiative, see
9 * http://www.opensource.org/licenses/cpl.php.
10 *
11 * 2) under the terms of the "The BSD License" a copy of which is
12 * available from the Open Source Initiative, see
13 * http://www.opensource.org/licenses/bsd-license.php.
14 *
15 * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
16 * copy of which is available from the Open Source Initiative, see
17 * http://www.opensource.org/licenses/gpl-license.php.
18 *
19 * Licensee has the right to choose one of the above licenses.
20 *
21 * Redistributions of source code must retain the above copyright
22 * notice and one of the license notices.
23 *
24 * Redistributions in binary form must reproduce both the above copyright
25 * notice, one of the license notices in the documentation
26 * and/or other materials provided with the distribution.
27 *
28 */
29
30#if !defined(IB_ADDR_H)
31#define IB_ADDR_H
32
33#include <linux/in.h>
34#include <linux/in6.h>
35#include <linux/netdevice.h>
36#include <linux/socket.h>
37#include <rdma/ib_verbs.h>
38
39struct rdma_dev_addr {
40 unsigned char src_dev_addr[MAX_ADDR_LEN];
41 unsigned char dst_dev_addr[MAX_ADDR_LEN];
42 unsigned char broadcast[MAX_ADDR_LEN];
43 enum ib_node_type dev_type;
44};
45
46/**
47 * rdma_translate_ip - Translate a local IP address to an RDMA hardware
48 * address.
49 */
50int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr);
51
52/**
53 * rdma_resolve_ip - Resolve source and destination IP addresses to
54 * RDMA hardware addresses.
55 * @src_addr: An optional source address to use in the resolution. If a
56 * source address is not provided, a usable address will be returned via
57 * the callback.
58 * @dst_addr: The destination address to resolve.
59 * @addr: A reference to a data location that will receive the resolved
60 * addresses. The data location must remain valid until the callback has
61 * been invoked.
62 * @timeout_ms: Amount of time to wait for the address resolution to complete.
63 * @callback: Call invoked once address resolution has completed, timed out,
64 * or been canceled. A status of 0 indicates success.
65 * @context: User-specified context associated with the call.
66 */
67int rdma_resolve_ip(struct sockaddr *src_addr, struct sockaddr *dst_addr,
68 struct rdma_dev_addr *addr, int timeout_ms,
69 void (*callback)(int status, struct sockaddr *src_addr,
70 struct rdma_dev_addr *addr, void *context),
71 void *context);
72
73void rdma_addr_cancel(struct rdma_dev_addr *addr);
74
75static inline int ip_addr_size(struct sockaddr *addr)
76{
77 return addr->sa_family == AF_INET6 ?
78 sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in);
79}
80
81static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr)
82{
83 return ((u16)dev_addr->broadcast[8] << 8) | (u16)dev_addr->broadcast[9];
84}
85
86static inline void ib_addr_set_pkey(struct rdma_dev_addr *dev_addr, u16 pkey)
87{
88 dev_addr->broadcast[8] = pkey >> 8;
89 dev_addr->broadcast[9] = (unsigned char) pkey;
90}
91
92static inline union ib_gid *ib_addr_get_sgid(struct rdma_dev_addr *dev_addr)
93{
94 return (union ib_gid *) (dev_addr->src_dev_addr + 4);
95}
96
97static inline void ib_addr_set_sgid(struct rdma_dev_addr *dev_addr,
98 union ib_gid *gid)
99{
100 memcpy(dev_addr->src_dev_addr + 4, gid, sizeof *gid);
101}
102
103static inline union ib_gid *ib_addr_get_dgid(struct rdma_dev_addr *dev_addr)
104{
105 return (union ib_gid *) (dev_addr->dst_dev_addr + 4);
106}
107
108static inline void ib_addr_set_dgid(struct rdma_dev_addr *dev_addr,
109 union ib_gid *gid)
110{
111 memcpy(dev_addr->dst_dev_addr + 4, gid, sizeof *gid);
112}
113
114#endif /* IB_ADDR_H */
diff --git a/include/rdma/ib_cache.h b/include/rdma/ib_cache.h
index 5bf9834f7dca..f179d233ffc3 100644
--- a/include/rdma/ib_cache.h
+++ b/include/rdma/ib_cache.h
@@ -102,4 +102,17 @@ int ib_find_cached_pkey(struct ib_device *device,
102 u16 pkey, 102 u16 pkey,
103 u16 *index); 103 u16 *index);
104 104
105/**
106 * ib_get_cached_lmc - Returns a cached lmc table entry
107 * @device: The device to query.
108 * @port_num: The port number of the device to query.
109 * @lmc: The lmc value for the specified port for that device.
110 *
111 * ib_get_cached_lmc() fetches the specified lmc table entry stored in
112 * the local software cache.
113 */
114int ib_get_cached_lmc(struct ib_device *device,
115 u8 port_num,
116 u8 *lmc);
117
105#endif /* _IB_CACHE_H */ 118#endif /* _IB_CACHE_H */
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index 0a9fcd59eb43..c9b4738be9d6 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -32,7 +32,7 @@
32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 * SOFTWARE. 33 * SOFTWARE.
34 * 34 *
35 * $Id: ib_cm.h 2730 2005-06-28 16:43:03Z sean.hefty $ 35 * $Id: ib_cm.h 4311 2005-12-05 18:42:01Z sean.hefty $
36 */ 36 */
37#if !defined(IB_CM_H) 37#if !defined(IB_CM_H)
38#define IB_CM_H 38#define IB_CM_H
@@ -102,7 +102,8 @@ enum ib_cm_data_size {
102 IB_CM_APR_INFO_LENGTH = 72, 102 IB_CM_APR_INFO_LENGTH = 72,
103 IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE = 216, 103 IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE = 216,
104 IB_CM_SIDR_REP_PRIVATE_DATA_SIZE = 136, 104 IB_CM_SIDR_REP_PRIVATE_DATA_SIZE = 136,
105 IB_CM_SIDR_REP_INFO_LENGTH = 72 105 IB_CM_SIDR_REP_INFO_LENGTH = 72,
106 IB_CM_COMPARE_SIZE = 64
106}; 107};
107 108
108struct ib_cm_id; 109struct ib_cm_id;
@@ -238,7 +239,6 @@ struct ib_cm_sidr_rep_event_param {
238 u32 qpn; 239 u32 qpn;
239 void *info; 240 void *info;
240 u8 info_len; 241 u8 info_len;
241
242}; 242};
243 243
244struct ib_cm_event { 244struct ib_cm_event {
@@ -317,6 +317,15 @@ void ib_destroy_cm_id(struct ib_cm_id *cm_id);
317 317
318#define IB_SERVICE_ID_AGN_MASK __constant_cpu_to_be64(0xFF00000000000000ULL) 318#define IB_SERVICE_ID_AGN_MASK __constant_cpu_to_be64(0xFF00000000000000ULL)
319#define IB_CM_ASSIGN_SERVICE_ID __constant_cpu_to_be64(0x0200000000000000ULL) 319#define IB_CM_ASSIGN_SERVICE_ID __constant_cpu_to_be64(0x0200000000000000ULL)
320#define IB_CMA_SERVICE_ID __constant_cpu_to_be64(0x0000000001000000ULL)
321#define IB_CMA_SERVICE_ID_MASK __constant_cpu_to_be64(0xFFFFFFFFFF000000ULL)
322#define IB_SDP_SERVICE_ID __constant_cpu_to_be64(0x0000000000010000ULL)
323#define IB_SDP_SERVICE_ID_MASK __constant_cpu_to_be64(0xFFFFFFFFFFFF0000ULL)
324
325struct ib_cm_compare_data {
326 u8 data[IB_CM_COMPARE_SIZE];
327 u8 mask[IB_CM_COMPARE_SIZE];
328};
320 329
321/** 330/**
322 * ib_cm_listen - Initiates listening on the specified service ID for 331 * ib_cm_listen - Initiates listening on the specified service ID for
@@ -330,10 +339,12 @@ void ib_destroy_cm_id(struct ib_cm_id *cm_id);
330 * range of service IDs. If set to 0, the service ID is matched 339 * range of service IDs. If set to 0, the service ID is matched
331 * exactly. This parameter is ignored if %service_id is set to 340 * exactly. This parameter is ignored if %service_id is set to
332 * IB_CM_ASSIGN_SERVICE_ID. 341 * IB_CM_ASSIGN_SERVICE_ID.
342 * @compare_data: This parameter is optional. It specifies data that must
343 * appear in the private data of a connection request for the specified
344 * listen request.
333 */ 345 */
334int ib_cm_listen(struct ib_cm_id *cm_id, 346int ib_cm_listen(struct ib_cm_id *cm_id, __be64 service_id, __be64 service_mask,
335 __be64 service_id, 347 struct ib_cm_compare_data *compare_data);
336 __be64 service_mask);
337 348
338struct ib_cm_req_param { 349struct ib_cm_req_param {
339 struct ib_sa_path_rec *primary_path; 350 struct ib_sa_path_rec *primary_path;
@@ -535,7 +546,6 @@ struct ib_cm_sidr_req_param {
535 const void *private_data; 546 const void *private_data;
536 u8 private_data_len; 547 u8 private_data_len;
537 u8 max_cm_retries; 548 u8 max_cm_retries;
538 u16 pkey;
539}; 549};
540 550
541/** 551/**
@@ -559,7 +569,7 @@ struct ib_cm_sidr_rep_param {
559}; 569};
560 570
561/** 571/**
562 * ib_send_cm_sidr_rep - Sends a service ID resolution request to the 572 * ib_send_cm_sidr_rep - Sends a service ID resolution reply to the
563 * remote node. 573 * remote node.
564 * @cm_id: Communication identifier associated with the received service ID 574 * @cm_id: Communication identifier associated with the received service ID
565 * resolution request. 575 * resolution request.
diff --git a/include/rdma/ib_marshall.h b/include/rdma/ib_marshall.h
new file mode 100644
index 000000000000..66bf4d7d0dfb
--- /dev/null
+++ b/include/rdma/ib_marshall.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (c) 2005 Intel Corporation. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#if !defined(IB_USER_MARSHALL_H)
34#define IB_USER_MARSHALL_H
35
36#include <rdma/ib_verbs.h>
37#include <rdma/ib_sa.h>
38#include <rdma/ib_user_verbs.h>
39#include <rdma/ib_user_sa.h>
40
41void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst,
42 struct ib_qp_attr *src);
43
44void ib_copy_path_rec_to_user(struct ib_user_path_rec *dst,
45 struct ib_sa_path_rec *src);
46
47void ib_copy_path_rec_from_user(struct ib_sa_path_rec *dst,
48 struct ib_user_path_rec *src);
49
50#endif /* IB_USER_MARSHALL_H */
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h
index ad63c215efe5..c99e4420fd7e 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -370,5 +370,12 @@ ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num,
370 context, query); 370 context, query);
371} 371}
372 372
373/**
374 * ib_init_ah_from_path - Initialize address handle attributes based on an SA
375 * path record.
376 */
377int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
378 struct ib_sa_path_rec *rec,
379 struct ib_ah_attr *ah_attr);
373 380
374#endif /* IB_SA_H */ 381#endif /* IB_SA_H */
diff --git a/include/rdma/ib_smi.h b/include/rdma/ib_smi.h
index 87f60737f695..f29af135ba83 100644
--- a/include/rdma/ib_smi.h
+++ b/include/rdma/ib_smi.h
@@ -85,6 +85,42 @@ struct ib_smp {
85#define IB_SMP_ATTR_LED_INFO __constant_htons(0x0031) 85#define IB_SMP_ATTR_LED_INFO __constant_htons(0x0031)
86#define IB_SMP_ATTR_VENDOR_MASK __constant_htons(0xFF00) 86#define IB_SMP_ATTR_VENDOR_MASK __constant_htons(0xFF00)
87 87
88struct ib_port_info {
89 __be64 mkey;
90 __be64 gid_prefix;
91 __be16 lid;
92 __be16 sm_lid;
93 __be32 cap_mask;
94 __be16 diag_code;
95 __be16 mkey_lease_period;
96 u8 local_port_num;
97 u8 link_width_enabled;
98 u8 link_width_supported;
99 u8 link_width_active;
100 u8 linkspeed_portstate; /* 4 bits, 4 bits */
101 u8 portphysstate_linkdown; /* 4 bits, 4 bits */
102 u8 mkeyprot_resv_lmc; /* 2 bits, 3, 3 */
103 u8 linkspeedactive_enabled; /* 4 bits, 4 bits */
104 u8 neighbormtu_mastersmsl; /* 4 bits, 4 bits */
105 u8 vlcap_inittype; /* 4 bits, 4 bits */
106 u8 vl_high_limit;
107 u8 vl_arb_high_cap;
108 u8 vl_arb_low_cap;
109 u8 inittypereply_mtucap; /* 4 bits, 4 bits */
110 u8 vlstallcnt_hoqlife; /* 3 bits, 5 bits */
111 u8 operationalvl_pei_peo_fpi_fpo; /* 4 bits, 1, 1, 1, 1 */
112 __be16 mkey_violations;
113 __be16 pkey_violations;
114 __be16 qkey_violations;
115 u8 guid_cap;
116 u8 clientrereg_resv_subnetto; /* 1 bit, 2 bits, 5 */
117 u8 resv_resptimevalue; /* 3 bits, 5 bits */
118 u8 localphyerrors_overrunerrors; /* 4 bits, 4 bits */
119 __be16 max_credit_hint;
120 u8 resv;
121 u8 link_roundtrip_latency[3];
122};
123
88static inline u8 124static inline u8
89ib_get_smp_direction(struct ib_smp *smp) 125ib_get_smp_direction(struct ib_smp *smp)
90{ 126{
diff --git a/include/rdma/ib_user_cm.h b/include/rdma/ib_user_cm.h
index 19be116047f6..066c20b7cdfb 100644
--- a/include/rdma/ib_user_cm.h
+++ b/include/rdma/ib_user_cm.h
@@ -30,13 +30,13 @@
30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 30 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 * SOFTWARE. 31 * SOFTWARE.
32 * 32 *
33 * $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $ 33 * $Id: ib_user_cm.h 4019 2005-11-11 00:33:09Z sean.hefty $
34 */ 34 */
35 35
36#ifndef IB_USER_CM_H 36#ifndef IB_USER_CM_H
37#define IB_USER_CM_H 37#define IB_USER_CM_H
38 38
39#include <linux/types.h> 39#include <rdma/ib_user_sa.h>
40 40
41#define IB_USER_CM_ABI_VERSION 4 41#define IB_USER_CM_ABI_VERSION 4
42 42
@@ -110,58 +110,6 @@ struct ib_ucm_init_qp_attr {
110 __u32 qp_state; 110 __u32 qp_state;
111}; 111};
112 112
113struct ib_ucm_ah_attr {
114 __u8 grh_dgid[16];
115 __u32 grh_flow_label;
116 __u16 dlid;
117 __u16 reserved;
118 __u8 grh_sgid_index;
119 __u8 grh_hop_limit;
120 __u8 grh_traffic_class;
121 __u8 sl;
122 __u8 src_path_bits;
123 __u8 static_rate;
124 __u8 is_global;
125 __u8 port_num;
126};
127
128struct ib_ucm_init_qp_attr_resp {
129 __u32 qp_attr_mask;
130 __u32 qp_state;
131 __u32 cur_qp_state;
132 __u32 path_mtu;
133 __u32 path_mig_state;
134 __u32 qkey;
135 __u32 rq_psn;
136 __u32 sq_psn;
137 __u32 dest_qp_num;
138 __u32 qp_access_flags;
139
140 struct ib_ucm_ah_attr ah_attr;
141 struct ib_ucm_ah_attr alt_ah_attr;
142
143 /* ib_qp_cap */
144 __u32 max_send_wr;
145 __u32 max_recv_wr;
146 __u32 max_send_sge;
147 __u32 max_recv_sge;
148 __u32 max_inline_data;
149
150 __u16 pkey_index;
151 __u16 alt_pkey_index;
152 __u8 en_sqd_async_notify;
153 __u8 sq_draining;
154 __u8 max_rd_atomic;
155 __u8 max_dest_rd_atomic;
156 __u8 min_rnr_timer;
157 __u8 port_num;
158 __u8 timeout;
159 __u8 retry_cnt;
160 __u8 rnr_retry;
161 __u8 alt_port_num;
162 __u8 alt_timeout;
163};
164
165struct ib_ucm_listen { 113struct ib_ucm_listen {
166 __be64 service_id; 114 __be64 service_id;
167 __be64 service_mask; 115 __be64 service_mask;
@@ -180,28 +128,6 @@ struct ib_ucm_private_data {
180 __u8 reserved[3]; 128 __u8 reserved[3];
181}; 129};
182 130
183struct ib_ucm_path_rec {
184 __u8 dgid[16];
185 __u8 sgid[16];
186 __be16 dlid;
187 __be16 slid;
188 __u32 raw_traffic;
189 __be32 flow_label;
190 __u32 reversible;
191 __u32 mtu;
192 __be16 pkey;
193 __u8 hop_limit;
194 __u8 traffic_class;
195 __u8 numb_path;
196 __u8 sl;
197 __u8 mtu_selector;
198 __u8 rate_selector;
199 __u8 rate;
200 __u8 packet_life_time_selector;
201 __u8 packet_life_time;
202 __u8 preference;
203};
204
205struct ib_ucm_req { 131struct ib_ucm_req {
206 __u32 id; 132 __u32 id;
207 __u32 qpn; 133 __u32 qpn;
@@ -274,7 +200,7 @@ struct ib_ucm_sidr_req {
274 __be64 sid; 200 __be64 sid;
275 __u64 data; 201 __u64 data;
276 __u64 path; 202 __u64 path;
277 __u16 pkey; 203 __u16 reserved_pkey;
278 __u8 len; 204 __u8 len;
279 __u8 max_cm_retries; 205 __u8 max_cm_retries;
280 __u8 reserved[4]; 206 __u8 reserved[4];
@@ -304,8 +230,8 @@ struct ib_ucm_event_get {
304}; 230};
305 231
306struct ib_ucm_req_event_resp { 232struct ib_ucm_req_event_resp {
307 struct ib_ucm_path_rec primary_path; 233 struct ib_user_path_rec primary_path;
308 struct ib_ucm_path_rec alternate_path; 234 struct ib_user_path_rec alternate_path;
309 __be64 remote_ca_guid; 235 __be64 remote_ca_guid;
310 __u32 remote_qkey; 236 __u32 remote_qkey;
311 __u32 remote_qpn; 237 __u32 remote_qpn;
@@ -349,7 +275,7 @@ struct ib_ucm_mra_event_resp {
349}; 275};
350 276
351struct ib_ucm_lap_event_resp { 277struct ib_ucm_lap_event_resp {
352 struct ib_ucm_path_rec path; 278 struct ib_user_path_rec path;
353}; 279};
354 280
355struct ib_ucm_apr_event_resp { 281struct ib_ucm_apr_event_resp {
diff --git a/include/rdma/ib_user_sa.h b/include/rdma/ib_user_sa.h
new file mode 100644
index 000000000000..659120157e14
--- /dev/null
+++ b/include/rdma/ib_user_sa.h
@@ -0,0 +1,60 @@
1/*
2 * Copyright (c) 2005 Intel Corporation. All rights reserved.
3 *
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
9 *
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
13 *
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
17 *
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
31 */
32
33#ifndef IB_USER_SA_H
34#define IB_USER_SA_H
35
36#include <linux/types.h>
37
38struct ib_user_path_rec {
39 __u8 dgid[16];
40 __u8 sgid[16];
41 __be16 dlid;
42 __be16 slid;
43 __u32 raw_traffic;
44 __be32 flow_label;
45 __u32 reversible;
46 __u32 mtu;
47 __be16 pkey;
48 __u8 hop_limit;
49 __u8 traffic_class;
50 __u8 numb_path;
51 __u8 sl;
52 __u8 mtu_selector;
53 __u8 rate_selector;
54 __u8 rate;
55 __u8 packet_life_time_selector;
56 __u8 packet_life_time;
57 __u8 preference;
58};
59
60#endif /* IB_USER_SA_H */
diff --git a/include/rdma/ib_user_verbs.h b/include/rdma/ib_user_verbs.h
index 338ed4333063..7b5372010f4b 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/rdma/ib_user_verbs.h
@@ -32,7 +32,7 @@
32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 32 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33 * SOFTWARE. 33 * SOFTWARE.
34 * 34 *
35 * $Id: ib_user_verbs.h 2708 2005-06-24 17:27:21Z roland $ 35 * $Id: ib_user_verbs.h 4019 2005-11-11 00:33:09Z sean.hefty $
36 */ 36 */
37 37
38#ifndef IB_USER_VERBS_H 38#ifndef IB_USER_VERBS_H
@@ -323,6 +323,64 @@ struct ib_uverbs_destroy_cq_resp {
323 __u32 async_events_reported; 323 __u32 async_events_reported;
324}; 324};
325 325
326struct ib_uverbs_global_route {
327 __u8 dgid[16];
328 __u32 flow_label;
329 __u8 sgid_index;
330 __u8 hop_limit;
331 __u8 traffic_class;
332 __u8 reserved;
333};
334
335struct ib_uverbs_ah_attr {
336 struct ib_uverbs_global_route grh;
337 __u16 dlid;
338 __u8 sl;
339 __u8 src_path_bits;
340 __u8 static_rate;
341 __u8 is_global;
342 __u8 port_num;
343 __u8 reserved;
344};
345
346struct ib_uverbs_qp_attr {
347 __u32 qp_attr_mask;
348 __u32 qp_state;
349 __u32 cur_qp_state;
350 __u32 path_mtu;
351 __u32 path_mig_state;
352 __u32 qkey;
353 __u32 rq_psn;
354 __u32 sq_psn;
355 __u32 dest_qp_num;
356 __u32 qp_access_flags;
357
358 struct ib_uverbs_ah_attr ah_attr;
359 struct ib_uverbs_ah_attr alt_ah_attr;
360
361 /* ib_qp_cap */
362 __u32 max_send_wr;
363 __u32 max_recv_wr;
364 __u32 max_send_sge;
365 __u32 max_recv_sge;
366 __u32 max_inline_data;
367
368 __u16 pkey_index;
369 __u16 alt_pkey_index;
370 __u8 en_sqd_async_notify;
371 __u8 sq_draining;
372 __u8 max_rd_atomic;
373 __u8 max_dest_rd_atomic;
374 __u8 min_rnr_timer;
375 __u8 port_num;
376 __u8 timeout;
377 __u8 retry_cnt;
378 __u8 rnr_retry;
379 __u8 alt_port_num;
380 __u8 alt_timeout;
381 __u8 reserved[5];
382};
383
326struct ib_uverbs_create_qp { 384struct ib_uverbs_create_qp {
327 __u64 response; 385 __u64 response;
328 __u64 user_handle; 386 __u64 user_handle;
@@ -541,26 +599,6 @@ struct ib_uverbs_post_srq_recv_resp {
541 __u32 bad_wr; 599 __u32 bad_wr;
542}; 600};
543 601
544struct ib_uverbs_global_route {
545 __u8 dgid[16];
546 __u32 flow_label;
547 __u8 sgid_index;
548 __u8 hop_limit;
549 __u8 traffic_class;
550 __u8 reserved;
551};
552
553struct ib_uverbs_ah_attr {
554 struct ib_uverbs_global_route grh;
555 __u16 dlid;
556 __u8 sl;
557 __u8 src_path_bits;
558 __u8 static_rate;
559 __u8 is_global;
560 __u8 port_num;
561 __u8 reserved;
562};
563
564struct ib_uverbs_create_ah { 602struct ib_uverbs_create_ah {
565 __u64 response; 603 __u64 response;
566 __u64 user_handle; 604 __u64 user_handle;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 6bbf1b364400..ee1f3a355666 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -260,7 +260,8 @@ enum ib_event_type {
260 IB_EVENT_SM_CHANGE, 260 IB_EVENT_SM_CHANGE,
261 IB_EVENT_SRQ_ERR, 261 IB_EVENT_SRQ_ERR,
262 IB_EVENT_SRQ_LIMIT_REACHED, 262 IB_EVENT_SRQ_LIMIT_REACHED,
263 IB_EVENT_QP_LAST_WQE_REACHED 263 IB_EVENT_QP_LAST_WQE_REACHED,
264 IB_EVENT_CLIENT_REREGISTER
264}; 265};
265 266
266struct ib_event { 267struct ib_event {
@@ -696,8 +697,12 @@ struct ib_ucontext {
696struct ib_uobject { 697struct ib_uobject {
697 u64 user_handle; /* handle given to us by userspace */ 698 u64 user_handle; /* handle given to us by userspace */
698 struct ib_ucontext *context; /* associated user context */ 699 struct ib_ucontext *context; /* associated user context */
700 void *object; /* containing object */
699 struct list_head list; /* link to context's list */ 701 struct list_head list; /* link to context's list */
700 u32 id; /* index into kernel idr */ 702 u32 id; /* index into kernel idr */
703 struct kref ref;
704 struct rw_semaphore mutex; /* protects .live */
705 int live;
701}; 706};
702 707
703struct ib_umem { 708struct ib_umem {
@@ -827,6 +832,7 @@ struct ib_cache {
827 struct ib_event_handler event_handler; 832 struct ib_event_handler event_handler;
828 struct ib_pkey_cache **pkey_cache; 833 struct ib_pkey_cache **pkey_cache;
829 struct ib_gid_cache **gid_cache; 834 struct ib_gid_cache **gid_cache;
835 u8 *lmc_cache;
830}; 836};
831 837
832struct ib_device { 838struct ib_device {
@@ -1086,6 +1092,20 @@ int ib_dealloc_pd(struct ib_pd *pd);
1086struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); 1092struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr);
1087 1093
1088/** 1094/**
1095 * ib_init_ah_from_wc - Initializes address handle attributes from a
1096 * work completion.
1097 * @device: Device on which the received message arrived.
1098 * @port_num: Port on which the received message arrived.
1099 * @wc: Work completion associated with the received message.
1100 * @grh: References the received global route header. This parameter is
1101 * ignored unless the work completion indicates that the GRH is valid.
1102 * @ah_attr: Returned attributes that can be used when creating an address
1103 * handle for replying to the message.
1104 */
1105int ib_init_ah_from_wc(struct ib_device *device, u8 port_num, struct ib_wc *wc,
1106 struct ib_grh *grh, struct ib_ah_attr *ah_attr);
1107
1108/**
1089 * ib_create_ah_from_wc - Creates an address handle associated with the 1109 * ib_create_ah_from_wc - Creates an address handle associated with the
1090 * sender of the specified work completion. 1110 * sender of the specified work completion.
1091 * @pd: The protection domain associated with the address handle. 1111 * @pd: The protection domain associated with the address handle.
diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h
new file mode 100644
index 000000000000..402c63d7226b
--- /dev/null
+++ b/include/rdma/rdma_cm.h
@@ -0,0 +1,256 @@
1/*
2 * Copyright (c) 2005 Voltaire Inc. All rights reserved.
3 * Copyright (c) 2005 Intel Corporation. All rights reserved.
4 *
5 * This Software is licensed under one of the following licenses:
6 *
7 * 1) under the terms of the "Common Public License 1.0" a copy of which is
8 * available from the Open Source Initiative, see
9 * http://www.opensource.org/licenses/cpl.php.
10 *
11 * 2) under the terms of the "The BSD License" a copy of which is
12 * available from the Open Source Initiative, see
13 * http://www.opensource.org/licenses/bsd-license.php.
14 *
15 * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
16 * copy of which is available from the Open Source Initiative, see
17 * http://www.opensource.org/licenses/gpl-license.php.
18 *
19 * Licensee has the right to choose one of the above licenses.
20 *
21 * Redistributions of source code must retain the above copyright
22 * notice and one of the license notices.
23 *
24 * Redistributions in binary form must reproduce both the above copyright
25 * notice, one of the license notices in the documentation
26 * and/or other materials provided with the distribution.
27 *
28 */
29
30#if !defined(RDMA_CM_H)
31#define RDMA_CM_H
32
33#include <linux/socket.h>
34#include <linux/in6.h>
35#include <rdma/ib_addr.h>
36#include <rdma/ib_sa.h>
37
38/*
39 * Upon receiving a device removal event, users must destroy the associated
40 * RDMA identifier and release all resources allocated with the device.
41 */
42enum rdma_cm_event_type {
43 RDMA_CM_EVENT_ADDR_RESOLVED,
44 RDMA_CM_EVENT_ADDR_ERROR,
45 RDMA_CM_EVENT_ROUTE_RESOLVED,
46 RDMA_CM_EVENT_ROUTE_ERROR,
47 RDMA_CM_EVENT_CONNECT_REQUEST,
48 RDMA_CM_EVENT_CONNECT_RESPONSE,
49 RDMA_CM_EVENT_CONNECT_ERROR,
50 RDMA_CM_EVENT_UNREACHABLE,
51 RDMA_CM_EVENT_REJECTED,
52 RDMA_CM_EVENT_ESTABLISHED,
53 RDMA_CM_EVENT_DISCONNECTED,
54 RDMA_CM_EVENT_DEVICE_REMOVAL,
55};
56
57enum rdma_port_space {
58 RDMA_PS_SDP = 0x0001,
59 RDMA_PS_TCP = 0x0106,
60 RDMA_PS_UDP = 0x0111,
61 RDMA_PS_SCTP = 0x0183
62};
63
64struct rdma_addr {
65 struct sockaddr src_addr;
66 u8 src_pad[sizeof(struct sockaddr_in6) -
67 sizeof(struct sockaddr)];
68 struct sockaddr dst_addr;
69 u8 dst_pad[sizeof(struct sockaddr_in6) -
70 sizeof(struct sockaddr)];
71 struct rdma_dev_addr dev_addr;
72};
73
74struct rdma_route {
75 struct rdma_addr addr;
76 struct ib_sa_path_rec *path_rec;
77 int num_paths;
78};
79
80struct rdma_cm_event {
81 enum rdma_cm_event_type event;
82 int status;
83 void *private_data;
84 u8 private_data_len;
85};
86
87struct rdma_cm_id;
88
89/**
90 * rdma_cm_event_handler - Callback used to report user events.
91 *
92 * Notes: Users may not call rdma_destroy_id from this callback to destroy
93 * the passed in id, or a corresponding listen id. Returning a
94 * non-zero value from the callback will destroy the passed in id.
95 */
96typedef int (*rdma_cm_event_handler)(struct rdma_cm_id *id,
97 struct rdma_cm_event *event);
98
99struct rdma_cm_id {
100 struct ib_device *device;
101 void *context;
102 struct ib_qp *qp;
103 rdma_cm_event_handler event_handler;
104 struct rdma_route route;
105 enum rdma_port_space ps;
106 u8 port_num;
107};
108
109/**
110 * rdma_create_id - Create an RDMA identifier.
111 *
112 * @event_handler: User callback invoked to report events associated with the
113 * returned rdma_id.
114 * @context: User specified context associated with the id.
115 * @ps: RDMA port space.
116 */
117struct rdma_cm_id *rdma_create_id(rdma_cm_event_handler event_handler,
118 void *context, enum rdma_port_space ps);
119
120void rdma_destroy_id(struct rdma_cm_id *id);
121
122/**
123 * rdma_bind_addr - Bind an RDMA identifier to a source address and
124 * associated RDMA device, if needed.
125 *
126 * @id: RDMA identifier.
127 * @addr: Local address information. Wildcard values are permitted.
128 *
129 * This associates a source address with the RDMA identifier before calling
130 * rdma_listen. If a specific local address is given, the RDMA identifier will
131 * be bound to a local RDMA device.
132 */
133int rdma_bind_addr(struct rdma_cm_id *id, struct sockaddr *addr);
134
135/**
136 * rdma_resolve_addr - Resolve destination and optional source addresses
137 * from IP addresses to an RDMA address. If successful, the specified
138 * rdma_cm_id will be bound to a local device.
139 *
140 * @id: RDMA identifier.
141 * @src_addr: Source address information. This parameter may be NULL.
142 * @dst_addr: Destination address information.
143 * @timeout_ms: Time to wait for resolution to complete.
144 */
145int rdma_resolve_addr(struct rdma_cm_id *id, struct sockaddr *src_addr,
146 struct sockaddr *dst_addr, int timeout_ms);
147
148/**
149 * rdma_resolve_route - Resolve the RDMA address bound to the RDMA identifier
150 * into route information needed to establish a connection.
151 *
152 * This is called on the client side of a connection.
153 * Users must have first called rdma_resolve_addr to resolve a dst_addr
154 * into an RDMA address before calling this routine.
155 */
156int rdma_resolve_route(struct rdma_cm_id *id, int timeout_ms);
157
158/**
159 * rdma_create_qp - Allocate a QP and associate it with the specified RDMA
160 * identifier.
161 *
162 * QPs allocated to an rdma_cm_id will automatically be transitioned by the CMA
163 * through their states.
164 */
165int rdma_create_qp(struct rdma_cm_id *id, struct ib_pd *pd,
166 struct ib_qp_init_attr *qp_init_attr);
167
168/**
169 * rdma_destroy_qp - Deallocate the QP associated with the specified RDMA
170 * identifier.
171 *
172 * Users must destroy any QP associated with an RDMA identifier before
173 * destroying the RDMA ID.
174 */
175void rdma_destroy_qp(struct rdma_cm_id *id);
176
177/**
178 * rdma_init_qp_attr - Initializes the QP attributes for use in transitioning
179 * to a specified QP state.
180 * @id: Communication identifier associated with the QP attributes to
181 * initialize.
182 * @qp_attr: On input, specifies the desired QP state. On output, the
183 * mandatory and desired optional attributes will be set in order to
184 * modify the QP to the specified state.
185 * @qp_attr_mask: The QP attribute mask that may be used to transition the
186 * QP to the specified state.
187 *
188 * Users must set the @qp_attr->qp_state to the desired QP state. This call
189 * will set all required attributes for the given transition, along with
190 * known optional attributes. Users may override the attributes returned from
191 * this call before calling ib_modify_qp.
192 *
193 * Users that wish to have their QP automatically transitioned through its
194 * states can associate a QP with the rdma_cm_id by calling rdma_create_qp().
195 */
196int rdma_init_qp_attr(struct rdma_cm_id *id, struct ib_qp_attr *qp_attr,
197 int *qp_attr_mask);
198
199struct rdma_conn_param {
200 const void *private_data;
201 u8 private_data_len;
202 u8 responder_resources;
203 u8 initiator_depth;
204 u8 flow_control;
205 u8 retry_count; /* ignored when accepting */
206 u8 rnr_retry_count;
207 /* Fields below ignored if a QP is created on the rdma_cm_id. */
208 u8 srq;
209 u32 qp_num;
210 enum ib_qp_type qp_type;
211};
212
213/**
214 * rdma_connect - Initiate an active connection request.
215 *
216 * Users must have resolved a route for the rdma_cm_id to connect with
217 * by having called rdma_resolve_route before calling this routine.
218 */
219int rdma_connect(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
220
221/**
222 * rdma_listen - This function is called by the passive side to
223 * listen for incoming connection requests.
224 *
225 * Users must have bound the rdma_cm_id to a local address by calling
226 * rdma_bind_addr before calling this routine.
227 */
228int rdma_listen(struct rdma_cm_id *id, int backlog);
229
230/**
231 * rdma_accept - Called to accept a connection request or response.
232 * @id: Connection identifier associated with the request.
233 * @conn_param: Information needed to establish the connection. This must be
234 * provided if accepting a connection request. If accepting a connection
235 * response, this parameter must be NULL.
236 *
237 * Typically, this routine is only called by the listener to accept a connection
238 * request. It must also be called on the active side of a connection if the
239 * user is performing their own QP transitions.
240 */
241int rdma_accept(struct rdma_cm_id *id, struct rdma_conn_param *conn_param);
242
243/**
244 * rdma_reject - Called to reject a connection request or response.
245 */
246int rdma_reject(struct rdma_cm_id *id, const void *private_data,
247 u8 private_data_len);
248
249/**
250 * rdma_disconnect - This function disconnects the associated QP and
251 * transitions it into the error state.
252 */
253int rdma_disconnect(struct rdma_cm_id *id);
254
255#endif /* RDMA_CM_H */
256
diff --git a/include/rdma/rdma_cm_ib.h b/include/rdma/rdma_cm_ib.h
new file mode 100644
index 000000000000..e8c3af1804d4
--- /dev/null
+++ b/include/rdma/rdma_cm_ib.h
@@ -0,0 +1,47 @@
1/*
2 * Copyright (c) 2006 Intel Corporation. All rights reserved.
3 *
4 * This Software is licensed under one of the following licenses:
5 *
6 * 1) under the terms of the "Common Public License 1.0" a copy of which is
7 * available from the Open Source Initiative, see
8 * http://www.opensource.org/licenses/cpl.php.
9 *
10 * 2) under the terms of the "The BSD License" a copy of which is
11 * available from the Open Source Initiative, see
12 * http://www.opensource.org/licenses/bsd-license.php.
13 *
14 * 3) under the terms of the "GNU General Public License (GPL) Version 2" a
15 * copy of which is available from the Open Source Initiative, see
16 * http://www.opensource.org/licenses/gpl-license.php.
17 *
18 * Licensee has the right to choose one of the above licenses.
19 *
20 * Redistributions of source code must retain the above copyright
21 * notice and one of the license notices.
22 *
23 * Redistributions in binary form must reproduce both the above copyright
24 * notice, one of the license notices in the documentation
25 * and/or other materials provided with the distribution.
26 *
27 */
28
29#if !defined(RDMA_CM_IB_H)
30#define RDMA_CM_IB_H
31
32#include <rdma/rdma_cm.h>
33
34/**
35 * rdma_set_ib_paths - Manually sets the path records used to establish a
36 * connection.
37 * @id: Connection identifier associated with the request.
38 * @path_rec: Reference to the path record
39 *
40 * This call permits a user to specify routing information for rdma_cm_id's
41 * bound to Infiniband devices. It is called on the client side of a
42 * connection and replaces the call to rdma_resolve_route.
43 */
44int rdma_set_ib_paths(struct rdma_cm_id *id,
45 struct ib_sa_path_rec *path_rec, int num_paths);
46
47#endif /* RDMA_CM_IB_H */
diff --git a/include/scsi/srp.h b/include/scsi/srp.h
index 637f77eccf0c..ad178fa78f66 100644
--- a/include/scsi/srp.h
+++ b/include/scsi/srp.h
@@ -87,6 +87,11 @@ enum srp_login_rej_reason {
87 SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED = 0x00010006 87 SRP_LOGIN_REJ_CHANNEL_LIMIT_REACHED = 0x00010006
88}; 88};
89 89
90enum {
91 SRP_REV10_IB_IO_CLASS = 0xff00,
92 SRP_REV16A_IB_IO_CLASS = 0x0100
93};
94
90struct srp_direct_buf { 95struct srp_direct_buf {
91 __be64 va; 96 __be64 va;
92 __be32 key; 97 __be32 key;