aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-m68k/mmzone.h9
-rw-r--r--include/asm-m68k/module.h34
-rw-r--r--include/asm-m68k/motorola_pgtable.h10
-rw-r--r--include/asm-m68k/page.h77
-rw-r--r--include/asm-m68k/pgalloc.h3
-rw-r--r--include/asm-m68k/pgtable.h17
-rw-r--r--include/asm-m68k/sun3_pgtable.h4
-rw-r--r--include/asm-m68k/virtconvert.h49
-rw-r--r--include/asm-sparc64/hypervisor.h168
-rw-r--r--include/linux/ipv6.h3
-rw-r--r--include/linux/netdevice.h27
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/tcp.h6
-rw-r--r--include/net/xfrm.h1
14 files changed, 319 insertions, 91 deletions
diff --git a/include/asm-m68k/mmzone.h b/include/asm-m68k/mmzone.h
new file mode 100644
index 000000000000..e1f1ec7b7006
--- /dev/null
+++ b/include/asm-m68k/mmzone.h
@@ -0,0 +1,9 @@
1#ifndef _ASM_M68K_MMZONE_H_
2#define _ASM_M68K_MMZONE_H_
3
4extern pg_data_t pg_data_map[];
5
6#define NODE_DATA(nid) (&pg_data_map[nid])
7#define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map)
8
9#endif /* _ASM_M68K_MMZONE_H_ */
diff --git a/include/asm-m68k/module.h b/include/asm-m68k/module.h
index c6d75af2d8d3..382d20a6fc18 100644
--- a/include/asm-m68k/module.h
+++ b/include/asm-m68k/module.h
@@ -1,7 +1,39 @@
1#ifndef _ASM_M68K_MODULE_H 1#ifndef _ASM_M68K_MODULE_H
2#define _ASM_M68K_MODULE_H 2#define _ASM_M68K_MODULE_H
3struct mod_arch_specific { }; 3
4struct mod_arch_specific {
5 struct m68k_fixup_info *fixup_start, *fixup_end;
6};
7
8#define MODULE_ARCH_INIT { \
9 .fixup_start = __start_fixup, \
10 .fixup_end = __stop_fixup, \
11}
12
4#define Elf_Shdr Elf32_Shdr 13#define Elf_Shdr Elf32_Shdr
5#define Elf_Sym Elf32_Sym 14#define Elf_Sym Elf32_Sym
6#define Elf_Ehdr Elf32_Ehdr 15#define Elf_Ehdr Elf32_Ehdr
16
17
18enum m68k_fixup_type {
19 m68k_fixup_memoffset,
20 m68k_fixup_vnode_shift,
21};
22
23struct m68k_fixup_info {
24 enum m68k_fixup_type type;
25 void *addr;
26};
27
28#define m68k_fixup(type, addr) \
29 " .section \".m68k_fixup\",\"aw\"\n" \
30 " .long " #type "," #addr "\n" \
31 " .previous\n"
32
33extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];
34
35struct module;
36extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
37 struct m68k_fixup_info *end);
38
7#endif /* _ASM_M68K_MODULE_H */ 39#endif /* _ASM_M68K_MODULE_H */
diff --git a/include/asm-m68k/motorola_pgtable.h b/include/asm-m68k/motorola_pgtable.h
index 61e4406ed96a..b5b78c01eb6c 100644
--- a/include/asm-m68k/motorola_pgtable.h
+++ b/include/asm-m68k/motorola_pgtable.h
@@ -130,7 +130,7 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
130#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROTNONE)) 130#define pte_present(pte) (pte_val(pte) & (_PAGE_PRESENT | _PAGE_PROTNONE))
131#define pte_clear(mm,addr,ptep) ({ pte_val(*(ptep)) = 0; }) 131#define pte_clear(mm,addr,ptep) ({ pte_val(*(ptep)) = 0; })
132 132
133#define pte_page(pte) (mem_map + ((unsigned long)(__va(pte_val(pte)) - PAGE_OFFSET) >> PAGE_SHIFT)) 133#define pte_page(pte) virt_to_page(__va(pte_val(pte)))
134#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) 134#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
135#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) 135#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
136 136
@@ -143,7 +143,7 @@ static inline void pgd_set(pgd_t *pgdp, pmd_t *pmdp)
143 while (--__i >= 0) \ 143 while (--__i >= 0) \
144 *__ptr++ = 0; \ 144 *__ptr++ = 0; \
145}) 145})
146#define pmd_page(pmd) (mem_map + ((unsigned long)(__va(pmd_val(pmd)) - PAGE_OFFSET) >> PAGE_SHIFT)) 146#define pmd_page(pmd) virt_to_page(__va(pmd_val(pmd)))
147 147
148 148
149#define pgd_none(pgd) (!pgd_val(pgd)) 149#define pgd_none(pgd) (!pgd_val(pgd))
@@ -223,10 +223,10 @@ static inline pte_t *pte_offset_kernel(pmd_t *pmdp, unsigned long address)
223 return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)); 223 return (pte_t *)__pmd_page(*pmdp) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1));
224} 224}
225 225
226#define pte_offset_map(pmdp,address) ((pte_t *)kmap(pmd_page(*pmdp)) + ((address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) 226#define pte_offset_map(pmdp,address) ((pte_t *)__pmd_page(*pmdp) + (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)))
227#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address) 227#define pte_offset_map_nested(pmdp, address) pte_offset_map(pmdp, address)
228#define pte_unmap(pte) kunmap(pte) 228#define pte_unmap(pte) ((void)0)
229#define pte_unmap_nested(pte) kunmap(pte) 229#define pte_unmap_nested(pte) ((void)0)
230 230
231/* 231/*
232 * Allocate and free page tables. The xxx_kernel() versions are 232 * Allocate and free page tables. The xxx_kernel() versions are
diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h
index fcc165ddd09e..9e6d0d6debdb 100644
--- a/include/asm-m68k/page.h
+++ b/include/asm-m68k/page.h
@@ -27,6 +27,8 @@
27 27
28#ifndef __ASSEMBLY__ 28#ifndef __ASSEMBLY__
29 29
30#include <asm/module.h>
31
30#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) 32#define get_user_page(vaddr) __get_free_page(GFP_KERNEL)
31#define free_user_page(page, addr) free_page(addr) 33#define free_user_page(page, addr) free_page(addr)
32 34
@@ -114,18 +116,33 @@ typedef struct { unsigned long pgprot; } pgprot_t;
114 116
115#ifndef __ASSEMBLY__ 117#ifndef __ASSEMBLY__
116 118
119extern unsigned long m68k_memoffset;
120
117#ifndef CONFIG_SUN3 121#ifndef CONFIG_SUN3
118 122
119#define WANT_PAGE_VIRTUAL 123#define WANT_PAGE_VIRTUAL
120#ifdef CONFIG_SINGLE_MEMORY_CHUNK
121extern unsigned long m68k_memoffset;
122 124
123#define __pa(vaddr) ((unsigned long)(vaddr)+m68k_memoffset) 125static inline unsigned long ___pa(void *vaddr)
124#define __va(paddr) ((void *)((unsigned long)(paddr)-m68k_memoffset)) 126{
125#else 127 unsigned long paddr;
126#define __pa(vaddr) virt_to_phys((void *)(vaddr)) 128 asm (
127#define __va(paddr) phys_to_virt((unsigned long)(paddr)) 129 "1: addl #0,%0\n"
128#endif 130 m68k_fixup(%c2, 1b+2)
131 : "=r" (paddr)
132 : "0" (vaddr), "i" (m68k_fixup_memoffset));
133 return paddr;
134}
135#define __pa(vaddr) ___pa((void *)(vaddr))
136static inline void *__va(unsigned long paddr)
137{
138 void *vaddr;
139 asm (
140 "1: subl #0,%0\n"
141 m68k_fixup(%c2, 1b+2)
142 : "=r" (vaddr)
143 : "0" (paddr), "i" (m68k_fixup_memoffset));
144 return vaddr;
145}
129 146
130#else /* !CONFIG_SUN3 */ 147#else /* !CONFIG_SUN3 */
131/* This #define is a horrible hack to suppress lots of warnings. --m */ 148/* This #define is a horrible hack to suppress lots of warnings. --m */
@@ -161,11 +178,47 @@ static inline void *__va(unsigned long x)
161#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) 178#define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT)
162#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) 179#define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT)
163 180
164#define virt_to_page(kaddr) (mem_map + (((unsigned long)(kaddr)-PAGE_OFFSET) >> PAGE_SHIFT)) 181extern int m68k_virt_to_node_shift;
165#define page_to_virt(page) ((((page) - mem_map) << PAGE_SHIFT) + PAGE_OFFSET) 182
183#ifdef CONFIG_SINGLE_MEMORY_CHUNK
184#define __virt_to_node(addr) (&pg_data_map[0])
185#else
186extern struct pglist_data *pg_data_table[];
187
188static inline __attribute_const__ int __virt_to_node_shift(void)
189{
190 int shift;
191
192 asm (
193 "1: moveq #0,%0\n"
194 m68k_fixup(%c1, 1b)
195 : "=d" (shift)
196 : "i" (m68k_fixup_vnode_shift));
197 return shift;
198}
199
200#define __virt_to_node(addr) (pg_data_table[(unsigned long)(addr) >> __virt_to_node_shift()])
201#endif
166 202
167#define pfn_to_page(pfn) virt_to_page(pfn_to_virt(pfn)) 203#define virt_to_page(addr) ({ \
168#define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) 204 pfn_to_page(virt_to_pfn(addr)); \
205})
206#define page_to_virt(page) ({ \
207 pfn_to_virt(page_to_pfn(page)); \
208})
209
210#define pfn_to_page(pfn) ({ \
211 unsigned long __pfn = (pfn); \
212 struct pglist_data *pgdat; \
213 pgdat = __virt_to_node((unsigned long)pfn_to_virt(__pfn)); \
214 pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn); \
215})
216#define page_to_pfn(_page) ({ \
217 struct page *__p = (_page); \
218 struct pglist_data *pgdat; \
219 pgdat = &pg_data_map[page_to_nid(__p)]; \
220 ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \
221})
169 222
170#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory) 223#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
171#define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn)) 224#define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn))
diff --git a/include/asm-m68k/pgalloc.h b/include/asm-m68k/pgalloc.h
index a9cfb4b99d88..4cb1a57ab763 100644
--- a/include/asm-m68k/pgalloc.h
+++ b/include/asm-m68k/pgalloc.h
@@ -8,11 +8,12 @@
8#include <asm/virtconvert.h> 8#include <asm/virtconvert.h>
9 9
10 10
11
12#ifdef CONFIG_SUN3 11#ifdef CONFIG_SUN3
13#include <asm/sun3_pgalloc.h> 12#include <asm/sun3_pgalloc.h>
14#else 13#else
15#include <asm/motorola_pgalloc.h> 14#include <asm/motorola_pgalloc.h>
16#endif 15#endif
17 16
17extern void m68k_setup_node(int node);
18
18#endif /* M68K_PGALLOC_H */ 19#endif /* M68K_PGALLOC_H */
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index 555b87a1f7e3..778a4c538eb2 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -107,22 +107,7 @@ extern void *empty_zero_page;
107/* 64-bit machines, beware! SRB. */ 107/* 64-bit machines, beware! SRB. */
108#define SIZEOF_PTR_LOG2 2 108#define SIZEOF_PTR_LOG2 2
109 109
110/* 110#define mm_end_of_chunk(addr, len) 0
111 * Check if the addr/len goes up to the end of a physical
112 * memory chunk. Used for DMA functions.
113 */
114#ifdef CONFIG_SINGLE_MEMORY_CHUNK
115/*
116 * It makes no sense to consider whether we cross a memory boundary if
117 * we support just one physical chunk of memory.
118 */
119static inline int mm_end_of_chunk(unsigned long addr, int len)
120{
121 return 0;
122}
123#else
124int mm_end_of_chunk (unsigned long addr, int len);
125#endif
126 111
127extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode); 112extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
128 113
diff --git a/include/asm-m68k/sun3_pgtable.h b/include/asm-m68k/sun3_pgtable.h
index 5156a28a18d8..b9e62c1e7ae3 100644
--- a/include/asm-m68k/sun3_pgtable.h
+++ b/include/asm-m68k/sun3_pgtable.h
@@ -132,8 +132,8 @@ static inline void pte_clear (struct mm_struct *mm, unsigned long addr, pte_t *p
132#define pfn_pte(pfn, pgprot) \ 132#define pfn_pte(pfn, pgprot) \
133({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; }) 133({ pte_t __pte; pte_val(__pte) = pfn | pgprot_val(pgprot); __pte; })
134 134
135#define pte_page(pte) (mem_map+((__pte_page(pte) - PAGE_OFFSET) >> PAGE_SHIFT)) 135#define pte_page(pte) virt_to_page(__pte_page(pte))
136#define pmd_page(pmd) (mem_map+((__pmd_page(pmd) - PAGE_OFFSET) >> PAGE_SHIFT)) 136#define pmd_page(pmd) virt_to_page(__pmd_page(pmd))
137 137
138 138
139static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); } 139static inline int pmd_none2 (pmd_t *pmd) { return !pmd_val (*pmd); }
diff --git a/include/asm-m68k/virtconvert.h b/include/asm-m68k/virtconvert.h
index 83a87c9b1a16..dea32fbc7e51 100644
--- a/include/asm-m68k/virtconvert.h
+++ b/include/asm-m68k/virtconvert.h
@@ -8,56 +8,35 @@
8#ifdef __KERNEL__ 8#ifdef __KERNEL__
9 9
10#include <linux/compiler.h> 10#include <linux/compiler.h>
11#include <linux/mmzone.h>
11#include <asm/setup.h> 12#include <asm/setup.h>
12#include <asm/page.h> 13#include <asm/page.h>
13 14
14#ifdef CONFIG_AMIGA
15#include <asm/amigahw.h>
16#endif
17
18/* 15/*
19 * Change virtual addresses to physical addresses and vv. 16 * Change virtual addresses to physical addresses and vv.
20 */ 17 */
21#ifndef CONFIG_SUN3
22extern unsigned long mm_vtop(unsigned long addr) __attribute_const__;
23extern unsigned long mm_ptov(unsigned long addr) __attribute_const__;
24#else
25static inline unsigned long mm_vtop(unsigned long vaddr)
26{
27 return __pa(vaddr);
28}
29
30static inline unsigned long mm_ptov(unsigned long paddr)
31{
32 return (unsigned long)__va(paddr);
33}
34#endif
35
36#ifdef CONFIG_SINGLE_MEMORY_CHUNK
37static inline unsigned long virt_to_phys(void *vaddr)
38{
39 return (unsigned long)vaddr - PAGE_OFFSET + m68k_memory[0].addr;
40}
41
42static inline void * phys_to_virt(unsigned long paddr)
43{
44 return (void *)(paddr - m68k_memory[0].addr + PAGE_OFFSET);
45}
46#else
47static inline unsigned long virt_to_phys(void *address) 18static inline unsigned long virt_to_phys(void *address)
48{ 19{
49 return mm_vtop((unsigned long)address); 20 return __pa(address);
50} 21}
51 22
52static inline void *phys_to_virt(unsigned long address) 23static inline void *phys_to_virt(unsigned long address)
53{ 24{
54 return (void *) mm_ptov(address); 25 return __va(address);
55} 26}
56#endif
57 27
58/* Permanent address of a page. */ 28/* Permanent address of a page. */
59#define __page_address(page) (PAGE_OFFSET + (((page) - mem_map) << PAGE_SHIFT)) 29#ifdef CONFIG_SINGLE_MEMORY_CHUNK
60#define page_to_phys(page) virt_to_phys((void *)__page_address(page)) 30#define page_to_phys(page) \
31 __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
32#else
33#define page_to_phys(_page) ({ \
34 struct page *__page = _page; \
35 struct pglist_data *pgdat; \
36 pgdat = pg_data_table[page_to_nid(__page)]; \
37 page_to_pfn(__page) << PAGE_SHIFT; \
38})
39#endif
61 40
62/* 41/*
63 * IO bus memory addresses are 1:1 with the physical address, 42 * IO bus memory addresses are 1:1 with the physical address,
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h
index 5cdb1ff04838..4a43075a0619 100644
--- a/include/asm-sparc64/hypervisor.h
+++ b/include/asm-sparc64/hypervisor.h
@@ -1097,6 +1097,80 @@ extern unsigned long sun4v_mach_set_soft_state(unsigned long soft_state,
1097 */ 1097 */
1098#define HV_FAST_MACH_GET_SOFT_STATE 0x71 1098#define HV_FAST_MACH_GET_SOFT_STATE 0x71
1099 1099
1100/* svc_send()
1101 * TRAP: HV_FAST_TRAP
1102 * FUNCTION: HV_FAST_SVC_SEND
1103 * ARG0: service ID
1104 * ARG1: buffer real address
1105 * ARG2: buffer size
1106 * RET0: STATUS
1107 * RET1: sent_bytes
1108 *
1109 * Be careful, all output registers are clobbered by this operation,
1110 * so for example it is not possible to save away a value in %o4
1111 * across the trap.
1112 */
1113#define HV_FAST_SVC_SEND 0x80
1114
1115/* svc_recv()
1116 * TRAP: HV_FAST_TRAP
1117 * FUNCTION: HV_FAST_SVC_RECV
1118 * ARG0: service ID
1119 * ARG1: buffer real address
1120 * ARG2: buffer size
1121 * RET0: STATUS
1122 * RET1: recv_bytes
1123 *
1124 * Be careful, all output registers are clobbered by this operation,
1125 * so for example it is not possible to save away a value in %o4
1126 * across the trap.
1127 */
1128#define HV_FAST_SVC_RECV 0x81
1129
1130/* svc_getstatus()
1131 * TRAP: HV_FAST_TRAP
1132 * FUNCTION: HV_FAST_SVC_GETSTATUS
1133 * ARG0: service ID
1134 * RET0: STATUS
1135 * RET1: status bits
1136 */
1137#define HV_FAST_SVC_GETSTATUS 0x82
1138
1139/* svc_setstatus()
1140 * TRAP: HV_FAST_TRAP
1141 * FUNCTION: HV_FAST_SVC_SETSTATUS
1142 * ARG0: service ID
1143 * ARG1: bits to set
1144 * RET0: STATUS
1145 */
1146#define HV_FAST_SVC_SETSTATUS 0x83
1147
1148/* svc_clrstatus()
1149 * TRAP: HV_FAST_TRAP
1150 * FUNCTION: HV_FAST_SVC_CLRSTATUS
1151 * ARG0: service ID
1152 * ARG1: bits to clear
1153 * RET0: STATUS
1154 */
1155#define HV_FAST_SVC_CLRSTATUS 0x84
1156
1157#ifndef __ASSEMBLY__
1158extern unsigned long sun4v_svc_send(unsigned long svc_id,
1159 unsigned long buffer,
1160 unsigned long buffer_size,
1161 unsigned long *sent_bytes);
1162extern unsigned long sun4v_svc_recv(unsigned long svc_id,
1163 unsigned long buffer,
1164 unsigned long buffer_size,
1165 unsigned long *recv_bytes);
1166extern unsigned long sun4v_svc_getstatus(unsigned long svc_id,
1167 unsigned long *status_bits);
1168extern unsigned long sun4v_svc_setstatus(unsigned long svc_id,
1169 unsigned long status_bits);
1170extern unsigned long sun4v_svc_clrstatus(unsigned long svc_id,
1171 unsigned long status_bits);
1172#endif
1173
1100/* Trap trace services. 1174/* Trap trace services.
1101 * 1175 *
1102 * The hypervisor provides a trap tracing capability for privileged 1176 * The hypervisor provides a trap tracing capability for privileged
@@ -2724,6 +2798,100 @@ struct hv_mmu_statistics {
2724 */ 2798 */
2725#define HV_FAST_MMUSTAT_INFO 0x103 2799#define HV_FAST_MMUSTAT_INFO 0x103
2726 2800
2801/* NCS crypto services */
2802
2803/* ncs_request() sub-function numbers */
2804#define HV_NCS_QCONF 0x01
2805#define HV_NCS_QTAIL_UPDATE 0x02
2806
2807#ifndef __ASSEMBLY__
2808struct hv_ncs_queue_entry {
2809 /* MAU Control Register */
2810 unsigned long mau_control;
2811#define MAU_CONTROL_INV_PARITY 0x0000000000002000
2812#define MAU_CONTROL_STRAND 0x0000000000001800
2813#define MAU_CONTROL_BUSY 0x0000000000000400
2814#define MAU_CONTROL_INT 0x0000000000000200
2815#define MAU_CONTROL_OP 0x00000000000001c0
2816#define MAU_CONTROL_OP_SHIFT 6
2817#define MAU_OP_LOAD_MA_MEMORY 0x0
2818#define MAU_OP_STORE_MA_MEMORY 0x1
2819#define MAU_OP_MODULAR_MULT 0x2
2820#define MAU_OP_MODULAR_REDUCE 0x3
2821#define MAU_OP_MODULAR_EXP_LOOP 0x4
2822#define MAU_CONTROL_LEN 0x000000000000003f
2823#define MAU_CONTROL_LEN_SHIFT 0
2824
2825 /* Real address of bytes to load or store bytes
2826 * into/out-of the MAU.
2827 */
2828 unsigned long mau_mpa;
2829
2830 /* Modular Arithmetic MA Offset Register. */
2831 unsigned long mau_ma;
2832
2833 /* Modular Arithmetic N Prime Register. */
2834 unsigned long mau_np;
2835};
2836
2837struct hv_ncs_qconf_arg {
2838 unsigned long mid; /* MAU ID, 1 per core on Niagara */
2839 unsigned long base; /* Real address base of queue */
2840 unsigned long end; /* Real address end of queue */
2841 unsigned long num_ents; /* Number of entries in queue */
2842};
2843
2844struct hv_ncs_qtail_update_arg {
2845 unsigned long mid; /* MAU ID, 1 per core on Niagara */
2846 unsigned long tail; /* New tail index to use */
2847 unsigned long syncflag; /* only SYNCFLAG_SYNC is implemented */
2848#define HV_NCS_SYNCFLAG_SYNC 0x00
2849#define HV_NCS_SYNCFLAG_ASYNC 0x01
2850};
2851#endif
2852
2853/* ncs_request()
2854 * TRAP: HV_FAST_TRAP
2855 * FUNCTION: HV_FAST_NCS_REQUEST
2856 * ARG0: NCS sub-function
2857 * ARG1: sub-function argument real address
2858 * ARG2: size in bytes of sub-function argument
2859 * RET0: status
2860 *
2861 * The MAU chip of the Niagara processor is not directly accessible
2862 * to privileged code, instead it is programmed indirectly via this
2863 * hypervisor API.
2864 *
2865 * The interfaces defines a queue of MAU operations to perform.
2866 * Privileged code registers a queue with the hypervisor by invoking
2867 * this HVAPI with the HV_NCS_QCONF sub-function, which defines the
2868 * base, end, and number of entries of the queue. Each queue entry
2869 * contains a MAU register struct block.
2870 *
2871 * The privileged code then proceeds to add entries to the queue and
2872 * then invoke the HV_NCS_QTAIL_UPDATE sub-function. Since only
2873 * synchronous operations are supported by the current hypervisor,
2874 * HV_NCS_QTAIL_UPDATE will run all the pending queue entries to
2875 * completion and return HV_EOK, or return an error code.
2876 *
2877 * The real address of the sub-function argument must be aligned on at
2878 * least an 8-byte boundary.
2879 *
2880 * The tail argument of HV_NCS_QTAIL_UPDATE is an index, not a byte
2881 * offset, into the queue and must be less than or equal the 'num_ents'
2882 * argument given in the HV_NCS_QCONF call.
2883 */
2884#define HV_FAST_NCS_REQUEST 0x110
2885
2886#ifndef __ASSEMBLY__
2887extern unsigned long sun4v_ncs_request(unsigned long request,
2888 unsigned long arg_ra,
2889 unsigned long arg_size);
2890#endif
2891
2892#define HV_FAST_FIRE_GET_PERFREG 0x120
2893#define HV_FAST_FIRE_SET_PERFREG 0x121
2894
2727/* Function numbers for HV_CORE_TRAP. */ 2895/* Function numbers for HV_CORE_TRAP. */
2728#define HV_CORE_SET_VER 0x00 2896#define HV_CORE_SET_VER 0x00
2729#define HV_CORE_PUTCHAR 0x01 2897#define HV_CORE_PUTCHAR 0x01
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 09ea01a8a99c..648bd1f0912d 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -209,9 +209,8 @@ enum {
209 DEVCONF_RTR_PROBE_INTERVAL, 209 DEVCONF_RTR_PROBE_INTERVAL,
210 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, 210 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
211 DEVCONF_PROXY_NDP, 211 DEVCONF_PROXY_NDP,
212 __DEVCONF_OPTIMISTIC_DAD,
213 DEVCONF_ACCEPT_SOURCE_ROUTE,
214 DEVCONF_OPTIMISTIC_DAD, 212 DEVCONF_OPTIMISTIC_DAD,
213 DEVCONF_ACCEPT_SOURCE_ROUTE,
215 DEVCONF_MAX 214 DEVCONF_MAX
216}; 215};
217 216
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f671cd2f133f..3a70f553b28f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -910,6 +910,17 @@ static inline int netif_rx_reschedule(struct net_device *dev, int undo)
910 return 0; 910 return 0;
911} 911}
912 912
913/* same as netif_rx_complete, except that local_irq_save(flags)
914 * has already been issued
915 */
916static inline void __netif_rx_complete(struct net_device *dev)
917{
918 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
919 list_del(&dev->poll_list);
920 smp_mb__before_clear_bit();
921 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
922}
923
913/* Remove interface from poll list: it must be in the poll list 924/* Remove interface from poll list: it must be in the poll list
914 * on current cpu. This primitive is called by dev->poll(), when 925 * on current cpu. This primitive is called by dev->poll(), when
915 * it completes the work. The device cannot be out of poll list at this 926 * it completes the work. The device cannot be out of poll list at this
@@ -920,10 +931,7 @@ static inline void netif_rx_complete(struct net_device *dev)
920 unsigned long flags; 931 unsigned long flags;
921 932
922 local_irq_save(flags); 933 local_irq_save(flags);
923 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state)); 934 __netif_rx_complete(dev);
924 list_del(&dev->poll_list);
925 smp_mb__before_clear_bit();
926 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
927 local_irq_restore(flags); 935 local_irq_restore(flags);
928} 936}
929 937
@@ -940,17 +948,6 @@ static inline void netif_poll_enable(struct net_device *dev)
940 clear_bit(__LINK_STATE_RX_SCHED, &dev->state); 948 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
941} 949}
942 950
943/* same as netif_rx_complete, except that local_irq_save(flags)
944 * has already been issued
945 */
946static inline void __netif_rx_complete(struct net_device *dev)
947{
948 BUG_ON(!test_bit(__LINK_STATE_RX_SCHED, &dev->state));
949 list_del(&dev->poll_list);
950 smp_mb__before_clear_bit();
951 clear_bit(__LINK_STATE_RX_SCHED, &dev->state);
952}
953
954static inline void netif_tx_lock(struct net_device *dev) 951static inline void netif_tx_lock(struct net_device *dev)
955{ 952{
956 spin_lock(&dev->_xmit_lock); 953 spin_lock(&dev->_xmit_lock);
diff --git a/include/net/sock.h b/include/net/sock.h
index 689b886038da..dfeb8b13024f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -218,13 +218,13 @@ struct sock {
218 atomic_t sk_rmem_alloc; 218 atomic_t sk_rmem_alloc;
219 atomic_t sk_wmem_alloc; 219 atomic_t sk_wmem_alloc;
220 atomic_t sk_omem_alloc; 220 atomic_t sk_omem_alloc;
221 int sk_sndbuf;
221 struct sk_buff_head sk_receive_queue; 222 struct sk_buff_head sk_receive_queue;
222 struct sk_buff_head sk_write_queue; 223 struct sk_buff_head sk_write_queue;
223 struct sk_buff_head sk_async_wait_queue; 224 struct sk_buff_head sk_async_wait_queue;
224 int sk_wmem_queued; 225 int sk_wmem_queued;
225 int sk_forward_alloc; 226 int sk_forward_alloc;
226 gfp_t sk_allocation; 227 gfp_t sk_allocation;
227 int sk_sndbuf;
228 int sk_route_caps; 228 int sk_route_caps;
229 int sk_gso_type; 229 int sk_gso_type;
230 int sk_rcvlowat; 230 int sk_rcvlowat;
diff --git a/include/net/tcp.h b/include/net/tcp.h
index e22b4f0305a3..a8af9ae00177 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -254,6 +254,12 @@ static inline int between(__u32 seq1, __u32 seq2, __u32 seq3)
254 return seq3 - seq2 >= seq1 - seq2; 254 return seq3 - seq2 >= seq1 - seq2;
255} 255}
256 256
257static inline int tcp_too_many_orphans(struct sock *sk, int num)
258{
259 return (num > sysctl_tcp_max_orphans) ||
260 (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
261 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]);
262}
257 263
258extern struct proto tcp_prot; 264extern struct proto tcp_prot;
259 265
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 39ef925d39dd..90185e8b335e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -237,7 +237,6 @@ extern int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo);
237extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo); 237extern int xfrm_policy_unregister_afinfo(struct xfrm_policy_afinfo *afinfo);
238extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c); 238extern void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c);
239extern void km_state_notify(struct xfrm_state *x, struct km_event *c); 239extern void km_state_notify(struct xfrm_state *x, struct km_event *c);
240#define XFRM_ACQ_EXPIRES 30
241 240
242struct xfrm_tmpl; 241struct xfrm_tmpl;
243extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol); 242extern int km_query(struct xfrm_state *x, struct xfrm_tmpl *t, struct xfrm_policy *pol);